Fix bug #10159 with crashes in auto-complete package.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-22 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
4 the new overlay string. (Bug#10159)
5
6 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
7
8 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
9 or that fprintf is async-signal-safe. POSIX doesn't require
10 either assumption.
11
12 2012-09-22 Chong Yidong <cyd@gnu.org>
13
14 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
15 (Bug#8207).
16
17 2012-09-22 Kenichi Handa <handa@gnu.org>
18
19 * composite.c (composition_reseat_it): Handle the case that a
20 grapheme cluster is not covered by a single font (Bug#12352).
21
22 2012-09-21 Chong Yidong <cyd@gnu.org>
23
24 * image.c (define_image_type): Avoid adding duplicate types to
25 image_types (Bug#12463). Suggested by Jörg Walter.
26
27 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
28
29 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
30 (print_load_command_name): Add case LC_DATA_IN_CODE.
31 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
32
33 2012-09-21 Glenn Morris <rgm@gnu.org>
34
35 * eval.c (Frun_hook_with_args_until_success)
36 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
37
38 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
39
40 * fileio.c (Ffile_selinux_context): Only call freecon when
41 lgetfilecon succeeded.
42 (Fset_file_selinux_context): Likewise. (Bug#12444)
43
44 2012-09-21 Eli Zaretskii <eliz@gnu.org>
45
46 * xdisp.c (try_window_reusing_current_matrix): Under bidi
47 reordering, locate the cursor by calling set_cursor_from_row; if
48 that fails, clear the desired glyph matrix before returning a
49 failure indication to the caller. Fixes leaving garbled display
50 when fast scrolling with a down-key. (Bug#12403)
51 (compute_stop_pos_backwards): Fix a typo that caused crashes while
52 scrolling through multibyte text.
53
54 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
55
56 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
57 calling mark_vectorlike since that's the one that marks the window.
58 (mark_discard_killed_buffers): Mark the final cdr.
59 * window.h (struct window): Move prev/next_buffers to the
60 non-standard fields.
61 * window.c (make_window): Initialize prev/next_buffers manually.
62
63 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
64
65 Omit unused arg EXPECTED from socket hooks.
66 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
67 * nsterm.m (ns_term_init):
68 * termhooks.h (struct terminal.read_socket_hook):
69 * w32inevt.c (w32_console_read_socket):
70 * w32term.c (w32_read_socket):
71 * xterm.c (XTread_socket):
72 Omit unused arg EXPECTED. All callers changed.
73 (store_user_signal_events): Return void, not int, since callers no
74 longer care about the return value. All uses changed.
75
76 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
77
78 * w32gui.h (XParseGeometry): Do not declare.
79
80 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
81
82 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
83 Ignore 'expected'. See Eli Zaretskii in
84 <http://bugs.gnu.org/12471#8> (last line).
85
86 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
87 (XParseGeometry): Now static. Substitute extremal values for
88 values that are out of range.
89
90 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
91
92 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
93
94 * nsfns.m (XParseGeometry): Remove.
95 (Fx_create_frame): Call x_set_offset to correctly interpret
96 top_pos in geometry.
97
98 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
99 (Fx_parse_geometry): If there is a space in string, call
100 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
101
102 2012-09-17 Eli Zaretskii <eliz@gnu.org>
103
104 * search.c (scan_buffer): Use character positions in calls to
105 region_cache_forward and region_cache_backward, not byte
106 positions. (Bug#12196)
107
108 * w32term.c (w32_read_socket): Set pending_signals to 1, like
109 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
110
111 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
112 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
113 emacs_blocked_malloc, now deleted.
114
115 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
116
117 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
118 The workaround was for improving performance on Solaris 2.4, but
119 is getting in the way now. Emacs will still work if someone is
120 still running Solaris 2.4 in a museum somewhere; Sun dropped
121 support for Solaris 2.4 in 2003.
122 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
123 * process.c (create_process) [HAVE_WORKING_VFORK]:
124 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
125 since Emacs no longer uses vfork on that platform.
126
127 2012-09-17 Glenn Morris <rgm@gnu.org>
128
129 * emacs.c: Use COPYRIGHT.
130
131 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
132
133 Remove configure's --without-sync-input option (Bug#12450).
134 When auditing signal-handling in preparation for cleaning it up,
135 I found that SYNC_INPUT has race conditions and would be a real
136 pain to fix. Since it's an undocumented and deprecated
137 configure-time option, now seems like a good time to remove it.
138 Also see <http://bugs.gnu.org/11080#16>.
139 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
140 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
141 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
142 (malloc_hysteresis):
143 (check_depth) [XMALLOC_OVERRUN_CHECK]:
144 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
145 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
146 (dont_register_blocks, bytes_used_when_reconsidered)
147 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
148 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
149 [!SYSTEM_MALLOC && !SYNC_INPUT]:
150 Remove. All uses removed.
151 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
152 implementation, one that depends on whether the new macro
153 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
154 is defined.
155 * atimer.c (run_timers, handle_alarm_signal):
156 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
157 (handle_async_input, process_pending_signals)
158 (handle_input_available_signal, init_keyboard):
159 * nsterm.m (ns_read_socket):
160 * process.c (wait_reading_process_output):
161 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
162 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
163 (emacs_write):
164 * xterm.c (XTread_socket):
165 Assume SYNC_INPUT.
166 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
167 * eval.c (handling_signal): Remove. All uses removed.
168 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
169 All uses replaced with the SYNC_INPUT version.
170 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
171 Remove decls.
172 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
173 Now static.
174
175 * font.c (Ffont_shape_gstring): Remove unused local.
176
177 2012-09-16 Glenn Morris <rgm@gnu.org>
178
179 * Makefile.in (clean): No longer run nextstep's clean.
180
181 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
182 (ns_frag): Remove.
183 (ns-app): Move here from ns.mk, and simplify.
184 (clean): Simplify nextstep entry.
185 * ns.mk: Remove file.
186
187 2012-09-17 Kenichi Handa <handa@gnu.org>
188
189 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
190 not covert the last few charactes.
191
192 2012-09-16 Kenichi Handa <handa@gnu.org>
193
194 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
195 here, but just check the validity of glyphs in the glyph-string.
196
197 2012-09-16 Martin Rudalics <rudalics@gmx.at>
198
199 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
200 any window as argument (Bug#12452).
201
202 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
203
204 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
205 to ns_term_init to avoid memory leak.
206
207 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
208 explicit retain/release.
209 (ns_term_init): Only allow one display. Initialize outerpool and
210 ns_*_types.
211
212 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
213
214 Port _setjmp fix to POSIXish hosts as well as Microsoft.
215 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
216 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
217 the Microsoft problem in a different way, by altering ../nt/config.nt.
218
219 2012-09-15 Eli Zaretskii <eliz@gnu.org>
220
221 * w32xfns.c:
222 * w32uniscribe.c:
223 * w32term.c:
224 * w32select.c:
225 * w32reg.c:
226 * w32proc.c:
227 * w32menu.c:
228 * w32inevt.c:
229 * w32heap.c:
230 * w32font.c:
231 * w32fns.c:
232 * w32console.c:
233 * w32.c:
234 * w16select.c: Remove inclusion of setjmp.h, as it is now included
235 by lisp.h. This completes removal of setjmp.h inclusion
236 erroneously announced in the previous commit. (Bug#12446)
237
238 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
239 more accurate.
240
241 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
242 not defined as a macro. The latter happens on MS-Windows.
243 (Bug#12446)
244
245 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
246
247 Port better to POSIX hosts lacking _setjmp (Bug#12446).
248 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
249 Some instances of '#include <setjmp.h>' removed, if the
250 only reason for the instance was because "lisp.h" was included.
251 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
252 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
253 and _longjmp with the new symbols. Emacs already uses _setjmp if
254 available, so this change affects only POSIXish hosts that have
255 sigsetjmp but not _setjmp, such as some versions of Solaris and
256 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
257 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
258 (png_load_body) [HAVE_PNG]:
259 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
260 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
261 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
262 since PNG requires jmp_buf. This is the only exception to the
263 general rule that we now use sys_setjmp and sys_longjmp.
264 This exception is OK since this code does not change the signal
265 mask or longjmp out of a signal handler.
266
267 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
268
269 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
270 Include "syssignal.h", for 'main_thread'.
271
272 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
273
274 Avoid out-of-range marker position (Bug#12426).
275 * insdel.c (replace_range, replace_range_2): Adjust
276 markers before overlays, as suggested by comments.
277 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
278 Remove redundant check before calling offset_intervals.
279
280 2012-09-14 Martin Rudalics <rudalics@gmx.at>
281
282 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
283 current buffer (Bug#12387).
284
285 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
286
287 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
288
289 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
290
291 Use a more backwards-compatible timer format (Bug#12430).
292 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
293 vector element, not from the 4th, since PSECS is now at the end.
294 (Fcurrent_idle_time): Doc fix.
295
296 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
297
298 Function to mark objects and remove killed buffers at once.
299 * alloc.c (discard_killed_buffers): Rename to ...
300 (mark_discard_killed buffers) ... new name. Add marking
301 of remaining objects. Fix comment. Adjust users.
302 (mark_object): Do not touch frame buffer lists here.
303 * frame.c (delete_frame): Reset frame buffer lists here.
304
305 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
306
307 Better workaround for GNOME bug when --enable-gcc-warnings.
308 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
309 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
310 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
311
312 Simplify SIGIO usage (Bug#12408).
313 The code that dealt with SIGIO was crufty and confusing, e.g., it
314 played tricks like "#undef SIGIO" but these tricks were not used
315 consistently. Simplify mostly by not #undeffing standard symbols,
316 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
317 or not as we please) rather than "defined SIGIO" (standard symbol
318 that we probably shouldn't #undef).
319 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
320 Modules that need it can include it.
321 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
322 * dispextern.h (ignore_sigio): New decl.
323 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
324 unconditionally, since it's now a no-op if !USABLE_SIGIO.
325 * emacs.c (shut_down_emacs):
326 * keyboard.c (kbd_buffer_store_event_hold):
327 Use ignore_sigio rather than invoking 'signal' directly.
328 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
329 for FIONREAD.
330 (FIONREAD, SIGIO): Do not #undef.
331 (tty_read_avail_input): Use #error rather than a syntax error.
332 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
333 for I_PIPE, used by SETUP_SLAVE_PTY.
334 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
335 * sysdep.c (croak): Remove; no longer needed. This bit of
336 temporary code, with Fred N. Fish's comment that it's temporary,
337 has been in Emacs since at least 1992!
338 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
339 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
340 * syssignal.h (croak): Remove decl.
341 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
342 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
343 now that we're termios-only.
344 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
345 * term.c (dissociate_if_controlling_tty): Use #error rather than
346 a run-time error.
347
348 Work around GCC and GNOME bugs when --enable-gcc-warnings.
349 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
350 to work around GNOME bug 683906.
351 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
352 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
353 This works around GCC bug 54561.
354
355 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
356
357 More fixes for 'volatile' and setjmp/longjmp.
358 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
359 * image.c (struct png_load_context) [HAVE_PNG]: New type.
360 (png_load_body) [HAVE_PNG]:
361 (jpeg_load_body) [HAVE_JPEG]:
362 New function, with most of the old parent function's body.
363 (png_load) [HAVE_PNG]:
364 (jpeg_load) [HAVE_JPEG]:
365 Invoke the new function, to avoid longjmp munging our locals.
366 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
367 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
368 longjmp is passed 2, as the C standard doesn't guarantee this.
369 Instead, store the failure code into mgr->failure_code.
370
371 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
372
373 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
374 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
375 (syms_of_keyboard): Remove support for unread-command-char.
376
377 2012-09-12 Eli Zaretskii <eliz@gnu.org>
378
379 * w32proc.c (sys_kill): If PID is our process ID and the signal is
380 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
381 violation. (Bug#12426)
382
383 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
384
385 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
386
387 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
388
389 * eval.c: Add `inhibit-debugger'.
390 (Qinhibit_debugger): New symbol.
391 (call_debugger): Bind it instead of Qdebug_on_error.
392 (maybe_call_debugger): Test Vinhibit_debugger.
393 (syms_of_eval): Define inhibit-debugger.
394 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
395 (syms_of_xdisp): Remove inhibit-debug-on-message.
396
397 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
398
399 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
400 If a nonvolatile local variable is written before a _longjmp to
401 the frame containing the variable, and is read after the _longjmp,
402 the value read is indeterminate. Some local variables of type
403 'struct handler' and 'struct catchtag' are used in this way, so
404 mark each of their slots as volatile if the slot can be set before
405 _longjmp and read afterwards.
406 * lisp.h (struct handler): var and chosen_clause are now volatile.
407 (struct catchtag): val, next, and pdlcount are now volatile.
408
409 * bidi.c (bidi_push_it, bidi_pop_it):
410 * fns.c (copy_hash_table):
411 * image.c (define_image_type):
412 * keyboard.c (kbd_buffer_store_event_hold):
413 * process.c (Fprocess_send_eof):
414 * xfaces.c (x_create_gc) [HAVE_NS]:
415 * xgselect.c (xg_select):
416 Prefer assignment to memcpy when either will do.
417
418 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
419 Use pointer-to-a-pointer to simplify and avoid a NILP check each
420 time an item is removed. No need to mark this function 'inline';
421 the compiler knows better than we do.
422
423 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
424
425 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
426 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
427 to change_frame_size (Bug#12388).
428 (windowDidResize:): Pass YES to updateFrameSize.
429
430 * nsterm.h: Add delay parameter to updateFrameSize.
431
432 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
433
434 Discard killed buffers from deleted window and frame objects.
435 This reduces an amount of references to killed buffers and
436 helps GC to reclaim them faster.
437 * alloc.c (discard_killed_buffers): New function.
438 (mark_object): Use it for deleted windows and frames.
439 (mark_object): If symbol's value is set up for a killed buffer
440 or deleted frame, restore it's global binding.
441 * data.c (swap_in_global_binding): Add GC notice.
442 (swap_in_symval_forwarding): Use convenient set_blv_where.
443 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
444 * window.h: ... to here.
445
446 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
447
448 Convenient macro to check whether the buffer is live.
449 * buffer.h (BUFFER_LIVE_P): New macro.
450 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
451 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
452
453 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
454
455 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
456 composition cases (Bug#12364).
457
458 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
459 overhang of succeeding glyphs overlapping box cursor.
460
461 * w32term.c (x_draw_glyph_string): Likewise.
462
463 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
464
465 Simplify, document, and port floating-point (Bug#12381).
466 The porting part of this patch fixes bugs on non-IEEE platforms
467 with frexp, ldexp, logb.
468 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
469 Now static.
470 * floatfns.c: Simplify discussion of functions that Emacs doesn't
471 support, by removing commented-out code and briefly listing the
472 C89 functions excluded. The commented-out stuff was confusing
473 maintenance, e.g., we thought we needed cbrt but it was commented out.
474 (logb): Remove decl; no longer needed.
475 (isfinite): New macro, if not already supplied.
476 (isnan): Don't replace any existing macro.
477 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
478 are present on all C89 platforms.
479 (Ffrexp): Do not special-case zero, as frexp does the right thing
480 for that case.
481 (Flogb): Do not use logb, as it doesn't have the desired meaning
482 on hosts that use non-base-2 floating point. Instead, stick with
483 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
484 frexp, to avoid getting an unspecified result.
485
486 * xdisp.c (Qinhibit_debug_on_message): Now static.
487
488 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
489
490 * nsterm.m (ns_update_begin): Set clip path to whole view by using
491 NSBezierPath (Bug#12131).
492
493 2012-09-10 Chong Yidong <cyd@gnu.org>
494
495 * fns.c (Fdelq, Fdelete): Doc fix.
496
497 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
498
499 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
500 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
501
502 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
503
504 * lisp.h (make_lisp_ptr): New macro to replace XSET.
505 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
506 Use it.
507
508 2012-09-09 Eli Zaretskii <eliz@gnu.org>
509
510 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
511 left fringe if the window has a left margin. This avoids leaving
512 traces of the cursor because its leftmost pixel is not drawn over.
513
514 * dispnew.c (update_window_line): When the left margin area of a
515 screen line is updated, set the redraw_fringe_bitmaps_p flag of
516 that screen line. (Bug#12277)
517
518 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
519
520 Assume C89 or later for math functions (Bug#12381).
521 This simplifies the code, and makes it a bit smaller and faster,
522 and (most important) makes it easier to clean up signal handling
523 since we can stop worring about floating-point exceptions in
524 library code. That was a problem before C89, but the problem
525 went away many years ago on all practical Emacs targets.
526 * data.c, image.c, lread.c, print.c:
527 Don't include <math.h>; no longer needed.
528 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
529 might be autoconfigured, as that never happens.
530 * data.c (fmod):
531 * doprnt.c (DBL_MAX_10_EXP):
532 * print.c (DBL_DIG):
533 Remove. C89 or later always defines these.
534 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
535 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
536 (arith_error, domain_error, domain_error2):
537 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
538 no longer needed -- we simply return what C returns. All uses removed.
539 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
540 the wrapped code.
541 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
542 Remove. All uses expanded, as these macros are no longer used
543 more than once and are now more trouble than they're worth.
544 (Ftan): Use tan, not sin / cos.
545 (Flogb): Assume C89 frexp.
546 (fmod_float): Assume C89 fmod.
547 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
548 (init_floatfns): Remove. All uses removed.
549
550 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
551
552 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
553 compositeToPoint for OSX < 10.6 (Bug#12390).
554
555 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
556
557 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
558 This produces more-accurate results.
559
560 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
561
562 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
563 changes (Bug#12088).
564
565 2012-09-08 Chong Yidong <cyd@gnu.org>
566
567 * syntax.c (Fstring_to_syntax): Doc fix.
568
569 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
570
571 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
572 in the internal border.
573 (x_set_window_size): Remove static variables and their usage.
574 (ns_redraw_scroll_bars): Fix NSTRACE arg.
575 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
576 fringe/internal border adjustment (Bug#11052).
577 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
578 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
579 (ns_fix_rect_ibw): Remove.
580 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
581 (ns_dumpglyphs_box_or_relief): Ditto.
582 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
583 adjustment.
584 (ns_dumpglyphs_image): Ditto.
585 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
586 border adjustment.
587 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
588 their usage. Add fringe_extended_p and its use as in other terms.
589 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
590 scroll bar was removed.
591 (updateFrameSize): New function.
592 (windowDidResize): Move code to updateFrameSize and call it.
593
594 * nsterm.h (EmacsView): Add updateFrameSize.
595
596 2012-09-07 Chong Yidong <cyd@gnu.org>
597
598 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
599
600 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
601
602 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
603
604 More signal-handler cleanup (Bug#12327).
605 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
606 Problem introduced when merging patches. Noted by Eli Zaretskii in
607 <http://bugs.gnu.org/12327#67>.
608 * floatfns.c: Comment fix.
609 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
610 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
611 and anyway the declaration is harmless even if SIGDANGER is not defined.
612 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
613 defined BROKEN_FIONREAD). systty.h formerly did this, but other
614 source files not surprisingly expected syssignal.h to define, or
615 not define, SIGIO, and it's cleaner to do it that way, for consistency.
616 Include <sys/ioctl.h>, for FIONREAD.
617 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
618 This eliminates a problem whereby other files mysteriously had
619 to include "syssignal.h" before including "systty.h" if they
620 wanted to use "#ifdef SIGIO".
621
622 2012-09-07 Eli Zaretskii <eliz@gnu.org>
623
624 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
625
626 * w32.c (sigemptyset): Empty the set.
627 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
628
629 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
630
631 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
632
633 * alloc.c (mark_buffer): Revert unsafe marking optimization.
634 (mark_object): Likewise for frame objects.
635
636 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
637
638 * syssignal.h (handle_on_main_thread): Always declare,
639 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
640 This ports to platforms without HAVE_PTHREAD.
641
642 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
643
644 Signal-handler cleanup (Bug#12327).
645 Emacs's signal handlers were written in the old 4.2BSD style with
646 sigblock and sigmask and so forth, and this led to some
647 inefficiencies and confusion. Rewrite these to use
648 pthread_sigmask etc. without copying signal sets around. Also,
649 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
650 'signal', and instead use functions that do not attempt to take
651 over the system name space. This patch causes Emacs's text
652 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
653 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
654 Do not include <signal.h> or "syssignal.h", as these
655 modules do not use signals.
656 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
657 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
658 Do not include <signal.h>, as "syssignal.h" does that for us now.
659 * atimer.c (sigmask_atimers): New function.
660 (block_atimers, unblock_atimers): New functions,
661 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
662 All uses replaced.
663 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
664 no longer needed here.
665 * emacs.c (main): Inspect existing signal handler with sigaction,
666 so that there's no need to block and unblock SIGHUP.
667 * sysdep.c (struct save_signal): New member 'action', replacing
668 old member 'handler'.
669 (save_signal_handlers, restore_signal_handlers):
670 Use sigaction instead of 'signal' to save and restore.
671 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
672 New function. All users of 'signal' modified to use set_sighandler
673 if they're writeonly, and to use sys_signal if they're read+write.
674 (emacs_sigaction_init, forwarded_signal): New functions.
675 (sys_signal): Remove. All uses replaced by calls to sigaction
676 and emacs_sigaction_init, or by direct calls to 'signal'.
677 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
678 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
679 all uses replaced by pthread_sigmask etc. calls.
680 * syssignal.h: Include <signal.h>.
681 (emacs_sigaction_init, forwarded_signal): New decls.
682 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
683 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
684 (sigmask, sys_sigmask): Remove; no longer needed.
685 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
686 (sigblock, sigunblock, sigfree):
687 (sigsetmask) [!defined sigsetmask]:
688 Remove. All uses replaced by pthread_sigmask.
689 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
690 no longer need to be replaced, and its typical old uses
691 are now done via emacs_sigaction_init and sigaction.
692 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
693 (sys_sigdel): Remove; unused.
694 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
695
696 2012-09-06 Eli Zaretskii <eliz@gnu.org>
697
698 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
699 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
700
701 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
702
703 Explicitly mark buffer_defaults and buffer_local_symbols.
704 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
705 mark_local_symbols here.
706 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
707 since special buffers aren't marked here any more.
708 (allocate_buffer): Chain new buffer with all_buffers here...
709 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
710 not here.
711 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
712 (syms_of_buffer): Remove staticpro of the above.
713 (init_buffer_once): Set names for buffer_defaults and
714 buffer_local_symbols.
715
716 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
717
718 Use bool for booleans in font-related modules.
719 * font.c (font_intern_prop, font_style_to_value)
720 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
721 (generate_otf_features, font_check_otf_features, font_check_otf)
722 (font_match_p, font_list_entities, font_at):
723 * fontset.c (fontset_id_valid_p, reorder_font_vector
724 (fontset_find_font, Fset_fontset_font)
725 (face_suitable_for_char_p) [0]:
726 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
727 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
728 (m17n_flt_initialized, ftfont_shape_by_flt):
729 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
730 * nsfont.m (nsfont_draw):
731 * w32font.c (w32font_draw):
732 * w32term.c (x_draw_glyphless_glyph_string_foreground):
733 Use bool for booleans.
734 * font.h: Adjust to above API changes.
735 (struct font, struct font_driver, struct font_driver_list):
736 Use bool for booleans.
737 (struct font): Remove useless member encoding_type.
738 All users removed.
739 * fontset.c, xftfont.c: Omit unnecessary static decls.
740
741 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
742
743 * alloc.c (mark_object): Revert window marking code
744 since it's unsafe for the Fset_window_configuration.
745
746 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
747
748 Fix race conditions with signal handlers and errno (Bug#12327).
749 Be more systematic about preserving errno whenever a signal
750 handler returns, even if it's not in the main thread. Do this by
751 renaming signal handlers to distinguish between signal delivery
752 and signal handling. All uses changed.
753 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
754 * data.c (deliver_arith_signal): Rename from arith_error.
755 * dispnew.c (deliver_window_change_signal): Rename from
756 window_change_signal.
757 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
758 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
759 * keyboard.c (deliver_input_available_signal): Rename from
760 input_available_signal.
761 (deliver_user_signal): Rename from handle_user_signal.
762 (deliver_interrupt_signal): Rename from interrupt_signal.
763 * process.c (deliver_pipe_signal): Rename from send_process_trap.
764 (deliver_child_signal): Rename from sigchld_handler.
765 * atimer.c (handle_alarm_signal):
766 * data.c (handle_arith_signal):
767 * dispnew.c (handle_window_change_signal):
768 * emacs.c (handle_fatal_signal, handle_danger_signal):
769 * keyboard.c (handle_input_available_signal):
770 * keyboard.c (handle_user_signal, handle_interrupt_signal):
771 * process.c (handle_pipe_signal, handle_child_signal):
772 New functions, with the actual signal-handling code taken from the
773 original respective signal handlers, sans the sporadic attempts to
774 preserve errno, since that's now done by handle_on_main_thread.
775 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
776 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
777 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
778 Move to sysdep.c.
779 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
780 Move initialization of main_thread to sysdep.c's init_signals.
781 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
782 our usage, and simplifies the mainline code.
783 (record_child_status_change): New static function, as a helper
784 for handle_child_signal, and with most of the old child handler's
785 contents.
786 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
787 (handle_child_signal): Use the above.
788 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
789 Moved here from emacs.c.
790 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
791 code moved here from emacs.c's main function.
792 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
793 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
794 lets callers save and restore errno properly.
795
796 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
797
798 Remove redundant or unused things here and there.
799 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
800 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
801 * editfns.c (Fcompare_buffer_substrings): Likewise.
802 * frame.h (struct terminal, struct font_driver_list):
803 Remove redundant declarations.
804 * window.h (Qleft, Qright): Likewise.
805
806 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
807
808 Do not mark objects from deleted buffers, windows and frames.
809 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
810 (mark_object): Likewise for windows and frames.
811
812 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
813
814 * alloc.c (valid_lisp_object_p): Treat killed buffers,
815 buffer_defaults and buffer_local_symbols as valid objects.
816 Return special value to denote them.
817
818 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
819
820 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
821 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
822 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
823 (file_name_absolute_p, Fsubstitute_in_file_name):
824 (check_executable, check_writable, Ffile_accessible_directory_p)
825 (Fset_file_selinux_context, Fdefault_file_modes)
826 (Finsert_file_contents, choose_write_coding_system)
827 (Fwrite_region, build_annotations, a_write, e_write)
828 (Fdo_auto_save):
829 * filelock.c (boot_time_initialized, get_boot_time)
830 (get_boot_time_1, lock_file_1, within_one_second):
831 * floatfns.c (in_float):
832 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
833 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
834 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
835 * lisp.h (struct Lisp_Hash_Table.cmpfn):
836 * window.c (compare_window_configurations):
837 Use bool for booleans.
838 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
839 (Fdefault_file_modes): Now mode_t, not int, for modes.
840 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
841 (internal_delete_file): Now returns void, not a (boolean) int,
842 since nobody was looking at the return value.
843 * lisp.h, window.h: Adjust to above API changes.
844
845 * xdisp.c (set_message): Simplify and reindent last change.
846
847 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
848
849 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
850
851 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
852
853 * eval.c (call_debugger): Make the function non-static so that we
854 can call it from set_message.
855
856 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
857 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
858
859 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
860
861 Give more-useful info on a fatal error (Bug#12328).
862 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
863 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
864 of doing the work ourselves.
865 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
866 do most of the work.
867 (fatal_error_backtrace): New function, taken from the guts
868 of the old fatal_error_signal, but with a new option to output
869 a backtrace.
870 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
871 info about the signal than just its number.
872 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
873 * sysdep.c: Include <execinfo.h>
874 (emacs_backtrace): New function, taken partly from the previous
875 code of the 'die' function.
876 (emacs_abort): Call fatal_error_backtrace rather than abort.
877
878 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
879
880 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
881 eager (load-time) macro-expansion.
882 * lisp.mk (lisp): Add macroexp.
883
884 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
885
886 Simplify redefinition of 'abort' (Bug#12316).
887 Do not try to redefine the 'abort' function. Instead, redo
888 the code so that it calls 'emacs_abort' rather than 'abort'.
889 This removes the need for the NO_ABORT configure-time macro
890 and makes it easier to change the abort code to do a backtrace.
891 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
892 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
893 Remove; sysdep.c's emacs_abort now takes its place.
894 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
895 'abort' changed to use 'emacs_abort'.
896 * msdos.c (dos_abort) [defined abort]: Remove; not used.
897 (abort) [!defined abort]: Rename to ...
898 (emacs_abort): ... new name.
899 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
900 the place of the old 'abort' in emacs.c.
901 * w32.c, w32fns.c (abort): Do not #undef.
902 * w32.c (emacs_abort): Rename from w32_abort.
903
904 2012-09-04 Eli Zaretskii <eliz@gnu.org>
905
906 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
907 offsets[j].dv, since the y axis of the screen coordinates points
908 down, while the y axis of the font definition coordinates points
909 up. This fixes display of Arabic diacritics such as KASRA and
910 KASRATAN. (Bug#11860)
911
912 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
913
914 Be more systematic about _setjmp vs setjmp.
915 * alloc.c (test_setjmp, mark_stack):
916 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
917 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
918 (png_load, my_error_exit, jpeg_load):
919 * process.c (send_process_trap, send_process):
920 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
921 The underscored versions are up to 30x faster on some hosts.
922 Formerly, the code used setjmp+longjmp sometimes and
923 _setjmp+_longjmp at other times, with no particular reason to
924 prefer setjmp+longjmp.
925
926 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
927
928 Fix minor problem found by static checking.
929 * buffer.c (Fdelete_all_overlays): Return nil.
930
931 2012-09-03 Martin Rudalics <rudalics@gmx.at>
932
933 * buffer.c (Fdelete_all_overlays): New function.
934
935 2012-09-03 Chong Yidong <cyd@gnu.org>
936
937 * gtkutil.c: Add extern decl for Qxft.
938
939 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
940
941 * emacs.c, eval.c: Use bool for boolean.
942 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
943 (malloc_using_checking) [DOUG_LEA_MALLOC]:
944 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
945 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
946 (main, decode_env_path, Fdaemon_initialized):
947 * eval.c (call_debugger, Finteractive_p, interactive_p):
948 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
949 (maybe_call_debugger, Fbacktrace):
950 * process.c (read_process_output, exec_sentinel):
951 Use bool for booleans.
952 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
953 All callers changed.
954 * eval.c (interactive_p): Omit always-true boolean argument
955 EXCLUDE_SUBRS_P. All callers changed.
956 * dispextern.h, lisp.h: Reflect above API changes.
957 * firstfile.c (dummy): Use the address of 'main', whose signature
958 won't change, instead of the address of 'initialize', whose
959 signature just changed from int to bool.
960 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
961 * msdos.c (fatal_error_in_progress): ... from here.
962 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
963 of incrementing it.
964 (redisplay_internal, unwind_redisplay): Simply clear
965 REDISPLAYING_P when unwinding, instead of saving its previous,
966 always-false value and then restoring it.
967
968 Clean up some extern decls.
969 Mostly, this hoists extern decls out of .c files and into .h files.
970 That way, we're more likely to catch errors if the interfaces change.
971 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
972 declare xg_mark_data.
973 * dispextern.h (x_frame_parm_handlers):
974 * font.h (Qxft):
975 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
976 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
977 (Qultra_bold, Qoblique, Qitalic):
978 Move extern decl here from .c file.
979 * alloc.c (xg_mark_data) [USE_GTK]:
980 * doc.c (Qclosure):
981 * eval.c (Qlexical_binding):
982 * fns.c (time) [!HAVE_UNISTD_H]:
983 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
984 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
985 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
986 * lread.c (Qinternal_interpreter_environment):
987 * minibuf.c (Qbuffer):
988 * process.c (QCfamily, QCfilter):
989 * widget.c (free_frame_faces):
990 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
991 * xfont.c (x_clear_errors):
992 * xterm.c (x_frame_parm_handlers):
993 Remove now-redundant extern decls.
994 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
995 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
996 Now static.
997 * xfaces.c: Remove unnecessary static decls.
998 * xterm.c (updating_frame): Remove decl of nonexistent object.
999
1000 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
1001 when building globals.h, as the objects that are not built on
1002 this host are not needed to compile C files on this host.
1003
1004 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
1005
1006 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
1007
1008 * frame.h: Add missing prototype for x_wm_set_size_hint.
1009
1010 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
1011
1012 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
1013 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
1014 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
1015 (Fsubstitute_command_keys):
1016 * editfns.c (region_limit, find_field, Fconstrain_to_field)
1017 (save_excursion_save, save_excursion_restore)
1018 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
1019 (format_time_string, general_insert_function)
1020 (make_buffer_string, make_buffer_string_both)
1021 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1022 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1023 (copy_text, insert_1, insert_1_both, insert_from_string)
1024 (insert_from_string_before_markers, insert_from_string_1)
1025 (insert_from_buffer, insert_from_buffer_1, replace_range)
1026 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1027 (del_range_2, modify_region):
1028 * intervals.c (intervals_equal, balance_possible_root_interval)
1029 (adjust_intervals_for_insertion, merge_properties_sticky)
1030 (graft_intervals_into_buffer, lookup_char_property)
1031 (adjust_for_invis_intang, set_point_both)
1032 (get_property_and_range, compare_string_intervals)
1033 (set_intervals_multibyte_1, set_intervals_multibyte):
1034 * keyboard.c (decode_timer):
1035 Use bool for boolean.
1036 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1037 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1038
1039 2012-09-02 Chong Yidong <cyd@gnu.org>
1040
1041 * keymap.c (push_key_description): Print M-TAB as C-M-i
1042 (Bug#11758).
1043
1044 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1045
1046 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1047 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1048 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1049 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1050 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1051 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1052 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1053
1054 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1055
1056 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1057 more than one grapheme cluster passed to the shaper: compute the
1058 offset adjustment values separately for each cluster. (Bug#11860)
1059
1060 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1061 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1062 about implicit conversions from integer to pointer.
1063
1064 2012-09-01 Daniel Colascione <dancol@dancol.org>
1065
1066 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1067 system used too early.
1068
1069 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1070
1071 Better seed support for (random).
1072 * emacs.c (main): Call init_random.
1073 * fns.c (Frandom): Set the seed from a string argument, if given.
1074 Remove long-obsolete Gentzel cruft.
1075 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1076 (init_random): New function.
1077
1078 2012-09-01 Daniel Colascione <dancol@dancol.org>
1079
1080 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1081 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1082 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1083 x_wm_set_size_hint, x_query_colors, x_real_positions,
1084 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1085 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1086 all of which have been moved to common code.
1087
1088 * xfaces.c: Include TERM_HEADER instead of listing all possible
1089 window-system headers.
1090
1091 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1092 to match header.
1093
1094 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1095 directly accessing frame internals.
1096
1097 * w32font.h: Include font.h. Define syms_of_w32font and
1098 globals_of_w32font.
1099
1100 * process.c: Include TERM_HEADER instead of listing all possible
1101 window-system headers.
1102
1103 * nsterm.h: Remove declarations now in frame.h. Define
1104 FRAME_X_SCREEN, FRAME_X_VISUAL.
1105
1106 * menu.c: Include TERM_HEADER instead of listing all possible
1107 window-system headers.
1108
1109 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1110 window system.
1111
1112 * keyboard.c: Include TERM_HEADER instead of listing all possible
1113 window-system headers.
1114
1115 * image.c: Include TERM_HEADER instead of listing all possible
1116 window-system headers. Declare Vlibrary_cache when compiling for
1117 Windows.
1118
1119 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1120 window system declarations.
1121
1122 * frame.h: Move common functions here: set_frame_menubar,
1123 x_set_window_size, x_sync, x_get_focus_frame,
1124 x_set_mouse_position, x_set_mouse_pixel_position,
1125 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1126 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1127 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1128 x_activate_menubar, x_real_positions, x_bitmap_icon,
1129 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1130 and x_query_colors.
1131
1132 * frame.c: Include TERM_HEADER instead of listing all possible
1133 window-system headers.
1134
1135 * font.c: Include TERM_HEADER instead of listing all possible
1136 window-system headers.
1137
1138 * emacs.c: Include TERM_HEADER.
1139
1140 * dispnew.c: Include TERM_HEADER instead of listing all possible
1141 window-system headers.
1142
1143 * ccl.h: Include character.h.
1144
1145 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1146 the current window system; include in list of objects to link into
1147 Emacs.
1148
1149 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1150
1151 Remove mark_ttys function and fix tty_display_info initialization.
1152 * lisp.h (mark_ttys): Remove prototype.
1153 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1154 to mark_ttys because all possible values of 'top_frame' slot are
1155 the frames which are reachable from Vframe_list.
1156 * term.c (mark_ttys): Remove.
1157 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1158
1159 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1160
1161 Change struct frame bitfields from unsigned char to unsigned.
1162 * frame.h (struct frame): Change type of 'display_preempted',
1163 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1164 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1165 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1166 bitfields from unsigned char to unsigned.
1167
1168 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1169
1170 Remove unused member of struct x_output and struct w32_output.
1171 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1172 * w32term.h (struct w32_output): Likewise.
1173
1174 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1175
1176 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1177 does not become zero (Bug#12234).
1178
1179 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1180
1181 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1182 for GCC 4.7.1 x86-64.
1183
1184 2012-08-30 Glenn Morris <rgm@gnu.org>
1185
1186 * lread.c (init_lread): For out-of-tree builds, only add the
1187 source directory's site-lisp dir to the load-path if it exists,
1188 consistent with in-tree builds. (Bug#12302)
1189
1190 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1191
1192 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1193 button_values to NULL. Call setStykeMask so dialogs get a close button.
1194 (windowShouldClose:): Set window_closed.
1195 (dealloc): New member, free button_values.
1196 (process_dialog:): Make member function. Remove window argument,
1197 replace window with self. Count buttons and allocate and store values
1198 in button_values.
1199 (addButton:value:row:): value is int with the name tag. Call setTag
1200 with tag. Remove return self, declare return value as void.
1201 (addString:row:): Remove return self, declare return value as void.
1202 (addSplit): Remove return self, declare return value as void.
1203 (clicked:): Remove return self, declare return value as void.
1204 Set dialog_return to button_values[seltag]. Code formatting change.
1205 (initFromContents:isQuestion:): Adjust call to process_dialog.
1206 Code formatting change.
1207 (timeout_handler:): Set timer_fired to YES.
1208 (runDialogAt:): Set timer_fired to NO.
1209 Handle click on close button as quit.
1210
1211 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1212 Add window_closed and button_values. Add void as return value for
1213 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1214 Add process_dialog as new member.
1215
1216 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1217
1218 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1219 is not one of the heaps we manage. (Bug#12242)
1220
1221 2012-08-28 Glenn Morris <rgm@gnu.org>
1222
1223 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1224
1225 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1226
1227 * window.c (Fset_window_configuration): Remove handling of
1228 auto-buffer-name window parameter. Install revision of reverted
1229 fix.
1230
1231 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1232
1233 Do not allow to set major mode for a dead buffer.
1234 * buffer.c (Fset_buffer_major_mode): Signal an error
1235 if the buffer is dead.
1236 (Fother_buffer, other_buffer_safely): Remove redundant
1237 nested declaration.
1238
1239 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1240
1241 Always use set_buffer_if_live to restore original buffer at unwind.
1242 * buffer.h (record_unwind_current_buffer): New function.
1243 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1244 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1245 * undo.c, window.c: Adjust users.
1246 * buffer.c (set_buffer_if_live): Fix comment.
1247
1248 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1249
1250 Fix usage of set_buffer_internal.
1251 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1252 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1253 * coding.c (decode_coding): Omit redundant test.
1254 * fileio.c (decide_coding_unwind): Likewise.
1255 * fns.c (secure_hash): Likewise.
1256 * insdel.c (modify_region): Likewise.
1257 * keyboard.c (command_loop_1): Likewise.
1258 * print.c (PRINTFINISH): Likewise.
1259 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1260
1261 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1262
1263 * dispnew.c: Use bool for boolean.
1264 (frame_garbaged, display_completed, delayed_size_change)
1265 (fonts_changed_p, add_window_display_history)
1266 (add_frame_display_history, verify_row_hash)
1267 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1268 (row_equal_p, realloc_glyph_pool)
1269 (allocate_matrices_for_frame_redisplay)
1270 (showing_window_margins_p)
1271 (adjust_frame_glyphs_for_frame_redisplay)
1272 (build_frame_matrix_from_leaf_window, make_current)
1273 (mirrored_line_dance, mirror_line_dance, update_frame)
1274 (update_window_tree, update_single_window)
1275 (check_current_matrix_flags, update_window, update_text_area)
1276 (update_window_line, set_window_update_flags, scrolling_window)
1277 (update_frame_1, scrolling, buffer_posn_from_coords)
1278 (do_pending_window_change, change_frame_size)
1279 (change_frame_size_1, sit_for):
1280 Use bool for boolean.
1281 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1282 and remove last int (actually boolean) argument, which was always 0.
1283 All callers changed.
1284 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1285 * dispextern.h (struct composition_it): Use bool for boolean.
1286 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1287 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1288 * dired.c (file_name_completion):
1289 Use bool for boolean. (This was missed in an earlier change.)
1290
1291 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1292
1293 * window.c (Fset_window_configuration): Revert first part of
1294 last change.
1295
1296 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1297
1298 * nsterm.h (NSPanel): New class variable dialog_return.
1299
1300 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1301 dialog_return.
1302 (windowShouldClose:): Use stop instead of stopModalWithCode.
1303 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1304 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1305 event.
1306 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1307 modal loop returns.
1308
1309 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1310
1311 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1312 * composite.c (find_composition, composition_gstring_p)
1313 (composition_reseat_it, find_automatic_composition):
1314 * data.c (let_shadows_buffer_binding_p)
1315 (let_shadows_global_binding_p, set_internal, make_blv)
1316 (Fmake_variable_buffer_local, Fmake_local_variable)
1317 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1318 (cons_to_signed, arith_driver):
1319 * dbusbind.c (xd_in_read_queued_messages):
1320 * dired.c (directory_files_internal, file_name_completion):
1321 Use bool for booleans.
1322 * dired.c (file_name_completion):
1323 * process.h (fd_callback):
1324 Omit int (actually boolean) argument. It wasn't being used.
1325 All uses changed.
1326 * composite.h, lisp.h: Reflect above API changes.
1327
1328 * cmds.c, coding.c: Use bool for booleans.
1329 * cmds.c (move_point, Fself_insert_command):
1330 * coding.h (struct composition status, struct coding_system):
1331 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1332 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1333 (emacs_mule_char, decode_coding_emacs_mule)
1334 (encode_coding_emacs_mule, detect_coding_iso_2022)
1335 (decode_coding_iso_2022, encode_invocation_designation)
1336 (encode_designation_at_bol, encode_coding_iso_2022)
1337 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1338 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1339 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1340 (encode_coding_raw_text, detect_coding_charset)
1341 (decode_coding_charset, encode_coding_charset, detect_eol)
1342 (detect_coding, get_translation_table, produce_chars)
1343 (consume_chars, reused_workbuf_in_use)
1344 (make_conversion_work_buffer, code_conversion_save)
1345 (decode_coding_object, encode_coding_object)
1346 (detect_coding_system, char_encodable_p)
1347 (Funencodable_char_position, code_convert_region)
1348 (code_convert_string, code_convert_string_norecord)
1349 (Fset_coding_system_priority):
1350 * fileio.c (Finsert_file_contents):
1351 Use bool for booleans.
1352 * coding.h, lisp.h: Reflect above API changes.
1353 * coding.c: Remove unnecessary static function decls.
1354 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1355 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1356 not a boolean 'int', since callers never look at the return value.
1357 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1358 * coding.h (decoding_buffer_size, encoding_buffer_size)
1359 (emacs_mule_string_char): Remove unused extern decls.
1360 (struct iso_2022_spec, struct coding_system):
1361 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1362 (struct emacs_mule_spec): Remove unused field 'full_support'.
1363 All initializations removed.
1364 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1365
1366 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1367
1368 Fix spare memory change (Bug#12286).
1369 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1370 (valid_lisp_object_p): Likewise.
1371
1372 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1373
1374 * window.c (Fset_window_configuration): Record any window's old
1375 buffer if it's replaced (see Bug#8789). If the new current
1376 buffer doesn't appear in the selected window, go to its old
1377 point (Bug#12208).
1378
1379 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1380
1381 Special MEM_TYPE_SPARE to denote reserved memory.
1382 * alloc.c (enum mem_type): New memory type.
1383 (refill_memory_reserve): Use new type for spare memory.
1384 This prevents live_cons_p and live_string_p from incorrect
1385 detection of uninitialized objects from spare memory as live.
1386
1387 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1388
1389 Spelling fixes.
1390 * Makefile.in (.PHONY): versioclean -> versionclean.
1391
1392 Remove unused external symbols.
1393 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1394 * window.c (Qwindow_valid_p, decode_valid_window):
1395 Now static, not extern.
1396 * data.c (Qinterval): Remove; unused.
1397 (syms_of_data): Do not define 'interval'.
1398 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1399 * window.h (decode_valid_window):
1400 Remove decls.
1401
1402 * character.c, charset.c, chartab.c: Use bool for booleans.
1403 * character.c (lisp_string_width, string_count_byte8)
1404 (string_escape_byte8):
1405 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1406 (load_charset_map_from_file, map_charset_chars)
1407 (Fdefine_charset_internal, define_charset_internal)
1408 (Fdeclare_equiv_charset, find_charsets_in_text)
1409 (Ffind_charset_region, char_charset, Fiso_charset):
1410 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1411 (sub_char_table_set, sub_char_table_set_range)
1412 (char_table_set_range, optimize_sub_char_table)
1413 (map_sub_char_table):
1414 Use bool for boolean.
1415 * character.c (str_to_unibyte): Omit last boolean argument; it was
1416 always 0. All callers changed.
1417 * character.h, charset.h: Adjust to match previous changes.
1418 * character.h (char_printable_p): Remove decl of nonexistent function.
1419 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1420 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1421 are all boolean, so make them single-bit bitfields.
1422
1423 * lisp.h (ASET): Remove attempt to detect side effects.
1424 It was meant to be temporary and it often doesn't work,
1425 because when IDX has side effects the behavior of IDX==IDX
1426 is undefined. See Stefan Monnier in
1427 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1428
1429 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1430
1431 * lisp.h (functionp): New function (extracted from Ffunctionp).
1432 (FUNCTIONP): Use it.
1433 * eval.c (Ffunctionp): Use it.
1434
1435 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1436
1437 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1438 as that's faster and simpler than static storage. Don't bother
1439 with the g_main_context_query overhead if g_main_context_pending
1440 says no events are pending.
1441 (gfds, gfds_size): Remove these static vars.
1442 (xgselect_initialize): Remove; no longer needed.
1443 All uses and decls removed.
1444
1445 * emacs.c (fatal_error_signal_hook): Remove.
1446 All uses removed. This leftover from old code was always 0.
1447
1448 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1449 * casefiddle.c (casify_object, casify_region):
1450 * casetab.c (set_case_table):
1451 * category.c, category.h (word_boundary_p):
1452 * category.h (CHAR_HAS_CATEGORY):
1453 Use bool for booleans, instead of int.
1454
1455 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1456
1457 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1458
1459 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1460
1461 On assertion failure, print backtrace if available.
1462 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1463 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1464 * Makefile.in (LIB_EXECINFO): New macro.
1465 (LIBES): Use it.
1466
1467 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1468 * bytecode.c (exec_byte_code):
1469 * callint.c (check_mark, Fcall_interactively):
1470 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1471 (getenv_internal, sync_process_alive, call_process_exited):
1472 * lisp.h (USE_SAFE_ALLOCA):
1473 Use bool for booleans, instead of int.
1474 * lisp.h, process.h: Adjust prototypes to match above changes.
1475 * callint.c (Fcall_interactively): Don't assume the mark's
1476 offset fits in 'int'.
1477
1478 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1479
1480 * buffer.c, buffer.h: Use bool for boolean.
1481 * buffer.c (reset_buffer_local_variables)
1482 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1483 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1484 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1485 (overlay_touches_p, overlay_strings, Foverlay_put)
1486 (report_overlay_modification, call_overlay_mod_hooks):
1487 (mmap_enlarge, mmap_set_vars):
1488 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1489 Use bool for booleans, instead of int.
1490 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1491 since the 1-or-0 return value is always ignored anyway.
1492 (mmap_initialized_p):
1493 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1494 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1495
1496 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1497
1498 * bidi.c: Use bool for boolean.
1499 This is a bit more readable, and makes the text segment of bidi.o
1500 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1501 Presumably it's faster too.
1502 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1503 Now bool.
1504 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1505 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1506 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1507 (bidi_explicit_dir_char, bidi_level_of_next_char)
1508 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1509 Use bool for booleans, instead of int.
1510 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1511 (bidi_unshelve_cache): Adjust decls to match code.
1512
1513 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1514
1515 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1516 argument.
1517
1518 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1519
1520 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1521 * atimer.h: Include <stdbool.h>.
1522
1523 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1524
1525 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1526 compile time tests instead of run time tests on systems that do
1527 not use them.
1528 (FRAME_MAC_P): Remove leftover from deleted code.
1529 * frame.c (syms_of_frame): Remove leftover from deleted code.
1530
1531 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1532
1533 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1534
1535 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1536
1537 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1538 Otherwise, the compiler complains about (A?B:C) where B is void
1539 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1540 (fontset_add): Return void, for FONTSET_ADD.
1541
1542 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1543
1544 * alloc.c: Use bool for booleans.
1545 (gc_in_progress, abort_on_gc)
1546 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1547 (dont_register_blocks) [GC_MALLOC_CHECK]:
1548 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1549 (check_string_bytes, make_specified_string, memory_full)
1550 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1551 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1552 (mark_stack, valid_pointer_p, make_pure_string)
1553 (Fgarbage_collect, survives_gc_p, gc_sweep):
1554 Use bool for booleans, instead of int.
1555 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1556 Remove unused local.
1557 * alloc.c (PURE_POINTER_P):
1558 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1559 * editfns.c (Fformat):
1560 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1561 (Fdo_auto_save):
1562 * fns.c (sweep_weak_table):
1563 * lisp.h (suppress_checking, push_message, survives_gc_p)
1564 (make_pure_string, gc_in_progress, abort_on_gc):
1565 * lread.c (readchar, read1):
1566 * print.c (Fprin1_to_string):
1567 * xdisp.c (push_message):
1568 Use bool for booleans affected directly or indirectly by
1569 alloc.c's changes.
1570
1571 Make recently-introduced setters macros.
1572 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1573 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1574 (set_fontset_default, set_fontset_fallback): Rename from their
1575 upper-case counterparts, and make them functions rather than macros.
1576 This is more consistent with the other recently-introduced setters.
1577 These don't need to be inline, since they're local.
1578
1579 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1580
1581 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1582 the loop (Bug#12247).
1583
1584 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1585
1586 * lisp.h (vcopy): Use memcpy rather than our own loop.
1587 This fixes a performance regression introduced by the recent
1588 addition of vcopy. This means 'vcopy' will need to be modified
1589 for a copying collector, but that's OK. Also, tighten the
1590 checking in the assertion.
1591
1592 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1593
1594 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1595 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1596 non-base glyph for the width of the base character, according to
1597 what x_draw_composite_glyph_string_foreground expects.
1598 Generate WADJUST value according to composition_gstring_width's
1599 expectations, to produce correct width of the composed character.
1600 Reverse the sign of the DU offset produced by ScriptPlace.
1601
1602 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1603
1604 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1605
1606 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1607
1608 Avoid direct writes to contents member of struct Lisp_Vector.
1609 * lisp.h (vcopy): New function to copy data into vector.
1610 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1611 * fns.c (Ffillarray): Use ASET.
1612 * keyboard.c (timer_check_2): Use AREF and ASET.
1613 (append_tool_bar_item, Frecent_keys): Use vcopy.
1614 * lread.c (read_vector): Use ASET.
1615 * msdos.c (Frecent_doskeys): Use vcopy.
1616 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1617 (Finternal_merge_in_global_face): Use ASET and vcopy.
1618 * xfont.c (xfont_list_pattern): Likewise.
1619
1620 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1621
1622 * window.c (Fwindow_point): For the selected window always return
1623 the position of its buffer's point.
1624 (Fset_window_point): For the selected window always go in its
1625 buffer to the specified position.
1626
1627 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1628
1629 Setter macros for fontsets.
1630 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1631 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1632 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1633 Adjust users.
1634
1635 2012-08-20 Glenn Morris <rgm@gnu.org>
1636
1637 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1638 Don't assume that `ln -f' works.
1639
1640 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1641
1642 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1643 and later about non-assignments with no effect. See discussion at
1644 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1645 details.
1646
1647 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1648
1649 Inline setter functions for Lisp_Objects slots of struct specbinding.
1650 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1651 Adjust users.
1652
1653 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1654
1655 * window.c (select_window): Always make selected window's buffer
1656 current.
1657
1658 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1659
1660 Use AREF and ASET for docstrings of category tables.
1661 * category.h (CATEGORY_DOCSTRING): Use AREF.
1662 (SET_CATEGORY_DOCSTRING): Use ASET.
1663 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1664
1665 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1666
1667 Inline setter functions for hash table members.
1668 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1669 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1670 (set_hash_key_and_value, set_hash_index, set_hash_next)
1671 (set_hash_hash): New functions.
1672 * charset.c, fns.c: Adjust users.
1673
1674 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1675
1676 Inline getter and setter functions for per-buffer values.
1677 * buffer.h (per_buffer_default, set_per_buffer_default)
1678 (per_buffer_value, set_per_buffer_value): New functions.
1679 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1680 * buffer.c, data.c: Adjust users.
1681
1682 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1683
1684 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1685
1686 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1687
1688 Rely on <config.h> + <unistd.h> to declare 'environ',
1689 as gnulib does this if the system doesn't.
1690 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1691 Remove declaration. MS-Windows declares it on stdlib.h which is
1692 included by conf_post.h.
1693 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1694 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1695 * vm-limit.c: Include <unistd.h>, for 'environ'.
1696
1697 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1698 (start_of_data): Remove decl; mem-limits.h provides it.
1699
1700 * xdisp.c (handle_invisible_prop): Make it a bit faster
1701 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1702
1703 2012-08-19 Chong Yidong <cyd@gnu.org>
1704
1705 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1706 ends (Bug#3874).
1707
1708 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1709
1710 * .gdbinit: Use call instead of set when calling a function in the
1711 inferior.
1712
1713 * data.c (set_internal): Don't use set_blv_found.
1714 (Fkill_local_variable): Likewise.
1715
1716 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1717
1718 * nsfont.m (ns_ascii_average_width): Ensure the string
1719 ascii_printable is initialized with a null-terminated character
1720 array. Otherwise, it can contain undesired extra characters.
1721
1722 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1723
1724 port new setting code to Sun C 5.8 2005/10/13
1725 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1726 Return void, not Lisp_Object. Otherwise, the compiler
1727 complains about (A?B:C) where B is void and C is Lisp_Object
1728 when compiling CHAR_TABLE_SET, due to the recent change to
1729 the API of sub_char_table_set_contents.
1730
1731 2012-08-18 Chong Yidong <cyd@gnu.org>
1732
1733 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1734 for the string case (Bug#3874).
1735
1736 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1737
1738 * buffer.h (BSET): Remove (Bug#12215).
1739 Replace all uses with calls to new setter functions.
1740 (bset_bidi_paragraph_direction, bset_case_canon_table)
1741 (bset_case_eqv_table, bset_directory, bset_display_count)
1742 (bset_display_time, bset_downcase_table)
1743 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1744 (bset_last_selected_window, bset_local_var_alist)
1745 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1746 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1747 (bset_width_table):
1748 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1749 (bset_auto_fill_function, bset_auto_save_file_format)
1750 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1751 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1752 (bset_cache_long_line_scans, bset_case_fold_search)
1753 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1754 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1755 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1756 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1757 (bset_header_line_format, bset_indicate_buffer_boundaries)
1758 (bset_indicate_empty_lines, bset_invisibility_spec)
1759 (bset_left_fringe_width, bset_major_mode, bset_mark)
1760 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1761 (bset_name, bset_overwrite_mode, bset_pt_marker)
1762 (bset_right_fringe_width, bset_save_length)
1763 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1764 (bset_scroll_up_aggressively, bset_selective_display)
1765 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1766 (bset_word_wrap, bset_zv_marker):
1767 * category.c (bset_category_table):
1768 * syntax.c (bset_syntax_table):
1769 New setter functions.
1770
1771 * process.h (PSET): Remove (Bug#12215).
1772 Replace all uses with calls to new setter functions.
1773 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1774 (PROCESS_INLINE): New macro.
1775 (pset_childp): New setter function.
1776 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1777 * process.c (PROCESS_INLINE):
1778 Define to EXTERN_INLINE, so that the corresponding functions
1779 are compiled into code.
1780 (pset_buffer, pset_command, pset_decode_coding_system)
1781 (pset_decoding_buf, pset_encode_coding_system)
1782 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1783 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1784 (pset_type, pset_write_queue): New setter functions.
1785
1786 * window.h (WSET): Remove (Bug#12215).
1787 Replace all uses with calls to new setter functions.
1788 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1789 (WINDOW_INLINE): New macro.
1790 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1791 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1792 (wset_total_lines, wset_vertical_scroll_bar)
1793 (wset_window_end_pos, wset_window_end_valid)
1794 (wset_window_end_vpos): New setter functions.
1795 * window.c (WINDOW_INLINE):
1796 Define to EXTERN_INLINE, so that the corresponding functions
1797 are compiled into code.
1798 (wset_combination_limit, wset_dedicated, wset_display_table)
1799 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1800 (wset_new_normal, wset_new_total, wset_next_buffers)
1801 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1802 (wset_prev_buffers, wset_right_fringe_width)
1803 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1804 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1805 (wset_window_parameters):
1806 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1807 (wset_column_number_displayed, wset_region_showing):
1808 New setter functions.
1809
1810 * termhooks.h (TSET): Remove (Bug#12215).
1811 Replace all uses with calls to new setter functions.
1812 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1813 (TERMHOOKS_INLINE): New macro.
1814 (tset_charset_list, tset_selection_alist): New setter functions.
1815 * terminal.c (TERMHOOKS_INLINE):
1816 Define to EXTERN_INLINE, so that the corresponding functions
1817 are compiled into code.
1818 (tset_param_alist): New setter function.
1819
1820 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1821
1822 * keyboard.h (KSET): Remove (Bug#12215).
1823 Replace all uses with calls to new setter functions.
1824 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1825 (KEYBOARD_INLINE): New macro.
1826 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1827 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1828 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1829 New setter functions.
1830 * keyboard.c (KEYBOARD_INLINE):
1831 Define to EXTERN_INLINE, so that the corresponding functions
1832 are compiled into code.
1833 (kset_echo_string, kset_kbd_queue)
1834 (kset_keyboard_translate_table, kset_last_prefix_arg)
1835 (kset_last_repeatable_command, kset_local_function_key_map)
1836 (kset_overriding_terminal_local_map, kset_real_last_command)
1837 (kset_system_key_syms): New setter functions.
1838
1839 * frame.h (FSET): Remove (Bug#12215).
1840 Replace all uses with calls to new setter functions.
1841 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1842 (FRAME_INLINE): New macro.
1843 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1844 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1845 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1846 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1847 (fset_param_alist, fset_root_window, fset_scroll_bars)
1848 (fset_selected_window, fset_title, fset_tool_bar_items)
1849 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1850 * frame.c (FRAME_INLINE):
1851 Define to EXTERN_INLINE, so that the corresponding functions
1852 are compiled into code.
1853 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1854
1855 A few more naming-convention fixes for getters and setters.
1856 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1857 and rename from buffer_overlays_set_before.
1858 (set_buffer_overlays_after): Move here from buffer.h, and rename
1859 from buffer_overlays_set_after.
1860 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1861 All uses changed.
1862 (set_buffer_intervals): Rename from buffer_set_intervals.
1863 * intervals.c (set_interval_object): Move here from intervals.h,
1864 and rename from interval_set_object.
1865 (set_interval_left): Move here from intervals.h, and rename from
1866 interval_set_left.
1867 (set_interval_right): Move here from intervals.h, and rename from
1868 interval_set_right.
1869 (copy_interval_parent): Move here from intervals.h, and rename from
1870 interval_copy_parent.
1871 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1872 (set_interval_plist): Rename from interval_set_plist.
1873 Return void, not Lisp_Object, since no caller uses the result.
1874 * lisp.h (string_intervals): Rename from string_get_intervals.
1875 (set_string_intervals): Rename from string_set_intervals.
1876
1877 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1878 (set_char_table_contents): Rename from char_table_set_contents.
1879 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1880 All uses changed. See the end of
1881 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1882
1883 * lisp.h (CSET): Remove (Bug#12215).
1884 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1885 (set_char_table_purpose): New functions,
1886 replacing CSET. All uses changed. For example, replace
1887 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1888 "set_char_table_parent (char_table, parent);".
1889 The old version was confusing because it used the same name
1890 'parent' for two different things.
1891
1892 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1893
1894 Functions to get and set Lisp_Object fields of buffer-local variables.
1895 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1896 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1897 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1898 * data.c, eval.c, frame.c: Adjust users.
1899
1900 2012-08-17 Chong Yidong <cyd@gnu.org>
1901
1902 * xfaces.c (merge_face_vectors): If the target font specfies a
1903 font spec, make the font's attributes take precedence over
1904 directly-specified attributes.
1905 (merge_face_ref): Recognize :font.
1906
1907 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1908
1909 Do not use memcpy for copying intervals.
1910 * intervals.c (reproduce_interval): New function.
1911 (reproduce_tree, reproduce_tree_obj): Use it.
1912 (reproduce_tree_obj): Remove prototype.
1913
1914 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1915
1916 * lisp.h (duration_to_sec_usec): Remove unused decl.
1917
1918 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1919
1920 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1921 to an allocated instance of NSString, not to the class itself.
1922
1923 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1924
1925 * makefile.w32-in (C_CTYPE_H): New macro.
1926 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1927 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1928 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1929
1930 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1931
1932 Use ASCII tests for character types.
1933 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1934 * xfns.c, xterm.c:
1935 Don't include <ctype.h>; was not needed.
1936 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1937 * sysdep.c, xfaces.c:
1938 Include <c-ctype.h> instead of <ctype.h>.
1939 * nsterm.m: Include <c-ctype.h>.
1940 * charset.c (read_hex):
1941 * doc.c (Fsnarf_documentation):
1942 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1943 (DRIVE_LETTER) [DOS_NT]:
1944 (Ffile_name_directory, Fexpand_file_name)
1945 (Fsubstitute_in_file_name):
1946 * font.c (font_parse_xlfd, font_parse_fcname):
1947 * frame.c (x_set_font_backend):
1948 * gtkutil.c (xg_get_font):
1949 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1950 * nsimage.m (hexchar):
1951 * nsterm.m (ns_xlfd_to_fontname):
1952 * sysdep.c (system_process_attributes):
1953 * xfaces.c (hash_string_case_insensitive):
1954 Use C-locale tests instead of locale-specific tests for character
1955 types, since we want the ASCII interpretation here, not the
1956 interpretation suitable for whatever happens to be the current locale.
1957
1958 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1959
1960 Consistently check windows for validity/liveness
1961 (Bug#11984, Bug#12025, Bug#12026).
1962 * lisp.h (CHECK_VALID_WINDOW): New macro.
1963 * window.c (decode_window): Rename to decode_live_window.
1964 (decode_valid_window, Fwindow_valid_p): New functions.
1965 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1966 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1967 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1968 (Fwindow_prev_sibling, Fwindow_combination_limit)
1969 (Fset_window_combination_limit, Fwindow_use_time)
1970 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1971 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1972 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1973 (Fwindow_hscroll, Fset_window_hscroll)
1974 (Fwindow_redisplay_end_trigger)
1975 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1976 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1977 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1978 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1979 (Fwindow_end, Fset_window_point, Fset_window_start)
1980 (Fpos_visible_in_window_p, Fwindow_line_height)
1981 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1982 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1983 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1984 (Fset_window_parameter, Fwindow_display_table)
1985 (Fset_window_display_table, Fdelete_other_windows_internal)
1986 (Fset_window_buffer, Fset_window_new_total)
1987 (Fset_window_new_normal, Fdelete_window_internal)
1988 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1989 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1990 (Fwindow_scroll_bars): Check whether argument window is a valid or
1991 live window. Update doc-strings.
1992 (syms_of_window): New symbol Qwindow_valid_p.
1993 * keyboard.c (Fposn_at_x_y): Check whether argument
1994 frame_or_window denotes a valid window.
1995
1996 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1997
1998 Fix previous char table change.
1999 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
2000 * chartab.c (optimize_sub_char_table): Likewise.
2001
2002 2012-08-16 Chong Yidong <cyd@gnu.org>
2003
2004 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
2005
2006 * xfont.c (xfont_open):
2007 * xftfont.c (xftfont_open): Set the font's max_width field.
2008
2009 * nsfont.m (nsfont_open): Similar to the Xft backend, set
2010 min_width to space_width and average_width to the average over
2011 printable ASCII characters.
2012 (ns_char_width): Code cleanup.
2013 (ns_ascii_average_width): New utility function.
2014
2015 * font.h (struct font): Update comments.
2016
2017 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
2018
2019 Simple interface to set Lisp_Object fields of character tables.
2020 * lisp.h (CSET): New macro.
2021 (char_table_set_extras, char_table_set_contents)
2022 (sub_char_table_set_contents): New function.
2023 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2024 * syntax.c: Adjust users.
2025
2026 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2027
2028 * eval.c (eval_sub): Bind lexical-binding.
2029 * lread.c (Qlexical_binding): Make non-static.
2030
2031 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2032
2033 * nsmenu.m (popupSession): Remove.
2034 (pop_down_menu): Remove endModalSession.
2035 (timeout_handler:): New method.
2036 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2037 Call runModalForWindow. Check timer_fired when it returns.
2038 If not set, cancel timer and break out of loop.
2039 Otherwise loop again, with a new timeout.
2040
2041 * nsterm.m: Include fcntl.h if present.
2042 (fd_entry, t_readfds, inNsSelect): Remove.
2043 (select_writefds, select_valid, select_timeout, selfds)
2044 (select_mutex, apploopnr): Add.
2045 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2046 Otherwise call kbd_buffer_store_event.
2047 (ns_send_appdefined): Remove release of fd_entry.
2048 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2049 Increment and decrement apploopnr.
2050 (ns_select): If no file descriptors, just do a NSTimer.
2051 Otherwise copy read/write masks and start select thread (fd_handler).
2052 Start main loop and wait for application defined event.
2053 Inform select thread to stop selecting after main loop is exited.
2054 (ns_term_init): Create selfds pipe and set non-blocking.
2055 Initialize select_mutex. Start the select thread (fd_handler).
2056 (fd_handler:): Loop forever, wait for info from the main thread
2057 to either start or stop selecting. When select returns, send
2058 and appdefined event.
2059 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2060 If not call kbd_buffer_store_event.
2061
2062 * nsterm.h (EmacsApp): fd_handler takes id argument.
2063 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2064
2065 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2066
2067 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2068
2069 * region-cache.c (move_cache_gap): Update gap_len using the actual
2070 growth of the boundaries array. Do not change cache_len.
2071 (Bug#12196)
2072
2073 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2074
2075 Generalize and cleanup font subsystem checks.
2076 * font.h (FONT_DEBUG, font_assert): Remove.
2077 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2078 Change font_assert to eassert. Use eassert where appropriate.
2079
2080 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2081
2082 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2083
2084 2012-08-15 Chong Yidong <cyd@gnu.org>
2085
2086 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2087 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2088 extract the font descriptor instead of just the font name.
2089 In that case, return a font spec instead of a string.
2090 (x_last_font_name): Move to this file from xfns.c.
2091
2092 * xfns.c (Fx_select_font): The return value can also be a font
2093 spec. Move x_last_font_name management to gtkutil.c.
2094
2095 * xfaces.c: Make font weight and style symbols non-static.
2096
2097 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2098
2099 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2100 (bug#12117).
2101
2102 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2103
2104 * alloc.c (Fgarbage_collect): Use plural form consistently.
2105
2106 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2107
2108 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2109 iteration through the command loop. Fixes a problem whereby mouse
2110 movements are ignored until the first mouse click.
2111
2112 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2113
2114 Use bool, not int, for Lisp booleans.
2115 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2116 makes Emacs a bit smaller and presumably a bit faster.
2117 * lisp.h: Include <stdbool.h>.
2118 (struct Lisp_Boolfwd, defvar_bool):
2119 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2120 * regex.c [!emacs]: Include <stdbool.h>.
2121 (false, true): Remove; <stdbool.h> does this for us now.
2122
2123 2012-08-14 Chong Yidong <cyd@gnu.org>
2124
2125 * character.c (Fcharacterp): Doc fix (Bug#12076).
2126
2127 * data.c (Findirect_variable): Doc fix (Bug#11040).
2128
2129 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2130
2131 * editfns.c (Fformat): Doc fix (Bug#12059).
2132 (Fsave_current_buffer): Doc fix (Bug#11542).
2133
2134 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2135
2136 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2137 (bug#12022).
2138
2139 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2140
2141 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2142 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2143 * minibuf.c (choose_minibuf_frame, read_minibuf):
2144 * w32fns.c (x_create_tip_frame):
2145 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2146 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2147
2148 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2149
2150 * intervals.c (offset_intervals): Remove obsolete comment.
2151
2152 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2153
2154 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2155
2156 2012-08-14 Gergely Risko <gergely@risko.hu>
2157
2158 * coding.c (decode_coding): Record buffer modification before
2159 disabling undo_list (Bug#11773).
2160
2161 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2162
2163 Revert and cleanup some recent overlay changes.
2164 * buffer.h (enum overlay_type): Remove.
2165 (buffer_get_overlays, buffer_set_overlays): Likewise.
2166 (buffer_set_overlays_before, buffer_set_overlays_after):
2167 New function. Adjust users.
2168 (unchain_both): Add eassert.
2169
2170 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2171
2172 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2173
2174 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2175
2176 * gtkutil.c (xg_mark_data): Don't assume C99.
2177
2178 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2179
2180 * gtkutil.c (xg_frame_tb_info): New struct.
2181 (TB_INFO_KEY): New define.
2182 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2183 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2184 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2185 if not present.
2186 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2187 is up to date. Otherwise store new data.
2188 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2189
2190 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2191
2192 Use KSET for write access to Lisp_Object members of struct kboard.
2193 * keyboard.h (KSET): New macro.
2194 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2195 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2196 * xterm.c: Adjust users.
2197
2198 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2199
2200 Use BSET for write access to Lisp_Object members of struct buffer.
2201 * buffer.h (BSET): New macro.
2202 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2203 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2204 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2205 * window.c, xdisp.c, xfns.c: Adjust users.
2206
2207 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2208
2209 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2210
2211 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2212
2213 * nsterm.m (not_in_argv): New function.
2214 (application:openFile, application:openTempFile:):
2215 (application:openFileWithoutUI:, application:openFiles:): Open file
2216 if not_in_argv returns non-zero (bug#12171).
2217
2218 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2219 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2220 Define for Gtk+ versions less than 3.2.
2221 (xg_get_font_name): Use those functions/macros here.
2222 Reported by Frans Oilinki <moilinki@gmail.com>.
2223
2224 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2225
2226 * unexmacosx.c (copy_data_segment): Copy initialized data in
2227 statically linked libraries from input file rather than memory.
2228
2229 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2230 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2231 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2232
2233 2012-08-10 Glenn Morris <rgm@gnu.org>
2234
2235 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2236 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2237
2238 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2239
2240 Fix last change to allow compilation with low optimization levels.
2241 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2242 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2243
2244 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2245
2246 Use common inline syntax in intervals.h.
2247 * intervals.h (INTERVALS_INLINE): New macro.
2248 Change all users from LISP_INLINE.
2249
2250 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2251
2252 Define Qnone once for all platforms.
2253 * frame.c (Qnone): Define here.
2254 (syms_of_frame): DEFSYM it.
2255 * lisp.h (Qnone): New declaration.
2256 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2257 * xfns.c: Remove duplication. Adjust users.
2258
2259 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2260
2261 Remove unused macros from intervals.h.
2262 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2263 * intervals.c: Adjust comment.
2264
2265 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2266
2267 * w32fns.c <w32_unicode_gui>: New static variable.
2268 (globals_of_w32fns): Initialize it according to os_subtype.
2269 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2270 testing os_subtype.
2271
2272 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2273 Eli Zaretskii <eliz@gnu.org>
2274
2275 Fix bug #10299 with Unicode characters sent by customized
2276 keyboards created by MSKLC.
2277 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2278 (w32_init_class): Use it to initialize the Emacs class with either
2279 ANSI or Unicode API calls.
2280 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2281 later.
2282 (w32_wnd_proc): If the character code sent by WM_CHAR or
2283 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2284 original message. Call DefWindowProcW on NT and later.
2285
2286 2012-08-10 Glenn Morris <rgm@gnu.org>
2287
2288 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2289
2290 * lisp.h (DIRECTORY_SEP): Let configure set it.
2291
2292 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2293
2294 Use TSET for write access to Lisp_Object slots of struct terminal.
2295 * termhooks.h (TSET): New macro.
2296 * coding.c, terminal.c, xselect.c: Adjust users.
2297
2298 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2299
2300 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2301 the failing expression, include them in the error message.
2302 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2303 * lisp.h (internal_condition_case_n): Update declaration.
2304
2305 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2306
2307 Inline functions to examine and change buffer overlays.
2308 * buffer.c (unchain_both): New function.
2309 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2310 (buffer_has_overlays): New function.
2311 (enum overlay_type): New enum.
2312 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2313 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2314
2315 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2316
2317 Inline functions to examine and change buffer intervals.
2318 * alloc.c (mark_interval_tree): Remove.
2319 (MARK_INTERVAL_TREE): Simplify.
2320 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2321 * intervals.c (buffer_balance_intervals): New function.
2322 (graft_intervals_into_buffer): Adjust indentation.
2323 (set_intervals_multibyte): Simplify.
2324 * buffer.h (BUF_INTERVALS): Remove.
2325 (buffer_get_intervals, buffer_set_intervals): New function.
2326 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2327 * intervals.c, textprop.c: Adjust users.
2328
2329 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2330
2331 Inline functions to examine and change string intervals.
2332 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2333 (string_get_intervals, string_set_intervals): New function.
2334 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2335 * lread.c, print.c, textprop.c: Adjust users.
2336
2337 2012-08-08 Glenn Morris <rgm@gnu.org>
2338
2339 * lisp.mk (lisp): Remove language/persian.elc.
2340
2341 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2342
2343 Cleanup intervals.
2344 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2345 (NULL_INTERVAL_P): Likewise. Adjust users.
2346 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2347 Adjust comment. Move under #if 0.
2348 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2349 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2350
2351 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2352
2353 Check total length of intervals with eassert.
2354 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2355 * intervals.c: Change all users to eassert.
2356
2357 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2358
2359 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2360 Rename fields to match removal of FGET and WGET and disuse of
2361 INTERNAL_FIELD in Lisp_Cons.
2362
2363 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2364
2365 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2366 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2367 name since all xname users are fixed long time ago. Do not
2368 use INTERNAL_FIELD.
2369 (set_symbol_name, set_symbol_function, set_symbol_plist):
2370 (set_symbol_next, set_overlay_plist): New function.
2371 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2372 (struct Lisp_Overlay): Likewise.
2373 (CVAR, MVAR, SVAR): Remove.
2374 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2375 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2376 * xterm.c: Adjust users.
2377 * .gdbinit: Change to use name field of struct Lisp_Symbol
2378 where appropriate.
2379
2380 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2381
2382 Basic functions to set Lisp_Object and pointer slots of intervals.
2383 * intervals.h (interval_set_parent, interval_set_object):
2384 (interval_set_left, interval_set_right, interval_set_plist):
2385 (interval_copy_parent): New function.
2386 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2387 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2388 Adjust indentation.
2389 (INTERVAL_SIZE): Remove. Adjust users.
2390 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2391
2392 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2393
2394 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2395 * process.h (PGET): Remove.
2396 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2397 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2398
2399 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2400
2401 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2402 * window.h (WGET): Remove.
2403 (struct window): Do not use INTERNAL_FIELD.
2404 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2405 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2406 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2407 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2408 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2409 Adjust users.
2410
2411 2012-08-07 Chong Yidong <cyd@gnu.org>
2412
2413 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2414 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2415 (Fdelete_window_internal): Signal an error if the window is not on
2416 a live frame (Bug#12025).
2417
2418 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2419
2420 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2421 * frame.h (FGET): Remove.
2422 (struct frame): Do not use INTERNAL_FIELD.
2423 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2424 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2425 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2426 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2427
2428 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2429
2430 * w32.c: Silence compiler warnings.
2431 (map_w32_filename): Remove unused variable `is_fat'.
2432 (chase_symlinks): Add parentheses around expression.
2433
2434 2012-08-06 Glenn Morris <rgm@gnu.org>
2435
2436 * sysdep.c: Respect BROKEN_GETWD.
2437
2438 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2439 Let configure handle it.
2440 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2441
2442 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2443
2444 Use GCALIGNMENT where appropriate.
2445 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2446 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2447 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2448
2449 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2450
2451 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2452 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2453
2454 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2455
2456 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2457 that should be sufficient for everyone.
2458
2459 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2460
2461 * keyboard.c (timer_check_2): Add break so timer_check returns next
2462 timeout.
2463
2464 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2465
2466 Fix Windows build errors introduced after converting to WGET and WSET.
2467 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2468 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2469
2470 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2471
2472 * nsterm.m (ns_frame_rehighlight): Use FSET.
2473
2474 * nsmenu.m (ns_update_menubar): Use FSET.
2475
2476 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2477
2478 Separate read and write access to Lisp_Object slots of Lisp_Process.
2479 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2480 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2481
2482 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2483
2484 Separate read and write access to Lisp_Object slots of struct window.
2485 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2486 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2487 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2488 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2489 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2490 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2491 Adjust users.
2492
2493 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2494
2495 Fix Windows build errors introduced after converting to FGET and FSET.
2496 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2497 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2498 (w32_judge_scroll_bars): Change to use FSET.
2499 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2500
2501 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2502
2503 Fix replacement typo.
2504 * window.c (replace_window): Set root_window instead of
2505 selected_window. This fixes a total window subsystem
2506 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2507
2508 2012-08-06 Glenn Morris <rgm@gnu.org>
2509
2510 * lisp.mk (lisp): Add language/persian.elc.
2511
2512 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2513
2514 Separate read and write access to Lisp_Object slots of struct frame.
2515 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2516 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2517 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2518 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2519 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2520
2521 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2522
2523 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2524
2525 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2526
2527 Generalize common compile-time constants.
2528 * lisp.h (header_size, bool_header_size, word_size): Now here.
2529 (struct Lisp_Vector): Add comment.
2530 (struct Lisp_Bool_Vector): Move up to define handy constants.
2531 (VECSIZE, PSEUDOVECSIZE): Simplify.
2532 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2533 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2534 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2535 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2536 * xfont.c, xmenu.c: Use word_size where appropriate.
2537
2538 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2539
2540 * search.c (Freplace_match): Treat \? in the replacement text
2541 literally (Bug#8161).
2542
2543 2012-08-05 Chong Yidong <cyd@gnu.org>
2544
2545 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2546 * frame.c (Vdelete_frame_functions):
2547 * emacs.c (Vkill_emacs_hook): Doc fix.
2548
2549 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2550
2551 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2552 --with-x-toolkit=no builds.
2553 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2554
2555 2012-08-04 Chong Yidong <cyd@gnu.org>
2556
2557 * syntax.c (Fmodify_syntax_entry): Doc fix.
2558
2559 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2560
2561 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2562 * w32.c (init_environment): Change the default values of many
2563 environment variables in dflt_envvars[] to NULL, to avoid pushing
2564 them into environment when they were not already defined.
2565 Remove the code that deletes site-lisp subdirectories from the default
2566 value of EMACSLOADPATH, as it is no longer needed.
2567 (check_windows_init_file): Now external, not static.
2568 Use Vload_path as is, without adding anything, as this function is now
2569 called when Vload_path is already set up.
2570
2571 * w32.h (check_windows_init_file): Add prototype.
2572
2573 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2574 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2575 compatibility with Posix platforms.
2576 (main): Move the call to check_windows_init_file to here from
2577 w32.c.
2578 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2579 any, in the DEFALT argument into the root of the Emacs build or
2580 installation tree, as appropriate.
2581
2582 * callproc.c (init_callproc_1): Call decode_env_path instead of
2583 doing its equivalent by hand.
2584 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2585 the code that sets Vexec_path run on MS-Windows.
2586
2587 * lread.c (init_lread): Add comments to #ifdef's.
2588
2589 * msdos.c (dos_set_window_size, IT_update_begin)
2590 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2591 instead of direct references.
2592
2593 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2594
2595 Export DEFAULT_REHASH_* to GDB.
2596 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2597 Now constants, not macros.
2598
2599 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2600
2601 Remove unnecessary casts involving pointers.
2602 These casts are no longer needed now that we assume C89 or later,
2603 since they involve casting to or from void *.
2604 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2605 (make_pure_float, make_pure_vector):
2606 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2607 * macros.c (Fstart_kbd_macro):
2608 * menu.c (find_and_return_menu_selection):
2609 * minibuf.c (read_minibuf_noninteractive):
2610 * sysdep.c (closedir):
2611 * xdisp.c (x_produce_glyphs):
2612 * xfaces.c (compare_fonts_by_sort_order):
2613 * xfns.c (x_real_positions, select_visual):
2614 * xselect.c (x_stop_queuing_selection_requests)
2615 (x_get_window_property, x_get_window_property_as_lisp_data):
2616 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2617 Remove unnecessary pointer casts.
2618 * alloc.c (record_xmalloc): New function.
2619 * lisp.h (record_xmalloc): New decl.
2620 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2621 more like a function. This is because the pointer cast is not
2622 needed. All uses changed.
2623 * print.c (print_string, print_error_message): Avoid length recalc.
2624
2625 Improve fix for macroexp crash with debugging (Bug#12118).
2626 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2627 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2628 not supposed to be invoked from the garbage collector.
2629 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2630 (gc_aset): New function, which is like ASET but can be
2631 used in the garbage collector.
2632 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2633 (set_hash_index): Use it instead of ASET.
2634
2635 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2636
2637 Support symlinks on latest versions of MS-Windows.
2638 * w32.c: Include winioctl.h and aclapi.h.
2639 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2640 (revert_to_self): Forward declarations of static functions.
2641 <static BOOL g_b_init_get_security_info>:
2642 <g_b_init_create_symbolic_link>: New static flags.
2643 (globals_of_w32): Initialize them to zero.
2644 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2645 (map_w32_filename): Improve commentary. Simplify switch.
2646 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2647 headers (most versions of MinGW w32api don't).
2648 (get_security_info, create_symbolic_link)
2649 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2650 New functions.
2651 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2652 in the argument file name.
2653 (sys_access): Call unc_volume_file_attributes only if
2654 GetFileAttributes fails with network-related error codes.
2655 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2656 have the required privileges.
2657 (get_file_security_desc_by_name): Rename from
2658 get_file_security_desc.
2659 (stat_worker): New function, with most of the guts of 'stat', and
2660 with addition of handling of symlinks and support for 'lstat'.
2661 If possible, get file's attributes and security information by
2662 handle, not by name. Produce S_IFLNK bit for symlinks, when
2663 called from 'lstat'.
2664 (stat, lstat): New functions, call 'stat_worker'.
2665 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2666 symlinks when the underlying filesystem supports them.
2667
2668 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2669
2670 Fix macroexp crash on Windows with debugging (Bug#12118).
2671 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2672 checking subscripts; problem introduced with the recent
2673 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2674 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2675 since it's used in non-static inline functions now.
2676
2677 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2678 Don't assume buffer size fits in 'int'. Remove unused local.
2679
2680 Use C99-style 'extern inline' if available.
2681 * buffer.h (BUFFER_INLINE):
2682 * category.h (CATEGORY_INLINE):
2683 * character.h (CHARACTER_INLINE):
2684 * charset.h (CHARSET_INLINE):
2685 * composite.h (COMPOSITE_INLINE):
2686 * dispextern.h (DISPEXTERN_INLINE):
2687 * lisp.h (LISP_INLINE):
2688 * systime.h (SYSTIME_INLINE):
2689 New macro, replacing 'static inline' in this header.
2690 * buffer.h, category.h, character.h, charset.h, composite.h:
2691 * dispextern.h, lisp.h, systime.h:
2692 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2693 * alloc.c (LISP_INLINE):
2694 * buffer.c (BUFFER_INLINE):
2695 * category.c (CATEGORY_INLINE):
2696 * character.c (CHARACTER_INLINE):
2697 * charset.c (CHARSET_INLINE):
2698 * composite.c (COMPOSITE_INLINE):
2699 * dispnew.c (DISPEXTERN_INLINE):
2700 * sysdep.c (SYSTIME_INLINE):
2701 Define to EXTERN_INLINE, so that the corresponding functions
2702 are compiled into code.
2703 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2704 (INLINE_HEADER_END): New macros.
2705 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2706 since it's used in non-static inline functions now.
2707 (VALMASK) [!USE_LSB_TAG]: Likewise.
2708
2709 2012-08-02 Glenn Morris <rgm@gnu.org>
2710
2711 * s/: Remove empty directory.
2712
2713 * s/ms-w32.h: Move to ../nt/inc.
2714 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2715 Update for new ms-w32.h location.
2716
2717 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 Port to Solaris 8.
2720 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2721
2722 2012-08-02 Glenn Morris <rgm@gnu.org>
2723
2724 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2725 hard-coding the path separator.
2726
2727 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2728
2729 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2730 This how ASET and AREF are supposed to work, and makes
2731 it easier to think about future improvements. See
2732 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2733 * charset.h (set_charset_attr): New function.
2734 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2735 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2736 (aref_addr): New function. All uses of &AREF(...) changed.
2737 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2738 (set_hash_index): New functions. All lvalue-style uses of
2739 HASH_KEY etc. changed.
2740 * keyboard.c (set_prop): New function. All lvalue-style uses
2741 of PROP changed.
2742
2743 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2744
2745 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2746 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2747 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2748 * nsfns.m (ns_set_name_as_filename): Likewise.
2749 * nsmenu.m (ns_update_menubar): Likewise.
2750 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2751
2752 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2753
2754 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2755 Adapt to latest changes in field names of the corresponding Lisp
2756 objects.
2757
2758 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2759
2760 2012-08-01 Glenn Morris <rgm@gnu.org>
2761
2762 * s/msdos.h: Remove file.
2763 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2764 * Makefile.in (S_FILE): Remove.
2765 (config_h): Remove S_FILE.
2766
2767 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2768
2769 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2770 Remove; moved to nt/config.nt.
2771
2772 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2773
2774 Use INTERNAL_FIELD for conses and overlays.
2775 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2776 Remove obsolete comment.
2777 (MVAR): New macro.
2778 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2779 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2780
2781 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2782
2783 Use INTERNAL_FIELD for symbols.
2784 * lisp.h (SVAR): New macro. Adjust users.
2785 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2786 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2787
2788 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2789
2790 Use INTERNAL_FIELD for processes.
2791 * process.h (PVAR): New macro. Adjust style.
2792 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2793 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2794
2795 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2796
2797 Use INTERNAL_FIELD for windows.
2798 * window.h (WVAR): New macro.
2799 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2800 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2801 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2802 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2803 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2804 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2805
2806 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2807
2808 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2809
2810 2012-08-01 Glenn Morris <rgm@gnu.org>
2811
2812 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2813 Move to configure.ac.
2814
2815 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2816
2817 * makefile.w32-in (CONFIG_H): Update dependencies.
2818 (CONF_POST_H): New macro.
2819
2820 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2821
2822 2012-07-31 Glenn Morris <rgm@gnu.org>
2823
2824 * Makefile.in (S_FILE): No longer set by configure.
2825
2826 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2827 is available.
2828 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2829
2830 * process.h (NULL_DEVICE):
2831 * emacs.c (SEPCHAR):
2832 * editfns.c (USER_FULL_NAME): Let configure set them.
2833
2834 * s/README, s/template.h: Remove files.
2835
2836 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2837
2838 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2839 Move to configure.ac.
2840
2841 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2842
2843 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2844 resulting renaming of 'struct frame' members.
2845
2846 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2847
2848 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2849 after introduction of FVAR.
2850
2851 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2852
2853 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2854
2855 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2856 instead of compositeToPoint.
2857 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2858
2859 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2860
2861 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2862
2863 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2864 * lisp.h (INTERNAL_FIELD): New macro.
2865 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2866 (BVAR): Change to use INTERNAL_FIELD.
2867 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2868 (KVAR): Change to use INTERNAL_FIELD.
2869 * frame.h (FVAR): New macro.
2870 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2871 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2872 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2873 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2874 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2875
2876 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2877
2878 Miscellaneous fixes for non-default X toolkits.
2879 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2880 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2881 Move under #ifdef USE_LUCID.
2882 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2883 definition and usage to avoid warnings.
2884
2885 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2886
2887 * nsterm.m (openFiles): Fix previous checkin.
2888
2889 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2890
2891 * indent.c (compute_motion): Remove unused local.
2892
2893 2012-07-31 Glenn Morris <rgm@gnu.org>
2894
2895 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2896
2897 * conf_post.h [USG5_4]:
2898 Move remaining contents of s/usg5-4-common.h here.
2899 * s/usg5-4-common.h: Remove file.
2900
2901 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2902 * s/irix6-5.h: Remove file.
2903
2904 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2905 * s/darwin.h: Remove file.
2906
2907 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2908 * s/hpux10-20.h: Remove file, which is now empty.
2909
2910 2012-07-30 Glenn Morris <rgm@gnu.org>
2911
2912 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2913 * Makefile.in (config_h): Add conf_post.h.
2914 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2915
2916 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2917
2918 * nsterm.m (ns_do_open_file): New variable.
2919 (ns_term_init): Set ns_do_open_file to YES after run returns.
2920 (openFile, openTempFile, openFileWithoutUI, openFiles):
2921 Open files only if ns_do_open_file.
2922
2923 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2924
2925 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2926 This no-op macro hasn't been needed for many years.
2927 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2928
2929 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2930 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2931 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2932 gdb_make_enums_visible.
2933 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2934 (DIRECTORY_SEP): Now a constant, not a macro.
2935
2936 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2937
2938 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2939 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2940
2941 * w32term.c <w32_keyboard_codepage>: Renamed from
2942 keyboard_codepage and now external. All users changed.
2943
2944 * w32term.h: Add declaration of w32_keyboard_codepage.
2945
2946 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2947 the codepage to translate keys to Unicode. If this argument is
2948 -1, use the value returned by GetConsoleCP. All callers changed.
2949
2950 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2951
2952 Update .PHONY listings in makefiles.
2953 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2954 bootstrap-clean, distclean, maintainer-clean, versioclean,
2955 extraclean, frc.
2956
2957 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2958 This is a bit clearer. Fix some commentary typos.
2959
2960 2012-07-30 Glenn Morris <rgm@gnu.org>
2961
2962 * s/netbsd.h: Let configure include signal.h if needed.
2963 Remove file, which is now empty.
2964
2965 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2966 Let configure set them.
2967 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2968 No more need to undefine.
2969
2970 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2971
2972 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2973 non-single-byte char when adding meta modifier. (Bug#12090)
2974
2975 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2976
2977 Convert safe_call to use variable number of arguments.
2978 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2979 (safe_call2): Fix comment.
2980 * lisp.h (safe_call): Adjust prototype.
2981 * coding.c (encode_coding_object): Change to use safe_call2.
2982 * xfaces.c (merge_face_heights): Change to use safe_call1.
2983
2984 2012-07-30 Glenn Morris <rgm@gnu.org>
2985
2986 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2987 does that unconditionally. Remove file, which is now empty.
2988
2989 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2990 Remove empty files.
2991
2992 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2993
2994 Export to GDB most of lisp.h's remaining object-like macros.
2995 * lisp.h (min, max): Move earlier, because they're used earlier now.
2996 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2997 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2998 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2999 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
3000 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
3001 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
3002 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
3003 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
3004 Now constants, for GDB. They need not be macros.
3005 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
3006 Now constants, for GDB, as well as macros, for static initializers.
3007 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
3008 Move to after the definition of struct Lisp_Char_Table,
3009 since the former now needs that type defined.
3010 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
3011 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
3012 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
3013 New enums, for gdb_make_enums_visible.
3014 (GLYPH_MODE_LINE_FACE): Remove; unused.
3015 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
3016 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
3017 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
3018 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
3019 enum maxargs, enum MAX_ALLOCA.
3020 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3021 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3022 no longer needed, now that they are done in lisp.h.
3023
3024 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3025
3026 Cleanup string bytes checking.
3027 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3028 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3029 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3030 (check_sblock, compact_small_strings): Simplify.
3031
3032 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3033
3034 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3035 These macros are confusing and no longer need to be defined, as
3036 the enum values now suffice. All uses replaced with definiens.
3037 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3038
3039 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3040
3041 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3042 ($(BLD)/w32console.$(O)): Update dependencies.
3043
3044 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3045
3046 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3047 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3048 time. Adjust users.
3049 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3050
3051 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3052
3053 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3054 setting sitelisp (Bug#12010).
3055
3056 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3057
3058 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3059
3060 * w32heap.c (cache_system_info):
3061 * w32.c (sys_rename):
3062 * w32proc.c (find_child_console, sys_kill): All users changed.
3063
3064 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3065
3066 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3067
3068 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3069
3070 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3071
3072 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3073
3074 Cleanup statistics calculation in Fgarbage_collect.
3075 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3076 Fix zombies percentage calculation. Simplify elapsed time calculation.
3077
3078 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3079
3080 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3081 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3082 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3083 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3084 (replace_range, replace_range_2, del_range_2): Change to eassert.
3085 * marker.c (byte_char_debug_check): Adjust style.
3086
3087 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3088
3089 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3090 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3091 long-ago-commented-out code that talks about "WIN32".
3092 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3093 All uses changed.
3094
3095 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3096
3097 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3098 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3099 Simplify by using alignof.
3100 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3101 * lisp.h: Include <stdalign.h>.
3102 (GCALIGNMENT): New macro and constant.
3103 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3104 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3105 (stdalign): New macro, if not already defined.
3106
3107 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3108
3109 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3110 * w32inevt.c: Include w32inevt.h.
3111 (w32_read_console_input): New inline function, calls either
3112 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3113 w32_console_unicode_input.
3114 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3115 (w32_kbd_patch_key, key_event): Use the codepage returned by
3116 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3117 (key_event): use uChar.UnicodeChar only if
3118 w32_console_unicode_input is non-zero.
3119
3120 * w32console.c: Include w32heap.h.
3121 <w32_console_unicode_input>: New global variable.
3122 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3123 family of Windows, zero otherwise.
3124
3125 * w32inevt.h: Declare w32_console_unicode_input.
3126
3127 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3128 --without-x. (Bug#11742)
3129
3130 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3131
3132 Adjust GDB to reflect pvec_type changes (Bug#12036).
3133 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3134 2012-07-04 changes to pseudovector representation.
3135 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3136
3137 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3138
3139 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3140 bus address.
3141 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3142
3143 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3144
3145 * alloc.c (listn): Fix the order the arguments are consed onto the
3146 list.
3147
3148 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3149 enumeration constants, as PURE and HEAP are too general, and clash
3150 with other headers and sources, such as gmalloc.c and the
3151 MS-Windows system headers. All users changed.
3152
3153 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3154
3155 Revert last save_excursion_save and save_excursion_restore changes.
3156 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3157 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3158
3159 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3160
3161 Fix recently-introduced typos in Windows port.
3162 Reported by Martin Rudalics <rudalics@gmx.at>.
3163 * w32.c (init_environment): Replace comma with semicolon.
3164 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3165
3166 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3167
3168 Improve GDB symbol export (Bug#12036).
3169 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3170 arms of an 'if', not using conditional expressions; otherwise GDB
3171 complains about the types in the unevaluated arm when the argument
3172 is an integer literal.
3173 (xgetint): Simplify expression.
3174 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3175 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3176 Zaretskii in <http://bugs.gnu.org/12036#13>.
3177 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3178 needed now that we have gdb_make_enums_visible.
3179 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3180 (enum enum_USE_LSB_TAG):
3181 New enum types, packaging up enums that need to be exported to GDB.
3182
3183 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3184
3185 Utility function to make a list from specified amount of objects.
3186 * lisp.h (enum constype): New datatype.
3187 (listn): New prototype.
3188 * alloc.c (listn): New function.
3189 (Fmemory_use_count, syms_of_alloc): Use it.
3190 * buffer.c (syms_of_buffer): Likewise.
3191 * callint.c (syms_of_callint): Likewise.
3192 * charset.c (define_charset_internal): Likewise.
3193 * coding.c (syms_of_coding): Likewise.
3194 * keymap.c (syms_of_keymap): Likewise.
3195 * search.c (syms_of_search): Likewise.
3196 * syntax.c (syms_of_syntax): Likewise.
3197 * w32.c (init_environment): Likewise.
3198 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3199 * xdisp.c (syms_of_xdisp): Likewise.
3200 * xfns.c (syms_of_xfns): Likewise.
3201
3202 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3203
3204 Fast save_excursion_save and save_excursion_restore.
3205 * lisp.h (struct Lisp_Excursion): New data type.
3206 (PVEC_EXCURSION): New pseudovector type.
3207 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3208 to deal with it. Adjust comments.
3209 (init_marker, attach_marker): New prototype.
3210 (unchain_marker): Adjust prototype.
3211 * marker.c (attach_marker): Change to global.
3212 (init_marker): New function.
3213 * alloc.c (Fmake_marker, build_marker): Use it.
3214 (build_marker): More easserts.
3215 (mark_object): Handle struct Lisp_Excursion.
3216 * editfns.c (save_excursion_save, save_excursion_restore):
3217 Reimplement to use struct Lisp_Excursion. Add comments.
3218
3219 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3220
3221 Fix export of symbols to GDB (Bug#12036).
3222 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3223 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3224 emacs.c, as this is a more-suitable home. Had this been done earlier
3225 the fix for 12036 would have avoided some of the problems noted in
3226 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3227 would have been more obvious.
3228 * emacs.c: Do not include <verify.h>; no longer needed.
3229 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3230 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3231 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3232 Remove; now done in lisp.h.
3233 * lisp.h (PUBLISH_TO_GDB): New macro.
3234 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3235 (DATA_SEG_BITS): Use it.
3236 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3237 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3238 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3239 not be usable in #if. This simplifies things.
3240
3241 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3242
3243 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3244
3245 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3246
3247 Simplify export of symbols to GDB (Bug#12036).
3248 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3249 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3250 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3251 Adjust to changes in lisp.h and emacs.c, by using
3252 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3253 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3254 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3255 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3256 instead of gdb_valbits.
3257 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3258 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3259 instead of gdb_array_mark_flag.
3260 (xboolvector): Get size from $->size, not $->header.size.
3261 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3262 (xreload, hook-run, hookpost-run): Remove.
3263 * emacs.c: Include <verify.h>.
3264 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3265 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3266 Remove.
3267 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3268 (gdb_USE_LSB_TAG): New enum constants.
3269 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3270 Also define these as enum constants, so they're visible to GDB.
3271 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3272 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3273 as constants, so they're visible to GDB.
3274 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3275 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3276 Now enum constants, not macros, so they're visible to GDB.
3277 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3278 more convenient now. All uses changed.
3279 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3280 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3281
3282 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3283
3284 Explicitly free restriction data that are not needed anymore.
3285 * editfns.c (save_restriction_restore): Free restriction data.
3286
3287 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3288
3289 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3290 add argument, tune behavior, and adjust all callers.
3291
3292 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3293
3294 Use typedef for EMACS_INT, EMACS_UINT.
3295 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3296 than macros. This simplifies debugging in the usual case, since
3297 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3298 and it allows expressions involving EMACS_INT casts.
3299 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3300
3301 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3302
3303 * nsterm.m (ns_read_socket): Return early if there is a modal
3304 window (Bug#12043).
3305
3306 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3307
3308 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3309 that FOCUS-FRAME can be omitted.
3310
3311 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3312
3313 Adjust buffer text indirection counters at the end of Fkill_buffer.
3314 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3315 buffer is definitely dead. This should really fix an issue reported
3316 by Christoph Scholtes again. (Bug#12007).
3317 (init_buffer_once): Initialize indirection counters of
3318 buffer_defaults and buffer_local_symbols (for sanity and safety).
3319
3320 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3321
3322 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3323 and continuation glyphs on tooltip frames, leave them at zero.
3324 Avoids continued lines in tooltips. (Bug#11832)
3325
3326 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3327
3328 Simplify copy_overlay.
3329 * buffer.c (copy_overlay): Simplify. Use build_marker.
3330 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3331
3332 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3333
3334 * print.c (print_object): Don't crash when a frame's name is nil
3335 or invalid. (Bug#12025)
3336
3337 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3338 it signals an error when a tooltip frame is being created.
3339
3340 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3341
3342 Cleanup miscellaneous objects allocation and initialization.
3343 * alloc.c (allocate_misc): Change to static. Add argument to
3344 specify the subtype. Adjust comment and users.
3345 (build_overlay): New function.
3346 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3347 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3348 (allocate_misc): Remove prototype.
3349 (build_overlay): Add prototype.
3350
3351 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3352
3353 Swap buffer text indirection counters in Fbuffer_swap_text.
3354 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3355 This avoids crash reported by Christoph Scholtes at
3356 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3357
3358 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3359
3360 * nsmenu.m (Popdown_data): New struct.
3361 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3362 free Popdown_data.
3363 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3364 (initWithContentRect): Make imgView and contentView non-static
3365 and autorelease them. Also autorelease img and matrix (Bug#12005).
3366 (dealloc): Remove (Bug#12005).
3367
3368 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3369
3370 Adjust consing_since_gc when objects are explicitly freed.
3371 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3372 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3373 (free_cons, free_misc): Subtract object size from consing_since_gc.
3374
3375 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3376
3377 Simplify and cleanup markers positioning code.
3378 * marker.c (attach_marker): More useful eassert.
3379 (live_buffer, set_marker_internal): New function.
3380 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3381 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3382
3383 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3384
3385 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3386 as it's limited by the amount of memory, not by INT_MAX.
3387
3388 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3389
3390 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3391 in special-event-map. See the discussion at
3392 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3393 for the reasons.
3394
3395 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3396 info.dwItemData. Fixes crashes on 64-bit Windows.
3397 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3398
3399 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3400
3401 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3402 (conversationIdentifier): Return value is NSInteger.
3403 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3404
3405 2012-07-21 Chong Yidong <cyd@gnu.org>
3406
3407 * window.c (decode_any_window): Signal an error if the window is
3408 on a dead frame (Bug#11984).
3409
3410 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3411
3412 Add indirection counting to speed up Fkill_buffer.
3413 * buffer.h (struct buffer): New member.
3414 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3415 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3416 base buffer indirection counter.
3417 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3418 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3419 through buffer list if indirection counter is 0.
3420
3421 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3422
3423 Extend the value returned by Fgarbage_collect with heap statistics.
3424 * alloc.c (Qheap): New symbol.
3425 (syms_of_alloc): DEFSYM it.
3426 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3427 (Fmemory_free): Remove.
3428 (syms_of_alloc): Don't defsubr it.
3429 * buffer.c (Fcompact_buffer): Remove.
3430 (syms_of_buffer): Don't defsubr it.
3431
3432 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3433
3434 Make maybe_gc inline.
3435 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3436 * lisp.h (consing_since_gc, gc_relative_threshold)
3437 (memory_full_cons_threshold): Revert declaration.
3438 (maybe_gc): Remove prototype, define as inline.
3439 * alloc.c: Remove old commented-out code.
3440 (consing_since_gc, gc_relative_threshold)
3441 (memory_full_cons_threshold): Revert to global.
3442 (maybe_gc): Remove.
3443
3444 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3445
3446 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3447 * lisp.h (build_unibyte_string): New function.
3448 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3449 * sysdep.c, w32fns.c, xfns.c: Use it.
3450 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3451 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3452 Adjust users accordingly.
3453 * font.h (font_open_by_name): Adjust prototype.
3454
3455 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3456
3457 Cleanup calls to Fgarbage_collect.
3458 * lisp.h (maybe_gc): New prototype.
3459 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3460 Remove declarations.
3461 * alloc.c (maybe_gc): New function.
3462 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3463 Make them static.
3464 * bytecode.c (MAYBE_GC): Use maybe_gc.
3465 * eval.c (eval_sub, Ffuncall): Likewise.
3466 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3467 to avoid dependency from auto-save feature.
3468
3469 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3470
3471 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3472 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3473 'for_each_per_buffer_object_at'.
3474 All uses changed. It's better to use upper-case for macros that
3475 cannot be implemented as functions, to give the reader a clue
3476 that they're special.
3477
3478 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3479
3480 * alloc.c (Fgarbage_collect): Tweak docstring.
3481
3482 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3483
3484 Tweak the value returned from Fgarbage_collect again.
3485 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3486 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3487 Adjust documentation.
3488 (total_vector_bytes): Rename to total_vector_slots, adjust
3489 accounting.
3490 (total_free_vector_bytes): Rename to total_free_vector_slots,
3491 adjust accounting.
3492 (Qstring_bytes, Qvector_slots): New symbols.
3493 (syms_of_alloc): DEFSYM them.
3494
3495 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3496
3497 Buffer compaction primitive which may be used from Lisp.
3498 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3499 (syms_of_buffer): Register Fcompact_buffer.
3500 * alloc.c (Fgarbage_collect): Use compact_buffer.
3501 * buffer.h (compact_buffer): New prototype.
3502 (struct buffer_text): New member.
3503
3504 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3505
3506 New macro to iterate over all buffers, miscellaneous cleanups.
3507 * lisp.h (all_buffers): Remove declaration.
3508 * buffer.h (all_buffers): Add declaration, with comment.
3509 (for_each_buffer): New macro.
3510 * alloc.c (Fgarbage_collect, mark_object): Use it.
3511 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3512 (init_buffer): Likewise.
3513 * data.c (Fset_default): Likewise.
3514 * coding.c (code_conversion_restore): Remove redundant check
3515 for dead buffer.
3516 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3517
3518 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3519
3520 Fix bug that created negative-length intervals.
3521 * intervals.c (merge_interval_right, merge_interval_left):
3522 Do not zero out this interval if it is absorbed by its children,
3523 as this interval's total length doesn't change in that case. See
3524 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3525
3526 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3527
3528 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3529 when invoking (make-bool-vector N t) and N is a positive
3530 multiple of 8 -- the last 8 bits were mistakenly cleared.
3531
3532 Remove some struct layout assumptions in bool vectors.
3533 * alloc.c (bool_header_size): New constant.
3534 (header_size, word_size): Move earlier, as they're now used earlier.
3535 Use 'word_size' in a few more places, where it's appropriate.
3536 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3537 padding before the data member of a bool vector.
3538 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3539 than doing the check by hand with an abort ().
3540
3541 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3542
3543 * eval.c (Fdefvar): Don't check constants since we only set the var if
3544 it's not yet defined anyway (bug#11904).
3545
3546 * lisp.h (last_undo_boundary): Declare new var.
3547 * keyboard.c (command_loop_1): Set it.
3548 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3549 were auto-added by the command loop (bug#11774).
3550
3551 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3552
3553 * w32font.c (Qsymbol): Remove local definition.
3554 (syms_of_w32font): Don't DEFSYM it.
3555
3556 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3557
3558 Fix sweep_vectors to handle large bool vectors correctly.
3559 * alloc.c (sweep_vectors): Account total_vector_bytes for
3560 bool vectors larger than VBLOCK_BYTES_MAX.
3561
3562 2012-07-18 Chong Yidong <cyd@gnu.org>
3563
3564 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3565 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3566
3567 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3568
3569 Return more descriptive data from Fgarbage_collect.
3570 Suggested by Stefan Monnier in
3571 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3572 * alloc.c (bounded_number): New function.
3573 (total_buffers, total_vectors): New variable.
3574 (total_string_size): Rename to total_string_bytes, adjust users.
3575 (total_vector_size): Rename to total_vector_bytes, adjust users.
3576 (sweep_vectors): Account total_vectors and total_vector_bytes.
3577 (Fgarbage_collect): New return value. Adjust documentation.
3578 (gc_sweep): Account total_buffers.
3579 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3580 (VECTOR_SIZE): Remove.
3581 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3582 (Qinterval, Qmisc): New symbols.
3583 (syms_of_data): Initialize them.
3584 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3585 (Qcons, Qbuffer): New declarations.
3586
3587 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3588
3589 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3590 Round up, not down. Improve doc.
3591
3592 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3593
3594 Restore old code in allocate_string_data to avoid Faset breakage.
3595 Reported by Julien Danjou <julien@danjou.info> in
3596 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3597 * alloc.c (allocate_string_data): Restore old code with minor
3598 adjustments, fix comment to explain this subtle issue.
3599
3600 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3601
3602 Remove FILE_SYSTEM_CASE.
3603 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3604
3605 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3606 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3607 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3608 call-process-region passes it through expand-file-name.
3609
3610 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3611
3612 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3613
3614 Fix crash when creating indirect buffer (Bug#11917)
3615 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3616 Don't handle unbound variables specially if non-zero.
3617 (Fbuffer_local_variables): Pass zero.
3618 (clone_per_buffer_values): Pass non-zero.
3619
3620 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3621
3622 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3623 to make the loop interruptible.
3624
3625 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3626
3627 * gnutls.c (emacs_gnutls_handshake): Only retry if
3628 GNUTLS_E_INTERRUPTED.
3629
3630 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3631
3632 Cleanup and convert miscellaneous checks to eassert.
3633 * alloc.c (mark_interval): Fix comment, partially rephrase
3634 old comment from intervals.h (see below).
3635 * intervals.c (find_interval, adjust_intervals_for_insertion)
3636 (delete_interval, adjust_intervals_for_deletion)
3637 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3638 Convert to eassert.
3639 (adjust_intervals_for_insertion, make_new_interval):
3640 Remove obsolete and unused code.
3641 * intervals.h (struct interval): Remove obsolete comment.
3642 * textprotp.c (erase_properties): Remove unused code.
3643 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3644 (Fremove_list_of_text_properties): Convert to eassert.
3645
3646 2012-07-17 Chong Yidong <cyd@gnu.org>
3647
3648 * editfns.c (Finsert_char): Doc fix.
3649
3650 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3651
3652 Fix previous change to make Fmemory_free always accurate.
3653 * alloc.c (make_interval): Update total_free_intervals.
3654 (make_float): Likewise for total_free_floats.
3655 (free_cons, Fcons): Likewise for total_free_conses.
3656 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3657 Likewise for total_free_vector_bytes.
3658 (Fmake_symbol): Likewise for total_free_symbols.
3659 (bytes_free): Remove.
3660
3661 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3662
3663 Simple free memory accounting feature.
3664 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3665 (sweep_vectors): Accumulate size of free vectors.
3666 (Fgarbage_collect): Setup bytes_free.
3667 (Fmemory_free): New function.
3668 (syms_of_alloc): Register it.
3669
3670 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3671
3672 Cleanup overlays checking.
3673 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3674 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3675 eassert and OVERLAYP.
3676 (sort_overlays): Change to use OVERLAYP.
3677
3678 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3679
3680 * editfns.c (Finsert_char): Make it interactive, and make the
3681 second arg optional. Copy interactive spec and docstring from
3682 ucs-insert.
3683
3684 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3685
3686 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3687 Unlike the other wrapped functions, fabs has an unspecified
3688 effect on errno.
3689
3690 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3691
3692 * nsterm.m (keyDown): Interpret flags without left/right bits
3693 as the left key (Bug#11670).
3694
3695 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3696
3697 Remove empty and useless init functions.
3698 * lisp.h (init_character_once, init_fns, init_image)
3699 (init_filelock, init_sound): Remove prototype.
3700 * character.c (init_character_once): Remove.
3701 * filelock.c (init_filelock): Likewise.
3702 * fns.c (init_fns): Likewise.
3703 * image.c (init_image): Likewise.
3704 * sound.c (init_sound): Likewise.
3705 * emacs.c (main): Adjust accordingly.
3706
3707 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3708
3709 * gtkutil.h: Tiny cleanups.
3710 (use_old_gtk_file_dialog): Remove useless declaration.
3711 (xg_uses_old_file_dialog): Add suggested const attribute.
3712
3713 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3714
3715 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3716 (bidi_paragraph_init): Use it to limit search forward for a strong
3717 directional character in abnormally large paragraphs full of
3718 neutral or weak characters. (Bug#11943)
3719
3720 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3721
3722 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3723 the toolbar (Bug#9451).
3724 (xg_make_tool_item): Give the widget event box a transparent
3725 background.
3726
3727 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3728
3729 Cleanup basic allocation variables and functions.
3730 * alloc.c (ignore_warnings, init_intervals, init_float)
3731 (init_cons, init_symbol, init_marker): Remove.
3732 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3733 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3734 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3735 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3736 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3737 (staticidx, init_alloc_once, init_strings, free_ablock):
3738 Remove redundant initialization.
3739 * fns.c (init_weak_hash_tables): Remove.
3740 * lisp.h (init_weak_hash_tables): Remove prototype.
3741
3742 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3743
3744 Use zero_vector where appropriate.
3745 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3746 accordingly.
3747 * lisp.h (zero_vector): New declaration.
3748 * font.c (null_vector): Remove.
3749 (syms_of_font): Remove initialization and staticpro.
3750 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3751 * keymap.c (Faccessible_keymaps): Likewise.
3752
3753 2012-07-15 Leo Liu <sdl.web@gmail.com>
3754
3755 * fringe.c: Fix typo in comments.
3756
3757 2012-07-14 Leo Liu <sdl.web@gmail.com>
3758
3759 * fringe.c: Add a new bitmap exclamation-mark.
3760
3761 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3762
3763 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3764
3765 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3766 (HAVE_MENUS): Don't define, defined by editing config.in with
3767 msdos/sed2v2.inp.
3768 (GMALLOC_INHIBIT_VALLOC): Don't define.
3769 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3770
3771 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3772
3773 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3774
3775 2012-07-14 Glenn Morris <rgm@gnu.org>
3776
3777 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3778 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3779 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3780
3781 2012-07-13 Glenn Morris <rgm@gnu.org>
3782
3783 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3784
3785 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3786 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3787
3788 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3789
3790 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3791 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3792 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3793 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3794 where appropriate.
3795 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3796 as boolean expression.
3797 (x_set_window_size): Remove unused variable toolbar.
3798 (ns_get_color_default, ns_mod_to_lisp): Remove.
3799 (ns_mouse_position): Remove unused variables xchar and ychar.
3800 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3801 (ns_set_vertical_scroll_bar): Remove unused variable count.
3802 (ns_delete_terminal): Remove unused variable i.
3803 (ns_term_init): Remove unused variables r, g and b.
3804 (mouseDown): Remove unused variable window.
3805 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3806 (initFrameFromEmacs): Remove unused variable vbextra.
3807 (mouseEntered): Remove unused variables p and dpyinfo.
3808 (mouseExited): Remove unused variables p and r.
3809 (ns_define_frame_cursor, ns_clear_frame_area)
3810 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3811 (menuDown): Assign [sender tag] to variable and cast the variable.
3812
3813 * nsterm.h (menuDown): Add id as type to argument sender.
3814 (ns_display_info_for_name): Add Lisp_Object argument.
3815 (ns_term_init): Add Lisp_Object argument.
3816 (ns_map_event_to_object): Add void argument.
3817 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3818 prototype with arguments and only declare if __OBJC__.
3819 (nxatoms_of_nsselect): Add void argument.
3820 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3821 (ns_alloc_autorelease_pool): Add void argument.
3822 (ns_release_autorelease_pool): Add void* argument.
3823 (ns_get_defaults_value): Add const char* argument.
3824
3825 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3826 (initFromContents): Use SSDATA where appropriate.
3827 (ns_update_menubar): Add braces to ambigous if-else.
3828 (initWithTitle): Put () around assignment in if statement.
3829 (ns_menu_show): Remove unused variables window and keymap.
3830 (update_frame_tool_bar): Remove unused variable selected_p.
3831 (initWithContentRect): Remove unused variable this_cmd_name.
3832
3833 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3834 appropriate.
3835 (setXBMColor): Remove unused variable len.
3836 (setPixmapData): Put () around assignment in loop statement.
3837
3838 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3839 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3840 where appropriate.
3841 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3842 around assignment in loop statement.
3843 (nsfont_open): Remove unused variable i.
3844 (nsfont_open): Remove unused variable len.
3845 (nsfont_draw): Remove unused variable cs.
3846
3847 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3848 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3849 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3850 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3851 (Fns_font_name, Fns_perform_service)
3852 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3853 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3854 (ns_set_name): Remove unused variable view.
3855 (x_set_menu_bar_lines): Remove unused variable olines.
3856 (x_set_tool_bar_lines): Remove unused variable root_window.
3857 (Fns_list_colors): Put () around assignment in while statement.
3858 (Fns_perform_service): Remove unused variable len.
3859 (Fns_display_usable_bounds): Remove unused variable top.
3860 (syms_of_nsfns): Remove unused variable i.
3861
3862 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3863 memcpy (Bug#11907).
3864
3865 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3866
3867 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3868 and free it with DestroyExceptionInfo (Bug#11558).
3869
3870 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3871
3872 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3873 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3874 Set here, not in nt/config.nt.
3875
3876 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3877
3878 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3879 cursor overflow into the last glyph on display line when the right
3880 fringe is off. (Bug#11832)
3881
3882 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3883
3884 * xdisp.c (produce_special_glyphs): Now static.
3885 * dispextern.h (produce_special_glyphs): Remove decl.
3886
3887 2012-07-13 Glenn Morris <rgm@gnu.org>
3888
3889 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3890 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3891
3892 * s/usg5-4-common.h (USG, USG5):
3893 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3894 * s/sol2-6.h (SOLARIS2):
3895 * s/irix6-5.h (IRIX6_5):
3896 * s/hpux10-20.h (USG, USG5, HPUX):
3897 * s/gnu-linux.h (USG, GNU_LINUX):
3898 * s/freebsd.h (BSD_SYSTEM):
3899 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3900 * s/cygwin.h (CYGWIN):
3901 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3902 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3903
3904 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3905
3906 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3907
3908 2012-07-13 Glenn Morris <rgm@gnu.org>
3909
3910 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3911
3912 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3913
3914 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3915 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3916
3917 2012-07-12 Glenn Morris <rgm@gnu.org>
3918
3919 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3920
3921 * process.c (init_process_emacs): Rename from init_process.
3922 The old name is also the name of a Mach system call.
3923 * lisp.h, emacs.c: Update for this name change.
3924 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3925 longer needed.
3926
3927 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3928
3929 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3930 memmove call that removes glyphs covered by the left truncation
3931 glyph. Improve commentary.
3932 (display_line): Fix display of continuation glyphs on GUI frames
3933 when the right fringe is turned off and variable-size fonts are
3934 used in the window. Move the code that appends a stretch glyph to
3935 produce_special_glyphs, so that it could be used for truncation
3936 and continuation glyphs alike.
3937 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3938 glyph of a suitably computed width, to align the special glyphs at
3939 the window margin. Code moved from display_line. (Bug#11832)
3940
3941 2012-07-12 Glenn Morris <rgm@gnu.org>
3942
3943 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3944
3945 * s/gnu-linux.h, s/hpux10-20.h:
3946 Do not unconditionally define HAVE_XRMSETDATABASE.
3947
3948 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3949
3950 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3951
3952 Fix typos that broke OS X build.
3953 Reported by Randal L. Schwartz in
3954 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3955 * nsterm.m (ns_timeout): Add missing local decl.
3956 (ns_get_color): snprintf -> sprintf, to fix typo.
3957
3958 2012-07-12 Glenn Morris <rgm@gnu.org>
3959
3960 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3961 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3962 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3963 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3964
3965 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3966 Move PTY_OPEN to configure.
3967
3968 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3969 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3970 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3971
3972 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3973
3974 Use empty_unibyte_string where applicable.
3975 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3976 * lread.c (read1): Likewise.
3977 * xsettings.c (syms_of_xsettings): Likewise.
3978
3979 2012-07-12 Glenn Morris <rgm@gnu.org>
3980
3981 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3982 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3983 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3984 * s/hpux10-20.h (RUN_TIME_REMAP):
3985 * s/bsd-common.h (TABDLY): Move to configure.
3986
3987 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3988
3989 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3990
3991 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3992 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3993
3994 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3995
3996 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3997 * s/template.h: Move NARROWPROTO to configure.
3998
3999 2012-07-11 Glenn Morris <rgm@gnu.org>
4000
4001 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
4002 unused since 2011-01-17 change to systty.h.
4003
4004 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4005 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4006 Move HAVE_PTYS and HAVE_SOCKETS to configure.
4007
4008 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4009
4010 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
4011
4012 2012-07-11 Glenn Morris <rgm@gnu.org>
4013
4014 * s/darwin.h, s/gnu-linux.h, s/template.h:
4015 Move INTERRUPT_INPUT to configure.
4016
4017 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4018
4019 Minor adjustments to interning code.
4020 * lisp.h (intern, intern_c_string): Redefine as static inline
4021 wrappers for intern_1 and intern_c_string_1, respectively.
4022 (intern_1, intern_c_string_1): Rename prototypes.
4023 * lread.c (intern_1, intern_c_string_1, oblookup):
4024 Simplify Vobarray checking.
4025 * font.c (font_intern_prop): Likewise. Adjust comment.
4026 * w32font.c (intern_font_name): Likewise.
4027
4028 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4029
4030 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4031
4032 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4033 of Fcar/Fcdr if possible.
4034 * font.c (check_otf_features): Likewise.
4035 * fontset.c (Fnew_fontset): Likewise.
4036 * gnutls.c (Fgnutls_boot): Likewise.
4037 * minibuf.c (read_minibuf): Likewise.
4038 * msdos.c (IT_set_frame_parameters): Likewise.
4039 * xmenu.c (Fx_popup_dialog): Likewise.
4040 * w32menu.c (Fx_popup_dialog): Likewise.
4041
4042 2012-07-11 Glenn Morris <rgm@gnu.org>
4043
4044 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4045 since nothing has defined it on these platforms.
4046
4047 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4048 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4049
4050 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4051 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4052 Move CLASH_DETECTION to configure.
4053
4054 * s/gnu.h: Remove file, which is now empty.
4055
4056 * s/gnu.h, s/gnu-linux.h:
4057 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4058
4059 2012-07-11 John Wiegley <johnw@newartisans.com>
4060
4061 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4062 function attribute, so we only use it if it exists in the
4063 compiler.
4064
4065 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4066
4067 Avoid call to strlen in fast_c_string_match_ignore_case.
4068 * search.c (fast_c_string_match_ignore_case): Change to use
4069 length argument. Adjust users accordingly.
4070 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4071
4072 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4073
4074 Assume mkdir, rmdir.
4075 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4076 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4077
4078 Assume rename.
4079 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4080
4081 Assume perror.
4082 * s/hpux10-20.h (HAVE_PERROR): Remove.
4083 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4084 Remove dummy definition, as this problem was obsolete long ago.
4085
4086 Assume strerror.
4087 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4088
4089 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4090
4091 Avoid calls to strlen in font processing functions.
4092 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4093 (font_open_by_name): Change to use length argument.
4094 Adjust users accordingly.
4095 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4096 Adjust prototypes.
4097 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4098 Change to return ptrdiff_t.
4099 (xfont_list_pattern, xfont_match): Use length returned by
4100 xfont_decode_coding_xlfd.
4101 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4102
4103 2012-07-11 Glenn Morris <rgm@gnu.org>
4104
4105 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4106 Move DONT_REOPEN_PTY to configure.
4107
4108 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4109 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4110
4111 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4112
4113 Remove "#define unix" that is no longer needed (Bug#11905).
4114 * s/aix4-2.h (unix): Remove; no longer needed.
4115
4116 EMACS_TIME simplification (Bug#11875).
4117 This replaces macros (which typically do not work in GDB)
4118 with functions, typedefs and enums, making the code easier to debug.
4119 The functional style also makes code easier to read and maintain.
4120 * systime.h: Include <sys/time.h> on all hosts, not just if
4121 WINDOWSNT, since 'struct timeval' is needed in general.
4122 (EMACS_TIME): Now a typedef, not a macro.
4123 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4124 not macros.
4125 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4126 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4127 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4128 (EMACS_TIME_LE): Now functions, not macros.
4129 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4130 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4131 which are not functions. All uses rewritten to use:
4132 (make_emacs_time): New function.
4133 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4134 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4135 not functions. All uses rewritten to use the following, respectively:
4136 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4137 (add_emacs_time, sub_emacs_time): New functions.
4138 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4139 * fileio.c (Fcopy_file):
4140 * xterm.c (XTflash): Get the current time closer to when it's used.
4141 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4142
4143 * bytecode.c (targets): Suppress -Woverride-init warnings.
4144
4145 Simplify by avoiding confusing use of strncpy etc.
4146 * doc.c (Fsnarf_documentation):
4147 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4148 * frame.c (Fmake_terminal_frame):
4149 * gtkutil.c (get_utf8_string):
4150 * lread.c (openp):
4151 * nsmenu.m (ns_update_menubar):
4152 * regex.c (regerror):
4153 Prefer memcpy to strncpy and strncat when either will do.
4154 * fileio.c (Fsubstitute_in_file_name):
4155 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4156 (menu_separator_name_p):
4157 * nsmenu.m (ns_update_menubar):
4158 Prefer memcmp to strncmp when either will do.
4159 * nsterm.m: Include <ftoastr.h>.
4160 (ns_get_color):
4161 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4162 Prefer snprintf to strncpy.
4163 * nsterm.m (ns_term_init):
4164 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4165 * nsterm.m (ns_term_init):
4166 Avoid the need for strncpy, by using build_string or
4167 make_unibyte_string directly. Use dtoastr, not snprintf.
4168 * process.c (Fmake_network_process): Diagnose service names that
4169 are too long, rather than silently truncating them or creating
4170 non-null-terminated names.
4171 (Fnetwork_interface_info): Likewise, for interface names.
4172 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4173 Prefer sprintf to strncat.
4174 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4175 Prefer vsnprintf to vsprintf + strncpy.
4176
4177 2012-07-10 Glenn Morris <rgm@gnu.org>
4178
4179 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4180 Clarify fallback case.
4181
4182 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4183
4184 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4185 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4186 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4187 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4188 where argument type is known to be a Lisp_Cons.
4189
4190 2012-07-10 Tom Tromey <tromey@redhat.com>
4191
4192 * bytecode.c (BYTE_CODE_THREADED): New macro.
4193 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4194 (enum byte_code_op): New type.
4195 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4196 (exec_byte_code): Use them. Use token threading when applicable.
4197
4198 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4199
4200 Optimize pure C strings initialization.
4201 * lisp.h (make_pure_string): Fix prototype.
4202 (build_pure_c_string): New function, defined as static inline. This
4203 provides a better opportunity to optimize away calls to strlen when
4204 the function is called with compile-time constant argument.
4205 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4206 argument, adjust users accordingly. Use build_pure_c_string where
4207 appropriate.
4208 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4209 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4210 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4211
4212 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4213
4214 Avoid calls to strlen in miscellaneous functions.
4215 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4216 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4217 * lread.c (openp): Likewise.
4218
4219 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4220
4221 Avoid calls to strlen in path processing functions.
4222 * fileio.c (file_name_as_directory): Add comment. Change to add
4223 srclen argument and return the length of result. Adjust users
4224 accordingly.
4225 (directory_file_name): Fix comment. Change to add srclen argument,
4226 swap 1st and 2nd arguments to obey the common convention.
4227 Adjust users accordingly.
4228 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4229
4230 2012-07-10 Glenn Morris <rgm@gnu.org>
4231
4232 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4233 Move PENDING_OUTPUT_COUNT definition to configure.
4234
4235 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4236 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4237 * s/gnu.h (DATA_START): Move definitions to configure.
4238
4239 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4240 We include usg5-4-common.h, which defines them both.
4241
4242 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4243 O_RDONLY already includes it).
4244
4245 Stop ns builds setting the EMACSLOADPATH environment variable.
4246 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4247 Now it does not set EMACSLOADPATH, just returns the load-path string.
4248 * nsterm.h: Update accordingly.
4249 * lread.c [HAVE_NS]: Include nsterm.h.
4250 (init_lread) [HAVE_NS]: Use ns_load_path.
4251 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4252
4253 2012-07-09 Glenn Morris <rgm@gnu.org>
4254
4255 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4256 since the included bsd-common.h does so.
4257
4258 Stop ns builds setting the EMACSPATH environment variable.
4259 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4260 (ns_init_paths): Do not set EMACSPATH.
4261 * nsterm.h (ns_exec_path): Add it.
4262 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4263 Use ns_exec_path.
4264
4265 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4266
4267 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4268
4269 * process.c (wait_reading_process_output): 'waitchannels' was unset
4270 when read_kbd || !NILP (wait_for_cell); fix this.
4271
4272 Add GCC-style 'const' attribute to functions that can use it.
4273 * character.h (char_resolve_modifier_mask):
4274 * keyboard.h (make_ctrl_char):
4275 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4276 (init_character_once, next_almost_prime, init_fns, init_image)
4277 (flush_pending_output, init_sound):
4278 * mem-limits.h (start_of_data):
4279 * menu.h (finish_menu_items):
4280 Add ATTRIBUTE_CONST.
4281 * emacs.c (DEFINE_DUMMY_FUNCTION):
4282 Declare the dummy function with ATTRIBUTE_CONST.
4283 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4284 Add decls with ATTRIBUTE_CONST.
4285
4286 Minor improvements to make_formatted_string.
4287 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4288 where int is good enough, as vsprintf returns an int.
4289 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4290
4291 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4292
4293 Use make_formatted_string to avoid double length calculation.
4294 * lisp.h (make_formatted_string): New prototype.
4295 * alloc.c (make_formatted_string): New function.
4296 * buffer.c (Fgenerate_new_buffer_name): Use it.
4297 * dbus.c (syms_of_dbusbind): Likewise.
4298 * editfns.c (Fcurrent_time_zone): Likewise.
4299 * filelock.c (get_boot_time): Likewise.
4300 * frame.c (make_terminal_frame, set_term_frame_name)
4301 (x_report_frame_params): Likewise.
4302 * image.c (gs_load): Likewise.
4303 * minibuf.c (get_minibuffer): Likewise.
4304 * msdos.c (dos_set_window_size): Likewise.
4305 * process.c (make_process): Likewise.
4306 * xdisp.c (ensure_echo_area_buffers): Likewise.
4307 * xsettings.c (apply_xft_settings): Likewise.
4308
4309 2012-07-09 Glenn Morris <rgm@gnu.org>
4310
4311 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4312 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4313 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4314 * nsterm.h (ns_etc_directory): Add it.
4315 * callproc.c [HAVE_NS]: Include nsterm.h.
4316 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4317
4318 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4319
4320 Move marker debugging code under MARKER_DEBUG.
4321 * marker.c (MARKER_DEBUG): Move marker debugging code under
4322 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4323 for bootstrap with --enable-checking (~3x slowdown reported
4324 by Juanma Barranquero <lekktu@gmail.com>).
4325 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4326
4327 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4328
4329 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4330 See <http://bugs.gnu.org/11825#29>.
4331
4332 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4333
4334 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4335 has no font, use the frame's font. (Bug#11813)
4336 (display_line): Add commentary about displaying truncation glyphs
4337 on GUI frames.
4338 (produce_special_glyphs): Move here from term.c.
4339
4340 * term.c (produce_special_glyphs): Move to xdisp.c.
4341
4342 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4343 section.
4344
4345 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4346
4347 * xdisp.c (display_line): Avoid warning about implicit declaration
4348 of FRAME_FONT.
4349
4350 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4351
4352 * lisp.h: Remove empty conditional.
4353
4354 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4355
4356 * lread.c (load_path_check): Now static.
4357
4358 Fix some minor --with-ns problems found by static checking.
4359 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4360 (x_set_font) [!HAVE_X_WINDOWS]:
4361 * image.c (xpm_load_image) [HAVE_NS]:
4362 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4363 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4364 Remove unused local.
4365 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4366 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4367 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4368 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4369 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4370 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4371 Fix pointer signedness problem.
4372 * xfaces.c (FRAME_X_FONT_TABLE):
4373 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4374
4375 2012-07-07 Glenn Morris <rgm@gnu.org>
4376
4377 * lread.c (load_path_check): New function, split from init_lread.
4378 (init_lread): Reorganize. Motivation:
4379 If EMACSLOADPATH is set, check/warn about that rather than the
4380 defaults, which we are not going to use. Hence we can remove
4381 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4382 Don't warn if site-lisp directories are missing.
4383 If not installed, start from a blank load-path, since
4384 PATH_LOADSEARCH refers to the eventual installation directories.
4385
4386 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4387
4388 Support truncation and continuation glyphs on GUI frames, when
4389 fringes are disabled. (Bug#11832)
4390 * xdisp.c (init_iterator): Get dimensions of truncation and
4391 continuation glyphs even if on GUI frames.
4392 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4393 or both, are absent.
4394 (start_display, move_it_in_display_line_to): Handle the case of a
4395 GUI frame without a fringe to display continuation or truncation
4396 glyphs.
4397 (insert_left_trunc_glyphs): Support GUI frames: make sure
4398 truncation glyphs overwrite enough glyphs from the current line to
4399 have sufficient space in pixels.
4400 (display_line): Support truncation and continuation glyphs on GUI
4401 frames. If some spare pixels are left on the line after inserting
4402 the truncation glyphs, fill that space with a stretch glyph of a
4403 suitably computed width.
4404
4405 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4406 produce_glyphs, to support GUI sessions.
4407
4408 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4409
4410 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4411
4412 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4413
4414 Do not require float-time's arg to fit in time_t (Bug#11825).
4415 This works better on hosts where time_t is unsigned, and where
4416 float-time is applied to the (negative) difference between two times.
4417 * editfns.c (decode_time_components): Last arg is now double *,
4418 not int *, and means to store all the result as a double, without
4419 worrying about whether the seconds part fits in time_t.
4420 All callers changed.
4421 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4422 All callers changed.
4423 (Ffloat_time): Do not fail merely because the specified time falls
4424 outside of time_t range.
4425
4426 2012-07-07 Glenn Morris <rgm@gnu.org>
4427
4428 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4429 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4430 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4431
4432 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4433
4434 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4435 Update dependencies.
4436
4437 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4438
4439 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4440
4441 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4442 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4443 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4444 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4445 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4446 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4447
4448 * xfont.c (compare_font_names): Redo to omit the need for casts.
4449
4450 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4451
4452 * xfns.c (Fx_change_window_property): Doc fix.
4453 * w32fns.c (Fx_change_window_property): Doc fix.
4454
4455 * w32fns.c (Fx_window_property): Accept the same arguments as the
4456 X Windows version. Doc fix.
4457 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4458
4459 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4460 Eli Zaretskii <eliz@gnu.org>
4461
4462 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4463 Windows-specific code from nt/config.nt moved here.
4464 Obsolete settings removed.
4465
4466 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4467
4468 * process.c: Avoid unnecessary calls to gettime.
4469 (wait_reading_process_output): Don't get the time of day
4470 when gobbling data immediately and not waiting, as there's no need
4471 for it in that case. This removes a FIXME.
4472
4473 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4474
4475 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4476 is defined (Bug#11768).
4477
4478 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4479
4480 Fix marker debugging code.
4481 * marker.c (byte_char_debug_check): Do not perform the check
4482 if buffer is not multibyte.
4483 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4484 Call byte_char_debug_check with correct arguments.
4485
4486 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4487
4488 Compile marker debugging code only if ENABLE_CHECKING is defined.
4489 * marker.c (byte_char_debug_check, count_markers):
4490 Use only if ENABLE_CHECKING is defined.
4491 (byte_debug_flag): Remove.
4492 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4493 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4494
4495 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4496
4497 Avoid code repetition in marker-related functions.
4498 * marker.c (attach_marker): New function.
4499 (Fset_marker, set_marker_restricted, set_marker_both)
4500 (set_marker_restricted_both): Use it.
4501 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4502 Consistently rename charno to charpos.
4503 (marker_position): Add eassert.
4504 (marker_byte_position): Convert to eassert.
4505
4506 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4507
4508 Simplify list operations in unchain_overlay and unchain_marker.
4509 * buffer.c (unchain_overlay): Simplify. Add comment.
4510 * marker.c (unchain_marker): Simplify. Fix comments.
4511
4512 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4513
4514 Introduce fast path for the widely used marker operation.
4515 * alloc.c (build_marker): New function.
4516 * lisp.h (build_marker): New prototype.
4517 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4518 * composite.c (autocmp_chars): Likewise.
4519 * editfns.c (buildmark): Remove.
4520 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4521 (save_restriction_save): Use build_marker.
4522 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4523 * window.c (save_window_save): Likewise.
4524
4525 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4526
4527 Do not use Fdelete_overlay in delete_all_overlays
4528 to avoid redundant calls to unchain_overlay.
4529 * buffer.c (drop_overlay): New function.
4530 (delete_all_overlays, Fdelete_overlay): Use it.
4531 * minibuf.c (get_minibuffer): Fix comment.
4532
4533 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4534
4535 Port to OpenBSD 5.1 amd64.
4536 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4537 This is needed for OpenBSD, and should be harmless on all BSD systems.
4538 Also, include <sys/sysctl.h>, as it should be available on all
4539 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4540 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4541 use p_pid member, not kp_proc.pid.
4542
4543 2012-07-06 Glenn Morris <rgm@gnu.org>
4544
4545 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4546
4547 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4548
4549 More xmalloc and related cleanup.
4550 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4551 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4552 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4553 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4554 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4555 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4556 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4557 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4558 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4559 * xterm.c:
4560 Omit needless casts involving void * pointers and allocation.
4561 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4562 as the former is more robust if P's type is changed.
4563 Prefer xzalloc to xmalloc + memset 0.
4564 Simplify malloc-or-realloc to realloc.
4565 Don't worry about xmalloc returning a null pointer.
4566 Prefer xstrdup to xmalloc + strcpy.
4567 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4568 growing it.
4569 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4570 alloca of a constant.
4571
4572 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4573
4574 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4575 hscroll is larger than the line width. Fixes long and futile
4576 looping inside extend_face_to_end_of_line (on a TTY) producing
4577 glyphs that are not needed and thrown away.
4578
4579 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4580
4581 * marker.c (set_marker_restricted_both): Simplify by using
4582 clip_to_bounds.
4583
4584 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4585
4586 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4587
4588 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4589
4590 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4591 not defined (Bug#11768).
4592 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4593 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4594 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4595 followed by gtk_box_set_homogeneous (Bug#11768).
4596 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4597 (update_theme_scrollbar_width, xg_create_scroll_bar):
4598 Use gtk_scrollbar_new (Bug#11768).
4599 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4600 (is_box_type): New function (Bug#11768).
4601 (xg_tool_item_stale_p): Call is_box_type.
4602 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4603 with default display (Bug#11768).
4604
4605 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4606
4607 * xdisp.c (window_hscroll_limited): New function.
4608 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4609 coordinates when window's hscroll is set to insanely large
4610 values. (Bug#11857)
4611
4612 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4613
4614 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4615 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4616
4617 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4618
4619 Cleanup xmalloc.
4620 * lisp.h (xzalloc): New prototype. Omit needless casts.
4621 * alloc.c (xzalloc): New function. Omit needless casts.
4622 * charset.c: Omit needless casts. Convert all calls to
4623 xmalloc with following memset to xzalloc.
4624 * dispnew.c: Likewise.
4625 * fringe.c: Likewise.
4626 * image.c: Likewise.
4627 * sound.c: Likewise.
4628 * term.c: Likewise.
4629 * w32fns.c: Likewise.
4630 * w32font.c: Likewise.
4631 * w32term.c: Likewise.
4632 * xfaces.c: Likewise.
4633 * xfns.c: Likewise.
4634 * xterm.c: Likewise.
4635 * atimer.c: Omit needless casts.
4636 * buffer.c: Likewise.
4637 * callproc.c: Likewise.
4638 * ccl.c: Likewise.
4639 * coding.c: Likewise.
4640 * composite.c: Likewise.
4641 * doc.c: Likewise.
4642 * doprnt.c: Likewise.
4643 * editfns.c: Likewise.
4644 * emacs.c: Likewise.
4645 * eval.c: Likewise.
4646 * filelock.c: Likewise.
4647 * fns.c: Likewise.
4648 * gtkutil.c: Likewise.
4649 * keyboard.c: Likewise.
4650 * lisp.h: Likewise.
4651 * lread.c: Likewise.
4652 * minibuf.c: Likewise.
4653 * msdos.c: Likewise.
4654 * print.c: Likewise.
4655 * process.c: Likewise.
4656 * region-cache.c: Likewise.
4657 * search.c: Likewise.
4658 * sysdep.c: Likewise.
4659 * termcap.c: Likewise.
4660 * terminal.c: Likewise.
4661 * tparam.c: Likewise.
4662 * w16select.c: Likewise.
4663 * w32.c: Likewise.
4664 * w32reg.c: Likewise.
4665 * w32select.c: Likewise.
4666 * w32uniscribe.c: Likewise.
4667 * widget.c: Likewise.
4668 * xdisp.c: Likewise.
4669 * xmenu.c: Likewise.
4670 * xrdb.c: Likewise.
4671 * xselect.c: Likewise.
4672
4673 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 * fileio.c (time_error_value): Check the right error number.
4676 Problem reported by Troels Nielsen in
4677 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4678
4679 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4680
4681 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4682 This should be fixed in a better way; see Eli Zaretskii in
4683 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4684 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4685
4686 * fileio.c (time_error_value): Rename from special_mtime.
4687 The old name's problems were noted by Eli Zaretskii in
4688 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4689
4690 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4691 This variable's comment says Emacs needs at least one GDB-visible
4692 symbol of type enum pvec_type, to work around GDB problems.
4693 The symbol's value doesn't matter.
4694
4695 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4696 that causes compilation to fail on pre-C99 compilers.
4697
4698 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4699
4700 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4701 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4702
4703 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4704
4705 * buffer.c (init_buffer_once): Fix initialization of
4706 headers for buffer_defaults and buffer_local_symbols.
4707 Reported by Juanma Barranquero <lekktu@gmail.com>.
4708
4709 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4710
4711 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4712 * lisp.h (enum pvec_type): Use fewer bits.
4713 (PSEUDOVECTOR_SIZE_BITS): New constant.
4714 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4715 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4716 change in pvec_type.
4717 (PSEUDOVECTOR_TYPEP): New macro.
4718 (TYPED_PSEUDOVECTORP): Use it.
4719 * fns.c (internal_equal): Adapt code to extract pvectype.
4720 * emacs.c (gdb_pvec_type): Update type.
4721 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4722 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4723 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4724 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4725 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4726 abusing vector->header.next.nbytes.
4727 (live_vector_p): Use PVEC_TYPE.
4728 (mark_object): Adapt code to extract pvectype. Use switch.
4729
4730 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4731
4732 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4733 Tighten new eassert a bit.
4734
4735 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4736
4737 Fix compilation with --enable-gcc-warnings and -O1
4738 optimization level.
4739 * doprnt.c (doprnt): Change type of tem to int, initialize
4740 to avoid compiler warning. Add eassert.
4741 * search.c (simple_search): Initialize match_byte to avoid
4742 compiler warning. Add eassert.
4743
4744 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4745
4746 Avoid weird behavior with large horizontal scrolls.
4747 Without this change, for example, large hscroll values would
4748 mess up Emacs's display on Fedora 15 x86, presumably due to
4749 overflows in int calculations in the display code.
4750 Also, if buffers had long lines, Emacs would freeze.
4751 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4752 (set_window_hscroll): New function, containing the old guts of
4753 Fset_window_hscroll. Return the clipped value.
4754 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4755 This avoids the need to check against PTRDIFF_MAX.
4756
4757 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4758
4759 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4760
4761 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4762
4763 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4764
4765 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4766 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4767 since GCC 4.4.6 issues a bogus warning for them.
4768
4769 Fix bugs in file timestamp newness comparisons.
4770 * fileio.c (Ffile_newer_than_file_p):
4771 * lread.c (Fload): Use full timestamp resolution of files,
4772 not just the 1-second resolution, so that files that are only
4773 slightly newer still count as newer.
4774 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4775 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4776
4777 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4778
4779 * fileio.c: Improve handling of file time marker. (Bug#11852)
4780 (special_mtime): New function.
4781 (Finsert_file_contents, Fverify_visited_file_modtime):
4782 Use it to set special mtime values consistently.
4783
4784 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4785
4786 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4787 marker for non-existing file. (Bug#11852)
4788
4789 2012-07-03 Glenn Morris <rgm@gnu.org>
4790
4791 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4792 and did not make it into globals.h).
4793
4794 2012-07-03 Tom Tromey <tromey@redhat.com>
4795
4796 * window.c (Fset_window_margins, Fset_window_fringes)
4797 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4798 * textprop.c (Fprevious_property_change): No longer static.
4799 * syntax.c (Fsyntax_table_p): No longer static.
4800 * process.c (Fget_process, Fprocess_datagram_address): No longer
4801 static.
4802 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4803 * keyboard.c (Fcommand_execute): No longer static.
4804 Remove EXFUN.
4805 * insdel.c (Fcombine_after_change_execute): No longer static.
4806 * image.c (Finit_image_library): No longer static.
4807 * fileio.c (Fmake_symbolic_link): No longer static.
4808 * eval.c (Ffetch_bytecode): No longer static.
4809 * editfns.c (Fuser_full_name): No longer static.
4810 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4811 No longer static.
4812 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4813 static.
4814 * dired.c (Ffile_attributes): No longer static.
4815 * composite.c (Fcomposition_get_gstring): No longer static.
4816 * callproc.c (Fgetenv_internal): No longer static.
4817
4818 * ccl.h: Remove EXFUNs.
4819 * buffer.h: Remove EXFUNs.
4820 * dispextern.h: Remove EXFUNs.
4821 * intervals.h: Remove EXFUNs.
4822 * fontset.h: Remove EXFUN.
4823 * font.h: Remove EXFUNs.
4824 * dosfns.c (system_process_attributes): Remove EXFUN.
4825 * keymap.h: Remove EXFUNs.
4826 * lisp.h: Remove EXFUNs.
4827 * w32term.h: Remove EXFUNs.
4828 * window.h: Remove EXFUNs.
4829 * xsettings.h: Remove EXFUN.
4830 * xterm.h: Remove EXFUN.
4831
4832 2012-07-03 Glenn Morris <rgm@gnu.org>
4833
4834 * lisp.h (Frandom): Make it visible to C.
4835 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4836 buffer for invisible buffers. (Bug#1229)
4837
4838 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4839
4840 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4841 values which aren't power of 2.
4842 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4843 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4844 accordingly.
4845
4846 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4847
4848 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4849
4850 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4851
4852 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4853
4854 * alloc.c (allocate_vector_block): Remove redundant
4855 calls to mallopt if DOUG_LEA_MALLOC is defined.
4856 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4857 avoid calls to mallopt if zero_vector is returned.
4858
4859 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4860
4861 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4862 is enabled, avoid dereferencing NULL current_sblock if
4863 running undumped.
4864
4865 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4866
4867 Cleanup basic buffer management.
4868 * buffer.h (struct buffer): Change layout to use generic vector
4869 marking code. Fix some comments. Change type of 'clip_changed'
4870 to bitfield. Remove unused #ifndef old.
4871 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4872 (GET_OVERLAYS_AT): Fix indentation.
4873 (for_each_per_buffer_object_at): New macro.
4874 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4875 (Fbuffer_local_variables): Use it.
4876 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4877 * alloc.c (allocate_buffer): Adjust to match new layout of
4878 struct buffer. Fix comment.
4879 (mark_overlay): New function.
4880 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4881 Lisp area of struct buffer.
4882 (mark_object): Use it. Adjust marking of misc objects
4883 and related comments.
4884
4885 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4886
4887 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4888 wrapper that is not needed because the wrapped code is a no-op (zero
4889 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4890 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4891
4892 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4893
4894 * alloc.c (mark_buffer): Simplify. Remove prototype.
4895 (mark_object): Add comment. Reorganize marking of vector-like
4896 objects. Use CHECK_LIVE for all vector-like objects except buffers
4897 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4898 Avoid redundant calls to mark_vectorlike for bool vectors.
4899
4900 2012-06-30 Glenn Morris <rgm@gnu.org>
4901
4902 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4903
4904 * epaths.in (PATH_SITELOADSEARCH): New.
4905 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4906 This is rather than relying on --enable-locallisppath elements
4907 having "site-lisp" in their names. (Bug#10208#25, 11658)
4908
4909 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4910
4911 * w32proc.c (sys_select): Accept and ignore one more argument.
4912
4913 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4914
4915 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4916 (pselect) [!MS_DOS]: Redirect to sys_select.
4917
4918 * sysdep.c: Don't include dos.h and dosfns.h.
4919
4920 * process.c (sys_select):
4921 * msdos.c (sys_select): Accept one more argument and ignore it.
4922
4923 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4924 adapt data types and code to that.
4925
4926 * dosfns.c:
4927 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4928 which clashes with the gnulib function of the same name.
4929
4930 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4931
4932 * font.c (font_style_to_value, font_style_symbolic)
4933 (font_prop_validate_style): Add type checks for values in
4934 font_style_table.
4935
4936 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4937 argument.
4938 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4939 uses.
4940
4941 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4942
4943 * xdisp.c (try_window_id): Undo last change.
4944
4945 * w32.c (getwd): Adjust commentary about startup_dir.
4946 (init_environment): Always call sys_access, even in non-MSVC
4947 builds. Don't chdir to the directory of the Emacs executable.
4948 This undoes code from 1997 which was justified by the need to
4949 "avoid conflicts when removing and renaming directories". But its
4950 downside was that every relative file name was being interpreted
4951 relative to the directory of the Emacs executable, which can never
4952 be TRT. In particular, it broke sys_access when called with
4953 relative file names.
4954 (sys_access): Map GetLastError to errno.
4955
4956 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4957
4958 * window.h (struct window): Change type of 'fringes_outside_margins'
4959 to bitfield. Fix comment. Adjust users accordingly.
4960 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4961 Adjust comment.
4962 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4963 to ptrdiff_t.
4964
4965 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4966
4967 * gnutls.c (emacs_gnutls_handshake):
4968 Add QUIT to make the loop interruptible.
4969
4970 2012-06-29 Glenn Morris <rgm@gnu.org>
4971
4972 * charset.c (init_charset): Make lack of etc/charsets fatal.
4973
4974 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4975
4976 * editfns.c (region_limit): Fix type mismatch.
4977
4978 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4979
4980 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4981 undefined. Convert from xassert to eassert.
4982 * nsmenu.m: Convert from xassert to eassert.
4983 * nsterm.m: Likewise.
4984
4985 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4986
4987 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4988
4989 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4990
4991 Avoid integer overflow on scroll-left and scroll-right.
4992 * window.c (HSCROLL_MAX): New macro.
4993 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4994 overflow when requested scroll falls outside ptrdiff_t range.
4995
4996 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4997
4998 * window.h (struct window): Change type of 'hscroll',
4999 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
5000 'last_modified' and 'last_overlay_modified' to EMACS_INT.
5001 Adjust users accordingly.
5002 * xdisp.c (try_cursor_movement): Replace type check with eassert.
5003 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
5004 from EMACS_INT to ptrdiff_t.
5005 (make_window): Omit redundant initialization.
5006
5007 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
5008
5009 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
5010
5011 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5012
5013 * window.h (struct window): Change type of 'use_time' and
5014 'sequence_number' from Lisp_Object to int.
5015 * frame.c (make_frame): Adjust users accordingly.
5016 * print.c (print_object): Likewise.
5017 * window.c (select_window, Fwindow_use_time, make_parent_window)
5018 (make_window): Likewise.
5019
5020 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5021
5022 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5023 enabled with --enable-checking=[all,glyphs] configure option.
5024 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5025 adjust comments accordingly.
5026 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5027 undefined, adjust comments accordingly.
5028 * image.c: Likewise.
5029 * scroll.c: Likewise.
5030 * w32fns.c: Likewise.
5031 * w32term.c: Likewise.
5032 * xdisp.c: Likewise.
5033 * xfaces.c: Likewise.
5034 * xfns.c: Likewise.
5035 * xterm.c: Likewise.
5036
5037 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5038
5039 Generalize run-time debugging checks.
5040 * dispextern.h (XASSERTS): Remove.
5041 * fontset.c (xassert): Remove.
5042 Convert from xassert to eassert.
5043 * alloc.c: Convert from xassert to eassert.
5044 * bidi.c: Likewise.
5045 * dispnew.c: Likewise.
5046 * fns.c: Likewise.
5047 * fringe.c: Likewise.
5048 * ftfont.c: Likewise.
5049 * gtkutil.c: Likewise.
5050 * image.c: Likewise.
5051 * keyboard.c: Likewise.
5052 * menu.c: Likewise.
5053 * process.c: Likewise.
5054 * scroll.c: Likewise.
5055 * sound.c: Likewise.
5056 * term.c: Likewise.
5057 * w32console.c: Likewise.
5058 * w32fns.c: Likewise.
5059 * w32term.c: Likewise.
5060 * window.c: Likewise.
5061 * xdisp.c: Likewise.
5062 * xfaces.c: Likewise.
5063 * xfns.c: Likewise.
5064 * xselect.c: Likewise.
5065 * xterm.c: Likewise.
5066
5067 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5068
5069 * fns.c (maybe_resize_hash_table): Output message when growing the
5070 purify-hashtable.
5071
5072 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5073
5074 * alloc.c (allocate_string_data): Remove dead code.
5075 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5076 avoid GCC warning about unused macro.
5077
5078 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5079
5080 * alloc.c (allocate_string): Omit intervals initialization.
5081 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5082 as in make_pure_string and make_pure_c_string.
5083
5084 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5085
5086 * alloc.c (allocate_string): Fix last change.
5087
5088 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5089
5090 * alloc.c (allocate_string): Remove two redundant calls
5091 to memset, add explicit initialization where appropriate.
5092
5093 2012-06-27 Glenn Morris <rgm@gnu.org>
5094
5095 * lisp.mk (lisp): Remove paths.elc.
5096
5097 2012-06-27 Chong Yidong <cyd@gnu.org>
5098
5099 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5100
5101 2012-06-26 John Wiegley <johnw@newartisans.com>
5102
5103 * unexmacosx.c (copy_data_segment): Add two section names used
5104 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5105
5106 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5107 when building with Clang.
5108
5109 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5110
5111 * eval.c (Fapply): Allow calling it with a single argument.
5112
5113 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5114
5115 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5116 _stricmp and _strnicmp.
5117 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5118
5119 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5120
5121 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5122 allocated window.
5123 (allocate_process): Likewise for new process.
5124 (allocate_terminal): Change to use offsetof.
5125 (allocate_frame): Likewise.
5126 * frame.c (make_frame): Omit redundant initialization.
5127 * window.c (make_parent_window): Use memset.
5128 (make_window): Omit redundant initialization.
5129 * process.c (make_process): Omit redundant initialization.
5130 * terminal.c (create_terminal): Likewise.
5131
5132 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5133
5134 * term.c (delete_tty): Remove redundant call to memset.
5135
5136 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5137
5138 * alloc.c: Remove build_string.
5139 * lisp.h: Define build_string as static inline. This provides
5140 a better opportunity to optimize away calls to strlen when the
5141 function is called with compile-time constant argument.
5142 * image.c (imagemagick_error): Convert to build_string.
5143 * w32proc.c (sys_spawnve): Likewise.
5144 * xterm.c (x_term_init): Likewise.
5145
5146 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5147
5148 Use sprintf return value instead of invoking strlen on result.
5149 In the old days this wasn't portable, since some sprintf
5150 implementations returned char *. But they died out years ago and
5151 Emacs already assumes sprintf returns int.
5152 Similarly for float_to_string.
5153 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5154 * ccl.c (ccl_driver):
5155 * character.c (string_escape_byte8):
5156 * data.c (Fnumber_to_string):
5157 * doprnt.c (doprnt):
5158 * print.c (print_object):
5159 * xdisp.c (message_dolog):
5160 * xfns.c (syms_of_xfns):
5161 Use sprintf or float_to_string result to avoid need to call strlen.
5162 * data.c (Fnumber_to_string):
5163 Use make_unibyte_string, since the string must be ASCII.
5164 * lisp.h, print.c (float_to_string): Now returns int length.
5165 * term.c (produce_glyphless_glyph):
5166 Use sprintf result rather than recomputing it.
5167
5168 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5169 * Makefile.in (ALL_CFLAGS):
5170 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5171 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5172
5173 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5174
5175 * dispextern.h (xstrcasecmp): Define to library function
5176 strcasecmp if available.
5177 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5178
5179 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5180
5181 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5182 Avoid comma operator.
5183 * menu.c (push_submenu_start, push_submenu_end)
5184 (push_left_right_boundary, push_menu_pane): Likewise.
5185 * msdos.c (dos_rawgetc): Likewise.
5186
5187 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5188
5189 * xfns.c (xic_create_fontsetname): Remove redundant calls
5190 to memset.
5191
5192 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5193
5194 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5195 sprintf already null-terminates its output.
5196
5197 * xfns.c (x_window): Remove redundant cast.
5198
5199 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5200
5201 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5202 `const char *' to `char *' to avoid compiler warning.
5203
5204 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5205
5206 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5207 instead of truncating it to 63 (admittedly a generous limit).
5208
5209 * process.c: Fix spelling and caps in comments.
5210
5211 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5212
5213 * emacs.c (setpgrp): Remove definition, unused.
5214 * sysdep.c (setpgrp): Remove definition, not used in this file.
5215
5216 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5217
5218 * makefile.w32-in: Update dependencies.
5219
5220 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5221
5222 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5223 (SYSTIME_H): Add nt/inc/sys/time.h.
5224
5225 * systime.h [WINDOWSNT]: Include sys/time.h.
5226
5227 * s/ms-w32.h (struct timespec): Definition moved from
5228 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5229
5230 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5231
5232 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5233 * buffer.h (buffer_slot_type_mismatch):
5234 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5235 * eval.c (unwind_to_catch):
5236 * image.c (my_png_error, my_error_exit):
5237 * keyboard.c (quit_throw_to_read_char, user_error)
5238 (Fexit_recursive_edit, Fabort_recursive_edit):
5239 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5240 (wrong_type_argument, buffer_overflow, __executable_start)
5241 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5242 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5243 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5244 (fatal):
5245 (child_setup) [!DOS_NT]:
5246 * lread.c (end_of_file_error, invalid_syntax):
5247 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5248 * puresize.h (pure_write_error):
5249 * search.c (matcher_overflow):
5250 * sound.c (sound_perror, alsa_sound_perror):
5251 * sysdep.c, syssignal.h (croak):
5252 * term.c (maybe_fatal, vfatal):
5253 * textprop.c (text_read_only):
5254 * undo.c (user_error):
5255 * unexmacosx.c (unexec_error):
5256 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5257 Use _Noreturn rather than NO_RETURN.
5258 No need for separate decl merely because of _Noreturn.
5259 * sound.c (sound_warning, parse_sound):
5260 Remove unnecessary forward decls.
5261
5262 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5263
5264 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5265 * lisp.h (WAIT_READING_MAX): New macro.
5266 * dispnew.c (Fsleep_for, sit_for):
5267 * keyboard.c (kbd_buffer_get_event):
5268 * process.c (Faccept_process_output):
5269 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5270 This improves on the previous patch, which introduced a bug
5271 when time_t is unsigned and as wide as intmax_t.
5272 See <http://bugs.gnu.org/9000#51>.
5273
5274 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5275
5276 * dispnew.c (sit_for, Fsleep_for):
5277 * keyboard.c (kbd_buffer_get_event):
5278 * process.c (Faccept_process_output): Avoid compiler warnings when
5279 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5280
5281 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5282
5283 * makefile.w32-in: Update dependencies.
5284
5285 * w32.c (ltime): Add return type and declare static.
5286 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5287
5288 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5289
5290 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5291 Privately reported by Herbert J. Skuhra.
5292 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5293 All uses changed.
5294 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5295 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5296
5297 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5298
5299 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5300 last argument of make_unibyte_string.
5301
5302 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5303 language ID in the event parameters.
5304
5305 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5306 event.code, not the obscure "character set ID".
5307
5308 2012-06-23 Chong Yidong <cyd@gnu.org>
5309
5310 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5311
5312 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5313
5314 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5315 * w32.c (fdutimens): New function.
5316
5317 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5318
5319 * s/ms-w32.h (pselect): Redirect to sys_select.
5320
5321 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5322
5323 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5324 in the logic of incrementing and decrementing the value of
5325 use_relocatable_buffers.
5326
5327 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5328
5329 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5330 Privately reported by Herbert J. Skuhra.
5331 [__FreeBSD__]: Remove "*/" typo after "#include".
5332 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5333 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5334 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5335 Don't assume EMACS_TIME and struct timeval are the same type.
5336
5337 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5338
5339 Support higher-resolution time stamps (Bug#9000).
5340 The time stamps are only nanosecond-resolution at the C level,
5341 since that's the best that any real-world system supports now.
5342 But they are picosecond-resolution at the Lisp level, as that's
5343 easy, and leaves room for future OS improvements.
5344
5345 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5346 (LIBES): Use it.
5347
5348 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5349 Don't get current time unless it's needed.
5350
5351 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5352 now provides it if it's absent.
5353 (start_atimer): Port to higher-res time stamps.
5354 Check for time stamp overflow. Don't get current time more
5355 often than is needed.
5356
5357 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5358 Include systime.h, not time.h.
5359 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5360
5361 * dired.c: Include stat-time.h.
5362 (Ffile-attributes): File times now have higher resolution.
5363
5364 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5365 (struct image): Timestamp now has higher resolution.
5366
5367 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5368 has at least microseconds now. All uses removed.
5369 (update_frame, update_single_window, update_window, update_frame_1)
5370 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5371 (duration_to_sec_usec): Remove; no longer needed.
5372
5373 * editfns.c (time_overflow): Now extern.
5374 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5375 (float-time, Fformat_time_string, Fcurrent_time_string)
5376 (Fcurrent_time_zone): Accept and generate higher-resolution
5377 time stamps.
5378 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5379 (decode_time_components, lisp_seconds_argument): New functions.
5380 (make_time): Now static.
5381 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5382 Report an error if the time is invalid, rather than having the caller
5383 do that.
5384
5385 * fileio.c: Include <stat-time.h>
5386 (Fcopy_file): Copy higher-resolution time stamps.
5387 Prefer to set the time stamp via a file descriptor if that works.
5388 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5389 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5390 (Fvisited_file_modtime, Fset_visited_file_modtime):
5391 Support higher-resolution time stamps.
5392
5393 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5394
5395 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5396
5397 * image.c (prepare_image_for_display, clear_image_cache)
5398 (lookup_image): Port to higer-resolution time stamps.
5399
5400 * keyboard.c (start_polling, bind_polling_period):
5401 Check for time stamp overflow.
5402 (read_char, kbd_buffer_get_event, timer_start_idle)
5403 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5404 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5405 Port to higher-resolution time stamps. Do not assume time_t is signed.
5406 (decode_timer): New function. Timers are now vectors of length 9,
5407 not 8, to accommodate the picosecond component.
5408 (timer_check_2): Use it.
5409
5410 * nsterm.m (select_timeout, timeval_subtract): Remove.
5411 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5412 as they're a bit more accurate and handle overflow better.
5413 (ns_select): Change prototype to be compatible with pselect.
5414 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5415 * nsterm.h (ns_select): Adjust prototype.
5416
5417 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5418 us-resolution time stamps.
5419 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5420
5421 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5422
5423 * lisp.h (time_overflow): New decl.
5424 (wait_reading_process_output): First arg is now intmax_t, not int,
5425 to accommodate larger waits.
5426
5427 * process.h (struct Lisp_Process.read_output_delay):
5428 Now counts nanoseconds, not microseconds.
5429 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5430 EMACS_HAS_USECS.
5431 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5432 (wait_reading_process_output):
5433 Port to ns-resolution time stamps.
5434 (Faccept_process_output, wait_reading_process_output):
5435 Check for time stamp overflow. Do not assume time_t is signed.
5436 (select_wrapper): Remove; we now use pselect.
5437 (Fprocess_attributes): Now generates ns-resolution time stamps.
5438
5439 * sysdep.c: Include utimens.h. Don't include utime.h
5440 or worry about struct utimbuf; gnulib does that for us now.
5441 (gettimeofday): Remove; gnulib provides a substitute.
5442 (make_timeval): New function.
5443 (set_file_times): Now sets ns-resolution time stamps.
5444 New arg FD; all uses changed.
5445 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5446 (system_process_attributes):
5447 Now returns ns-resolution time stamp. All uses changed.
5448 Check for time stamp overflow.
5449
5450 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5451 provides a substitute now.
5452
5453 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5454 since it guarantees struct timespec.
5455 (EMACS_TIME): Now struct timespec, so that we can support
5456 ns-resolution time stamps.
5457 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5458 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5459 (EMACS_USECS): Remove.
5460 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5461 so multiply the arg by 1000 before storing it.
5462 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5463 New macros.
5464 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5465 Port to ns-resolution time stamps.
5466 (EMACS_TIME_NEG_P): Remove; replaced by....
5467 (EMACS_TIME_SIGN): New macro.
5468 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5469 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5470 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5471 (make_timeval, make_lisp_time, decode_time_components): New decls.
5472 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5473 that it mishandled time_t overflow. You can't compare by subtracting!
5474 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5475 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5476
5477 * term.c: Include <sys/time.h>.
5478 (timeval_to_Time): New function, for proper overflow wraparound.
5479 (term_mouse_position, term_mouse_click): Use it.
5480
5481 * undo.c (record_first_change): Support higher-resolution time stamps
5482 in the undo buffer.
5483 (Fprimitive_undo): Use them when restoring time stamps.
5484
5485 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5486 (w32_get_internal_run_time):
5487 Port to higher-resolution Emacs time stamps.
5488 (ltime): Now accepts single 64-bit integer, as that's more convenient
5489 for callers.
5490
5491 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5492
5493 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5494 for compatibility with pselect. Support ns-resolution time stamps.
5495
5496 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5497
5498 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5499 Check for time stamp overflow, and support ns-resolution time stamps.
5500
5501 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5502 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5503 (timeval_subtract): Remove; no longer needed.
5504 (XTflash, XTring_bell, x_wait_for_event):
5505 Port to ns-resolution time stamps. Don't assume time_t is signed.
5506
5507 2012-06-22 Chong Yidong <cyd@gnu.org>
5508
5509 * xdisp.c (x_consider_frame_title): Revert last change.
5510
5511 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5512
5513 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5514 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5515 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5516 staticidx goes up to 1597 out of 1600 = 0x640.)
5517
5518 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5519
5520 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5521 Otherwise, the umask might be mistakenly 0 while handling input signals.
5522
5523 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5524
5525 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5526
5527 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5528
5529 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5530 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5531 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5532 access to `contents' member of Lisp_Vector objects with AREF and ASET
5533 where appropriate.
5534
5535 2012-06-19 Chong Yidong <cyd@gnu.org>
5536
5537 * frame.c (delete_frame): When selecting a frame on a different
5538 text terminal, do not alter the terminal's top-frame.
5539
5540 * xdisp.c (format_mode_line_unwind_data): Record the target
5541 frame's selected window and its terminal's top-frame.
5542 (unwind_format_mode_line): Restore them.
5543 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5544 Callers changed.
5545 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5546 since tty frames can be explicitly named.
5547 (prepare_menu_bars): Likewise.
5548
5549 * term.c (Ftty_top_frame): New function.
5550
5551 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5552
5553 Port byte-code-meter to modern targets.
5554 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5555 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5556 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5557 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5558 (METER_1, METER_2): Simplify.
5559
5560 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5561
5562 * data.c (Fdefalias): Return `symbol' (bug#11686).
5563
5564 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5565
5566 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5567 gets killed during executing of this function (Bug#11665).
5568 Try to always return Qt when the buffer has been actually killed.
5569 (Vkill_buffer_query_functions): In doc-string say that functions
5570 run by this hook should not change the current buffer.
5571
5572 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5573
5574 Fix recently-introduced process.c problems found by static checking.
5575 * process.c (write_queue_push, write_queue_pop, send_process):
5576 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5577 (write_queue_pop): Fix pointer signedness problem.
5578 (send_process): Remove unused local.
5579
5580 2012-06-17 Chong Yidong <cyd@gnu.org>
5581
5582 * xdisp.c (redisplay_internal): No need to redisplay terminal
5583 frames that are not on top.
5584
5585 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5586
5587 * process.c (make_process): Initialize write_queue.
5588 (write_queue_push, write_queue_pop): New functions.
5589 (send_process): Use them to maintain correct ordering of process
5590 writes (Bug#10815).
5591
5592 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5593
5594 * lisp.h (eassert): Assume C89 or later.
5595 This removes the need for CHECK.
5596 (CHECK): Remove. Its comments about always evaluating its
5597 argument were confusing, as 'eassert' typically does not evaluate
5598 its argument.
5599
5600 * coding.c (produce_chars): Use ptrdiff_t, not int.
5601
5602 * xterm.c (x_draw_underwave): Check for integer overflow.
5603 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5604
5605 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5606
5607 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5608 referenced (Bug#11583).
5609
5610 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5611
5612 Implement wave-style variant of underlining.
5613 * dispextern.h (face_underline_type): New enum.
5614 (face): Add field for underline type.
5615 * nsterm.m (ns_draw_underwave): New function.
5616 (ns_draw_text_decoration): Use it.
5617 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5618 New functions.
5619 (x_draw_glyph_string): Use them.
5620 * xfaces.c (Qline, Qwave): New Lisp objects.
5621 (check_lface_attrs, merge_face_ref)
5622 (Finternal_set_lisp_face_attribute, realize_x_face):
5623 Handle wave-style underline face attributes.
5624 * xterm.c (x_draw_underwave): New function.
5625 (x_draw_glyph_string): Use it.
5626
5627 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5628
5629 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5630 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5631 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5632 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5633 ($(BLD)/w32select.$(O)): Update dependencies.
5634
5635 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5636
5637 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5638 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5639 * character.c (_fetch_multibyte_char_p): Remove.
5640 * alloc.c: Include "character.h" before "buffer.h".
5641 * bidi.c: Likewise.
5642 * buffer.c: Likewise.
5643 * bytecode.c: Likewise.
5644 * callint.c: Likewise.
5645 * callproc.c: Likewise.
5646 * casefiddle.c: Likewise.
5647 * casetab.c: Likewise.
5648 * category.c: Likewise.
5649 * cmds.c: Likewise.
5650 * coding.c: Likewise.
5651 * composite.c: Likewise.
5652 * dired.c: Likewise.
5653 * dispnew.c: Likewise.
5654 * doc.c: Likewise.
5655 * dosfns.c: Likewise.
5656 * editfns.c: Likewise.
5657 * emacs.c: Likewise.
5658 * fileio.c: Likewise.
5659 * filelock.c: Likewise.
5660 * font.c: Likewise.
5661 * fontset.c: Likewise.
5662 * fringe.c: Likewise.
5663 * indent.c: Likewise.
5664 * insdel.c: Likewise.
5665 * intervals.c: Likewise.
5666 * keyboard.c: Likewise.
5667 * keymap.c: Likewise.
5668 * lread.c: Likewise.
5669 * macros.c: Likewise.
5670 * marker.c: Likewise.
5671 * minibuf.c: Likewise.
5672 * nsfns.m: Likewise.
5673 * nsmenu.m: Likewise.
5674 * print.c: Likewise.
5675 * process.c: Likewise.
5676 * regex.c: Likewise.
5677 * region-cache.c: Likewise.
5678 * search.c: Likewise.
5679 * syntax.c: Likewise.
5680 * term.c: Likewise.
5681 * textprop.c: Likewise.
5682 * undo.c: Likewise.
5683 * unexsol.c: Likewise.
5684 * w16select.c: Likewise.
5685 * w32fns.c: Likewise.
5686 * w32menu.c: Likewise.
5687 * window.c: Likewise.
5688 * xdisp.c: Likewise.
5689 * xfns.c: Likewise.
5690 * xmenu.c: Likewise.
5691 * xml.c: Likewise.
5692 * xselect.c: Likewise.
5693
5694 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5695
5696 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5697 If all the glyphs of the glyph row came from strings, and we have no
5698 cursor positioning clues, put the cursor on the first glyph of the
5699 row.
5700 (handle_face_prop): Use chunk-relative overlay string index when
5701 indexing into it->string_overlays array. (Bug#11653)
5702 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5703 the rightmost. (Bug#11720)
5704
5705 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5706
5707 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5708 (CATEGORY_MEMBER): Enforce 1/0 value.
5709 * category.c (_temp_category_set): Remove.
5710
5711 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5712
5713 * window.c (Fdelete_other_windows_internal)
5714 (Fdelete_window_internal): Don't access frame's mouse highlight
5715 info of the initial frame. (Bug#11677)
5716
5717 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5718
5719 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5720 Assume USE_2_TAGS_FOR_INTS.
5721 (xreload): Adjust $tagmask width to match recent lisp.h change.
5722
5723 Simplify lisp.h in minor ways that should not affect code.
5724 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5725 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5726 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5727 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5728 (INTTYPEBITS): New macro, for clarity.
5729 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5730 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5731 Simplify now that USE_LSB_TAG is always defined.
5732 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5733 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5734
5735 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5736
5737 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5738
5739 2012-06-13 Glenn Morris <rgm@gnu.org>
5740
5741 * s/bsd-common.h (BSD4_3):
5742 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5743
5744 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5745
5746 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5747 instead of union.
5748 (XLI, XIL): Define.
5749 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5750 Use them.
5751 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5752 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5753 * alloc.c (widen_to_Lisp_Object): Remove.
5754 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5755 * frame.c (delete_frame): Remove outdated comment.
5756 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5757 USE_LISP_UNION_TYPE.
5758 (Fw32_unregister_hot_key): Likewise.
5759 (Fw32_toggle_lock_key): Likewise.
5760 * w32menu.c (add_menu_item): Likewise.
5761 (w32_menu_display_help): Use XIL instead of checking
5762 USE_LISP_UNION_TYPE.
5763 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5764 (init_heap): Likewise.
5765 * w32term.c (w32_read_socket): Update comment.
5766
5767 2012-06-13 Glenn Morris <rgm@gnu.org>
5768
5769 * s/usg5-4-common.h, src/s/unixware.h:
5770 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5771
5772 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5773
5774 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5775
5776 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5777 * alloc.c (make_number) [!defined make_number]:
5778 Remove, as lisp.h always defines this now.
5779 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5780 (roundup_size): Verify that it is a power of 2.
5781 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5782 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5783 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5784 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5785 USE_LSB_TAG now is always defined to be either 0 or 1.
5786 All uses changed.
5787 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5788 code works fine either way, and efficiency is not a concern here,
5789 as the union type is for debugging, not for production.
5790 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5791 Use an inline function on all platforms when using the union type,
5792 since this is simpler and 'static inline' can be used portably
5793 within Emacs now.
5794 (LISP_INITIALLY_ZERO): New macro.
5795 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5796 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5797
5798 2012-06-12 Glenn Morris <rgm@gnu.org>
5799
5800 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5801
5802 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5803
5804 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5805 Move BROKEN_SIGIO to configure.
5806
5807 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5808 Move NO_TERMIO to configure.
5809
5810 2012-06-12 Chong Yidong <cyd@gnu.org>
5811
5812 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5813 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5814 MagickExportImagePixels is undefined.
5815
5816 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5817
5818 * image.c (imagemagick_load_image): Remove unused label.
5819
5820 2012-06-11 Glenn Morris <rgm@gnu.org>
5821
5822 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5823 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5824 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5825 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5826
5827 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5828
5829 * alloc.c (make_byte_code): New function.
5830 (Fmake_byte_code): Use it. Don't purify here.
5831 * lread.c (read1): Use it as well to avoid extra allocation.
5832
5833 2012-06-11 Chong Yidong <cyd@gnu.org>
5834
5835 * image.c (imagemagick_load_image): Implement transparency.
5836
5837 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5838
5839 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5840 account for preceding backslashes. (Bug#11663)
5841
5842 2012-06-09 Chong Yidong <cyd@gnu.org>
5843
5844 * term.c: Support italics in capable terminals (Bug#9652).
5845 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5846 (turn_on_face): Output using TS_enter_italic_mode if available.
5847 Don't handle unused blinking and alt-charset cases.
5848 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5849 and tty_alt_charset_p cases.
5850 (tty_capable_p, init_tty): Support italics.
5851
5852 * termchar.h (struct tty_display_info): Add field for italics.
5853 Remove unused blink field.
5854
5855 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5856 Handle slant.
5857
5858 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5859 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5860 tty_alt_charset_p. Add tty_italic_p.
5861
5862 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5863
5864 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5865 dbus_type_is_basic if available.
5866 (xd_extract_signed, xd_extract_unsigned): Rename from
5867 extract_signed and extract_unsigned, respectively. Adapt callers.
5868
5869 2012-06-09 Chong Yidong <cyd@gnu.org>
5870
5871 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5872
5873 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5874 case (Bug#9752).
5875
5876 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5877
5878 * xdisp.c (vmessage): Treat frame message as multibyte.
5879 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5880 would generate the diagnostic "Making \302\247 buffer-local while
5881 let-bound!".
5882
5883 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5884
5885 * dispnew.c (showing_window_margins_p): Undo last change, which
5886 was done due to an inadvertent commit.
5887 (adjust_frame_glyphs_for_frame_redisplay): Do call
5888 showing_window_margins_p.
5889
5890 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5891
5892 * eval.c (Fmake_var_non_special): New primitive.
5893 (syms_of_eval): Defsubr it.
5894 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5895
5896 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5897
5898 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5899 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5900
5901 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5902
5903 * alloc.c (allocate_vectorlike): Fix last change.
5904
5905 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5906
5907 Block-based vector allocation of small vectors.
5908 * lisp.h (struct vectorlike_header): New field `nbytes',
5909 adjust comment accordingly.
5910 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5911 to denote vector blocks. Adjust users (live_vector_p,
5912 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5913 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5914 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5915 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5916 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5917 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5918 (roundup_size): New constant.
5919 (struct vector_block): New data type.
5920 (vector_blocks, vector_free_lists, zero_vector): New variables.
5921 (all_vectors): Rename to `large_vectors'.
5922 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5923 (sweep_vectors): New functions.
5924 (allocate_vectorlike): Return `zero_vector' as the only vector of
5925 0 items. Allocate new vector from block if vector size is less than
5926 or equal to VBLOCK_BYTES_MAX.
5927 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5928 (init_alloc_once): Add call to init_vectors.
5929
5930 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5931
5932 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5933
5934 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5935
5936 * doprnt.c (doprnt): Truncate multibyte char correctly.
5937 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5938 would mishandle a string argument "Xc" if X was a multibyte
5939 character of length 2: it would truncate after X's first byte
5940 rather than including all of X.
5941
5942 2012-06-06 Chong Yidong <cyd@gnu.org>
5943
5944 * buffer.c (word_wrap): Doc fix.
5945
5946 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5947
5948 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5949
5950 2012-06-03 Glenn Morris <rgm@gnu.org>
5951
5952 * xdisp.c (tool-bar-style): Doc fix.
5953
5954 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5955
5956 * Makefile.in (PAXCTL): Define.
5957 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5958 binary via PaX flags if the paxctl utility is available.
5959 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5960 Restore PaX flags to their default. (Bug#11398)
5961
5962 2012-06-03 Chong Yidong <cyd@gnu.org>
5963
5964 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5965 buffer (Bug#11226).
5966
5967 2012-06-03 Chong Yidong <cyd@gnu.org>
5968
5969 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5970 (note_mode_line_or_margin_highlight): If there is no help echo,
5971 use mode-line-default-help-echo. Handle the case where the mouse
5972 position is past the end of the mode line string.
5973
5974 * buffer.c (buffer_local_value_1): New function, split from
5975 Fbuffer_local_value; can return Qunbound.
5976 (Fbuffer_local_value): Use it.
5977 (Vmode_line_format): Docstring tweaks.
5978
5979 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5980
5981 * sysdep.c (system_process_attributes): Improve comment.
5982
5983 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5984
5985 * keyboard.c: Export real-this-command to Elisp.
5986 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5987 and DEFVAR it. Update all users.
5988
5989 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5990
5991 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5992
5993 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5994 Convert pctcpu and pctmem to Lisp float properly.
5995 Let the compiler fold better, as 100.0/0x8000 is exact.
5996
5997 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5998
5999 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
6000 cons_block.
6001
6002 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
6003
6004 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
6005
6006 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
6007
6008 For a 'struct window', replace some Lisp_Object fields to
6009 bitfields where appropriate, remove unused fields.
6010 * window.h (struct window): Remove unused 'last_mark_x' and
6011 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
6012 change it's type from Lisp_Object to bitfield.
6013 Change type of 'force_start', 'optional_new_start',
6014 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
6015 fields from Lisp_Object to bitfield. Adjust users accordingly.
6016
6017 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6018
6019 Pacify gcc -Wdouble-precision when using Xaw.
6020 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6021 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6022 Use 'float' consistently, rather than 'float' in most places
6023 and 'double' in a couple of places.
6024
6025 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6026
6027 * xdisp.c (handle_stop): Detect whether we have overlay strings
6028 loaded by testing it->current.overlay_string_index to be
6029 non-negative, instead of checking whether n_overlay_strings is
6030 positive. (Bug#11587)
6031
6032 2012-05-31 Chong Yidong <cyd@gnu.org>
6033
6034 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6035
6036 * doc.c (Fsubstitute_command_keys): Doc fix.
6037
6038 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6039
6040 * search.c (search_buffer): Remove calls to
6041 r_alloc_inhibit_buffer_relocation, as it is now called by
6042 maybe_unify_char, which was the cause of relocation of buffer text
6043 in bug#11519.
6044
6045 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6046
6047 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6048 for the duration of call to load_charset, to avoid problems with
6049 callers of maybe_unify_char that access buffer text through C
6050 pointers.
6051
6052 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6053 decrement the inhibition flag, instead of just setting or
6054 resetting it.
6055
6056 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6057
6058 Remove obsolete '#define static' cruft.
6059 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6060 This #undef was "temporary" in 2000; it is no longer needed
6061 now that '#define static' has gone away.
6062 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6063 (gray_bitmap_bits): Remove; no longer needed.
6064 All uses replaced with definiens.
6065 * xterm.c: Include "bitmaps/gray.xbm".
6066
6067 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6068
6069 Clean up __executable_start, monstartup when --enable-profiling.
6070 The following changes affect the code only when profiling.
6071 * dispnew.c (__executable_start): Rename from safe_bcopy.
6072 Define only on platforms that need it.
6073 * emacs.c: Include <sys/gmon.h> when profiling.
6074 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6075 (__executable_start): Remove decl, since lisp.h does it now.
6076 (safe_bcopy): Remove decl; no longer has that name.
6077 (main): Coalesce #if into single bit of code, for simplicity.
6078 Cast pointers to uintptr_t, since standard libraries want integers
6079 and not pointers.
6080 * lisp.h (__executable_start): New decl.
6081
6082 2012-05-31 Glenn Morris <rgm@gnu.org>
6083
6084 * image.c (Fimagemagick_types): Doc fix.
6085
6086 2012-05-30 Jim Meyering <meyering@redhat.com>
6087
6088 * callproc.c (Fcall_process_region): Include directory component
6089 in mkstemp error message (Bug#11586).
6090
6091 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6092
6093 * alloc.c, lisp.h (make_pure_vector): Now static.
6094
6095 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6096
6097 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6098 Move to byte-run.el.
6099 (Fautoload): Do the hash-doc more carefully.
6100 * data.c (Fdefalias): Purify definition, except for keymaps.
6101 (Qdefun): Move from eval.c.
6102 * lisp.h (Qdefun): Remove.
6103 * lread.c (read1): Tiny simplification.
6104
6105 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6106
6107 Do not create empty overlays with the evaporate property (Bug#9642).
6108 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6109 Bug#9642, but explicitly check that the buffer the overlay would
6110 be moved to is live and rearrange lines to make sure that errors
6111 will not put the overlay in an inconsistent state.
6112 (Fdelete_overlay): Cosmetics.
6113
6114 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6115
6116 * w32term.c (my_bring_window_to_top): New function.
6117 (x_raise_frame): Use handle returned by DeferWindowPos, which
6118 could be different from the original one.
6119 Call my_bring_window_to_top instead of my_set_foreground_window.
6120 (Bug#11513)
6121
6122 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6123 by calling BringWindowToTop.
6124
6125 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6126 (WM_EMACS_END): Increase by one.
6127
6128 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6129
6130 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6131 This avoids undefined behavior that might cause the eassert
6132 to not catch an out-of-range value.
6133
6134 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6135
6136 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6137 Update dependencies.
6138
6139 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6140
6141 * bidi.c (bidi_mirror_char): Fix last change.
6142
6143 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6144
6145 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6146 when referring to sectname field in printf format.
6147
6148 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6149
6150 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6151 Only r_alloc_inhibit_buffer_relocation needed to be added;
6152 the others were already declared.
6153
6154 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6155 before checking whether it's out of range. Put the check inside
6156 eassert. See
6157 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6158
6159 2012-05-27 Ken Brown <kbrown@cornell.edu>
6160
6161 * callproc.c (Fcall_process): Restore a line that was accidentally
6162 commented out in the 2011-02-13 change (bug#11547).
6163
6164 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6165
6166 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6167 defined on ralloc.c.
6168
6169 * buffer.c [REL_ALLOC]: Remove prototypes of
6170 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6171 they are now on lisp.h.
6172
6173 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6174
6175 * search.c (search_buffer): Use it to inhibit relocation of buffer
6176 text while re_search_2 is doing its job, because re_search_2 is
6177 passed C pointers to buffer text. (Bug#11519)
6178
6179 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6180 Update value to 24.
6181
6182 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6183 state after an additional call to move_it_in_display_line_to, keep
6184 the values of it->max_ascent and it->max_descent found for the
6185 entire line.
6186 (pos_visible_p): Revert the comparison against bottom_y to what it
6187 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6188 (Bug#11464)
6189
6190 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6191
6192 Fix coding-related core dumps with gcc -ftrapv.
6193 The code was computing A - B, where A and B are pointers, and B is
6194 random garbage. This can lead to core dumps on platforms that
6195 have special pointer registers, and it also leads to core dumps on
6196 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6197 A - B only when B is initialized properly.
6198 * coding.c (coding_set_source, coding_set_destination): Return void.
6199 (coding_change_source, coding_change_destinations): New functions,
6200 with the old behaviors of coding_set_source and coding_set_destination.
6201 All callers that need an offset changed to use these new functions.
6202
6203 2012-05-26 Glenn Morris <rgm@gnu.org>
6204
6205 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6206
6207 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6208
6209 Extend mouse support on W32 text-mode console.
6210 * xdisp.c (draw_row_with_mouse_face):
6211 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6212
6213 * w32console.c: Include window.h.
6214 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6215 New functions.
6216 (initialize_w32_display): Initialize mouse-highlight data.
6217
6218 * w32inevt.c: Include termchar.h and window.h.
6219 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6220 moves, call note_mouse_highlight. If help_echo changed, call
6221 gen_help_event to produce help-echo message in the echo area.
6222 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6223 highlight info.
6224
6225 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6226
6227 * lread.c (read1): Simplify slightly to avoid an overflow warning
6228 with GCC 4.7.0 on x86-64.
6229
6230 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6231
6232 * bidi.c (bidi_mirror_char): Revert last change: an int is
6233 definitely wide enough here.
6234
6235 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6236
6237 Fix integer width and related bugs (Bug#9874).
6238 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6239 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6240 (string_bytes, check_sblock, allocate_string_data):
6241 (compact_small_strings, Fmake_bool_vector, make_string)
6242 (make_unibyte_string, make_multibyte_string)
6243 (make_string_from_bytes, make_specified_string)
6244 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6245 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6246 (mark_vectorlike):
6247 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6248 (allocate_pseudovector):
6249 Use int, not EMACS_INT, where int is wide enough.
6250 (inhibit_garbage_collection, Fgarbage_collect):
6251 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6252 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6253 int might not be wide enough.
6254 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6255 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6256 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6257 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6258 (bidi_level_of_next_char, bidi_move_to_visually_next):
6259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6260 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6261 (Fkill_buffer, Fset_buffer_major_mode)
6262 (advance_to_char_boundary, Fbuffer_swap_text)
6263 (Fset_buffer_multibyte, overlays_at, overlays_in)
6264 (overlay_touches_p, struct sortvec, record_overlay_string)
6265 (overlay_strings, recenter_overlay_lists)
6266 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6267 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6268 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6269 (Foverlay_recenter, last_overlay_modification_hooks_used)
6270 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6271 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6272 (validate_region): Omit unnecessary test for b <= e,
6273 since that's guaranteed by the previous test.
6274 (adjust_overlays_for_delete): Avoid pos + length overflow.
6275 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6276 (report_overlay_modification):
6277 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6278 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6279 Omit pointer cast, which isn't needed anyway, and doesn't work
6280 after the EMACS_INT -> ptrdiff_t change.
6281 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6282 * buffer.h: Adjust decls to match defn changes elsewhere.
6283 (struct buffer_text, struct buffer):
6284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6285 Use EMACS_INT, not int, where int might not be wide enough.
6286 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6287 not int, to avoid needless 32-bit limit on 64-bit hosts.
6288 (exec_byte_code): Use tighter memory-full test, one that checks
6289 for alloca overflow. Don't compute the address of the object just
6290 before an array, as that's not portable. Use EMACS_INT, not
6291 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6292 * callint.c (Fcall_interactively):
6293 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6294 * callproc.c (call_process_kill, Fcall_process):
6295 Don't assume pid_t fits into an Emacs fixnum.
6296 (call_process_cleanup, Fcall_process, child_setup):
6297 Don't assume pid_t fits into int.
6298 (call_process_cleanup, Fcall_process, delete_temp_file)
6299 (Fcall_process_region):
6300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6301 (Fcall_process): Simplify handling of volatile integers.
6302 Use int, not EMACS_INT, where int will do.
6303 * casefiddle.c (casify_object, casify_region, operate_on_word)
6304 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6305 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6306 (casify_object): Avoid integer overflow when overallocating buffer.
6307 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6308 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6309 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6310 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6311 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6312 integers are now checked earlier. All uses replaced with XINT.
6313 (ccl_driver):
6314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6315 For CCL_MapSingle, check that content and value are in int range.
6316 (ccl_driver, Fregister_code_conversion_map):
6317 Check that Vcode_version_map_vector is a vector.
6318 (resolve_symbol_ccl_program): Check that vector header is in range.
6319 Always copy the vector, so that we can check its contents reliably
6320 now rather than having to recheck each instruction as it's being
6321 executed. Check that vector words fit in 'int'.
6322 (ccl_get_compiled_code, Fregister_ccl_program)
6323 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6324 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6325 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6326 contents are in range.
6327 (Fccl_execute_on_string): Check that status is in range.
6328 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6329 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6330 Accept and return EMACS_INT, not int, because callers can pass values
6331 out of 'int' range.
6332 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6333 (multibyte_chars_in_text, parse_str_as_multibyte)
6334 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6335 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6336 (string_escape_byte8, Fget_byte):
6337 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6338 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6339 avoid mishandling large integers.
6340 * character.h: Adjust decls to match defn changes elsewhere.
6341 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6342 (Ffind_charset_region):
6343 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6344 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6345 (load_charset_map_from_vector, Fdefine_charset_internal):
6346 Don't assume fixnum fits in int.
6347 (load_charset_map_from_vector, Fmap_charset_chars):
6348 Remove now-unnecessary CHECK_NATNUMs.
6349 (Fdefine_charset_internal): Check ranges here, more carefully.
6350 Don't rely on undefined behavior with signed left shift overflow.
6351 Don't assume unsigned int fits into fixnum, or that fixnum fits
6352 into unsigned int. Don't require max_code to be a valid fixnum;
6353 that's not true for gb10830 4-byte on a 32-bit host. Allow
6354 invalid_code to be a cons, for the same reason. Require code_offset
6355 to be a character. Avoid int overflow if max_char is close
6356 to INT_MAX.
6357 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6358 this is intended anyway and avoids some undefined behavior.
6359 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6360 INDEX_TO_CODE_POINT, as that's what it expects.
6361 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6362 * charset.h (DECODE_CHAR): Return int, not unsigned;
6363 this is what was intended anyway, and it avoids undefined behavior.
6364 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6365 integer-overflow issues.
6366 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6367 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6368 where the argument is EMACS_INT, and this behavior is not intended.
6369 * chartab.c (Fmake_char_table, Fset_char_table_range)
6370 (uniprop_get_decoder, uniprop_get_encoder):
6371 Don't assume fixnum fits in int.
6372 * cmds.c (move_point): New function, that does the gist of
6373 Fforward_char and Fbackward_char, but does so while checking
6374 for integer overflow more accurately.
6375 (Fforward_char, Fbackward_char): Use it.
6376 (Fforward_line, Fend_of_line, internal_self_insert)
6377 (internal_self_insert):
6378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6379 Fix a FIXME, by checking for integer overflow when calculating
6380 target_clm and actual_clm.
6381 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6382 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6383 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6384 (coding_alloc_by_making_gap, alloc_destination)
6385 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6386 (encode_coding_utf_16, detect_coding_emacs_mule)
6387 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6388 (detect_coding_iso_2022, decode_coding_iso_2022)
6389 (encode_invocation_designation, encode_designation_at_bol)
6390 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6391 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6392 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6393 (encode_coding_ccl, encode_coding_raw_text)
6394 (detect_coding_charset, decode_coding_charset)
6395 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6396 (produce_composition, produce_charset, produce_annotation)
6397 (decode_coding, handle_composition_annotation)
6398 (handle_charset_annotation, consume_chars, decode_coding_gap)
6399 (decode_coding_object, encode_coding_object, detect_coding_system)
6400 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6401 (code_convert_region, code_convert_string)
6402 (Fdefine_coding_system_internal)
6403 (coding_set_source, coding_set_destination):
6404 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6405 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6406 (Fdefine_coding_system_internal):
6407 Don't assume fixnums fit in int.
6408 (decode_coding_gap, decode_coding_object, encode_coding_object)
6409 (Fread_coding_system, Fdetect_coding_region)
6410 (Funencodable_char_position, Fcheck_coding_systems_region)
6411 (get_translation, handle_composition_annotation, consume_chars):
6412 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6413 (consume_chars): Rewrite to not calculate an address outside buffer.
6414 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6415 Don't access memory outside of the args array.
6416 (Fdefine_coding_system_internal): Check for charset-id overflow.
6417 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6418 result of ENCODE_CHAR.
6419 * coding.h: Adjust decls to match defn changes elsewhere.
6420 (struct coding_system):
6421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6422 * composite.c (get_composition_id, find_composition)
6423 (run_composition_function, update_compositions)
6424 (compose_text, composition_gstring_put_cache)
6425 (composition_gstring_p, composition_gstring_width)
6426 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6427 (composition_compute_stop_pos, composition_reseat_it)
6428 (composition_update_it, struct position_record)
6429 (find_automatic_composition, composition_adjust_point)
6430 (Fcomposition_get_gstring, Ffind_composition_internal):
6431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6432 (update_compositions):
6433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6434 * composite.h: Adjust decls to match defn changes elsewhere.
6435 (struct composition):
6436 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6437 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6438 Do not attempt to compute the address of the object just before a
6439 buffer; this is not portable.
6440 (Faref, Faset):
6441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6442 (Faset): Use int, not EMACS_INT, where int is wide enough.
6443 (Fstring_to_number): Don't assume fixnums fit in int.
6444 (Frem): Don't assume arg is nonnegative.
6445 * dbusbind.c (xd_append_arg): Check for integers out of range.
6446 (Fdbus_call_method): Don't overflow the timeout int.
6447 (extract_signed, extract_unsigned): New functions.
6448 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6449 (xd_get_connection_references): Return ptrdiff_t, not int.
6450 All uses changed.
6451 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6452 (xd_read_message_1):
6453 Use int, not unsigned, where the dbus API uses int.
6454 (Fdbus_message_internal): Don't overflow mtype.
6455 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6456 * dired.c (directory_files_internal, file_name_completion, scmp)
6457 (file_name_completion_stat):
6458 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6459 (file_name_completion): Don't overflow matchcount.
6460 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6461 * dispextern.h: Adjust decls to match defn changes elsewhere.
6462 (struct text_pos, struct glyph, struct bidi_saved_info)
6463 (struct bidi_string_data, struct bidi_it, struct composition_it)
6464 (struct it):
6465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6466 (struct display_pos, struct composition_it, struct it):
6467 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6468 * dispnew.c (increment_matrix_positions)
6469 (increment_row_positions, mode_line_string)
6470 (marginal_area_string):
6471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6472 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6473 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6474 (duration_to_sec_usec): New function, to check for overflow better.
6475 (Fsleep_for, sit_for): Use it.
6476 * doc.c (get_doc_string, store_function_docstring):
6477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6478 (get_doc_string, Fsnarf_documentation):
6479 Use int, not EMACS_INT, where int is wide enough.
6480 (get_doc_string):
6481 Use SAFE_ALLOCA, not alloca.
6482 Check for overflow when converting EMACS_INT to off_t.
6483 * doprnt.c (doprnt):
6484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6485 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6486 Don't assume uid_t fits into fixnum.
6487 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6488 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6489 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6490 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6491 (general_insert_function)
6492 (Finsert_char, make_buffer_string, make_buffer_string_both)
6493 (update_buffer_properties, Fbuffer_substring)
6494 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6495 (Fsubst_char_in_region, check_translation)
6496 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6497 (transpose_markers, Ftranspose_regions):
6498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6499 (clip_to_bounds): Move to lisp.h as an inline function).
6500 (Fconstrain_to_field): Don't assume integers are nonnegative.
6501 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6502 (Fsubst_char_in_region, Fsave_restriction):
6503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6504 (Femacs_pid): Don't assume pid_t fits into fixnum.
6505 (lo_time): Use int, not EMACS_INT, when int suffices.
6506 (lisp_time_argument): Check for usec out of range.
6507 (Fencode_time): Don't assume fixnum fits in int.
6508 (Fuser_login_name, Fuser_full_name): Signal an error
6509 if a uid argument is out of range, rather than relying on
6510 undefined behavior.
6511 (Fformat_time_string): Remove now-unnecessary check.
6512 lisp_time_argument checks for out-of-range usec now.
6513 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6514 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6515 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6516 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6517 (init_cmdargs, Fdump_emacs):
6518 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6519 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6520 the bottom (typically) 32 bits of the fixnum.
6521 * eval.c (specpdl_size, call_debugger):
6522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6523 (when_entered_debugger, Fbacktrace_debug):
6524 Don't assume fixnum can fit in int.
6525 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6526 the object just before a buffer; this is not portable.
6527 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6528 (grow_specpdl, unbind_to):
6529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6530 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6531 (grow_specpdl): Simplify allocation by using xpalloc.
6532 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6533 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6534 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6536 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6537 (a_write, e_write):
6538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6539 (Fcopy_file, non_regular_nbytes, read_non_regular)
6540 (Finsert_file_contents):
6541 Use int, not EMACS_INT, where int is wide enough.
6542 (READ_BUF_SIZE): Verify that it fits in int.
6543 (Finsert_file_contents): Check that counts are in proper range,
6544 rather than assuming fixnums fit into ptrdiff_t etc.
6545 Don't assume fixnums fit into int.
6546 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6547 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6548 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6549 (string_char_to_byte, string_byte_to_char)
6550 (string_make_multibyte, string_to_multibyte)
6551 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6552 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6553 (substring_both, Fdelete, internal_equal, Ffillarray)
6554 (Fclear_string, mapcar1)
6555 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6556 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6557 (larger_vector, make_hash_table, maybe_resize_hash_table)
6558 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6559 (Fmaphash, secure_hash):
6560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6561 (concat): Check for string index and length overflow.
6562 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6563 (Frequire):
6564 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6565 (larger_vector): New API (vec, incr_min, size_max) replaces old
6566 one (vec, new_size, init). This catches size overflow.
6567 INIT was removed because it was always Qnil.
6568 All callers changed.
6569 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6570 the upper bound on a hash table index size.
6571 (make_hash_table, maybe_resize_hash_table): Use it.
6572 (secure_hash): Computer start_byte and end_byte only after
6573 they're known to be in ptrdiff_t range.
6574 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6575 (Ffont_get_glyphs, Ffont_at):
6576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6577 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6578 (Flist_fonts, Fopen_font):
6579 Don't assume fixnum can fit in int.
6580 (check_gstring): Don't assume index can fit in int.
6581 (font_match_p): Check that fixnum is a character, not a nonnegative
6582 fixnum, since the later code needs to stuff it into an int.
6583 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6584 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6585 conversion overflow issues.
6586 (Fopen_font): Check for integer out of range.
6587 (Ffont_get_glyphs): Don't assume index can fit in int.
6588 * font.h: Adjust decls to match defn changes elsewhere.
6589 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6590 integer overflow.
6591 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6592 printmax_t, where ptrdiff_t is wide enough.
6593 (Finternal_char_font):
6594 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6595 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6596 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6597 (Fset_frame_position, x_set_frame_parameters)
6598 (x_set_line_spacing, x_set_border_width)
6599 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6600 Check that fixnums are in proper range for system types.
6601 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6603 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6604 Use SAFE_ALLOCA_LISP, not alloca.
6605 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6606 intptr_t is wide enough.
6607 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6608 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6609 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6610 Check for fixnum out of range.
6611 * ftfont.c (ftfont_list): Don't assume index fits in int.
6612 Check that fixnums are in proper range for system types.
6613 (ftfont_shape_by_flt):
6614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6615 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6616 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6617 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6618 Check that fixnums are in proper range for system types.
6619 * gnutls.h: Adjust decls to match defn changes elsewhere.
6620 * gtkutil.c (xg_dialog_run):
6621 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6622 (update_frame_tool_bar):
6623 Check that fixnums are in proper range for system types.
6624 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6625 (lookup_image): Check that fixnums are in range for system types.
6626 * indent.c (last_known_column, last_known_column_point):
6627 (current_column_bol_cache):
6628 (skip_invisible, current_column, check_display_width):
6629 (check_display_width, scan_for_column, current_column_1)
6630 (Findent_to, Fcurrent_indentation, position_indentation)
6631 (indented_beyond_p, Fmove_to_column, compute_motion):
6632 (Fcompute_motion, Fvertical_motion):
6633 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6634 (last_known_column_modified): Use EMACS_INT, not int.
6635 (check_display_width):
6636 (Fcompute_motion):
6637 Check that fixnums and floats are in proper range for system types.
6638 (compute_motion): Don't assume index or fixnum fits in int.
6639 (compute_motion, Fcompute_motion):
6640 Use int, not EMACS_INT, when it is wide enough.
6641 (vmotion): Omit local var start_hpos that is always 0; that way
6642 we don't need to worry about overflow in expressions involving it.
6643 * indent.h: Adjust decls to match defn changes elsewhere.
6644 (struct position):
6645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6646 Use int, not EMACS_INT, where int is wide enough.
6647 Remove unused members ovstring_chars_done and tab_offset;
6648 all uses removed.
6649 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6650 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6651 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6652 (make_gap, copy_text, insert, insert_and_inherit)
6653 (insert_before_markers, insert_before_markers_and_inherit)
6654 (insert_1, count_combining_before, count_combining_after)
6655 (insert_1_both, insert_from_string)
6656 (insert_from_string_before_markers, insert_from_string_1)
6657 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6658 (adjust_after_replace, adjust_after_insert, replace_range)
6659 (replace_range_2, del_range, del_range_1, del_range_byte)
6660 (del_range_both, del_range_2, modify_region)
6661 (prepare_to_modify_buffer, signal_before_change)
6662 (signal_after_change, Fcombine_after_change_execute):
6663 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6664 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6665 (balance_an_interval, split_interval_right, split_interval_left)
6666 (find_interval, next_interval, update_interval)
6667 (adjust_intervals_for_insertion, delete_node, delete_interval)
6668 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6669 (static_offset_intervals, offset_intervals)
6670 (merge_interval_right, merge_interval_left, make_new_interval)
6671 (graft_intervals_into_buffer, temp_set_point_both)
6672 (temp_set_point, set_point, adjust_for_invis_intang)
6673 (set_point_both, move_if_not_intangible, get_property_and_range)
6674 (get_local_map, copy_intervals, copy_intervals_to_string)
6675 (compare_string_intervals, set_intervals_multibyte_1):
6676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6677 * intervals.h: Adjust decls to match defn changes elsewhere.
6678 (struct interval):
6679 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6680 * keyboard.c (this_command_key_count, this_single_command_key_start)
6681 (before_command_key_count, before_command_echo_length, echo_now)
6682 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6683 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6684 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6685 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6687 (last_non_minibuf_size, last_point_position, echo_truncate)
6688 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6689 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6690 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6691 (stuff_buffered_input):
6692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6693 (last_auto_save, command_loop_1, read_char):
6694 Use EMACS_INT, not int, to avoid integer overflow.
6695 (record_char): Avoid overflow in total_keys computation.
6696 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6697 * keyboard.h: Adjust decls to match defn changes elsewhere.
6698 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6699 (Fkey_description, Fdescribe_vector, Flookup_key):
6700 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6701 (click_position): New function, to check that positions are in range.
6702 (Fcurrent_active_maps):
6703 (describe_command):
6704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6705 (Faccessible_keymaps, Fkey_description):
6706 (preferred_sequence_p):
6707 Don't assume fixnum can fit into int.
6708 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6709 Check for integer overflow in size calculations.
6710 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6711 avoid mishandling large integers.
6712 * lisp.h: Adjust decls to match defn changes elsewhere.
6713 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6714 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6715 (struct Lisp_Marker):
6716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6717 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6718 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6719 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6720 All callers changed.
6721 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6722 Assume the arg has valid form, since it always does.
6723 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6724 unsigned integer system type.
6725 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6726 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6727 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6728 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6729 (duration_to_sec_usec): New decl.
6730 * lread.c (read_from_string_index, read_from_string_index_byte)
6731 (read_from_string_limit, readchar, unreadchar, openp)
6732 (read_internal_start, read1, oblookup):
6733 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6734 (Fload, readevalloop, Feval_buffer, Feval_region):
6735 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6736 (openp): Check for out-of-range argument to 'access'.
6737 (read1): Use int, not EMACS_INT, where int is wide enough.
6738 Don't assume fixnum fits into int.
6739 Fix off-by-one error that can read outside a buffer.
6740 (read_filtered_event): Use duration_to_sec_usec
6741 to do proper overflow checking on durations.
6742 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6743 in size calculation.
6744 (Fexecute_kbd_macro):
6745 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6746 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6747 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6748 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6749 (set_marker_both, set_marker_restricted_both, marker_position)
6750 (marker_byte_position, Fbuffer_has_markers_at):
6751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6752 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6753 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6754 It now merely ensures that the menu is large enough, without
6755 necessarily growing it, as this avoids some integer overflow issues.
6756 All callers changed.
6757 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6759 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6760 Use SAFE_ALLOCA_LISP, not alloca.
6761 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6762 to EMACS_INT. Check that fixnums are in proper range for system types.
6763 * minibuf.c (minibuf_prompt_width, string_to_object)
6764 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6765 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6766 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6767 (get_minibuffer, read_minibuf_unwind):
6768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6769 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6770 this simplifies overflow checking. All callers changed.
6771 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6772 (Ftest_completion):
6773 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6774 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6775 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6776 Check that fixnums are in proper range for system types.
6777 (Fx_create_frame, Fx_show_tip):
6778 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6779 * nsfont.m (ns_findfonts, nsfont_list_family):
6780 Don't assume fixnum fits in long.
6781 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6782 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6783 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6784 wide enough.
6785 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6787 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6788 (PRINTDECLARE, PRINTPREPARE):
6789 (strout, print_string):
6790 (print, print_preprocess, print_check_string_charset_prop)
6791 (print_object):
6792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6793 (PRINTDECLARE):
6794 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6796 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6797 (printchar, strout): Use xpalloc to catch size calculation overflow.
6798 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6799 (print_error_message): Use SAFE_ALLOCA, not alloca.
6800 (print_object): Use int, not EMACS_INT, where int is wide enough.
6801 (print_depth, new_backquote_output, print_number_index):
6802 Use ptrdiff_t, not int, where int might not be wide enough.
6803 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6804 (Fset_process_window_size, Fformat_network_address)
6805 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6806 (sigchld_handler):
6807 Check that fixnums are in proper range for system types.
6808 (Fsignal_process): Simplify by avoiding a goto.
6809 Check for process-ids out of pid_t range rather than relying on
6810 undefined behavior.
6811 (process_tick, update_tick): Use EMACS_INT, not int.
6812 (Fformat_network_address, read_process_output, send_process)
6813 (Fprocess_send_region, status_notify):
6814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6815 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6816 (wait_reading_process_output, read_process_output, exec_sentinel):
6817 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6818 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6819 (Faccept_process_output): Use duration_to_sec_usec to do proper
6820 overflow checking on durations.
6821 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6822 Don't assume pid_t fits in int.
6823 * process.h (struct Lisp_Process): Members tick and update_tick
6824 are now of type EMACS_INT, not int.
6825 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6826 configured --with-wide-int.
6827 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6828 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6829 * search.c (looking_at_1, string_match_1):
6830 (fast_string_match, fast_c_string_match_ignore_case)
6831 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6832 (scan_newline, find_before_next_newline, search_command)
6833 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6834 (set_search_regs, wordify):
6835 (Freplace_match):
6836 (Fmatch_data):
6837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6838 (string_match_1, search_buffer, set_search_regs):
6839 (Fmatch_data):
6840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6841 (wordify): Check for overflow in size calculation.
6842 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6843 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6844 Check that fixnums are in proper range for system types.
6845 * sound.c (struct sound_device)
6846 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6847 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6848 (Fplay_sound_internal):
6849 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6850 * syntax.c (struct lisp_parse_state, find_start_modiff)
6851 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6852 (Fparse_partial_sexp):
6853 Don't assume fixnums can fit in int.
6854 (struct lisp_parse_state, find_start_pos, find_start_value)
6855 (find_start_value_byte, find_start_begv)
6856 (update_syntax_table, char_quoted, dec_bytepos)
6857 (find_defun_start, prev_char_comend_first, back_comment):
6858 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6859 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6860 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6861 (Finternal_describe_syntax_value): Check that match_lisp is a
6862 character, not an integer, since the code stuffs it into int.
6863 (scan_words, scan_sexps_forward):
6864 Check that fixnums are in proper range for system types.
6865 (Fforward_word):
6866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6867 (scan_sexps_forward):
6868 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6869 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6870 * syntax.h: Adjust decls to match defn changes elsewhere.
6871 (struct gl_state_s):
6872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6873 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6874 MOST_POSITIVE_FIXNUM.
6875 * sysdep.c (wait_for_termination_1, wait_for_termination)
6876 (interruptible_wait_for_termination, mkdir):
6877 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6878 (emacs_read, emacs_write):
6879 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6880 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6881 and double all fit in int.
6882 * term.c (set_tty_color_mode):
6883 Check that fixnums are in proper range for system types.
6884 * termhooks.h (struct input_event):
6885 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6886 * textprop.c (validate_interval_range, interval_of)
6887 (Fadd_text_properties, set_text_properties_1)
6888 (Fremove_text_properties, Fremove_list_of_text_properties)
6889 (Ftext_property_any, Ftext_property_not_all)
6890 (copy_text_properties, text_property_list, extend_property_ranges)
6891 (verify_interval_modification):
6892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6893 (Fnext_single_char_property_change)
6894 (Fprevious_single_char_property_change):
6895 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6896 (copy_text_properties):
6897 Check for integer overflow in index calculation.
6898 * undo.c (last_boundary_position, record_point, record_insert)
6899 (record_delete, record_marker_adjustment, record_change)
6900 (record_property_change):
6901 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6902 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6903 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6904 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6905 (Fx_hide_tip, Fx_file_dialog):
6906 * w32menu.c (set_frame_menubar):
6907 Use ptrdiff_t, not int, for consistency with rest of code.
6908 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6909 (select_window, Fdelete_other_windows_internal)
6910 (window_scroll_pixel_based, window_scroll_line_based)
6911 (Frecenter, Fset_window_configuration):
6912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6913 (Fset_window_hscroll, run_window_configuration_change_hook)
6914 (set_window_buffer, temp_output_buffer_show, scroll_command)
6915 (Fscroll_other_window, Frecenter):
6916 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6917 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6918 Don't assume fixnum fits in int.
6919 (Fset_window_scroll_bars):
6920 Check that fixnums are in proper range for system types.
6921 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6922 (string_pos, c_string_pos, number_of_chars, init_iterator)
6923 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6924 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6925 (compute_display_string_end, handle_face_prop)
6926 (face_before_or_after_it_pos, handle_invisible_prop)
6927 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6928 (display_prop_intangible_p, string_buffer_position_lim)
6929 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6930 (get_overlay_strings_1, get_overlay_strings)
6931 (iterate_out_of_display_property, forward_to_next_line_start)
6932 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6933 (get_next_display_element, set_iterator_to_next)
6934 (get_visually_first_element, compute_stop_pos_backwards)
6935 (handle_stop_backwards, next_element_from_buffer)
6936 (move_it_in_display_line_to, move_it_in_display_line)
6937 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6938 (add_to_log, message_dolog, message_log_check_duplicate)
6939 (message2, message2_nolog, message3, message3_nolog
6940 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6941 (current_message_1, truncate_echo_area, truncate_message_1)
6942 (set_message, set_message_1, store_mode_line_noprop)
6943 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6944 (text_outside_line_unchanged_p, check_point_in_composition)
6945 (reconsider_clip_changes)
6946 (redisplay_internal, set_cursor_from_row, try_scrolling)
6947 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6948 (redisplay_window, find_last_unchanged_at_beg_row)
6949 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6950 (trailing_whitespace_p, find_row_edges, display_line)
6951 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6952 (display_mode_element, store_mode_line_string)
6953 (pint2str, pint2hrstr, decode_mode_spec)
6954 (display_count_lines, display_string, draw_glyphs)
6955 (x_produce_glyphs, x_insert_glyphs)
6956 (rows_from_pos_range, mouse_face_from_buffer_pos)
6957 (fast_find_string_pos, mouse_face_from_string_pos)
6958 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6960 (safe_call, init_from_display_pos, handle_fontified_prop)
6961 (handle_single_display_spec, load_overlay_strings)
6962 (with_echo_area_buffer, setup_echo_area_for_printing)
6963 (display_echo_area, echo_area_display)
6964 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6965 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6966 (redisplay_window, dump_glyph_row, display_mode_line)
6967 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6968 (handle_display_spec, display_prop_string_p):
6969 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6970 (handle_single_display_spec, build_desired_tool_bar_string)
6971 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6972 (get_specified_cursor_type):
6973 Check that fixnums are in proper range for system types.
6974 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6975 (Flookup_image_map):
6976 Don't assume fixnums fit in int.
6977 (compare_overlay_entries):
6978 Avoid mishandling comparisons due to subtraction overflow.
6979 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6980 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6981 (handle_tool_bar_click):
6982 Use int, not unsigned, since we prefer signed and the signedness
6983 doesn't matter here.
6984 (get_next_display_element, next_element_from_display_vector):
6985 Use int, not EMACS_INT, when int is wide enough.
6986 (start_hourglass): Use duration_to_sec_usec to do proper
6987 overflow checking on durations.
6988 * xfaces.c (Fbitmap_spec_p):
6989 Check that fixnums are in proper range for system types.
6990 (compare_fonts_by_sort_order):
6991 Avoid mishandling comparisons due to subtraction overflow.
6992 (Fx_family_fonts, realize_basic_faces):
6993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6994 (Fx_family_fonts):
6995 Don't assume fixnum fits in int.
6996 Use SAFE_ALLOCA_LISP, not alloca.
6997 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6998 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6999 (face_at_buffer_position, face_for_overlay_string)
7000 (face_at_string_position):
7001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7002 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
7003 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
7004 (Fx_show_tip):
7005 Check that fixnums are in proper range for system types.
7006 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
7007 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
7008 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7009 (Fx_change_window_property): Don't assume fixnums fit in int.
7010 * xfont.c (xfont_chars_supported):
7011 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7012 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
7013 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
7014 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7015 * xml.c (parse_region):
7016 * xrdb.c (magic_file_p):
7017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
7018 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
7019 (x_get_local_selection, x_reply_selection_request)
7020 (x_handle_selection_request, wait_for_property_change):
7021 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7022 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7023 short is wide enough.
7024 (x_send_client_event): Don't assume fixnum fits in int.
7025 * xterm.c (x_x_to_emacs_modifiers):
7026 Don't assume EMACS_INT overflows nicely into int.
7027 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7028 may come from Lisp.
7029 (handle_one_xevent): NATNUMP can eval its arg twice.
7030 (x_connection_closed):
7031 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7032 * xterm.h: Adjust decls to match defn changes elsewhere.
7033 (struct scroll_bar): Use struct vectorlike_header
7034 rather than rolling our own approximation.
7035 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7036
7037 2012-05-25 Glenn Morris <rgm@gnu.org>
7038
7039 * lisp.mk (lisp): Update for more files being compiled now.
7040
7041 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7042
7043 * lread.c: Remove `read_pure' which makes no difference.
7044 (read_pure): Remove var.
7045 (unreadpure): Remove function.
7046 (readevalloop): Don't call read_list with -1 flag.
7047 (read1, read_vector): Don't test read_pure any more.
7048 (read_list): Simplify.
7049
7050 * fileio.c, character.h: Minor style tweaks.
7051
7052 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7053
7054 * window.h (clip_changed): Remove useless declaration.
7055
7056 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7057
7058 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7059 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7060
7061 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7062
7063 Remove src/m/*.
7064 This directory predates autoconf and is no longer needed nowadays.
7065 Move its few remaining bits of functionality to where they're needed.
7066 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7067 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7068 * m/template.h: Remove.
7069 * Makefile.in (M_FILE): Remove. All uses removed.
7070 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7071 * lisp.h (USE_LSB_TAG):
7072 * mem-limits.h (EXCEEDS_LISP_PTR):
7073 Use VAL_MAX, not VALBITS, in #if.
7074 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7075 (EMACS_UINT): Define unconditionally now.
7076 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7077 (BITS_PER_EMACS_INT): New constants, replacing
7078 what used to be in config.h, but not useful in #if.
7079 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7080 define them any more.
7081 (VAL_MAX): New macro.
7082 (VALMASK): Use it.
7083 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7084 BITS_PER_EMACS_INT, in #if.
7085 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7086 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7087 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7088 * s/ms-w32.h (DATA_START):
7089 Move here from removed file m/intel386.h.
7090 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7091 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7092
7093 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7094
7095 Assume C89 or later.
7096 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7097 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7098 (xrealloc):
7099 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7100 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7101 * textprop.c, tparam.c (NULL): Remove.
7102 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7103 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7104 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7105 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7106 * xterm.c (input_signal_count): Assume volatile works.
7107
7108 2012-05-21 Ken Brown <kbrown@cornell.edu>
7109
7110 * xgselect.c (xg_select): Fix first argument in call to 'select'
7111 (bug#11508).
7112
7113 2012-05-20 Ken Brown <kbrown@cornell.edu>
7114
7115 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7116 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7117
7118 2012-05-19 Ken Brown <kbrown@cornell.edu>
7119
7120 * xfns.c (x_in_use): Remove `static' qualifier.
7121 * xterm.h (x_in_use): Declare.
7122 * xgselect.c: Include xterm.h.
7123 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7124 and `display_arg' (bug#9754).
7125
7126 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7127
7128 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7129
7130 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7131 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7132
7133 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7134
7135 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7136
7137 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7138 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7139
7140 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7141 reference to image_cache->refcount.
7142 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7143
7144 2012-05-17 Juri Linkov <juri@jurta.org>
7145
7146 * search.c (Fword_search_regexp, Fword_search_backward)
7147 (Fword_search_forward, Fword_search_backward_lax)
7148 (Fword_search_forward_lax): Move functions to isearch.el
7149 (bug#10145, bug#11381).
7150
7151 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7154
7155 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7156
7157 * lread.c (init_obarray): Declare Qt and Qnil as special.
7158
7159 2012-05-14 Glenn Morris <rgm@gnu.org>
7160
7161 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7162 Put "libexec" before "bin", for the sake of init_callproc_1.
7163
7164 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7165
7166 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7167
7168 * unexaix.c: Port to more-recent AIX compilers.
7169 (report_error, report_error_1, make_hdr, copy_sym)
7170 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7171 Make arguments const char *, not char *, to avoid violations of C
7172 standard and to fix some AIX warnings reported by Gilles Pion.
7173
7174 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7175
7176 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7177 already have overlays loaded.
7178 (handle_single_display_spec): Before returning without displaying
7179 fringe bitmap, synchronize the bidi iterator with the main display
7180 iterator, by calling iterate_out_of_display_property.
7181 (iterate_out_of_display_property): Detect buffer iteration by
7182 testing that it->string is a Lisp string.
7183 (get_next_display_element): When the current object is exhausted,
7184 and there's something on it->stack, call set_iterator_to_next to
7185 proceed with what's on the stack, instead of returning zero.
7186 (set_iterator_to_next): If called at the end of a Lisp string,
7187 proceed to consider_string_end without incrementing string
7188 position. Don't increment display vector index past the end of
7189 the display vector. (Bug#11417)
7190 (pos_visible_p): Don't report a position visible when move_it_to
7191 stopped at the last line of window, which happens to be scanned
7192 backwards by the bidi iteration. (Bug#11464)
7193
7194 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7195
7196 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7197 and right-margin display specs even if the spec is invalid or we
7198 are on a TTY, and thus unable to display on the fringes.
7199 That's because the text with the property will not be displayed anyway,
7200 so we need to signal to the caller that this is a "replacing"
7201 display spec. This fixes display when the spec is invalid or we
7202 are on a TTY.
7203
7204 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7205
7206 * unexaix.c (make_hdr): Fix typo in prototype.
7207 This bug broke the build on AIX. Problem reported by Gilles Pion.
7208
7209 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7210
7211 * keyboard.c (kbd_buffer_get_event): Read special events also in
7212 batch mode. (Bug#11415)
7213
7214 2012-05-12 Glenn Morris <rgm@gnu.org>
7215
7216 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7217
7218 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7219
7220 * lisp.mk (lisp): Add newcomment.elc.
7221
7222 2012-05-12 Glenn Morris <rgm@gnu.org>
7223
7224 * Makefile.in (MKDIR_P): New, set by configure.
7225 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7226
7227 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7228
7229 Remove unused function hourglass_started.
7230 * dispextern.h (hourglass_started):
7231 * w32fns.c (hourglass_started):
7232 * xdisp.c (hourglass_started): Remove.
7233
7234 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7235
7236 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7237 Update dependencies.
7238
7239 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7240
7241 * xgselect.c (xg_select): Put maxfds+1 into a var.
7242 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7243
7244 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7245
7246 2012-05-10 Dave Abrahams <dave@boostpro.com>
7247
7248 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7249 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7250
7251 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7252
7253 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7254 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7255 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7256 Initialize xd_registered_buses.
7257
7258 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7259
7260 Untag more efficiently if USE_LSB_TAG.
7261 This is based on a proposal by YAMAMOTO Mitsuharu in
7262 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7263 For an admittedly artificial (nth 8000 longlist) benchmark on
7264 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7265 Emacs's overall text size by 1%.
7266 * lisp.h (XUNTAG): New macro.
7267 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7268 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7269 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7270 * eval.c (Fautoload):
7271 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7272 * frame.h (XFRAME): Use XUNTAG.
7273
7274 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7275 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7276 Remove unportable assumptions about print widths of types like
7277 dbus_uint32_t.
7278 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7279 intptr_t when converting between pointer and integer, to avoid GCC
7280 warnings about wrong width.
7281
7282 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7283
7284 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7285 stack for each reader_thread, instead of defaulting to 8MB
7286 determined by the linker. This avoids failures in creating
7287 subprocesses on Windows 7, see the discussion in this thread:
7288 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7289
7290 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7291
7292 Fix up display of the *Minibuf-0* buffer in the mini window.
7293 * keyboard.c (read_char): Don't clear the echo area if there's no
7294 message to clear.
7295 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7296 contents of *Minibuf-0*) if there's no message displayed in its stead.
7297
7298 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7299
7300 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7301 batch mode.
7302
7303 2012-05-06 Chong Yidong <cyd@gnu.org>
7304
7305 * lisp.mk (lisp): Update.
7306
7307 2012-05-05 Jim Meyering <meyering@redhat.com>
7308
7309 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7310
7311 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7312
7313 * data.c (PUT_ERROR): New macro.
7314 (syms_of_data): Use it. Add new error type `user-error'.
7315 * undo.c (user_error): New function.
7316 (Fprimitive_undo): Use it.
7317 * print.c (print_error_message): Adjust print style for `user-error'.
7318 * keyboard.c (user_error): New function.
7319 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7320
7321 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7322
7323 Do not limit current-time-string to years 1000..9999.
7324 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7325 (Fcurrent_time_string): Support any year that is supported by the
7326 underlying localtime representation. Don't use asctime, as it
7327 has undefined behavior for years outside the range -999..9999.
7328
7329 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7330
7331 Fix race conditions involving setenv, gmtime, localtime, asctime.
7332 Without this fix, interrupts could mess up code that uses these
7333 nonreentrant functions, since setting TZ invalidates existing
7334 tm_zone or tzname values, and since most of these functions return
7335 pointers to static storage.
7336 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7337 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7338 Grow the critical sections to include not just invoking
7339 localtime/gmtime, but also accessing these functions' results
7340 including their tm_zone values if any, and any related TZ setting.
7341 (format_time_string): Last arg is now struct tm *, not struct tm **,
7342 so that the struct tm is saved in the critical section.
7343 All callers changed. Simplify allocation of initial buffer, partly
7344 motivated by the fact that memory allocation needs to be outside
7345 the critical section.
7346
7347 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7348
7349 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7350 with RESET_INTERVAL.
7351
7352 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7353 Remove duplicated buffer name initialization.
7354
7355 2012-05-02 Jim Meyering <jim@meyering.net>
7356
7357 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7358
7359 * xfns.c (x_window): Use xstrdup (Bug#11375).
7360
7361 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7362
7363 * xdisp.c (pos_visible_p): If already at a newline from the
7364 display string before the 'while' loop, don't walk back the glyphs
7365 from it3.glyph_row. Solves assertion violation when the display
7366 string begins with a newline (egg.el). (Bug#11367)
7367
7368 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7369
7370 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7371 Move to simple.el.
7372
7373 2012-05-01 Glenn Morris <rgm@gnu.org>
7374
7375 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7376 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7377 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7378 All were removed before 23.1.
7379
7380 * dispnew.c: Remove HAVE_LIBNCURSES test;
7381 it is always true on relevant platforms.
7382
7383 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7384 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7385
7386 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7387
7388 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7389
7390 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7391 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7392 Remove.
7393
7394 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 Do not avoid creating empty evaporating overlays (Bug#9642).
7397 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7398 That is, do not delete an evaporating overlay if it becomes
7399 empty after its bounds are adjusted to fit within its buffer.
7400 This fix caused other problems, and I'm reverting it until we get
7401 to the bottom of them.
7402
7403 2012-04-27 Chong Yidong <cyd@gnu.org>
7404
7405 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7406
7407 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7408
7409 * xdisp.c (pos_visible_p): If the window start position is beyond
7410 ZV, start the display from buffer beginning. Prevents assertion
7411 violation in init_iterator when the minibuffer window is scrolled
7412 via the scroll bar.
7413
7414 * window.c (window_scroll_pixel_based): Likewise.
7415
7416 2012-04-27 Chong Yidong <cyd@gnu.org>
7417
7418 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7419
7420 2012-04-27 Glenn Morris <rgm@gnu.org>
7421
7422 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7423 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7424
7425 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7426
7427 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7428 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7429
7430 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7431
7432 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7433 display element, check also the underlying string or buffer
7434 character. (Bug#11341)
7435
7436 * w32menu.c: Include w32heap.h.
7437 (add_menu_item): If the call to AppendMenuW (via
7438 unicode_append_menu) fails, disable Unicode menus only if we are
7439 running on Windows 9X/Me.
7440
7441 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7442
7443 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7444 (xgetint): Add missing shift for LSB tags.
7445
7446 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7447
7448 * keyboard.c (read_char): Don't wipe echo area for select window
7449 events: These might get delayed via `mouse-autoselect-window'
7450 (Bug#11304).
7451
7452 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7453
7454 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7455 manipulation of :loaded-from data.
7456
7457 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7458
7459 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7460 now a cons (bug#11311).
7461
7462 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7463
7464 Do not create empty overlays with the evaporate property (Bug#9642).
7465 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7466 if it becomes empty after its bounds are adjusted to fit within
7467 its buffer. Without this fix, in a nonempty buffer (let ((o
7468 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7469 yields an empty overlay that has the evaporate property, which is
7470 not supposed to happen.
7471
7472 Fix minor GTK3 problems found by static checking.
7473 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7474 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7475 (struct _EmacsFixedClass, emacs_fixed_get_type):
7476 Move decls here from emacsgtkfixed.h, since they needn't be public.
7477 (emacs_fixed_get_type): Now static.
7478 (emacs_fixed_class_init): Omit unused local.
7479 (emacs_fixed_child_type): Remove; unused.
7480 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7481 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7482 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7483 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7484 (EMACS_FIXED_GET_CLASS): Remove; unused.
7485 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7486
7487 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7488 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7489
7490 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7491
7492 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7493 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7494 (__malloc_size_t, __malloc_ptrdiff_t):
7495 Remove. All uses removed, replaced by the definiens if needed,
7496 since we can assume C89 or better now.
7497 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7498 (protect_malloc_state, align, get_contiguous_space)
7499 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7500 (malloc_atfork_handler_child, malloc_enable_thread)
7501 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7502 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7503 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7504 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7505 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7506 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7507 Define using prototypes, not old style.
7508 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7509 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7510 (align): Don't assume that signed integer overflow wraps around.
7511 Omit unused local var.
7512 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7513 (_free_internal_nolock, memalign, mallochook, reallochook):
7514 Omit no-longer-needed casts.
7515 (valloc): Use getpagesize, not __getpagesize.
7516 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7517 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7518
7519 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7520
7521 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7522
7523 Move functions from C to Lisp. Make non-blocking method calls
7524 the default. Implement further D-Bus standard interfaces.
7525
7526 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7527 (QCdbus_request_name_allow_replacement)
7528 (QCdbus_request_name_replace_existing)
7529 (QCdbus_request_name_do_not_queue)
7530 (QCdbus_request_name_reply_primary_owner)
7531 (QCdbus_request_name_reply_in_queue)
7532 (QCdbus_request_name_reply_exists)
7533 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7534 (QCdbus_registered_serial, QCdbus_registered_method)
7535 (QCdbus_registered_signal): New Lisp objects.
7536 (XD_DEBUG_MESSAGE): Use sizeof.
7537 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7538 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7539 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7540 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7541 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7542 (xd_signature, xd_append_arg): Allow float for integer types.
7543 (xd_get_connection_references): New function.
7544 (xd_get_connection_address): Rename from xd_initialize.
7545 Return cached address.
7546 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7547 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7548 level.
7549 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7550 Return number of refcounts.
7551 (Fdbus_get_unique_name): Make stronger parameter check.
7552 (Fdbus_message_internal): New defun.
7553 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7554 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7555 (Fdbus_send_signal, Fdbus_register_service)
7556 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7557 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7558 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7559 (Vdbus_compiled_version, Vdbus_runtime_version)
7560 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7561 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7562 (Vdbus_message_type_signal): New defvars.
7563 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7564 Adapt docstring.
7565
7566 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7569 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7570 Do not assume ptrdiff_t is the same width as 'int'.
7571
7572 * alloc.c: Handle unusual debugging option combinations.
7573 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7574 since the two debugging options are incompatible.
7575 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7576 is defined.
7577 (mem_init, mem_insert, mem_insert_fixup):
7578 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7579 (NEED_MEM_INSERT): Remove; no longer needed.
7580
7581 2012-04-22 Leo Liu <sdl.web@gmail.com>
7582
7583 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7584
7585 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7586
7587 * sysdep.c [__FreeBSD__]: Minor cleanups.
7588 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7589 Use Emacs indenting style more consistently. Avoid some casts.
7590 Use 'double' consistently rather than mixing 'float' and 'double'.
7591
7592 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7593
7594 * sysdep.c (list_system_processes, system_process_attributes):
7595 Add implementation for FreeBSD (Bug#5243).
7596
7597 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7598
7599 * lisp.mk (lisp): Update.
7600
7601 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7602
7603 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7604 It is never used otherwise.
7605
7606 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7607
7608 * print.c (print_preprocess): Only check print_depth if print-circle
7609 is nil.
7610 (print_object): Check for cycles even when print-circle is nil and
7611 print-gensym is t, but only check print_depth if print-circle is nil.
7612
7613 2012-04-20 Chong Yidong <cyd@gnu.org>
7614
7615 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7616 set the status to "failed" and ensure that sentinel is run.
7617
7618 2012-04-20 Glenn Morris <rgm@gnu.org>
7619
7620 * process.c (Fset_process_inherit_coding_system_flag)
7621 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7622 (Fmake_network_process, Fmake_serial_process): Doc fix.
7623
7624 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7625
7626 * xdisp.c (string_buffer_position_lim): Limit starting position to
7627 BEGV.
7628 (set_cursor_from_row): If called for a mode-line or header-line
7629 row, return zero immediately.
7630 (try_cursor_movement): If inside continuation line, don't back up
7631 farther than the first row after the header line, if any.
7632 Don't consider the header-line row as "partially visible", even if
7633 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7634
7635 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7636
7637 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7638 (bug#11238).
7639
7640 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7641 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7642
7643 configure: new option --enable-gcc-warnings (Bug#11207)
7644 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7645 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7646 (ALL_CFLAGS): Use new macros rather than old.
7647 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7648 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7649 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7650 -Wunused-result, -Wunused-variable. This should go away once
7651 the Emacs and Gnulib regex code is merged.
7652 (xmalloc, xrealloc): Now static.
7653
7654 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7655
7656 * dired.c (Fsystem_groups): Remove unused local.
7657
7658 2012-04-17 Glenn Morris <rgm@gnu.org>
7659
7660 * dired.c (Fsystem_users): Doc fix.
7661
7662 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7663
7664 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7665 (syms_of_dired): Add them.
7666
7667 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7668
7669 Fix minor alloc.c problems found by static checking.
7670 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7671 New extern decls, to avoid calling undeclared functions.
7672 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7673 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7674 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7675 (NEED_MEM_INSERT): New macro.
7676 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7677 Remove one incorrect comment and fix another.
7678
7679 Fix minor ralloc.c problems found by static checking.
7680 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7681 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7682 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7683 (r_alloc_sbrk): Now static.
7684
7685 Improve ralloc.c interface checking.
7686 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7687 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7688 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7689 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7690 [REL_ALLOC]: ... to here, to check interface.
7691 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7692 Remove decls. This fixes an "It stinks!".
7693
7694 * alloc.c (which_symbols): Fix alignment issue / type clash.
7695
7696 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7697
7698 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7699 (struct Lisp_Misc_Any): Likewise.
7700 (struct Lisp_Free): Likewise.
7701 * alloc.c (union aligned_Lisp_Symbol): Define.
7702 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7703 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7704 (union aligned_Lisp_Misc): Define.
7705 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7706 aligned_Lisp_Misc instead of union Lisp_Misc.
7707 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7708
7709 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7710
7711 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7712 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7713 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7714 * s/netbsd.h, s/sol2-6.h:
7715 Remove definition of GC_MARK_STACK, since the default now works.
7716 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7717 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7718 no longer the default.
7719 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7720
7721 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7722
7723 * lread.c (lisp_file_lexically_bound_p):
7724 Fix hang at ";-*-\n" (bug#11238).
7725
7726 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7727
7728 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7729 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7730
7731 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7732
7733 * nsterm.m (constrainFrameRect): Always constrain when there is only
7734 one screen (Bug#10962).
7735
7736 2012-04-13 Ken Brown <kbrown@cornell.edu>
7737
7738 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7739
7740 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7741
7742 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7743
7744 2012-04-11 Daniel Colascione <dancol@dancol.org>
7745
7746 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7747 against is gone. It's better to use vfork now so that when Cygwin
7748 gains a new, working vfork, we use it automatically (bug#10398).
7749
7750 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7751
7752 * window.c (save_window_save): Obey window-point-insertion-type.
7753
7754 2012-04-11 Glenn Morris <rgm@gnu.org>
7755
7756 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7757
7758 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7759
7760 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7761
7762 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7763
7764 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7765 (force_quit_count): New var.
7766 (handle_interrupt): Use it.
7767
7768 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7769
7770 * w32.c (w32_delayed_load): Record the full path of the library
7771 being loaded (bug#10424).
7772
7773 2012-04-09 Glenn Morris <rgm@gnu.org>
7774
7775 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7776 not just in the obarray, before snarfing them. (Bug#11036)
7777
7778 * Makefile.in ($(leimdir)/leim-list.el):
7779 Pass EMACS rather than BUILT_EMACS.
7780
7781 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7782
7783 * process.c (make_process):
7784 * process.h: Add integer `gnutls_handshakes_tried' member to
7785 process struct.
7786
7787 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7788 Add convenience `GNUTLS_LOG2i' macro.
7789
7790 * gnutls.c (gnutls_log_function2i): Convenience log function.
7791 (emacs_gnutls_read): Use new log functions,
7792 `gnutls_handshakes_tried' process member, and
7793 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7794 attempts per process (connection).
7795
7796 2012-04-09 Chong Yidong <cyd@gnu.org>
7797
7798 * eval.c (Fuser_variable_p, user_variable_p_eh)
7799 (lisp_indirect_variable): Functions deleted.
7800 (Fdefvar): Caller changed.
7801
7802 * callint.c (Finteractive, Fcall_interactively):
7803 * minibuf.c (Fread_variable): Callers changed.
7804
7805 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7806
7807 * xdisp.c (set_cursor_from_row): If the display string appears in
7808 the buffer at position that is closer to point than the position
7809 after the display string, display the cursor on the first glyph of
7810 the display string. Fixes cursor display when a 'display' text
7811 property immediately follows invisible text. (Bug#11094)
7812
7813 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7814
7815 composite.c: use 'double' consistently
7816 * composite.c (get_composition_id): Use 'double' consistently
7817 instead of converting 'float' to 'double' and vice versa; this is
7818 easier to understand and avoids a GCC warning.
7819
7820 2012-04-09 Glenn Morris <rgm@gnu.org>
7821
7822 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7823 preparation for dumping it with emacs. (Bug#4789)
7824 (leimdir): New variable.
7825 ($(leimdir)/leim-list.el): New rule.
7826 (emacs$(EXEEXT)): Depend on leim-list.el.
7827
7828 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7829 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7830 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7831
7832 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7833
7834 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7835 proper alignment.
7836
7837 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7838
7839 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7840 Remove unused local variable.
7841
7842 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7843
7844 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7845 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7846 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7847 objects, as mark_maybe_pointer will catch them otherwise.
7848 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7849 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7850
7851 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7852
7853 Fix typo that broke non-Windows builds.
7854 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7855
7856 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7857
7858 Support building on MS-Windows with libxml2.
7859
7860 * makefile.w32-in (OBJ2): Add xml.$(O).
7861 (GLOBAL_SOURCES): Add xml.c.
7862 ($(BLD)/xml.$(O)): New dependency list.
7863
7864 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7865 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7866 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7867 [!WINDOWSNT]: New macros.
7868 (init_libxml2_functions, libxml2_loaded_p): New functions.
7869 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7870 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7871 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7872 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7873 linked in).
7874 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7875 Call init_libxml2_functions before calling libxml2 functions.
7876 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7877
7878 * emacs.c: Don't include libxml/parser.h.
7879 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7880 xmlCleanupParser directly.
7881
7882 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7883
7884 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7885
7886 * indent.c (Fvertical_motion): If there is a display string at
7887 point, use it.vpos to compute how many lines to backtrack after
7888 move_it_to point. (Bug#11133)
7889
7890 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7891
7892 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7893 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7894 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7895 macros related to unification of CJK characters. For the details,
7896 see the discussion following the message here:
7897 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7898
7899 2012-04-04 Chong Yidong <cyd@gnu.org>
7900
7901 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7902
7903 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7904
7905 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7906 instead of alloca. (Bug#11138)
7907
7908 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7909
7910 * w32menu.c (is_simple_dialog): Properly check lisp types.
7911 (Bug#11141)
7912
7913 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7914
7915 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7916 position we get to after a call to move_it_to fails the
7917 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7918 only if we wind up in a string from display property. (Bug#11063)
7919
7920 * window.c (Fdelete_other_windows_internal): Invalidate the row
7921 and column information about mouse highlight, so that redisplay
7922 restores it after reallocating the glyph matrices. (Bug#7464)
7923
7924 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7925 string comes from a `display' text property, use the buffer
7926 position of that property as if we actually saw that position in
7927 the row's glyphs.
7928 (move_it_by_lines): Remove the assertion that
7929 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7930 violated when there's a before-string at the beginning of a line.
7931 (Bug#11063)
7932
7933 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7934
7935 * xdisp.c (append_space_for_newline): If the default face was
7936 remapped, use the remapped face for the appended newline.
7937 (extend_face_to_end_of_line): Use the remapped default face for
7938 extending the face to the end of the line.
7939 (display_line): Call extend_face_to_end_of_line when the default
7940 face was remapped. (Bug#11068)
7941
7942 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7943
7944 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7945
7946 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7947
7948 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7949
7950 2012-03-27 Glenn Morris <rgm@gnu.org>
7951
7952 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7953 Doc fixes.
7954
7955 2012-03-26 Kenichi Handa <handa@m17n.org>
7956
7957 * dispextern.h (struct glyph): Fix previous change. Change the
7958 bit length of glyphless.ch to 25 (Bug#11082).
7959
7960 2012-03-26 Chong Yidong <cyd@gnu.org>
7961
7962 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7963 (command_loop_1): Use it; inhibit selection update for
7964 handle-select-window too (Bug#8996).
7965
7966 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7967
7968 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7969
7970 2012-03-25 Kenichi Handa <handa@m17n.org>
7971
7972 * dispextern.h (struct glyph): Change the bit length of
7973 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7974
7975 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7976
7977 * s/ms-w32.h (tzname): Include time.h before redirecting to
7978 _tzname. Fixes the MSVC build. (Bug#9960)
7979
7980 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7981
7982 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7983 characters.
7984
7985 * xterm.c (XTread_socket): Only modify handling_signal if
7986 !SYNC_INPUT. (Bug#11080)
7987
7988 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7989
7990 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7991 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7992 when fetching a multibyte character consumes more bytes than
7993 CHAR_BYTES returns, due to unification of CJK characters in
7994 string_char. (Bug#11073)
7995
7996 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7997
7998 * process.c (wait_reading_process_output): Handle pty disconnect
7999 by refraining from sending oneself a SIGCHLD (bug#10933).
8000
8001 2012-03-22 Chong Yidong <cyd@gnu.org>
8002
8003 * dispextern.h (struct it): New member string_from_prefix_prop_p.
8004
8005 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
8006 Mark string as coming from a prefix property.
8007 (handle_face_prop): Use default face for prefix strings (Bug#4281).
8008 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
8009
8010 2012-03-21 Chong Yidong <cyd@gnu.org>
8011
8012 * xfaces.c (Vface_remapping_alist): Doc fix.
8013
8014 2012-03-20 Eli Zaretskii <eliz@gnu.org>
8015
8016 * w32proc.c (Fw32_set_console_codepage)
8017 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
8018 Doc fixes.
8019
8020 2012-03-20 Chong Yidong <cyd@gnu.org>
8021
8022 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8023 to reflect default non-nil value of redisplay-dont-pause.
8024
8025 2012-03-19 Kenichi Handa <handa@m17n.org>
8026
8027 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8028 it fit in a valid range (Bug#11003).
8029
8030 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8031
8032 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8033 that is not from display property, accept the row as a "cursor
8034 row" if one of the string's character has a non-nil `cursor'
8035 property. Fixes cursor positioning when there are newlines in
8036 overlay strings, e.g. in icomplete.el. (Bug#11035)
8037
8038 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8039
8040 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8041
8042 2012-03-12 Chong Yidong <cyd@gnu.org>
8043
8044 * eval.c (inhibit_lisp_code): Rename from
8045 inhibit_window_configuration_change_hook; move from window.c.
8046
8047 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8048 * window.c (run_window_configuration_change_hook)
8049 (syms_of_window): Callers changed.
8050
8051 2012-03-11 Chong Yidong <cyd@gnu.org>
8052
8053 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8054
8055 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8056
8057 2012-03-10 Chong Yidong <cyd@gnu.org>
8058
8059 * frame.c (other_visible_frames): Don't assume the selected frame
8060 is visible (Bug#10955).
8061
8062 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8063
8064 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8065
8066 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8067
8068 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8069 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8070 zero (Bug#10954).
8071
8072 2012-03-03 Glenn Morris <rgm@gnu.org>
8073
8074 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8075
8076 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8077
8078 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8079 position past the first glyph_row that ends at ZV. (Bug#10902)
8080 (redisplay_window, next_element_from_string): Fix typos in
8081 comments.
8082 (redisplay_window): Pass to move_it_vertically the margin in
8083 pixels, not in screen lines.
8084
8085 2012-03-02 Glenn Morris <rgm@gnu.org>
8086
8087 * buffer.c (buffer-list-update-hook): Doc fix.
8088
8089 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8090
8091 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8092 push_it before setting up the iterator for the first overlay
8093 string, even if we have an empty string loaded.
8094 (next_overlay_string): If there's an empty string on the iterator
8095 stack, pop the stack. (Bug#10903)
8096
8097 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8098
8099 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8100 Suggested by Stefan Monnier in
8101 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8102 * alloc.c (widen_to_Lisp_Object): New static function.
8103 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8104 and widening them to Lisp_Objects. This would work even if
8105 USE_LSB_TAG is defined and wide integers are used, which might
8106 happen in a future version of Emacs.
8107
8108 2012-02-25 Chong Yidong <cyd@gnu.org>
8109
8110 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8111 Doc fix.
8112
8113 * xselect.c (Fx_selection_exists_p): Doc fix.
8114 (x_clipboard_manager_save_all): Print an informative message
8115 before saving to clipboard manager.
8116
8117 2012-02-24 Chong Yidong <cyd@gnu.org>
8118
8119 * keyboard.c (process_special_events): Handle all X selection
8120 requests in kbd_buffer, not just the next one (Bug#8869).
8121
8122 2012-02-23 Chong Yidong <cyd@gnu.org>
8123
8124 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8125 call when setting menu-bar-lines and tool-bar-lines parameters.
8126 (unwind_create_frame_1): New helper function.
8127
8128 * window.c (inhibit_window_configuration_change_hook): New var.
8129 (run_window_configuration_change_hook): Obey it.
8130 (syms_of_window): Initialize it.
8131
8132 2012-02-22 Chong Yidong <cyd@gnu.org>
8133
8134 * xterm.c (x_draw_image_relief): Add missing type check for
8135 Vtool_bar_button_margin (Bug#10743).
8136
8137 2012-02-21 Chong Yidong <cyd@gnu.org>
8138
8139 * fileio.c (Vfile_name_handler_alist): Doc fix.
8140
8141 * buffer.c (Fget_file_buffer): Protect against invalid file
8142 handler return value.
8143
8144 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8145
8146 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8147 when computing $valmask.
8148
8149 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8150 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8151 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8152 It's useless in that case, and it can cause problems on hosts
8153 that allocate halves of EMACS_INT values separately.
8154 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8155 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8156 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8157 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8158 it avoids undefined behavior on hosts where shifting right by more
8159 than the word width has undefined behavior.
8160
8161 2012-02-19 Chong Yidong <cyd@gnu.org>
8162
8163 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8164 (Funhandled_file_name_directory, Ffile_name_as_directory)
8165 (Fdirectory_file_name, Fexpand_file_name)
8166 (Fsubstitute_in_file_name): Protect against invalid file handler
8167 return values (Bug#10845).
8168
8169 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8170
8171 * .gdbinit (pitx): Fix incorrect references to fields of the
8172 iterator stack.
8173
8174 2012-02-17 Chong Yidong <cyd@gnu.org>
8175
8176 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8177
8178 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8179
8180 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8181 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8182
8183 2012-02-15 Chong Yidong <cyd@gnu.org>
8184
8185 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8186 marked as special. Also, starting docstrings with * is obsolete.
8187
8188 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8189
8190 * gnutls.c (emacs_gnutls_write): Fix last change.
8191
8192 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8193
8194 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8195 send_process.
8196
8197 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8198
8199 * keymap.c (Fsingle_key_description): Handle char ranges.
8200
8201 2012-02-12 Chong Yidong <cyd@gnu.org>
8202
8203 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8204 as that creates a dangerous corner case.
8205
8206 * window.c (Fdelete_window_internal): Invalidate the mouse
8207 highlight (Bug#9904).
8208
8209 2012-02-12 Glenn Morris <rgm@gnu.org>
8210
8211 * xselect.c (Fx_own_selection_internal)
8212 (Fx_get_selection_internal, Fx_disown_selection_internal)
8213 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8214 * nsselect.m (Fx_own_selection_internal)
8215 (Fx_disown_selection_internal, Fx_selection_exists_p)
8216 (Fx_selection_owner_p, Fx_get_selection_internal):
8217 Sync docs and argument specs with the xselect.c versions.
8218
8219 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8220
8221 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8222
8223 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8224
8225 * w32select.c (Fx_selection_exists_p): Sync doc string and
8226 argument list with xselect.c. (Bug#10783)
8227
8228 * w16select.c (Fx_selection_exists_p): Sync doc string and
8229 argument list with xselect.c. (Bug#10783)
8230
8231 2012-02-10 Glenn Morris <rgm@gnu.org>
8232
8233 * fns.c (Fsecure_hash): Doc fix.
8234
8235 2012-02-09 Kenichi Handa <handa@m17n.org>
8236
8237 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8238
8239 2012-02-07 Chong Yidong <cyd@gnu.org>
8240
8241 * buffer.c (Fbuffer_local_variables)
8242 (buffer_lisp_local_variables): Handle unbound vars correctly;
8243 don't let Qunbound leak into Lisp.
8244
8245 2012-02-07 Glenn Morris <rgm@gnu.org>
8246
8247 * image.c (Fimagemagick_types): Doc fix.
8248
8249 * image.c (imagemagick-render-type): Change it from a lisp object
8250 to an integer. Move the doc here from the lisp manual.
8251 Treat all values not equal to 0 the same.
8252
8253 2012-02-06 Chong Yidong <cyd@gnu.org>
8254
8255 * doc.c (store_function_docstring): Avoid applying docstring of
8256 alias to base function (Bug#2603).
8257
8258 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8259
8260 * .gdbinit (pp1, pv1): Remove redundant defines.
8261 (pr): Use pp.
8262
8263 2012-02-04 Chong Yidong <cyd@gnu.org>
8264
8265 * nsterm.m: Declare a global (Bug#10694).
8266
8267 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8268
8269 * w32.c (get_emacs_configuration_options):
8270 Include --enable-checking, if specified, in the return value.
8271
8272 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8273
8274 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8275 after rounding frame sizes. (Bug#9723)
8276
8277 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8278
8279 * keyboard.c (adjust_point_for_property): Don't position point
8280 before BEGV. (Bug#10696)
8281
8282 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8283
8284 Handle overflow when computing char display width (Bug#9496).
8285 * character.c (char_width): Return EMACS_INT, not int.
8286 (char_width, c_string_width): Check for overflow when
8287 computing the width; this is possible now that individual
8288 characters can have unbounded width. Problem introduced
8289 by merge from Emacs 23 on 2012-01-19.
8290
8291 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8292
8293 * dbusbind.c (Fdbus_register_method): Mention the return value
8294 :ignore in the docstring.
8295
8296 2012-02-02 Glenn Morris <rgm@gnu.org>
8297
8298 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8299
8300 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8301 Unconditionally set to t. (Bug#10673)
8302 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8303 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8304 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8305
8306 2012-02-02 Kenichi Handa <handa@m17n.org>
8307
8308 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8309 0, do not call append_composite_glyph.
8310
8311 2012-02-02 Kenichi Handa <handa@m17n.org>
8312
8313 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8314 NULL (Bug#6988).
8315 (x_produce_glyphs): If the component of a composition is a null
8316 string, set it->pixel_width to 1 to avoid zero-width glyph.
8317
8318 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8319
8320 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8321 first 2 arguments are identical. This makes inserting large
8322 output from a subprocess an order of magnitude faster on
8323 MS-Windows, where all sbrk'ed memory is always contiguous.
8324
8325 2012-01-31 Glenn Morris <rgm@gnu.org>
8326
8327 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8328 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8329 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8330
8331 2012-01-29 Glenn Morris <rgm@gnu.org>
8332
8333 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8334
8335 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8336
8337 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8338
8339 2012-01-28 Chong Yidong <cyd@gnu.org>
8340
8341 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8342
8343 2012-01-26 Chong Yidong <cyd@gnu.org>
8344
8345 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8346
8347 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8348 repeat counts (Bug#10507).
8349
8350 2012-01-26 Glenn Morris <rgm@gnu.org>
8351
8352 * lread.c (syms_of_lread): Doc fix.
8353
8354 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8355
8356 * coding.c (encode_designation_at_bol): Change return value to
8357 EMACS_INT.
8358
8359 2012-01-25 Chong Yidong <cyd@gnu.org>
8360
8361 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8362
8363 2012-01-21 Chong Yidong <cyd@gnu.org>
8364
8365 * floatfns.c (Fcopysign): Make the second argument non-optional,
8366 since nil is not allowed anyway.
8367
8368 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8369
8370 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8371 (send_process): Likewise.
8372
8373 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8374
8375 * window.c (save_window_save, Fcurrent_window_configuration)
8376 (Vwindow_persistent_parameters): Do not use Qstate.
8377 Rewrite doc-strings.
8378
8379 2012-01-19 Kenichi Handa <handa@m17n.org>
8380
8381 * character.c (char_width): New function.
8382 (Fchar_width, c_string_width, lisp_string_width):
8383 Use char_width (Bug#9496).
8384
8385 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8386
8387 * window.c (Vwindow_persistent_parameters): New variable.
8388 (Fset_window_configuration, save_window_save): Handle persistent
8389 window parameters.
8390
8391 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8392
8393 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8394 thrashing the stack of the thread. (Bug#9087)
8395
8396 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8397
8398 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8399
8400 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8401
8402 * xdisp.c (rows_from_pos_range): Handle the case where the
8403 highlight ends on a newline. (Bug#10464)
8404 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8405 he end column for display of highlight that ends on a newline
8406 before a R2L line.
8407
8408 2012-01-11 Glenn Morris <rgm@gnu.org>
8409
8410 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8411 from load-path also when installation-directory is nil. (Bug#10208)
8412
8413 2012-01-10 Glenn Morris <rgm@gnu.org>
8414
8415 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8416
8417 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8418 Update template values to be closer to their typical values these days.
8419
8420 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8421
8422 * xdisp.c (rows_from_pos_range): Accept additional argument
8423 DISP_STRING, and accept any glyph in a row whose object is that
8424 string as eligible for mouse highlight. Fixes mouse highlight of
8425 display strings from overlays. (Bug#10464)
8426
8427 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8428
8429 emacs: fix an auto-save permissions race condition (Bug#10400)
8430 * fileio.c (auto_saving_dir_umask): New static var.
8431 (Fmake_directory_internal): Use it.
8432 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8433 creating the directory. The old code temporarily assigns
8434 too-generous permissions to the directory.
8435 (do_auto_save_eh): Clear it.
8436 (Fdo_auto_save): Catch all errors, not just file errors, so
8437 that the var is always cleared.
8438
8439 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8440
8441 * search.c (scan_buffer): Pass character positions to
8442 know_region_cache, not byte positions. (Bug#6540)
8443
8444 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8445
8446 * w32.c (sys_rename): Report EXDEV when rename of a directory
8447 fails because the target is on another logical disk. (Bug#10284)
8448
8449 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8450
8451 * xterm.c (x_embed_request_focus): New function.
8452
8453 * xterm.h: Add prototype.
8454
8455 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8456
8457 2012-01-05 Glenn Morris <rgm@gnu.org>
8458
8459 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8460
8461 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8462
8463 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8464 Load gnutls_transport_set_lowat only if GnuTLS version is below
8465 2.11.1.
8466 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8467 GnuTLS versions below 2.11.1.
8468
8469 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8470
8471 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8472 to the doc string advising against its use for altering the way
8473 windows are scrolled.
8474
8475 2011-12-28 Kenichi Handa <handa@m17n.org>
8476
8477 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8478 coding-system ASCII compatible only when it does not produce BOM
8479 on encoding (Bug#10383).
8480
8481 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8482
8483 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8484 can scroll.
8485 (create_and_show_popup_menu): Always use menu_position_func for
8486 Gtk3 (Bug#10361).
8487
8488 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8489
8490 * callint.c (Fcall_interactively): Don't truncate prompt string.
8491
8492 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8493
8494 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8495 property that ends at ZV, so that the bidi iteration could be
8496 resumed from there (after widening). (Bug#10360)
8497
8498 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8499
8500 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8501
8502 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8503
8504 * nsterm.m (x_free_frame_resources):
8505 Release f->output_data.ns->miniimage.
8506 (ns_index_color): Fix indentation. Do not retain
8507 color_table->colors[i].
8508
8509 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8510 before returning.
8511
8512 * nsfns.m (x_set_background_color): Assign return value from
8513 ns_index_color to face-background instead of NSColor*.
8514 (ns_implicitly_set_icon_type): Fix indentation.
8515 Change assignment in for loop to comparison.
8516
8517 * emacs.c (ns_pool): New variable.
8518 (main): Assign ns_pool.
8519 (Fkill_emacs): Call ns_release_autorelease_pool.
8520
8521 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8522 autorelease fdesc, release fdAttrs and tdict.
8523 (ns_get_covering_families): Release charset.
8524 (ns_findfonts): Release NSFontDescriptor created with new.
8525 (ns_uni_to_glyphs): Fix indentation.
8526 (setString): Release attrStr before assigning new value.
8527
8528 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8529
8530 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8531 and NS_IMPL_COCOA.
8532 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8533 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8534
8535 2011-12-18 David Reitter <reitter@cmu.edu>
8536
8537 * nsterm.m (ns_term_init): Subscribe for notifications
8538 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8539 to method trackingNotification in EmacsMenu.
8540
8541 * nsmenu.m (trackingMenu): New variable.
8542 (trackingNotification): New method (from Aquamacs).
8543 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8544 from Aquamacs (Bug#7030).
8545
8546 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8547
8548 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8549 (symbol_to_nsstring): Fix indentation.
8550 (ns_symbol_to_pb): New function.
8551 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8552 (Fns_rotate_cut_buffers_internal): Remove.
8553 (Fns_store_selection_internal): Rename from
8554 Fns_store_cut_buffer_internal.
8555 (ns_get_foreign_selection, Fx_own_selection_internal)
8556 (Fx_disown_selection_internal, Fx_selection_exists_p)
8557 (Fns_get_selection_internal, Fns_store_selection_internal):
8558 Use ns_symbol_to_pb and check if return value is nil.
8559 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8560 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8561 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8562 renamed to Sns_store_selection_internal.
8563 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8564 and remove this function.
8565 (ns_handle_selection_clear): Remove, never used.
8566 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8567 here.
8568
8569 2011-12-17 Ken Brown <kbrown@cornell.edu>
8570
8571 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8572 GID is unknown (Bug#10257).
8573
8574 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8575
8576 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8577 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8578 which caused a build failure on GNU/Linux IA-64. This problem was
8579 introduced by my 2011-10-07 patch.
8580
8581 2011-12-15 Juri Linkov <juri@jurta.org>
8582
8583 * image.c (imagemagick_error): New function. (Bug#10112)
8584 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8585 Use `imagemagick_error' where ImageMagick functions return
8586 `MagickFalse'.
8587 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8588 proper order.
8589
8590 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8591
8592 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8593 fill background (Bug#8992).
8594
8595 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8596
8597 * window.c (Vwindow_combination_resize)
8598 (Vwindow_combination_limit): Use t instead of non-nil in
8599 doc-strings.
8600 (Vrecenter_redisplay): Add first sentence of doc-string on
8601 separate line.
8602 (Frecenter): Fix doc-string typo.
8603
8604 2011-12-11 Kenichi Handa <handa@m17n.org>
8605
8606 * coding.c (Funencodable_char_position): Pay attention to the
8607 buffer text relocation (Bug#9389).
8608
8609 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8610
8611 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8612 gtk_init (Bug#10100).
8613
8614 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8615
8616 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8617 IT->string is nil. (Bug#10263)
8618
8619 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8620
8621 * nsterm.h (x_free_frame_resources): Declare.
8622
8623 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8624 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8625
8626 * nsterm.h (ns_get_defaults_value): Declare.
8627
8628 * nsterm.m (ns_default): Call ns_get_defaults_value.
8629
8630 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8631
8632 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8633 (Bug#10170)
8634
8635 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8636
8637 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8638 that where the value of an _OBJC_* symbol points to is in the .bss
8639 section (Bug#10240).
8640
8641 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8642
8643 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8644 after the loop to call ccl_driver at least once (Bug#8619).
8645
8646 2011-12-08 Kenichi Handa <handa@m17n.org>
8647
8648 * ftfont.c (get_adstyle_property): Fix previous change
8649 (Bug#10233).
8650
8651 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8652
8653 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8654 dirs from the default value of EMACSLOADPATH (bug#10208).
8655
8656 2011-12-07 Glenn Morris <rgm@gnu.org>
8657
8658 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8659 installation and source directories as well. (Bug#10208)
8660
8661 2011-12-06 Chong Yidong <cyd@gnu.org>
8662
8663 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8664
8665 2011-12-06 Glenn Morris <rgm@gnu.org>
8666
8667 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8668 as an error, not just -1. (Bug#10217)
8669
8670 2011-12-05 Chong Yidong <cyd@gnu.org>
8671
8672 * keyboard.c (process_special_events): New function.
8673 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8674
8675 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 * coding.c (encode_designation_at_bol): Don't use uninitialized
8678 local variable (Bug#9318).
8679
8680 2011-12-05 Kenichi Handa <handa@m17n.org>
8681
8682 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8683 return Qnil (Bug#8046, Bug#10193).
8684
8685 2011-12-05 Kenichi Handa <handa@m17n.org>
8686
8687 * coding.c (encode_designation_at_bol): New args charbuf_end and
8688 dst. Return the number of produced bytes. Callers changed.
8689 (coding_set_source): Return how many bytes coding->source was
8690 relocated.
8691 (coding_set_destination): Return how many bytes
8692 coding->destination was relocated.
8693 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8694 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8695
8696 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8697
8698 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8699 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8700 macro (Bug#9318).
8701
8702 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8703
8704 The following changes are to fix Bug#9318.
8705
8706 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8707 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8708 (encode_coding_iso_2022, encode_coding_sjis)
8709 (encode_coding_big5, encode_coding_charset): Use the above macros.
8710
8711 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8712
8713 * lisp.h (process_quit_flag): Fix external declaration.
8714
8715 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8716
8717 Don't macro-inline non-performance-critical code.
8718 * eval.c (process_quit_flag): New function.
8719 * lisp.h (QUIT): Use it.
8720
8721 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8722
8723 * nsfns.m (get_geometry_from_preferences): New function.
8724 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8725
8726 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8727
8728 * emacs.c (Qkill_emacs): Define.
8729 (syms_of_emacs): Initialize it.
8730 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8731 Qquit_flag to `kill-emacs' instead.
8732 (quit_throw_to_read_char): Add parameter `from_signal'.
8733 All callers changed. Call Fkill_emacs if requested and safe.
8734 * lisp.h (QUIT): Call Fkill_emacs if requested.
8735
8736 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8737
8738 * widget.c (update_wm_hints): Return if wmshell is null.
8739 (widget_update_wm_size_hints): New function.
8740
8741 * widget.h (widget_update_wm_size_hints): Declare.
8742
8743 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8744 widget_update_wm_size_hints (Bug#10104).
8745
8746 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8747
8748 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8749 before a newline, prepare the bidi iterator for consuming the
8750 newline, and keep the current paragraph direction. (Bug#10183)
8751 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8752
8753 2011-12-02 Juri Linkov <juri@jurta.org>
8754
8755 * search.c (Fword_search_regexp): New Lisp function created from
8756 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8757 (Fword_search_backward, Fword_search_forward)
8758 (Fword_search_backward_lax, Fword_search_forward_lax):
8759 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8760 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8761
8762 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8763
8764 * fileio.c (Finsert_file_contents): Move after-change-function call
8765 to before the "handled:" label, since all "goto handled" appear in
8766 cases where the *-change-functions have already been properly called
8767 (bug#10117).
8768
8769 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8770
8771 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8772 waiting for input. (Bug#10169)
8773
8774 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8775
8776 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8777 verifies glyph row's hash code--we have just reallocated the
8778 glyphs, so their contents can be complete garbage. (Bug#10164)
8779
8780 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8781
8782 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8783
8784 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8785
8786 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8787 attributes are tested _before_ calling verify_row_hash, to protect
8788 against GCC re-ordering of the tests. (Bug#10164)
8789
8790 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8791
8792 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8793
8794 * xterm.c (handle_one_xevent): Only set async_visible and friends
8795 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8796 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8797 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8798
8799 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8800
8801 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8802 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8803 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8804 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8805 All uses changed to use GCPRO1 etc.
8806 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8807 Revert to old implementation (i.e., before 2011-03-11).
8808
8809 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8810
8811 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8812 of scroll runs so as to avoid assigning disabled bogus rows and
8813 unnecessary graphics copy operations.
8814
8815 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8816
8817 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8818 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8819 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8820 (malloc, free, realloc, calloc): Redirect to e_* only when
8821 compiling Emacs.
8822
8823 * lisp.h (GCTYPEBITS): Move before first use.
8824 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8825 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8826 this macro definition.
8827
8828 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8829 _MSC_VER.
8830
8831 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8832
8833 * gtkutil.c (xg_create_frame_widgets):
8834 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8835 present with Gtk+ 2.0.
8836
8837 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8838
8839 * fileio.c (Finsert_file_contents): Undo previous change; see
8840 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8841
8842 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8843
8844 Rename locals to avoid shadowing.
8845 * fileio.c (Finsert_file_contents):
8846 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8847 * process.c (wait_reading_process_output):
8848 Rename inner 'proc' to 'p' to avoid shadowing.
8849 Indent for consistency with usual Emacs style.
8850
8851 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8852
8853 * xdisp.c (redisplay_window): If cursor row is not fully visible
8854 after recentering, and scroll-conservatively is set to a large
8855 number, scroll window by a few more lines to make the cursor fully
8856 visible and out of scroll-margin. (Bug#10105)
8857 (start_display): Don't move to the next line if the display should
8858 start at a newline that is part of a display vector or an overlay
8859 string. (Bug#10119)
8860
8861 2011-11-24 Juri Linkov <juri@jurta.org>
8862
8863 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8864 after the `MagickPingImage' call. (Bug#10112)
8865
8866 2011-11-23 Chong Yidong <cyd@gnu.org>
8867
8868 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8869
8870 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8871
8872 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8873 making another buffer current. (Bug#10114)
8874
8875 2011-11-23 Glenn Morris <rgm@gnu.org>
8876
8877 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8878
8879 2011-11-23 Chong Yidong <cyd@gnu.org>
8880
8881 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8882 using it (Bug#5984).
8883
8884 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8885
8886 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8887 and header-lines, as they don't have one computed for them.
8888 (Bug#10098)
8889
8890 * .gdbinit (prow): Make displayed values more self-explaining.
8891 Add row's hash code.
8892
8893 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8894
8895 * process.c (wait_reading_process_output): Fix asynchrounous
8896 GnuTLS socket handling on some versions of the GnuTLS library.
8897 (wait_reading_process_output): Add comment and URL.
8898
8899 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8900
8901 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8902
8903 2011-11-21 Chong Yidong <cyd@gnu.org>
8904
8905 * window.c (Fnext_window, Fprevious_window): Doc fix.
8906
8907 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8908
8909 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8910
8911 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8912
8913 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8914
8915 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8916
8917 * window.c (Fset_window_combination_limit): Rename argument
8918 STATUS to LIMIT.
8919 (Vwindow_combination_limit): Remove "status" from doc-string.
8920
8921 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8922
8923 * m/ibms390.h: Remove.
8924 * m/ibms390x.h: Don't include "ibms390.h".
8925
8926 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8927
8928 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8929 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8930
8931 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8932
8933 * casetab.c (Fset_case_table):
8934 * charset.c (Fcharset_after): Fix typos.
8935
8936 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8937
8938 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8939 Otherwise, valgrind does not work on some platforms.
8940 Problem reported by Andreas Schwab in
8941 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8942 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8943 is set, removing the need for VIRT_ADDRESS_VARIES.
8944 (PURE_P): Use a more-efficient implementation that needs just one
8945 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8946 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8947 to 4 (xorl, subq, cmpq, setbe).
8948 * alloc.c (pure): Always extern now, since that's the
8949 VIRT_ADDR_VARIES behavior.
8950 (PURE_POINTER_P): Use a single comparison, not two, for
8951 consistency with the new puresize.h.
8952 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8953 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8954 Remove VIRT_ADDR_VARIES no longer needed.
8955
8956 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8957
8958 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8959 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8960 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8961 behave as if the cursor position were at the window margin.
8962
8963 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8964 and the cursor position is out of bounds, behave as if the cursor
8965 position were at the window margin. (Bug#10075)
8966
8967 2011-11-18 Chong Yidong <cyd@gnu.org>
8968
8969 * window.c (Fwindow_combination_limit): Make first argument
8970 non-optional, since it is meaningless for live windows like the
8971 selected window.
8972
8973 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8974
8975 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8976
8977 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8978
8979 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8980 (graft_intervals_into_buffer): Simplify.
8981
8982 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8983
8984 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8985 hash values of the two rows.
8986 (copy_row_except_pointers): Preserve the used[] arrays and the
8987 hash values of the two rows. (Bug#10035)
8988 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8989
8990 * xdisp.c (row_hash): New function, body extracted from
8991 compute_line_metrics.
8992 (compute_line_metrics): Call row_hash, instead of computing the
8993 hash code inline.
8994
8995 * dispnew.c (verify_row_hash): Call row_hash for computing the
8996 hash code of a row, instead of duplicating code from xdisp.c.
8997
8998 * dispextern.h (row_hash): Add prototype.
8999
9000 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
9001
9002 * frame.c (delete_frame): Don't delete the terminal when the last
9003 X frame is closed if emacs is built with GTK toolkit.
9004
9005 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
9006
9007 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
9008
9009 2011-11-17 Martin Rudalics <rudalics@gmx.at>
9010
9011 * window.c (Vwindow_splits): Rename to
9012 Vwindow_combination_resize. Suggested by Juri Linkov.
9013 (Fsplit_window_internal): Use Vwindow_combination_resize instead
9014 of Vwindow_splits.
9015
9016 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
9017
9018 * nsfns.m (Fns_font_name):
9019 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
9020
9021 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9022
9023 * window.h (window): Rename slot "nest" to "combination_limit".
9024 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9025 (Fset_window_nest): Rename to Fset_window_combination_limit.
9026 (Vwindow_nest): Rename to Vwindow_combination_limit.
9027 (recombine_windows, make_parent_window, make_window)
9028 (Fsplit_window_internal, saved_window)
9029 (Fset_window_configuration, save_window_save): Rename all
9030 occurrences of window_nest to window_combination_limit.
9031
9032 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9033
9034 * image.c (imagemagick_load_image): Fix typo.
9035
9036 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9037
9038 * xdisp.c (display_line): Move the call to
9039 highlight_trailing_whitespace before the call to
9040 compute_line_metrics, since the latter needs to see the final
9041 faces of all the glyphs to compute ROW's hash value.
9042 Fixes assertion violations in row_equal_p. (Bug#10035)
9043
9044 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9045
9046 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9047 just return (bug#10044).
9048
9049 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9050
9051 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9052 with user-defined heap size. Bump the default size of the temacs
9053 heap to 27MB, to avoid memory warning when running temacs.
9054 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9055
9056 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9057 current_matrix and desired_matrix. (Bug#9990)
9058 (verify_row_hash) [XASSERTS]: New function.
9059 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9060 that the hash value of glyph rows is correct.
9061
9062 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9063
9064 * window.h (window): Remove splits slot.
9065 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9066 (Fdelete_other_windows_internal, make_parent_window)
9067 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9068 (Fset_window_configuration, save_window_save): Don't deal with
9069 split status of windows.
9070 (saved_window): Remove splits slot.
9071 (Vwindow_splits): Rewrite doc-string.
9072
9073 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9074
9075 * xfns.c (unwind_create_frame):
9076 * nsfns.m (unwind_create_frame):
9077 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9078 Vframe_list (Bug#9999).
9079
9080 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9081
9082 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9083
9084 2011-11-11 Kenichi Handa <handa@m17n.org>
9085
9086 * callproc.c (Fcall_process): Set the member dst_multibyte of
9087 process_coding.
9088
9089 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9090
9091 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9092 avoid a crash (bug#9496).
9093
9094 2011-11-09 Chong Yidong <cyd@gnu.org>
9095
9096 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9097 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9098
9099 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9100
9101 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9102
9103 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9104
9105 Avoid some portability problems by eschewing 'extern inline' functions.
9106 The trivial performance wins aren't worth the portability hassles; see
9107 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9108 et seq.
9109 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9110 (window_box_width, window_box_left, window_box_left_offset)
9111 (window_box_right, window_box_right_offset): Undo previous change,
9112 by removing the "extern"s.
9113 * intervals.c (adjust_intervals_for_insertion)
9114 (adjust_intervals_for_deletion): Undo previous change,
9115 making these static again.
9116 (offset_intervals, temp_set_point_both, temp_set_point)
9117 (copy_intervals_to_string): No longer inline.
9118 * xdisp.c (window_text_bottom_y, window_box_width)
9119 (window_box_height, window_box_left_offset)
9120 (window_box_right_offset, window_box_left, window_box_right)
9121 (window_box): No longer inline.
9122
9123 2011-11-08 Chong Yidong <cyd@gnu.org>
9124
9125 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9126 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9127 Signal an error if not a live window.
9128 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9129 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9130
9131 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9132
9133 * lisp.h (syms_of_abbrev): Remove declaration.
9134 Reported by CHENG Gao <chenggao@royau.me>.
9135
9136 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9137
9138 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9139 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9140 of temacs in GUI mode.
9141
9142 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9143
9144 * window.h: Declare delete_all_child_windows instead of
9145 delete_all_subwindows.
9146 * window.c (Fwindow_nest, Fset_window_nest)
9147 (Fset_window_new_total, Fset_window_new_normal)
9148 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9149 (delete_all_subwindows): Rename to delete_all_child_windows.
9150 (Fdelete_other_windows_internal, Fset_window_configuration):
9151 Call delete_all_child_windows instead of delete_all_subwindows.
9152 * frame.c (delete_frame): Call delete_all_child_windows instead
9153 of delete_all_subwindows.
9154
9155 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9156
9157 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9158 This is also needed for porting to any host where GC_MARK_STACK is
9159 not GC_MAKE_GCPROS_NOOPS.
9160 (which_symbols): Use it.
9161
9162 2011-11-07 Kenichi Handa <handa@m17n.org>
9163
9164 * coding.c (coding_set_destination): Check coding->src_pos only
9165 when coding->src_object is a buffer (bug#9910).
9166
9167 * process.c (send_process): Set the member src_multibyte of coding
9168 to 0 (bug#9911) when sending a unibyte text.
9169
9170 * callproc.c (Fcall_process): Set the member src_multibyte of
9171 process_coding to 0 (bug#9912).
9172
9173 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9174
9175 * xmenu.c (cleanup_widget_value_tree): New function.
9176 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9177 calling free_menubar_widget_value_tree directly (Bug#9830).
9178
9179 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9180
9181 Fix some portability problems with 'inline'.
9182 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9183 (window_box_width, window_box_left, window_box_left_offset)
9184 (window_box_right, window_box_right_offset): Declare extern.
9185 Otherwise, these inline functions do not conform to C99 and
9186 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9187 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9188 * intervals.c (adjust_intervals_for_insertion)
9189 (adjust_intervals_for_deletion): Now extern, because otherwise the
9190 extern inline functions 'offset_intervals' couldn't refer to it.
9191 (static_offset_intervals): Remove.
9192 (offset_intervals): Rewrite using the old contents of
9193 static_offset_intervals. The old version didn't conform to C99
9194 because an extern inline function contained a reference to an
9195 identifier with static linkage.
9196
9197 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9198
9199 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9200 GC.
9201
9202 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9203
9204 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9205 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9206 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9207 return Qleft_to_right.
9208
9209 2011-11-06 Chong Yidong <cyd@gnu.org>
9210
9211 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9212 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9213 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9214 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9215 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9216 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9217 (Fwindow_vscroll): Doc fix.
9218 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9219 argument, since it makes no sense to pass a live window and for
9220 consistency with window-child.
9221
9222 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9223
9224 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9225 support MSVC.
9226
9227 2011-11-05 Jason Rumney <jasonr@gnu.org>
9228
9229 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9230 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9231 fonts (Bug#6029).
9232 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9233 bitwise arithmetic preventing use of unicode-sip and non-truetype
9234 opentype fonts.
9235
9236 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9237
9238 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9239 "emacs"-only part.
9240
9241 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9242 initialization code to keep similarity to xfns.c after changes
9243 from 2011-11-05.
9244
9245 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9246
9247 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9248 (unwind_create_frame): New function (Bug#9943).
9249 (Fx_create_frame): Restructure code to be more similar to the one in
9250 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9251 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9252 Move terminal->reference_count++ just before making the frame official
9253 (Bug#9943).
9254
9255 * nsterm.m (x_free_frame_resources): New function.
9256 (x_destroy_window): Move code to x_free_frame_resources.
9257
9258 * xfns.c (unwind_create_frame): Fix comment.
9259 (Fx_create_frame, x_create_tip_frame):
9260 Move terminal->reference_count++ just before making the frame
9261 official. Move initialization of image_cache_refcount and
9262 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9263
9264 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9265
9266 Support MSVC build with newer versions of Visual Studio.
9267 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9268 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9269 nt/gmake.defs.
9270
9271 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9272 which are not supported by MSVC.
9273 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9274 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9275 bitfields.
9276 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9277 types in bitfields.
9278 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9279
9280 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9281
9282 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9283
9284 Support MSVC build with newer versions of Visual Studio.
9285 * w32.c: Don't include w32api.h for MSVC.
9286 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9287
9288 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9289 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9290 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9291 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9292 e_* cousins.
9293 (alloca) [_MSC_VER]: Define to _alloca.
9294
9295 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9296
9297 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9298
9299 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9300
9301 * xdisp.c (note_mouse_highlight): If either of
9302 previous/next-single-property-change returns nil, treat that as
9303 the beginning or the end of the buffer. (Bug#9955)
9304
9305 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9306
9307 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9308 label is not null (Bug#9951).
9309 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9310 may be NULL.
9311
9312 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9313
9314 * window.c (Fwindow_body_size): Mention in the doc string that the
9315 return value is in frame's canonical units. (Bug#9949)
9316
9317 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9318
9319 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9320
9321 * w32fns.c (unwind_create_frame): If needed, free the glyph
9322 matrices of the partially constructed frame. (Bug#9943)
9323 * xfns.c (unwind_create_frame): Likewise.
9324
9325 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9326
9327 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9328 Don't stop backward scan on the continuation glyph, even though
9329 its CHARPOS is positive.
9330 (mouse_face_from_buffer_pos, note_mouse_highlight):
9331 Rename cover_string to disp_string.
9332
9333 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9334
9335 * window.c (temp_output_buffer_show): Don't use
9336 Vtemp_buffer_show_specifiers.
9337 (Vtemp_buffer_show_specifiers): Remove unused variable.
9338
9339 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9340
9341 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9342 past the beginning of the current glyph matrix.
9343
9344 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9345
9346 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9347 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9348 HAVE_GTK3 (Bug#9869).
9349
9350 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9351 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9352
9353 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9354
9355 * xterm.c: Declare x_handle_net_wm_state to return int.
9356 (handle_one_xevent): Check if we are iconified but don't have
9357 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9358 (get_current_wm_state): Return non-zero if not hidden,
9359 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9360 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9361 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9362 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9363
9364 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9365
9366 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9367 so that this new function doesn't get optimized away by a
9368 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9369
9370 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9371
9372 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9373
9374 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9375
9376 Fix the `xbytecode' command.
9377 * .gdbinit (xprintbytestr): New command.
9378 (xwhichsymbols): Rename from `which'; all callers changed.
9379 (xbytecode): Print the byte-code string as well.
9380
9381 2011-10-29 Kim Storm <storm@cua.dk>
9382
9383 * alloc.c (which_symbols): New function.
9384
9385 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9386
9387 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9388 line. (Bug#9903)
9389
9390 2011-10-29 Glenn Morris <rgm@gnu.org>
9391
9392 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9393 Not clear what it was for, and it causes various bugs. (Bug#9839)
9394
9395 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9396
9397 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9398 possible random value that matches one of those tested as
9399 condition to clear the mouse face.
9400
9401 2011-10-28 Chong Yidong <cyd@gnu.org>
9402
9403 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9404
9405 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9406
9407 * window.c (make_window): Initialize phys_cursor_on_p.
9408
9409 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9410
9411 * lisp.h (struct Lisp_Symbol): Update comments.
9412
9413 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9414
9415 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9416
9417 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9418
9419 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9420 <oslsachem@gmail.com> for helping to debug this.
9421
9422 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9423 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9424 (g_b_init_get_glyph_outline_w): New static variables.
9425 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9426 (GetGlyphOutlineW_Proc): New typedefs.
9427 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9428 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9429 New functions.
9430 (w32font_open_internal, compute_metrics):
9431 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9432 instead of calling the "wide" APIs directly.
9433
9434 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9435
9436 * w32.h (syms_of_w32font): Add prototype.
9437
9438 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9439
9440 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9441 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9442 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9443 (Fmove_to_window_line): Doc fix.
9444
9445 2011-10-27 Chong Yidong <cyd@gnu.org>
9446
9447 * process.c (make_process): Set gnutls_state to NULL.
9448
9449 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9450 non-NULL, regardless of GNUTLS_INITSTAGE.
9451 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9452 an error. Set process slots as soon as we allocate them.
9453
9454 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9455
9456 2011-10-27 Chong Yidong <cyd@gnu.org>
9457
9458 * gnutls.c (emacs_gnutls_deinit): New function.
9459 Deallocate credentials structures as well as calling gnutls_deinit.
9460 (Fgnutls_deinit, Fgnutls_boot): Use it.
9461
9462 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9463 (deactivate_process): Call emacs_gnutls_deinit.
9464
9465 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9466
9467 * image.c (x_create_x_image_and_pixmap):
9468 * w32.c (sys_rename, w32_delayed_load):
9469 * w32font.c (fill_in_logfont):
9470 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9471
9472 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9473
9474 * w32fns.c (w32_default_color_map): New function,
9475 extracted from Fw32_default_color_map.
9476 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9477
9478 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9479
9480 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9481
9482 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9483
9484 * keyboard.c (test_undefined): New function (bug#9751).
9485 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9486
9487 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9488
9489 * sysdep.c (init_sys_modes): Fix the check for the controlling
9490 terminal (Bug#6649).
9491
9492 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9493
9494 * dispextern.h (struct bidi_it): New member next_en_type.
9495
9496 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9497 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9498 current character, check also for next_en_type being WEAK_EN.
9499 (bidi_resolve_weak): Don't enter the expensive loop if the current
9500 position is before next_en_pos. Record the bidi type of the first
9501 non-ET, non-BN character we find, in addition to its position.
9502 (bidi_level_of_next_char): Invalidate next_en_type when
9503 next_en_pos is over-stepped.
9504
9505 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9506
9507 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9508 * editfns.c: Rewrite current-time-zone so that it invokes
9509 the equivalent of (format-time-string "%Z") to get the time zone name.
9510 This fixes a bug when the time zone name contains characters that
9511 need converting from the system time locale to Emacs internal format.
9512 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9513 that patch fixed format-time-string to do the conversion, but
9514 I forgot to fix current-time-zone.
9515 (format_time_string): New function, containing most of
9516 what Fformat_time_string used to contain.
9517 (Fformat_time_string): Rewrite in terms of format_time_string.
9518 This doesn't change this function's behavior.
9519 (current-time-zone): Rewrite to use format_time_string.
9520 This fixes the bug reported by Michael Schierl in
9521 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9522 Jason Rumney's 2007-06-07 change worked around this bug, but
9523 didn't fix it.
9524 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9525
9526 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9527
9528 * xdisp.c (start_display): If the character at POS is displayed
9529 via a display vector, reset IT->current.dpvec_index to zero.
9530 (try_window_reusing_current_matrix): If a line ends in a display
9531 vector or the next line starts in a display vector, continue
9532 redrawing the window even though the character position of
9533 start_row was reached.
9534 (Bug#9771, part 2)
9535
9536 2011-10-18 Chong Yidong <cyd@gnu.org>
9537
9538 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9539 with nobreak-char-display too.
9540
9541 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9542
9543 Fix part 3 of bug#9771.
9544 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9545 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9546 non-neutral characters if the current character is a paragraph
9547 separator (a.k.a. Newline). This avoids running the same
9548 expensive loop twice, once when we consume the preceding newline
9549 and the other time when the line actually needs to be displayed.
9550 Avoid the loop when we see neutrals on the base embedding level
9551 following a character whose directionality is the same as the
9552 paragraph's. This avoids running the expensive loop when a line
9553 ends in a long sequence of neutrals, like control characters.
9554 Add assertion against STRONG_AL type. Slightly rearrange code
9555 that determines the type of a neutral given the first non-neutral
9556 that follows it.
9557 (bidi_level_of_next_char): Set next_en_pos to zero when
9558 invalidating its info.
9559
9560 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9561
9562 * xdisp.c (push_display_prop): Determine whether to record string
9563 or buffer position by IT->string, not by IT->method. Allow
9564 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9565 (move_it_vertically_backward): Don't look for character position
9566 immediately after the newline when in a continuation line.
9567 (Bug#9771, part 1)
9568
9569 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9570
9571 * window.c (coordinates_in_window): Rewrite and delabelize
9572 vertical border check. (Bug#5357) (Bug#9618)
9573
9574 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9575
9576 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9577 errors in XSetWindowBorder (bug#9310).
9578
9579 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9580
9581 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9582 avoid crash when xmalloc overrun checking is enabled.
9583
9584 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9585
9586 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9587 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9588 cursor motion with <left> and <right> arrow keys.
9589
9590 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9591 some callers set that themselves.
9592
9593 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9594
9595 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9596 display string and the previous row comes from the same string and
9597 is empty. (Bug#9739) (Bug#9738)
9598
9599 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9600
9601 * doc.c (get_doc_string): Encode file name (bug#9735).
9602
9603 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9604
9605 * bidi.c (bidi_level_of_next_char):
9606 * xdisp.c (get_visually_first_element): Remove old incorrect
9607 comments regarding the Unicode Line Separator character.
9608
9609 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9610
9611 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9612
9613 * alloc.c (Fgc_status): Do not access beyond zombies array
9614 boundary if nzombies > MAX_ZOMBIES.
9615 * alloc.c (dump_zombies): Add missing format specifier.
9616
9617 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9618
9619 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9620 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9621
9622 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9623 Some packages use them to denote characters with modifiers.
9624
9625 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9626
9627 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9628 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9629 matching a pp-number. Rename parameter var to var1.
9630
9631 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9632
9633 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9634
9635 2011-10-08 Glenn Morris <rgm@gnu.org>
9636
9637 * callint.c (Fcall_interactively): Give a more explicit error for the
9638 'c' case with a non-character input. (Bug#8479)
9639
9640 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9641
9642 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9643 lines.
9644 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9645 lines that are hscrolled on the left.
9646
9647 * dispnew.c (buffer_posn_from_coords): Account for a possible
9648 presence of header-line. (Bug#4426)
9649
9650 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9651
9652 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9653 Don't advertise functionality which we discourage or doesn't work.
9654
9655 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9656
9657 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9658 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9659 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9660 this makes Emacs dump core during garbage collection on rare
9661 occasions. sizeof is obviously inferior to offsetof here, so
9662 stick with offsetof.
9663 (GC_POINTER_ALIGNMENT): New macro.
9664 (mark_memory): Omit 3rd (offset) arg; caller changed.
9665 Don't assume EMACS_INT alignment is the same as pointer alignment.
9666
9667 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9668
9669 * keyboard.c (read_key_sequence_remapped): New var.
9670 (read_key_sequence): Compute remapping in the right buffer.
9671 (command_loop_1): Use read_key_sequence's remapping directly.
9672
9673 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9674
9675 * dired.c (file_name_completion): Don't expand file name.
9676 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9677 before checking file name handler.
9678
9679 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9680 they've been requested explicitly (bug#9591).
9681
9682 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9683
9684 * keymap.c (Fsingle_key_description): Use make_specified_string
9685 instead of build_string to build string from push_key_description.
9686 (Bug#5193)
9687
9688 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9689
9690 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9691 This fixes a Y2038 bug on 64-bit hosts.
9692 * buffer.c (reset_buffer):
9693 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9694 (Fclear_buffer_auto_save_failure):
9695 Use 0, not -1, to represent an unset failure time, since time_t
9696 might not be signed.
9697
9698 Remove dependency on glibc malloc internals.
9699 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9700 Move back here from lisp.h, but with their new implementations.
9701 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9702 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9703 * charset.c (charset_table_init): New static var.
9704 (syms_of_charset): Use it instead of xmalloc. This removes a
9705 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9706 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9707 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9708 Move back to alloc.c.
9709 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9710 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9711
9712 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9713
9714 * nsterm.m (windowDidResize): Call x_set_window_size only when
9715 ns_in_resize is true. Otherwise set pixelwidth/height and
9716 call change_frame_size (Bug#9628).
9717
9718 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9719
9720 Port --enable-checking=all to Fedora 14 x86-64.
9721 * charset.c (syms_of_charset): Also account for glibc malloc's
9722 internal overhead when calculating the initial malloc maximum.
9723
9724 Port --enable-checking=all to Fedora 14 x86.
9725 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9726 Move to lisp.h.
9727 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9728 (overrun_check_realloc, overrun_check_free):
9729 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9730 That way, xmalloc returns a properly-aligned pointer even if
9731 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9732 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9733 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9734 into account when calculating the initial malloc maximum.
9735 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9736 Move here from alloc.c, so that charset.c can use it too.
9737 Properly align; the old code wasn't right for common 32-bit hosts
9738 when configured with --enable-checking=all.
9739 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9740 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9741
9742 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9743
9744 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9745 use EDOM.
9746
9747 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9748
9749 * xdisp.c (compute_display_string_end): If there's no display
9750 string at CHARPOS, return -1.
9751
9752 * bidi.c (bidi_fetch_char): When compute_display_string_end
9753 returns a negative value, treat the character as a normal
9754 character not covered by a display string. (Bug#9624)
9755
9756 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9757
9758 * lread.c (Fread_from_string): Fix typo in docstring.
9759
9760 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9761
9762 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9763 newline, reseat the iterator instead of bidi-iterating there one
9764 character at a time. (Bug#9610)
9765 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9766 TO_CHARPOS if the bidi iterator is at base embedding level.
9767
9768 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9769
9770 * lread.c (readevalloop): Use correct code for NBSP.
9771 (read1): Likewise. (Bug#9608)
9772
9773 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9774
9775 * dbusbind.c (Fdbus_register_signal): When service is not
9776 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9777
9778 2011-09-25 Glenn Morris <rgm@gnu.org>
9779
9780 * buffer.c (truncate-lines): Doc fix.
9781
9782 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9783
9784 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9785 (Fset_window_next_buffers): Doc fix.
9786
9787 2011-09-24 Glenn Morris <rgm@gnu.org>
9788
9789 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9790
9791 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9792
9793 Fix minor problems found by static checking.
9794 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9795 * indent.c (Fvertical_motion): Fix == vs = typo.
9796
9797 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9798
9799 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9800 Default value is now t. Doc fix.
9801
9802 * indent.c (Fvertical_motion): Compute and apply the overshoot
9803 logic when moving up, not only when moving down. Fix the
9804 confusing name and values of the it_overshoot_expected variable;
9805 logic changes accordingly. (Bug#9254) (Bug#9549)
9806
9807 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9808 CHARPOS is covered by a display string which includes newlines.
9809 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9810 is covered by a display string with embedded newlines.
9811
9812 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9813
9814 * dbusbind.c (Fdbus_register_signal): Add match rule to
9815 Vdbus_registered_objects_table. (Bug#9581)
9816 (Fdbus_register_method, Vdbus_registered_objects_table):
9817 Fix docstring.
9818
9819 2011-09-24 Jim Meyering <meyering@redhat.com>
9820
9821 do not ignore write error for any output size
9822 The previous change was incomplete.
9823 While it makes emacs --batch detect the vast majority of stdout
9824 write failures, errors were still ignored whenever the output size is
9825 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9826 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9827 && echo FAIL: ignored write error
9828 FAIL: ignored write error
9829 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9830 && echo FAIL: ignored write error
9831 FAIL: ignored write error
9832 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9833
9834 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9835
9836 * emacs.c (Fkill_emacs): In noninteractive mode exit
9837 non-successfully if a write error occurred on stdout. (Bug#9574)
9838
9839 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9840
9841 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9842 the xassert test.
9843
9844 * dispextern.h (struct it): Update the comment documenting what
9845 can it->OBJECT be.
9846
9847 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9848
9849 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9850 a display string, extend search for cursor position to end of row.
9851 (find_row_edges): If the row ends in a newline from a display
9852 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9853 Handle the case of a display string with multiple newlines.
9854 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9855 non-empty line. Fixes confusing cursor motion with arrow keys at
9856 the beginning of a line that starts with whitespace.
9857
9858 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9859
9860 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9861 (bug#9493).
9862
9863 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9864
9865 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9866 boolean (Bug#9154).
9867
9868 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9869
9870 * xdisp.c (display_line): Record maximum and minimum buffer
9871 positions even if no glyphs were produced (e.g., by a zero-width
9872 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9873 buffer positions that will be removed from the glyph row because
9874 they don't fit.
9875 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9876 column is beyond frame width: don't subtract 1 "pixel" when
9877 computing width of the stretch.
9878 (reseat_at_next_visible_line_start): Undo the change made on
9879 2011-09-17 that saved paragraph information and restored it after
9880 the call to `reseat'. (Bug#9545)
9881
9882 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9883
9884 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9885 and turn window cursor on if cleared (Bug#9415).
9886
9887 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9888
9889 * search.c (boyer_moore): Take unibyte characters from pattern
9890 literally. (Bug#9458)
9891
9892 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9893
9894 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9895
9896 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9897
9898 Fix minor problem found by static checking.
9899 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9900 initialized, to pacify gcc -Wuninitialized.
9901
9902 * fileio.c: Report proper errno when syscall falls.
9903 (Finsert_file_contents): Save and restore errno,
9904 so that report_file_error outputs the correct diagnostic.
9905 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9906
9907 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9908
9909 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9910
9911 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9912
9913 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9914 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9915
9916 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9917
9918 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9919 about the current paragraph and restore it after the call to reseat.
9920
9921 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9922 (bidi_find_paragraph_start): Search back for paragraph beginning
9923 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9924 (bidi_move_to_visually_next): Only trigger paragraph-related
9925 computations when the last character is a newline or at EOB, not
9926 just any NEUTRAL_B. (Bug#9470)
9927
9928 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9929 truncated lines if point is covered by a display string. (Bug#9524)
9930
9931 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9932
9933 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9934 (cons_to_x_long): New function.
9935 (lisp_data_to_selection_data): Use it. Correct the test for
9936 short-versus-long data; it was negated. Break out of vector
9937 loop, for efficiency, when a long datum is discovered.
9938
9939 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9940
9941 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9942
9943 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9944
9945 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9946 GCC PR/17406) by declaring this function with external scope.
9947
9948 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9949
9950 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9951 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9952
9953 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9954
9955 * editfns.c (Fformat): Correctly handle text properties on "%%".
9956
9957 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9958
9959 * xterm.c (x_draw_composite_glyph_string_foreground):
9960 * w32term.c (x_draw_composite_glyph_string_foreground):
9961 * term.c (encode_terminal_code):
9962 * composite.c (composition_update_it, get_composition_id):
9963 * xdisp.c (get_next_display_element)
9964 (fill_composite_glyph_string): Add comments about special meaning
9965 of TAB characters in a composition.
9966
9967 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9968
9969 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9970 This occurs when processing a multibyte format.
9971 Problem reported by Wolfgang Jenker.
9972
9973 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9974
9975 * xdisp.c (try_cursor_movement): Only check for exact match if
9976 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9977
9978 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9979
9980 Remove unused external symbols.
9981 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9982 * xdisp.c (calc_pixel_width_or_height): Now static.
9983 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9984 * indent.c (check_display_width):
9985 * w32term.c: Fix comment to match code.
9986 * xterm.c, xterm.h (x_catching_errors): Remove.
9987
9988 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9989
9990 * xselect.c: Use signed conversions more consistently (Bug#9498).
9991 (selection_data_to_lisp_data): Assume incoming selection data are
9992 signed integers, not unsigned. This is to be consistent with
9993 outgoing selection data, which was modified to use signed integers
9994 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9995 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9996 expects long, not unsigned long.
9997
9998 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9999
10000 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
10001 computation of loop end. Reported by Johan Bockgård
10002 <bojohan@gnu.org>.
10003
10004 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
10005
10006 * frame.c (Fother_visible_frames_p): Function deleted.
10007
10008 2011-09-12 Eli Zaretskii <eliz@gnu.org>
10009
10010 * indent.c (compute_motion): Process display vector front to back
10011 rather than the other way around. (Bug#2496)
10012
10013 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
10014
10015 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
10016
10017 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
10018
10019 * minibuf.c (Fread_from_minibuffer): Doc fix.
10020
10021 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10022
10023 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10024 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10025
10026 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10027
10028 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10029 value for non-existent files.
10030
10031 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10032
10033 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10034 set its "size" to -1. This will set the modtime_size field of
10035 the corresponding buffer to -1, which is what
10036 verify-visited-file-modtime expects for files that do not exist.
10037 (Bug#9139)
10038
10039 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10040
10041 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10042 here ...
10043 * lisp.h: ... from here. push_key_description is no longer
10044 defined in keyboard.c, so its declaration should not be in
10045 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10046 logically belongs with push_key_description.
10047
10048 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10049
10050 * buffer.h: Include <sys/types.h> instead of <time.h>.
10051 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10052 Problem reported by Herbert J. Skuhra.
10053
10054 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10055
10056 * xml.c (parse_region): Make the parsing work for
10057 non-comment-starting XML files again (bug#9144).
10058
10059 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10060
10061 * image.c (gif_load): Fix calculation of bottom and right corner.
10062 (Bug#9468)
10063
10064 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10065
10066 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10067 redisplay in small windows.
10068
10069 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10070
10071 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10072
10073 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10074
10075 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10076 Operate on live windows only.
10077
10078 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10079
10080 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10081
10082 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10083
10084 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10085 only under bidi iteration.
10086
10087 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10088
10089 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10090
10091 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10092
10093 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10094 Without this fix, the command to link temacs failed due to an
10095 undefined symbol __builtin_isnan. This is because
10096 /usr/include/iso/math_c99.h #defines isnan(x) to
10097 __builtin_isnan(x), but the bundled gcc, which identifies itself
10098 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10099 a __builtin_isnan.
10100 * floatfns.c (isnan): #undef, and then #define to a clone of
10101 what's in data.c.
10102 (Fisnan): Always define, since it's always available now.
10103 (syms_of_floatfns): Always define isnan at the Lisp level.
10104
10105 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10106
10107 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10108
10109 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10110
10111 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10112 The previous code assumed that file offsets (off_t values) fit in
10113 EMACS_INT variables, which is not true on typical 32-bit hosts.
10114 The code messed up by falsely reporting buffer overflow in cases
10115 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10116 when "big" contains more than 2**29 bytes, even though this
10117 inserts just one byte and does not overflow the buffer.
10118 (Finsert_file_contents): Store file offsets as off_t
10119 values, not as EMACS_INT values. Check for overflow when
10120 converting between EMACS_INT and off_t. When checking for
10121 buffer overflow or for overlap, take the offsets into account.
10122 Don't use EMACS_INT for small values where int suffices.
10123 When checking for overlap, fix a typo: ZV was used where
10124 ZV_BYTE was intended.
10125 (Fwrite_region): Don't assume off_t fits into 'long'.
10126 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10127
10128 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10129
10130 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10131
10132 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10133
10134 sprintf-related integer and memory overflow issues (Bug#9412).
10135
10136 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10137 (esprintf, exprintf, evxprintf): New functions.
10138 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10139 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10140 (modify_event_symbol): Do not assume that the length of
10141 name_alist_or_stem is safe to alloca and fits in int.
10142 (Fexecute_extended_command): Likewise for function name and binding.
10143 (Frecursion_depth): Wrap around reliably on integer overflow.
10144 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10145 since some callers pass EMACS_INT values.
10146 (Fsingle_key_description): Don't crash if symbol name contains more
10147 than MAX_ALLOCA bytes.
10148 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10149 (get_minibuffer): Arg is now EMACS_INT, not int.
10150 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10151 (esprintf, exprintf, evxprintf): New decls.
10152 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10153
10154 * dbusbind.c (signature_cat): New function.
10155 (xd_signature, Fdbus_register_signal):
10156 Do not overrun buffer; instead, report string overflow.
10157
10158 * dispnew.c (add_window_display_history): Don't overrun buffer.
10159 Truncate instead; this is OK since it's just a log.
10160
10161 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10162 even if the time zone offset is outlandishly large.
10163 Don't mishandle offset == INT_MIN.
10164
10165 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10166 when creating daemon; the previous buffer-overflow check was incorrect.
10167
10168 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10169 which has the guts of the old verror function.
10170
10171 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10172 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10173
10174 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10175 (font_unparse_xlfd): Don't blindly alloca long strings.
10176 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10177 fits in int, when using sprintf. Use single snprintf to count
10178 length of string rather than counting it via multiple sprintfs;
10179 that's simpler and more reliable.
10180 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10181 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10182 sprintf, in case result does not fit in int.
10183
10184 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10185 (fontset_from_font): Print it.
10186
10187 * frame.c (tty_frame_count): Now printmax_t, not int.
10188 (make_terminal_frame, set_term_frame_name): Print it.
10189 (x_report_frame_params): In X, window IDs are unsigned long,
10190 not signed long, so print them as unsigned.
10191 (validate_x_resource_name): Check for implausibly long names,
10192 and don't assume name length fits in 'int'.
10193 (x_get_resource_string): Don't blindly alloca invocation name;
10194 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10195 not fit in int.
10196
10197 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10198 (xg_check_special_colors, xg_set_geometry):
10199 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10200
10201 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10202 Use esprintf, not sprintf, in case result does not fit in int.
10203
10204 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10205 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10206 it as a large positive number.
10207 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10208 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10209
10210 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10211 in case result does not fit in int.
10212
10213 * print.c (float_to_string): Detect width overflow more reliably.
10214 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10215 buffer overrun. Don't assume list length fits in 'int'. Treat
10216 print length of 0 as 0, not as infinity; to be consistent with other
10217 uses of print length in this function. Don't overflow print length
10218 index. Don't assume hash table size fits in 'long', or that
10219 vectorlike size fits in 'unsigned long'.
10220
10221 * process.c (make_process): Use printmax_t, not int, to format
10222 process-name gensyms.
10223
10224 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10225
10226 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10227 to avoid potential buffer overrun.
10228
10229 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10230 if X resource line is longer than 512 bytes.
10231
10232 * xfns.c (x_window): Make sprintf buffer a bit bigger
10233 to avoid potential buffer overrun.
10234
10235 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10236
10237 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10238
10239 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10240
10241 Integer overflow fixes for scrolling, etc.
10242 Without these, Emacs silently mishandles large integers sometimes.
10243 For example, "C-u 4294967297 M-x recenter" was treated as if
10244 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10245
10246 * xdisp.c (try_window_id): Check Emacs fixnum range before
10247 converting to 'int'.
10248
10249 * window.c (window_scroll_line_based, Frecenter):
10250 Check that an Emacs fixnum is in range before assigning it to 'int'.
10251 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10252 values converted from Emacs fixnums.
10253 (Frecenter): Don't wrap around a line count if it is out of 'int'
10254 range; instead, treat it as an extreme value.
10255 (Fset_window_configuration, compare_window_configurations):
10256 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10257
10258 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10259 that can exceed INT_MAX. Check that EMACS_INT value is in range
10260 before assigning it to the (possibly-narrower) index.
10261 (match_limit): Don't assume that a fixnum can fit in 'int'.
10262
10263 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10264 exceed INT_MAX.
10265
10266 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10267 (Fvertical_motion): Don't wrap around LINES values that don't fit
10268 in 'int'. Instead, treat them as extreme values. This is good
10269 enough for windows, which can't have more than INT_MAX lines anyway.
10270
10271 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10272
10273 * Require libxml/parser.h to avoid compilation warning.
10274
10275 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10276
10277 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10278 since this reportedly can destroy thread storage.
10279
10280 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10281
10282 * syntax.c (find_defun_start): Update all cache variables if
10283 exiting early (Bug#9401).
10284
10285 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10286
10287 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10288
10289 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10290 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10291 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10292
10293 * term.c (tty_append_glyph): New function.
10294 (produce_stretch_glyph): Static function and its prototype deleted.
10295
10296 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10297 Add prototypes.
10298
10299 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10300
10301 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10302 when checking :margin (Bug#9390).
10303 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10304 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10305 so that the name doesn't mislead. All uses changed.
10306
10307 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10308
10309 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10310 set_tty_hooks.
10311
10312 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10313
10314 * xdisp.c (move_it_to): Don't bail out early when reaching
10315 position beyond to_charpos, if we are scanning backwards.
10316 (move_it_vertically_backward): When DY == 0, make sure we get to
10317 the first character in the line after the newline.
10318
10319 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10320
10321 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10322 (ccl_driver): Do not generate an out-of-range pointer.
10323 (Fccl_execute_on_string): Remove unnecessary check for
10324 integer overflow, noted by Stefan Monnier in
10325 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10326 Remove a FIXME that didn't need fixing.
10327 Simplify the newly-introduced buffer reallocation code.
10328
10329 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10330
10331 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10332
10333 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10334
10335 Integer and memory overflow issues (Bug#9196).
10336
10337 * doc.c (get_doc_string): Rework so that
10338 get_doc_string_buffer_size is the actual buffer size, rather than
10339 being 1 less than the actual buffer size; this makes xpalloc more
10340 convenient.
10341
10342 * image.c (x_allocate_bitmap_record, cache_image):
10343 * xselect.c (Fx_register_dnd_atom):
10344 Simplify previous changes by using xpalloc.
10345
10346 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10347 since either will do and ptrdiff_t is convenient with xpalloc.
10348
10349 * charset.c (charset_table_size)
10350 (struct charset_sort_data.priority): Now ptrdiff_t.
10351 (charset_compare): Don't overflow if priorities differ greatly.
10352 (Fsort_charsets): Don't assume list length fits in int.
10353 Check for size-calculation overflow when allocating sort data.
10354 (syms_of_charset): Allocate an initial charset table that is
10355 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10356
10357 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10358
10359 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10360 The actual value is always <= INT_MAX, and leaving it unsigned made
10361 overflow checking harder.
10362
10363 * dispextern.h (struct glyph_matrix.rows_allocated)
10364 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10365 with xpalloc. The values are still always <= INT_MAX.
10366
10367 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10368
10369 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10370 (SAFE_NALLOCA): New macro.
10371
10372 * region-cache.c (struct boundary.pos, find_cache_boundary)
10373 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10374 (set_cache_region, invalidate_region_cache)
10375 (revalidate_region_cache, know_region_cache, region_cache_forward)
10376 (region_cache_backward, pp_cache):
10377 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10378 so that ptrdiff_t * can be passed to xpalloc.
10379 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10380 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10381 (pp_cache): Don't assume cache_len fits in int.
10382 * region-cache.h: Adjust extern decls to match.
10383
10384 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10385 EMACS_INT, since either will do, for xpalloc.
10386
10387 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10388 (xnmalloc, xnrealloc, xpalloc): New functions.
10389
10390 * bidi.c (bidi_shelve_header_size): New constant.
10391 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10392 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10393
10394 * bidi.c (bidi_cache_shrink):
10395 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10396 (overlay_strings):
10397 Don't update size of array until after memory allocation succeeds,
10398 because xmalloc/xrealloc may not return.
10399 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10400 now that we have proper integer overflow checking.
10401 (record_overlay_string, overlay_strings): Catch overflows when
10402 calculating size of overlay_str_buf.
10403
10404 * callproc.c (Fcall_process): Check for size overflow when
10405 calculating size of args2.
10406 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10407 Normally we prefer signed values, but sticking with ptrdiff_t would
10408 require adding more-complicated checks.
10409
10410 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10411 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10412 Redo buffer-overflow calculations to avoid integer overflow.
10413 Add a FIXME comment where memory seems to be over-allocated.
10414
10415 * character.c (Fstring): Check for size-calculation overflow.
10416
10417 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10418 unnecessary integer overflow. Check for size overflow.
10419 (encode_coding_object): Don't update size until xmalloc succeeds.
10420
10421 * composite.c (get_composition_id): Check for overflow in glyph
10422 length calculations.
10423
10424 Integer and memory overflow fixes for display code.
10425 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10426 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10427 (scrolling_window): Check for overflow in size calculations.
10428 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10429 Don't assume glyph table len fits in int.
10430 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10431 (row_table_size): Now ptrdiff_t, not int.
10432 (scrolling_window): Avoid overflow in size calculations.
10433 Don't update size until allocation succeeds.
10434 * fns.c (concat): Check for overflow in size calculations.
10435 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10436 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10437 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10438
10439 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10440 (get_doc_string): Check for size calculation overflow.
10441 Don't update size until allocation succeeds.
10442 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10443 EMACS_INT, where ptrdiff_t will do.
10444 (Fsubstitute_command_keys): Check for string overflow.
10445
10446 * editfns.c (set_time_zone_rule): Don't assume environment length
10447 fits in int.
10448 (message_length): Now ptrdiff_t, not int.
10449 (Fmessage_box): Don't update size until allocation succeeds.
10450 Don't assume message length fits in int.
10451 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10452
10453 * emacs.c (main): Do not reallocate argv, since there is a null at
10454 the end that can be overwritten, and this way there's no need to
10455 worry about size-calculation overflow.
10456 (sort_args): Check for size-calculation overflow.
10457
10458 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10459 alloc succeeds.
10460 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10461
10462 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10463 (x_set_scroll_bar_width, x_figure_window_size):
10464 Check for integer overflow.
10465 (x_set_alpha): Do not assume XINT fits in int.
10466
10467 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10468 This is for the members text_lines, text_cols, total_lines, total_cols,
10469 where the system imposes an 'int' limit.
10470
10471 * fringe.c (Fdefine_fringe_bitmap):
10472 Don't update size until alloc works.
10473
10474 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10475 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10476
10477 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10478 Check for size-calculation overflow.
10479 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10480 do, as we prefer signed integers.
10481 (id_to_widget.max_size, id_to_widget.used)
10482 (xg_store_widget_in_map, xg_remove_widget_from_map)
10483 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10484 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10485 Use and return ptrdiff_t, not int.
10486 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10487 * gtkutil.h: Change prototypes to match the above.
10488
10489 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10490 are duplicate now that they've been promoted to lisp.h.
10491 (x_allocate_bitmap_record, x_alloc_image_color)
10492 (make_image_cache, cache_image, xpm_load):
10493 Don't update size until alloc is done.
10494 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10495 (x_detect_edges):
10496 Check for size calculation overflow.
10497 (ct_colors_allocated_max): New constant.
10498 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10499 overflow.
10500
10501 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10502 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10503 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10504 Use ptrdiff_t, not int, to count maps.
10505 (read_char_minibuf_menu_prompt): Check for overflow in size
10506 calculations. Don't update size until allocation succeeds.
10507 Redo calculations to avoid overflow.
10508 * keyboard.h: Change prototypes to match the above.
10509
10510 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10511 to count maps.
10512 (current_minor_maps): Check for size calculation overflow.
10513 * keymap.h: Change prototypes to match the above.
10514
10515 * lread.c (read1, init_obarray): Don't update size until alloc done.
10516
10517 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10518 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10519
10520 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10521 Now ptrdiff_t, not int.
10522 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10523 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10524
10525 * process.c (Fnetwork_interface_list): Check for overflow
10526 in size calculation.
10527
10528 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10529
10530 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10531 overflow. Don't bother calling xmalloc when xrealloc will do.
10532
10533 * search.c (Freplace_match): Check for size calculation overflow.
10534 (Fset_match_data): Don't assume list lengths fit in 'int'.
10535
10536 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10537 for command line length. Do not attempt to address one before the
10538 beginning of an array, as that's not portable.
10539
10540 * term.c (max_frame_lines): Remove; unused.
10541 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10542 not int.
10543 (encode_terminal_code, calculate_costs): Check for size
10544 calculation overflow.
10545 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10546 table lengths and related sizes. Don't update size until alloc
10547 done. Redo calculations to avoid overflow.
10548 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10549
10550 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10551 subtracting pointers.
10552 (gobble_line): Check for overflow more carefully. Don't update size
10553 until alloc done.
10554
10555 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10556 Don't update size until alloc done.
10557 Redo size calculations to avoid overflow.
10558 Check for size calculation overflow.
10559 (main) [DEBUG]: Fix typo in invoking tparam1.
10560
10561 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10562 Use ptrdiff_t, not int, for sizes.
10563 (store_mode_line_noprop_char): Don't update size until alloc done.
10564
10565 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10566 Use ptrdiff_t, not int, for sizes.
10567 (Finternal_make_lisp_face, cache_face):
10568 Check for size calculation overflow.
10569 (cache_face): Treat size calculation overflows as if they were
10570 memory exhaustion (the usual treatment), rather than aborting.
10571
10572 * xfns.c (x_encode_text, x_set_name_internal)
10573 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10574 sizes, since they can exceed INT_MAX in size. Check for size
10575 calculation overflow.
10576
10577 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10578 (xg_select): Check for size calculation overflow.
10579 Don't update size until alloc done.
10580
10581 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10582 as sprintf is limited to int lengths.
10583
10584 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10585 (X_LONG_MIN): New macros.
10586 Use them to make the following changes clearer.
10587 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10588 This change doesn't affect the value now, but it may help remind
10589 future maintainers not to raise the value too much later.
10590 (SELECTION_QUANTUM): Remove, replacing with ...
10591 (selection_quantum): ... new function, which avoids overflow.
10592 All uses changed.
10593 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10594 assumption that selection length fits in 'int'.
10595 (x_reply_selection_request, x_handle_selection_request)
10596 (x_get_window_property, receive_incremental_selection)
10597 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10598 (lisp_data_to_selection_data, clean_local_selection_data):
10599 Use ptrdiff_t, not int, to record length of selection.
10600 (x_reply_selection_request, x_get_window_property)
10601 (receive_incremental_selection, x_property_data_to_lisp):
10602 Redo calculations to avoid overflow.
10603 (x_reply_selection_request): When sending hint, ceiling it at
10604 X_LONG_MAX rather than relying on wraparound overflow to send
10605 something.
10606 (x_get_window_property, receive_incremental_selection)
10607 (lisp_data_to_selection_data, x_property_data_to_lisp):
10608 Check for size-calculation overflow.
10609 (x_get_window_property, receive_incremental_selection)
10610 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10611 Don't store size until memory allocation succeeds.
10612 (x_get_window_property): Plug memory leak on memory exhaustion.
10613 Don't double-block input; malloc is safe here. Don't assume 2**34
10614 - 4 fits in unsigned long. Add an xassert to check
10615 XGetWindowProperty overflow. Be more careful about overflow
10616 calculations, and distinguish size from memory overflow better.
10617 (receive_incremental_selection): When tracing, don't assume
10618 unsigned int is less than INT_MAX.
10619 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10620 harmful) conversions of unsigned short to int.
10621 (lisp_data_to_selection_data): Don't assume that integers
10622 in the range -65535 through -1 fit in an X unsigned short.
10623 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10624 result parameters unless successful. Rely on cons_to_unsigned
10625 to report problems with elements; the old code wasn't right anyway.
10626 (x_check_property_data): Check for int overflow; we cannot use
10627 a wider type due to X limits.
10628 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10629
10630 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10631
10632 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10633 (x_term_init): Check for size calculation overflow.
10634 (x_color_cells): Don't store size until memory allocation succeeds.
10635 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10636 Don't assume alloca size is less than MAX_ALLOCA.
10637 (x_term_init): Don't assume length fits in int (sprintf is limited
10638 to int size).
10639
10640 Use ptrdiff_t for composition IDs.
10641 * character.c (lisp_string_width):
10642 * composite.c (composition_table_size, n_compositions)
10643 (get_composition_id, composition_gstring_from_id):
10644 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10645 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10646 * window.c (Frecenter):
10647 Use ptrdiff_t, not int, for composition IDs.
10648 * composite.c (get_composition_id): Check for integer overflow.
10649 * composite.h: Adjust prototypes to match the above changes.
10650
10651 Use ptrdiff_t for hash table indexes.
10652 * category.c (hash_get_category_set):
10653 * ccl.c (ccl_driver):
10654 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10655 * coding.c (coding_system_charset_list, detect_coding_system):
10656 * coding.h (struct coding_system.id):
10657 * composite.c (get_composition_id, gstring_lookup_cache):
10658 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10659 * image.c (xpm_get_color_table_h):
10660 * lisp.h (hash_lookup, hash_put):
10661 * minibuf.c (Ftest_completion):
10662 Use ptrdiff_t for hash table indexes, not int (which is too
10663 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10664 32-bit --with-wide-int hosts).
10665
10666 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10667 Add a FIXME comment about memory leaks.
10668 (syms_of_charset): Don't assume xmalloc returns.
10669
10670 Don't assume that stated character widths fit in int.
10671 * character.c (Fchar_width, c_string_width, lisp_string_width):
10672 * character.h (CHAR_WIDTH):
10673 * indent.c (MULTIBYTE_BYTES_WIDTH):
10674 Use sanitize_char_width to avoid undefined and/or bad behavior
10675 with outlandish widths.
10676 * character.h (sanitize_tab_width): Rename from sanitize_width,
10677 now that we have two such functions. All uses changed.
10678 (sanitize_char_width): New inline function.
10679
10680 Don't assume that tab-width fits in int.
10681 * character.h (sanitize_width): New inline function.
10682 (SANE_TAB_WIDTH): New macro.
10683 (ASCII_CHAR_WIDTH): Use it.
10684 * indent.c (sane_tab_width): Remove. All uses replaced by
10685 SANE_TAB_WIDTH (current_buffer).
10686 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10687
10688 * fileio.c: Integer overflow issues with file modes.
10689 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10690
10691 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10692 Remove unreachable code.
10693 (read_hex, load_charset_map_from_file): Check for integer overflow.
10694
10695 * xterm.c: Don't go over XClientMessageEvent limit.
10696 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10697 (x_send_scroll_bar_event): Likewise. Check that the size does not
10698 exceed limits imposed by XClientMessageEvent, as well as the usual
10699 ptrdiff_t and size_t limits.
10700
10701 * keyboard.c: Overflow, signedness and related fixes.
10702 (make_lispy_movement): Use same integer type in forward decl
10703 that is used in the definition.
10704 (read_key_sequence, keyremap_step):
10705 Change bufsize argument back to int, undoing my 2011-03-30 change.
10706 We prefer signed types, and int is wide enough here.
10707 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10708 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10709 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10710 length, not size_t. Use ptrdiff_t for index, not int.
10711 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10712 possibility of integer overflow.
10713
10714 Overflow, signedness and related fixes for images.
10715
10716 * dispextern.h (struct it.stack[0].u.image.image_id)
10717 (struct_it.image_id, struct image.id, struct image_cache.size)
10718 (struct image_cache.used, struct image_cache.ref_count):
10719 * gtkutil.c (update_frame_tool_bar):
10720 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10721 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10722 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10723 * nsmenu.m (update_frame_tool_bar):
10724 * xdisp.c (calc_pixel_width_or_height):
10725 * xfns.c (image_cache_refcount):
10726 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10727 on typical 64-bit hosts.
10728
10729 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10730 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10731 Omit unnecessary casts to int.
10732 (parse_image_spec): Check that integers fall into 'int' range
10733 when the callers expect that.
10734 (image_ascent): Redo ascent calculation to avoid int overflow.
10735 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10736 (lookup_image): Remove unnecessary tests.
10737 (xbm_image_p): Locals are now of int, not EMACS_INT,
10738 since parse_image_check makes sure they fit into int.
10739 (png_load, gif_load, svg_load_image):
10740 Prefer int to unsigned where either will do.
10741 (tiff_handler): New function, combining the cores of the
10742 old tiff_error_handler and tiff_warning_handler.
10743 This function is rewritten to use vsnprintf and thereby avoid
10744 stack buffer overflows. It uses only the features of vsnprintf
10745 that are common to both POSIX and native Microsoft.
10746 (tiff_error_handler, tiff_warning_handler): Use it.
10747 (tiff_load, gif_load, imagemagick_load_image):
10748 Don't assume :index value fits in 'int'.
10749 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10750 (imagemagick_load_image): Check that crop parameters fit into
10751 the integer types that MagickCropImage accepts. Don't assume
10752 Vimagemagick_render_type has a nonnegative value. Don't assume
10753 size_t fits in 'long'.
10754 (gs_load): Use printmax_t to print the widest integers possible.
10755 Check for integer overflow when computing image height and width.
10756
10757 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10758
10759 * xdisp.c (redisplay_window): Don't force window start if point
10760 will be invisible in the resulting window. (Bug#9324)
10761
10762 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10763
10764 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10765 the display spec is of the form `(space ...)'.
10766 (handle_display_spec): Return the value returned by
10767 handle_single_display_spec, not just 1 or zero.
10768 (handle_single_display_spec): If the display spec is of the form
10769 `(space ...)', and specifies display in the text area, return 2
10770 rather than 1.
10771 (try_cursor_movement): Check for the need to scroll more
10772 accurately, and prefer exact match for point under bidi.
10773 Don't advance `row' beyond the last row of the window.
10774
10775 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10776 into disp_prop; all users changed.
10777
10778 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10779 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10780 for the text covered by the display property.
10781
10782 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10783
10784 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10785 Change return value to nil.
10786 (Frecord_buffer): Delete unused function.
10787
10788 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10789
10790 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10791 buffers, return left-to-right.
10792 (set_cursor_from_row): Consider candidate row a win if its glyph
10793 represents a newline and point is on that newline. Fixes cursor
10794 positioning on the newline at EOL of R2L text within L2R
10795 paragraph, and vice versa.
10796 (try_cursor_movement): Check continued rows, in addition to
10797 continuation rows. Fixes unwarranted scroll when point enters a
10798 continued line of R2L text within an L2R paragraph, or vice versa.
10799 (cursor_row_p): Consider the case of point being equal to
10800 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10801 from the end of a short line to the beginning of a continued line
10802 of R2L text within L2R paragraph.
10803 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10804 composed characters.
10805
10806 * bidi.c (bidi_check_type): Use xassert.
10807 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10808 members.
10809
10810 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10811
10812 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10813 a character.
10814
10815 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10816
10817 * nsfont.m (ns_otf_to_script): Fix typo.
10818
10819 2011-08-22 Kenichi Handa <handa@m17n.org>
10820
10821 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10822 extra slot even if the purpose is char-code-property-table.
10823
10824 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10825
10826 * xdisp.c (redisplay_window): When computing centering_position,
10827 account for the height of the header line. (Bug#8874)
10828
10829 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10830 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10831 candidate is selected by the mouse, and that candidate has a
10832 composed character under the mouse.
10833
10834 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10835 coordinates reported by pos-visible-in-window-p for a composed
10836 character in column zero.
10837
10838 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10839
10840 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10841
10842 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10843
10844 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10845 consider it a hit if to_charpos is anywhere in the range of the
10846 composed buffer positions.
10847
10848 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10849
10850 * image.c (gif_load): Don't assume that each subimage has the same
10851 dimensions as the base image. Handle disposal method that is
10852 "undefined" by the gif spec (Bug#9335).
10853
10854 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10855
10856 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10857 (Fcondition_case): Document `debug' symbol in error handler.
10858
10859 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10860
10861 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10862 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10863 from an Org mode buffer to a Speedbar frame.
10864
10865 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10866 a composition, take its buffer position from IT->cmp_it.charpos.
10867 Fixes cursor positioning at the beginning of a line that begins
10868 with a composed character.
10869
10870 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10871
10872 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10873 character bidirectional type, use STRONG_L instead. Fixes crashes
10874 in a buffer produced by `describe-categories'.
10875
10876 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10877 members before the level stack, so they would be saved and
10878 restored when copying iterator state. Fixes incorrect reordering
10879 around TABs covered by display properties.
10880
10881 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10882
10883 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10884
10885 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10886
10887 * eval.c (internal_condition_case, internal_condition_case_1)
10888 (internal_condition_case_2, internal_condition_case_n):
10889 Remove unnecessary aborts (Bug#9081).
10890
10891 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10892
10893 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10894 has no `load' handler, try opening the file locally. (Bug#9311)
10895
10896 2011-08-16 Ken Brown <kbrown@cornell.edu>
10897
10898 * gmalloc.c: Expand comment.
10899
10900 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10901
10902 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10903 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10904
10905 2011-08-16 Ken Brown <kbrown@cornell.edu>
10906
10907 Fix memory allocation problems in Cygwin build (Bug#9273).
10908
10909 * unexcw.c ( __malloc_initialized): Declare external variable.
10910 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10911
10912 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10913 New variables.
10914 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10915 dumped emacs.
10916 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10917 in the static heap.
10918 [CYGWIN] (special_realloc): New function.
10919 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10920 requests to realloc storage in the static heap.
10921
10922 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10923
10924 * bidi.c (bidi_initialize): Remove unused local.
10925
10926 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10927
10928 * bidimirror.h:
10929 * biditype.h: Remove file.
10930 * makefile.w32-in ($(BLD)/bidi.$(O)):
10931 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10932
10933 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10934
10935 * chartab.c: Improve commentary for the uniprop_table API.
10936
10937 * bidi.c (bidi_paragraph_init): Support zero value of
10938 bidi_ignore_explicit_marks_for_paragraph_level.
10939 (bidi_initialize): Use uniprop_table instead of including
10940 biditype.h and bidimirror.h.
10941
10942 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10943 coordinates of the iterator when restoring from ppos_it.
10944 (Bug#9296)
10945
10946 2011-08-14 Kenichi Handa <handa@m17n.org>
10947
10948 * process.c (create_process): Call setup_process_coding_systems
10949 after the pid of the process is set to -1 (Bug#8162).
10950
10951 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10952
10953 * xdisp.c (move_it_in_display_line_to): Don't invoke
10954 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10955 ppos_it. Fixes vertical cursor motion when line beginning is
10956 covered by an image. (Bug#9296)
10957
10958 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10959
10960 * nsterm.h (ns_run_ascript): Declare.
10961 (NSAPP_DATA2_RUNASSCRIPT): Define.
10962
10963 * nsfns.m (as_script, as_result, as_status): New static variables.
10964 (ns_run_ascript): New function.
10965 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10966 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10967 the event loop. Get status from as_status (Bug#7276).
10968
10969 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10970 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10971 the event loop (Bug#7276).
10972
10973 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10974
10975 * gnutls.c (QCgnutls_bootprop_priority)
10976 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10977 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10978 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10979 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10980 (QCgnutls_bootprop_verify_hostname_error)
10981 (QCgnutls_bootprop_callbacks_verify): Rename from
10982 Qgnutls_bootprop_..., all uses changed.
10983
10984 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10985 uses changed.
10986
10987 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10988
10989 * xfaces.c (Qframe_set_background_mode): Now static.
10990 * dispextern.h (Qframe_set_background_mode): Remove decl.
10991
10992 * process.c (Fnetwork_interface_info): Declare local only if needed.
10993
10994 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10995
10996 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10997 (Fnetwork_interface_list): Allocate in increments of bytes instead
10998 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10999 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
11000 sockaddr.
11001 (struct ifflag_def): notrailers is smart on OSX.
11002 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
11003 Get hardware address with getifaddrs if available.
11004
11005 2011-08-12 Eli Zaretskii <eliz@gnu.org>
11006
11007 * xdisp.c (iterate_out_of_display_property): xassert that
11008 IT->position is set to within IT->object's boundaries. Break from
11009 the loop as soon as EOB is reached; avoids infloops in redisplay
11010 when IT->position is set up wrongly due to some bug.
11011 Set IT->current to match the bidi iterator unconditionally.
11012 (push_display_prop): Allow GET_FROM_STRING as IT->method on
11013 entry. Force push_it to save on the stack the current
11014 buffer/string position, to be restored by pop_it. Fix flags in
11015 the iterator structure wrt the object coming from a display
11016 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
11017 properties. (Bug#9284)
11018
11019 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
11020
11021 * fontset.c (fontset_get_font_group): Add proper type checks.
11022 (Bug#9172)
11023
11024 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11025
11026 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11027 and LC_VERSION_MIN_MACOSX.
11028 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11029 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11030
11031 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11032
11033 * xdisp.c (forward_to_next_line_start): Allow to use the
11034 no-display-properties-and-no-overlays under bidi display.
11035 Set disp_pos in the bidi iterator to avoid searches for display
11036 properties and overlays.
11037
11038 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11039
11040 * editfns.c (Fset_time_zone_rule): Document relationship with the
11041 setenv function.
11042
11043 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11044 the font entity extracted from the cache (Bug#8109).
11045
11046 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11047
11048 * composite.c (autocmp_chars): Don't reset point. That is done by
11049 restore_point_unwind (Bug#5984).
11050
11051 2011-08-07 Juri Linkov <juri@jurta.org>
11052
11053 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11054 to show the arg `TIME' instead of `TIMEVAL'.
11055
11056 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11057
11058 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11059 display property strides EOL and includes a newline, as in
11060 longlines-mode. (Bug#9254)
11061 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11062 word-wrap under bidirectional display. (Bug#9224)
11063
11064 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11065 is non-zero, even if the data buffer is NULL. Fixes a crash in
11066 vertical-motion with longlines-mode. (Bug#9254)
11067
11068 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11069
11070 * bidi.c <bidi_cache_total_alloc>: Now static.
11071 (bidi_initialize): Initialize bidi_cache_total_alloc.
11072
11073 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11074 cache. (Bug#9221)
11075
11076 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11077 amount allocated this far in `bidi_cache_total_alloc'.
11078 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11079 non-zero, only free the data buffer without restoring the cache
11080 contents. All callers changed.
11081
11082 * dispextern.h (bidi_unshelve_cache): Update prototype.
11083
11084 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11085 (move_it_in_display_line, move_it_to)
11086 (move_it_vertically_backward, move_it_by_lines): Replace the call
11087 to xfree to an equivalent call to bidi_unshelve_cache.
11088 (move_it_in_display_line_to): Fix logic of returning
11089 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11090
11091 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11092
11093 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11094 came from a string character with a `cursor' property. (Bug#9229)
11095
11096 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11097
11098 * Makefile.in (LIB_PTHREAD): New variable.
11099 (LIBES): Add LIB_PTHREAD (Bug#9216).
11100
11101 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11102 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11103
11104 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11105
11106 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11107
11108 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11109
11110 * xterm.c (x_find_topmost_parent): New function.
11111 (x_set_frame_alpha): Find topmost parent window with
11112 x_find_topmost_parent and set the property there also (bug#9181).
11113 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11114
11115 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11116
11117 * callproc.c (Fcall_process): Avoid vfork clobbering
11118 the local vars buffer, coding_systems, current_dir.
11119
11120 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11121
11122 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11123
11124 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11125
11126 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11127 so that it is not optimized away.
11128
11129 * xdisp.c (compute_display_string_pos): Remove unused local.
11130
11131 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11132
11133 Fix slow cursor motion and scrolling in large buffers with
11134 selective display, like Org Mode buffers. (Bug#9218)
11135
11136 * dispextern.h (struct bidi_it): New member disp_prop_p.
11137
11138 * xdisp.c: Remove one-slot cache of display string positions.
11139 (compute_display_string_pos): Accept an additional argument
11140 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11141 for a display string or property. If found, set DISP_PROP_P
11142 non-zero.
11143
11144 * bidi.c (bidi_fetch_char): Accept an additional argument
11145 DISP_PROP_P, and pass it to compute_display_string_pos.
11146 Only handle text covered by a display string if DISP_PROP_P is returned
11147 non-zero. All callers of bidi_fetch_char changed.
11148
11149 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11150
11151 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11152
11153 2010-12-03 Don March <don@ohspite.net>
11154
11155 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11156 last character M-[char] is translated to ESC [char] (bug#7541).
11157
11158 2011-08-02 Kenichi Handa <handa@m17n.org>
11159
11160 * lisp.h (uniprop_table): Extern it.
11161
11162 * chartab.c (uniprop_table): Make it non-static.
11163
11164 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11165
11166 * xdisp.c (forward_to_next_line_start): Accept additional argument
11167 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11168 on the newline.
11169 (reseat_at_next_visible_line_start): Use the bidi iterator state
11170 returned by forward_to_next_line_start to restore the state of
11171 it->bidi_it after backing up to previous newline. (Bug#9212)
11172
11173 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11174
11175 * regex.c (re_comp): Protoize.
11176 (re_exec): Fix return type.
11177 (regexec): Fix type of `ret'. (Bug#9203)
11178
11179 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11180
11181 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11182 This is needed if max-image-size is a floating-point number.
11183
11184 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11185
11186 * print.c (print_object): Print empty symbol as ##.
11187
11188 * lread.c (read1): Read ## as empty symbol.
11189
11190 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11191
11192 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11193 setting frame foreground color (Bug#9175).
11194 (x_set_background_color): Likewise.
11195
11196 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11197 contents (Bug#9176).
11198 (EmacsTooltip -init): Remove bezels and add shadows to
11199 tooltip windows.
11200
11201 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11202 or scroll bar (Bug#8470).
11203
11204 * nsfont.m (nsfont_open): Remove assignment to voffset and
11205 unnecessary vars hshink, expand, hd, full_height, min_height.
11206 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11207
11208 * nsterm.h (nsfont_info): Remove voffset field.
11209
11210 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11211
11212 Implement strike-through and overline on NextStep (Bug#8863).
11213
11214 * nsfont.m (nsfont_open): Use underline position provided by font,
11215 instead of hard-coded value of 2.
11216 (nsfont_draw): Call ns_draw_text_decoration instead.
11217
11218 * nsterm.h: Add declaration for ns_draw_text_decoration.
11219
11220 * nsterm.m (ns_draw_text_decoration): New function for drawing
11221 underline, overline, and strike-through.
11222 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11223 ns_draw_text_decoration. Change treatment of cursor drawing to
11224 accommodate underlining, etc.
11225
11226 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11227
11228 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11229 default.
11230
11231 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11232
11233 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11234 Without this fix, if a signal arrives just after memory fills up,
11235 'malloc' might be invoked reentrantly.
11236
11237 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11238 In other words, assume that every image size is allowed, on non-X
11239 hosts. This assumption is probably wrong, but it lets Emacs compile.
11240
11241 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11242
11243 * regex.c (re_iswctype): Convert return values to boolean.
11244
11245 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11246
11247 * xdisp.c (compute_display_string_pos): Don't use cached display
11248 string position if the buffer had its restriction changed.
11249 (Bug#9184)
11250
11251 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11252
11253 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11254
11255 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11256
11257 Integer signedness and overflow and related fixes. (Bug#9079)
11258
11259 * bidi.c: Integer size and overflow fixes.
11260 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11261 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11262 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11263 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11264 (bidi_find_other_level_edge):
11265 Use ptrdiff_t instead of EMACS_INT where either will do.
11266 This works better on 32-bit hosts configured --with-wide-int.
11267 (bidi_cache_ensure_space): Check for size-calculation overflow.
11268 Use % rather than repeated addition, for better worst-case speed.
11269 Don't set bidi_cache_size until after xrealloc returns, because it
11270 might not return.
11271 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11272 (bidi_cache_ensure_space): Also check that the bidi cache size
11273 does not exceed that of the largest Lisp string or buffer. See Eli
11274 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11275
11276 * alloc.c (__malloc_size_t): Remove.
11277 All uses replaced by size_t. See Andreas Schwab's note
11278 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11279
11280 * image.c: Improve checking for integer overflow.
11281 (check_image_size): Assume that f is nonnull, since
11282 it is always nonnull in practice. This is one less thing to
11283 worry about when checking for integer overflow later.
11284 (x_check_image_size): New function, which checks for integer
11285 overflow issues inside X.
11286 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11287 This removes the need for a memory_full check.
11288 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11289 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11290 (xbm_read_bitmap_data): Change locals back to 'int', since
11291 their values must fit in 'int'.
11292 (xpm_load_image, png_load, tiff_load):
11293 Invoke x_create_x_image_and_pixmap earlier,
11294 to avoid much needless work if the image is too large.
11295 (tiff_load): Treat overly large images as if
11296 x_create_x_image_and_pixmap failed, not as malloc failures.
11297 (gs_load): Use x_check_image_size.
11298
11299 * gtkutil.c: Omit integer casts.
11300 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11301 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11302
11303 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11304
11305 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11306 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11307 would wrongly return t on a 64-bit host.
11308
11309 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11310 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11311 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11312 and therefore cause GCC to emit a bogus diagnostic in some cases.
11313
11314 * image.c: Integer signedness and overflow and related fixes.
11315 This is not an exhaustive set of fixes, but it's time to
11316 record what I've got.
11317 (lookup_pixel_color, check_image_size): Remove redundant decls.
11318 (check_image_size): Don't assume that arbitrary EMACS_INT values
11319 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11320 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11321 (tiff_load, imagemagick_load_image):
11322 Check for overflow in size calculations.
11323 (x_create_x_image_and_pixmap): Remove unnecessary test for
11324 xmalloc returning NULL; that can't happen.
11325 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11326 (xpm_color_bucket): Use better integer hashing function.
11327 (xpm_cache_color): Don't possibly over-allocate memory.
11328 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11329 (gif_memory_source):
11330 Use ptrdiff_t, not int or size_t, to record sizes.
11331 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11332 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11333 either works, as we prefer signed integers.
11334 (tiff_read_from_memory, tiff_write_from_memory):
11335 Return tsize_t, not size_t, since that's what the TIFF API wants.
11336 (tiff_read_from_memory): Don't fail simply because the read would
11337 go past EOF; instead, return a short read.
11338 (tiff_load): Omit no-longer-needed casts.
11339 (Fimagemagick_types): Don't assume size fits into 'int'.
11340
11341 Improve hashing quality when configured --with-wide-int.
11342 * fns.c (hash_string): New function, taken from sxhash_string.
11343 Do not discard information about ASCII character case; this
11344 discarding is no longer needed.
11345 (sxhash-string): Use it. Change sig to match it. Caller changed.
11346 * lisp.h: Declare it.
11347 * lread.c (hash_string): Remove, since we now use fns.c's version.
11348 The fns.c version returns a wider integer if --with-wide-int is
11349 specified, so this should help the quality of the hashing a bit.
11350
11351 * emacs.c: Integer overflow minor fix.
11352 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11353 Define only if GNU_LINUX.
11354 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11355
11356 * dispnew.c: Integer signedness and overflow fixes.
11357 Remove unnecessary forward decls, that were a maintenance hassle.
11358 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11359 All uses changed.
11360 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11361 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11362 (prepare_desired_row, line_draw_cost):
11363 Use int, not unsigned, where either works.
11364 (save_current_matrix, restore_current_matrix):
11365 Use ptrdiff_t, not size_t, where either works.
11366 (init_display): Check for overflow more accurately, and without
11367 relying on undefined behavior.
11368
11369 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11370 Remove, replacing with the new symbols in lisp.h. All uses changed.
11371 * fileio.c (make_temp_name):
11372 * filelock.c (lock_file_1, lock_file):
11373 * xdisp.c (message_dolog):
11374 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11375 Use pMd etc. instead.
11376 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11377 replacing the pWIDE etc. symbols removed from editfns.c.
11378
11379 * keyboard.h (num_input_events): Now uintmax_t.
11380 This is (very slightly) less likely to mess up due to wraparound.
11381 All uses changed.
11382
11383 * buffer.c: Integer signedness fixes.
11384 (alloc_buffer_text, enlarge_buffer_text):
11385 Use ptrdiff_t rather than size_t when either will do, as we prefer
11386 signed integers.
11387
11388 * alloc.c: Integer signedness and overflow fixes.
11389 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11390 (__malloc_size_t): Default to size_t, not to int.
11391 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11392 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11393 Prefer ptrdiff_t to size_t when either would do, as we prefer
11394 signed integers.
11395 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11396 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11397 Now const. Initialize with values that are in range even if char
11398 is signed.
11399 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11400 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11401 These functions do the right thing with sizes > 2**32.
11402 (check_depth): Now ptrdiff_t, not int.
11403 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11404 Adjust to new way of storing sizes. Check for size overflow bugs
11405 in rest of code.
11406 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11407 slightly wrong anyway, as it missed one instance of
11408 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11409 (refill_memory_reserve): Omit needless cast to size_t.
11410 (mark_object_loop_halt): Mark as externally visible.
11411
11412 * xselect.c: Integer signedness and overflow fixes.
11413 (Fx_register_dnd_atom, x_handle_dnd_message):
11414 Use ptrdiff_t, not size_t, since we prefer signed.
11415 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11416 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11417 x_dnd_atoms_size and x_dnd_atoms_length.
11418
11419 * doprnt.c: Prefer signed to unsigned when either works.
11420 * eval.c (verror):
11421 * doprnt.c (doprnt):
11422 * lisp.h (doprnt):
11423 * xdisp.c (vmessage):
11424 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11425 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11426 prefer signed arithmetic to avoid comparison confusion.
11427 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11428 but is a bit tricky.
11429
11430 Assume freestanding C89 headers, string.h, stdlib.h.
11431 * data.c, doprnt.c, floatfns.c, print.c:
11432 Include float.h unconditionally.
11433 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11434 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11435 * regex.c: Likewise for stddef.h, string.h.
11436 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11437 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11438 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11439 (STDC_HEADERS): Remove obsolete defines.
11440 * sysdep.c: Include limits.h unconditionally.
11441
11442 Assume support for memcmp, memcpy, memmove, memset.
11443 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11444 * regex.c (memcmp, memcpy):
11445 Remove; we assume C89 now.
11446
11447 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11448 (__malloc_safe_bcopy): Remove; no longer needed.
11449
11450 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11451 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11452 well either way, and we prefer signed to unsigned.
11453
11454 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11455
11456 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11457 closes the connection while we're reading (bug#9182).
11458
11459 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11460
11461 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11462 are specified (Bug#9168).
11463
11464 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11465
11466 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11467 Found by GCC static checking and --with-wide-int on a 32-bit host.
11468
11469 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11470
11471 * xdisp.c (compute_display_string_pos): Fix logic of caching
11472 previous display string position. Initialize cached_prev_pos to
11473 -1. Fixes slow-down at the beginning of a buffer.
11474
11475 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11476
11477 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11478 for attrs[LFACE_FONTSET_INDEX].
11479
11480 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11481
11482 * xml.c (parse_region): Remove unused local
11483 that was recently introduced.
11484
11485 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11486
11487 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11488 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11489
11490 * xdisp.c (move_it_in_display_line_to): Record the best matching
11491 position for TO_CHARPOS while scanning the line, and restore it on
11492 exit if none of the characters scanned was an exact match.
11493 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11494 when exact match is impossible due to invisible text, and the
11495 lines are truncated.
11496
11497 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11498
11499 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11500 for OSX >= 10.7.
11501
11502 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11503
11504 Fix a significant slow-down of cursor motion with C-n, C-p,
11505 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11506 auto-repeat under bidi redisplay in fontified buffers.
11507 * xdisp.c (compute_stop_pos_backwards): New function.
11508 (next_element_from_buffer): Call compute_stop_pos_backwards to
11509 find a suitable prev_stop when we find ourselves before
11510 base_level_stop.
11511 (reseat): Don't look for prev_stop, as that could mean a very long
11512 run.
11513 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11514 <cached_disp_overlay_modiff>: Cache for last found display string
11515 position.
11516 (compute_display_string_pos): Return the cached position if asked
11517 about the same buffer in the same area of character positions, and
11518 the buffer wasn't changed since the time the display string
11519 position was cached.
11520
11521 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11522
11523 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11524 is an integer, which is important for empty lines. (Bug#9149)
11525
11526 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11527
11528 * frame.c (Fmodify_frame_parameters): In tty case, update the
11529 default face if necessary (Bug#4238).
11530
11531 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11532
11533 * editfns.c (Fstring_to_char): No need to explain what a character
11534 is in the docstring (Bug#6576).
11535
11536 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11537
11538 * xml.c (parse_region): Make sure we always return a tree.
11539
11540 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11541
11542 * xml.c (parse_region): If a document contains only comments,
11543 return that, too.
11544
11545 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11546
11547 * xml.c (make_dom): Return comments, too.
11548
11549 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11550
11551 Port to OpenBSD.
11552 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11553 and the surrounding thread.
11554 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11555 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11556 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11557 timer goes off.
11558 * s/openbsd.h (BROKEN_SIGIO): Define.
11559 * unexelf.c (unexec) [__OpenBSD__]:
11560 Don't update the .mdebug section of the Alpha COFF symbol table.
11561
11562 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11563
11564 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11565 (bug#8460).
11566
11567 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11568
11569 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11570 This fixes some race conditions on the permissions of any newly
11571 created file.
11572
11573 * alloc.c (valid_pointer_p): Use pipe, not open.
11574 This fixes some permissions issues when debugging.
11575
11576 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11577 If fchown fails to set both uid and gid, try to set just gid,
11578 as that is sometimes allowed. Adjust the file's mode to eliminate
11579 setuid or setgid bits that are inappropriate if fchown fails.
11580
11581 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11582
11583 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11584 to compare Lisp_Objects.
11585 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11586 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11587 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11588
11589 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11590
11591 * lread.c (read_integer): Unread even EOF character.
11592 (read1): Likewise. Properly record start position of symbol.
11593
11594 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11595 symbol character follows.
11596
11597 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11598
11599 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11600 This works around a problem with the previous change to Fcopy_file.
11601 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11602 and without this change, GCC might complain about discarding
11603 fchown's return value.
11604
11605 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11606
11607 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11608
11609 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11610
11611 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11612
11613 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11614
11615 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11616 it's used from the C level.
11617
11618 * process.c: Use the same condition for POLL_FOR_INPUT in both
11619 keyboard.c and process.c (bug#1858).
11620
11621 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11622
11623 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11624 (Fgnutls_boot): Use it.
11625
11626 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11627
11628 * doc.c (Fsubstitute_command_keys): Revert last change.
11629
11630 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11631
11632 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11633 quotes the next character, and doesn't affect other longer
11634 sequences (bug#8935).
11635
11636 * lread.c (syms_of_lread): Clarify that is isn't only
11637 `eval-buffer' and `eval-defun' that's affected by
11638 `lexical-binding' (bug#8460).
11639
11640 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11641
11642 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11643 bidi redisplay when a line includes both an image and is truncated.
11644
11645 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11646
11647 Fix minor problems found by static checking.
11648 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11649 (elsz): Now a signed constant, not a size_t var. We prefer signed
11650 types to unsigned, to avoid integer comparison confusion. Without
11651 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11652 "cannot optimize loop, the loop counter may overflow", a symptom
11653 of the confusion.
11654 * indent.c (Fvertical_motion): Mark locals as initialized.
11655 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11656
11657 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11658
11659 * search.c (Fre_search_backward): Mention `case-fold-search' in
11660 all the re_search_* functions (bug#8138).
11661
11662 * keyboard.c (Fopen_dribble_file): Document when the file is
11663 closed (bug#8056).
11664
11665 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11666
11667 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11668 bidi_cache_idx.
11669
11670 Support bidi reordering of display and overlay strings.
11671 * xdisp.c (compute_display_string_pos)
11672 (compute_display_string_end): Accept additional argument STRING.
11673 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11674 (reseat_to_string): Initialize bidi_it->string.s and
11675 bidi_it->string.schars.
11676 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11677 NULL (avoids a crash in bidi_paragraph_init).
11678 Initialize itb.string.lstring.
11679 (init_iterator): Call bidi_init_it only of a valid
11680 buffer position was specified. Initialize paragraph_embedding to
11681 L2R.
11682 (reseat_to_string): Initialize the bidi iterator.
11683 (display_string): If we need to ignore text properties of
11684 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11685 original value of -1 will not work with bidi.)
11686 (compute_display_string_pos): First arg is now struct
11687 `text_pos *'; all callers changed. Support display properties on
11688 Lisp strings.
11689 (compute_display_string_end): Support display properties on Lisp
11690 strings.
11691 (init_iterator, reseat_1, reseat_to_string): Initialize the
11692 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11693 when iterating on a string not from display properties).
11694 (compute_display_string_pos, compute_display_string_end):
11695 Fix calculation of the object to scan. Fixes an error when using
11696 arrow keys.
11697 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11698 base_level_stop; instead, set base_level_stop to BEGV.
11699 Fixes crashes in vertical-motion.
11700 (next_element_from_buffer): Improve commentary for when
11701 the iterator is before prev_stop.
11702 (init_iterator): Initialize bidi_p from the default value of
11703 bidi-display-reordering, not from buffer-local value. Use the
11704 buffer-local value only if initializing for buffer iteration.
11705 (handle_invisible_prop): Support invisible properties on strings
11706 that are being bidi-reordered.
11707 (set_iterator_to_next): Support bidi reordering of C strings and
11708 Lisp strings.
11709 (next_element_from_string): Support bidi reordering of Lisp
11710 strings.
11711 (handle_stop_backwards): Support Lisp strings as well.
11712 (display_string): Support display of R2L glyph rows.
11713 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11714 (init_iterator): Don't initialize it->bidi_p for strings
11715 here.
11716 (reseat_to_string): Initialize it->bidi_p for strings here.
11717 (next_element_from_string, next_element_from_c_string)
11718 (next_element_from_buffer): Add xassert's for correspondence
11719 between IT's object being iterated and it->bidi_it.string
11720 structure.
11721 (face_before_or_after_it_pos): Support bidi iteration.
11722 (next_element_from_c_string): Handle the case of the first string
11723 character that is not the first one in the visual order.
11724 (get_visually_first_element): New function, refactored from common
11725 parts of next_element_from_buffer, next_element_from_string, and
11726 next_element_from_c_string.
11727 (tool_bar_lines_needed, redisplay_tool_bar)
11728 (display_menu_bar): Force left-to-right direction. Add a FIXME
11729 comment for making that be controlled by a user option.
11730 (push_it, pop_it): Save and restore the state of the
11731 bidi iterator. Save and restore the bidi_p flag.
11732 (pop_it): Iterate out of display property for string iteration as
11733 well.
11734 (iterate_out_of_display_property): Support iteration over strings.
11735 (handle_single_display_spec): Set up it->bidi_it for iteration
11736 over a display string, and call bidi_init_it.
11737 (handle_single_display_spec, next_overlay_string)
11738 (get_overlay_strings_1, push_display_prop): Set up the bidi
11739 iterator for displaying display or overlay strings.
11740 (forward_to_next_line_start): Don't use the shortcut if
11741 bidi-iterating.
11742 (back_to_previous_visible_line_start): If handle_display_prop
11743 pushed the iterator stack, restore the internal state of the bidi
11744 iterator by calling bidi_pop_it same number of times.
11745 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11746 and we are bidi-iterating, don't decrement the iterator position;
11747 instead, set the first_elt flag in the bidi iterator, to produce
11748 the same effect.
11749 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11750 (push_display_prop): xassert that we are iterating a buffer.
11751 (push_it, pop_it): Save and restore paragraph_embedding member.
11752 (handle_single_display_spec, next_overlay_string)
11753 (get_overlay_strings_1, reseat_1, reseat_to_string)
11754 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11755 correctly. Don't assume unibyte strings are not bidi-reordered.
11756 (compute_display_string_pos)
11757 (compute_display_string_end): Fix handling the case of C string.
11758 (push_it, pop_it): Save and restore from_disp_prop_p.
11759 (handle_single_display_spec, push_display_prop): Set the
11760 from_disp_prop_p flag.
11761 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11762 (pop_it): Call iterate_out_of_display_property only if we are
11763 popping after iteration over a string that came from a display
11764 property. Fix a typo in popping stretch info. Add an assertion
11765 for verifying that the iterator position is in sync with the bidi
11766 iterator.
11767 (handle_single_display_spec, get_overlay_strings_1)
11768 (push_display_prop): Fix initialization of paragraph direction for
11769 string when that of the parent object is not yet determined.
11770 (reseat_1): Call bidi_init_it to resync the bidi
11771 iterator with IT's position. (Bug#7616)
11772 (find_row_edges): If ROW->start.pos gives position
11773 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11774 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11775 Reset the from_disp_prop_p flag.
11776 (SAVE_IT, RESTORE_IT): New macros.
11777 (pos_visible_p, face_before_or_after_it_pos)
11778 (back_to_previous_visible_line_start)
11779 (move_it_in_display_line_to, move_it_in_display_line)
11780 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11781 (try_scrolling, redisplay_window, display_line): Use them when
11782 saving a temporary copy of the iterator and restoring it back.
11783 (back_to_previous_visible_line_start, reseat_1)
11784 (init_iterator): Empty the bidi cache "stack".
11785 (move_it_in_display_line_to): If iterator ended up at
11786 EOL, but we never saw any buffer positions smaller than
11787 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11788 motion in bidi-reordered lines.
11789 (move_it_in_display_line_to): Record prev_method and prev_pos
11790 immediately before the call to set_iterator_to_next. Fixes cursor
11791 motion in bidi-reordered lines with stretch glyphs and strings
11792 displayed in margins. (Bug#8133) (Bug#8867)
11793 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11794 TO_CHARPOS.
11795 (pos_visible_p): Support positions in bidi-reordered lines.
11796 Save and restore bidi cache.
11797
11798 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11799 (bidi_paragraph_info): Delete unused struct.
11800 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11801 (bidi_cache_start): New variable.
11802 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11803 to zero.
11804 (bidi_cache_fetch_state, bidi_cache_search)
11805 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11806 (bidi_cache_find, bidi_peek_at_next_level)
11807 (bidi_level_of_next_char, bidi_find_other_level_edge)
11808 (bidi_move_to_visually_next): Compare cache index with
11809 bidi_cache_start rather than with zero.
11810 (bidi_fetch_char): Accept new argument STRING; all callers
11811 changed. Support iteration over a string. Support strings with
11812 display properties. Support unibyte strings. Fix the type of
11813 `len' according to what STRING_CHAR_AND_LENGTH expects.
11814 (bidi_paragraph_init, bidi_resolve_explicit_1)
11815 (bidi_resolve_explicit, bidi_resolve_weak)
11816 (bidi_level_of_next_char, bidi_move_to_visually_next):
11817 Support iteration over a string.
11818 (bidi_set_sor_type, bidi_resolve_explicit_1)
11819 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11820 can now be zero (for strings); special values 0 and -1 were
11821 changed to -1 and -2, respectively.
11822 (bidi_char_at_pos): New function.
11823 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11824 Call it instead of FETCH_MULTIBYTE_CHAR.
11825 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11826 initialized to valid values.
11827 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11828 values.
11829 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11830 the test for valid cached positions. Fix the logic for looking up
11831 the sentinel state in the cache. GCPRO the Lisp string we are
11832 iterating.
11833 (bidi_push_it, bidi_pop_it): New functions.
11834 (bidi_initialize): Initialize the bidi cache start stack pointer.
11835 (bidi_cache_ensure_space): New function, refactored from part of
11836 bidi_cache_iterator_state. Don't assume the required size is just
11837 one BIDI_CACHE_CHUNK away.
11838 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11839 (bidi_count_bytes, bidi_char_at_pos): New functions.
11840 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11841 always valid if bidi_cache_idx is valid.
11842 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11843 is valid if it's going to be used.
11844 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11845 (bidi_cache_fetch_state, bidi_cache_search)
11846 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11847 (bidi_cache_iterator_state, bidi_cache_find)
11848 (bidi_find_other_level_edge, bidi_cache_start_stack):
11849 All variables related to cache indices are now EMACS_INT.
11850
11851 * dispextern.h (struct bidi_string_data): New structure.
11852 (struct bidi_it): New member `string'. Make flag members be 1-bit
11853 fields, and put them last in the struct.
11854 (compute_display_string_pos, compute_display_string_end):
11855 Update prototypes.
11856 (bidi_push_it, bidi_pop_it): Add prototypes.
11857 (struct iterator_stack_entry): New members bidi_p,
11858 paragraph_embedding, and from_disp_prop_p.
11859 (struct it): Member bidi_p is now a bit field 1 bit wide.
11860 (bidi_shelve_cache, bidi_unshelve_cache):
11861 Declare prototypes.
11862
11863 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11864 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11865 and vector-like objects.
11866
11867 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11868 cache around display iteration.
11869
11870 * window.c (Fwindow_end, window_scroll_pixel_based)
11871 (displayed_window_lines, Frecenter): Save and restore the bidi
11872 cache around display iteration.
11873
11874 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11875
11876 * editfns.c (Fdelete_region): Clarify the use of the named
11877 parameters (bug#6788).
11878
11879 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11880
11881 * indent.c (Fvertical_motion): Set and restore w->pointm when
11882 saving and restoring the window's buffer (Bug#9006).
11883
11884 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11885
11886 * editfns.c (Fstring_to_char): Clarify just what is returned
11887 (bug#6576). Text by Eli Zaretskii.
11888
11889 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11890
11891 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11892
11893 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11894
11895 * buffer.c (mmap_find): Fix a typo.
11896
11897 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11898
11899 Fix execution of x selection hooks.
11900 * xselect.c (Qx_lost_selection_functions)
11901 (Qx_sent_selection_functions): New vars.
11902 (syms_of_xselect): DEFSYM them.
11903 (x_handle_selection_request): Pass Qx_sent_selection_functions
11904 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11905 (x_handle_selection_clear,x_clear_frame_selections):
11906 Pass Qx_lost_selection_functions rather than
11907 Vx_lost_selection_functions to Frun_hook_with_args.
11908
11909 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11910
11911 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11912 The old code sometimes used this field without initializing it.
11913
11914 * alloc.c (gc_sweep): Don't read past end of array.
11915 In theory, the old code could also have corrupted Emacs internals,
11916 though it'd be very unlikely.
11917
11918 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11919
11920 * character.c (Fcharacterp): Don't advertise optional ignored
11921 argument. (Bug#4026)
11922
11923 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11924
11925 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11926 key" (bug#4257).
11927
11928 * window.c (Fset_window_start): Doc fix (bug#4199).
11929 (Fset_window_hscroll): Ditto.
11930
11931 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11932
11933 Fix minor new problems caught by GCC 4.6.1.
11934 * term.c (init_tty): Remove unused local.
11935 * xsettings.c (store_monospaced_changed): Define this function only
11936 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11937 not used otherwise.
11938
11939 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11940
11941 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11942
11943 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11944
11945 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11946 are the mini-buffer and the echo area (bug#3320).
11947
11948 * term.c (init_tty): Remove support for supdup, c10 and perq
11949 terminals, which are no longer supported (bug#1482).
11950
11951 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11952
11953 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11954
11955 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11956
11957 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11958 for non-popups (Bug#3642).
11959
11960 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11961
11962 * alloc.c (reset_malloc_hooks): Protoize.
11963 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11964 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11965 * cm.c (losecursor): Likewise.
11966 * data.c (fmod): Likewise.
11967 * dispnew.c (swap_glyphs_in_rows): Likewise.
11968 * emacs.c (memory_warning_signal): Likewise.
11969 * floatfns.c (float_error): Likewise.
11970 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11971 (otf_open, font_otf_capability, generate_otf_features)
11972 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11973 Likewise.
11974 * image.c (pbm_read_file): Likewise.
11975 * indent.c (string_display_width): Likewise.
11976 * intervals.c (check_for_interval, search_for_interval)
11977 (inc_interval_count, count_intervals, root_interval)
11978 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11979 * lread.c (defalias): Likewise.
11980 * ralloc.c (r_alloc_check): Likewise.
11981 * regex.c (set_image_of_range_1, set_image_of_range)
11982 (regex_grow_registers): Likewise.
11983 * sysdep.c (strerror): Likewise.
11984 * termcap.c (valid_filename_p, tprint, main): Likewise.
11985 * tparam.c (main): Likewise.
11986 * unexhp9k800.c (run_time_remap, save_data_space)
11987 (update_file_ptrs, read_header, write_header, calculate_checksum)
11988 (copy_file, copy_rest, display_header): Likewise.
11989 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11990 Likewise.
11991 * xdisp.c (check_it): Likewise.
11992 * xfaces.c (register_color, unregister_color, unregister_colors):
11993 Likewise.
11994 * xfns.c (print_fontset_result): Likewise.
11995 * xrdb.c (member, fatal, main): Likewise.
11996
11997 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11998
11999 Fix minor problems found by static checking (Bug#9031).
12000 * chartab.c (char_table_set_range, map_sub_char_table):
12001 Remove unused locals.
12002 (uniprop_table): Now static.
12003 * composite.c (_work_char): Remove unused static var.
12004
12005 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
12006
12007 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
12008
12009 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
12010
12011 * gtkutil.c (qttip_cb): Remove code without function.
12012
12013 2011-07-09 Eli Zaretskii <eliz@gnu.org>
12014
12015 * w32.c (pthread_sigmask): New stub.
12016
12017 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
12018
12019 Use pthread_sigmask, not sigprocmask (Bug#9010).
12020 sigprocmask is portable only for single-threaded applications, and
12021 Emacs can be multi-threaded when it uses GTK.
12022 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12023 (LIBES): Use it.
12024 * callproc.c (Fcall_process):
12025 * process.c (create_process):
12026 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12027 Use pthread_sigmask, not sigprocmask.
12028
12029 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12030
12031 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12032 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12033 wrong (Bug#8591).
12034
12035 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12036
12037 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12038 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12039 (xg_hide_tooltip): Fix comment.
12040
12041 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12042 in registerServicesMenuSendTypes.
12043 (validRequestorForSendType): Don't check ns_return_types.
12044
12045 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12046 ns_return_type.
12047
12048 2011-07-08 Jason Rumney <jasonr@gnu.org>
12049
12050 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12051 SH_SHOW for hidden windows (Bug#5482).
12052
12053 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12054 frame struct members of non-existent frames (Bug#6284).
12055
12056 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12057
12058 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12059 variable firstTime not needed on OSX >= 10.6.
12060 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12061 >= 10.5. Use setKnobProportion, setDoubleValue.
12062
12063 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12064 (MAC_OS_X_VERSION_10_5): Define if not defined.
12065 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12066 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12067 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12068
12069 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12070 cString and lossyCString on OSX >= 10.4.
12071
12072 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12073 sizeToFit on OSX >= 10.2.
12074
12075 * nsimage.m (allocInitFromFile): Don't use deprecated method
12076 bestRepresentationForDevice on OSX >= 10.6.
12077
12078 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12079 to avoid warning.
12080
12081 * emacs.c: Declare unexec_init_emacs_zone.
12082
12083 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12084
12085 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12086
12087 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12088 on svcsMenu (Bug#8842).
12089
12090 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12091 ns_return_types.
12092 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12093
12094 * nsterm.m (QUTF8_STRING): Declare.
12095 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12096 (validRequestorForSendType): Return type is (id).
12097 Change indexOfObjectIdenticalTo to indexOfObject.
12098 Check if we have local selection before returning self (Bug#8842).
12099 (writeSelectionToPasteboard): Put local selection into paste board
12100 if we have a local selection (Bug#8842).
12101 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12102
12103 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12104 (ns_get_local_selection): Declare.
12105
12106 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12107
12108 * keymap.c (describe_map_tree): Don't insert a double newline at
12109 the end of the buffer (bug#1169) and return whether we inserted
12110 something.
12111
12112 * callint.c (Fcall_interactively): Change "reading args" to
12113 "providing args" to try to clarify what it does (bug#1010).
12114
12115 2011-07-07 Kenichi Handa <handa@m17n.org>
12116
12117 * composite.c (composition_compute_stop_pos): Ignore a static
12118 composition starting before CHARPOS (Bug#8915).
12119
12120 * xdisp.c (handle_composition_prop): Likewise.
12121
12122 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12123
12124 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12125 (Bug#9015)
12126
12127 2011-07-07 Kenichi Handa <handa@m17n.org>
12128
12129 * character.h (unicode_category_t): New enum type.
12130
12131 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12132 (Qchar_code_property_table): New variable.
12133 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12134 (UNIPROP_COMPRESSED_FORM_P): New macros.
12135 (char_table_ascii): Uncompress the compressed values.
12136 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12137 Uncompress the compressed values.
12138 (sub_char_table_ref_and_range): Likewise.
12139 (char_table_ref_and_range): Uncompress the compressed values.
12140 (sub_char_table_set): New arg is_uniprop. Callers changed.
12141 Uncompress the compressed values.
12142 (sub_char_table_set_range): Args changed. Callers changed.
12143 (char_table_set_range): Adjuted for the above change.
12144 (map_sub_char_table): Delete args default_val and parent. Add arg
12145 top. Give decoded values to a Lisp function.
12146 (map_char_table): Adjust for the above change. Give decoded
12147 values to a Lisp function. Gcpro more variables.
12148 (uniprop_table_uncompress)
12149 (uniprop_decode_value_run_length): New functions.
12150 (uniprop_decoder, uniprop_decoder_count): New variables.
12151 (uniprop_get_decoder, uniprop_encode_value_character)
12152 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12153 New functions.
12154 (uniprop_encoder, uniprop_encoder_count): New variables.
12155 (uniprop_get_encoder, uniprop_table)
12156 (Funicode_property_table_internal, Fget_unicode_property_internal)
12157 (Fput_unicode_property_internal): New functions.
12158 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12159 Sunicode_property_table_internal, Sget_unicode_property_internal,
12160 and Sput_unicode_property_internal. Defvar_lisp
12161 char-code-property-alist.
12162
12163 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12164 Vunicode_category_table.
12165
12166 * font.c (font_range): Adjust for the change of
12167 Vunicode_category_table.
12168
12169 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12170
12171 * m/iris4d.h: Remove file, move contents ...
12172 * s/irix6-5.h: ... here.
12173
12174 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12175
12176 Remove unportable assumption about struct layout (Bug#8884).
12177 * alloc.c (mark_buffer):
12178 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12179 (clone_per_buffer_values): Don't assume that
12180 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12181 This isn't true in general, and it's particularly not true
12182 if Emacs is configured with --with-wide-int.
12183 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12184 New macros, used in the buffer.c change.
12185
12186 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12187
12188 * xsettings.c: Use both GConf and GSettings if both are available.
12189 (store_config_changed_event): Add comment.
12190 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12191 (store_tool_bar_style_changed): New functions.
12192 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12193 (struct xsettings): Move font inside HAVE_XFT.
12194 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12195 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12196 Move inside HAVE_XFT.
12197 (something_changed_gsettingsCB): Rename from something_changedCB.
12198 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12199 also.
12200 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12201 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12202 (something_changed_gconfCB): Rename from something_changedCB.
12203 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12204 (parse_settings): Move check for font inside HAVE_XFT.
12205 (read_settings, apply_xft_settings): Add comment.
12206 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12207 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12208 call store_font_name_changed.
12209 (xft_settings_event): Add comment.
12210 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12211 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12212 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12213 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12214 (xsettings_initialize): Call init_gsettings last.
12215 (xsettings_get_system_font, xsettings_get_system_normal_font):
12216 Add comment.
12217
12218 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12219
12220 Random fixes. E.g., (random) never returned negative values.
12221 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12222 subseconds part to the entropy, as that's a bit more random.
12223 Prefer signed to unsigned, since the signedness doesn't matter and
12224 in general we prefer signed. When given a limit, use a
12225 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12226 latter isn't right if USE_2_TAGS_FOR_INTS.
12227 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12228 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12229
12230 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12231
12232 * textprop.c (text_property_stickiness):
12233 Obey Vtext_property_default_nonsticky.
12234 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12235 * w32fns.c (syms_of_w32fns):
12236 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12237
12238 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12239
12240 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12241 This is more efficient than Ffile_directory_p and avoids a minor race.
12242
12243 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12244
12245 * buffer.c (Foverlay_put): Say what the return value is
12246 (bug#7835).
12247
12248 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12249 is a directory before asking whether to use the file name
12250 (bug#7564).
12251 (barf_or_query_if_file_exists): Make the "File is a directory"
12252 error be more correct.
12253
12254 * fns.c (Frequire): Remove the mention of the .gz files, since
12255 that's installation-specific, but keep the mention of
12256 `get-load-suffixes'.
12257
12258 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12259
12260 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12261 Report string overflow if the output is too long.
12262
12263 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12264
12265 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12266 (syms_of_gnutls): Remove duplicate DEFSYM for
12267 Qgnutls_bootprop_verify_hostname_error, an error for
12268 Qgnutls_bootprop_verify_error (which is no longer used).
12269
12270 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12271 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12272 Also (re)move comments that are misplaced or no longer relevant.
12273
12274 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12275
12276 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12277
12278 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12279
12280 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12281 and background color parameters if they have been changed.
12282
12283 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12284
12285 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12286
12287 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12288
12289 * xsettings.c (SYSTEM_FONT): Define only when used.
12290 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12291
12292 * keymap.c (access_keymap_1): Now static.
12293
12294 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12295
12296 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12297 leave any prefix arg for the up event (Bug#1586).
12298
12299 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12300
12301 * lread.c (syms_of_lread): Mention single symbols defined by
12302 `defvar' or `defconst' (bug#7154).
12303
12304 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12305 (Frequire): Mention get-load-suffixes.
12306
12307 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12308
12309 * window.h (window): Remove clone_number slot.
12310 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12311 Remove.
12312 (make_parent_window, make_window, saved_window)
12313 (Fset_window_configuration, save_window_save): Don't deal with
12314 clone numbers.
12315 * buffer.c (Qclone_number): Remove declaration.
12316 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12317
12318 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12319
12320 Add multiple inheritance to keymaps.
12321 * keymap.c (Fmake_composed_keymap): New function.
12322 (Fset_keymap_parent): Simplify.
12323 (fix_submap_inheritance): Remove.
12324 (access_keymap_1): New function extracted from access_keymap to handle
12325 embedded parents and handle lists of maps.
12326 (access_keymap): Use it.
12327 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12328 (Fcopy_keymap): Handle embedded parents.
12329 (Fcommand_remapping, define_as_prefix): Simplify.
12330 (Fkey_binding): Simplify.
12331 (syms_of_keymap): Move minibuffer-local-completion-map,
12332 minibuffer-local-filename-completion-map,
12333 minibuffer-local-must-match-map, and
12334 minibuffer-local-filename-must-match-map to Elisp.
12335 (syms_of_keymap): Defsubr make-composed-keymap.
12336 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12337 (parse_menu_item): Trivial simplification.
12338
12339 2011-07-01 Glenn Morris <rgm@gnu.org>
12340
12341 * Makefile.in (SETTINGS_LIBS): Fix typo.
12342
12343 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12344
12345 * coding.c (Fencode_coding_string): Record the last coding system
12346 used, as the function doc string says (bug#8738).
12347
12348 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12349
12350 * xsettings.c (store_monospaced_changed): Take new font as arg and
12351 check for change against current_mono_font.
12352 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12353 (emacs_settings_constructor, emacs_settings_get_property)
12354 (emacs_settings_set_property, emacs_settings_class_init)
12355 (emacs_settings_init, gsettings_obj): Remove.
12356 (something_changedCB): New function for HAVE_GSETTINGS.
12357 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12358 with value as argument.
12359 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12360 g_settings_new (Bug#8967). Do not create gsettings_obj.
12361 Remove calls to g_settings_bind. Connect something_changedCB to
12362 "changed".
12363
12364 * xgselect.c: Add defined (HAVE_GSETTINGS).
12365 (xgselect_initialize): Ditto.
12366
12367 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12368 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12369 xg_select.
12370
12371 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12372
12373 * eval.c (struct backtrace): Simplify and port the data structure.
12374 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12375 signed bit field, as this assumption is not portable and it makes
12376 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12377 "char debug_on_exit : 1" as this is not portable either; instead,
12378 use the portable "unsigned int debug_on_exit : 1". Remove unused
12379 member evalargs. Remove obsolete comments about cc bombing out.
12380
12381 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12382
12383 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12384 Let HAVE_GSETTINGS override HAVE_GCONF.
12385 (store_monospaced_changed): New function.
12386 (EMACS_SETTINGS): A new type derived from GObject to handle
12387 GSettings notifications.
12388 (emacs_settings_constructor, emacs_settings_get_property)
12389 (emacs_settings_set_property, emacs_settings_class_init):
12390 New functions.
12391 (gsettings_client, gsettings_obj): New variables.
12392 (GSETTINGS_SCHEMA): New define.
12393 (something_changedCB): Call store_monospaced_changed.
12394 (init_gsettings): New function.
12395 (xsettings_initialize): Call init_gsettings.
12396 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12397 to NULL.
12398
12399 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12400 GCONF_CFLAGS/LIBS.
12401
12402 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12403
12404 * window.c (resize_root_window, grow_mini_window)
12405 (shrink_mini_window): Rename Qresize_root_window to
12406 Qwindow_resize_root_window and Qresize_root_window_vertically to
12407 Qwindow_resize_root_window_vertically.
12408
12409 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12410
12411 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12412
12413 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12414
12415 * makefile.w32-in: Redesign dependencies so they reflect more
12416 clearly which files are directly included by each source file,
12417 and not through other includes.
12418
12419 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12420
12421 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12422 (sort_overlays, overlay_strings): When an overlay's clone number
12423 matches the window's clone number process the overlay even if
12424 the overlay's window property doesn't match the current window.
12425
12426 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12427 (Fwindow_hchild): Rename to Fwindow_left_child.
12428 (Fwindow_next): Rename to Fwindow_next_sibling.
12429 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12430 (resize_window_check): Rename to window_resize_check.
12431 (resize_window_apply): Rename to window_resize_apply.
12432 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12433 (Fdelete_other_windows_internal, resize_frame_windows)
12434 (Fsplit_window_internal, Fdelete_window_internal)
12435 (grow_mini_window, shrink_mini_window)
12436 (Fresize_mini_window_internal): Fix callers accordingly.
12437
12438 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12439
12440 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12441 (emacs_fixed_set_min_size): Remove.
12442 (emacs_fixed_new): Take frame as argument.
12443
12444 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12445 (_EmacsFixedPrivate): Remove minwidth/height.
12446 Add struct frame *f.
12447 (emacs_fixed_init): Initialize priv->f.
12448 (get_parent_class, emacs_fixed_set_min_size): Remove.
12449 (emacs_fixed_new): Set priv->f to argument.
12450 (emacs_fixed_get_preferred_width)
12451 (emacs_fixed_get_preferred_height): Use min_width/height from
12452 frames size_hint to set minimum and natural (Bug#8919).
12453 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12454 and use min_width/height from frames size_hint to set
12455 min_width/height (Bug#8919).
12456
12457 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12458 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12459 Fix indentation.
12460
12461 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12462
12463 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12464 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12465 called at ZV.
12466
12467 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12468
12469 * process.c (wait_reading_process_output): Bypass select if
12470 waiting for a cell while ignoring keyboard input, and input is
12471 pending. Suggested by Jan Djärv (Bug#8869).
12472
12473 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12474
12475 Use gnulib's dup2 module instead of rolling our own.
12476 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12477
12478 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12479
12480 * dispnew.c (scrolling_window): Before scrolling, turn off a
12481 mouse-highlight in the window being scrolled.
12482
12483 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12484
12485 Move DEFSYM to lisp.h and use everywhere.
12486
12487 * character.h (DEFSYM): Move declaration...
12488 * lisp.h (DEFSYM): ...here.
12489
12490 * gnutls.c:
12491 * minibuf.c:
12492 * w32menu.c:
12493 * w32proc.c:
12494 * w32select.c: Don't include character.h.
12495
12496 * alloc.c (syms_of_alloc):
12497 * buffer.c (syms_of_buffer):
12498 * bytecode.c (syms_of_bytecode):
12499 * callint.c (syms_of_callint):
12500 * casefiddle.c (syms_of_casefiddle):
12501 * casetab.c (init_casetab_once):
12502 * category.c (init_category_once, syms_of_category):
12503 * ccl.c (syms_of_ccl):
12504 * cmds.c (syms_of_cmds):
12505 * composite.c (syms_of_composite):
12506 * dbusbind.c (syms_of_dbusbind):
12507 * dired.c (syms_of_dired):
12508 * dispnew.c (syms_of_display):
12509 * doc.c (syms_of_doc):
12510 * editfns.c (syms_of_editfns):
12511 * emacs.c (syms_of_emacs):
12512 * eval.c (syms_of_eval):
12513 * fileio.c (syms_of_fileio):
12514 * fns.c (syms_of_fns):
12515 * frame.c (syms_of_frame):
12516 * fringe.c (syms_of_fringe):
12517 * insdel.c (syms_of_insdel):
12518 * keymap.c (syms_of_keymap):
12519 * lread.c (init_obarray, syms_of_lread):
12520 * macros.c (syms_of_macros):
12521 * msdos.c (syms_of_msdos):
12522 * print.c (syms_of_print):
12523 * process.c (syms_of_process):
12524 * search.c (syms_of_search):
12525 * sound.c (syms_of_sound):
12526 * syntax.c (init_syntax_once, syms_of_syntax):
12527 * terminal.c (syms_of_terminal):
12528 * textprop.c (syms_of_textprop):
12529 * undo.c (syms_of_undo):
12530 * w32.c (globals_of_w32):
12531 * window.c (syms_of_window):
12532 * xdisp.c (syms_of_xdisp):
12533 * xfaces.c (syms_of_xfaces):
12534 * xfns.c (syms_of_xfns):
12535 * xmenu.c (syms_of_xmenu):
12536 * xsettings.c (syms_of_xsettings):
12537 * xterm.c (syms_of_xterm): Use DEFSYM.
12538
12539 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12540
12541 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12542
12543 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12544
12545 Integer and buffer overflow fixes (Bug#8873).
12546
12547 * print.c (printchar, strout): Check for string overflow.
12548 (PRINTPREPARE, printchar, strout):
12549 Don't set size unless allocation succeeds.
12550
12551 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12552 for sizes. Check for string overflow more accurately.
12553 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12554
12555 * macros.c: Integer and buffer overflow fixes.
12556 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12557 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12558 Use ptrdiff_t, not int, for sizes.
12559 Don't increment bufsize until after realloc succeeds.
12560 Check for size-calculation overflow.
12561 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12562
12563 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12564
12565 * lread.c: Integer overflow fixes.
12566 (read_integer): Radix is now EMACS_INT, not int,
12567 to improve quality of diagnostics for out-of-range radices.
12568 Calculate buffer size correctly for out-of-range radices.
12569 (read1): Check for integer overflow in radices, and in
12570 read-circle numbers.
12571 (read_escape): Avoid int overflow.
12572 (Fload, openp, read_buffer_size, read1)
12573 (substitute_object_recurse, read_vector, read_list, map_obarray):
12574 Use ptrdiff_t, not int, for sizes.
12575 (read1): Use EMACS_INT, not int, for sizes.
12576 Check for size overflow.
12577
12578 * image.c (cache_image): Check for size arithmetic overflow.
12579
12580 * lread.c: Integer overflow issues.
12581 (saved_doc_string_size, saved_doc_string_length)
12582 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12583 Now ptrdiff_t, not int.
12584 (read1): Don't assume doc string length fits in int. Check for
12585 out-of-range doc string lengths.
12586 (read_list): Don't assume file position fits in int.
12587 (read_escape): Check for hex character overflow.
12588
12589 2011-06-22 Leo Liu <sdl.web@gmail.com>
12590
12591 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12592 Move to minibuffer.el.
12593
12594 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12595
12596 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12597 The following patches are for when GLYPH_DEBUG && !XASSERT.
12598 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12599 * dispnew.c (flush_stdout):
12600 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12601 Mark as externally visible.
12602 * dispnew.c (check_window_matrix_pointers): Now static.
12603 * dispnew.c (window_to_frame_vpos):
12604 * xfns.c (unwind_create_frame):
12605 * xterm.c (x_check_font): Remove unused local.
12606 * scroll.c (CHECK_BOUNDS):
12607 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12608 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12609 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12610 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12611 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12612 Now static.
12613 (debug_method_add): Use va_list and vsprintf rather than relying
12614 on undefined behavior with wrong number of arguments.
12615 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12616 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12617 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12618 since we're not interested in debugging glyphs with old libraries.
12619 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12620 GCC 4.6.0's static checking.
12621
12622 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12623
12624 Integer overflow and signedness fixes (Bug#8873).
12625 A few related buffer overrun fixes, too.
12626
12627 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12628
12629 * dispextern.h (struct face.stipple):
12630 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12631 (x_bitmap_mask, x_allocate_bitmap_record)
12632 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12633 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12634 (x_create_bitmap_from_xpm_data):
12635 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12636 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12637 (.bitmaps_last):
12638 * xfaces.c (load_pixmap):
12639 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12640 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12641 (.bitmaps_last, struct x_output.icon_bitmap):
12642 Use ptrdiff_t, not int, for bitmap indexes.
12643 (x_allocate_bitmap_record): Check for size overflow.
12644 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12645
12646 Use ptrdiff_t, not int, for overlay counts.
12647 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12648 * editfns.c (overlays_around, get_pos_property):
12649 * textprop.c (get_char_property_and_overlay):
12650 * xdisp.c (next_overlay_change, note_mouse_highlight):
12651 * xfaces.c (face_at_buffer_position):
12652 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12653 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12654 (Fnext_overlay_change, Fprevious_overlay_change)
12655 (mouse_face_overlay_overlaps, Foverlays_in):
12656 Use ptrdiff_t, not int, for sizes.
12657 (overlays_at, overlays_in): Check for size-calculation overflow.
12658
12659 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12660
12661 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12662 (x_session_initialize): Do not assume string length fits in int.
12663
12664 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12665 This is unlikely, but can occur if DPI is outlandish.
12666
12667 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12668 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12669
12670 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12671 * xrdb.c (magic_file_p, search_magic_path):
12672 Omit last arg SUFFIX; it was always 0. All callers changed.
12673 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12674
12675 * xfont.c (xfont_match): Avoid need for strlen.
12676
12677 * xfns.c: Don't assume strlen fits in int.
12678 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12679
12680 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12681 not unsigned long, as we prefer signed integers. All callers changed.
12682 Detect integer overflow in repeat count.
12683 (message_dolog): Don't assume print length fits in 39 bytes.
12684 (display_mode_element): Don't assume strlen fits in int.
12685
12686 * termcap.c: Don't assume sizes fit in int and never overflow.
12687 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12688 (gobble_line): Check for size-calculation overflow.
12689
12690 * minibuf.c (Fread_buffer):
12691 * lread.c (intern, intern_c_string):
12692 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12693 Don't assume string length fits in int.
12694
12695 * keyboard.c (parse_tool_bar_item):
12696 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12697
12698 * font.c: Don't assume string length fits in int.
12699 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12700 Use ptrdiff_t, not int.
12701 (font_intern_prop): Don't assume string length fits in int.
12702 Don't assume integer property fits in fixnum.
12703 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12704
12705 * filelock.c: Fix some buffer overrun and integer overflow issues.
12706 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12707 Reformulate so as not to need the command string.
12708 Invoke gzip -cd rather than gunzip, as it's more portable.
12709 (lock_info_type, lock_file_1, lock_file):
12710 Don't assume pid_t and time_t fit in unsigned long.
12711 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12712 (current_lock_owner): Prefer signed type for sizes.
12713 Use memcpy, not strncpy, where memcpy is what is really wanted.
12714 Don't assume (via atoi) that time_t and pid_t fit in int.
12715 Check for time_t and/or pid_t out of range, e.g., via a network share.
12716 Don't alloca where an auto var works fine.
12717
12718 * fileio.c: Fix some integer overflow issues.
12719 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12720 Don't assume string length fits in int.
12721 (directory_file_name): Don't assume string length fits in long.
12722 (make_temp_name): Don't assume pid fits in int, or that its print
12723 length is less than 20.
12724
12725 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12726
12727 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12728
12729 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12730
12731 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12732 We prefer signed integers, even for size calculations.
12733
12734 * emacs.c: Don't assume string length fits in 'int'.
12735 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12736 (main): Don't invoke strlen when not needed.
12737
12738 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12739 (XD_DEBUG_MESSAGE): Don't waste a byte.
12740
12741 * callproc.c (getenv_internal_1, getenv_internal)
12742 (Fgetenv_internal):
12743 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12744
12745 * lread.c (invalid_syntax): Omit length argument.
12746 All uses changed. This doesn't fix a bug, but it simplifies the
12747 code away from its former Hollerith-constant appearance, and it's
12748 one less 'int' to worry about when looking at integer-overflow issues.
12749 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12750
12751 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12752 This didn't break anything, but it didn't help either.
12753 It's confusing to put a bogus integer in a place where the actual
12754 value does not matter.
12755 (LIST_END_P): Remove unused macro and its bogus comment.
12756 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12757
12758 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12759 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12760 implementation.
12761 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12762 We prefer signed types, and the value cannot exceed the EMACS_INT
12763 range anyway (because otherwise the length would not be representable).
12764 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12765 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12766 This avoids a GCC warning when WIDE_EMACS_INT.
12767
12768 * indent.c (sane_tab_width): New function.
12769 (current_column, scan_for_column, Findent_to, position_indentation)
12770 (compute_motion): Use it. This is just for clarity.
12771 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12772
12773 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12774
12775 * lisp.h (lint_assume): New macro.
12776 * composite.c (composition_gstring_put_cache):
12777 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12778
12779 * editfns.c, insdel.c:
12780 Omit unnecessary forward decls, to simplify future changes.
12781
12782 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12783
12784 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12785
12786 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12787 Use much-faster test for byte-length change.
12788 Don't assume string byte-length fits in 'int'.
12789 Check that character arg fits in 'int'.
12790 (mapcar1): Declare byte as byte, for clarity.
12791
12792 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12793
12794 * fns.c (concat): Catch string overflow earlier.
12795 Do not rely on integer wraparound.
12796
12797 * dispextern.h (struct it.overlay_strings_charpos)
12798 (struct it.selective): Now EMACS_INT, not int.
12799 * xdisp.c (forward_to_next_line_start)
12800 (back_to_previous_visible_line_start)
12801 (reseat_at_next_visible_line_start, next_element_from_buffer):
12802 Don't arbitrarily truncate the value of 'selective' to int.
12803
12804 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12805
12806 * composite.c: Don't truncate sizes to 'int'.
12807 (composition_gstring_p, composition_reseat_it)
12808 (composition_adjust_point): Use EMACS_INT, not int.
12809 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12810 not EMACS_UINT, for indexes.
12811
12812 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12813
12814 * buffer.c: Include <verify.h>.
12815 (struct sortvec.priority, struct sortstr.priority):
12816 Now EMACS_INT, not int.
12817 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12818 (struct sortstr.size, record_overlay_string)
12819 (struct sortstrlist.size, struct sortlist.used):
12820 Don't truncate size to int.
12821 (record_overlay_string): Check for size-calculation overflow.
12822 (init_buffer_once): Check at compile-time, not run-time.
12823
12824 2011-06-22 Jim Meyering <meyering@redhat.com>
12825
12826 Don't leak an XBM-image-sized buffer
12827 * image.c (xbm_load): Free the image buffer after using it.
12828
12829 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12830
12831 Port to Sun C.
12832 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12833 that Sun C diagnosed.
12834 * fns.c (secure_hash): Fix pointer signedness issue.
12835 * intervals.c (static_offset_intervals): New function.
12836 (offset_intervals): Use it.
12837
12838 2011-06-21 Leo Liu <sdl.web@gmail.com>
12839
12840 * deps.mk (fns.o):
12841 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12842 sha512.h.
12843
12844 * fns.c (secure_hash): Rename from crypto_hash_function and change
12845 the first arg to accept symbols.
12846 (Fsecure_hash): New primitive.
12847 (syms_of_fns): New symbols.
12848
12849 2011-06-20 Deniz Dogan <deniz@dogan.se>
12850
12851 * process.c (Fset_process_buffer): Clarify return value in
12852 docstring.
12853
12854 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12855
12856 * dispnew.c (add_window_display_history): Use BVAR.
12857
12858 * xdisp.c (debug_method_add): Use BVAR.
12859 (check_window_end, dump_glyph_matrix, dump_glyph)
12860 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12861
12862 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12863 Likewise.
12864
12865 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12866 check till after the cache is created in init_frame_faces.
12867
12868 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12869
12870 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12871
12872 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12873
12874 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12875 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12876 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12877
12878 Improve buffer-overflow checking (Bug#8873).
12879 * fileio.c (Finsert_file_contents):
12880 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12881 Remove the old (too-loose) buffer overflow checks.
12882 They weren't needed, since make_gap checks for buffer overflow.
12883 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12884 The old code merely checked for Emacs fixnum overflow, and relied
12885 on undefined (wraparound) behavior. The new code avoids undefined
12886 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12887
12888 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12889 Tune. Don't use wider integers than needed. Don't use alloca.
12890 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12891
12892 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12893
12894 * insdel.c, lisp.h (buffer_overflow): New function.
12895 (insert_from_buffer_1, replace_range, replace_range_2):
12896 * insdel.c (make_gap_larger):
12897 * editfns.c (Finsert_char):
12898 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12899
12900 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12901
12902 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12903
12904 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12905
12906 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12907 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12908
12909 * fileio.c: Don't assume EMACS_INT fits in off_t.
12910 (emacs_lseek): New static function.
12911 (Finsert_file_contents, Fwrite_region): Use it.
12912 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12913
12914 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12915
12916 * fns.c: Don't overflow int when computing a list length.
12917 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12918 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12919 truncation on 64-bit hosts. Check for QUIT every
12920 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12921 faster and is responsive enough.
12922 (Flength): Report an error instead of overflowing an integer.
12923 (Fsafe_length): Return a float if the value is not representable
12924 as a fixnum. This shouldn't happen except in contrived situations.
12925 (Fnthcdr, Fsort): Don't assume list length fits in int.
12926 (Fcopy_sequence): Don't assume vector length fits in int.
12927
12928 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12929 (header_size, word_size): New constants.
12930 (allocate_vectorlike): Don't check size overflow here.
12931 (allocate_vector): Check it here instead, since this is the only
12932 caller of allocate_vectorlike that could cause overflow.
12933 Check that the new vector's length is representable as a fixnum.
12934
12935 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12936 The previous code was bogus. For example, next_almost_prime (32)
12937 returned 39, which is undesirable as it is a multiple of 3; and
12938 next_almost_prime (24) returned 25, which is a multiple of 5 so
12939 why was the code bothering to check for multiples of 7?
12940
12941 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12942
12943 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12944
12945 Variadic C functions now count arguments with ptrdiff_t.
12946 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12947 Back then I didn't know that the Emacs coding style prefers signed int.
12948 Also, in the meantime I found a few more instances where arguments
12949 were being counted with int, which may truncate counts on 64-bit
12950 machines, or EMACS_INT, which may be unnecessarily wide.
12951 * lisp.h (struct Lisp_Subr.function.aMANY)
12952 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12953 Arg counts are now ptrdiff_t, not size_t.
12954 All variadic functions and their callers changed accordingly.
12955 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12956 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12957 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12958 * callint.c (Fcall_interactively): Check arg count for overflow,
12959 to avoid potential buffer overrun. Use signed char, not 'int',
12960 for 'varies' array, so that we needn't bother to check its size
12961 calculation for overflow.
12962 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12963 * eval.c (apply_lambda):
12964 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12965 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12966 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12967
12968 * callint.c (Fcall_interactively): Don't use index var as event count.
12969
12970 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12971 * mem-limits.h (SIZE): Remove; no longer used.
12972
12973 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12974
12975 Remove unnecessary casts.
12976 * xterm.c (x_term_init):
12977 * xfns.c (x_set_border_pixel):
12978 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12979 These aren't needed now that we assume ANSI C.
12980
12981 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12982 It's more likely to cause problems (due to unsigned overflow)
12983 than to cure them.
12984
12985 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12986
12987 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12988
12989 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12990
12991 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12992
12993 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12994
12995 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12996
12997 GLYPH_CODE_FACE returns EMACS_INT, not int.
12998 * dispextern.h (merge_faces):
12999 * xfaces.c (merge_faces):
13000 * xdisp.c (get_next_display_element, next_element_from_display_vector):
13001 Don't assume EMACS_INT fits in int.
13002
13003 * character.h (CHAR_VALID_P): Remove unused parameter.
13004 * fontset.c, lisp.h, xdisp.c: All uses changed.
13005
13006 * editfns.c (Ftranslate_region_internal): Omit redundant test.
13007
13008 * fns.c (concat): Minor tuning based on overflow analysis.
13009 This doesn't fix any bugs. Use int to hold character, instead
13010 of constantly refetching from Emacs object. Use XFASTINT, not
13011 XINT, for value known to be a character. Don't bother comparing
13012 a single byte to 0400, as it's always less.
13013
13014 * floatfns.c (Fexpt):
13015 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
13016
13017 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
13018 for characters.
13019
13020 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13021
13022 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13023 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13024 incorrectly succeed when S was a string, because 4294967386 was
13025 truncated before it was used.
13026
13027 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13028 Otherwise, an out-of-range integer could cause undefined behavior
13029 on a 64-bit host.
13030
13031 * composite.c: Use int, not EMACS_INT, for characters.
13032 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13033 EMACS_INT, for values that are known to be in character range.
13034 This doesn't fix any bugs but is the usual style inside Emacs and
13035 may generate better code on 32-bit machines.
13036
13037 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13038 This is for reasons similar to the recent CHAR_STRING fix.
13039 * charset.c (Fencode_char): Check that character arg is actually
13040 a character. Pass an int to ENCODE_CHAR.
13041 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13042 wider than 'int', as a compile-time check to prevent future regressions
13043 in this area.
13044
13045 * character.c (char_string): Remove unnecessary casts.
13046
13047 Make sure a 64-bit char is never passed to CHAR_STRING.
13048 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13049 by silently ignoring the top 32 bits, allowing some values
13050 that were far too large to be valid characters.
13051 * character.h: Include <verify.h>.
13052 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13053 arguments are no wider than unsigned, as a compile-time check
13054 to prevent future regressions in this area.
13055 * data.c (Faset):
13056 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13057 (Fsubst_char_in_region):
13058 * fns.c (concat):
13059 * xdisp.c (decode_mode_spec_coding):
13060 Adjust to CHAR_STRING's new requirement.
13061 * editfns.c (Finsert_char, Fsubst_char_in_region):
13062 * fns.c (concat): Check that character args are actually
13063 characters. Without this test, these functions did the wrong
13064 thing with wildly out-of-range values on 64-bit hosts.
13065
13066 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13067 These casts should not be needed on 32-bit hosts, either.
13068 * keyboard.c (read_char):
13069 * lread.c (Fload): Remove casts to unsigned.
13070
13071 * lisp.h (UNSIGNED_CMP): New macro.
13072 This fixes comparison bugs on 64-bit hosts.
13073 (ASCII_CHAR_P): Use it.
13074 * casefiddle.c (casify_object):
13075 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13076 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13077 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13078 * dispextern.h (FACE_FROM_ID):
13079 * keyboard.c (read_char): Use UNSIGNED_CMP.
13080
13081 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13082 not to EMACS_INT, to avoid GCC warning.
13083
13084 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13085
13086 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13087 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13088 isn't needed on 32-bit machines.
13089
13090 * buffer.c (Fgenerate_new_buffer_name):
13091 Use EMACS_INT for count, not int.
13092 (advance_to_char_boundary): Return EMACS_INT, not int.
13093
13094 * data.c (Qcompiled_function): Now static.
13095
13096 * window.c (window_body_lines): Now static.
13097
13098 * image.c (gif_load): Rename local to avoid shadowing.
13099
13100 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13101 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13102 * alloc.c (make_save_value): Integer argument is now of type
13103 ptrdiff_t, not int.
13104 (mark_object): Use ptrdiff_t, not int.
13105 * lisp.h (pD): New macro.
13106 * print.c (print_object): Use it.
13107
13108 * alloc.c: Use EMACS_INT, not int, to count objects.
13109 (total_conses, total_markers, total_symbols, total_vector_size)
13110 (total_free_conses, total_free_markers, total_free_symbols)
13111 (total_free_floats, total_floats, total_free_intervals)
13112 (total_intervals, total_strings, total_free_strings):
13113 Now EMACS_INT, not int. All uses changed.
13114 (Fgarbage_collect): Compute overall total using a double, so that
13115 integer overflow is less likely to be a problem. Check for overflow
13116 when converting back to an integer.
13117 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13118 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13119 These were 'int' variables that could overflow on 64-bit hosts;
13120 they were never used, so remove them instead of repairing them.
13121 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13122 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13123 Previously, this ceilinged at INT_MAX, but that doesn't work on
13124 64-bit machines.
13125 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13126
13127 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13128 (allocate_vectorlike): Check for ptrdiff_t overflow.
13129 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13130 when a (possibly-narrower) signed value would do just as well.
13131 We prefer using signed arithmetic, to avoid comparison confusion.
13132
13133 * alloc.c: Catch some string size overflows that we were missing.
13134 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13135 for convenience in STRING_BYTES_MAX.
13136 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13137 The definition here is exact; the one in lisp.h was approximate.
13138 (allocate_string_data): Check for string overflow. This catches
13139 some instances we weren't catching before. Also, it catches
13140 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13141 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13142 and ptrdiff_t and EMACS_INT are both 64 bits.
13143
13144 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13145 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13146 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13147
13148 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13149
13150 * alloc.c (Fmake_string): Check for out-of-range init.
13151
13152 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13153
13154 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13155
13156 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13157
13158 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13159 xg_get_default_scrollbar_width.
13160
13161 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13162 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13163 (style_changed_cb): Call update_theme_scrollbar_width and call
13164 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13165 all frames (Bug#8505).
13166 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13167 Call gtk_window_set_resizable if HAVE_GTK3.
13168 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13169 and height if HAVE_GTK3 (Bug#8505).
13170 (scroll_bar_width_for_theme): New variable.
13171 (update_theme_scrollbar_width): New function.
13172 (xg_get_default_scrollbar_width): Move code to
13173 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13174 (xg_initialize): Call update_theme_scrollbar_width.
13175
13176 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13177
13178 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13179
13180 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13181
13182 * frame.c (make_frame): Call other_buffer_safely instead of
13183 other_buffer.
13184
13185 * window.c (temp_output_buffer_show): Call display_buffer with
13186 second argument Vtemp_buffer_show_specifiers and reset latter
13187 immediately after the call.
13188 (Vtemp_buffer_show_specifiers): New variable.
13189 (auto_window_vscroll_p, next_screen_context_lines)
13190 (Vscroll_preserve_screen_position): Remove leading asterisks from
13191 doc-strings.
13192
13193 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13194
13195 Fix minor problems found by GCC 4.6.0 static checking.
13196 * buffer.c (Qclone_number): Remove for now, as it's unused.
13197 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13198 (record_buffer): Remove unused local.
13199 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13200 (set_frame_buffer_list): Remove; unused.
13201 * frame.h (other_visible_frames): Remove decl.
13202 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13203 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13204 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13205 if HAVE_GPM.
13206 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13207 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13208 Define only if HAVE_GPM.
13209 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13210 (update_hints_inhibit): Remove; never set. All uses removed.
13211 * widgetprv.h (emacsFrameClassRec): Remove decl.
13212 * window.c (delete_deletable_window): Now returns void, since it
13213 wasn't returning anything.
13214 (compare_window_configurations): Remove unused locals.
13215 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13216 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13217 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13218 the same widths as pointers. This follows up on the 2011-05-06 patch.
13219 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13220 * xterm.h: Likewise.
13221 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13222
13223 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13224
13225 * makefile.w32-in: Update dependencies.
13226 (LISP_H): Add lib/intprops.h.
13227
13228 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13229
13230 * image.c (gif_load): Add animation frame delay to the metadata.
13231 (syms_of_image): Use DEFSYM. New symbol `delay'.
13232
13233 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13234
13235 * window.c (delete_deletable_window): Re-add.
13236 (Fset_window_configuration): Rewrite to handle dead buffers and
13237 consequently deletable windows.
13238 (window_tree, Fwindow_tree): Remove. Supply functionality in
13239 window.el.
13240 (compare_window_configurations): Simplify code.
13241
13242 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13243
13244 * image.c (imagemagick_load_image): Fix type mismatch.
13245 (Fimagemagick_types): Likewise.
13246
13247 * window.h (replace_buffer_in_windows): Declare.
13248
13249 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13250
13251 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13252 Qclone_number. Remove external declaration of Qdelete_window.
13253 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13254 code.
13255 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13256 Run Qbuffer_list_update_hook if allowed.
13257 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13258 buffer list implementation.
13259 (other_buffer_safely): New function.
13260 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13261 calls to replace_buffer_in_windows and
13262 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13263 if allowed.
13264 (record_buffer): Inhibit quitting and rewrite using quittable
13265 functions. Run Qbuffer_list_update_hook if allowed.
13266 (Frecord_buffer, Funrecord_buffer): New functions.
13267 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13268 Move switch-to-buffer to window.el.
13269 (bury-buffer): Move to window.el.
13270 (Vbuffer_list_update_hook): New variable.
13271
13272 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13273 section.
13274
13275 * window.h (resize_frame_windows): Move up in code.
13276 (Fwindow_frame): Remove EXFUN.
13277 (replace_buffer_in_all_windows): Remove prototype.
13278 (replace_buffer_in_windows_safely): Add prototype.
13279
13280 * window.c: Declare Qdelete_window static again. Move down
13281 declaration of select_count.
13282 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13283 (Fother_window): Move to window.el.
13284 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13285 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13286 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13287 window.el.
13288 (replace_buffer_in_windows): Implement by calling
13289 Qreplace_buffer_in_windows.
13290 (replace_buffer_in_all_windows): Remove with some functionality
13291 moved into replace_buffer_in_windows_safely.
13292 (replace_buffer_in_windows_safely): New function.
13293 (select_window_norecord, select_frame_norecord): Move in front
13294 of run_window_configuration_change_hook. Remove now obsolete
13295 declarations.
13296 (Fset_window_buffer): Rewrite doc-string.
13297 Call Qrecord_window_buffer.
13298 (keys_of_window): Move binding for other-window to window.el.
13299
13300 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13301
13302 * dispextern.h (struct image): Replace data member, whose int_val
13303 and ptr_val fields were not used by anything, with a single
13304 lisp_val object.
13305
13306 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13307 (gif_clear_image, gif_load, imagemagick_load_image)
13308 (gs_clear_image, gs_load): Callers changed.
13309
13310 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13311
13312 * buffer.h: Include <time.h>, for time_t.
13313 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13314
13315 Fix minor problems found by static checking.
13316
13317 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13318
13319 Make identifiers static if they are not used in other modules.
13320 * data.c (Qcompiled_function, Qframe, Qvector):
13321 * image.c (QimageMagick, Qsvg):
13322 * minibuf.c (Qmetadata):
13323 * window.c (resize_window_check, resize_root_window): Now static.
13324 * window.h (resize_window_check, resize_root_window): Remove decls.
13325
13326 * window.c (window_deletion_count, delete_deletable_window):
13327 Remove; unused.
13328 (window_body_lines): Now static.
13329 (Fdelete_other_windows_internal): Mark vars as initialized.
13330 Make sure 'resize_failed' is initialized.
13331 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13332 (resize_window_apply): Remove unused local.
13333 * window.h (delete_deletable_window): Remove decl.
13334
13335 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13336 (imagemagick_load_image): Fix pointer signedness problem by changing
13337 last arg from unsigned char * to char *. All uses changed.
13338 Also, fix a local for similar reasons.
13339 Remove unused locals. Remove locals to avoid shadowing.
13340 (fn_rsvg_handle_free): Remove; unused.
13341 (svg_load, svg_load_image): Fix pointer signedness problem.
13342 (imagemagick_load_image): Don't use garbage pointer image_wand.
13343
13344 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13345
13346 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13347
13348 * image.c (gif_load): Fix omitted cast error introduced by
13349 2011-06-06 change.
13350
13351 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13352
13353 * window.h (resize_proportionally, orig_total_lines)
13354 (orig_top_line): Remove from window structure.
13355 (set_window_height, set_window_width, change_window_heights)
13356 (Fdelete_window): Remove prototypes.
13357 (resize_frame_windows): Remove duplicate declaration.
13358
13359 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13360
13361 * window.h (resize_frame_windows, resize_window_check)
13362 (delete_deletable_window, resize_root_window)
13363 (resize_frame_windows): Declare prototypes.
13364
13365 * window.c (resize_window_apply): Make definition be "static" to
13366 match the prototype.
13367
13368 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13369
13370 * window.c: Remove declarations of Qwindow_size_fixed,
13371 window_min_size_1, window_min_size_2, window_min_size,
13372 size_window, window_fixed_size_p, enlarge_window, delete_window.
13373 Remove static from declaration of Qdelete_window, it's
13374 temporarily needed by Fbury_buffer.
13375 (replace_window): Don't assign orig_top_line and
13376 orig_total_lines.
13377 (Fdelete_window, delete_window): Remove. Window deletion is
13378 handled by window.el.
13379 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13380 Replace Fdelete_window calls with calls to Qdelete_window.
13381 (Fdelete_other_windows): Remove. Deleting other windows is
13382 handled by window.el.
13383 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13384 handled in window.el.
13385 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13386 Window minimum sizes are handled in window.el.
13387 (shrink_windows, size_window, set_window_height)
13388 (set_window_width, change_window_heights, window_height)
13389 (window_width, CURBEG, CURSIZE, enlarge_window)
13390 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13391 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13392 handled in window.el.
13393 (make_dummy_parent): Rename to make_parent_window and give it a
13394 second argument horflag.
13395 (make_window): Don't set resize_proportionally any more.
13396 (Fsplit_window): Remove. Windows are split in window.el.
13397 (save_restore_action, save_restore_orig_size)
13398 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13399 Resize mini windows in window.el.
13400 (grow_mini_window, shrink_mini_window): Implement by calling
13401 Qresize_root_window_vertically, resize_window_check and
13402 resize_window_apply.
13403 (saved_window, Fset_window_configuration, save_window_save):
13404 Do not handle orig_top_line, orig_total_lines, and
13405 resize_proportionally.
13406 (window_min_height, window_min_width): Move to window.el.
13407 (keys_of_window): Move bindings for delete-other-windows,
13408 split-window, delete-window and enlarge-window to window.el.
13409
13410 * buffer.c: Temporarily extern Qdelete_window.
13411 (Fbury_buffer): Temporarily call Qdelete_window instead of
13412 Fdelete_window (Fbury_buffer will move to window.el soon).
13413
13414 * frame.c (set_menu_bar_lines_1): Remove code handling
13415 orig_top_line and orig_total_lines.
13416
13417 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13418 set_window_height but set heights directly.
13419 (change_frame_size_1): Use resize_frame_windows.
13420
13421 * xdisp.c (init_xdisp): Don't use set_window_height but set
13422 heights directly.
13423
13424 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13425 Use resize_frame_windows instead of change_window_heights and run
13426 run_window_configuration_change_hook.
13427
13428 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13429 instead of change_window_heights and run
13430 run_window_configuration_change_hook.
13431
13432 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13433
13434 * window.c (replace_window): Rename second argument REPLACEMENT to
13435 NEW. New third argument SETFLAG. Rewrite.
13436 (delete_window, make_dummy_parent): Call replace_window with
13437 third argument 1.
13438 (window_list_1): Move down in code.
13439 (run_window_configuration_change_hook): Move set_buffer part
13440 before select_frame_norecord part in order to unwind correctly.
13441 Rename count1 to count.
13442 (recombine_windows, delete_deletable_window, resize_root_window)
13443 (Fdelete_other_windows_internal)
13444 (Frun_window_configuration_change_hook, make_parent_window)
13445 (resize_window_check, resize_window_apply, Fresize_window_apply)
13446 (resize_frame_windows, Fsplit_window_internal)
13447 (Fdelete_window_internal, Fresize_mini_window_internal):
13448 New functions.
13449 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13450
13451 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13452
13453 * window.h (window): Add some new members to window structure -
13454 normal_lines, normal_cols, new_total, new_normal, clone_number,
13455 splits, nest, prev_buffers, next_buffers.
13456 (WINDOW_TOTAL_SIZE): Move here from window.c.
13457 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13458
13459 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13460 Remove.
13461 (make_dummy_parent): Set new members of windows structure.
13462 (make_window): Move down in code. Handle new members of window
13463 structure.
13464 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13465 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13466 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13467 (Fset_window_prev_buffers, Fwindow_next_buffers)
13468 (Fset_window_next_buffers, Fset_window_clone_number):
13469 New functions.
13470 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13471 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13472 Doc-string fixes.
13473 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13474 Argument WINDOW can be now internal window too.
13475 (Fwindow_use_time): Move up in code.
13476 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13477 Rewrite doc-string.
13478 (Fset_window_configuration, saved_window)
13479 (Fcurrent_window_configuration, save_window_save): Handle new
13480 members of window structure.
13481 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13482 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13483 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13484 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13485 Qget_mru_window, Qresize_root_window,
13486 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13487 Qauto_buffer_name; staticpro them.
13488
13489 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13490
13491 * window.c (Fwindow_total_size, Fwindow_left_column)
13492 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13493 (Fwindow_list_1): New functions.
13494 (window_box_text_cols): Replace with window_body_cols.
13495 (Fwindow_width, Fscroll_left, Fscroll_right):
13496 Use window_body_cols instead of window_box_text_cols.
13497 (delete_window, Fset_window_configuration):
13498 Call delete_all_subwindows with window as argument.
13499 (delete_all_subwindows): Take a window as argument and not a
13500 structure. Rewrite.
13501 (window_loop): Remove handling of GET_LRU_WINDOW and
13502 GET_LARGEST_WINDOW.
13503 (Fget_lru_window, Fget_largest_window): Move to window.el.
13504
13505 * window.h: Extern window_body_cols instead of
13506 window_box_text_cols. delete_all_subwindows now takes a
13507 Lisp_Object as argument.
13508
13509 * indent.c (compute_motion, Fcompute_motion):
13510 Use window_body_cols instead of window_box_text_cols.
13511
13512 * frame.c (delete_frame): Call delete_all_subwindows with root
13513 window as argument.
13514
13515 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13516
13517 * fns.c (Fputhash): Document return value.
13518
13519 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13520
13521 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13522
13523 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13524
13525 Cons<->int and similar integer overflow fixes (Bug#8794).
13526
13527 Check for overflow when converting integer to cons and back.
13528 * charset.c (Fdefine_charset_internal, Fdecode_char):
13529 Use cons_to_unsigned to catch overflow.
13530 (Fencode_char): Use INTEGER_TO_CONS.
13531 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13532 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13533 * data.c (long_to_cons, cons_to_long): Remove.
13534 (cons_to_unsigned, cons_to_signed): New functions.
13535 These signal an error for invalid or out-of-range values.
13536 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13537 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13538 * font.c (Ffont_variation_glyphs):
13539 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13540 * lisp.h: Include <intprops.h>.
13541 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13542 (cons_to_signed, cons_to_unsigned): New decls.
13543 (long_to_cons, cons_to_long): Remove decls.
13544 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13545 (Fprimitive_undo): Use CONS_TO_INTEGER.
13546 * xfns.c (Fx_window_property): Likewise.
13547 * xselect.c: Include <limits.h>.
13548 (x_own_selection, selection_data_to_lisp_data):
13549 Use INTEGER_TO_CONS.
13550 (x_handle_selection_request, x_handle_selection_clear)
13551 (x_get_foreign_selection, Fx_disown_selection_internal)
13552 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13553 (lisp_data_to_selection_data): Use cons_to_unsigned.
13554 (x_fill_property_data): Use cons_to_signed.
13555 Report values out of range.
13556
13557 Check for buffer and string overflow more precisely.
13558 * buffer.h (BUF_BYTES_MAX): New macro.
13559 * lisp.h (STRING_BYTES_MAX): New macro.
13560 * alloc.c (Fmake_string):
13561 * character.c (string_escape_byte8):
13562 * coding.c (coding_alloc_by_realloc):
13563 * doprnt.c (doprnt):
13564 * editfns.c (Fformat):
13565 * eval.c (verror):
13566 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13567 since they may not be the same number.
13568 * editfns.c (Finsert_char):
13569 * fileio.c (Finsert_file_contents):
13570 Likewise for BUF_BYTES_MAX.
13571
13572 * image.c: Use ptrdiff_t, not int, for sizes.
13573 (slurp_file): Switch from int to ptrdiff_t.
13574 All uses changed.
13575 (slurp_file): Check that file size fits in both size_t (for
13576 malloc) and ptrdiff_t (for sanity and safety).
13577
13578 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13579 if b->modtime has its maximal value.
13580
13581 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13582
13583 Don't assume time_t can fit into int.
13584 * buffer.h (struct buffer.modtime): Now time_t, not int.
13585 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13586 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13587
13588 Minor fixes for signed vs unsigned integers.
13589 * character.h (MAYBE_UNIFY_CHAR):
13590 * charset.c (maybe_unify_char):
13591 * keyboard.c (read_char, reorder_modifiers):
13592 XINT -> XFASTINT, since the integer must be nonnegative.
13593 * ftfont.c (ftfont_spec_pattern):
13594 * keymap.c (access_keymap, silly_event_symbol_error):
13595 XUINT -> XFASTINT, since the integer must be nonnegative.
13596 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13597 since it makes no difference and we prefer signed.
13598 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13599 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13600 nonnegative.
13601
13602 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13603
13604 * window.h (Fwindow_frame): Declare.
13605
13606 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13607
13608 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13609 (SPARE_MEMORY): Always define.
13610 (LARGE_REQUEST): Remove.
13611 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13612
13613 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13614
13615 * lisp.h: Move EXFUNS for Fframe_root_window,
13616 Fframe_first_window and Fset_frame_selected_window to window.h.
13617
13618 * window.h: Move EXFUNS for Fframe_root_window,
13619 Fframe_first_window and Fset_frame_selected_window here from
13620 lisp.h.
13621
13622 * frame.c (Fwindow_frame, Fframe_first_window)
13623 (Fframe_root_window, Fframe_selected_window)
13624 (Fset_frame_selected_window): Move to window.c.
13625 (Factive_minibuffer_window): Move to minibuf.c.
13626 (Fother_visible_frames_p): New function.
13627
13628 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13629
13630 * window.c (decode_window, decode_any_window): Move up in code.
13631 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13632 (inhibit_frame_unsplittable): Remove unused variable.
13633 (Fwindow_buffer): Move up and rewrite doc-string.
13634 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13635 (Fwindow_prev): New functions.
13636 (Fwindow_frame): Move here from frame.c. Accept any window as
13637 argument.
13638 (Fframe_root_window, Fframe_first_window)
13639 (Fframe_selected_window): Move here from frame.c. Accept frame
13640 or arbitrary window as argument. Update doc-strings.
13641 (Fminibuffer_window): Move up in code.
13642 (Fwindow_minibuffer_p): Move up in code and simplify.
13643 (Fset_frame_selected_window): Move here from frame.c.
13644 Marginal rewrite.
13645 (Fselected_window, select_window, Fselect_window): Move up in
13646 code. Minor doc-string fixes.
13647
13648 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13649
13650 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13651 Do not assume that spare memory exists; that assumption is valid
13652 only if SYSTEM_MALLOC.
13653 (LARGE_REQUEST): New macro, so that the issue of large requests
13654 is separated from the issue of spare memory.
13655
13656 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13657
13658 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13659 format. (Bug#8806)
13660
13661 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13662
13663 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13664 before statements.
13665
13666 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13667
13668 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13669
13670 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13671
13672 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13673 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13674
13675 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13676
13677 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13678
13679 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13680
13681 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13682 (x_clipboard_manager_save): Add return value.
13683 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13684 New error handlers.
13685 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13686 Obey Vx_select_enable_clipboard_manager. Catch errors in
13687 x_clipboard_manager_save (Bug#8779).
13688 (Vx_select_enable_clipboard_manager): New variable.
13689 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13690
13691 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13692
13693 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13694
13695 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13696
13697 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13698 in the current matrix if keep_current_p is non-zero.
13699
13700 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13701
13702 * bidi.c (bidi_level_of_next_char): Fix last change.
13703
13704 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13705
13706 Support bidi reordering of text covered by display properties.
13707
13708 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13709 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13710 (bidi_cache_search, bidi_cache_iterator_state)
13711 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13712 (bidi_level_of_next_char, bidi_move_to_visually_next):
13713 Support character positions inside a run of characters covered by a
13714 display string.
13715 (bidi_paragraph_init, bidi_resolve_explicit_1)
13716 (bidi_level_of_next_char): Call bidi_fetch_char and
13717 bidi_fetch_char_advance instead of FETCH_CHAR and
13718 FETCH_CHAR_ADVANCE.
13719 (bidi_init_it): Initialize new members.
13720 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13721 definitions.
13722 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13723 instead of using explicit *_CHAR codes.
13724 (bidi_resolve_explicit, bidi_resolve_weak):
13725 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13726 bidirectional text is supported only in multibyte buffers.
13727 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13728 it to initialize the frame_window_p member of struct bidi_it.
13729 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13730 (bidi_resolve_explicit, bidi_resolve_weak)
13731 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13732 bidi_it->nchars is non-positive.
13733 (bidi_level_of_next_char): Don't try to lookup the cache for the
13734 next/previous character if nothing is cached there yet, or if we
13735 were just reseat()'ed to a new position.
13736
13737 * xdisp.c (set_cursor_from_row): Set start and stop points
13738 according to the row's direction when priming the loop that looks
13739 for the glyph on which to display cursor.
13740 (single_display_spec_intangible_p): Function deleted.
13741 (display_prop_intangible_p): Reimplement to call
13742 handle_display_spec instead of single_display_spec_intangible_p.
13743 Accept 3 additional arguments needed by handle_display_spec.
13744 This fixes incorrect cursor motion across display property with complex
13745 values: lists, `(when COND...)' forms, etc.
13746 (single_display_spec_string_p): Support property values that are
13747 lists with the argument STRING its top-level element.
13748 (display_prop_string_p): Fix the condition for processing a
13749 property that is a list to be consistent with handle_display_spec.
13750 (handle_display_spec): New function, refactored from the
13751 last portion of handle_display_prop.
13752 (compute_display_string_pos): Accept additional argument
13753 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13754 value of a `display' property is a "replacing spec".
13755 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13756 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13757 the display property, but just return a value indicating whether
13758 the display property will replace the characters it covers.
13759 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13760 frame_window_p members of struct bidi_it.
13761 (compute_display_string_pos, compute_display_string_end):
13762 New functions.
13763 (push_it): Accept second argument POSITION, where pop_it should
13764 jump to continue iteration.
13765 (reseat_1): Initialize bidi_it.disp_pos.
13766
13767 * keyboard.c (adjust_point_for_property): Adjust the call to
13768 display_prop_intangible_p to its new signature.
13769
13770 * dispextern.h (struct bidi_it): New member frame_window_p.
13771 (bidi_init_it): Update prototypes.
13772 (display_prop_intangible_p): Update prototype.
13773 (compute_display_string_pos, compute_display_string_end):
13774 Declare prototypes.
13775 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13776 EMACS_INT.
13777
13778 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13779
13780 Malloc failure behavior now depends on size of allocation.
13781 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13782 * lisp.h: Change signatures accordingly.
13783 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13784 All callers changed. (Bug#8762)
13785
13786 * gnutls.c: Use Emacs's memory allocators.
13787 Without this change, the gnutls library would invoke malloc etc.
13788 directly, which causes problems on non-SYNC_INPUT hosts, and which
13789 runs afoul of improving memory_full behavior. (Bug#8761)
13790 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13791 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13792 xfree instead of the default malloc, realloc, free.
13793 (Fgnutls_boot): No need to check for memory allocation failure,
13794 since xmalloc does that for us.
13795
13796 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13797 * category.c (hash_get_category_set):
13798 * ccl.c (ccl_driver):
13799 * charset.c (Fdefine_charset_internal):
13800 * charset.h (struct charset.hash_index):
13801 * composite.c (get_composition_id, gstring_lookup_cache)
13802 (composition_gstring_put_cache):
13803 * composite.h (struct composition.hash_index):
13804 * dispextern.h (struct image.hash):
13805 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13806 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13807 (hashfn_equal, hashfn_user_defined, make_hash_table)
13808 (maybe_resize_hash_table, hash_lookup, hash_put)
13809 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13810 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13811 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13812 * image.c (make_image, search_image_cache, lookup_image)
13813 (xpm_put_color_table_h):
13814 * lisp.h (struct Lisp_Hash_Table):
13815 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13816 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13817 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13818 * alloc.c (allocate_vectorlike):
13819 Check for overflow in vector size calculations.
13820 * ccl.c (ccl_driver):
13821 Check for overflow when converting EMACS_INT to int.
13822 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13823 need to be updated by these changes.
13824 * fns.c (make_hash_table, maybe_resize_hash_table):
13825 Check for integer overflow with large hash tables.
13826 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13827 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13828 (SXHASH_REDUCE): New macro.
13829 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13830 Use it instead of discarding useful hash info with large hash values.
13831 (sxhash_float): New function.
13832 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13833 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13834 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13835 Rewrite to use FIXNUM_BITS, as this simplifies things.
13836 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13837 Adjust signatures to match updated version of code.
13838 (consing_since_gc): Now EMACS_INT, since a single hash table can
13839 use more than INT_MAX bytes.
13840
13841 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13842
13843 Make it possible to build with GCC-4.6+ -O2 -flto.
13844
13845 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13846
13847 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13848
13849 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13850 Call minibuffer-inactive-mode.
13851
13852 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13853
13854 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13855 Update dependencies.
13856
13857 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13858
13859 * data.c (init_data): Remove code for UTS, this system is not
13860 supported anymore.
13861
13862 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13863
13864 Don't force ./temacs to start in terminal mode.
13865
13866 * frame.c (make_initial_frame): Initialize faces in all cases, not
13867 only when CANNOT_DUMP is defined.
13868 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13869
13870 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13871
13872 * dispnew.c (add_window_display_history): Use const for the string
13873 pointer. Remove declaration, not needed.
13874
13875 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13876
13877 Use 'inline', not 'INLINE'.
13878 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13879 * alloc.c, fontset.c (INLINE): Remove.
13880 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13881 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13882 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13883 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13884 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13885
13886 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13887
13888 Make it possible to run ./temacs.
13889
13890 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13891 syms_of_callproc does the same thing. Remove test for
13892 "initialized", do it in the caller.
13893 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13894
13895 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13896
13897 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13898 (read_minibuf): Use get_minibuffer.
13899 (syms_of_minibuf): Use DEFSYM.
13900 (Qmetadata): New var.
13901 * data.c (Qbuffer): Don't make it static.
13902 (syms_of_data): Use DEFSYM.
13903
13904 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13905
13906 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13907 (CCL_CODE_MIN): New macro.
13908
13909 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13910
13911 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13912
13913 * eval.c (Qdebug): Now static.
13914 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13915 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13916 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13917
13918 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13919
13920 * image.c: Various fixes to ImageMagick code comments.
13921 (Fimagemagick_types): Doc fix.
13922
13923 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13924
13925 Minor fixes prompted by GCC 4.6.0 warnings.
13926
13927 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13928
13929 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13930 (x_clipboard_manager_save_all): Move extern decl to ...
13931 * xterm.h: ... here, so that it can be checked for consistency.
13932
13933 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13934
13935 * xselect.c (x_clipboard_manager_save_frame)
13936 (x_clipboard_manager_save_all): New functions.
13937 (Fx_clipboard_manager_save): Lisp function deleted.
13938
13939 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13940 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13941
13942 * xterm.h: Update prototype.
13943
13944 2011-05-28 William Xu <william.xwl@gmail.com>
13945
13946 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13947 exiting (Bug#8239).
13948
13949 2011-05-28 Jim Meyering <meyering@redhat.com>
13950
13951 Avoid a sign-extension bug in crypto_hash_function.
13952 * fns.c (to_uchar): Define.
13953 (crypto_hash_function): Use it to convert some newly-signed
13954 variables to unsigned, to avoid sign-extension bugs. For example,
13955 without this change, (md5 "truc") would evaluate to
13956 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13957 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13958 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13959
13960 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13961
13962 Integer overflow fixes.
13963
13964 * dbusbind.c: Serial number integer overflow fixes.
13965 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13966 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13967 to hold a serial number that is too large for a fixnum.
13968 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13969 Check for serial numbers out of range. Decode any serial number
13970 that was so large that it became a float. (Bug#8722)
13971
13972 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13973 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13974 Use XFASTINT rather than XUINT when numbers are nonnegative.
13975 (xd_append_arg, Fdbus_method_return_internal):
13976 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13977 arguments, check that Lisp number is nonnegative, rather than
13978 silently wrapping negative numbers around. (Bug#8722)
13979 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13980 (Bug#8722)
13981
13982 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13983
13984 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13985
13986 ccl: Add integer overflow checks.
13987 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13988 (IN_INT_RANGE): New macros.
13989 (ccl_driver): Use them to check for integer overflow when
13990 decoding a CCL program. Many of the new checks are whether XINT (x)
13991 fits in int; it doesn't always, on 64-bit hosts. The new version
13992 doesn't catch all possible integer overflows, but it's an
13993 improvement. (Bug#8719)
13994
13995 * alloc.c (make_event_array): Use XINT, not XUINT.
13996 There's no need for unsigned here.
13997
13998 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13999 This follows up to the 2011-05-06 change that substituted uintptr_t
14000 for EMACS_INT. This case wasn't caught back then.
14001
14002 Rework Fformat to avoid integer overflow issues.
14003 * editfns.c: Include <float.h> unconditionally, as it's everywhere
14004 now (part of C89). Include <verify.h>.
14005 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
14006 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
14007 (Fformat): Avoid the prepass trying to compute sizes; it was only
14008 approximate and thus did not catch overflow reliably. Instead, walk
14009 through the format just once, formatting and computing sizes as we go,
14010 checking for integer overflow at every step, and allocating a larger
14011 buffer as needed. Keep track separately whether the format is
14012 multibyte. Keep only the most-recently calculated precision, rather
14013 than them all. Record whether each argument has been converted to
14014 string. Use EMACS_INT, not int, for byte and char and arg counts.
14015 Support field widths and precisions larger than INT_MAX. Avoid
14016 sprintf's undefined behavior with conversion specifications such as %#d
14017 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
14018 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
14019 formatting out-of-range floating point numbers with int
14020 formats. (Bug#8668)
14021
14022 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14023
14024 * data.c: Avoid integer truncation in expressions involving floats.
14025 * data.c: Include <intprops.h>.
14026 (arith_driver): When there's an integer overflow in an expression
14027 involving floating point, convert the integers to floating point
14028 so that the resulting value does not suffer from catastrophic
14029 integer truncation. For example, on a 64-bit host (* 4
14030 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14031 Do not rely on undefined behavior after integer overflow.
14032
14033 merge count_size_as_multibyte, parse_str_to_multibyte
14034 * character.c, character.h (count_size_as_multibyte):
14035 Rename from parse_str_to_multibyte; all uses changed.
14036 Check for integer overflow.
14037 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14038 since it's now a duplicate of the other. This is more of
14039 a character than a buffer op, so better that it's in character.c.
14040 * fns.c, print.c: Adjust to above changes.
14041
14042 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14043
14044 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14045
14046 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14047
14048 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14049 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14050 (x_clipboard_manager_save): Now static.
14051 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14052
14053 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14054 (crypto_hash_function): Now static.
14055 Fix pointer signedness problems. Avoid unnecessary initializations.
14056
14057 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14058
14059 * termhooks.h (Vselection_alist): Make it terminal-local.
14060
14061 * terminal.c (create_terminal): Initialize it.
14062
14063 * xselect.c: Support for clipboard managers.
14064 (Vselection_alist): Move to termhooks.h as terminal-local var.
14065 (LOCAL_SELECTION): New macro.
14066 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14067 (symbol_to_x_atom): Remove gratuitous arg.
14068 (x_handle_selection_request, lisp_data_to_selection_data)
14069 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14070 (x_own_selection, x_get_local_selection, x_convert_selection):
14071 New arg, specifying work frame. Use terminal-local Vselection_alist.
14072 (some_frame_on_display): Delete unused function.
14073 (Fx_own_selection_internal, Fx_get_selection_internal)
14074 (Fx_disown_selection_internal, Fx_selection_owner_p)
14075 (Fx_selection_exists_p): New optional frame arg.
14076 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14077 (x_handle_selection_clear): Don't treat other terminals with the
14078 same keyboard specially. Use the terminal-local Vselection_alist.
14079 (x_clear_frame_selections): Use Frun_hook_with_args.
14080
14081 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14082
14083 * xterm.h: Add support for those atoms.
14084
14085 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14086
14087 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14088 (converted_selections, conversion_fail_tag): New global variables.
14089 (x_selection_request_lisp_error): Free the above.
14090 (x_get_local_selection): Remove unnecessary code.
14091 (x_reply_selection_request): Args changed; handle arbitrary array
14092 of converted selections stored in converted_selections.
14093 Separate the XChangeProperty and SelectionNotify steps.
14094 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14095 (x_convert_selection): New function.
14096 (x_handle_selection_event): Simplify.
14097 (x_get_foreign_selection): Don't ignore incoming requests while
14098 waiting for an answer; this will fail when we implement
14099 SAVE_TARGETS, and seems unnecessary anyway.
14100 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14101 (Vx_sent_selection_functions): Doc fix.
14102
14103 2011-05-26 Leo Liu <sdl.web@gmail.com>
14104
14105 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14106
14107 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14108
14109 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14110
14111 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14112 for fringe update if it has periodic bitmap.
14113 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14114 and fringe_bitmap_periodic_p.
14115
14116 * fringe.c (get_fringe_bitmap_data): New function.
14117 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14118 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14119 row. Mark glyph row for fringe update if periodicity changed.
14120
14121 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14122 for fringe update unless it has periodic bitmap.
14123
14124 2011-05-25 Kenichi Handa <handa@m17n.org>
14125
14126 * xdisp.c (get_next_display_element): Set correct it->face_id for
14127 a static composition.
14128
14129 2011-05-24 Leo Liu <sdl.web@gmail.com>
14130
14131 * deps.mk (fns.o):
14132 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14133
14134 * fns.c (crypto_hash_function, Fsha1): New function.
14135 (Fmd5): Use crypto_hash_function.
14136 (syms_of_fns): Add Ssha1.
14137
14138 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14139
14140 * gnutls.c: Remove unused macros.
14141 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14142 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14143 Remove macros that are defined and never used.
14144 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14145
14146 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14147
14148 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14149 (Fx_get_selection_internal): Minor cleanup.
14150 (Fx_own_selection_internal): Rename arguments for consistency with
14151 select.el.
14152
14153 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14154
14155 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14156
14157 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14158
14159 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14160
14161 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14162
14163 * dispnew.c (scrolling_window): Don't exclude the case that the
14164 last enabled row in the desired matrix touches the bottom boundary.
14165
14166 2011-05-21 Glenn Morris <rgm@gnu.org>
14167
14168 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14169 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14170 and add some more files.
14171
14172 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14173
14174 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14175 report_file_error introduced by the change from 2011-05-07.
14176
14177 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14178
14179 * systime.h (Time): Define only if emacs is defined.
14180 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14181 where the include path doesn't have X11/X.h by default. See
14182 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14183
14184 2011-05-20 Kenichi Handa <handa@m17n.org>
14185
14186 * composite.c (find_automatic_composition): Fix previous change.
14187
14188 2011-05-20 Glenn Morris <rgm@gnu.org>
14189
14190 * lisp.mk: New file, split from Makefile.in.
14191 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14192 (shortlisp): Remove.
14193 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14194
14195 2011-05-19 Glenn Morris <rgm@gnu.org>
14196
14197 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14198 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14199 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14200 (lisp): Set the order to that of loadup.el.
14201 (shortlisp): Make it a copy of $lisp.
14202 (SOME_MACHINE_LISP): Remove.
14203 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14204 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14205
14206 2011-05-18 Kenichi Handa <handa@m17n.org>
14207
14208 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14209 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14210 (find_automatic_composition): Mostly rewrite for efficiency.
14211
14212 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14213
14214 * makefile.w32-in: Update dependencies.
14215
14216 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14217
14218 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14219 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14220
14221 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14222
14223 Fix some integer overflow issues, such as string length overflow.
14224
14225 * insdel.c (count_size_as_multibyte): Check for string overflow.
14226
14227 * character.c (lisp_string_width): Check for string overflow.
14228 Use EMACS_INT, not int, for string indexes and lengths; in
14229 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14230 the resulting string length overflows an EMACS_INT; instead,
14231 report a string overflow if no precision given. When checking for
14232 precision exhaustion, use a check that cannot possibly have
14233 integer overflow. (Bug#8675)
14234 * character.h (lisp_string_width): Adjust to new signature.
14235
14236 * alloc.c (string_overflow): New function.
14237 (Fmake_string): Use it. This doesn't change behavior, but saves
14238 a few bytes and will simplify future changes.
14239 * character.c (string_escape_byte8): Likewise.
14240 * lisp.h (string_overflow): New decl.
14241
14242 Fixups, following up to the user-interface timestamp change.
14243 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14244 for UI timestamps, instead of unsigned long.
14245 * msdos.c (mouse_get_pos): Likewise.
14246 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14247 * w32gui.h (Time): Define by including "systime.h" rather than by
14248 declaring it ourselves. (Bug#8664)
14249
14250 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14251 * image.c (clear_image_cache): Likewise.
14252
14253 * term.c (term_mouse_position): Don't assume time_t wraparound.
14254
14255 Be more systematic about user-interface timestamps.
14256 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14257 and sometimes 'EMACS_UINT', to represent these timestamps.
14258 This change causes it to use 'Time' uniformly, as that's what X uses.
14259 This makes the code easier to follow, and makes it easier to catch
14260 integer overflow bugs such as Bug#8664.
14261 * frame.c (Fmouse_position, Fmouse_pixel_position):
14262 Use Time, not unsigned long, for user-interface timestamps.
14263 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14264 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14265 * keyboard.h (last_event_timestamp): Likewise.
14266 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14267 * menu.h (xmenu_show): Likewise.
14268 * term.c (term_mouse_position): Likewise.
14269 * termhooks.h (struct input_event.timestamp): Likewise.
14270 (struct terminal.mouse_position_hook): Likewise.
14271 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14272 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14273 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14274 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14275 what it was before.
14276 * menu.h, termhooks.h: Include "systime.h", for Time.
14277
14278 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14279 Don't assume that the difference between two unsigned long values
14280 can fit into an integer. At this point, we know button_down_time
14281 <= event->timestamp, so the difference must be nonnegative, so
14282 there's no need to cast the result if double-click-time is
14283 nonnegative, as it should be; check that it's nonnegative, just in
14284 case. This bug is triggered when events are more than 2**31 ms
14285 apart (about 25 days). (Bug#8664)
14286
14287 * xselect.c (last_event_timestamp): Remove duplicate decl.
14288 (x_own_selection): Remove needless cast to unsigned long.
14289
14290 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14291 that always fit in int. Use a sentinel instead of a counter, to
14292 avoid a temp and to allay GCC's concerns about possible int overflow.
14293 * frame.h (struct frame): Use int for menu_bar_items_used
14294 instead of EMACS_INT, since it always fits in int.
14295
14296 * menu.c (grow_menu_items): Check for int overflow.
14297
14298 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14299
14300 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14301 Before, the code was not consistent. These values cannot exceed
14302 2**31 - 1 so there's no need to make them unsigned.
14303 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14304 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14305 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14306 as modifiers.
14307 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14308
14309 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14310 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14311 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14312 presumably because the widths might not match.
14313
14314 * window.c (size_window): Avoid needless test at loop start.
14315
14316 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14317
14318 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14319
14320 2011-05-12 Drew Adams <drew.adams@oracle.com>
14321
14322 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14323
14324 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14325
14326 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14327 `width' to `bar_area_x' and `bar_area_width', respectively.
14328 (x_scroll_run): Take account of fringe background extension.
14329
14330 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14331 Rename local vars `left' and `width' to `bar_area_x' and
14332 `bar_area_width', respectively.
14333 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14334 background extension.
14335
14336 2011-05-10 Jim Meyering <meyering@redhat.com>
14337
14338 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14339
14340 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14341
14342 * image.c (Finit_image_library): Return t for built-in image types,
14343 like pbm and xbm. (Bug#8640)
14344
14345 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14346
14347 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14348
14349 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14350
14351 * w32console.c (Fset_screen_color): Doc fix.
14352 (Fget_screen_color): New function.
14353 (syms_of_ntterm): Defsubr it.
14354
14355 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14356 unlink the temporary file if Fcall_process didn't create it in the
14357 first place.
14358 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14359 child process will be redirected to a file specified with `:file'.
14360 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14361 cue to call_process_cleanup not to close that handle.
14362
14363 2011-05-07 Ben Key <bkey76@gmail.com>
14364
14365 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14366 one of two shell specific rules, either bootstrap-temacs-CMD or
14367 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14368 to the previous implementation of the bootstrap-temacs rule.
14369 The bootstrap-temacs-CMD rule is similar to the previous
14370 implementation of the bootstrap-temacs rule except that it
14371 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14372 variable.
14373
14374 These changes, along with some changes to nt/configure.bat,
14375 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14376 earlier fix to add support for --cflags and --ldflags options
14377 that include quotes so that it works whether make uses cmd or
14378 sh as the shell.
14379
14380 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14381
14382 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14383 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14384 is a constant.
14385 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14386 a string. Handle both cases.
14387 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14388 (Fdbus_register_method): Use Qinvalid_function.
14389
14390 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14391
14392 * makefile.w32-in: Update dependencies.
14393 (LISP_H): Add inttypes.h and stdin.h.
14394 (PROCESS_H): Add unistd.h.
14395
14396 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14397
14398 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14399 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14400
14401 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14402
14403 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14404
14405 * term.c (vfatal): Remove stray call to va_end.
14406 It's not needed and the C Standard doesn't allow it here anyway.
14407
14408 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14409 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14410
14411 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14412 bytes.
14413
14414 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14415
14416 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14417
14418 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14419
14420 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14421
14422 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14423
14424 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14425 * charset.c (Fdefine_charset_internal): Don't initialize
14426 charset.code_space[15]. The value was garbage, on hosts with
14427 32-bit int (Bug#8600).
14428
14429 * lread.c (read_integer): Be more consistent with string-to-number.
14430 Use string_to_number to do the actual conversion; this avoids
14431 rounding errors and fixes some other screwups. Without this fix,
14432 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14433 (digit_to_number): Move earlier, for benefit of read_integer.
14434 Return -1 if the digit is out of range for the base, -2 if it is
14435 not a digit in any supported base. (Bug#8602)
14436
14437 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14438
14439 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14440 to match comment at start of function. This also removes a
14441 GCC warning about overflow in a 32+64-bit port.
14442
14443 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14444
14445 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14446 Reported by Stefan Monnier in
14447 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14448 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14449 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14450
14451 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14452 (EMACS_UINTPTR): Likewise, with uintptr_t.
14453
14454 * lisp.h: Prefer 64-bit EMACS_INT if available.
14455 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14456 on 32-bit hosts that have 64-bit int, so that they can access
14457 large files.
14458 However, temporarily disable this change unless the temporary
14459 symbol WIDE_EMACS_INT is defined.
14460
14461 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14462
14463 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14464 This removes an assumption that EMACS_INT and long are the same
14465 width as pointers. The assumption is true for Emacs porting targets
14466 now, but we want to make other targets possible.
14467 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14468 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14469 In the rest of the code, change types of integers that hold casted
14470 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14471 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14472 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14473 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14474 No need to cast type when ORing.
14475 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14476 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14477 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14478 assume EMACS_INT is the same width as char *.
14479 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14480 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14481 Remove no-longer-needed casts.
14482 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14483 (xg_tool_bar_help_callback, xg_make_tool_item):
14484 Use EMACS_INTPTR to hold an integer
14485 that will be cast to void *; this can avoid a GCC warning
14486 if EMACS_INT is not the same width as void *.
14487 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14488 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14489 (current_message_1, set_message_1):
14490 Use a local to convert to proper width without a cast.
14491 * xmenu.c (dialog_selection_callback): Likewise.
14492
14493 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14494 Also, don't assume VALBITS / RAND_BITS is less than 5,
14495 and don't rely on undefined behavior when shifting a 1 left into
14496 the sign bit.
14497 * lisp.h (get_random): Change signature to match.
14498
14499 * lread.c (hash_string): Use size_t, not int, for hash computation.
14500 Normally we prefer signed values; but hashing is special, because
14501 it's better to use unsigned division on hash table sizes so that
14502 the remainder is nonnegative. Also, size_t is the natural width
14503 for hashing into memory. The previous code used 'int', which doesn't
14504 retain enough info to hash well into very large tables.
14505 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14506
14507 * dbusbind.c: Don't possibly lose pointer info when converting.
14508 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14509 Use XPNTR rather than XHASH, so that the high-order bits of
14510 the pointer aren't lost when converting through void *.
14511
14512 * eval.c (Fautoload): Don't double-shift a pointer.
14513
14514 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14515
14516 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14517
14518 * gnutls.c (DEF_GNUTLS_FN):
14519 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14520
14521 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14522
14523 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14524 marker. (Bug#8610)
14525
14526 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14527
14528 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14529 New version that can reserve upto 2GB of heap space.
14530
14531 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14532
14533 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14534
14535 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14536
14537 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14538 `gnutls_certificate_set_x509_key_file'.
14539
14540 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14541
14542 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14543 Update dependencies.
14544
14545 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14546
14547 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14548 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14549 Remove unused parameter `fildes'.
14550 * process.c (read_process_output, send_process): Don't pass it.
14551
14552 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14553
14554 Fix previous change: the library cache is defined in w32.c.
14555 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14556 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14557
14558 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14559
14560 Implement dynamic loading of GnuTLS on Windows.
14561
14562 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14563 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14564 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14565 Declare.
14566
14567 * gnutls.c (Qgnutls_dll): Define.
14568 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14569 (gnutls_*): Declare function pointers.
14570 (init_gnutls_functions): New function to initialize function pointers.
14571 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14572 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14573 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14574 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14575 (emacs_gnutls_write, emacs_gnutls_read)
14576 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14577 (Fgnutls_available_p): New function.
14578 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14579 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14580 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14581
14582 * image.c: Include w32.h.
14583 (Vimage_type_cache): Delete.
14584 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14585 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14586 (w32_delayed_load): Move to w32.c.
14587
14588 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14589
14590 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14591 (w32_delayed_load): Move from image.c. When loading a library, record
14592 its filename in the :loaded-from property of the library id.
14593 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14594 Initialize and staticpro them.
14595 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14596
14597 * process.c: Include lisp.h before w32.h, not after.
14598 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14599 instead of gnutls_record_check_pending.
14600
14601 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14602
14603 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14604
14605 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14606 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14607 as passed in.
14608
14609 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14610
14611 * xterm.c (x_set_frame_alpha): Do not set property on anything
14612 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14613
14614 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14615
14616 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14617
14618 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14619
14620 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14621 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14622 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14623 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14624 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14625 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14626 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14627 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14628 (Qgnutls_bootprop_callbacks_verify): Make static.
14629
14630 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14631
14632 * callproc.c: Indentation fixup.
14633
14634 * sysdep.c (wait_for_termination_1): Make static.
14635 (wait_for_termination, interruptible_wait_for_termination):
14636 Move after wait_for_termination_1.
14637
14638 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14639
14640 * sysdep.c (interruptible_wait_for_termination): New function
14641 which is like wait_for_termination, but allows keyboard
14642 interruptions.
14643
14644 * callproc.c (Fcall_process): Add (:file "file") as an option for
14645 the STDOUT buffer.
14646 (Fcall_process_region): Ditto.
14647
14648 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14649
14650 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14651 rather than `XVECTOR (FOO)->size'.
14652
14653 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14654 inttypes.h, as a gnulib replacement is used if it not available in
14655 system headers.
14656
14657 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14658
14659 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14660 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14661 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14662
14663 * coding.c (coding_alloc_by_realloc): Error out if destination
14664 will grow beyond MOST_POSITIVE_FIXNUM.
14665 (decode_coding_emacs_mule): Abort if there isn't enough place in
14666 charbuf for the composition carryover bytes. Reserve an extra
14667 space for up to 2 characters produced in a loop.
14668 (decode_coding_iso_2022): Abort if there isn't enough place in
14669 charbuf for the composition carryover bytes.
14670
14671 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14672
14673 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14674 aborting when %lld or %lll format is passed.
14675 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14676 %llo or %llx format is passed. (Bug#8545)
14677
14678 * window.c (window_scroll_line_based): Use a marker instead of
14679 simple variables to record original value of point. (Bug#7952)
14680
14681 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14682 produced by %s or %c overflows available buffer space. (Bug#8545)
14683
14684 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14685
14686 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14687 (SIZE_MAX): Move defn after all includes, as they might #define it.
14688
14689 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14690
14691 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14692
14693 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14694
14695 * keyboard.c (Qdelayed_warnings_hook): Define.
14696 (command_loop_1): Run `delayed-warnings-hook'
14697 if Vdelayed_warnings_list is non-nil.
14698 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14699 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14700
14701 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14702
14703 * doprnt.c (doprnt): Don't return value smaller than the buffer
14704 size if the message was truncated. (Bug#8545).
14705
14706 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14707
14708 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14709 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14710
14711 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14712
14713 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14714
14715 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14716
14717 * makefile.w32-in: Update dependencies.
14718
14719 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14720
14721 Improve `doprnt' and its usage. (Bug#8545)
14722 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14723 `format_end'. Remove support for %l as a conversion specifier.
14724 Don't use xrealloc. Improve diagnostics when the %l size modifier
14725 is used. Update the commentary.
14726
14727 * eval.c (verror): Simplify calculation of size_t.
14728
14729 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14730 messages.
14731
14732 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14733
14734 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14735 change.
14736
14737 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14738
14739 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14740 This makes this file independent of the recent pseudovector change.
14741
14742 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14743
14744 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14745
14746 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14747 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14748 Remove unused local.
14749 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14750
14751 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14752 GCC 4.6.0 optimizes based on type-based alias analysis.
14753 For example, if b is of type struct buffer * and v of type struct
14754 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14755 != &v->size, and therefore "v->size = 1; b->size = 2; return
14756 v->size;" must therefore return 1. This assumption is incorrect
14757 for Emacs, since it type-puns struct Lisp_Vector * with many other
14758 types. To fix this problem, this patch adds a new type struct
14759 vectorlike_header that documents the constraints on layout of vectors
14760 and pseudovectors, and helps optimizing compilers not get fooled
14761 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14762 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14763 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14764 the size member.
14765 (XSETPVECTYPE): Rewrite in terms of new macro.
14766 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14767 This is a bit clearer, and further avoids the possibility of
14768 undesirable aliasing.
14769 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14770 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14771 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14772 since Lisp_Subr is a special case (no "next" field).
14773 (ASIZE): Now uses header.size rather than size.
14774 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14775 to avoid the hassle of writing XVECTOR (foo)->header.size.
14776 (struct vectorlike_header): New type.
14777 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14778 object, to help avoid aliasing.
14779 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14780 (SUBRP): Likewise, since Lisp_Subr is a special case.
14781 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14782 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14783 (struct Lisp_Hash_Table): Combine first two members into a single
14784 struct vectorlike_header member. All uses of "size" and "next" members
14785 changed to be "header.size" and "header.next".
14786 * buffer.h (struct buffer): Likewise.
14787 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14788 * frame.h (struct frame): Likewise.
14789 * process.h (struct Lisp_Process): Likewise.
14790 * termhooks.h (struct terminal): Likewise.
14791 * window.c (struct save_window_data, struct saved_window): Likewise.
14792 * window.h (struct window): Likewise.
14793 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14794 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14795 * buffer.c (init_buffer_once): Likewise.
14796 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14797 special case.
14798 * process.c (Fformat_network_address): Use local var for size,
14799 for brevity.
14800
14801 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14802
14803 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14804 * data.c (atof): Remove decl; no longer used or needed.
14805 (digit_to_number): Move to lread.c.
14806 (Fstring_to_number): Use new string_to_number function, to be
14807 consistent with how the Lisp reader treats infinities and NaNs.
14808 Do not assume that floating-point numbers represent EMACS_INT
14809 without losing information; this is not true on most 64-bit hosts.
14810 Avoid double-rounding errors, by insisting on integers when
14811 parsing non-base-10 numbers, as the documentation specifies.
14812 * lisp.h (string_to_number): New decl, replacing ...
14813 (isfloat_string): Remove.
14814 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14815 (read1): Do not accept +. and -. as integers; this
14816 appears to have been a coding error. Similarly, do not accept
14817 strings like +-1e0 as floating point numbers. Do not report
14818 overflow for integer overflows unless the base is not 10 which
14819 means we have no simple and reliable way to continue.
14820 Break out the floating-point parsing into a new
14821 function string_to_number, so that Fstring_to_number parses
14822 floating point numbers consistently with the Lisp reader.
14823 (digit_to_number): Move here from data.c. Make it static inline.
14824 (E_CHAR, EXP_INT): Remove, replacing with ...
14825 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14826 (string_to_number): New function, replacing isfloat_string.
14827 This function checks for valid syntax and produces the resulting
14828 Lisp float number too. Rework it so that string-to-number
14829 no longer mishandles examples like "1.0e+". Use strtoumax,
14830 so that overflow for non-base-10 numbers is reported only when
14831 there's no portable and simple way to convert to floating point.
14832
14833 * textprop.c (set_text_properties_1): Rewrite for clarity,
14834 and to avoid GCC warning about integer overflow.
14835
14836 * intervals.h (struct interval): Use EMACS_INT for members
14837 where EMACS_UINT might cause problems. See
14838 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14839 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14840 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14841 All uses changed.
14842 (offset_intervals): Tell GCC not to worry about length overflow
14843 when negating a negative length.
14844
14845 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14846 (overrun_check_free): Likewise.
14847
14848 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14849 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14850 word size.
14851
14852 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14853 (gnutls_make_error): Rename local to avoid shadowing.
14854 (gnutls_emacs_global_deinit): ifdef out; not used.
14855 (Fgnutls_boot): Use const for pointer to readonly storage.
14856 Comment out unused local. Fix pointer signedness problems.
14857
14858 * lread.c (openp): Don't stuff size_t into an 'int'.
14859 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14860 about possible signed overflow.
14861
14862 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14863 (GDK_KEY_g): Don't define if already defined.
14864 (xg_prepare_tooltip): Avoid pointer signedness problem.
14865 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14866
14867 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14868 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14869
14870 * xfns.c (Fx_window_property): Simplify a bit,
14871 to make a bit faster and to avoid GCC 4.6.0 warning.
14872 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14873
14874 * fns.c (internal_equal): Don't assume size_t fits in int.
14875
14876 * alloc.c (compact_small_strings): Tighten assertion a little.
14877
14878 Replace pEd with more-general pI, and fix some printf arg casts.
14879 * lisp.h (pI): New macro, generalizing old pEd macro to other
14880 conversion specifiers. For example, use "...%"pI"d..." rather
14881 than "...%"pEd"...".
14882 (pEd): Remove. All uses replaced with similar uses of pI.
14883 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14884 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14885 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14886 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14887 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14888 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14889 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14890 64-bit hosts.
14891 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14892 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14893 * print.c (safe_debug_print, print_object): Likewise.
14894 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14895 to int.
14896 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14897 avoiding the 0 flag, which is not portable.
14898 * process.c (Fmake_network_process): Use pI to avoid cast.
14899 * region-cache.c (pp_cache): Likewise.
14900 * xdisp.c (decode_mode_spec): Likewise.
14901 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14902 behavior on 64-bit hosts with printf arg.
14903 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14904 (x_stop_queuing_selection_requests): Likewise.
14905 (x_get_window_property): Don't truncate byte count to an 'int'
14906 when tracing.
14907
14908 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14909 here, since it parses constructs like leading '-' and spaces,
14910 which are not wanted; and it overflows with large numbers.
14911 Instead, simply match F[0-9]+, which is what is wanted anyway.
14912
14913 * alloc.c: Remove unportable assumptions about struct layout.
14914 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14915 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14916 (allocate_vectorlike, make_pure_vector): Use the new macros,
14917 plus offsetof, to remove unportable assumptions about struct layout.
14918 These assumptions hold on all porting targets that I know of, but
14919 they are not guaranteed, they're easy to remove, and removing them
14920 makes further changes easier.
14921
14922 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14923 This doesn't fix a bug but makes the code clearer.
14924 (string_overrun_cookie): Now const. Use initializers that
14925 don't formally overflow signed char, to avoid warnings.
14926 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14927 can cause Emacs to crash when string overrun checking is enabled.
14928 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14929 multiple of sizeof (EMACS_INT); it need not be, if
14930 alignof(EMACS_INT) < sizeof (EMACS_INT).
14931 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14932
14933 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14934
14935 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14936
14937 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14938
14939 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14940 supposed to be handshaking. (Bug#8556)
14941 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14942
14943 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14944
14945 * lisp.h (Qdebug): List symbol.
14946 * eval.c (Qdebug): Restore global linkage.
14947 * keyboard.c (debug-on-event): New variable.
14948 (handle_user_signal): Break into debugger when debug-on-event
14949 matches the current signal symbol.
14950
14951 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14952
14953 * alloc.c (check_sblock, check_string_bytes)
14954 (check_string_free_list): Convert to standard C.
14955
14956 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14957
14958 * w32.c (emacs_gnutls_push): Fix typo.
14959
14960 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14961
14962 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14963 "cast to pointer from integer of different size".
14964
14965 Improve doprnt and its use in verror. (Bug#8545)
14966 * doprnt.c (doprnt): Document the set of format control sequences
14967 supported by the function. Use SAFE_ALLOCA instead of always
14968 using `alloca'.
14969
14970 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14971 is one byte too soon. Don't use xrealloc; instead xfree and
14972 xmalloc anew.
14973
14974 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14975
14976 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14977 callbacks stage.
14978
14979 * gnutls.c: Renamed global_initialized to
14980 gnutls_global_initialized. Added internals for the
14981 :verify-hostname-error, :verify-error, and :verify-flags
14982 parameters of `gnutls-boot' and documented those parameters in the
14983 docstring. Start callback support.
14984 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14985 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14986 on error. Return error code.
14987 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14988 (emacs_gnutls_read): Likewise.
14989 (Fgnutls_boot): Return handshake error code.
14990 (emacs_gnutls_handle_error): New function.
14991 (wsaerror_to_errno): Likewise.
14992
14993 * w32.h (emacs_gnutls_pull): Add prototype.
14994 (emacs_gnutls_push): Likewise.
14995
14996 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14997 (emacs_gnutls_push): Likewise.
14998
14999 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
15000
15001 * process.c (wait_reading_process_output): Check if GnuTLS
15002 buffered some data internally if no FDs are set for TLS
15003 connections.
15004
15005 * makefile.w32-in (OBJ2): Add gnutls.$(O).
15006 (LIBS): Link to USER_LIBS.
15007 ($(BLD)/gnutls.$(0)): New target.
15008
15009 2011-04-24 Eli Zaretskii <eliz@gnu.org>
15010
15011 * xdisp.c (handle_single_display_spec): Rename the
15012 display_replaced_before_p argument into display_replaced_p, to
15013 make it consistent with the commentary. Fix typos in the
15014 commentary.
15015
15016 * textprop.c (syms_of_textprop): Remove dead code.
15017 (copy_text_properties): Delete obsolete commentary about an
15018 interface that was deleted long ago. Fix typos in the description
15019 of arguments.
15020
15021 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15022 to changes in oldXMenu/XMenu.h from 2011-04-16.
15023 <menu_help_message, prev_menu_help_message>: Constify.
15024 (IT_menu_make_room): menu->help_text is now `const char **';
15025 adjust.
15026
15027 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15028 to changes in oldXMenu/XMenu.h from 2011-04-16.
15029 (struct XMenu): Declare `help_text' `const char **'.
15030
15031 * xfaces.c <Qunspecified>: Make extern again.
15032
15033 * syntax.c: Include sys/types.h before including regex.h, as
15034 required by POSIX.
15035
15036 * doc.c (get_doc_string): Improve the format passed to `error'.
15037
15038 * doprnt.c (doprnt): Improve commentary.
15039
15040 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15041
15042 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15043 them with etags.
15044
15045 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15046 changes in globals.h immediately force recompilation.
15047 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15048 $(CURDIR)/s/ms-w32.h.
15049 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15050
15051 * character.c (Fchar_direction): Function deleted.
15052 (syms_of_character): Don't defsubr it.
15053 <char-direction-table>: Deleted.
15054
15055 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15056
15057 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15058 * doprnt.c: Include limits.h.
15059 (SIZE_MAX): New macro.
15060 (doprnt): Return a size_t value. 2nd arg is now size_t.
15061 Many local variables are now size_t instead of int or unsigned.
15062 Improve overflow protection. Support `l' modifier for integer
15063 conversions. Support %l conversion. Don't assume an EMACS_INT
15064 argument for integer conversions and for %c.
15065
15066 * lisp.h (doprnt): Restore prototype.
15067
15068 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15069 $(SRC)/character.h.
15070
15071 * Makefile.in (base_obj): Add back doprnt.o.
15072
15073 * deps.mk (doprnt.o): Add back prerequisites.
15074 (callint.o): Depend on character.h.
15075
15076 * eval.c (internal_lisp_condition_case): Include the handler
15077 representation in the error message.
15078 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15079 when breaking from the loop.
15080
15081 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15082
15083 * callint.c (Fcall_interactively): When displaying error message
15084 about invalid control letter, pass the character's codepoint, not
15085 a pointer to its multibyte form. Improve display of the character
15086 in octal and display also its hex code.
15087
15088 * character.c (char_string): Use %x to display the (unsigned)
15089 codepoint of an invalid character, to avoid displaying a bogus
15090 negative value.
15091
15092 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15093 `error', not SYMBOL_NAME itself.
15094
15095 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15096 character arguments to `error'.
15097
15098 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15099 to `error' in error message about FINAL_CHAR argument. Make sure
15100 FINAL_CHAR is a character, and use %c when it is passed as
15101 argument to `error'.
15102
15103 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15104
15105 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15106
15107 * w32.c: Include <time.h>.
15108 (sys_localtime): New function.
15109
15110 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15111
15112 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15113
15114 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15115
15116 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15117
15118 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15119 zombies (Bug#8467).
15120
15121 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15122
15123 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15124 gl_state.e_property when gl_state.object is Qt.
15125
15126 * insdel.c (make_gap_larger): Remove limitation of buffer size
15127 to <= INT_MAX.
15128
15129 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15130
15131 * xdisp.c (lookup_glyphless_char_display)
15132 (produce_glyphless_glyph): Handle cons cell entry in
15133 glyphless-char-display.
15134 (Vglyphless_char_display): Document it.
15135
15136 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15137 glyphless-char-display.
15138
15139 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15140
15141 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15142
15143 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15144
15145 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15146 definition for no-X builds.
15147
15148 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15149
15150 Static checks with GCC 4.6.0 and non-default toolkits.
15151
15152 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15153
15154 * process.c (keyboard_bit_set): Define only if SIGIO.
15155 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15156 (send_process): Repair possible setjmp clobbering.
15157
15158 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15159
15160 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15161
15162 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15163
15164 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15165 Define only if needed.
15166
15167 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15168 by pacifying GCC about it. Maybe it's time to retire it?
15169 * xfaces.c (USG, __TIMEVAL__): Likewise.
15170
15171 * dispextern.h (struct redisplay_interface): Rename param
15172 to avoid shadowing.
15173 * termhooks.h (struct terminal): Likewise.
15174 * xterm.c (xembed_send_message): Likewise.
15175
15176 * insdel.c (make_gap_smaller): Define only if
15177 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15178
15179 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15180 it.
15181
15182 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15183 so that we aren't warned about unused symbols.
15184
15185 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15186
15187 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15188
15189 * xfns.c (x_real_positions): Mark locals as initialized.
15190
15191 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15192
15193 * xterm.c: Fix problems found by static analysis with other toolkits.
15194 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15195 (x_dispatch_event): Declare static if USE_GTK, and
15196 define if USE_GTK || USE_X_TOOLKIT.
15197 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15198 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15199 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15200 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15201
15202 * xmenu.c (menu_help_callback): Pointer type fixes.
15203 Use const pointers when pointing at readonly data. Avoid pointer
15204 signedness clashes.
15205 (FALSE): Remove unused macro.
15206 (update_frame_menubar): Remove unused decl.
15207
15208 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15209
15210 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15211 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15212 (single_menu_item): Rename local to avoid shadowing.
15213
15214 * keyboard.c (make_lispy_event): Remove unused local var.
15215
15216 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15217 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15218
15219 * bitmaps: Change bitmaps from unsigned char back to the X11
15220 compatible char. Avoid the old compiler warnings about
15221 out-of-range initializers by using, for example, '\xab' rather
15222 than 0xab.
15223
15224 * xgselect.c (xgselect_initialize): Check vs interface
15225 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15226
15227 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15228
15229 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15230 to read-only memory.
15231
15232 * fns.c (vector): Remove; this old hack is no longer needed.
15233
15234 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15235 Remove unused var.
15236 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15237
15238 * xrdb.c (x_load_resources): Omit unused local.
15239
15240 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15241 (x_window): Rename locals to avoid shadowing.
15242 (USG): Use the kludged USG macro, to pacify gcc.
15243
15244 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15245 (x_term_init): Remove local to avoid shadowing.
15246
15247 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15248
15249 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15250 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15251
15252 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15253
15254 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15255
15256 Fix regex.c, syntax.c and friends for buffers > 2GB.
15257 * syntax.h (struct gl_state_s): Declare character position members
15258 EMACS_INT.
15259
15260 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15261
15262 * textprop.c (verify_interval_modification, interval_of):
15263 Declare arguments EMACS_INT.
15264
15265 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15266 EMACS_INT.
15267
15268 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15269
15270 * indent.c (Fvertical_motion): Local variable it_start is now
15271 EMACS_INT.
15272
15273 * regex.c (re_match, re_match_2, re_match_2_internal)
15274 (bcmp_translate, regcomp, regexec, print_double_string)
15275 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15276 (re_compile_pattern, re_exec): Declare arguments and local
15277 variables `size_t' and `ssize_t' and return values `regoff_t', as
15278 appropriate.
15279 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15280 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15281 <compile_stack_type>: `size' and `avail' are now `size_t'.
15282
15283 * regex.h <regoff_t>: Use ssize_t, not int.
15284 (re_search, re_search_2, re_match, re_match_2): Arguments that
15285 specify buffer/string position and length are now ssize_t and
15286 size_t. Return type is regoff_t.
15287
15288 2011-04-16 Ben Key <bkey76@gmail.com>
15289
15290 * nsfont.m: Fixed bugs in ns_get_family and
15291 ns_descriptor_to_entity that were caused by using free to
15292 deallocate memory blocks that were allocated by xmalloc (via
15293 xstrdup). This caused Emacs to crash when compiled with
15294 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15295 --enable-checking=xmallocoverrun). xfree is now used to
15296 deallocate these memory blocks.
15297
15298 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15299
15300 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15301
15302 emacs_write: Accept and return EMACS_INT for sizes.
15303 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15304 et seq.
15305 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15306 Accept and return EMACS_INT.
15307 (emacs_gnutls_write): Return the number of bytes written on
15308 partial writes.
15309 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15310 (emacs_read, emacs_write): Remove check for negative size, as the
15311 Emacs source code has been audited now.
15312 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15313 (emacs_read, emacs_write): Use it.
15314 * process.c (send_process): Adjust to the new signatures of
15315 emacs_write and emacs_gnutls_write. Do not attempt to store
15316 a byte offset into an 'int'; it might overflow.
15317 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15318
15319 * sound.c: Don't assume sizes fit in 'int'.
15320 (struct sound_device.period_size, alsa_period_size):
15321 Return EMACS_INT, not int.
15322 (struct sound_device.write, vox_write, alsa_write):
15323 Accept EMACS_INT, not int.
15324 (wav_play, au_play): Use EMACS_INT to store sizes and to
15325 record read return values.
15326
15327 2011-04-15 Ben Key <bkey76@gmail.com>
15328
15329 * keyboard.c (Qundefined): Don't declare static since it is used
15330 in nsfns.m.
15331 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15332 static since they are used in nsfont.m.
15333
15334 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15335
15336 * process.c (Qprocessp): Don't declare static.
15337 * lisp.h (Qprocessp): Declare again.
15338
15339 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15340
15341 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15342
15343 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15344
15345 Improve C-level modularity by making more things 'static'.
15346
15347 Don't publish debugger-only interfaces to other modules.
15348 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15349 (verify_bytepos, count_markers): Move decls to the only modules
15350 that need them.
15351 * region-cache.h (pp_cache): Likewise.
15352 * window.h (check_all_windows): Likewise.
15353 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15354
15355 * sysdep.c (croak): Now static, if
15356 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15357 * syssignal.h (croak): Declare only if not static.
15358
15359 * alloc.c (refill_memory_reserve): Now static if
15360 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15361 * lisp.h (refill_memory_reserve): Declare only if not static.
15362
15363 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15364 Define only if USE_LUCID.
15365
15366 * xrdb.c (x_customization_string, x_rm_string): Now static.
15367
15368 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15369 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15370
15371 * xdisp.c (draw_row_with_mouse_face): Now static.
15372 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15373
15374 * window.h (check_all_windows): Mark externally visible.
15375
15376 * window.c (window_deletion_count): Now static.
15377
15378 * undo.c: Make symbols static if they're not exported.
15379 (last_undo_buffer, last_boundary_position, pending_boundary):
15380 Now static.
15381
15382 * textprop.c (interval_insert_behind_hooks): Now static.
15383 (interval_insert_in_front_hooks): Likewise.
15384
15385 * term.c: Make symbols static if they're not exported.
15386 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15387 (max_frame_lines, tty_set_terminal_modes):
15388 (tty_reset_terminal_modes, tty_turn_off_highlight):
15389 (get_tty_terminal): Now static.
15390 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15391 * termhooks.h (term_mouse_moveto): Do not declare if
15392 HAVE_WINDOW_SYSTEM.
15393 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15394 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15395
15396 * sysdep.c: Make symbols static if they're not exported.
15397 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15398 Now static.
15399 (sigprocmask_set, full_mask): Remove; unused.
15400 (wait_debugging): Mark as visible.
15401 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15402 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15403
15404 * syntax.c (syntax_temp): Define only if !__GNUC__.
15405
15406 * sound.c (current_sound_device, current_sound): Now static.
15407
15408 * search.c (searchbufs, searchbuf_head): Now static.
15409
15410 * scroll.c (scroll_cost): Remove; unused.
15411 * dispextern.h (scroll_cost): Remove decl.
15412
15413 * region-cache.h (pp_cache): Mark as externally visible.
15414
15415 * process.c: Make symbols static if they're not exported.
15416 (process_tick, update_tick, create_process, chan_process):
15417 (Vprocess_alist, proc_buffered_char, datagram_access):
15418 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15419 (deactivate_process): Mark defn as static, as well as decl.
15420 * lisp.h (create_process): Remove decl.
15421 * process.h (chan_process, Vprocess_alist): Remove decls.
15422
15423 * print.c: Make symbols static if they're not exported.
15424 (print_depth, new_backquote_output, being_printed, print_buffer):
15425 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15426 (print_interval, print_number_index, initial_stderr_stream):
15427 Now static.
15428 * lisp.h (Fprinc): Remove decl.
15429 (debug_output_compilation_hack): Mark as externally visible.
15430
15431 * sysdep.c (croak): Move decl from here to syssignal.h.
15432 * syssignal.h (croak): Put it here, so the API can be checked when
15433 'croak' is called from dissociate_if_controlling_tty.
15434
15435 * minibuf.c: Make symbols static if they're not exported.
15436 (minibuf_save_list, choose_minibuf_frame): Now static.
15437 * lisp.h (choose_minibuf_frame): Remove decl.
15438
15439 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15440
15441 * lread.c: Make symbols static if they're not exported.
15442 (read_objects, initial_obarray, oblookup_last_bucket_number):
15443 Now static.
15444 (make_symbol): Remove; unused.
15445 * lisp.h (initial_obarray, make_symbol): Remove decls.
15446
15447 * keyboard.c: Make symbols static if they're not exported.
15448 (single_kboard, recent_keys_index, total_keys, recent_keys):
15449 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15450 (this_single_command_key_start, echoing, last_auto_save):
15451 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15452 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15453 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15454 (Vlispy_mouse_stem, double_click_count):
15455 Now static.
15456 (force_auto_save_soon): Define only if SIGDANGER.
15457 (ignore_mouse_drag_p): Now static if
15458 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15459 (print_help): Remove; unused.
15460 (stop_character, last_timer_event): Mark as externally visible.
15461 * keyboard.h (ignore_mouse_drag_p): Declare only if
15462 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15463 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15464 * lisp.h (echoing): Remove decl.
15465 (force_auto_save_soon): Declare only if SIGDANGER.
15466 * xdisp.c (redisplay_window): Simplify code, to make it more
15467 obvious that ignore_mouse_drag_p is not accessed if !defined
15468 USE_GTK && !defined HAVE_NS.
15469
15470 * intervals.c: Make symbols static if they're not exported.
15471 (merge_properties_sticky, merge_interval_right, delete_interval):
15472 Now static.
15473 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15474
15475 * insdel.c: Make symbols static if they're not exported.
15476 However, leave prepare_to_modify_buffer alone. It's never
15477 called from outside this function, but that appears to be a bug.
15478 (combine_after_change_list, combine_after_change_buffer):
15479 (adjust_after_replace, signal_before_change): Now static.
15480 (adjust_after_replace_noundo): Remove; unused.
15481 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15482 (signal_before_change): Remove decls.
15483
15484 * indent.c (val_compute_motion, val_vmotion): Now static.
15485
15486 * image.c: Make symbols static if they're not exported.
15487 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15488 if USE_GTK.
15489 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15490 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15491
15492 * fringe.c (standard_bitmaps): Now static.
15493 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15494
15495 * frame.c: Make symbols static if they're not exported.
15496 (x_report_frame_params, make_terminal_frame): Now static.
15497 (get_frame_param): Now static, unless HAVE_NS.
15498 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15499 (x_get_resource_string): Remove; not used.
15500 * frame.h (make_terminal_frame, x_report_frame_params):
15501 (x_get_resource_string); Remove decls.
15502 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15503 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15504
15505 * font.c, fontset.c: Make symbols static if they're not exported.
15506 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15507 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15508 * font.c (font_close_object): Now static.
15509 * font.h (font_close_object): Remove.
15510 * fontset.c (FONTSET_OBJLIST): Remove.
15511 (free_realized_fontset) #if-0 the body, which does nothing.
15512 (face_suitable_for_char_p): #if-0, as it's never called.
15513 * fontset.h (face_suitable_for_char_p): Remove decl.
15514 * xfaces.c (face_at_string_position):
15515 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15516 since 0 is always ASCII.
15517
15518 * fns.c (weak_hash_tables): Now static.
15519
15520 * fileio.c: Make symbols static if they're not exported.
15521 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15522 (Vwrite_region_annotation_buffers): Now static.
15523
15524 * eval.c: Make symbols static if they're not exported.
15525 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15526 * lisp.h (backtrace_list): Remove decl.
15527
15528 * emacs.c: Make symbols static if they're not exported.
15529 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15530 (fatal_error_code, fatal_error_signal_hook, standard_args):
15531 Now static.
15532 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15533 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15534 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15535 * lisp.h (fatal_error_signal_hook): Remove decl.
15536 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15537
15538 * editfns.c: Move a (normally-unused) function to its only use.
15539 * editfns.c, lisp.h (get_operating_system_release): Remove.
15540 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15541 worth the hassle of breaking this out.
15542
15543 * xterm.c: Make symbols static if they're not exported.
15544 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15545 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15546 (x_destroy_window, x_delete_display):
15547 Now static.
15548 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15549 (x_mouse_leave): Remove; unused.
15550 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15551 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15552 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15553 Remove decls.
15554 (x_mouse_leave): Declare only if WINDOWSNT.
15555 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15556 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15557 USE_X_TOOLKIT.
15558
15559 * ftxfont.c: Make symbols static if they're not exported.
15560 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15561 HAVE_FREETYPE.
15562 * font.h (ftxfont_driver): Likewise.
15563
15564 * xfns.c: Make symbols static if they're not exported.
15565 (x_last_font_name, x_display_info_for_name):
15566 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15567 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15568 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15569 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15570 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15571 (last_show_tip_args): Now static.
15572 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15573 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15574 (x_screen_planes): Remove; unused.
15575 * dispextern.h (x_screen_planes): Remove decl.
15576
15577 * dispnew.c: Make symbols static if they're not exported.
15578 * dispextern.h (redraw_garbaged_frames, scrolling):
15579 (increment_row_positions): Remove.
15580 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15581 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15582 Now static.
15583 (redraw_garbaged_frames): Remove; unused.
15584
15585 * xfaces.c: Make symbols static if they're not exported.
15586 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15587 Remove decls.
15588 * xterm.h (defined_color): Remove decls.
15589 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15590 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15591 (menu_face_changed_default, defined_color, free_realized_face):
15592 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15593 (ascii_face_of_lisp_face): Remove; unused.
15594
15595 * xdisp.c: Make symbols static if they're not exported.
15596 * dispextern.h (scratch_glyph_row, window_box_edges):
15597 (glyph_to_pixel_coords, set_cursor_from_row):
15598 (get_next_display_element, set_iterator_to_next):
15599 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15600 (show_mouse_face): Remove decls
15601 * frame.h (message_buf_print): Likewise.
15602 * lisp.h (pop_message, set_message, check_point_in_composition):
15603 Likewise.
15604 * xterm.h (set_vertical_scroll_bar): Likewise.
15605 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15606 (message_buf_print, scratch_glyph_row, displayed_buffer):
15607 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15608 (get_next_display_element, show_mouse_face, window_box_edges):
15609 (frame_to_window_pixel_xy, check_point_in_composition):
15610 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15611 (glyph_to_pixel_coords): Remove; unused.
15612
15613 * dired.c (file_name_completion): Now static.
15614
15615 * dbusbind.c (xd_in_read_queued_messages): Now static.
15616
15617 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15618 * data.c (circular_list_error): Remove.
15619
15620 * commands.h (last_point_position, last_point_position_buffer):
15621 (last_point_position_window): Remove decls.
15622 * keyboard.c: Make these variables static.
15623
15624 * coding.h (coding, code_convert_region, encode_coding_gap):
15625 Remove decls.
15626 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15627 (iso_code_class, detect_coding, code_convert_region): Now static.
15628 (encode_coding_gap): Remove; unused.
15629
15630 * chartab.c (chartab_chars, chartab_bits): Now static.
15631
15632 * charset.h (charset_iso_8859_1): Remove decl.
15633 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15634 Now static.
15635
15636 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15637 * ccl.c (Vccl_program_table): Now static.
15638 (check_ccl_update): Remove; unused.
15639
15640 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15641 * category.h: ... from here.
15642 * category.c (check_category_table, set_category_set): Now static.
15643
15644 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15645 * lisp.h: Remove these decls.
15646
15647 * buffer.c (buffer_count): Remove unused var.
15648
15649 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15650 so that it's not optimized away.
15651 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15652 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15653 exported only to the debugger.
15654
15655 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15656 * atimer.h (run_all_atimers): Remove; not exported.
15657
15658 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15659 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15660 was inaccessible from Lisp.
15661 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15662 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15663
15664 alloc.c: Import and export fewer symbols, and remove unused items.
15665 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15666 is defined.
15667 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15668 it's not optimized away by whole-program optimization.
15669 (message_enable_multibyte, free_misc): Remove.
15670 (catchlist, handlerlist, mark_backtrace):
15671 Declare only if BYTE_MARK_STACK.
15672 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15673 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15674 (message_enable_multibyte): Remove decl.
15675 (free_misc, interval_free_list, float_block, float_block_index):
15676 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15677 (cons_free_list, last_marked_index):
15678 Now static.
15679 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15680 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15681 (mark_backtrace): Define only if BYTE_MARK_STACK.
15682 * xdisp.c (message_enable_multibyte): Now static.
15683
15684 Declare Lisp_Object Q* variables to be 'static' if not exported.
15685 This makes it easier for human readers (and static analyzers)
15686 to see whether these variables are used from other modules.
15687 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15688 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15689 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15690 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15691 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15692 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15693 * xmenu.c, xselect.c:
15694 Declare Q* vars static if they are not used in other modules.
15695 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15696 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15697 Remove decls of unexported vars.
15698 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15699
15700 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15701
15702 Make Emacs functions such as Fatom 'static' by default.
15703 This makes it easier for human readers (and static analyzers)
15704 to see whether these functions can be called from other modules.
15705 DEFUN now defines a static function. To make the function external
15706 so that it can be used in other C modules, use the new macro DEFUE.
15707 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15708 (Finit_image_library):
15709 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15710 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15711 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15712 Remove decls, since these functions are now static.
15713 (Funintern, Fget_internal_run_time): New decls, since these functions
15714 were already external.
15715
15716 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15717 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15718 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15719 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15720 * keyboard.c, keymap.c, lread.c:
15721 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15722 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15723 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15724 Mark functions with DEFUE instead of DEFUN,
15725 if they are used in other modules.
15726 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15727 decls for now-static functions.
15728 * buffer.h (Fdelete_overlay): Remove decl.
15729 * callproc.c (Fgetenv_internal): Mark as internal.
15730 * composite.c (Fremove_list_of_text_properties): Remove decl.
15731 (Fcomposition_get_gstring): New forward static decl.
15732 * composite.h (Fcomposite_get_gstring): Remove decl.
15733 * dired.c (Ffile_attributes): New forward static decl.
15734 * doc.c (Fdocumntation_property): New forward static decl.
15735 * eval.c (Ffetch_bytecode): New forward static decl.
15736 (Funintern): Remove extern decl; now in .h file where it belongs.
15737 * fileio.c (Fmake_symbolic_link): New forward static decl.
15738 * image.c (Finit_image_library): New forward static decl.
15739 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15740 * intervals.h (Fprevious_property_change):
15741 (Fremove_list_of_text_properties): Remove decls.
15742 * keyboard.c (Fthis_command_keys): Remove decl.
15743 (Fcommand_execute): New forward static decl.
15744 * keymap.c (Flookup_key): New forward static decl.
15745 (Fcopy_keymap): Now static.
15746 * keymap.h (Flookup_key): Remove decl.
15747 * process.c (Fget_process): New forward static decl.
15748 (Fprocess_datagram_address): Mark as internal.
15749 * syntax.c (Fsyntax_table_p): New forward static decl.
15750 (skip_chars): Remove duplicate decl.
15751 * textprop.c (Fprevious_property_change): New forward static decl.
15752 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15753 Now internal.
15754 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15755 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15756
15757 * editfns.c (Fformat): Remove unreachable code.
15758
15759 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15760
15761 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15762 change. (Bug#8496)
15763
15764 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15765
15766 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15767 when at ZV. (Bug#8487)
15768
15769 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15770
15771 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15772 (Bug#8437)
15773 * keyboard.c (parse_tool_bar_item): Likewise.
15774 * sound.c (sound_cleanup, alsa_close): Likewise.
15775 * termcap.c (tgetent): Likewise.
15776 * xfns.c (x_default_font_parameter): Likewise.
15777 * xsettings.c (read_and_apply_settings): Likewise.
15778
15779 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15780 (overrun_check_free): Protoize.
15781
15782 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15783
15784 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15785 since callers should never pass a negative size.
15786 Change the signature to match that of plain 'read' and 'write'; see
15787 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15788 * lisp.h: Update prototypes of emacs_write and emacs_read.
15789
15790 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15791
15792 * xdisp.c (redisplay_window): Don't try to determine the character
15793 position of the scroll margin if the window start point w->startp
15794 is outside the buffer's accessible region. (Bug#8468)
15795
15796 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15797
15798 Fix write-region and its subroutines for buffers > 2GB.
15799 * fileio.c (a_write, e_write): Modify declaration of arguments and
15800 local variables to support buffers larger than 2GB.
15801 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15802
15803 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15804 argument, local variables, and return value.
15805
15806 * lisp.h: Update prototypes of emacs_write and emacs_read.
15807
15808 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15809
15810 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15811
15812 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15813
15814 Fix more problems found by GCC 4.6.0's static checks.
15815
15816 * xdisp.c (vmessage): Use a better test for character truncation.
15817
15818 * charset.c (load_charset_map): <, not <=, for optimization,
15819 and to avoid potential problems with integer overflow.
15820 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15821 * casetab.c (set_identity, shuffle): Likewise.
15822 * editfns.c (Fformat): Likewise.
15823 * syntax.c (skip_chars): Likewise.
15824
15825 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15826 This also lets GCC 4.6.0 generate slightly better loop code.
15827
15828 * callint.c (Fcall_interactively): <, not <=, for optimization.
15829 (Fcall_interactively): Count the number of arguments produced,
15830 not the number of arguments given. This is simpler and lets GCC
15831 4.6.0 generate slightly better code.
15832
15833 * ftfont.c: Distingish more carefully between FcChar8 and char.
15834 The previous code passed unsigned char * to a functions like
15835 strlen and xstrcasecmp that expect char *, which does not
15836 conform to the C standard.
15837 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15838 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15839 char * when the C standard requires it.
15840
15841 * keyboard.c (read_char): Remove unused var.
15842
15843 * eval.c: Port to Windows vsnprintf (Bug#8435).
15844 Include <limits.h>.
15845 (SIZE_MAX): Define if the headers do not.
15846 (verror): Do not give up if vsnprintf returns a negative count.
15847 Instead, grow the buffer. This ports to Windows vsnprintf, which
15848 does not conform to C99. Problem reported by Eli Zaretskii.
15849 Also, simplify the allocation scheme, by avoiding the need for
15850 calling realloc, and removing the ALLOCATED variable.
15851
15852 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15853
15854 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15855 But keep the doprint source code for now, as we might revamp it
15856 and use it again (Bug#8435).
15857 * lisp.h (doprnt): Remove.
15858 * Makefile.in (base_obj): Remove doprnt.o.
15859 * deps.mk (doprnt.o): Remove.
15860
15861 error: Print 32- and 64-bit integers portably (Bug#8435).
15862 Without this change, on typical 64-bit hosts error ("...%d...", N)
15863 was used to print both 32- and 64-bit integers N, which relied on
15864 undefined behavior.
15865 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15866 * lisp.h (error, verror): Mark as printf-like functions.
15867 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15868 Report overflow in size calculations when allocating printf buffer.
15869 Do not truncate output string at its first null byte.
15870 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15871 Truncate the output at a character boundary, since vsnprintf does not
15872 do that.
15873 * charset.c (check_iso_charset_parameter): Convert internal
15874 character to string before calling 'error', since %c now has the
15875 printf meaning.
15876 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15877 overflow when computing char to be passed to 'error'. Do not
15878 pass Lisp_Object to 'error'; pass the integer instead.
15879 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15880 formatted with plain %d.
15881
15882 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15883
15884 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15885
15886 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15887
15888 * xterm.c (x_catch_errors): Remove duplicate declaration.
15889
15890 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15891
15892 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15893
15894 2011-04-10 Jim Meyering <meyering@redhat.com>
15895
15896 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15897 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15898 return ssize_t not "int", and use size_t as the buffer length.
15899 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15900 * gnutls.h: Update declarations.
15901 * process.c (read_process_output): Use ssize_t, to match.
15902 (send_process): Likewise.
15903
15904 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15905
15906 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15907
15908 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15909
15910 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15911 Use unsigned char, to match FcChar8 type definition.
15912
15913 * xterm.c (handle_one_xevent):
15914 * xmenu.c (create_and_show_popup_menu):
15915 * xselect.c (x_decline_selection_request)
15916 (x_reply_selection_request): Avoid type-punned deref of X events.
15917
15918 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15919
15920 Fix some uses of `int' instead of EMACS_INT.
15921 * search.c (string_match_1, fast_string_match)
15922 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15923 (scan_buffer, find_next_newline_no_quit)
15924 (find_before_next_newline, search_command, Freplace_match)
15925 (Fmatch_data): Make some `int' variables be EMACS_INT.
15926
15927 * xdisp.c (display_count_lines): 3rd argument and return value now
15928 EMACS_INT. All callers changed.
15929 (pint2hrstr): Last argument is now EMACS_INT.
15930
15931 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15932 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15933 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15934 (decode_coding_utf_16, decode_coding_emacs_mule)
15935 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15936 (decode_coding_ccl, decode_coding_charset)
15937 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15938 (decode_coding_iso_2022, decode_coding_emacs_mule)
15939 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15940 <char_offset, last_offset>: Declare EMACS_INT.
15941 (encode_coding_utf_8, encode_coding_utf_16)
15942 (encode_coding_emacs_mule, encode_invocation_designation)
15943 (encode_designation_at_bol, encode_coding_iso_2022)
15944 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15945 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15946 Declare EMACS_INT.
15947 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15948 (encode_invocation_designation): Last argument P_NCHARS is now
15949 EMACS_INT.
15950 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15951 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15952
15953 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15954 All users changed.
15955
15956 * ccl.c (Fccl_execute_on_string): Declare some variables
15957 EMACS_INT.
15958
15959 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15960
15961 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15962
15963 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15964
15965 * process.c (Fformat_network_address): Doc fix.
15966
15967 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15968
15969 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15970
15971 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15972
15973 * keyboard.c (read_char): Call Lisp function help-form-show,
15974 instead of using internal_with_output_to_temp_buffer.
15975 (Qhelp_form_show): New var.
15976 (syms_of_keyboard): Use DEFSYM macro.
15977
15978 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15979
15980 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15981
15982 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15983
15984 * process.c (Flist_processes): Remove to Lisp.
15985 (list_processes_1): Delete.
15986
15987 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15988
15989 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15990
15991 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15992
15993 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15994
15995 Fix more problems found by GCC 4.6.0's static checks.
15996
15997 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15998
15999 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
16000
16001 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
16002
16003 * xdisp.c (vmessage): Mark as a printf-like function.
16004
16005 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
16006
16007 * sound.c (sound_warning): Don't crash if arg contains a printf format.
16008
16009 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
16010 printf-like functions.
16011 (tiff_load): Add casts to remove these marks before passing them
16012 to system-supplied API.
16013
16014 * eval.c (Fsignal): Remove excess argument to 'fatal'.
16015
16016 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
16017 This avoids several warnings with gcc -Wstrict-overflow.
16018 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
16019 directly, rather than having caller test rule sign. This avoids
16020 some unnecessary tests.
16021 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16022 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16023 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16024
16025 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16026 (xfont_open): Avoid unnecessary tests.
16027
16028 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16029
16030 * composite.h, composite.c (composition_gstring_put_cache):
16031 Use EMACS_INT, not int, for length.
16032
16033 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16034 breaking out part of COMPOSITION_DECODE_RULE.
16035 (COMPOSITION_DECODE_RULE): Use it.
16036 * composite.c (get_composition_id): Remove unused local vars,
16037 by using the new macro.
16038
16039 * textprop.c (set_text_properties_1): Change while to do-while,
16040 since the condition is always true at first.
16041
16042 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16043 (interval_deletion_adjustment): Return unsigned value.
16044 All uses changed.
16045
16046 * process.c (list_processes_1, create_pty, read_process_output):
16047 (exec_sentinel): Remove vars that were set but not used.
16048 (create_pty): Remove unnecessary "volatile"s.
16049 (Fnetwork_interface_info): Avoid possibility of int overflow.
16050 (read_process_output): Do adaptive read buffering even if carryover.
16051 (read_process_output): Simplify nbytes computation if buffered.
16052
16053 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16054
16055 * syntax.c (scan_words): Remove var that was set but not used.
16056 (update_syntax_table): Use unsigned instead of int.
16057
16058 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16059 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16060 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16061
16062 * print.c (print_error_message): Avoid int overflow.
16063
16064 * font.c (font_list_entities): Redo for clarity,
16065 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16066
16067 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16068 (font_score): Avoid potential overflow in diff calculation.
16069
16070 * fns.c (substring_both): Remove var that is set but not used.
16071 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16072
16073 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16074
16075 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16076 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16077 can always succeed if overflow has undefined behavior.
16078
16079 * search.c (boyer_moore, wordify): Remove vars set but not used.
16080 (wordify): Omit three unnecessary tests.
16081
16082 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16083 All callers changed. This avoids the need for an unused var.
16084
16085 * casefiddle.c (casify_region): Remove var that is set but not used.
16086
16087 * dired.c (file_name_completion): Remove var that is set but not used.
16088
16089 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16090
16091 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16092 (Finsert_file_contents): Remove unnecessary code checking fd.
16093
16094 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16095 Check for integer overflow on size calculations.
16096
16097 * buffer.c (Fprevious_overlay_change): Remove var that is set
16098 but not used.
16099
16100 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16101 Remove vars that are set but not used.
16102 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16103 (timer_check_2): Mark vars as initialized.
16104
16105 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16106
16107 * image.c (lookup_image): Remove var that is set but not used.
16108 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16109
16110 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16111 that are set but not used.
16112
16113 * xfns.c (make_invisible_cursor): Don't return garbage
16114 if XCreateBitmapFromData fails (Bug#8410).
16115
16116 * xselect.c (x_get_local_selection, x_handle_property_notify):
16117 Remove vars that are set but not used.
16118
16119 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16120 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16121
16122 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16123 Remove var that is set but not used.
16124 (scroll_bar_windows_size): Now size_t, not int.
16125 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16126 Check for overflow.
16127
16128 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16129 (map_tty_color) [!defined MSDOS]: Likewise.
16130
16131 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16132
16133 * coding.c: Remove vars that are set but not used.
16134 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16135 All callers changed.
16136 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16137 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16138 (decode_coding_charset): Remove vars that are set but not used.
16139
16140 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16141 that is set but not used.
16142
16143 * print.c (print_object): Remove var that is set but not used.
16144
16145 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16146 The gnulib version avoids calling malloc in the usual case,
16147 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16148 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16149 * filelock.c (current_lock_owner): Likewise.
16150 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16151 * sysdep.c: Include allocator.h, careadlinkat.h.
16152 (emacs_no_realloc_allocator): New static constant.
16153 (emacs_readlink): New function.
16154 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16155 ../lib/careadlinkat.h.
16156
16157 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16158
16159 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16160 first non-nil return value).
16161
16162 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16163
16164 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16165 if not defined (Bug#8403).
16166
16167 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16168
16169 * xdisp.c (display_count_lines): Remove parameter `start',
16170 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16171 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16172 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16173 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16174 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16175 and thereabouts. All callers changed.
16176 (get_per_char_metric): Remove parameter `f', unused since
16177 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16178
16179 2011-04-02 Jim Meyering <meyering@redhat.com>
16180
16181 do not dereference NULL upon failed strdup
16182 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16183 (ns_get_family): Likewise.
16184
16185 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16186
16187 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16188
16189 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16190
16191 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16192 later (Bug#8403).
16193
16194 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16195
16196 Add lexical binding.
16197
16198 * window.c (Ftemp_output_buffer_show): New fun.
16199 (Fsave_window_excursion):
16200 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16201
16202 * lread.c (lisp_file_lexically_bound_p): New function.
16203 (Fload): Bind Qlexical_binding.
16204 (readevalloop): Remove `evalfun' arg.
16205 Bind Qinternal_interpreter_environment.
16206 (Feval_buffer): Bind Qlexical_binding.
16207 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16208 Mark as dynamic.
16209 (syms_of_lread): Declare `lexical-binding'.
16210
16211 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16212
16213 * keyboard.c (eval_dyn): New fun.
16214 (menu_item_eval_property): Use it.
16215
16216 * image.c (parse_image_spec): Use Ffunctionp.
16217
16218 * fns.c (concat, mapcar1): Accept byte-code-functions.
16219
16220 * eval.c (Fsetq): Handle lexical vars.
16221 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16222 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16223 (FletX, Flet): Obey lexical binding.
16224 (Fcommandp): Handle closures.
16225 (Feval): New `lexical' arg.
16226 (eval_sub): New function extracted from Feval. Use it almost
16227 everywhere where Feval was used. Look up vars in lexical env.
16228 Handle closures.
16229 (Ffunctionp): Move from subr.el.
16230 (Ffuncall): Handle closures.
16231 (apply_lambda): Remove `eval_flags'.
16232 (funcall_lambda): Handle closures and new byte-code-functions.
16233 (Fspecial_variable_p): New function.
16234 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16235 but without exporting it to Lisp.
16236
16237 * doc.c (Fdocumentation, store_function_docstring):
16238 * data.c (Finteractive_form): Handle closures.
16239
16240 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16241 interactive spec.
16242
16243 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16244 New byte-codes.
16245 (exec_byte_code): New function extracted from Fbyte_code to handle new
16246 calling convention for byte-code-functions. Add new byte-codes.
16247
16248 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16249
16250 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16251
16252 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16253
16254 * xdisp.c (redisplay_internal): Fix prototype.
16255
16256 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16257
16258 * xdisp.c (SCROLL_LIMIT): New macro.
16259 (try_scrolling): Use it when setting scroll_limit.
16260 Limit scrolling to 100 screen lines.
16261 (redisplay_window): Even when falling back on "recentering",
16262 position point in the window according to scroll-conservatively,
16263 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16264
16265 (try_scrolling): When point is above the window, allow searching
16266 as far as scroll_max, or one screenful, to compute vertical
16267 distance from PT to the scroll margin position. This prevents
16268 try_scrolling from unnecessarily failing when
16269 scroll-conservatively is set to a value slightly larger than the
16270 window height. Clean up the case of PT below the margin at bottom
16271 of window: scroll_max can no longer be INT_MAX. When aggressive
16272 scrolling is in use, don't let point enter the opposite scroll
16273 margin as result of the scroll.
16274 (syms_of_xdisp) <scroll-conservatively>: Document the
16275 threshold of 100 lines for never-recentering scrolling.
16276
16277 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16278
16279 * dispextern.h (move_it_by_lines):
16280 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16281 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16282 (message_log_check_duplicate): Remove parameters `prev_bol' and
16283 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16284 (redisplay_internal): Remove parameter `preserve_echo_area',
16285 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16286
16287 * indent.c (Fvertical_motion):
16288 * window.c (window_scroll_pixel_based, Frecenter):
16289 Don't pass `need_y_p' to `move_it_by_lines'.
16290
16291 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16292
16293 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16294 steal a few bits to be more compact.
16295 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16296 Remove unneeded casts.
16297
16298 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16299
16300 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16301
16302 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16303 binding" message (bug#7967).
16304
16305 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16306
16307 Fix more problems found by GCC 4.6.0's static checks.
16308
16309 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16310 Remove unused local var.
16311
16312 * editfns.c (Fmessage_box): Remove unused local var.
16313
16314 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16315 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16316 Omit unused local vars.
16317 * window.c (shrink_windows): Omit unused local var.
16318 * menu.c (digest_single_submenu): Omit unused local var.
16319 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16320 Omit unused local var.
16321
16322 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16323 Don't assume string length fits in int.
16324 (keyremap_step, read_key_sequence): Use size_t for sizes.
16325 (read_key_sequence): Don't check last_real_key_start redundantly.
16326
16327 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16328 instead of alloca (Bug#8344).
16329
16330 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16331 (Fbacktrace_frame): Don't assume nframes fits in int.
16332
16333 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16334
16335 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16336 concerns.
16337
16338 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16339
16340 * cm.c (calccost): Turn while-do into do-while, for clarity.
16341
16342 * keyboard.c (syms_of_keyboard): Use the same style as later
16343 in this function when indexing through an array. This also
16344 works around GCC bug 48267.
16345
16346 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16347
16348 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16349
16350 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16351 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16352
16353 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16354 This avoids undefined behavior on integer overflow, and is a bit
16355 more convenient anyway since it is compared to a size_t variable.
16356
16357 Variadic C functions now count arguments with size_t, not int.
16358 This avoids an unnecessary limitation on 64-bit machines, which
16359 caused (substring ...) to crash on large vectors (Bug#8344).
16360 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16361 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16362 All variadic functions and their callers changed accordingly.
16363 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16364 * data.c (arith_driver, float_arith_driver): Likewise.
16365 * editfns.c (general_insert_function): Likewise.
16366 * eval.c (struct backtrace.nargs, interactive_p)
16367 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16368 (funcall_lambda, mark_backtrace): Likewise.
16369 * fns.c (concat): Likewise.
16370 * frame.c (x_set_frame_parameters): Likewise.
16371 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16372 0 if not found, not -1. All callers changed.
16373
16374 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16375 (stack_copy_size): Now size_t, not int.
16376 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16377
16378 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16379
16380 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16381 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16382 All callers changed.
16383
16384 * lisp.h (multibyte_char_to_unibyte):
16385 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16386 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16387 * character.h (CHAR_TO_BYTE8):
16388 * cmds.c (internal_self_insert):
16389 * editfns.c (general_insert_function):
16390 * keymap.c (push_key_description):
16391 * search.c (Freplace_match):
16392 * xdisp.c (message_dolog, set_message_1): All callers changed.
16393
16394 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16395
16396 * keyboard.c (safe_run_hook_funcall): New function.
16397 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16398 don't set the hook to nil, but remove the offending function instead.
16399 (Qcommand_hook_internal): Remove, unused.
16400 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16401 Vcommand_hook_internal.
16402
16403 * eval.c (enum run_hooks_condition): Remove.
16404 (funcall_nil, funcall_not): New functions.
16405 (run_hook_with_args): Call each function through a `funcall' argument.
16406 Remove `cond' argument, now redundant.
16407 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16408 (Frun_hook_with_args_until_failure): Adjust accordingly.
16409 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16410
16411 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16412
16413 * dispextern.h (string_buffer_position): Remove declaration.
16414
16415 * print.c (strout): Remove parameter `multibyte', unused since
16416 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16417
16418 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16419 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16420 All callers changed.
16421
16422 * w32.c (_wsa_errlist): Use braces for struct initializers.
16423
16424 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16425 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16426 All callers changed.
16427 (string_buffer_position): Likewise. Also, make static (it's never
16428 used outside xdisp.c).
16429 (cursor_row_p): Remove parameter `w', unused since
16430 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16431 (decode_mode_spec): Remove parameter `precision', introduced during
16432 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16433 All callers changed.
16434
16435 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16436
16437 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16438
16439 2011-03-27 Anders Lindgren <andlind@gmail.com>
16440
16441 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16442 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16443 (ns_update_auto_hide_menu_bar): New functions.
16444 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16445 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16446 ns_constrain_all_frames.
16447 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16448 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16449
16450 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16451
16452 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16453
16454 2011-03-27 Glenn Morris <rgm@gnu.org>
16455
16456 * syssignal.h: Replace RETSIGTYPE with void.
16457 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16458 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16459 Replace SIGTYPE with void everywhere.
16460 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16461 * s/template.h (SIGTYPE): Remove commented out definition.
16462
16463 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16464
16465 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16466 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16467
16468 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16469
16470 * w32.c (read_unc_volume): Use parameter `henum', instead of
16471 global variable `wget_enum_handle'.
16472
16473 * keymap.c (describe_vector): Remove parameters `indices' and
16474 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16475 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16476
16477 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16478
16479 * keyboard.c (timer_check): Remove parameter `do_it_now',
16480 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16481 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16482 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16483
16484 * keyboard.c (read_char):
16485 * w32menu.c (w32_menu_display_help):
16486 * xmenu.c (show_help_event, menu_help_callback):
16487 Adjust calls to `show_help_echo'.
16488
16489 * gtkutil.c (xg_maybe_add_timer):
16490 * keyboard.c (readable_events):
16491 * process.c (wait_reading_process_output):
16492 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16493
16494 * insdel.c (adjust_markers_gap_motion):
16495 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16496 (gap_left, gap_right): Don't call it.
16497
16498 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16499
16500 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16501 incurred during fontification.
16502
16503 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16504
16505 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16506 (DEFVAR_PER_BUFFER): Don't pass it.
16507
16508 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16509 (scrolling_window): Don't pass it.
16510
16511 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16512
16513 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16514
16515 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16516 and `suffix'.
16517 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16518 of variables specific to SELinux and computation of `encoded_absname'.
16519
16520 * image.c (XPutPixel): Remove unused variable `height'.
16521
16522 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16523
16524 * unexw32.c (get_section_info): Remove unused variable `section'.
16525
16526 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16527 (system_process_attributes): Remove unused variable `sess'.
16528 (sys_read): Remove unused variable `err'.
16529
16530 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16531 (w32_wnd_proc): Remove unused variable `isdead'.
16532 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16533 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16534 (x_create_tip_frame): Remove unused variable `tem'.
16535
16536 * w32inevt.c (w32_console_read_socket):
16537 Remove unused variable `no_events'.
16538
16539 * w32term.c (x_draw_composite_glyph_string_foreground):
16540 Remove unused variable `width'.
16541
16542 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16543
16544 * w32term.c (x_set_glyph_string_clipping):
16545 Don't pass uninitialized region to CombineRgn.
16546
16547 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16548
16549 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16550 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16551 (Fx_close_connection): Remove unused variable `i'.
16552
16553 * w32font.c (w32font_draw): Return number of glyphs.
16554 (w32font_open_internal): Remove unused variable `i'.
16555 (w32font_driver): Add missing initializer.
16556
16557 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16558 (fill_in_menu): Remove unused variable `items_added'.
16559
16560 * w32term.c (last_mouse_press_frame): Remove static global variable.
16561 (w32_clip_to_row): Remove unused variable `f'.
16562 (x_delete_terminal): Remove unused variable `i'.
16563
16564 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16565 (NOTHING): Remove unused static global variable.
16566 (uniscribe_check_otf): Remove unused variable `table'.
16567 (uniscribe_font_driver): Add missing initializers.
16568
16569 2011-03-23 Julien Danjou <julien@danjou.info>
16570
16571 * term.c (Fsuspend_tty, Fresume_tty):
16572 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16573 * window.c (temp_output_buffer_show):
16574 * insdel.c (signal_before_change):
16575 * frame.c (Fhandle_switch_frame):
16576 * fileio.c (Fdo_auto_save):
16577 * emacs.c (Fkill_emacs):
16578 * editfns.c (save_excursion_restore):
16579 * cmds.c (internal_self_insert):
16580 * callint.c (Fcall_interactively):
16581 * buffer.c (Fkill_all_local_variables):
16582 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16583 Use Frun_hooks.
16584 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16585 unconditionally since it does the check itself.
16586
16587 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16588
16589 Fix more problems found by GCC 4.5.2's static checks.
16590
16591 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16592 the first time through the loop, since we know p0 < p1 then.
16593 This also avoids a gcc -Wstrict-overflow warning.
16594
16595 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16596 leading to a memory leak, possible in functions like
16597 load_charset_map_from_file that can allocate an unbounded number
16598 of objects (Bug#8318).
16599
16600 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16601 that could (at least in theory) be that large.
16602
16603 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16604 This is less likely to overflow, and avoids undefined behavior if
16605 overflow does occur. All callers changed. Use strtoul to scan
16606 for the unsigned long integer.
16607 (pint2hrstr): Simplify and tune code slightly.
16608 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16609
16610 * scroll.c (do_scrolling): Work around GCC bug 48228.
16611 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16612
16613 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16614 This also avoids a warning with gcc -Wstrict-overflow.
16615 (validate_x_resource_name): Simplify count usage.
16616 This also avoids a warning with gcc -Wstrict-overflow.
16617
16618 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16619 fail (Bug#8306).
16620
16621 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16622
16623 * process.c (Fmake_network_process): Use socklen_t, not int,
16624 where POSIX says socklen_t is required in portable programs.
16625 This fixes a porting bug on hosts like 64-bit HP-UX, where
16626 socklen_t is wider than int (Bug#8277).
16627 (Fmake_network_process, server_accept_connection):
16628 (wait_reading_process_output, read_process_output):
16629 Likewise.
16630
16631 * process.c: Rename or move locals to avoid shadowing.
16632 (list_processes_1, Fmake_network_process):
16633 (read_process_output_error_handler, exec_sentinel_error_handler):
16634 Rename or move locals.
16635 (Fmake_network_process): Define label "retry_connect" only if needed.
16636 (Fnetwork_interface_info): Fix pointer signedness.
16637 (process_send_signal): Add cast to avoid pointer signedness problem.
16638 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16639 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16640
16641 Make tparam.h and terminfo.c consistent.
16642 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16643 Include tparam.h instead, since it declares them.
16644 * cm.h (PC): Remove extern decl; tparam.h now does this.
16645 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16646 * terminfo.c: Include tparam.h, to check interfaces.
16647 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16648 (tparam): Adjust signature to match interface in tparam.h;
16649 this removes some undefined behavior. Check that outstring and len
16650 are zero, which they always are with Emacs.
16651 * tparam.h (PC, BC, UP): New extern decls.
16652
16653 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16654 (xftfont_open): Rename locals to avoid shadowing.
16655
16656 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16657 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16658 (OTF_TAG_SYM): Omit macro if not needed.
16659 (ftfont_list): Remove unused local.
16660 (get_adstyle_property, ftfont_pattern_entity):
16661 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16662 Rename locals to avoid shadowing.
16663
16664 * xfont.c (xfont_list_family): Mark var as initialized.
16665
16666 * xml.c (make_dom): Now static.
16667
16668 * composite.c (composition_compute_stop_pos): Rename local to
16669 avoid shadowing.
16670 (composition_reseat_it): Remove unused locals.
16671 (find_automatic_composition, composition_adjust_point): Likewise.
16672 (composition_update_it): Mark var as initialized.
16673 (find_automatic_composition): Mark vars as initialized,
16674 with a FIXME (Bug#8290).
16675
16676 character.h: Rename locals to avoid shadowing.
16677 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16678 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16679 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16680 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16681 to avoid shadowing.
16682
16683 * textprop.c (property_change_between_p): Remove; unused.
16684
16685 * intervals.c (interval_start_pos): Now static.
16686
16687 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16688
16689 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16690 Rename locals to avoid shadowing.
16691
16692 * sound.c (wav_play, au_play, Fplay_sound_internal):
16693 Fix pointer signedness.
16694 (alsa_choose_format): Remove unused local var.
16695 (wav_play): Initialize a variable to 0, to prevent undefined
16696 behavior (Bug#8278).
16697
16698 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16699
16700 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16701
16702 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16703 clobbering (Bug#8298).
16704 * sysdep.c (sys_subshell): Likewise.
16705 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16706
16707 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16708 This should get cleaned up, so that child_setup has the
16709 same signature on all platforms.
16710
16711 * callproc.c (call_process_cleanup): Now static.
16712 (relocate_fd): Rename locals to avoid shadowing.
16713
16714 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16715
16716 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16717 not to be necessary, and produces flickering.
16718
16719 2011-03-20 Glenn Morris <rgm@gnu.org>
16720
16721 * config.in: Remove file.
16722
16723 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16724
16725 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16726 are now in src/globals.h.
16727 (syms_of_minibuf): Remove spurious & from previous change.
16728
16729 2011-03-20 Leo Liu <sdl.web@gmail.com>
16730
16731 * minibuf.c (completing-read-function): New variable.
16732 (completing-read-default): Rename from completing-read.
16733 (completing-read): Call completing-read-function.
16734
16735 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16736
16737 * xfaces.c (Fx_load_color_file):
16738 Read color file from absolute filename (bug#8250).
16739
16740 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16741
16742 * makefile.w32-in: Update dependencies.
16743
16744 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16745
16746 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16747
16748 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16749
16750 Fix more problems found by GCC 4.5.2's static checks.
16751
16752 * process.c (make_serial_process_unwind, send_process_trap):
16753 (sigchld_handler): Now static.
16754
16755 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16756 That way, the code declares only the vars that it needs.
16757 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16758 * s/cygwin.h (PTY_ITERATION): Likewise.
16759 * s/darwin.h (PTY_ITERATION): Likewise.
16760 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16761
16762 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16763 * process.c (allocate_pty): Don't declare stb unless it's needed.
16764
16765 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16766 (CONSTANTLIM): Remove; unused.
16767 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16768 Define only if needed.
16769
16770 * unexelf.c (unexec): Name an expression,
16771 to avoid gcc -Wbad-function-cast warning.
16772 Use a different way to cause a compilation error if anyone uses
16773 n rather than nn, a way that does not involve shadowing.
16774 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16775
16776 * deps.mk (unexalpha.o): Remove; unused.
16777
16778 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16779 * unexec.h: New file.
16780 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16781 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16782 Depend on unexec.h.
16783 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16784 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16785 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16786 Change as necessary to match prototype in unexec.h.
16787
16788 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16789 shadowing.
16790 (back_comment, skip_chars): Mark vars as initialized.
16791
16792 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16793 Rename locals to avoid shadowing.
16794
16795 * lread.c (read1): Rewrite so as not to use empty "else".
16796 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16797
16798 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16799
16800 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16801 warning when compiling print.c.
16802
16803 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16804 instead of using an uninitialized var.
16805 (font_sort_entities): Mark var as initialized.
16806
16807 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16808
16809 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16810 pointers to constants.
16811 (font_parse_fcname): Remove unused vars.
16812 (font_delete_unmatched): Now static.
16813 (font_get_spec): Remove; unused.
16814 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16815 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16816 Rename or move locals to avoid shadowing.
16817
16818 * fns.c (require_nesting_list, require_unwind): Now static.
16819 (Ffillarray): Rename locals to avoid shadowing.
16820
16821 * floatfns.c (domain_error2): Define only if needed.
16822 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16823
16824 * alloc.c (mark_backtrace): Move decl from here ...
16825 * lisp.h: ... to here, so that it can be checked.
16826
16827 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16828 (Fdefvar): Rewrite so as not to use empty "else".
16829 (lisp_indirect_variable): Name an expression,
16830 to avoid gcc -Wbad-function-cast warning.
16831 (Fdefvar): Rename locals to avoid shadowing.
16832
16833 * callint.c (quotify_arg, quotify_args): Now static.
16834 (Fcall_interactively): Rename locals to avoid shadowing.
16835 Use const pointer when appropriate.
16836
16837 * lisp.h (get_system_name, get_operating_system_release):
16838 Move decls here, to check interfaces.
16839 * process.c (get_operating_system_release): Move decl to lisp.h.
16840 * xrdb.c (get_system_name): Likewise.
16841 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16842 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16843 some of which prompt warnings from gcc -Wbad-function-cast.
16844 (Fformat_time_string, Fencode_time, Finsert_char):
16845 (Ftranslate_region_internal, Fformat):
16846 Rename or remove local vars to avoid shadowing.
16847 (Ftranslate_region_internal): Mark var as initialized.
16848
16849 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16850 avoid shadowing.
16851
16852 * lisp.h (eassert): Check that the argument compiles, even if
16853 ENABLE_CHECKING is not defined.
16854
16855 * data.c (Findirect_variable): Name an expression, to avoid
16856 gcc -Wbad-function-cast warning.
16857 (default_value, arithcompare, arith_driver, arith_error): Now static.
16858 (store_symval_forwarding): Rename local to avoid shadowing.
16859 (Fmake_variable_buffer_local, Fmake_local_variable):
16860 Mark variables as initialized.
16861 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16862
16863 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16864 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16865 Rename locals to avoid shadowing.
16866 (mark_stack): Move local variables into the #ifdef region where
16867 they're used.
16868 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16869 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16870 needed otherwise.
16871 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16872 (GC_STRING_CHARS): Remove; not used.
16873 (Fmemory_limit): Cast sbrk's returned value to char *.
16874
16875 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16876 avoids undefined behavior in theory.
16877
16878 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16879
16880 Use functions, not macros, for up- and down-casing (Bug#8254).
16881 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16882 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16883 to use the following functions instead of these macros.
16884 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16885 EMACS_INT, since callers assume the returned value fits in int.
16886 (upcase1): Likewise, for UPCASE_TABLE.
16887 (uppercasep, lowercasep, upcase): New static inline functions.
16888 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16889 the race-condition problem in the old DOWNCASE.
16890
16891 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16892 Rename locals to avoid shadowing.
16893 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16894 (regex_compile, re_search_2, re_match_2_internal):
16895 Remove unused local vars.
16896 (FREE_VAR): Rewrite so as not to use empty "else",
16897 which gcc can warn about.
16898 (regex_compile, re_match_2_internal): Mark locals as initialized.
16899 (RETALLOC_IF): Define only if needed.
16900 (WORDCHAR_P): Likewise. This one is never needed, but is used
16901 only in a comment talking about a compiler bug, so put inside
16902 the #if 0 of that comment.
16903 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16904 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16905 Remove; unused.
16906
16907 * search.c (boyer_moore): Rename locals to avoid shadowing.
16908 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16909 (PREV_CHAR_BOUNDARY): Likewise.
16910
16911 * search.c (simple_search): Remove unused var.
16912
16913 * dired.c (compile_pattern): Move decl from here ...
16914 * lisp.h: ... to here, so that it can be checked.
16915 (struct re_registers): New forward decl.
16916
16917 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16918
16919 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16920 All uses changed.
16921 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16922 Rename locals to avoid shadowing.
16923 (Fvertical_motion): Mark locals as initialized.
16924
16925 * casefiddle.c (casify_object, casify_region): Now static.
16926 (casify_region): Mark local as initialized.
16927
16928 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16929
16930 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16931 New macros, so that the caller can use some names other than
16932 gcpro1, gcpro2, etc.
16933 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16934 of the new macros.
16935 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16936 argument, for consistency with GCPRO2_VAR, etc: it is now the
16937 prefix of the variable, not the variable itself. All uses
16938 changed.
16939 * dired.c (directory_files_internal, file_name_completion):
16940 Rename locals to avoid shadowing.
16941
16942 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16943 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16944 dired.c's scmp function, had undefined behavior.
16945 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16946 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16947 * buffer.h: ... to here, because these macros use current_buffer,
16948 and the new implementation with inline functions needs to have
16949 current_buffer in scope now, rather than later when the macros
16950 are used.
16951 (downcase, upcase1): New static inline functions.
16952 (DOWNCASE, UPCASE1): Reimplement using these functions.
16953 This avoids undefined behavior in expressions like
16954 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16955 from race conditions in accessing the global variables
16956 case_temp1 and case_temp2.
16957 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16958 * lisp.h (case_temp1, case_temp2): Remove their decls.
16959 * character.h (ASCII_CHAR_P): Move from here ...
16960 * lisp.h: ... to here, so that the inline functions mentioned
16961 above can use them.
16962
16963 * dired.c (directory_files_internal_unwind): Now static.
16964
16965 * fileio.c (file_name_as_directory, directory_file_name):
16966 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16967 Now static.
16968 (file_name_as_directory): Use const pointers when appropriate.
16969 (Fexpand_file_name): Likewise. In particular, newdir might
16970 point at constant storage, so make it a const pointer.
16971 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16972 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16973 signedness issues.
16974 (Fset_file_times, Finsert_file_contents, auto_save_error):
16975 Rename locals to avoid shadowing.
16976
16977 * minibuf.c (choose_minibuf_frame_1): Now static.
16978 (Ftry_completion, Fall_completions): Rename or remove locals
16979 to avoid shadowing.
16980
16981 * marker.c (bytepos_to_charpos): Remove; unused.
16982
16983 * lisp.h (verify_bytepos, count_markers): New decls,
16984 so that gcc does not warn that these functions aren't declared.
16985
16986 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16987 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16988 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16989 (copy_text): Remove unused local var.
16990
16991 * filelock.c (within_one_second): Now static.
16992 (lock_file_1): Rename local to avoid shadowing.
16993
16994 * buffer.c (fix_overlays_before): Mark locals as initialized.
16995 (fix_start_end_in_overlays): Likewise. This function should be
16996 simplified by using pointers-to-pointers, but that's a different
16997 matter.
16998 (switch_to_buffer_1): Now static.
16999 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
17000 (report_overlay_modification): Rename locals to avoid shadowing.
17001
17002 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
17003 Fix pointer signedness issue.
17004 (sys_subshell): Mark local as volatile if checking for lint,
17005 to suppress a gcc -Wclobbered warning that does not seem to be right.
17006 (MAXPATHLEN): Define only if needed.
17007
17008 * process.c (serial_open, serial_configure): Move decls from here ...
17009 * systty.h: ... to here, so that they can be checked.
17010
17011 * fns.c (get_random, seed_random): Move extern decls from here ...
17012 * lisp.h: ... to here, so that they can be checked.
17013
17014 * sysdep.c (reset_io): Now static.
17015 (wait_for_termination_signal): Remove; unused.
17016
17017 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
17018 (copy_keymap_item, append_key, push_text_char_description):
17019 Now static.
17020 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17021 (DENSE_TABLE_SIZE): Remove; unused.
17022 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17023 (describe_map_tree):
17024 Rename locals to avoid shadowing.
17025
17026 * keyboard.c: Declare functions static if they are not used elsewhere.
17027 (echo_char, echo_dash, cmd_error, top_level_2):
17028 (poll_for_input, handle_async_input): Now static.
17029 (read_char, kbd_buffer_get_event, make_lispy_position):
17030 (make_lispy_event, make_lispy_movement, apply_modifiers):
17031 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17032 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17033 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17034 (read_key_sequence, read_char): Mark locals as initialized.
17035 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17036
17037 * keyboard.h (make_ctrl_char): New decl.
17038 (mark_kboards): Move decl here ...
17039 * alloc.c (mark_kboards): ... from here.
17040
17041 * lisp.h (force_auto_save_soon): New decl.
17042
17043 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17044 (DEFINE_DUMMY_FUNCTION): New macro.
17045 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17046 Use it.
17047 (main): Add casts to avoid warnings
17048 if GCC considers string literals to be constants.
17049
17050 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17051
17052 * dbusbind.c: Pointer signedness fixes.
17053 (xd_signature, xd_append_arg, xd_initialize):
17054 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17055 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17056 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17057 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17058
17059 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17060 if GCC considers string literals to be constants.
17061 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17062
17063 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17064
17065 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17066 (print_preprocess, print_object): New macro to fix last change.
17067
17068 * print.c (print_preprocess): Don't forget font objects.
17069
17070 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17071
17072 * emacs.c (USAGE3): Doc fixes.
17073
17074 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17075
17076 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17077 structure.
17078
17079 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17080
17081 * lisp.h (VWindow_system, Qfile_name_history):
17082 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17083 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17084 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17085
17086 * w32select.c: Don't #include "keyboard.h".
17087 (run_protected): Add extern declaration for waiting_for_input.
17088
17089 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17090 * w32console.c (detect_input_pending, read_input_pending)
17091 (encode_terminal_code):
17092 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17093 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17094 (w32_system_caret_y, Qfile_name_history):
17095 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17096 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17097 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17098 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17099 * w32proc.c (Qlocal, report_file_error):
17100 * w32term.c (Vwindow_system, updating_frame):
17101 * w32uniscribe.c (initialized, uniscribe_font_driver):
17102 Remove unneeded extern declarations.
17103
17104 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17105
17106 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17107
17108 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17109
17110 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17111 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17112 These macros can no longer be used for assignment.
17113
17114 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17115 Assign struct members directly, instead of using BUF_BEGV etc.
17116 (record_buffer_markers, fetch_buffer_markers): New functions for
17117 recording and fetching special buffer markers.
17118 (set_buffer_internal_1, set_buffer_temp): Use them.
17119
17120 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17121
17122 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17123
17124 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17125 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17126
17127 * xdisp.c (hscroll_window_tree):
17128 (reconsider_clip_changes): Use PT instead of BUF_PT.
17129
17130 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17131
17132 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17133 $(EMACS_ROOT)/lib/intprops.h.
17134
17135 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17136
17137 Fix more problems found by GCC 4.5.2's static checks.
17138
17139 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17140 to unsigned char * to avoid compiler diagnostic.
17141 (xg_free_frame_widgets): Make it clear that a local variable is
17142 needed only if USE_GTK_TOOLTIP.
17143 (gdk_window_get_screen): Make it clear that this macro is needed
17144 only if USE_GTK_TOOLTIP.
17145 (int_gtk_range_get_value): New function, which avoids a diagnostic
17146 from gcc -Wbad-function-cast.
17147 (xg_set_toolkit_scroll_bar_thumb): Use it.
17148 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17149 diagnostic from gcc -Wbad-function-cast.
17150 (get_utf8_string, xg_get_file_with_chooser):
17151 Rename locals to avoid shadowing.
17152 (create_dialog): Move locals to avoid shadowing.
17153
17154 * xgselect.c (xg_select): Remove unused var.
17155
17156 * image.c (four_corners_best): Mark locals as initialized.
17157 (gif_load): Initialize transparent_p to zero (Bug#8238).
17158 Mark another local as initialized.
17159 (my_png_error, my_error_exit): Mark with NO_RETURN.
17160
17161 * image.c (clear_image_cache): Now static.
17162 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17163 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17164 (x_edge_detection): Remove unnecessary cast that
17165 gcc -Wbad-function-cast diagnoses.
17166 (gif_load): Fix pointer signedness.
17167 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17168 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17169
17170 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17171
17172 Improve quality of tests for time stamp overflow.
17173 For example, without this patch (encode-time 0 0 0 1 1
17174 1152921504606846976) returns the obviously-bogus value (-948597
17175 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17176 reports time overflow. See
17177 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17178 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17179 * editfns.c: Include limits.h and intprops.h.
17180 (TIME_T_MIN, TIME_T_MAX): New macros.
17181 (time_overflow): Move earlier, to before first use.
17182 (hi_time, lo_time): New functions, for an accurate test for
17183 out-of-range times.
17184 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17185 (Fget_internal_run_time): Don't assume time_t fits in int.
17186 (make_time): Use list2 instead of Fcons twice.
17187 (Fdecode_time): More accurate test for out-of-range times.
17188 (check_tm_member): New function.
17189 (Fencode_time): Use it, to test for out-of-range times.
17190 (lisp_time_argument): Don't rely on undefined left-shift and
17191 right-shift behavior when checking for time stamp overflow.
17192
17193 * editfns.c (time_overflow): New function, refactoring common code.
17194 (Fformat_time_string, Fdecode_time, Fencode_time):
17195 (Fcurrent_time_string): Use it.
17196
17197 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17198 * dired.c (make_time): Move to ...
17199 * editfns.c (make_time): ... here.
17200 * systime.h: Note the move.
17201
17202 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17203
17204 * fringe.c (update_window_fringes): Remove unused variables.
17205
17206 * unexmacosx.c (copy_data_segment): Also copy __got section.
17207 (Bug#8223)
17208
17209 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17210
17211 * termcap.c [MSDOS]: Include "msdos.h".
17212 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17213 Constify `char *' arguments and their references according to
17214 prototypes in tparam.h.
17215
17216 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17217
17218 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17219 Adapt all references accordingly.
17220
17221 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17222
17223 2011-03-11 Tom Tromey <tromey@redhat.com>
17224
17225 * buffer.c (syms_of_buffer): Remove obsolete comment.
17226
17227 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17228
17229 * termhooks.h (encode_terminal_code): Declare prototype.
17230
17231 * msdos.c (encode_terminal_code): Don't declare prototype.
17232
17233 * term.c (encode_terminal_code): Now external again, used by
17234 w32console.c and msdos.c.
17235
17236 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17237 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17238
17239 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17240
17241 Fix some minor problems found by GCC 4.5.2's static checks.
17242
17243 * fringe.c (update_window_fringes): Mark locals as initialized
17244 (Bug#8227).
17245 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17246
17247 * alloc.c (mark_fringe_data): Move decl from here ...
17248 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17249 to check its interface.
17250 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17251
17252 * fontset.c (free_realized_fontset): Now static.
17253 (Fset_fontset_font): Rename local to avoid shadowing.
17254 (fontset_font): Mark local as initialized.
17255 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17256
17257 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17258
17259 * xselect.c (x_disown_buffer_selections): Remove; not used.
17260 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17261 (x_own_selection, Fx_disown_selection_internal): Rename locals
17262 to avoid shadowing.
17263 (x_handle_dnd_message): Remove local to avoid shadowing.
17264
17265 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17266 so that the caller can use some name other than gcpro1.
17267 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17268 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17269 (Fx_backspace_delete_keys_p):
17270 Use them to avoid shadowing, and rename vars to avoid shadowing.
17271 (x_decode_color, x_set_name, x_window): Now static.
17272 (Fx_create_frame): Add braces to silence GCC warning.
17273 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17274 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17275 Remove unused locals.
17276 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17277 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17278 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17279 macros.
17280
17281 * xterm.h (x_mouse_leave): New decl.
17282
17283 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17284 Remove unused functions.
17285 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17286 (x_calc_absolute_position): Now static.
17287 (XTread_socket): Don't define label "out" unless it's used.
17288 Don't declare local "event" unless it's used.
17289 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17290 unless they are used.
17291 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17292 (x_fatal_error_signal): Remove; not used.
17293 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17294 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17295 (x_error_catcher, x_connection_closed, x_error_handler):
17296 (x_error_quitter, xembed_send_message, x_iconify_frame):
17297 (my_log_handler): Rename locals to avoid shadowing.
17298 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17299 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17300
17301 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17302 Rename or move locals to avoid shadowing.
17303 (tty_defined_color, merge_face_heights): Now static.
17304 (free_realized_faces_for_fontset): Remove; not used.
17305 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17306 does not deduce is never used uninitialized.
17307 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17308 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17309
17310 * terminal.c (store_terminal_param): Now static.
17311
17312 * xmenu.c (menu_highlight_callback): Now static.
17313 (set_frame_menubar): Remove unused local.
17314 (xmenu_show): Rename parameter to avoid shadowing.
17315 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17316 since they might point to immutable storage.
17317 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17318 since it's unused otherwise.
17319
17320 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17321 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17322 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17323 avoids a gcc -Wuninitialized diagnostic.
17324 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17325 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17326 does not deduce are never used uninitialized.
17327
17328 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17329
17330 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17331 * window.c (window_loop, size_window):
17332 (run_window_configuration_change_hook, enlarge_window): Likewise.
17333
17334 * window.c (display_buffer): Now static.
17335 (size_window): Mark variables that gcc -Wuninitialized
17336 does not deduce are never used uninitialized.
17337 * window.h (check_all_windows): New decl, to forestall
17338 gcc -Wmissing-prototypes diagnostic.
17339 * dispextern.h (bidi_dump_cached_states): Likewise.
17340
17341 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17342 shadowing.
17343 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17344 Include <limits.h>.
17345 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17346 and to avoid gcc -Wuninitialized warning.
17347 (load_charset_map): Mark variables that gcc -Wuninitialized
17348 does not deduce are never used uninitialized.
17349 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17350
17351 * coding.c (coding_set_source, coding_set_destination):
17352 Use "else { /* comment */ }" rather than "else /* comment */;"
17353 for clarity, and to avoid gcc -Wempty-body warning.
17354 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17355 a block, when the outer 'i' will do.
17356 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17357 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17358 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17359 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17360 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17361 Rename locals to avoid shadowing.
17362 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17363 * coding.c (emacs_mule_char, encode_invocation_designation):
17364 Now static, since they're not used elsewhere.
17365 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17366 (decode_coding_object, encode_coding_object, detect_coding_system):
17367 (decode_coding_emacs_mule): Mark variables that gcc
17368 -Wuninitialized does not deduce are never used uninitialized.
17369 (detect_coding_iso_2022): Initialize a local variable that might
17370 be used uninitialized. Leave a FIXME because it's not clear that
17371 this initialization is needed. (Bug#8211)
17372 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17373 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17374 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17375 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17376 Remove unused macros.
17377
17378 * category.c (hash_get_category_set): Remove unused local var.
17379 (copy_category_table): Now static, since it's not used elsewhere.
17380 * character.c (string_count_byte8): Likewise.
17381
17382 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17383 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17384
17385 * chartab.c (copy_sub_char_table): Now static, since it's not used
17386 elsewhere.
17387 (sub_char_table_ref_and_range, char_table_ref_and_range):
17388 Rename locals to avoid shadowing.
17389 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17390
17391 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17392 (BIDI_BOB): Remove unused macro.
17393
17394 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17395 deduce are never used uninitialized.
17396 * term.c (encode_terminal_code): Likewise.
17397
17398 * term.c (encode_terminal_code): Now static. Remove unused local.
17399
17400 * tparam.h: New file.
17401 * term.c, tparam.h: Include it.
17402 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17403 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17404 Move these decls to tparam.h, and make them agree with what
17405 is actually in tparam.c. The previous trick of using incompatible
17406 decls in different modules does not conform to the C standard.
17407 All callers of tparam changed to use tparam's actual API.
17408 * tparam.c (tparam1, tparam, tgoto):
17409 Use const pointers where appropriate.
17410
17411 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17412 * cm.h (struct cm): Likewise.
17413 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17414 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17415 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17416 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17417 (turn_on_face, init_tty): Likewise.
17418 * termchar.h (struct tty_display_info): Likewise.
17419
17420 * term.c (term_mouse_position): Rename local to avoid shadowing.
17421
17422 * alloc.c (mark_ttys): Move decl from here ...
17423 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17424
17425 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17426
17427 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17428
17429 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17430
17431 * search.c (compile_pattern_1): Remove argument regp, unused since
17432 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17433 (compile_pattern): Don't pass it.
17434
17435 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17436
17437 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17438 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17439 for ! HAVE_GTK3.
17440 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17441
17442 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17443
17444 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17445 gdk_window_get_screen, gdk_window_get_geometry,
17446 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17447 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17448 (xg_get_pixbuf_from_pixmap): New function.
17449 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17450 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17451 Call xg_get_pixbuf_from_pixmap instead of
17452 gdk_pixbuf_get_from_drawable.
17453 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17454 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17455 (xg_check_special_colors): Use GtkStyleContext and its functions
17456 for HAVE_GTK3.
17457 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17458 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17459 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17460 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17461 Call gtk_widget_get_preferred_size.
17462 (xg_frame_resized): gdk_window_get_geometry only takes 5
17463 parameters.
17464 (xg_win_to_widget, xg_event_is_for_menubar):
17465 Call gdk_x11_window_lookup_for_display.
17466 (xg_set_widget_bg): New function.
17467 (delete_cb): New function.
17468 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17469 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17470 (xg_set_background_color): Call xg_set_widget_bg.
17471 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17472 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17473 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17474 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17475 if ! HAVE_GTK3.
17476 (update_frame_tool_bar): Call gtk_widget_hide.
17477 (xg_initialize): Use GDK_KEY_g.
17478
17479 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17480 if ! HAVE_GTK3
17481 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17482
17483 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17484 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17485 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17486
17487 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17488
17489 * w32xfns.c (select_palette): Check success of RealizePalette against
17490 GDI_ERROR, not zero.
17491
17492 See ChangeLog.11 for earlier changes.
17493
17494 ;; Local Variables:
17495 ;; coding: utf-8
17496 ;; End:
17497
17498 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17499
17500 This file is part of GNU Emacs.
17501
17502 GNU Emacs is free software: you can redistribute it and/or modify
17503 it under the terms of the GNU General Public License as published by
17504 the Free Software Foundation, either version 3 of the License, or
17505 (at your option) any later version.
17506
17507 GNU Emacs is distributed in the hope that it will be useful,
17508 but WITHOUT ANY WARRANTY; without even the implied warranty of
17509 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17510 GNU General Public License for more details.
17511
17512 You should have received a copy of the GNU General Public License
17513 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.