]> code.delx.au - gnu-emacs/blob - src/ChangeLog
Merge from emacs-24; up to 2012-05-07T14:57:18Z!michael.albinus@gmx.de
[gnu-emacs] / src / ChangeLog
1 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
4 (print_load_command_name): Add case LC_DATA_IN_CODE.
5 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6
7 2012-09-21 Glenn Morris <rgm@gnu.org>
8
9 * eval.c (Frun_hook_with_args_until_success)
10 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
11
12 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
13
14 * fileio.c (Ffile_selinux_context): Only call freecon when
15 lgetfilecon succeeded.
16 (Fset_file_selinux_context): Likewise. (Bug#12444)
17
18 2012-09-21 Eli Zaretskii <eliz@gnu.org>
19
20 * xdisp.c (try_window_reusing_current_matrix): Under bidi
21 reordering, locate the cursor by calling set_cursor_from_row; if
22 that fails, clear the desired glyph matrix before returning a
23 failure indication to the caller. Fixes leaving garbled display
24 when fast scrolling with a down-key. (Bug#12403)
25 (compute_stop_pos_backwards): Fix a typo that caused crashes while
26 scrolling through multibyte text.
27
28 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
29
30 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
31 calling mark_vectorlike since that's the one that marks the window.
32 (mark_discard_killed_buffers): Mark the final cdr.
33 * window.h (struct window): Move prev/next_buffers to the
34 non-standard fields.
35 * window.c (make_window): Initialize prev/next_buffers manually.
36
37 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
38
39 Omit unused arg EXPECTED from socket hooks.
40 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
41 * nsterm.m (ns_term_init):
42 * termhooks.h (struct terminal.read_socket_hook):
43 * w32inevt.c (w32_console_read_socket):
44 * w32term.c (w32_read_socket):
45 * xterm.c (XTread_socket):
46 Omit unused arg EXPECTED. All callers changed.
47 (store_user_signal_events): Return void, not int, since callers no
48 longer care about the return value. All uses changed.
49
50 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
51
52 * w32gui.h (XParseGeometry): Do not declare.
53
54 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
55
56 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
57 Ignore 'expected'. See Eli Zaretskii in
58 <http://bugs.gnu.org/12471#8> (last line).
59
60 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
61 (XParseGeometry): Now static. Substitute extremal values for
62 values that are out of range.
63
64 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
65
66 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
67
68 * nsfns.m (XParseGeometry): Remove.
69 (Fx_create_frame): Call x_set_offset to correctly interpret
70 top_pos in geometry.
71
72 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
73 (Fx_parse_geometry): If there is a space in string, call
74 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
75
76 2012-09-17 Eli Zaretskii <eliz@gnu.org>
77
78 * search.c (scan_buffer): Use character positions in calls to
79 region_cache_forward and region_cache_backward, not byte
80 positions. (Bug#12196)
81
82 * w32term.c (w32_read_socket): Set pending_signals to 1, like
83 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
84
85 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
86 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
87 emacs_blocked_malloc, now deleted.
88
89 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
90
91 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
92 The workaround was for improving performance on Solaris 2.4, but
93 is getting in the way now. Emacs will still work if someone is
94 still running Solaris 2.4 in a museum somewhere; Sun dropped
95 support for Solaris 2.4 in 2003.
96 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
97 * process.c (create_process) [HAVE_WORKING_VFORK]:
98 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
99 since Emacs no longer uses vfork on that platform.
100
101 2012-09-17 Glenn Morris <rgm@gnu.org>
102
103 * emacs.c: Use COPYRIGHT.
104
105 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
106
107 Remove configure's --without-sync-input option (Bug#12450).
108 When auditing signal-handling in preparation for cleaning it up,
109 I found that SYNC_INPUT has race conditions and would be a real
110 pain to fix. Since it's an undocumented and deprecated
111 configure-time option, now seems like a good time to remove it.
112 Also see <http://bugs.gnu.org/11080#16>.
113 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
114 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
115 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
116 (malloc_hysteresis):
117 (check_depth) [XMALLOC_OVERRUN_CHECK]:
118 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
119 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
120 (dont_register_blocks, bytes_used_when_reconsidered)
121 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
122 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
123 [!SYSTEM_MALLOC && !SYNC_INPUT]:
124 Remove. All uses removed.
125 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
126 implementation, one that depends on whether the new macro
127 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
128 is defined.
129 * atimer.c (run_timers, handle_alarm_signal):
130 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
131 (handle_async_input, process_pending_signals)
132 (handle_input_available_signal, init_keyboard):
133 * nsterm.m (ns_read_socket):
134 * process.c (wait_reading_process_output):
135 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
136 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
137 (emacs_write):
138 * xterm.c (XTread_socket):
139 Assume SYNC_INPUT.
140 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
141 * eval.c (handling_signal): Remove. All uses removed.
142 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
143 All uses replaced with the SYNC_INPUT version.
144 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
145 Remove decls.
146 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
147 Now static.
148
149 * font.c (Ffont_shape_gstring): Remove unused local.
150
151 2012-09-16 Glenn Morris <rgm@gnu.org>
152
153 * Makefile.in (clean): No longer run nextstep's clean.
154
155 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
156 (ns_frag): Remove.
157 (ns-app): Move here from ns.mk, and simplify.
158 (clean): Simplify nextstep entry.
159 * ns.mk: Remove file.
160
161 2012-09-16 Kenichi Handa <handa@gnu.org>
162
163 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
164 not covert the last few charactes.
165
166 2012-09-16 Kenichi Handa <handa@gnu.org>
167
168 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
169 here, but just check the validity of glyphs in the glyph-string.
170
171 2012-09-16 Martin Rudalics <rudalics@gmx.at>
172
173 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
174 any window as argument (Bug#12452).
175
176 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
177
178 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
179 to ns_term_init to avoid memory leak.
180
181 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
182 explicit retain/release.
183 (ns_term_init): Only allow one display. Initialize outerpool and
184 ns_*_types.
185
186 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
187
188 Port _setjmp fix to POSIXish hosts as well as Microsoft.
189 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
190 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
191 the Microsoft problem in a different way, by altering ../nt/config.nt.
192
193 2012-09-15 Eli Zaretskii <eliz@gnu.org>
194
195 * w32xfns.c:
196 * w32uniscribe.c:
197 * w32term.c:
198 * w32select.c:
199 * w32reg.c:
200 * w32proc.c:
201 * w32menu.c:
202 * w32inevt.c:
203 * w32heap.c:
204 * w32font.c:
205 * w32fns.c:
206 * w32console.c:
207 * w32.c:
208 * w16select.c: Remove inclusion of setjmp.h, as it is now included
209 by lisp.h. This completes removal of setjmp.h inclusion
210 erroneously announced in the previous commit. (Bug#12446)
211
212 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
213 more accurate.
214
215 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
216 not defined as a macro. The latter happens on MS-Windows.
217 (Bug#12446)
218
219 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
220
221 Port better to POSIX hosts lacking _setjmp (Bug#12446).
222 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
223 Some instances of '#include <setjmp.h>' removed, if the
224 only reason for the instance was because "lisp.h" was included.
225 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
226 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
227 and _longjmp with the new symbols. Emacs already uses _setjmp if
228 available, so this change affects only POSIXish hosts that have
229 sigsetjmp but not _setjmp, such as some versions of Solaris and
230 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
231 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
232 (png_load_body) [HAVE_PNG]:
233 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
234 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
235 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
236 since PNG requires jmp_buf. This is the only exception to the
237 general rule that we now use sys_setjmp and sys_longjmp.
238 This exception is OK since this code does not change the signal
239 mask or longjmp out of a signal handler.
240
241 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
242
243 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
244 Include "syssignal.h", for 'main_thread'.
245
246 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
247
248 Avoid out-of-range marker position (Bug#12426).
249 * insdel.c (replace_range, replace_range_2): Adjust
250 markers before overlays, as suggested by comments.
251 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
252 Remove redundant check before calling offset_intervals.
253
254 2012-09-14 Martin Rudalics <rudalics@gmx.at>
255
256 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
257 current buffer (Bug#12387).
258
259 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
260
261 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
262
263 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
264
265 Use a more backwards-compatible timer format (Bug#12430).
266 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
267 vector element, not from the 4th, since PSECS is now at the end.
268 (Fcurrent_idle_time): Doc fix.
269
270 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
271
272 Function to mark objects and remove killed buffers at once.
273 * alloc.c (discard_killed_buffers): Rename to ...
274 (mark_discard_killed buffers) ... new name. Add marking
275 of remaining objects. Fix comment. Adjust users.
276 (mark_object): Do not touch frame buffer lists here.
277 * frame.c (delete_frame): Reset frame buffer lists here.
278
279 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
280
281 Better workaround for GNOME bug when --enable-gcc-warnings.
282 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
283 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
284 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
285
286 Simplify SIGIO usage (Bug#12408).
287 The code that dealt with SIGIO was crufty and confusing, e.g., it
288 played tricks like "#undef SIGIO" but these tricks were not used
289 consistently. Simplify mostly by not #undeffing standard symbols,
290 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
291 or not as we please) rather than "defined SIGIO" (standard symbol
292 that we probably shouldn't #undef).
293 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
294 Modules that need it can include it.
295 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
296 * dispextern.h (ignore_sigio): New decl.
297 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
298 unconditionally, since it's now a no-op if !USABLE_SIGIO.
299 * emacs.c (shut_down_emacs):
300 * keyboard.c (kbd_buffer_store_event_hold):
301 Use ignore_sigio rather than invoking 'signal' directly.
302 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
303 for FIONREAD.
304 (FIONREAD, SIGIO): Do not #undef.
305 (tty_read_avail_input): Use #error rather than a syntax error.
306 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
307 for I_PIPE, used by SETUP_SLAVE_PTY.
308 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
309 * sysdep.c (croak): Remove; no longer needed. This bit of
310 temporary code, with Fred N. Fish's comment that it's temporary,
311 has been in Emacs since at least 1992!
312 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
313 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
314 * syssignal.h (croak): Remove decl.
315 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
316 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
317 now that we're termios-only.
318 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
319 * term.c (dissociate_if_controlling_tty): Use #error rather than
320 a run-time error.
321
322 Work around GCC and GNOME bugs when --enable-gcc-warnings.
323 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
324 to work around GNOME bug 683906.
325 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
326 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
327 This works around GCC bug 54561.
328
329 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
330
331 More fixes for 'volatile' and setjmp/longjmp.
332 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
333 * image.c (struct png_load_context) [HAVE_PNG]: New type.
334 (png_load_body) [HAVE_PNG]:
335 (jpeg_load_body) [HAVE_JPEG]:
336 New function, with most of the old parent function's body.
337 (png_load) [HAVE_PNG]:
338 (jpeg_load) [HAVE_JPEG]:
339 Invoke the new function, to avoid longjmp munging our locals.
340 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
341 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
342 longjmp is passed 2, as the C standard doesn't guarantee this.
343 Instead, store the failure code into mgr->failure_code.
344
345 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
346
347 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
348 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
349 (syms_of_keyboard): Remove support for unread-command-char.
350
351 2012-09-12 Eli Zaretskii <eliz@gnu.org>
352
353 * w32proc.c (sys_kill): If PID is our process ID and the signal is
354 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
355 violation. (Bug#12426)
356
357 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
358
359 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
360
361 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
362
363 * eval.c: Add `inhibit-debugger'.
364 (Qinhibit_debugger): New symbol.
365 (call_debugger): Bind it instead of Qdebug_on_error.
366 (maybe_call_debugger): Test Vinhibit_debugger.
367 (syms_of_eval): Define inhibit-debugger.
368 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
369 (syms_of_xdisp): Remove inhibit-debug-on-message.
370
371 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
372
373 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
374 If a nonvolatile local variable is written before a _longjmp to
375 the frame containing the variable, and is read after the _longjmp,
376 the value read is indeterminate. Some local variables of type
377 'struct handler' and 'struct catchtag' are used in this way, so
378 mark each of their slots as volatile if the slot can be set before
379 _longjmp and read afterwards.
380 * lisp.h (struct handler): var and chosen_clause are now volatile.
381 (struct catchtag): val, next, and pdlcount are now volatile.
382
383 * bidi.c (bidi_push_it, bidi_pop_it):
384 * fns.c (copy_hash_table):
385 * image.c (define_image_type):
386 * keyboard.c (kbd_buffer_store_event_hold):
387 * process.c (Fprocess_send_eof):
388 * xfaces.c (x_create_gc) [HAVE_NS]:
389 * xgselect.c (xg_select):
390 Prefer assignment to memcpy when either will do.
391
392 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
393 Use pointer-to-a-pointer to simplify and avoid a NILP check each
394 time an item is removed. No need to mark this function 'inline';
395 the compiler knows better than we do.
396
397 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
398
399 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
400 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
401 to change_frame_size (Bug#12388).
402 (windowDidResize:): Pass YES to updateFrameSize.
403
404 * nsterm.h: Add delay parameter to updateFrameSize.
405
406 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
407
408 Discard killed buffers from deleted window and frame objects.
409 This reduces an amount of references to killed buffers and
410 helps GC to reclaim them faster.
411 * alloc.c (discard_killed_buffers): New function.
412 (mark_object): Use it for deleted windows and frames.
413 (mark_object): If symbol's value is set up for a killed buffer
414 or deleted frame, restore it's global binding.
415 * data.c (swap_in_global_binding): Add GC notice.
416 (swap_in_symval_forwarding): Use convenient set_blv_where.
417 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
418 * window.h: ... to here.
419
420 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
421
422 Convenient macro to check whether the buffer is live.
423 * buffer.h (BUFFER_LIVE_P): New macro.
424 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
425 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
426
427 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
428
429 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
430 composition cases (Bug#12364).
431
432 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
433 overhang of succeeding glyphs overlapping box cursor.
434
435 * w32term.c (x_draw_glyph_string): Likewise.
436
437 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
438
439 Simplify, document, and port floating-point (Bug#12381).
440 The porting part of this patch fixes bugs on non-IEEE platforms
441 with frexp, ldexp, logb.
442 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
443 Now static.
444 * floatfns.c: Simplify discussion of functions that Emacs doesn't
445 support, by removing commented-out code and briefly listing the
446 C89 functions excluded. The commented-out stuff was confusing
447 maintenance, e.g., we thought we needed cbrt but it was commented out.
448 (logb): Remove decl; no longer needed.
449 (isfinite): New macro, if not already supplied.
450 (isnan): Don't replace any existing macro.
451 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
452 are present on all C89 platforms.
453 (Ffrexp): Do not special-case zero, as frexp does the right thing
454 for that case.
455 (Flogb): Do not use logb, as it doesn't have the desired meaning
456 on hosts that use non-base-2 floating point. Instead, stick with
457 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
458 frexp, to avoid getting an unspecified result.
459
460 * xdisp.c (Qinhibit_debug_on_message): Now static.
461
462 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
463
464 * nsterm.m (ns_update_begin): Set clip path to whole view by using
465 NSBezierPath (Bug#12131).
466
467 2012-09-10 Chong Yidong <cyd@gnu.org>
468
469 * fns.c (Fdelq, Fdelete): Doc fix.
470
471 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
472
473 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
474 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
475
476 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
477
478 * lisp.h (make_lisp_ptr): New macro to replace XSET.
479 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
480 Use it.
481
482 2012-09-09 Eli Zaretskii <eliz@gnu.org>
483
484 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
485 left fringe if the window has a left margin. This avoids leaving
486 traces of the cursor because its leftmost pixel is not drawn over.
487
488 * dispnew.c (update_window_line): When the left margin area of a
489 screen line is updated, set the redraw_fringe_bitmaps_p flag of
490 that screen line. (Bug#12277)
491
492 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
493
494 Assume C89 or later for math functions (Bug#12381).
495 This simplifies the code, and makes it a bit smaller and faster,
496 and (most important) makes it easier to clean up signal handling
497 since we can stop worring about floating-point exceptions in
498 library code. That was a problem before C89, but the problem
499 went away many years ago on all practical Emacs targets.
500 * data.c, image.c, lread.c, print.c:
501 Don't include <math.h>; no longer needed.
502 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
503 might be autoconfigured, as that never happens.
504 * data.c (fmod):
505 * doprnt.c (DBL_MAX_10_EXP):
506 * print.c (DBL_DIG):
507 Remove. C89 or later always defines these.
508 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
509 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
510 (arith_error, domain_error, domain_error2):
511 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
512 no longer needed -- we simply return what C returns. All uses removed.
513 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
514 the wrapped code.
515 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
516 Remove. All uses expanded, as these macros are no longer used
517 more than once and are now more trouble than they're worth.
518 (Ftan): Use tan, not sin / cos.
519 (Flogb): Assume C89 frexp.
520 (fmod_float): Assume C89 fmod.
521 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
522 (init_floatfns): Remove. All uses removed.
523
524 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
525
526 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
527 compositeToPoint for OSX < 10.6 (Bug#12390).
528
529 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
530
531 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
532 This produces more-accurate results.
533
534 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
535
536 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
537 changes (Bug#12088).
538
539 2012-09-08 Chong Yidong <cyd@gnu.org>
540
541 * syntax.c (Fstring_to_syntax): Doc fix.
542
543 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
544
545 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
546 in the internal border.
547 (x_set_window_size): Remove static variables and their usage.
548 (ns_redraw_scroll_bars): Fix NSTRACE arg.
549 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
550 fringe/internal border adjustment (Bug#11052).
551 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
552 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
553 (ns_fix_rect_ibw): Remove.
554 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
555 (ns_dumpglyphs_box_or_relief): Ditto.
556 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
557 adjustment.
558 (ns_dumpglyphs_image): Ditto.
559 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
560 border adjustment.
561 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
562 their usage. Add fringe_extended_p and its use as in other terms.
563 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
564 scroll bar was removed.
565 (updateFrameSize): New function.
566 (windowDidResize): Move code to updateFrameSize and call it.
567
568 * nsterm.h (EmacsView): Add updateFrameSize.
569
570 2012-09-07 Chong Yidong <cyd@gnu.org>
571
572 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
573
574 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
575
576 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
577
578 More signal-handler cleanup (Bug#12327).
579 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
580 Problem introduced when merging patches. Noted by Eli Zaretskii in
581 <http://bugs.gnu.org/12327#67>.
582 * floatfns.c: Comment fix.
583 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
584 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
585 and anyway the declaration is harmless even if SIGDANGER is not defined.
586 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
587 defined BROKEN_FIONREAD). systty.h formerly did this, but other
588 source files not surprisingly expected syssignal.h to define, or
589 not define, SIGIO, and it's cleaner to do it that way, for consistency.
590 Include <sys/ioctl.h>, for FIONREAD.
591 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
592 This eliminates a problem whereby other files mysteriously had
593 to include "syssignal.h" before including "systty.h" if they
594 wanted to use "#ifdef SIGIO".
595
596 2012-09-07 Eli Zaretskii <eliz@gnu.org>
597
598 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
599
600 * w32.c (sigemptyset): Empty the set.
601 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
602
603 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
604
605 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
606
607 * alloc.c (mark_buffer): Revert unsafe marking optimization.
608 (mark_object): Likewise for frame objects.
609
610 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
611
612 * syssignal.h (handle_on_main_thread): Always declare,
613 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
614 This ports to platforms without HAVE_PTHREAD.
615
616 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
617
618 Signal-handler cleanup (Bug#12327).
619 Emacs's signal handlers were written in the old 4.2BSD style with
620 sigblock and sigmask and so forth, and this led to some
621 inefficiencies and confusion. Rewrite these to use
622 pthread_sigmask etc. without copying signal sets around. Also,
623 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
624 'signal', and instead use functions that do not attempt to take
625 over the system name space. This patch causes Emacs's text
626 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
627 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
628 Do not include <signal.h> or "syssignal.h", as these
629 modules do not use signals.
630 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
631 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
632 Do not include <signal.h>, as "syssignal.h" does that for us now.
633 * atimer.c (sigmask_atimers): New function.
634 (block_atimers, unblock_atimers): New functions,
635 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
636 All uses replaced.
637 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
638 no longer needed here.
639 * emacs.c (main): Inspect existing signal handler with sigaction,
640 so that there's no need to block and unblock SIGHUP.
641 * sysdep.c (struct save_signal): New member 'action', replacing
642 old member 'handler'.
643 (save_signal_handlers, restore_signal_handlers):
644 Use sigaction instead of 'signal' to save and restore.
645 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
646 New function. All users of 'signal' modified to use set_sighandler
647 if they're writeonly, and to use sys_signal if they're read+write.
648 (emacs_sigaction_init, forwarded_signal): New functions.
649 (sys_signal): Remove. All uses replaced by calls to sigaction
650 and emacs_sigaction_init, or by direct calls to 'signal'.
651 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
652 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
653 all uses replaced by pthread_sigmask etc. calls.
654 * syssignal.h: Include <signal.h>.
655 (emacs_sigaction_init, forwarded_signal): New decls.
656 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
657 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
658 (sigmask, sys_sigmask): Remove; no longer needed.
659 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
660 (sigblock, sigunblock, sigfree):
661 (sigsetmask) [!defined sigsetmask]:
662 Remove. All uses replaced by pthread_sigmask.
663 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
664 no longer need to be replaced, and its typical old uses
665 are now done via emacs_sigaction_init and sigaction.
666 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
667 (sys_sigdel): Remove; unused.
668 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
669
670 2012-09-06 Eli Zaretskii <eliz@gnu.org>
671
672 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
673 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
674
675 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
676
677 Explicitly mark buffer_defaults and buffer_local_symbols.
678 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
679 mark_local_symbols here.
680 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
681 since special buffers aren't marked here any more.
682 (allocate_buffer): Chain new buffer with all_buffers here...
683 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
684 not here.
685 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
686 (syms_of_buffer): Remove staticpro of the above.
687 (init_buffer_once): Set names for buffer_defaults and
688 buffer_local_symbols.
689
690 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
691
692 Use bool for booleans in font-related modules.
693 * font.c (font_intern_prop, font_style_to_value)
694 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
695 (generate_otf_features, font_check_otf_features, font_check_otf)
696 (font_match_p, font_list_entities, font_at):
697 * fontset.c (fontset_id_valid_p, reorder_font_vector
698 (fontset_find_font, Fset_fontset_font)
699 (face_suitable_for_char_p) [0]:
700 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
701 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
702 (m17n_flt_initialized, ftfont_shape_by_flt):
703 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
704 * nsfont.m (nsfont_draw):
705 * w32font.c (w32font_draw):
706 * w32term.c (x_draw_glyphless_glyph_string_foreground):
707 Use bool for booleans.
708 * font.h: Adjust to above API changes.
709 (struct font, struct font_driver, struct font_driver_list):
710 Use bool for booleans.
711 (struct font): Remove useless member encoding_type.
712 All users removed.
713 * fontset.c, xftfont.c: Omit unnecessary static decls.
714
715 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
716
717 * alloc.c (mark_object): Revert window marking code
718 since it's unsafe for the Fset_window_configuration.
719
720 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
721
722 Fix race conditions with signal handlers and errno (Bug#12327).
723 Be more systematic about preserving errno whenever a signal
724 handler returns, even if it's not in the main thread. Do this by
725 renaming signal handlers to distinguish between signal delivery
726 and signal handling. All uses changed.
727 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
728 * data.c (deliver_arith_signal): Rename from arith_error.
729 * dispnew.c (deliver_window_change_signal): Rename from
730 window_change_signal.
731 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
732 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
733 * keyboard.c (deliver_input_available_signal): Rename from
734 input_available_signal.
735 (deliver_user_signal): Rename from handle_user_signal.
736 (deliver_interrupt_signal): Rename from interrupt_signal.
737 * process.c (deliver_pipe_signal): Rename from send_process_trap.
738 (deliver_child_signal): Rename from sigchld_handler.
739 * atimer.c (handle_alarm_signal):
740 * data.c (handle_arith_signal):
741 * dispnew.c (handle_window_change_signal):
742 * emacs.c (handle_fatal_signal, handle_danger_signal):
743 * keyboard.c (handle_input_available_signal):
744 * keyboard.c (handle_user_signal, handle_interrupt_signal):
745 * process.c (handle_pipe_signal, handle_child_signal):
746 New functions, with the actual signal-handling code taken from the
747 original respective signal handlers, sans the sporadic attempts to
748 preserve errno, since that's now done by handle_on_main_thread.
749 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
750 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
751 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
752 Move to sysdep.c.
753 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
754 Move initialization of main_thread to sysdep.c's init_signals.
755 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
756 our usage, and simplifies the mainline code.
757 (record_child_status_change): New static function, as a helper
758 for handle_child_signal, and with most of the old child handler's
759 contents.
760 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
761 (handle_child_signal): Use the above.
762 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
763 Moved here from emacs.c.
764 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
765 code moved here from emacs.c's main function.
766 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
767 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
768 lets callers save and restore errno properly.
769
770 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
771
772 Remove redundant or unused things here and there.
773 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
774 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
775 * editfns.c (Fcompare_buffer_substrings): Likewise.
776 * frame.h (struct terminal, struct font_driver_list):
777 Remove redundant declarations.
778 * window.h (Qleft, Qright): Likewise.
779
780 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
781
782 Do not mark objects from deleted buffers, windows and frames.
783 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
784 (mark_object): Likewise for windows and frames.
785
786 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
787
788 * alloc.c (valid_lisp_object_p): Treat killed buffers,
789 buffer_defaults and buffer_local_symbols as valid objects.
790 Return special value to denote them.
791
792 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
793
794 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
795 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
796 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
797 (file_name_absolute_p, Fsubstitute_in_file_name):
798 (check_executable, check_writable, Ffile_accessible_directory_p)
799 (Fset_file_selinux_context, Fdefault_file_modes)
800 (Finsert_file_contents, choose_write_coding_system)
801 (Fwrite_region, build_annotations, a_write, e_write)
802 (Fdo_auto_save):
803 * filelock.c (boot_time_initialized, get_boot_time)
804 (get_boot_time_1, lock_file_1, within_one_second):
805 * floatfns.c (in_float):
806 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
807 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
808 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
809 * lisp.h (struct Lisp_Hash_Table.cmpfn):
810 * window.c (compare_window_configurations):
811 Use bool for booleans.
812 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
813 (Fdefault_file_modes): Now mode_t, not int, for modes.
814 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
815 (internal_delete_file): Now returns void, not a (boolean) int,
816 since nobody was looking at the return value.
817 * lisp.h, window.h: Adjust to above API changes.
818
819 * xdisp.c (set_message): Simplify and reindent last change.
820
821 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
822
823 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
824
825 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
826
827 * eval.c (call_debugger): Make the function non-static so that we
828 can call it from set_message.
829
830 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
831 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
832
833 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
834
835 Give more-useful info on a fatal error (Bug#12328).
836 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
837 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
838 of doing the work ourselves.
839 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
840 do most of the work.
841 (fatal_error_backtrace): New function, taken from the guts
842 of the old fatal_error_signal, but with a new option to output
843 a backtrace.
844 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
845 info about the signal than just its number.
846 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
847 * sysdep.c: Include <execinfo.h>
848 (emacs_backtrace): New function, taken partly from the previous
849 code of the 'die' function.
850 (emacs_abort): Call fatal_error_backtrace rather than abort.
851
852 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
853
854 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
855 eager (load-time) macro-expansion.
856 * lisp.mk (lisp): Add macroexp.
857
858 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
859
860 Simplify redefinition of 'abort' (Bug#12316).
861 Do not try to redefine the 'abort' function. Instead, redo
862 the code so that it calls 'emacs_abort' rather than 'abort'.
863 This removes the need for the NO_ABORT configure-time macro
864 and makes it easier to change the abort code to do a backtrace.
865 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
866 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
867 Remove; sysdep.c's emacs_abort now takes its place.
868 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
869 'abort' changed to use 'emacs_abort'.
870 * msdos.c (dos_abort) [defined abort]: Remove; not used.
871 (abort) [!defined abort]: Rename to ...
872 (emacs_abort): ... new name.
873 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
874 the place of the old 'abort' in emacs.c.
875 * w32.c, w32fns.c (abort): Do not #undef.
876 * w32.c (emacs_abort): Rename from w32_abort.
877
878 2012-09-04 Eli Zaretskii <eliz@gnu.org>
879
880 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
881 offsets[j].dv, since the y axis of the screen coordinates points
882 down, while the y axis of the font definition coordinates points
883 up. This fixes display of Arabic diacritics such as KASRA and
884 KASRATAN. (Bug#11860)
885
886 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
887
888 Be more systematic about _setjmp vs setjmp.
889 * alloc.c (test_setjmp, mark_stack):
890 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
891 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
892 (png_load, my_error_exit, jpeg_load):
893 * process.c (send_process_trap, send_process):
894 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
895 The underscored versions are up to 30x faster on some hosts.
896 Formerly, the code used setjmp+longjmp sometimes and
897 _setjmp+_longjmp at other times, with no particular reason to
898 prefer setjmp+longjmp.
899
900 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
901
902 Fix minor problem found by static checking.
903 * buffer.c (Fdelete_all_overlays): Return nil.
904
905 2012-09-03 Martin Rudalics <rudalics@gmx.at>
906
907 * buffer.c (Fdelete_all_overlays): New function.
908
909 2012-09-03 Chong Yidong <cyd@gnu.org>
910
911 * gtkutil.c: Add extern decl for Qxft.
912
913 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
914
915 * emacs.c, eval.c: Use bool for boolean.
916 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
917 (malloc_using_checking) [DOUG_LEA_MALLOC]:
918 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
919 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
920 (main, decode_env_path, Fdaemon_initialized):
921 * eval.c (call_debugger, Finteractive_p, interactive_p):
922 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
923 (maybe_call_debugger, Fbacktrace):
924 * process.c (read_process_output, exec_sentinel):
925 Use bool for booleans.
926 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
927 All callers changed.
928 * eval.c (interactive_p): Omit always-true boolean argument
929 EXCLUDE_SUBRS_P. All callers changed.
930 * dispextern.h, lisp.h: Reflect above API changes.
931 * firstfile.c (dummy): Use the address of 'main', whose signature
932 won't change, instead of the address of 'initialize', whose
933 signature just changed from int to bool.
934 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
935 * msdos.c (fatal_error_in_progress): ... from here.
936 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
937 of incrementing it.
938 (redisplay_internal, unwind_redisplay): Simply clear
939 REDISPLAYING_P when unwinding, instead of saving its previous,
940 always-false value and then restoring it.
941
942 Clean up some extern decls.
943 Mostly, this hoists extern decls out of .c files and into .h files.
944 That way, we're more likely to catch errors if the interfaces change.
945 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
946 declare xg_mark_data.
947 * dispextern.h (x_frame_parm_handlers):
948 * font.h (Qxft):
949 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
950 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
951 (Qultra_bold, Qoblique, Qitalic):
952 Move extern decl here from .c file.
953 * alloc.c (xg_mark_data) [USE_GTK]:
954 * doc.c (Qclosure):
955 * eval.c (Qlexical_binding):
956 * fns.c (time) [!HAVE_UNISTD_H]:
957 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
958 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
959 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
960 * lread.c (Qinternal_interpreter_environment):
961 * minibuf.c (Qbuffer):
962 * process.c (QCfamily, QCfilter):
963 * widget.c (free_frame_faces):
964 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
965 * xfont.c (x_clear_errors):
966 * xterm.c (x_frame_parm_handlers):
967 Remove now-redundant extern decls.
968 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
969 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
970 Now static.
971 * xfaces.c: Remove unnecessary static decls.
972 * xterm.c (updating_frame): Remove decl of nonexistent object.
973
974 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
975 when building globals.h, as the objects that are not built on
976 this host are not needed to compile C files on this host.
977
978 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
979
980 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
981
982 * frame.h: Add missing prototype for x_wm_set_size_hint.
983
984 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
985
986 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
987 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
988 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
989 (Fsubstitute_command_keys):
990 * editfns.c (region_limit, find_field, Fconstrain_to_field)
991 (save_excursion_save, save_excursion_restore)
992 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
993 (format_time_string, general_insert_function)
994 (make_buffer_string, make_buffer_string_both)
995 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
996 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
997 (copy_text, insert_1, insert_1_both, insert_from_string)
998 (insert_from_string_before_markers, insert_from_string_1)
999 (insert_from_buffer, insert_from_buffer_1, replace_range)
1000 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1001 (del_range_2, modify_region):
1002 * intervals.c (intervals_equal, balance_possible_root_interval)
1003 (adjust_intervals_for_insertion, merge_properties_sticky)
1004 (graft_intervals_into_buffer, lookup_char_property)
1005 (adjust_for_invis_intang, set_point_both)
1006 (get_property_and_range, compare_string_intervals)
1007 (set_intervals_multibyte_1, set_intervals_multibyte):
1008 * keyboard.c (decode_timer):
1009 Use bool for boolean.
1010 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1011 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1012
1013 2012-09-02 Chong Yidong <cyd@gnu.org>
1014
1015 * keymap.c (push_key_description): Print M-TAB as C-M-i
1016 (Bug#11758).
1017
1018 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1019
1020 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1021 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1022 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1023 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1024 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1025 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1026 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1027
1028 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1029
1030 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1031 more than one grapheme cluster passed to the shaper: compute the
1032 offset adjustment values separately for each cluster. (Bug#11860)
1033
1034 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1035 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1036 about implicit conversions from integer to pointer.
1037
1038 2012-09-01 Daniel Colascione <dancol@dancol.org>
1039
1040 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1041 system used too early.
1042
1043 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1044
1045 Better seed support for (random).
1046 * emacs.c (main): Call init_random.
1047 * fns.c (Frandom): Set the seed from a string argument, if given.
1048 Remove long-obsolete Gentzel cruft.
1049 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1050 (init_random): New function.
1051
1052 2012-09-01 Daniel Colascione <dancol@dancol.org>
1053
1054 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1055 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1056 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1057 x_wm_set_size_hint, x_query_colors, x_real_positions,
1058 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1059 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1060 all of which have been moved to common code.
1061
1062 * xfaces.c: Include TERM_HEADER instead of listing all possible
1063 window-system headers.
1064
1065 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1066 to match header.
1067
1068 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1069 directly accessing frame internals.
1070
1071 * w32font.h: Include font.h. Define syms_of_w32font and
1072 globals_of_w32font.
1073
1074 * process.c: Include TERM_HEADER instead of listing all possible
1075 window-system headers.
1076
1077 * nsterm.h: Remove declarations now in frame.h. Define
1078 FRAME_X_SCREEN, FRAME_X_VISUAL.
1079
1080 * menu.c: Include TERM_HEADER instead of listing all possible
1081 window-system headers.
1082
1083 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1084 window system.
1085
1086 * keyboard.c: Include TERM_HEADER instead of listing all possible
1087 window-system headers.
1088
1089 * image.c: Include TERM_HEADER instead of listing all possible
1090 window-system headers. Declare Vlibrary_cache when compiling for
1091 Windows.
1092
1093 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1094 window system declarations.
1095
1096 * frame.h: Move common functions here: set_frame_menubar,
1097 x_set_window_size, x_sync, x_get_focus_frame,
1098 x_set_mouse_position, x_set_mouse_pixel_position,
1099 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1100 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1101 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1102 x_activate_menubar, x_real_positions, x_bitmap_icon,
1103 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1104 and x_query_colors.
1105
1106 * frame.c: Include TERM_HEADER instead of listing all possible
1107 window-system headers.
1108
1109 * font.c: Include TERM_HEADER instead of listing all possible
1110 window-system headers.
1111
1112 * emacs.c: Include TERM_HEADER.
1113
1114 * dispnew.c: Include TERM_HEADER instead of listing all possible
1115 window-system headers.
1116
1117 * ccl.h: Include character.h.
1118
1119 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1120 the current window system; include in list of objects to link into
1121 Emacs.
1122
1123 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1124
1125 Remove mark_ttys function and fix tty_display_info initialization.
1126 * lisp.h (mark_ttys): Remove prototype.
1127 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1128 to mark_ttys because all possible values of 'top_frame' slot are
1129 the frames which are reachable from Vframe_list.
1130 * term.c (mark_ttys): Remove.
1131 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1132
1133 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1134
1135 Change struct frame bitfields from unsigned char to unsigned.
1136 * frame.h (struct frame): Change type of 'display_preempted',
1137 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1138 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1139 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1140 bitfields from unsigned char to unsigned.
1141
1142 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1143
1144 Remove unused member of struct x_output and struct w32_output.
1145 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1146 * w32term.h (struct w32_output): Likewise.
1147
1148 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1149
1150 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1151 does not become zero (Bug#12234).
1152
1153 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1154
1155 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1156 for GCC 4.7.1 x86-64.
1157
1158 2012-08-30 Glenn Morris <rgm@gnu.org>
1159
1160 * lread.c (init_lread): For out-of-tree builds, only add the
1161 source directory's site-lisp dir to the load-path if it exists,
1162 consistent with in-tree builds. (Bug#12302)
1163
1164 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1165
1166 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1167 button_values to NULL. Call setStykeMask so dialogs get a close button.
1168 (windowShouldClose:): Set window_closed.
1169 (dealloc): New member, free button_values.
1170 (process_dialog:): Make member function. Remove window argument,
1171 replace window with self. Count buttons and allocate and store values
1172 in button_values.
1173 (addButton:value:row:): value is int with the name tag. Call setTag
1174 with tag. Remove return self, declare return value as void.
1175 (addString:row:): Remove return self, declare return value as void.
1176 (addSplit): Remove return self, declare return value as void.
1177 (clicked:): Remove return self, declare return value as void.
1178 Set dialog_return to button_values[seltag]. Code formatting change.
1179 (initFromContents:isQuestion:): Adjust call to process_dialog.
1180 Code formatting change.
1181 (timeout_handler:): Set timer_fired to YES.
1182 (runDialogAt:): Set timer_fired to NO.
1183 Handle click on close button as quit.
1184
1185 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1186 Add window_closed and button_values. Add void as return value for
1187 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1188 Add process_dialog as new member.
1189
1190 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1191
1192 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1193 is not one of the heaps we manage. (Bug#12242)
1194
1195 2012-08-28 Glenn Morris <rgm@gnu.org>
1196
1197 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1198
1199 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1200
1201 * window.c (Fset_window_configuration): Remove handling of
1202 auto-buffer-name window parameter. Install revision of reverted
1203 fix.
1204
1205 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1206
1207 Do not allow to set major mode for a dead buffer.
1208 * buffer.c (Fset_buffer_major_mode): Signal an error
1209 if the buffer is dead.
1210 (Fother_buffer, other_buffer_safely): Remove redundant
1211 nested declaration.
1212
1213 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1214
1215 Always use set_buffer_if_live to restore original buffer at unwind.
1216 * buffer.h (record_unwind_current_buffer): New function.
1217 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1218 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1219 * undo.c, window.c: Adjust users.
1220 * buffer.c (set_buffer_if_live): Fix comment.
1221
1222 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1223
1224 Fix usage of set_buffer_internal.
1225 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1226 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1227 * coding.c (decode_coding): Omit redundant test.
1228 * fileio.c (decide_coding_unwind): Likewise.
1229 * fns.c (secure_hash): Likewise.
1230 * insdel.c (modify_region): Likewise.
1231 * keyboard.c (command_loop_1): Likewise.
1232 * print.c (PRINTFINISH): Likewise.
1233 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1234
1235 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1236
1237 * dispnew.c: Use bool for boolean.
1238 (frame_garbaged, display_completed, delayed_size_change)
1239 (fonts_changed_p, add_window_display_history)
1240 (add_frame_display_history, verify_row_hash)
1241 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1242 (row_equal_p, realloc_glyph_pool)
1243 (allocate_matrices_for_frame_redisplay)
1244 (showing_window_margins_p)
1245 (adjust_frame_glyphs_for_frame_redisplay)
1246 (build_frame_matrix_from_leaf_window, make_current)
1247 (mirrored_line_dance, mirror_line_dance, update_frame)
1248 (update_window_tree, update_single_window)
1249 (check_current_matrix_flags, update_window, update_text_area)
1250 (update_window_line, set_window_update_flags, scrolling_window)
1251 (update_frame_1, scrolling, buffer_posn_from_coords)
1252 (do_pending_window_change, change_frame_size)
1253 (change_frame_size_1, sit_for):
1254 Use bool for boolean.
1255 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1256 and remove last int (actually boolean) argument, which was always 0.
1257 All callers changed.
1258 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1259 * dispextern.h (struct composition_it): Use bool for boolean.
1260 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1261 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1262 * dired.c (file_name_completion):
1263 Use bool for boolean. (This was missed in an earlier change.)
1264
1265 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1266
1267 * window.c (Fset_window_configuration): Revert first part of
1268 last change.
1269
1270 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1271
1272 * nsterm.h (NSPanel): New class variable dialog_return.
1273
1274 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1275 dialog_return.
1276 (windowShouldClose:): Use stop instead of stopModalWithCode.
1277 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1278 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1279 event.
1280 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1281 modal loop returns.
1282
1283 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1284
1285 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1286 * composite.c (find_composition, composition_gstring_p)
1287 (composition_reseat_it, find_automatic_composition):
1288 * data.c (let_shadows_buffer_binding_p)
1289 (let_shadows_global_binding_p, set_internal, make_blv)
1290 (Fmake_variable_buffer_local, Fmake_local_variable)
1291 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1292 (cons_to_signed, arith_driver):
1293 * dbusbind.c (xd_in_read_queued_messages):
1294 * dired.c (directory_files_internal, file_name_completion):
1295 Use bool for booleans.
1296 * dired.c (file_name_completion):
1297 * process.h (fd_callback):
1298 Omit int (actually boolean) argument. It wasn't being used.
1299 All uses changed.
1300 * composite.h, lisp.h: Reflect above API changes.
1301
1302 * cmds.c, coding.c: Use bool for booleans.
1303 * cmds.c (move_point, Fself_insert_command):
1304 * coding.h (struct composition status, struct coding_system):
1305 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1306 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1307 (emacs_mule_char, decode_coding_emacs_mule)
1308 (encode_coding_emacs_mule, detect_coding_iso_2022)
1309 (decode_coding_iso_2022, encode_invocation_designation)
1310 (encode_designation_at_bol, encode_coding_iso_2022)
1311 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1312 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1313 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1314 (encode_coding_raw_text, detect_coding_charset)
1315 (decode_coding_charset, encode_coding_charset, detect_eol)
1316 (detect_coding, get_translation_table, produce_chars)
1317 (consume_chars, reused_workbuf_in_use)
1318 (make_conversion_work_buffer, code_conversion_save)
1319 (decode_coding_object, encode_coding_object)
1320 (detect_coding_system, char_encodable_p)
1321 (Funencodable_char_position, code_convert_region)
1322 (code_convert_string, code_convert_string_norecord)
1323 (Fset_coding_system_priority):
1324 * fileio.c (Finsert_file_contents):
1325 Use bool for booleans.
1326 * coding.h, lisp.h: Reflect above API changes.
1327 * coding.c: Remove unnecessary static function decls.
1328 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1329 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1330 not a boolean 'int', since callers never look at the return value.
1331 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1332 * coding.h (decoding_buffer_size, encoding_buffer_size)
1333 (emacs_mule_string_char): Remove unused extern decls.
1334 (struct iso_2022_spec, struct coding_system):
1335 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1336 (struct emacs_mule_spec): Remove unused field 'full_support'.
1337 All initializations removed.
1338 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1339
1340 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1341
1342 Fix spare memory change (Bug#12286).
1343 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1344 (valid_lisp_object_p): Likewise.
1345
1346 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1347
1348 * window.c (Fset_window_configuration): Record any window's old
1349 buffer if it's replaced (see Bug#8789). If the new current
1350 buffer doesn't appear in the selected window, go to its old
1351 point (Bug#12208).
1352
1353 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1354
1355 Special MEM_TYPE_SPARE to denote reserved memory.
1356 * alloc.c (enum mem_type): New memory type.
1357 (refill_memory_reserve): Use new type for spare memory.
1358 This prevents live_cons_p and live_string_p from incorrect
1359 detection of uninitialized objects from spare memory as live.
1360
1361 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1362
1363 Spelling fixes.
1364 * Makefile.in (.PHONY): versioclean -> versionclean.
1365
1366 Remove unused external symbols.
1367 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1368 * window.c (Qwindow_valid_p, decode_valid_window):
1369 Now static, not extern.
1370 * data.c (Qinterval): Remove; unused.
1371 (syms_of_data): Do not define 'interval'.
1372 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1373 * window.h (decode_valid_window):
1374 Remove decls.
1375
1376 * character.c, charset.c, chartab.c: Use bool for booleans.
1377 * character.c (lisp_string_width, string_count_byte8)
1378 (string_escape_byte8):
1379 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1380 (load_charset_map_from_file, map_charset_chars)
1381 (Fdefine_charset_internal, define_charset_internal)
1382 (Fdeclare_equiv_charset, find_charsets_in_text)
1383 (Ffind_charset_region, char_charset, Fiso_charset):
1384 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1385 (sub_char_table_set, sub_char_table_set_range)
1386 (char_table_set_range, optimize_sub_char_table)
1387 (map_sub_char_table):
1388 Use bool for boolean.
1389 * character.c (str_to_unibyte): Omit last boolean argument; it was
1390 always 0. All callers changed.
1391 * character.h, charset.h: Adjust to match previous changes.
1392 * character.h (char_printable_p): Remove decl of nonexistent function.
1393 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1394 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1395 are all boolean, so make them single-bit bitfields.
1396
1397 * lisp.h (ASET): Remove attempt to detect side effects.
1398 It was meant to be temporary and it often doesn't work,
1399 because when IDX has side effects the behavior of IDX==IDX
1400 is undefined. See Stefan Monnier in
1401 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1402
1403 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1404
1405 * lisp.h (functionp): New function (extracted from Ffunctionp).
1406 (FUNCTIONP): Use it.
1407 * eval.c (Ffunctionp): Use it.
1408
1409 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1410
1411 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1412 as that's faster and simpler than static storage. Don't bother
1413 with the g_main_context_query overhead if g_main_context_pending
1414 says no events are pending.
1415 (gfds, gfds_size): Remove these static vars.
1416 (xgselect_initialize): Remove; no longer needed.
1417 All uses and decls removed.
1418
1419 * emacs.c (fatal_error_signal_hook): Remove.
1420 All uses removed. This leftover from old code was always 0.
1421
1422 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1423 * casefiddle.c (casify_object, casify_region):
1424 * casetab.c (set_case_table):
1425 * category.c, category.h (word_boundary_p):
1426 * category.h (CHAR_HAS_CATEGORY):
1427 Use bool for booleans, instead of int.
1428
1429 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1430
1431 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1432
1433 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1434
1435 On assertion failure, print backtrace if available.
1436 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1437 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1438 * Makefile.in (LIB_EXECINFO): New macro.
1439 (LIBES): Use it.
1440
1441 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1442 * bytecode.c (exec_byte_code):
1443 * callint.c (check_mark, Fcall_interactively):
1444 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1445 (getenv_internal, sync_process_alive, call_process_exited):
1446 * lisp.h (USE_SAFE_ALLOCA):
1447 Use bool for booleans, instead of int.
1448 * lisp.h, process.h: Adjust prototypes to match above changes.
1449 * callint.c (Fcall_interactively): Don't assume the mark's
1450 offset fits in 'int'.
1451
1452 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1453
1454 * buffer.c, buffer.h: Use bool for boolean.
1455 * buffer.c (reset_buffer_local_variables)
1456 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1457 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1458 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1459 (overlay_touches_p, overlay_strings, Foverlay_put)
1460 (report_overlay_modification, call_overlay_mod_hooks):
1461 (mmap_enlarge, mmap_set_vars):
1462 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1463 Use bool for booleans, instead of int.
1464 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1465 since the 1-or-0 return value is always ignored anyway.
1466 (mmap_initialized_p):
1467 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1468 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1469
1470 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1471
1472 * bidi.c: Use bool for boolean.
1473 This is a bit more readable, and makes the text segment of bidi.o
1474 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1475 Presumably it's faster too.
1476 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1477 Now bool.
1478 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1479 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1480 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1481 (bidi_explicit_dir_char, bidi_level_of_next_char)
1482 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1483 Use bool for booleans, instead of int.
1484 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1485 (bidi_unshelve_cache): Adjust decls to match code.
1486
1487 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1488
1489 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1490 argument.
1491
1492 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1493
1494 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1495 * atimer.h: Include <stdbool.h>.
1496
1497 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1498
1499 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1500 compile time tests instead of run time tests on systems that do
1501 not use them.
1502 (FRAME_MAC_P): Remove leftover from deleted code.
1503 * frame.c (syms_of_frame): Remove leftover from deleted code.
1504
1505 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1506
1507 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1508
1509 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1510
1511 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1512 Otherwise, the compiler complains about (A?B:C) where B is void
1513 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1514 (fontset_add): Return void, for FONTSET_ADD.
1515
1516 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1517
1518 * alloc.c: Use bool for booleans.
1519 (gc_in_progress, abort_on_gc)
1520 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1521 (dont_register_blocks) [GC_MALLOC_CHECK]:
1522 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1523 (check_string_bytes, make_specified_string, memory_full)
1524 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1525 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1526 (mark_stack, valid_pointer_p, make_pure_string)
1527 (Fgarbage_collect, survives_gc_p, gc_sweep):
1528 Use bool for booleans, instead of int.
1529 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1530 Remove unused local.
1531 * alloc.c (PURE_POINTER_P):
1532 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1533 * editfns.c (Fformat):
1534 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1535 (Fdo_auto_save):
1536 * fns.c (sweep_weak_table):
1537 * lisp.h (suppress_checking, push_message, survives_gc_p)
1538 (make_pure_string, gc_in_progress, abort_on_gc):
1539 * lread.c (readchar, read1):
1540 * print.c (Fprin1_to_string):
1541 * xdisp.c (push_message):
1542 Use bool for booleans affected directly or indirectly by
1543 alloc.c's changes.
1544
1545 Make recently-introduced setters macros.
1546 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1547 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1548 (set_fontset_default, set_fontset_fallback): Rename from their
1549 upper-case counterparts, and make them functions rather than macros.
1550 This is more consistent with the other recently-introduced setters.
1551 These don't need to be inline, since they're local.
1552
1553 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1554
1555 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1556 the loop (Bug#12247).
1557
1558 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1559
1560 * lisp.h (vcopy): Use memcpy rather than our own loop.
1561 This fixes a performance regression introduced by the recent
1562 addition of vcopy. This means 'vcopy' will need to be modified
1563 for a copying collector, but that's OK. Also, tighten the
1564 checking in the assertion.
1565
1566 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1567
1568 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1569 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1570 non-base glyph for the width of the base character, according to
1571 what x_draw_composite_glyph_string_foreground expects.
1572 Generate WADJUST value according to composition_gstring_width's
1573 expectations, to produce correct width of the composed character.
1574 Reverse the sign of the DU offset produced by ScriptPlace.
1575
1576 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1577
1578 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1579
1580 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1581
1582 Avoid direct writes to contents member of struct Lisp_Vector.
1583 * lisp.h (vcopy): New function to copy data into vector.
1584 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1585 * fns.c (Ffillarray): Use ASET.
1586 * keyboard.c (timer_check_2): Use AREF and ASET.
1587 (append_tool_bar_item, Frecent_keys): Use vcopy.
1588 * lread.c (read_vector): Use ASET.
1589 * msdos.c (Frecent_doskeys): Use vcopy.
1590 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1591 (Finternal_merge_in_global_face): Use ASET and vcopy.
1592 * xfont.c (xfont_list_pattern): Likewise.
1593
1594 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1595
1596 * window.c (Fwindow_point): For the selected window always return
1597 the position of its buffer's point.
1598 (Fset_window_point): For the selected window always go in its
1599 buffer to the specified position.
1600
1601 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1602
1603 Setter macros for fontsets.
1604 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1605 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1606 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1607 Adjust users.
1608
1609 2012-08-20 Glenn Morris <rgm@gnu.org>
1610
1611 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1612 Don't assume that `ln -f' works.
1613
1614 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1615
1616 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1617 and later about non-assignments with no effect. See discussion at
1618 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1619 details.
1620
1621 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1622
1623 Inline setter functions for Lisp_Objects slots of struct specbinding.
1624 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1625 Adjust users.
1626
1627 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1628
1629 * window.c (select_window): Always make selected window's buffer
1630 current.
1631
1632 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1633
1634 Use AREF and ASET for docstrings of category tables.
1635 * category.h (CATEGORY_DOCSTRING): Use AREF.
1636 (SET_CATEGORY_DOCSTRING): Use ASET.
1637 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1638
1639 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1640
1641 Inline setter functions for hash table members.
1642 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1643 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1644 (set_hash_key_and_value, set_hash_index, set_hash_next)
1645 (set_hash_hash): New functions.
1646 * charset.c, fns.c: Adjust users.
1647
1648 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1649
1650 Inline getter and setter functions for per-buffer values.
1651 * buffer.h (per_buffer_default, set_per_buffer_default)
1652 (per_buffer_value, set_per_buffer_value): New functions.
1653 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1654 * buffer.c, data.c: Adjust users.
1655
1656 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1657
1658 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1659
1660 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1661
1662 Rely on <config.h> + <unistd.h> to declare 'environ',
1663 as gnulib does this if the system doesn't.
1664 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1665 Remove declaration. MS-Windows declares it on stdlib.h which is
1666 included by conf_post.h.
1667 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1668 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1669 * vm-limit.c: Include <unistd.h>, for 'environ'.
1670
1671 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1672 (start_of_data): Remove decl; mem-limits.h provides it.
1673
1674 * xdisp.c (handle_invisible_prop): Make it a bit faster
1675 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1676
1677 2012-08-19 Chong Yidong <cyd@gnu.org>
1678
1679 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1680 ends (Bug#3874).
1681
1682 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1683
1684 * .gdbinit: Use call instead of set when calling a function in the
1685 inferior.
1686
1687 * data.c (set_internal): Don't use set_blv_found.
1688 (Fkill_local_variable): Likewise.
1689
1690 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1691
1692 * nsfont.m (ns_ascii_average_width): Ensure the string
1693 ascii_printable is initialized with a null-terminated character
1694 array. Otherwise, it can contain undesired extra characters.
1695
1696 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1697
1698 port new setting code to Sun C 5.8 2005/10/13
1699 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1700 Return void, not Lisp_Object. Otherwise, the compiler
1701 complains about (A?B:C) where B is void and C is Lisp_Object
1702 when compiling CHAR_TABLE_SET, due to the recent change to
1703 the API of sub_char_table_set_contents.
1704
1705 2012-08-18 Chong Yidong <cyd@gnu.org>
1706
1707 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1708 for the string case (Bug#3874).
1709
1710 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1711
1712 * buffer.h (BSET): Remove (Bug#12215).
1713 Replace all uses with calls to new setter functions.
1714 (bset_bidi_paragraph_direction, bset_case_canon_table)
1715 (bset_case_eqv_table, bset_directory, bset_display_count)
1716 (bset_display_time, bset_downcase_table)
1717 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1718 (bset_last_selected_window, bset_local_var_alist)
1719 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1720 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1721 (bset_width_table):
1722 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1723 (bset_auto_fill_function, bset_auto_save_file_format)
1724 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1725 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1726 (bset_cache_long_line_scans, bset_case_fold_search)
1727 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1728 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1729 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1730 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1731 (bset_header_line_format, bset_indicate_buffer_boundaries)
1732 (bset_indicate_empty_lines, bset_invisibility_spec)
1733 (bset_left_fringe_width, bset_major_mode, bset_mark)
1734 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1735 (bset_name, bset_overwrite_mode, bset_pt_marker)
1736 (bset_right_fringe_width, bset_save_length)
1737 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1738 (bset_scroll_up_aggressively, bset_selective_display)
1739 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1740 (bset_word_wrap, bset_zv_marker):
1741 * category.c (bset_category_table):
1742 * syntax.c (bset_syntax_table):
1743 New setter functions.
1744
1745 * process.h (PSET): Remove (Bug#12215).
1746 Replace all uses with calls to new setter functions.
1747 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1748 (PROCESS_INLINE): New macro.
1749 (pset_childp): New setter function.
1750 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1751 * process.c (PROCESS_INLINE):
1752 Define to EXTERN_INLINE, so that the corresponding functions
1753 are compiled into code.
1754 (pset_buffer, pset_command, pset_decode_coding_system)
1755 (pset_decoding_buf, pset_encode_coding_system)
1756 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1757 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1758 (pset_type, pset_write_queue): New setter functions.
1759
1760 * window.h (WSET): Remove (Bug#12215).
1761 Replace all uses with calls to new setter functions.
1762 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1763 (WINDOW_INLINE): New macro.
1764 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1765 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1766 (wset_total_lines, wset_vertical_scroll_bar)
1767 (wset_window_end_pos, wset_window_end_valid)
1768 (wset_window_end_vpos): New setter functions.
1769 * window.c (WINDOW_INLINE):
1770 Define to EXTERN_INLINE, so that the corresponding functions
1771 are compiled into code.
1772 (wset_combination_limit, wset_dedicated, wset_display_table)
1773 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1774 (wset_new_normal, wset_new_total, wset_next_buffers)
1775 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1776 (wset_prev_buffers, wset_right_fringe_width)
1777 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1778 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1779 (wset_window_parameters):
1780 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1781 (wset_column_number_displayed, wset_region_showing):
1782 New setter functions.
1783
1784 * termhooks.h (TSET): Remove (Bug#12215).
1785 Replace all uses with calls to new setter functions.
1786 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1787 (TERMHOOKS_INLINE): New macro.
1788 (tset_charset_list, tset_selection_alist): New setter functions.
1789 * terminal.c (TERMHOOKS_INLINE):
1790 Define to EXTERN_INLINE, so that the corresponding functions
1791 are compiled into code.
1792 (tset_param_alist): New setter function.
1793
1794 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1795
1796 * keyboard.h (KSET): Remove (Bug#12215).
1797 Replace all uses with calls to new setter functions.
1798 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1799 (KEYBOARD_INLINE): New macro.
1800 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1801 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1802 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1803 New setter functions.
1804 * keyboard.c (KEYBOARD_INLINE):
1805 Define to EXTERN_INLINE, so that the corresponding functions
1806 are compiled into code.
1807 (kset_echo_string, kset_kbd_queue)
1808 (kset_keyboard_translate_table, kset_last_prefix_arg)
1809 (kset_last_repeatable_command, kset_local_function_key_map)
1810 (kset_overriding_terminal_local_map, kset_real_last_command)
1811 (kset_system_key_syms): New setter functions.
1812
1813 * frame.h (FSET): Remove (Bug#12215).
1814 Replace all uses with calls to new setter functions.
1815 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1816 (FRAME_INLINE): New macro.
1817 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1818 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1819 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1820 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1821 (fset_param_alist, fset_root_window, fset_scroll_bars)
1822 (fset_selected_window, fset_title, fset_tool_bar_items)
1823 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1824 * frame.c (FRAME_INLINE):
1825 Define to EXTERN_INLINE, so that the corresponding functions
1826 are compiled into code.
1827 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1828
1829 A few more naming-convention fixes for getters and setters.
1830 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1831 and rename from buffer_overlays_set_before.
1832 (set_buffer_overlays_after): Move here from buffer.h, and rename
1833 from buffer_overlays_set_after.
1834 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1835 All uses changed.
1836 (set_buffer_intervals): Rename from buffer_set_intervals.
1837 * intervals.c (set_interval_object): Move here from intervals.h,
1838 and rename from interval_set_object.
1839 (set_interval_left): Move here from intervals.h, and rename from
1840 interval_set_left.
1841 (set_interval_right): Move here from intervals.h, and rename from
1842 interval_set_right.
1843 (copy_interval_parent): Move here from intervals.h, and rename from
1844 interval_copy_parent.
1845 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1846 (set_interval_plist): Rename from interval_set_plist.
1847 Return void, not Lisp_Object, since no caller uses the result.
1848 * lisp.h (string_intervals): Rename from string_get_intervals.
1849 (set_string_intervals): Rename from string_set_intervals.
1850
1851 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1852 (set_char_table_contents): Rename from char_table_set_contents.
1853 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1854 All uses changed. See the end of
1855 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1856
1857 * lisp.h (CSET): Remove (Bug#12215).
1858 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1859 (set_char_table_purpose): New functions,
1860 replacing CSET. All uses changed. For example, replace
1861 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1862 "set_char_table_parent (char_table, parent);".
1863 The old version was confusing because it used the same name
1864 'parent' for two different things.
1865
1866 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1867
1868 Functions to get and set Lisp_Object fields of buffer-local variables.
1869 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1870 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1871 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1872 * data.c, eval.c, frame.c: Adjust users.
1873
1874 2012-08-17 Chong Yidong <cyd@gnu.org>
1875
1876 * xfaces.c (merge_face_vectors): If the target font specfies a
1877 font spec, make the font's attributes take precedence over
1878 directly-specified attributes.
1879 (merge_face_ref): Recognize :font.
1880
1881 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1882
1883 Do not use memcpy for copying intervals.
1884 * intervals.c (reproduce_interval): New function.
1885 (reproduce_tree, reproduce_tree_obj): Use it.
1886 (reproduce_tree_obj): Remove prototype.
1887
1888 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1889
1890 * lisp.h (duration_to_sec_usec): Remove unused decl.
1891
1892 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1893
1894 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1895 to an allocated instance of NSString, not to the class itself.
1896
1897 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1898
1899 * makefile.w32-in (C_CTYPE_H): New macro.
1900 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1901 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1902 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1903
1904 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1905
1906 Use ASCII tests for character types.
1907 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1908 * xfns.c, xterm.c:
1909 Don't include <ctype.h>; was not needed.
1910 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1911 * sysdep.c, xfaces.c:
1912 Include <c-ctype.h> instead of <ctype.h>.
1913 * nsterm.m: Include <c-ctype.h>.
1914 * charset.c (read_hex):
1915 * doc.c (Fsnarf_documentation):
1916 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1917 (DRIVE_LETTER) [DOS_NT]:
1918 (Ffile_name_directory, Fexpand_file_name)
1919 (Fsubstitute_in_file_name):
1920 * font.c (font_parse_xlfd, font_parse_fcname):
1921 * frame.c (x_set_font_backend):
1922 * gtkutil.c (xg_get_font):
1923 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1924 * nsimage.m (hexchar):
1925 * nsterm.m (ns_xlfd_to_fontname):
1926 * sysdep.c (system_process_attributes):
1927 * xfaces.c (hash_string_case_insensitive):
1928 Use C-locale tests instead of locale-specific tests for character
1929 types, since we want the ASCII interpretation here, not the
1930 interpretation suitable for whatever happens to be the current locale.
1931
1932 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1933
1934 Consistently check windows for validity/liveness
1935 (Bug#11984, Bug#12025, Bug#12026).
1936 * lisp.h (CHECK_VALID_WINDOW): New macro.
1937 * window.c (decode_window): Rename to decode_live_window.
1938 (decode_valid_window, Fwindow_valid_p): New functions.
1939 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1940 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1941 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1942 (Fwindow_prev_sibling, Fwindow_combination_limit)
1943 (Fset_window_combination_limit, Fwindow_use_time)
1944 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1945 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1946 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1947 (Fwindow_hscroll, Fset_window_hscroll)
1948 (Fwindow_redisplay_end_trigger)
1949 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1950 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1951 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1952 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1953 (Fwindow_end, Fset_window_point, Fset_window_start)
1954 (Fpos_visible_in_window_p, Fwindow_line_height)
1955 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1956 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1957 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1958 (Fset_window_parameter, Fwindow_display_table)
1959 (Fset_window_display_table, Fdelete_other_windows_internal)
1960 (Fset_window_buffer, Fset_window_new_total)
1961 (Fset_window_new_normal, Fdelete_window_internal)
1962 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1963 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1964 (Fwindow_scroll_bars): Check whether argument window is a valid or
1965 live window. Update doc-strings.
1966 (syms_of_window): New symbol Qwindow_valid_p.
1967 * keyboard.c (Fposn_at_x_y): Check whether argument
1968 frame_or_window denotes a valid window.
1969
1970 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1971
1972 Fix previous char table change.
1973 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1974 * chartab.c (optimize_sub_char_table): Likewise.
1975
1976 2012-08-16 Chong Yidong <cyd@gnu.org>
1977
1978 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1979
1980 * xfont.c (xfont_open):
1981 * xftfont.c (xftfont_open): Set the font's max_width field.
1982
1983 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1984 min_width to space_width and average_width to the average over
1985 printable ASCII characters.
1986 (ns_char_width): Code cleanup.
1987 (ns_ascii_average_width): New utility function.
1988
1989 * font.h (struct font): Update comments.
1990
1991 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1992
1993 Simple interface to set Lisp_Object fields of character tables.
1994 * lisp.h (CSET): New macro.
1995 (char_table_set_extras, char_table_set_contents)
1996 (sub_char_table_set_contents): New function.
1997 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1998 * syntax.c: Adjust users.
1999
2000 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2001
2002 * eval.c (eval_sub): Bind lexical-binding.
2003 * lread.c (Qlexical_binding): Make non-static.
2004
2005 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2006
2007 * nsmenu.m (popupSession): Remove.
2008 (pop_down_menu): Remove endModalSession.
2009 (timeout_handler:): New method.
2010 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2011 Call runModalForWindow. Check timer_fired when it returns.
2012 If not set, cancel timer and break out of loop.
2013 Otherwise loop again, with a new timeout.
2014
2015 * nsterm.m: Include fcntl.h if present.
2016 (fd_entry, t_readfds, inNsSelect): Remove.
2017 (select_writefds, select_valid, select_timeout, selfds)
2018 (select_mutex, apploopnr): Add.
2019 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2020 Otherwise call kbd_buffer_store_event.
2021 (ns_send_appdefined): Remove release of fd_entry.
2022 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2023 Increment and decrement apploopnr.
2024 (ns_select): If no file descriptors, just do a NSTimer.
2025 Otherwise copy read/write masks and start select thread (fd_handler).
2026 Start main loop and wait for application defined event.
2027 Inform select thread to stop selecting after main loop is exited.
2028 (ns_term_init): Create selfds pipe and set non-blocking.
2029 Initialize select_mutex. Start the select thread (fd_handler).
2030 (fd_handler:): Loop forever, wait for info from the main thread
2031 to either start or stop selecting. When select returns, send
2032 and appdefined event.
2033 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2034 If not call kbd_buffer_store_event.
2035
2036 * nsterm.h (EmacsApp): fd_handler takes id argument.
2037 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2038
2039 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2040
2041 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2042
2043 * region-cache.c (move_cache_gap): Update gap_len using the actual
2044 growth of the boundaries array. Do not change cache_len.
2045 (Bug#12196)
2046
2047 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2048
2049 Generalize and cleanup font subsystem checks.
2050 * font.h (FONT_DEBUG, font_assert): Remove.
2051 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2052 Change font_assert to eassert. Use eassert where appropriate.
2053
2054 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2055
2056 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2057
2058 2012-08-15 Chong Yidong <cyd@gnu.org>
2059
2060 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2061 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2062 extract the font descriptor instead of just the font name.
2063 In that case, return a font spec instead of a string.
2064 (x_last_font_name): Move to this file from xfns.c.
2065
2066 * xfns.c (Fx_select_font): The return value can also be a font
2067 spec. Move x_last_font_name management to gtkutil.c.
2068
2069 * xfaces.c: Make font weight and style symbols non-static.
2070
2071 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2072
2073 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2074 (bug#12117).
2075
2076 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2077
2078 * alloc.c (Fgarbage_collect): Use plural form consistently.
2079
2080 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2081
2082 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2083 iteration through the command loop. Fixes a problem whereby mouse
2084 movements are ignored until the first mouse click.
2085
2086 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2087
2088 Use bool, not int, for Lisp booleans.
2089 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2090 makes Emacs a bit smaller and presumably a bit faster.
2091 * lisp.h: Include <stdbool.h>.
2092 (struct Lisp_Boolfwd, defvar_bool):
2093 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2094 * regex.c [!emacs]: Include <stdbool.h>.
2095 (false, true): Remove; <stdbool.h> does this for us now.
2096
2097 2012-08-14 Chong Yidong <cyd@gnu.org>
2098
2099 * character.c (Fcharacterp): Doc fix (Bug#12076).
2100
2101 * data.c (Findirect_variable): Doc fix (Bug#11040).
2102
2103 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2104
2105 * editfns.c (Fformat): Doc fix (Bug#12059).
2106 (Fsave_current_buffer): Doc fix (Bug#11542).
2107
2108 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2109
2110 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2111 (bug#12022).
2112
2113 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2114
2115 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2116 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2117 * minibuf.c (choose_minibuf_frame, read_minibuf):
2118 * w32fns.c (x_create_tip_frame):
2119 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2120 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2121
2122 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2123
2124 * intervals.c (offset_intervals): Remove obsolete comment.
2125
2126 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2127
2128 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2129
2130 2012-08-14 Gergely Risko <gergely@risko.hu>
2131
2132 * coding.c (decode_coding): Record buffer modification before
2133 disabling undo_list (Bug#11773).
2134
2135 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2136
2137 Revert and cleanup some recent overlay changes.
2138 * buffer.h (enum overlay_type): Remove.
2139 (buffer_get_overlays, buffer_set_overlays): Likewise.
2140 (buffer_set_overlays_before, buffer_set_overlays_after):
2141 New function. Adjust users.
2142 (unchain_both): Add eassert.
2143
2144 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2145
2146 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2147
2148 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2149
2150 * gtkutil.c (xg_mark_data): Don't assume C99.
2151
2152 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2153
2154 * gtkutil.c (xg_frame_tb_info): New struct.
2155 (TB_INFO_KEY): New define.
2156 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2157 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2158 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2159 if not present.
2160 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2161 is up to date. Otherwise store new data.
2162 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2163
2164 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2165
2166 Use KSET for write access to Lisp_Object members of struct kboard.
2167 * keyboard.h (KSET): New macro.
2168 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2169 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2170 * xterm.c: Adjust users.
2171
2172 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2173
2174 Use BSET for write access to Lisp_Object members of struct buffer.
2175 * buffer.h (BSET): New macro.
2176 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2177 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2178 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2179 * window.c, xdisp.c, xfns.c: Adjust users.
2180
2181 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2182
2183 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2184
2185 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2186
2187 * nsterm.m (not_in_argv): New function.
2188 (application:openFile, application:openTempFile:):
2189 (application:openFileWithoutUI:, application:openFiles:): Open file
2190 if not_in_argv returns non-zero (bug#12171).
2191
2192 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2193 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2194 Define for Gtk+ versions less than 3.2.
2195 (xg_get_font_name): Use those functions/macros here.
2196 Reported by Frans Oilinki <moilinki@gmail.com>.
2197
2198 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2199
2200 * unexmacosx.c (copy_data_segment): Copy initialized data in
2201 statically linked libraries from input file rather than memory.
2202
2203 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2204 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2205 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2206
2207 2012-08-10 Glenn Morris <rgm@gnu.org>
2208
2209 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2210 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2211
2212 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2213
2214 Fix last change to allow compilation with low optimization levels.
2215 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2216 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2217
2218 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2219
2220 Use common inline syntax in intervals.h.
2221 * intervals.h (INTERVALS_INLINE): New macro.
2222 Change all users from LISP_INLINE.
2223
2224 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 Define Qnone once for all platforms.
2227 * frame.c (Qnone): Define here.
2228 (syms_of_frame): DEFSYM it.
2229 * lisp.h (Qnone): New declaration.
2230 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2231 * xfns.c: Remove duplication. Adjust users.
2232
2233 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2234
2235 Remove unused macros from intervals.h.
2236 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2237 * intervals.c: Adjust comment.
2238
2239 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2240
2241 * w32fns.c <w32_unicode_gui>: New static variable.
2242 (globals_of_w32fns): Initialize it according to os_subtype.
2243 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2244 testing os_subtype.
2245
2246 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2247 Eli Zaretskii <eliz@gnu.org>
2248
2249 Fix bug #10299 with Unicode characters sent by customized
2250 keyboards created by MSKLC.
2251 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2252 (w32_init_class): Use it to initialize the Emacs class with either
2253 ANSI or Unicode API calls.
2254 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2255 later.
2256 (w32_wnd_proc): If the character code sent by WM_CHAR or
2257 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2258 original message. Call DefWindowProcW on NT and later.
2259
2260 2012-08-10 Glenn Morris <rgm@gnu.org>
2261
2262 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2263
2264 * lisp.h (DIRECTORY_SEP): Let configure set it.
2265
2266 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2267
2268 Use TSET for write access to Lisp_Object slots of struct terminal.
2269 * termhooks.h (TSET): New macro.
2270 * coding.c, terminal.c, xselect.c: Adjust users.
2271
2272 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2273
2274 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2275 the failing expression, include them in the error message.
2276 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2277 * lisp.h (internal_condition_case_n): Update declaration.
2278
2279 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2280
2281 Inline functions to examine and change buffer overlays.
2282 * buffer.c (unchain_both): New function.
2283 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2284 (buffer_has_overlays): New function.
2285 (enum overlay_type): New enum.
2286 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2287 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2288
2289 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2290
2291 Inline functions to examine and change buffer intervals.
2292 * alloc.c (mark_interval_tree): Remove.
2293 (MARK_INTERVAL_TREE): Simplify.
2294 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2295 * intervals.c (buffer_balance_intervals): New function.
2296 (graft_intervals_into_buffer): Adjust indentation.
2297 (set_intervals_multibyte): Simplify.
2298 * buffer.h (BUF_INTERVALS): Remove.
2299 (buffer_get_intervals, buffer_set_intervals): New function.
2300 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2301 * intervals.c, textprop.c: Adjust users.
2302
2303 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2304
2305 Inline functions to examine and change string intervals.
2306 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2307 (string_get_intervals, string_set_intervals): New function.
2308 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2309 * lread.c, print.c, textprop.c: Adjust users.
2310
2311 2012-08-08 Glenn Morris <rgm@gnu.org>
2312
2313 * lisp.mk (lisp): Remove language/persian.elc.
2314
2315 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2316
2317 Cleanup intervals.
2318 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2319 (NULL_INTERVAL_P): Likewise. Adjust users.
2320 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2321 Adjust comment. Move under #if 0.
2322 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2323 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2324
2325 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2326
2327 Check total length of intervals with eassert.
2328 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2329 * intervals.c: Change all users to eassert.
2330
2331 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2332
2333 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2334 Rename fields to match removal of FGET and WGET and disuse of
2335 INTERNAL_FIELD in Lisp_Cons.
2336
2337 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2338
2339 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2340 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2341 name since all xname users are fixed long time ago. Do not
2342 use INTERNAL_FIELD.
2343 (set_symbol_name, set_symbol_function, set_symbol_plist):
2344 (set_symbol_next, set_overlay_plist): New function.
2345 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2346 (struct Lisp_Overlay): Likewise.
2347 (CVAR, MVAR, SVAR): Remove.
2348 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2349 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2350 * xterm.c: Adjust users.
2351 * .gdbinit: Change to use name field of struct Lisp_Symbol
2352 where appropriate.
2353
2354 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2355
2356 Basic functions to set Lisp_Object and pointer slots of intervals.
2357 * intervals.h (interval_set_parent, interval_set_object):
2358 (interval_set_left, interval_set_right, interval_set_plist):
2359 (interval_copy_parent): New function.
2360 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2361 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2362 Adjust indentation.
2363 (INTERVAL_SIZE): Remove. Adjust users.
2364 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2365
2366 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2367
2368 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2369 * process.h (PGET): Remove.
2370 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2371 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2372
2373 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2374
2375 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2376 * window.h (WGET): Remove.
2377 (struct window): Do not use INTERNAL_FIELD.
2378 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2379 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2380 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2381 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2382 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2383 Adjust users.
2384
2385 2012-08-07 Chong Yidong <cyd@gnu.org>
2386
2387 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2388 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2389 (Fdelete_window_internal): Signal an error if the window is not on
2390 a live frame (Bug#12025).
2391
2392 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2393
2394 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2395 * frame.h (FGET): Remove.
2396 (struct frame): Do not use INTERNAL_FIELD.
2397 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2398 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2399 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2400 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2401
2402 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2403
2404 * w32.c: Silence compiler warnings.
2405 (map_w32_filename): Remove unused variable `is_fat'.
2406 (chase_symlinks): Add parentheses around expression.
2407
2408 2012-08-06 Glenn Morris <rgm@gnu.org>
2409
2410 * sysdep.c: Respect BROKEN_GETWD.
2411
2412 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2413 Let configure handle it.
2414 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2415
2416 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2417
2418 Use GCALIGNMENT where appropriate.
2419 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2420 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2421 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2422
2423 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2424
2425 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2426 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2427
2428 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2429
2430 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2431 that should be sufficient for everyone.
2432
2433 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2434
2435 * keyboard.c (timer_check_2): Add break so timer_check returns next
2436 timeout.
2437
2438 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2439
2440 Fix Windows build errors introduced after converting to WGET and WSET.
2441 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2442 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2443
2444 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2445
2446 * nsterm.m (ns_frame_rehighlight): Use FSET.
2447
2448 * nsmenu.m (ns_update_menubar): Use FSET.
2449
2450 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2451
2452 Separate read and write access to Lisp_Object slots of Lisp_Process.
2453 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2454 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2455
2456 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2457
2458 Separate read and write access to Lisp_Object slots of struct window.
2459 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2460 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2461 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2462 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2463 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2464 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2465 Adjust users.
2466
2467 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2468
2469 Fix Windows build errors introduced after converting to FGET and FSET.
2470 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2471 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2472 (w32_judge_scroll_bars): Change to use FSET.
2473 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2474
2475 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2476
2477 Fix replacement typo.
2478 * window.c (replace_window): Set root_window instead of
2479 selected_window. This fixes a total window subsystem
2480 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2481
2482 2012-08-06 Glenn Morris <rgm@gnu.org>
2483
2484 * lisp.mk (lisp): Add language/persian.elc.
2485
2486 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2487
2488 Separate read and write access to Lisp_Object slots of struct frame.
2489 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2490 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2491 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2492 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2493 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2494
2495 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2496
2497 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2498
2499 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2500
2501 Generalize common compile-time constants.
2502 * lisp.h (header_size, bool_header_size, word_size): Now here.
2503 (struct Lisp_Vector): Add comment.
2504 (struct Lisp_Bool_Vector): Move up to define handy constants.
2505 (VECSIZE, PSEUDOVECSIZE): Simplify.
2506 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2507 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2508 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2509 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2510 * xfont.c, xmenu.c: Use word_size where appropriate.
2511
2512 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2513
2514 * search.c (Freplace_match): Treat \? in the replacement text
2515 literally (Bug#8161).
2516
2517 2012-08-05 Chong Yidong <cyd@gnu.org>
2518
2519 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2520 * frame.c (Vdelete_frame_functions):
2521 * emacs.c (Vkill_emacs_hook): Doc fix.
2522
2523 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2524
2525 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2526 --with-x-toolkit=no builds.
2527 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2528
2529 2012-08-04 Chong Yidong <cyd@gnu.org>
2530
2531 * syntax.c (Fmodify_syntax_entry): Doc fix.
2532
2533 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2534
2535 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2536 * w32.c (init_environment): Change the default values of many
2537 environment variables in dflt_envvars[] to NULL, to avoid pushing
2538 them into environment when they were not already defined.
2539 Remove the code that deletes site-lisp subdirectories from the default
2540 value of EMACSLOADPATH, as it is no longer needed.
2541 (check_windows_init_file): Now external, not static.
2542 Use Vload_path as is, without adding anything, as this function is now
2543 called when Vload_path is already set up.
2544
2545 * w32.h (check_windows_init_file): Add prototype.
2546
2547 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2548 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2549 compatibility with Posix platforms.
2550 (main): Move the call to check_windows_init_file to here from
2551 w32.c.
2552 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2553 any, in the DEFALT argument into the root of the Emacs build or
2554 installation tree, as appropriate.
2555
2556 * callproc.c (init_callproc_1): Call decode_env_path instead of
2557 doing its equivalent by hand.
2558 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2559 the code that sets Vexec_path run on MS-Windows.
2560
2561 * lread.c (init_lread): Add comments to #ifdef's.
2562
2563 * msdos.c (dos_set_window_size, IT_update_begin)
2564 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2565 instead of direct references.
2566
2567 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2568
2569 Export DEFAULT_REHASH_* to GDB.
2570 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2571 Now constants, not macros.
2572
2573 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2574
2575 Remove unnecessary casts involving pointers.
2576 These casts are no longer needed now that we assume C89 or later,
2577 since they involve casting to or from void *.
2578 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2579 (make_pure_float, make_pure_vector):
2580 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2581 * macros.c (Fstart_kbd_macro):
2582 * menu.c (find_and_return_menu_selection):
2583 * minibuf.c (read_minibuf_noninteractive):
2584 * sysdep.c (closedir):
2585 * xdisp.c (x_produce_glyphs):
2586 * xfaces.c (compare_fonts_by_sort_order):
2587 * xfns.c (x_real_positions, select_visual):
2588 * xselect.c (x_stop_queuing_selection_requests)
2589 (x_get_window_property, x_get_window_property_as_lisp_data):
2590 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2591 Remove unnecessary pointer casts.
2592 * alloc.c (record_xmalloc): New function.
2593 * lisp.h (record_xmalloc): New decl.
2594 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2595 more like a function. This is because the pointer cast is not
2596 needed. All uses changed.
2597 * print.c (print_string, print_error_message): Avoid length recalc.
2598
2599 Improve fix for macroexp crash with debugging (Bug#12118).
2600 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2601 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2602 not supposed to be invoked from the garbage collector.
2603 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2604 (gc_aset): New function, which is like ASET but can be
2605 used in the garbage collector.
2606 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2607 (set_hash_index): Use it instead of ASET.
2608
2609 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2610
2611 Support symlinks on latest versions of MS-Windows.
2612 * w32.c: Include winioctl.h and aclapi.h.
2613 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2614 (revert_to_self): Forward declarations of static functions.
2615 <static BOOL g_b_init_get_security_info>:
2616 <g_b_init_create_symbolic_link>: New static flags.
2617 (globals_of_w32): Initialize them to zero.
2618 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2619 (map_w32_filename): Improve commentary. Simplify switch.
2620 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2621 headers (most versions of MinGW w32api don't).
2622 (get_security_info, create_symbolic_link)
2623 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2624 New functions.
2625 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2626 in the argument file name.
2627 (sys_access): Call unc_volume_file_attributes only if
2628 GetFileAttributes fails with network-related error codes.
2629 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2630 have the required privileges.
2631 (get_file_security_desc_by_name): Rename from
2632 get_file_security_desc.
2633 (stat_worker): New function, with most of the guts of 'stat', and
2634 with addition of handling of symlinks and support for 'lstat'.
2635 If possible, get file's attributes and security information by
2636 handle, not by name. Produce S_IFLNK bit for symlinks, when
2637 called from 'lstat'.
2638 (stat, lstat): New functions, call 'stat_worker'.
2639 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2640 symlinks when the underlying filesystem supports them.
2641
2642 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2643
2644 Fix macroexp crash on Windows with debugging (Bug#12118).
2645 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2646 checking subscripts; problem introduced with the recent
2647 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2648 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2649 since it's used in non-static inline functions now.
2650
2651 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2652 Don't assume buffer size fits in 'int'. Remove unused local.
2653
2654 Use C99-style 'extern inline' if available.
2655 * buffer.h (BUFFER_INLINE):
2656 * category.h (CATEGORY_INLINE):
2657 * character.h (CHARACTER_INLINE):
2658 * charset.h (CHARSET_INLINE):
2659 * composite.h (COMPOSITE_INLINE):
2660 * dispextern.h (DISPEXTERN_INLINE):
2661 * lisp.h (LISP_INLINE):
2662 * systime.h (SYSTIME_INLINE):
2663 New macro, replacing 'static inline' in this header.
2664 * buffer.h, category.h, character.h, charset.h, composite.h:
2665 * dispextern.h, lisp.h, systime.h:
2666 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2667 * alloc.c (LISP_INLINE):
2668 * buffer.c (BUFFER_INLINE):
2669 * category.c (CATEGORY_INLINE):
2670 * character.c (CHARACTER_INLINE):
2671 * charset.c (CHARSET_INLINE):
2672 * composite.c (COMPOSITE_INLINE):
2673 * dispnew.c (DISPEXTERN_INLINE):
2674 * sysdep.c (SYSTIME_INLINE):
2675 Define to EXTERN_INLINE, so that the corresponding functions
2676 are compiled into code.
2677 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2678 (INLINE_HEADER_END): New macros.
2679 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2680 since it's used in non-static inline functions now.
2681 (VALMASK) [!USE_LSB_TAG]: Likewise.
2682
2683 2012-08-02 Glenn Morris <rgm@gnu.org>
2684
2685 * s/: Remove empty directory.
2686
2687 * s/ms-w32.h: Move to ../nt/inc.
2688 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2689 Update for new ms-w32.h location.
2690
2691 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2692
2693 Port to Solaris 8.
2694 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2695
2696 2012-08-02 Glenn Morris <rgm@gnu.org>
2697
2698 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2699 hard-coding the path separator.
2700
2701 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2702
2703 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2704 This how ASET and AREF are supposed to work, and makes
2705 it easier to think about future improvements. See
2706 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2707 * charset.h (set_charset_attr): New function.
2708 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2709 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2710 (aref_addr): New function. All uses of &AREF(...) changed.
2711 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2712 (set_hash_index): New functions. All lvalue-style uses of
2713 HASH_KEY etc. changed.
2714 * keyboard.c (set_prop): New function. All lvalue-style uses
2715 of PROP changed.
2716
2717 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2718
2719 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2720 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2721 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2722 * nsfns.m (ns_set_name_as_filename): Likewise.
2723 * nsmenu.m (ns_update_menubar): Likewise.
2724 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2725
2726 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2727
2728 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2729 Adapt to latest changes in field names of the corresponding Lisp
2730 objects.
2731
2732 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2733
2734 2012-08-01 Glenn Morris <rgm@gnu.org>
2735
2736 * s/msdos.h: Remove file.
2737 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2738 * Makefile.in (S_FILE): Remove.
2739 (config_h): Remove S_FILE.
2740
2741 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2742
2743 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2744 Remove; moved to nt/config.nt.
2745
2746 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2747
2748 Use INTERNAL_FIELD for conses and overlays.
2749 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2750 Remove obsolete comment.
2751 (MVAR): New macro.
2752 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2753 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2754
2755 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2756
2757 Use INTERNAL_FIELD for symbols.
2758 * lisp.h (SVAR): New macro. Adjust users.
2759 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2760 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2761
2762 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2763
2764 Use INTERNAL_FIELD for processes.
2765 * process.h (PVAR): New macro. Adjust style.
2766 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2767 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2768
2769 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2770
2771 Use INTERNAL_FIELD for windows.
2772 * window.h (WVAR): New macro.
2773 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2774 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2775 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2776 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2777 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2778 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2779
2780 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2781
2782 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2783
2784 2012-08-01 Glenn Morris <rgm@gnu.org>
2785
2786 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2787 Move to configure.ac.
2788
2789 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2790
2791 * makefile.w32-in (CONFIG_H): Update dependencies.
2792 (CONF_POST_H): New macro.
2793
2794 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2795
2796 2012-07-31 Glenn Morris <rgm@gnu.org>
2797
2798 * Makefile.in (S_FILE): No longer set by configure.
2799
2800 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2801 is available.
2802 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2803
2804 * process.h (NULL_DEVICE):
2805 * emacs.c (SEPCHAR):
2806 * editfns.c (USER_FULL_NAME): Let configure set them.
2807
2808 * s/README, s/template.h: Remove files.
2809
2810 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2811
2812 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2813 Move to configure.ac.
2814
2815 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2816
2817 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2818 resulting renaming of 'struct frame' members.
2819
2820 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2821
2822 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2823 after introduction of FVAR.
2824
2825 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2826
2827 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2828
2829 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2830 instead of compositeToPoint.
2831 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2832
2833 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2834
2835 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2836
2837 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2838 * lisp.h (INTERNAL_FIELD): New macro.
2839 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2840 (BVAR): Change to use INTERNAL_FIELD.
2841 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2842 (KVAR): Change to use INTERNAL_FIELD.
2843 * frame.h (FVAR): New macro.
2844 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2845 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2846 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2847 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2848 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2849
2850 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2851
2852 Miscellaneous fixes for non-default X toolkits.
2853 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2854 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2855 Move under #ifdef USE_LUCID.
2856 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2857 definition and usage to avoid warnings.
2858
2859 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2860
2861 * nsterm.m (openFiles): Fix previous checkin.
2862
2863 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2864
2865 * indent.c (compute_motion): Remove unused local.
2866
2867 2012-07-31 Glenn Morris <rgm@gnu.org>
2868
2869 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2870
2871 * conf_post.h [USG5_4]:
2872 Move remaining contents of s/usg5-4-common.h here.
2873 * s/usg5-4-common.h: Remove file.
2874
2875 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2876 * s/irix6-5.h: Remove file.
2877
2878 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2879 * s/darwin.h: Remove file.
2880
2881 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2882 * s/hpux10-20.h: Remove file, which is now empty.
2883
2884 2012-07-30 Glenn Morris <rgm@gnu.org>
2885
2886 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2887 * Makefile.in (config_h): Add conf_post.h.
2888 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2889
2890 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2891
2892 * nsterm.m (ns_do_open_file): New variable.
2893 (ns_term_init): Set ns_do_open_file to YES after run returns.
2894 (openFile, openTempFile, openFileWithoutUI, openFiles):
2895 Open files only if ns_do_open_file.
2896
2897 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2898
2899 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2900 This no-op macro hasn't been needed for many years.
2901 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2902
2903 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2904 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2905 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2906 gdb_make_enums_visible.
2907 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2908 (DIRECTORY_SEP): Now a constant, not a macro.
2909
2910 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2911
2912 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2913 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2914
2915 * w32term.c <w32_keyboard_codepage>: Renamed from
2916 keyboard_codepage and now external. All users changed.
2917
2918 * w32term.h: Add declaration of w32_keyboard_codepage.
2919
2920 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2921 the codepage to translate keys to Unicode. If this argument is
2922 -1, use the value returned by GetConsoleCP. All callers changed.
2923
2924 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2925
2926 Update .PHONY listings in makefiles.
2927 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2928 bootstrap-clean, distclean, maintainer-clean, versioclean,
2929 extraclean, frc.
2930
2931 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2932 This is a bit clearer. Fix some commentary typos.
2933
2934 2012-07-30 Glenn Morris <rgm@gnu.org>
2935
2936 * s/netbsd.h: Let configure include signal.h if needed.
2937 Remove file, which is now empty.
2938
2939 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2940 Let configure set them.
2941 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2942 No more need to undefine.
2943
2944 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2945
2946 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2947 non-single-byte char when adding meta modifier. (Bug#12090)
2948
2949 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2950
2951 Convert safe_call to use variable number of arguments.
2952 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2953 (safe_call2): Fix comment.
2954 * lisp.h (safe_call): Adjust prototype.
2955 * coding.c (encode_coding_object): Change to use safe_call2.
2956 * xfaces.c (merge_face_heights): Change to use safe_call1.
2957
2958 2012-07-30 Glenn Morris <rgm@gnu.org>
2959
2960 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2961 does that unconditionally. Remove file, which is now empty.
2962
2963 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2964 Remove empty files.
2965
2966 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2967
2968 Export to GDB most of lisp.h's remaining object-like macros.
2969 * lisp.h (min, max): Move earlier, because they're used earlier now.
2970 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2971 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2972 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2973 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2974 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2975 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2976 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2977 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2978 Now constants, for GDB. They need not be macros.
2979 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2980 Now constants, for GDB, as well as macros, for static initializers.
2981 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2982 Move to after the definition of struct Lisp_Char_Table,
2983 since the former now needs that type defined.
2984 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2985 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2986 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2987 New enums, for gdb_make_enums_visible.
2988 (GLYPH_MODE_LINE_FACE): Remove; unused.
2989 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2990 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2991 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2992 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2993 enum maxargs, enum MAX_ALLOCA.
2994 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2995 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2996 no longer needed, now that they are done in lisp.h.
2997
2998 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2999
3000 Cleanup string bytes checking.
3001 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3002 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3003 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3004 (check_sblock, compact_small_strings): Simplify.
3005
3006 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3007
3008 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3009 These macros are confusing and no longer need to be defined, as
3010 the enum values now suffice. All uses replaced with definiens.
3011 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3012
3013 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3014
3015 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3016 ($(BLD)/w32console.$(O)): Update dependencies.
3017
3018 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3019
3020 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3021 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3022 time. Adjust users.
3023 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3024
3025 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3026
3027 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3028 setting sitelisp (Bug#12010).
3029
3030 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3031
3032 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3033
3034 * w32heap.c (cache_system_info):
3035 * w32.c (sys_rename):
3036 * w32proc.c (find_child_console, sys_kill): All users changed.
3037
3038 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3039
3040 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3041
3042 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3043
3044 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3045
3046 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3047
3048 Cleanup statistics calculation in Fgarbage_collect.
3049 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3050 Fix zombies percentage calculation. Simplify elapsed time calculation.
3051
3052 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3053
3054 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3055 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3056 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3057 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3058 (replace_range, replace_range_2, del_range_2): Change to eassert.
3059 * marker.c (byte_char_debug_check): Adjust style.
3060
3061 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3062
3063 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3064 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3065 long-ago-commented-out code that talks about "WIN32".
3066 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3067 All uses changed.
3068
3069 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3070
3071 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3072 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3073 Simplify by using alignof.
3074 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3075 * lisp.h: Include <stdalign.h>.
3076 (GCALIGNMENT): New macro and constant.
3077 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3078 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3079 (stdalign): New macro, if not already defined.
3080
3081 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3082
3083 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3084 * w32inevt.c: Include w32inevt.h.
3085 (w32_read_console_input): New inline function, calls either
3086 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3087 w32_console_unicode_input.
3088 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3089 (w32_kbd_patch_key, key_event): Use the codepage returned by
3090 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3091 (key_event): use uChar.UnicodeChar only if
3092 w32_console_unicode_input is non-zero.
3093
3094 * w32console.c: Include w32heap.h.
3095 <w32_console_unicode_input>: New global variable.
3096 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3097 family of Windows, zero otherwise.
3098
3099 * w32inevt.h: Declare w32_console_unicode_input.
3100
3101 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3102 --without-x. (Bug#11742)
3103
3104 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3105
3106 Adjust GDB to reflect pvec_type changes (Bug#12036).
3107 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3108 2012-07-04 changes to pseudovector representation.
3109 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3110
3111 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3112
3113 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3114 bus address.
3115 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3116
3117 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3118
3119 * alloc.c (listn): Fix the order the arguments are consed onto the
3120 list.
3121
3122 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3123 enumeration constants, as PURE and HEAP are too general, and clash
3124 with other headers and sources, such as gmalloc.c and the
3125 MS-Windows system headers. All users changed.
3126
3127 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3128
3129 Revert last save_excursion_save and save_excursion_restore changes.
3130 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3131 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3132
3133 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3134
3135 Fix recently-introduced typos in Windows port.
3136 Reported by Martin Rudalics <rudalics@gmx.at>.
3137 * w32.c (init_environment): Replace comma with semicolon.
3138 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3139
3140 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3141
3142 Improve GDB symbol export (Bug#12036).
3143 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3144 arms of an 'if', not using conditional expressions; otherwise GDB
3145 complains about the types in the unevaluated arm when the argument
3146 is an integer literal.
3147 (xgetint): Simplify expression.
3148 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3149 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3150 Zaretskii in <http://bugs.gnu.org/12036#13>.
3151 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3152 needed now that we have gdb_make_enums_visible.
3153 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3154 (enum enum_USE_LSB_TAG):
3155 New enum types, packaging up enums that need to be exported to GDB.
3156
3157 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3158
3159 Utility function to make a list from specified amount of objects.
3160 * lisp.h (enum constype): New datatype.
3161 (listn): New prototype.
3162 * alloc.c (listn): New function.
3163 (Fmemory_use_count, syms_of_alloc): Use it.
3164 * buffer.c (syms_of_buffer): Likewise.
3165 * callint.c (syms_of_callint): Likewise.
3166 * charset.c (define_charset_internal): Likewise.
3167 * coding.c (syms_of_coding): Likewise.
3168 * keymap.c (syms_of_keymap): Likewise.
3169 * search.c (syms_of_search): Likewise.
3170 * syntax.c (syms_of_syntax): Likewise.
3171 * w32.c (init_environment): Likewise.
3172 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3173 * xdisp.c (syms_of_xdisp): Likewise.
3174 * xfns.c (syms_of_xfns): Likewise.
3175
3176 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3177
3178 Fast save_excursion_save and save_excursion_restore.
3179 * lisp.h (struct Lisp_Excursion): New data type.
3180 (PVEC_EXCURSION): New pseudovector type.
3181 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3182 to deal with it. Adjust comments.
3183 (init_marker, attach_marker): New prototype.
3184 (unchain_marker): Adjust prototype.
3185 * marker.c (attach_marker): Change to global.
3186 (init_marker): New function.
3187 * alloc.c (Fmake_marker, build_marker): Use it.
3188 (build_marker): More easserts.
3189 (mark_object): Handle struct Lisp_Excursion.
3190 * editfns.c (save_excursion_save, save_excursion_restore):
3191 Reimplement to use struct Lisp_Excursion. Add comments.
3192
3193 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3194
3195 Fix export of symbols to GDB (Bug#12036).
3196 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3197 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3198 emacs.c, as this is a more-suitable home. Had this been done earlier
3199 the fix for 12036 would have avoided some of the problems noted in
3200 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3201 would have been more obvious.
3202 * emacs.c: Do not include <verify.h>; no longer needed.
3203 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3204 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3205 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3206 Remove; now done in lisp.h.
3207 * lisp.h (PUBLISH_TO_GDB): New macro.
3208 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3209 (DATA_SEG_BITS): Use it.
3210 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3211 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3212 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3213 not be usable in #if. This simplifies things.
3214
3215 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3216
3217 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3218
3219 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3220
3221 Simplify export of symbols to GDB (Bug#12036).
3222 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3223 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3224 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3225 Adjust to changes in lisp.h and emacs.c, by using
3226 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3227 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3228 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3229 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3230 instead of gdb_valbits.
3231 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3232 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3233 instead of gdb_array_mark_flag.
3234 (xboolvector): Get size from $->size, not $->header.size.
3235 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3236 (xreload, hook-run, hookpost-run): Remove.
3237 * emacs.c: Include <verify.h>.
3238 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3239 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3240 Remove.
3241 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3242 (gdb_USE_LSB_TAG): New enum constants.
3243 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3244 Also define these as enum constants, so they're visible to GDB.
3245 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3246 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3247 as constants, so they're visible to GDB.
3248 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3249 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3250 Now enum constants, not macros, so they're visible to GDB.
3251 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3252 more convenient now. All uses changed.
3253 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3254 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3255
3256 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3257
3258 Explicitly free restriction data that are not needed anymore.
3259 * editfns.c (save_restriction_restore): Free restriction data.
3260
3261 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3262
3263 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3264 add argument, tune behavior, and adjust all callers.
3265
3266 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3267
3268 Use typedef for EMACS_INT, EMACS_UINT.
3269 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3270 than macros. This simplifies debugging in the usual case, since
3271 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3272 and it allows expressions involving EMACS_INT casts.
3273 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3274
3275 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3276
3277 * nsterm.m (ns_read_socket): Return early if there is a modal
3278 window (Bug#12043).
3279
3280 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3281
3282 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3283 that FOCUS-FRAME can be omitted.
3284
3285 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3286
3287 Adjust buffer text indirection counters at the end of Fkill_buffer.
3288 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3289 buffer is definitely dead. This should really fix an issue reported
3290 by Christoph Scholtes again. (Bug#12007).
3291 (init_buffer_once): Initialize indirection counters of
3292 buffer_defaults and buffer_local_symbols (for sanity and safety).
3293
3294 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3295
3296 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3297 and continuation glyphs on tooltip frames, leave them at zero.
3298 Avoids continued lines in tooltips. (Bug#11832)
3299
3300 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3301
3302 Simplify copy_overlay.
3303 * buffer.c (copy_overlay): Simplify. Use build_marker.
3304 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3305
3306 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3307
3308 * print.c (print_object): Don't crash when a frame's name is nil
3309 or invalid. (Bug#12025)
3310
3311 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3312 it signals an error when a tooltip frame is being created.
3313
3314 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3315
3316 Cleanup miscellaneous objects allocation and initialization.
3317 * alloc.c (allocate_misc): Change to static. Add argument to
3318 specify the subtype. Adjust comment and users.
3319 (build_overlay): New function.
3320 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3321 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3322 (allocate_misc): Remove prototype.
3323 (build_overlay): Add prototype.
3324
3325 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3326
3327 Swap buffer text indirection counters in Fbuffer_swap_text.
3328 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3329 This avoids crash reported by Christoph Scholtes at
3330 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3331
3332 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3333
3334 * nsmenu.m (Popdown_data): New struct.
3335 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3336 free Popdown_data.
3337 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3338 (initWithContentRect): Make imgView and contentView non-static
3339 and autorelease them. Also autorelease img and matrix (Bug#12005).
3340 (dealloc): Remove (Bug#12005).
3341
3342 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3343
3344 Adjust consing_since_gc when objects are explicitly freed.
3345 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3346 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3347 (free_cons, free_misc): Subtract object size from consing_since_gc.
3348
3349 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3350
3351 Simplify and cleanup markers positioning code.
3352 * marker.c (attach_marker): More useful eassert.
3353 (live_buffer, set_marker_internal): New function.
3354 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3355 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3356
3357 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3358
3359 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3360 as it's limited by the amount of memory, not by INT_MAX.
3361
3362 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3363
3364 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3365 in special-event-map. See the discussion at
3366 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3367 for the reasons.
3368
3369 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3370 info.dwItemData. Fixes crashes on 64-bit Windows.
3371 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3372
3373 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3374
3375 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3376 (conversationIdentifier): Return value is NSInteger.
3377 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3378
3379 2012-07-21 Chong Yidong <cyd@gnu.org>
3380
3381 * window.c (decode_any_window): Signal an error if the window is
3382 on a dead frame (Bug#11984).
3383
3384 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3385
3386 Add indirection counting to speed up Fkill_buffer.
3387 * buffer.h (struct buffer): New member.
3388 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3389 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3390 base buffer indirection counter.
3391 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3392 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3393 through buffer list if indirection counter is 0.
3394
3395 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3396
3397 Extend the value returned by Fgarbage_collect with heap statistics.
3398 * alloc.c (Qheap): New symbol.
3399 (syms_of_alloc): DEFSYM it.
3400 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3401 (Fmemory_free): Remove.
3402 (syms_of_alloc): Don't defsubr it.
3403 * buffer.c (Fcompact_buffer): Remove.
3404 (syms_of_buffer): Don't defsubr it.
3405
3406 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3407
3408 Make maybe_gc inline.
3409 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3410 * lisp.h (consing_since_gc, gc_relative_threshold)
3411 (memory_full_cons_threshold): Revert declaration.
3412 (maybe_gc): Remove prototype, define as inline.
3413 * alloc.c: Remove old commented-out code.
3414 (consing_since_gc, gc_relative_threshold)
3415 (memory_full_cons_threshold): Revert to global.
3416 (maybe_gc): Remove.
3417
3418 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3419
3420 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3421 * lisp.h (build_unibyte_string): New function.
3422 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3423 * sysdep.c, w32fns.c, xfns.c: Use it.
3424 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3425 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3426 Adjust users accordingly.
3427 * font.h (font_open_by_name): Adjust prototype.
3428
3429 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3430
3431 Cleanup calls to Fgarbage_collect.
3432 * lisp.h (maybe_gc): New prototype.
3433 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3434 Remove declarations.
3435 * alloc.c (maybe_gc): New function.
3436 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3437 Make them static.
3438 * bytecode.c (MAYBE_GC): Use maybe_gc.
3439 * eval.c (eval_sub, Ffuncall): Likewise.
3440 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3441 to avoid dependency from auto-save feature.
3442
3443 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3444
3445 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3446 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3447 'for_each_per_buffer_object_at'.
3448 All uses changed. It's better to use upper-case for macros that
3449 cannot be implemented as functions, to give the reader a clue
3450 that they're special.
3451
3452 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3453
3454 * alloc.c (Fgarbage_collect): Tweak docstring.
3455
3456 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3457
3458 Tweak the value returned from Fgarbage_collect again.
3459 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3460 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3461 Adjust documentation.
3462 (total_vector_bytes): Rename to total_vector_slots, adjust
3463 accounting.
3464 (total_free_vector_bytes): Rename to total_free_vector_slots,
3465 adjust accounting.
3466 (Qstring_bytes, Qvector_slots): New symbols.
3467 (syms_of_alloc): DEFSYM them.
3468
3469 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3470
3471 Buffer compaction primitive which may be used from Lisp.
3472 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3473 (syms_of_buffer): Register Fcompact_buffer.
3474 * alloc.c (Fgarbage_collect): Use compact_buffer.
3475 * buffer.h (compact_buffer): New prototype.
3476 (struct buffer_text): New member.
3477
3478 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3479
3480 New macro to iterate over all buffers, miscellaneous cleanups.
3481 * lisp.h (all_buffers): Remove declaration.
3482 * buffer.h (all_buffers): Add declaration, with comment.
3483 (for_each_buffer): New macro.
3484 * alloc.c (Fgarbage_collect, mark_object): Use it.
3485 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3486 (init_buffer): Likewise.
3487 * data.c (Fset_default): Likewise.
3488 * coding.c (code_conversion_restore): Remove redundant check
3489 for dead buffer.
3490 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3491
3492 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3493
3494 Fix bug that created negative-length intervals.
3495 * intervals.c (merge_interval_right, merge_interval_left):
3496 Do not zero out this interval if it is absorbed by its children,
3497 as this interval's total length doesn't change in that case. See
3498 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3499
3500 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3501
3502 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3503 when invoking (make-bool-vector N t) and N is a positive
3504 multiple of 8 -- the last 8 bits were mistakenly cleared.
3505
3506 Remove some struct layout assumptions in bool vectors.
3507 * alloc.c (bool_header_size): New constant.
3508 (header_size, word_size): Move earlier, as they're now used earlier.
3509 Use 'word_size' in a few more places, where it's appropriate.
3510 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3511 padding before the data member of a bool vector.
3512 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3513 than doing the check by hand with an abort ().
3514
3515 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3516
3517 * eval.c (Fdefvar): Don't check constants since we only set the var if
3518 it's not yet defined anyway (bug#11904).
3519
3520 * lisp.h (last_undo_boundary): Declare new var.
3521 * keyboard.c (command_loop_1): Set it.
3522 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3523 were auto-added by the command loop (bug#11774).
3524
3525 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3526
3527 * w32font.c (Qsymbol): Remove local definition.
3528 (syms_of_w32font): Don't DEFSYM it.
3529
3530 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3531
3532 Fix sweep_vectors to handle large bool vectors correctly.
3533 * alloc.c (sweep_vectors): Account total_vector_bytes for
3534 bool vectors larger than VBLOCK_BYTES_MAX.
3535
3536 2012-07-18 Chong Yidong <cyd@gnu.org>
3537
3538 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3539 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3540
3541 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3542
3543 Return more descriptive data from Fgarbage_collect.
3544 Suggested by Stefan Monnier in
3545 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3546 * alloc.c (bounded_number): New function.
3547 (total_buffers, total_vectors): New variable.
3548 (total_string_size): Rename to total_string_bytes, adjust users.
3549 (total_vector_size): Rename to total_vector_bytes, adjust users.
3550 (sweep_vectors): Account total_vectors and total_vector_bytes.
3551 (Fgarbage_collect): New return value. Adjust documentation.
3552 (gc_sweep): Account total_buffers.
3553 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3554 (VECTOR_SIZE): Remove.
3555 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3556 (Qinterval, Qmisc): New symbols.
3557 (syms_of_data): Initialize them.
3558 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3559 (Qcons, Qbuffer): New declarations.
3560
3561 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3562
3563 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3564 Round up, not down. Improve doc.
3565
3566 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3567
3568 Restore old code in allocate_string_data to avoid Faset breakage.
3569 Reported by Julien Danjou <julien@danjou.info> in
3570 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3571 * alloc.c (allocate_string_data): Restore old code with minor
3572 adjustments, fix comment to explain this subtle issue.
3573
3574 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3575
3576 Remove FILE_SYSTEM_CASE.
3577 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3578
3579 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3580 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3581 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3582 call-process-region passes it through expand-file-name.
3583
3584 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3585
3586 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3587
3588 Fix crash when creating indirect buffer (Bug#11917)
3589 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3590 Don't handle unbound variables specially if non-zero.
3591 (Fbuffer_local_variables): Pass zero.
3592 (clone_per_buffer_values): Pass non-zero.
3593
3594 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3595
3596 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3597 to make the loop interruptible.
3598
3599 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3600
3601 * gnutls.c (emacs_gnutls_handshake): Only retry if
3602 GNUTLS_E_INTERRUPTED.
3603
3604 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3605
3606 Cleanup and convert miscellaneous checks to eassert.
3607 * alloc.c (mark_interval): Fix comment, partially rephrase
3608 old comment from intervals.h (see below).
3609 * intervals.c (find_interval, adjust_intervals_for_insertion)
3610 (delete_interval, adjust_intervals_for_deletion)
3611 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3612 Convert to eassert.
3613 (adjust_intervals_for_insertion, make_new_interval):
3614 Remove obsolete and unused code.
3615 * intervals.h (struct interval): Remove obsolete comment.
3616 * textprotp.c (erase_properties): Remove unused code.
3617 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3618 (Fremove_list_of_text_properties): Convert to eassert.
3619
3620 2012-07-17 Chong Yidong <cyd@gnu.org>
3621
3622 * editfns.c (Finsert_char): Doc fix.
3623
3624 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3625
3626 Fix previous change to make Fmemory_free always accurate.
3627 * alloc.c (make_interval): Update total_free_intervals.
3628 (make_float): Likewise for total_free_floats.
3629 (free_cons, Fcons): Likewise for total_free_conses.
3630 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3631 Likewise for total_free_vector_bytes.
3632 (Fmake_symbol): Likewise for total_free_symbols.
3633 (bytes_free): Remove.
3634
3635 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3636
3637 Simple free memory accounting feature.
3638 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3639 (sweep_vectors): Accumulate size of free vectors.
3640 (Fgarbage_collect): Setup bytes_free.
3641 (Fmemory_free): New function.
3642 (syms_of_alloc): Register it.
3643
3644 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3645
3646 Cleanup overlays checking.
3647 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3648 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3649 eassert and OVERLAYP.
3650 (sort_overlays): Change to use OVERLAYP.
3651
3652 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3653
3654 * editfns.c (Finsert_char): Make it interactive, and make the
3655 second arg optional. Copy interactive spec and docstring from
3656 ucs-insert.
3657
3658 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3659
3660 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3661 Unlike the other wrapped functions, fabs has an unspecified
3662 effect on errno.
3663
3664 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3665
3666 * nsterm.m (keyDown): Interpret flags without left/right bits
3667 as the left key (Bug#11670).
3668
3669 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3670
3671 Remove empty and useless init functions.
3672 * lisp.h (init_character_once, init_fns, init_image)
3673 (init_filelock, init_sound): Remove prototype.
3674 * character.c (init_character_once): Remove.
3675 * filelock.c (init_filelock): Likewise.
3676 * fns.c (init_fns): Likewise.
3677 * image.c (init_image): Likewise.
3678 * sound.c (init_sound): Likewise.
3679 * emacs.c (main): Adjust accordingly.
3680
3681 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3682
3683 * gtkutil.h: Tiny cleanups.
3684 (use_old_gtk_file_dialog): Remove useless declaration.
3685 (xg_uses_old_file_dialog): Add suggested const attribute.
3686
3687 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3688
3689 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3690 (bidi_paragraph_init): Use it to limit search forward for a strong
3691 directional character in abnormally large paragraphs full of
3692 neutral or weak characters. (Bug#11943)
3693
3694 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3695
3696 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3697 the toolbar (Bug#9451).
3698 (xg_make_tool_item): Give the widget event box a transparent
3699 background.
3700
3701 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3702
3703 Cleanup basic allocation variables and functions.
3704 * alloc.c (ignore_warnings, init_intervals, init_float)
3705 (init_cons, init_symbol, init_marker): Remove.
3706 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3707 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3708 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3709 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3710 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3711 (staticidx, init_alloc_once, init_strings, free_ablock):
3712 Remove redundant initialization.
3713 * fns.c (init_weak_hash_tables): Remove.
3714 * lisp.h (init_weak_hash_tables): Remove prototype.
3715
3716 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3717
3718 Use zero_vector where appropriate.
3719 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3720 accordingly.
3721 * lisp.h (zero_vector): New declaration.
3722 * font.c (null_vector): Remove.
3723 (syms_of_font): Remove initialization and staticpro.
3724 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3725 * keymap.c (Faccessible_keymaps): Likewise.
3726
3727 2012-07-15 Leo Liu <sdl.web@gmail.com>
3728
3729 * fringe.c: Fix typo in comments.
3730
3731 2012-07-14 Leo Liu <sdl.web@gmail.com>
3732
3733 * fringe.c: Add a new bitmap exclamation-mark.
3734
3735 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3736
3737 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3738
3739 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3740 (HAVE_MENUS): Don't define, defined by editing config.in with
3741 msdos/sed2v2.inp.
3742 (GMALLOC_INHIBIT_VALLOC): Don't define.
3743 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3744
3745 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3746
3747 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3748
3749 2012-07-14 Glenn Morris <rgm@gnu.org>
3750
3751 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3752 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3753 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3754
3755 2012-07-13 Glenn Morris <rgm@gnu.org>
3756
3757 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3758
3759 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3760 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3761
3762 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3763
3764 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3765 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3766 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3767 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3768 where appropriate.
3769 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3770 as boolean expression.
3771 (x_set_window_size): Remove unused variable toolbar.
3772 (ns_get_color_default, ns_mod_to_lisp): Remove.
3773 (ns_mouse_position): Remove unused variables xchar and ychar.
3774 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3775 (ns_set_vertical_scroll_bar): Remove unused variable count.
3776 (ns_delete_terminal): Remove unused variable i.
3777 (ns_term_init): Remove unused variables r, g and b.
3778 (mouseDown): Remove unused variable window.
3779 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3780 (initFrameFromEmacs): Remove unused variable vbextra.
3781 (mouseEntered): Remove unused variables p and dpyinfo.
3782 (mouseExited): Remove unused variables p and r.
3783 (ns_define_frame_cursor, ns_clear_frame_area)
3784 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3785 (menuDown): Assign [sender tag] to variable and cast the variable.
3786
3787 * nsterm.h (menuDown): Add id as type to argument sender.
3788 (ns_display_info_for_name): Add Lisp_Object argument.
3789 (ns_term_init): Add Lisp_Object argument.
3790 (ns_map_event_to_object): Add void argument.
3791 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3792 prototype with arguments and only declare if __OBJC__.
3793 (nxatoms_of_nsselect): Add void argument.
3794 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3795 (ns_alloc_autorelease_pool): Add void argument.
3796 (ns_release_autorelease_pool): Add void* argument.
3797 (ns_get_defaults_value): Add const char* argument.
3798
3799 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3800 (initFromContents): Use SSDATA where appropriate.
3801 (ns_update_menubar): Add braces to ambigous if-else.
3802 (initWithTitle): Put () around assignment in if statement.
3803 (ns_menu_show): Remove unused variables window and keymap.
3804 (update_frame_tool_bar): Remove unused variable selected_p.
3805 (initWithContentRect): Remove unused variable this_cmd_name.
3806
3807 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3808 appropriate.
3809 (setXBMColor): Remove unused variable len.
3810 (setPixmapData): Put () around assignment in loop statement.
3811
3812 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3813 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3814 where appropriate.
3815 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3816 around assignment in loop statement.
3817 (nsfont_open): Remove unused variable i.
3818 (nsfont_open): Remove unused variable len.
3819 (nsfont_draw): Remove unused variable cs.
3820
3821 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3822 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3823 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3824 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3825 (Fns_font_name, Fns_perform_service)
3826 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3827 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3828 (ns_set_name): Remove unused variable view.
3829 (x_set_menu_bar_lines): Remove unused variable olines.
3830 (x_set_tool_bar_lines): Remove unused variable root_window.
3831 (Fns_list_colors): Put () around assignment in while statement.
3832 (Fns_perform_service): Remove unused variable len.
3833 (Fns_display_usable_bounds): Remove unused variable top.
3834 (syms_of_nsfns): Remove unused variable i.
3835
3836 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3837 memcpy (Bug#11907).
3838
3839 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3840
3841 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3842 and free it with DestroyExceptionInfo (Bug#11558).
3843
3844 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3845
3846 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3847 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3848 Set here, not in nt/config.nt.
3849
3850 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3851
3852 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3853 cursor overflow into the last glyph on display line when the right
3854 fringe is off. (Bug#11832)
3855
3856 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3857
3858 * xdisp.c (produce_special_glyphs): Now static.
3859 * dispextern.h (produce_special_glyphs): Remove decl.
3860
3861 2012-07-13 Glenn Morris <rgm@gnu.org>
3862
3863 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3864 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3865
3866 * s/usg5-4-common.h (USG, USG5):
3867 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3868 * s/sol2-6.h (SOLARIS2):
3869 * s/irix6-5.h (IRIX6_5):
3870 * s/hpux10-20.h (USG, USG5, HPUX):
3871 * s/gnu-linux.h (USG, GNU_LINUX):
3872 * s/freebsd.h (BSD_SYSTEM):
3873 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3874 * s/cygwin.h (CYGWIN):
3875 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3876 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3877
3878 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3879
3880 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3881
3882 2012-07-13 Glenn Morris <rgm@gnu.org>
3883
3884 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3885
3886 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3887
3888 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3889 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3890
3891 2012-07-12 Glenn Morris <rgm@gnu.org>
3892
3893 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3894
3895 * process.c (init_process_emacs): Rename from init_process.
3896 The old name is also the name of a Mach system call.
3897 * lisp.h, emacs.c: Update for this name change.
3898 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3899 longer needed.
3900
3901 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3902
3903 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3904 memmove call that removes glyphs covered by the left truncation
3905 glyph. Improve commentary.
3906 (display_line): Fix display of continuation glyphs on GUI frames
3907 when the right fringe is turned off and variable-size fonts are
3908 used in the window. Move the code that appends a stretch glyph to
3909 produce_special_glyphs, so that it could be used for truncation
3910 and continuation glyphs alike.
3911 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3912 glyph of a suitably computed width, to align the special glyphs at
3913 the window margin. Code moved from display_line. (Bug#11832)
3914
3915 2012-07-12 Glenn Morris <rgm@gnu.org>
3916
3917 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3918
3919 * s/gnu-linux.h, s/hpux10-20.h:
3920 Do not unconditionally define HAVE_XRMSETDATABASE.
3921
3922 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3923
3924 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3925
3926 Fix typos that broke OS X build.
3927 Reported by Randal L. Schwartz in
3928 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3929 * nsterm.m (ns_timeout): Add missing local decl.
3930 (ns_get_color): snprintf -> sprintf, to fix typo.
3931
3932 2012-07-12 Glenn Morris <rgm@gnu.org>
3933
3934 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3935 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3936 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3937 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3938
3939 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3940 Move PTY_OPEN to configure.
3941
3942 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3943 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3944 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3945
3946 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3947
3948 Use empty_unibyte_string where applicable.
3949 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3950 * lread.c (read1): Likewise.
3951 * xsettings.c (syms_of_xsettings): Likewise.
3952
3953 2012-07-12 Glenn Morris <rgm@gnu.org>
3954
3955 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3956 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3957 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3958 * s/hpux10-20.h (RUN_TIME_REMAP):
3959 * s/bsd-common.h (TABDLY): Move to configure.
3960
3961 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3962
3963 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3964
3965 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3966 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3967
3968 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3969
3970 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3971 * s/template.h: Move NARROWPROTO to configure.
3972
3973 2012-07-11 Glenn Morris <rgm@gnu.org>
3974
3975 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3976 unused since 2011-01-17 change to systty.h.
3977
3978 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3979 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3980 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3981
3982 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3983
3984 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3985
3986 2012-07-11 Glenn Morris <rgm@gnu.org>
3987
3988 * s/darwin.h, s/gnu-linux.h, s/template.h:
3989 Move INTERRUPT_INPUT to configure.
3990
3991 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3992
3993 Minor adjustments to interning code.
3994 * lisp.h (intern, intern_c_string): Redefine as static inline
3995 wrappers for intern_1 and intern_c_string_1, respectively.
3996 (intern_1, intern_c_string_1): Rename prototypes.
3997 * lread.c (intern_1, intern_c_string_1, oblookup):
3998 Simplify Vobarray checking.
3999 * font.c (font_intern_prop): Likewise. Adjust comment.
4000 * w32font.c (intern_font_name): Likewise.
4001
4002 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4003
4004 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4005
4006 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4007 of Fcar/Fcdr if possible.
4008 * font.c (check_otf_features): Likewise.
4009 * fontset.c (Fnew_fontset): Likewise.
4010 * gnutls.c (Fgnutls_boot): Likewise.
4011 * minibuf.c (read_minibuf): Likewise.
4012 * msdos.c (IT_set_frame_parameters): Likewise.
4013 * xmenu.c (Fx_popup_dialog): Likewise.
4014 * w32menu.c (Fx_popup_dialog): Likewise.
4015
4016 2012-07-11 Glenn Morris <rgm@gnu.org>
4017
4018 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4019 since nothing has defined it on these platforms.
4020
4021 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4022 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4023
4024 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4025 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4026 Move CLASH_DETECTION to configure.
4027
4028 * s/gnu.h: Remove file, which is now empty.
4029
4030 * s/gnu.h, s/gnu-linux.h:
4031 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4032
4033 2012-07-11 John Wiegley <johnw@newartisans.com>
4034
4035 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4036 function attribute, so we only use it if it exists in the
4037 compiler.
4038
4039 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4040
4041 Avoid call to strlen in fast_c_string_match_ignore_case.
4042 * search.c (fast_c_string_match_ignore_case): Change to use
4043 length argument. Adjust users accordingly.
4044 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4045
4046 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4047
4048 Assume mkdir, rmdir.
4049 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4050 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4051
4052 Assume rename.
4053 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4054
4055 Assume perror.
4056 * s/hpux10-20.h (HAVE_PERROR): Remove.
4057 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4058 Remove dummy definition, as this problem was obsolete long ago.
4059
4060 Assume strerror.
4061 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4062
4063 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4064
4065 Avoid calls to strlen in font processing functions.
4066 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4067 (font_open_by_name): Change to use length argument.
4068 Adjust users accordingly.
4069 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4070 Adjust prototypes.
4071 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4072 Change to return ptrdiff_t.
4073 (xfont_list_pattern, xfont_match): Use length returned by
4074 xfont_decode_coding_xlfd.
4075 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4076
4077 2012-07-11 Glenn Morris <rgm@gnu.org>
4078
4079 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4080 Move DONT_REOPEN_PTY to configure.
4081
4082 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4083 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4084
4085 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4086
4087 Remove "#define unix" that is no longer needed (Bug#11905).
4088 * s/aix4-2.h (unix): Remove; no longer needed.
4089
4090 EMACS_TIME simplification (Bug#11875).
4091 This replaces macros (which typically do not work in GDB)
4092 with functions, typedefs and enums, making the code easier to debug.
4093 The functional style also makes code easier to read and maintain.
4094 * systime.h: Include <sys/time.h> on all hosts, not just if
4095 WINDOWSNT, since 'struct timeval' is needed in general.
4096 (EMACS_TIME): Now a typedef, not a macro.
4097 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4098 not macros.
4099 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4100 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4101 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4102 (EMACS_TIME_LE): Now functions, not macros.
4103 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4104 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4105 which are not functions. All uses rewritten to use:
4106 (make_emacs_time): New function.
4107 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4108 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4109 not functions. All uses rewritten to use the following, respectively:
4110 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4111 (add_emacs_time, sub_emacs_time): New functions.
4112 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4113 * fileio.c (Fcopy_file):
4114 * xterm.c (XTflash): Get the current time closer to when it's used.
4115 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4116
4117 * bytecode.c (targets): Suppress -Woverride-init warnings.
4118
4119 Simplify by avoiding confusing use of strncpy etc.
4120 * doc.c (Fsnarf_documentation):
4121 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4122 * frame.c (Fmake_terminal_frame):
4123 * gtkutil.c (get_utf8_string):
4124 * lread.c (openp):
4125 * nsmenu.m (ns_update_menubar):
4126 * regex.c (regerror):
4127 Prefer memcpy to strncpy and strncat when either will do.
4128 * fileio.c (Fsubstitute_in_file_name):
4129 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4130 (menu_separator_name_p):
4131 * nsmenu.m (ns_update_menubar):
4132 Prefer memcmp to strncmp when either will do.
4133 * nsterm.m: Include <ftoastr.h>.
4134 (ns_get_color):
4135 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4136 Prefer snprintf to strncpy.
4137 * nsterm.m (ns_term_init):
4138 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4139 * nsterm.m (ns_term_init):
4140 Avoid the need for strncpy, by using build_string or
4141 make_unibyte_string directly. Use dtoastr, not snprintf.
4142 * process.c (Fmake_network_process): Diagnose service names that
4143 are too long, rather than silently truncating them or creating
4144 non-null-terminated names.
4145 (Fnetwork_interface_info): Likewise, for interface names.
4146 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4147 Prefer sprintf to strncat.
4148 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4149 Prefer vsnprintf to vsprintf + strncpy.
4150
4151 2012-07-10 Glenn Morris <rgm@gnu.org>
4152
4153 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4154 Clarify fallback case.
4155
4156 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4157
4158 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4159 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4160 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4161 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4162 where argument type is known to be a Lisp_Cons.
4163
4164 2012-07-10 Tom Tromey <tromey@redhat.com>
4165
4166 * bytecode.c (BYTE_CODE_THREADED): New macro.
4167 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4168 (enum byte_code_op): New type.
4169 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4170 (exec_byte_code): Use them. Use token threading when applicable.
4171
4172 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4173
4174 Optimize pure C strings initialization.
4175 * lisp.h (make_pure_string): Fix prototype.
4176 (build_pure_c_string): New function, defined as static inline. This
4177 provides a better opportunity to optimize away calls to strlen when
4178 the function is called with compile-time constant argument.
4179 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4180 argument, adjust users accordingly. Use build_pure_c_string where
4181 appropriate.
4182 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4183 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4184 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4185
4186 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4187
4188 Avoid calls to strlen in miscellaneous functions.
4189 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4190 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4191 * lread.c (openp): Likewise.
4192
4193 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4194
4195 Avoid calls to strlen in path processing functions.
4196 * fileio.c (file_name_as_directory): Add comment. Change to add
4197 srclen argument and return the length of result. Adjust users
4198 accordingly.
4199 (directory_file_name): Fix comment. Change to add srclen argument,
4200 swap 1st and 2nd arguments to obey the common convention.
4201 Adjust users accordingly.
4202 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4203
4204 2012-07-10 Glenn Morris <rgm@gnu.org>
4205
4206 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4207 Move PENDING_OUTPUT_COUNT definition to configure.
4208
4209 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4210 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4211 * s/gnu.h (DATA_START): Move definitions to configure.
4212
4213 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4214 We include usg5-4-common.h, which defines them both.
4215
4216 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4217 O_RDONLY already includes it).
4218
4219 Stop ns builds setting the EMACSLOADPATH environment variable.
4220 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4221 Now it does not set EMACSLOADPATH, just returns the load-path string.
4222 * nsterm.h: Update accordingly.
4223 * lread.c [HAVE_NS]: Include nsterm.h.
4224 (init_lread) [HAVE_NS]: Use ns_load_path.
4225 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4226
4227 2012-07-09 Glenn Morris <rgm@gnu.org>
4228
4229 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4230 since the included bsd-common.h does so.
4231
4232 Stop ns builds setting the EMACSPATH environment variable.
4233 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4234 (ns_init_paths): Do not set EMACSPATH.
4235 * nsterm.h (ns_exec_path): Add it.
4236 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4237 Use ns_exec_path.
4238
4239 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4240
4241 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4242
4243 * process.c (wait_reading_process_output): 'waitchannels' was unset
4244 when read_kbd || !NILP (wait_for_cell); fix this.
4245
4246 Add GCC-style 'const' attribute to functions that can use it.
4247 * character.h (char_resolve_modifier_mask):
4248 * keyboard.h (make_ctrl_char):
4249 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4250 (init_character_once, next_almost_prime, init_fns, init_image)
4251 (flush_pending_output, init_sound):
4252 * mem-limits.h (start_of_data):
4253 * menu.h (finish_menu_items):
4254 Add ATTRIBUTE_CONST.
4255 * emacs.c (DEFINE_DUMMY_FUNCTION):
4256 Declare the dummy function with ATTRIBUTE_CONST.
4257 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4258 Add decls with ATTRIBUTE_CONST.
4259
4260 Minor improvements to make_formatted_string.
4261 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4262 where int is good enough, as vsprintf returns an int.
4263 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4264
4265 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4266
4267 Use make_formatted_string to avoid double length calculation.
4268 * lisp.h (make_formatted_string): New prototype.
4269 * alloc.c (make_formatted_string): New function.
4270 * buffer.c (Fgenerate_new_buffer_name): Use it.
4271 * dbus.c (syms_of_dbusbind): Likewise.
4272 * editfns.c (Fcurrent_time_zone): Likewise.
4273 * filelock.c (get_boot_time): Likewise.
4274 * frame.c (make_terminal_frame, set_term_frame_name)
4275 (x_report_frame_params): Likewise.
4276 * image.c (gs_load): Likewise.
4277 * minibuf.c (get_minibuffer): Likewise.
4278 * msdos.c (dos_set_window_size): Likewise.
4279 * process.c (make_process): Likewise.
4280 * xdisp.c (ensure_echo_area_buffers): Likewise.
4281 * xsettings.c (apply_xft_settings): Likewise.
4282
4283 2012-07-09 Glenn Morris <rgm@gnu.org>
4284
4285 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4286 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4287 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4288 * nsterm.h (ns_etc_directory): Add it.
4289 * callproc.c [HAVE_NS]: Include nsterm.h.
4290 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4291
4292 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4293
4294 Move marker debugging code under MARKER_DEBUG.
4295 * marker.c (MARKER_DEBUG): Move marker debugging code under
4296 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4297 for bootstrap with --enable-checking (~3x slowdown reported
4298 by Juanma Barranquero <lekktu@gmail.com>).
4299 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4300
4301 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4302
4303 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4304 See <http://bugs.gnu.org/11825#29>.
4305
4306 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4307
4308 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4309 has no font, use the frame's font. (Bug#11813)
4310 (display_line): Add commentary about displaying truncation glyphs
4311 on GUI frames.
4312 (produce_special_glyphs): Move here from term.c.
4313
4314 * term.c (produce_special_glyphs): Move to xdisp.c.
4315
4316 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4317 section.
4318
4319 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4320
4321 * xdisp.c (display_line): Avoid warning about implicit declaration
4322 of FRAME_FONT.
4323
4324 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4325
4326 * lisp.h: Remove empty conditional.
4327
4328 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4329
4330 * lread.c (load_path_check): Now static.
4331
4332 Fix some minor --with-ns problems found by static checking.
4333 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4334 (x_set_font) [!HAVE_X_WINDOWS]:
4335 * image.c (xpm_load_image) [HAVE_NS]:
4336 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4337 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4338 Remove unused local.
4339 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4340 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4341 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4342 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4343 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4344 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4345 Fix pointer signedness problem.
4346 * xfaces.c (FRAME_X_FONT_TABLE):
4347 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4348
4349 2012-07-07 Glenn Morris <rgm@gnu.org>
4350
4351 * lread.c (load_path_check): New function, split from init_lread.
4352 (init_lread): Reorganize. Motivation:
4353 If EMACSLOADPATH is set, check/warn about that rather than the
4354 defaults, which we are not going to use. Hence we can remove
4355 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4356 Don't warn if site-lisp directories are missing.
4357 If not installed, start from a blank load-path, since
4358 PATH_LOADSEARCH refers to the eventual installation directories.
4359
4360 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4361
4362 Support truncation and continuation glyphs on GUI frames, when
4363 fringes are disabled. (Bug#11832)
4364 * xdisp.c (init_iterator): Get dimensions of truncation and
4365 continuation glyphs even if on GUI frames.
4366 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4367 or both, are absent.
4368 (start_display, move_it_in_display_line_to): Handle the case of a
4369 GUI frame without a fringe to display continuation or truncation
4370 glyphs.
4371 (insert_left_trunc_glyphs): Support GUI frames: make sure
4372 truncation glyphs overwrite enough glyphs from the current line to
4373 have sufficient space in pixels.
4374 (display_line): Support truncation and continuation glyphs on GUI
4375 frames. If some spare pixels are left on the line after inserting
4376 the truncation glyphs, fill that space with a stretch glyph of a
4377 suitably computed width.
4378
4379 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4380 produce_glyphs, to support GUI sessions.
4381
4382 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4383
4384 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4385
4386 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4387
4388 Do not require float-time's arg to fit in time_t (Bug#11825).
4389 This works better on hosts where time_t is unsigned, and where
4390 float-time is applied to the (negative) difference between two times.
4391 * editfns.c (decode_time_components): Last arg is now double *,
4392 not int *, and means to store all the result as a double, without
4393 worrying about whether the seconds part fits in time_t.
4394 All callers changed.
4395 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4396 All callers changed.
4397 (Ffloat_time): Do not fail merely because the specified time falls
4398 outside of time_t range.
4399
4400 2012-07-07 Glenn Morris <rgm@gnu.org>
4401
4402 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4403 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4404 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4405
4406 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4407
4408 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4409 Update dependencies.
4410
4411 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4412
4413 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4414
4415 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4416 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4417 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4418 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4419 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4420 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4421
4422 * xfont.c (compare_font_names): Redo to omit the need for casts.
4423
4424 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4425
4426 * xfns.c (Fx_change_window_property): Doc fix.
4427 * w32fns.c (Fx_change_window_property): Doc fix.
4428
4429 * w32fns.c (Fx_window_property): Accept the same arguments as the
4430 X Windows version. Doc fix.
4431 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4432
4433 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4434 Eli Zaretskii <eliz@gnu.org>
4435
4436 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4437 Windows-specific code from nt/config.nt moved here.
4438 Obsolete settings removed.
4439
4440 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4441
4442 * process.c: Avoid unnecessary calls to gettime.
4443 (wait_reading_process_output): Don't get the time of day
4444 when gobbling data immediately and not waiting, as there's no need
4445 for it in that case. This removes a FIXME.
4446
4447 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4448
4449 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4450 is defined (Bug#11768).
4451
4452 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4453
4454 Fix marker debugging code.
4455 * marker.c (byte_char_debug_check): Do not perform the check
4456 if buffer is not multibyte.
4457 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4458 Call byte_char_debug_check with correct arguments.
4459
4460 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4461
4462 Compile marker debugging code only if ENABLE_CHECKING is defined.
4463 * marker.c (byte_char_debug_check, count_markers):
4464 Use only if ENABLE_CHECKING is defined.
4465 (byte_debug_flag): Remove.
4466 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4467 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4468
4469 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4470
4471 Avoid code repetition in marker-related functions.
4472 * marker.c (attach_marker): New function.
4473 (Fset_marker, set_marker_restricted, set_marker_both)
4474 (set_marker_restricted_both): Use it.
4475 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4476 Consistently rename charno to charpos.
4477 (marker_position): Add eassert.
4478 (marker_byte_position): Convert to eassert.
4479
4480 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4481
4482 Simplify list operations in unchain_overlay and unchain_marker.
4483 * buffer.c (unchain_overlay): Simplify. Add comment.
4484 * marker.c (unchain_marker): Simplify. Fix comments.
4485
4486 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4487
4488 Introduce fast path for the widely used marker operation.
4489 * alloc.c (build_marker): New function.
4490 * lisp.h (build_marker): New prototype.
4491 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4492 * composite.c (autocmp_chars): Likewise.
4493 * editfns.c (buildmark): Remove.
4494 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4495 (save_restriction_save): Use build_marker.
4496 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4497 * window.c (save_window_save): Likewise.
4498
4499 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4500
4501 Do not use Fdelete_overlay in delete_all_overlays
4502 to avoid redundant calls to unchain_overlay.
4503 * buffer.c (drop_overlay): New function.
4504 (delete_all_overlays, Fdelete_overlay): Use it.
4505 * minibuf.c (get_minibuffer): Fix comment.
4506
4507 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4508
4509 Port to OpenBSD 5.1 amd64.
4510 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4511 This is needed for OpenBSD, and should be harmless on all BSD systems.
4512 Also, include <sys/sysctl.h>, as it should be available on all
4513 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4514 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4515 use p_pid member, not kp_proc.pid.
4516
4517 2012-07-06 Glenn Morris <rgm@gnu.org>
4518
4519 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4520
4521 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4522
4523 More xmalloc and related cleanup.
4524 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4525 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4526 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4527 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4528 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4529 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4530 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4531 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4532 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4533 * xterm.c:
4534 Omit needless casts involving void * pointers and allocation.
4535 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4536 as the former is more robust if P's type is changed.
4537 Prefer xzalloc to xmalloc + memset 0.
4538 Simplify malloc-or-realloc to realloc.
4539 Don't worry about xmalloc returning a null pointer.
4540 Prefer xstrdup to xmalloc + strcpy.
4541 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4542 growing it.
4543 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4544 alloca of a constant.
4545
4546 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4547
4548 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4549 hscroll is larger than the line width. Fixes long and futile
4550 looping inside extend_face_to_end_of_line (on a TTY) producing
4551 glyphs that are not needed and thrown away.
4552
4553 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4554
4555 * marker.c (set_marker_restricted_both): Simplify by using
4556 clip_to_bounds.
4557
4558 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4559
4560 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4561
4562 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4563
4564 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4565 not defined (Bug#11768).
4566 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4567 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4568 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4569 followed by gtk_box_set_homogeneous (Bug#11768).
4570 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4571 (update_theme_scrollbar_width, xg_create_scroll_bar):
4572 Use gtk_scrollbar_new (Bug#11768).
4573 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4574 (is_box_type): New function (Bug#11768).
4575 (xg_tool_item_stale_p): Call is_box_type.
4576 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4577 with default display (Bug#11768).
4578
4579 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4580
4581 * xdisp.c (window_hscroll_limited): New function.
4582 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4583 coordinates when window's hscroll is set to insanely large
4584 values. (Bug#11857)
4585
4586 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4587
4588 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4589 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4590
4591 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4592
4593 Cleanup xmalloc.
4594 * lisp.h (xzalloc): New prototype. Omit needless casts.
4595 * alloc.c (xzalloc): New function. Omit needless casts.
4596 * charset.c: Omit needless casts. Convert all calls to
4597 xmalloc with following memset to xzalloc.
4598 * dispnew.c: Likewise.
4599 * fringe.c: Likewise.
4600 * image.c: Likewise.
4601 * sound.c: Likewise.
4602 * term.c: Likewise.
4603 * w32fns.c: Likewise.
4604 * w32font.c: Likewise.
4605 * w32term.c: Likewise.
4606 * xfaces.c: Likewise.
4607 * xfns.c: Likewise.
4608 * xterm.c: Likewise.
4609 * atimer.c: Omit needless casts.
4610 * buffer.c: Likewise.
4611 * callproc.c: Likewise.
4612 * ccl.c: Likewise.
4613 * coding.c: Likewise.
4614 * composite.c: Likewise.
4615 * doc.c: Likewise.
4616 * doprnt.c: Likewise.
4617 * editfns.c: Likewise.
4618 * emacs.c: Likewise.
4619 * eval.c: Likewise.
4620 * filelock.c: Likewise.
4621 * fns.c: Likewise.
4622 * gtkutil.c: Likewise.
4623 * keyboard.c: Likewise.
4624 * lisp.h: Likewise.
4625 * lread.c: Likewise.
4626 * minibuf.c: Likewise.
4627 * msdos.c: Likewise.
4628 * print.c: Likewise.
4629 * process.c: Likewise.
4630 * region-cache.c: Likewise.
4631 * search.c: Likewise.
4632 * sysdep.c: Likewise.
4633 * termcap.c: Likewise.
4634 * terminal.c: Likewise.
4635 * tparam.c: Likewise.
4636 * w16select.c: Likewise.
4637 * w32.c: Likewise.
4638 * w32reg.c: Likewise.
4639 * w32select.c: Likewise.
4640 * w32uniscribe.c: Likewise.
4641 * widget.c: Likewise.
4642 * xdisp.c: Likewise.
4643 * xmenu.c: Likewise.
4644 * xrdb.c: Likewise.
4645 * xselect.c: Likewise.
4646
4647 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4648
4649 * fileio.c (time_error_value): Check the right error number.
4650 Problem reported by Troels Nielsen in
4651 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4652
4653 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4654
4655 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4656 This should be fixed in a better way; see Eli Zaretskii in
4657 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4658 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4659
4660 * fileio.c (time_error_value): Rename from special_mtime.
4661 The old name's problems were noted by Eli Zaretskii in
4662 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4663
4664 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4665 This variable's comment says Emacs needs at least one GDB-visible
4666 symbol of type enum pvec_type, to work around GDB problems.
4667 The symbol's value doesn't matter.
4668
4669 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4670 that causes compilation to fail on pre-C99 compilers.
4671
4672 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4673
4674 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4675 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4676
4677 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4678
4679 * buffer.c (init_buffer_once): Fix initialization of
4680 headers for buffer_defaults and buffer_local_symbols.
4681 Reported by Juanma Barranquero <lekktu@gmail.com>.
4682
4683 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4684
4685 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4686 * lisp.h (enum pvec_type): Use fewer bits.
4687 (PSEUDOVECTOR_SIZE_BITS): New constant.
4688 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4689 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4690 change in pvec_type.
4691 (PSEUDOVECTOR_TYPEP): New macro.
4692 (TYPED_PSEUDOVECTORP): Use it.
4693 * fns.c (internal_equal): Adapt code to extract pvectype.
4694 * emacs.c (gdb_pvec_type): Update type.
4695 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4696 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4697 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4698 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4699 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4700 abusing vector->header.next.nbytes.
4701 (live_vector_p): Use PVEC_TYPE.
4702 (mark_object): Adapt code to extract pvectype. Use switch.
4703
4704 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4705
4706 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4707 Tighten new eassert a bit.
4708
4709 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4710
4711 Fix compilation with --enable-gcc-warnings and -O1
4712 optimization level.
4713 * doprnt.c (doprnt): Change type of tem to int, initialize
4714 to avoid compiler warning. Add eassert.
4715 * search.c (simple_search): Initialize match_byte to avoid
4716 compiler warning. Add eassert.
4717
4718 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4719
4720 Avoid weird behavior with large horizontal scrolls.
4721 Without this change, for example, large hscroll values would
4722 mess up Emacs's display on Fedora 15 x86, presumably due to
4723 overflows in int calculations in the display code.
4724 Also, if buffers had long lines, Emacs would freeze.
4725 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4726 (set_window_hscroll): New function, containing the old guts of
4727 Fset_window_hscroll. Return the clipped value.
4728 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4729 This avoids the need to check against PTRDIFF_MAX.
4730
4731 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4732
4733 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4734
4735 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4736
4737 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4738
4739 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4740 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4741 since GCC 4.4.6 issues a bogus warning for them.
4742
4743 Fix bugs in file timestamp newness comparisons.
4744 * fileio.c (Ffile_newer_than_file_p):
4745 * lread.c (Fload): Use full timestamp resolution of files,
4746 not just the 1-second resolution, so that files that are only
4747 slightly newer still count as newer.
4748 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4749 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4750
4751 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4752
4753 * fileio.c: Improve handling of file time marker. (Bug#11852)
4754 (special_mtime): New function.
4755 (Finsert_file_contents, Fverify_visited_file_modtime):
4756 Use it to set special mtime values consistently.
4757
4758 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4759
4760 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4761 marker for non-existing file. (Bug#11852)
4762
4763 2012-07-03 Glenn Morris <rgm@gnu.org>
4764
4765 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4766 and did not make it into globals.h).
4767
4768 2012-07-03 Tom Tromey <tromey@redhat.com>
4769
4770 * window.c (Fset_window_margins, Fset_window_fringes)
4771 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4772 * textprop.c (Fprevious_property_change): No longer static.
4773 * syntax.c (Fsyntax_table_p): No longer static.
4774 * process.c (Fget_process, Fprocess_datagram_address): No longer
4775 static.
4776 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4777 * keyboard.c (Fcommand_execute): No longer static.
4778 Remove EXFUN.
4779 * insdel.c (Fcombine_after_change_execute): No longer static.
4780 * image.c (Finit_image_library): No longer static.
4781 * fileio.c (Fmake_symbolic_link): No longer static.
4782 * eval.c (Ffetch_bytecode): No longer static.
4783 * editfns.c (Fuser_full_name): No longer static.
4784 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4785 No longer static.
4786 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4787 static.
4788 * dired.c (Ffile_attributes): No longer static.
4789 * composite.c (Fcomposition_get_gstring): No longer static.
4790 * callproc.c (Fgetenv_internal): No longer static.
4791
4792 * ccl.h: Remove EXFUNs.
4793 * buffer.h: Remove EXFUNs.
4794 * dispextern.h: Remove EXFUNs.
4795 * intervals.h: Remove EXFUNs.
4796 * fontset.h: Remove EXFUN.
4797 * font.h: Remove EXFUNs.
4798 * dosfns.c (system_process_attributes): Remove EXFUN.
4799 * keymap.h: Remove EXFUNs.
4800 * lisp.h: Remove EXFUNs.
4801 * w32term.h: Remove EXFUNs.
4802 * window.h: Remove EXFUNs.
4803 * xsettings.h: Remove EXFUN.
4804 * xterm.h: Remove EXFUN.
4805
4806 2012-07-03 Glenn Morris <rgm@gnu.org>
4807
4808 * lisp.h (Frandom): Make it visible to C.
4809 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4810 buffer for invisible buffers. (Bug#1229)
4811
4812 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4813
4814 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4815 values which aren't power of 2.
4816 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4817 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4818 accordingly.
4819
4820 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4821
4822 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4823
4824 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4825
4826 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4827
4828 * alloc.c (allocate_vector_block): Remove redundant
4829 calls to mallopt if DOUG_LEA_MALLOC is defined.
4830 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4831 avoid calls to mallopt if zero_vector is returned.
4832
4833 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4834
4835 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4836 is enabled, avoid dereferencing NULL current_sblock if
4837 running undumped.
4838
4839 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4840
4841 Cleanup basic buffer management.
4842 * buffer.h (struct buffer): Change layout to use generic vector
4843 marking code. Fix some comments. Change type of 'clip_changed'
4844 to bitfield. Remove unused #ifndef old.
4845 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4846 (GET_OVERLAYS_AT): Fix indentation.
4847 (for_each_per_buffer_object_at): New macro.
4848 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4849 (Fbuffer_local_variables): Use it.
4850 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4851 * alloc.c (allocate_buffer): Adjust to match new layout of
4852 struct buffer. Fix comment.
4853 (mark_overlay): New function.
4854 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4855 Lisp area of struct buffer.
4856 (mark_object): Use it. Adjust marking of misc objects
4857 and related comments.
4858
4859 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4860
4861 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4862 wrapper that is not needed because the wrapped code is a no-op (zero
4863 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4864 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4865
4866 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4867
4868 * alloc.c (mark_buffer): Simplify. Remove prototype.
4869 (mark_object): Add comment. Reorganize marking of vector-like
4870 objects. Use CHECK_LIVE for all vector-like objects except buffers
4871 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4872 Avoid redundant calls to mark_vectorlike for bool vectors.
4873
4874 2012-06-30 Glenn Morris <rgm@gnu.org>
4875
4876 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4877
4878 * epaths.in (PATH_SITELOADSEARCH): New.
4879 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4880 This is rather than relying on --enable-locallisppath elements
4881 having "site-lisp" in their names. (Bug#10208#25, 11658)
4882
4883 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4884
4885 * w32proc.c (sys_select): Accept and ignore one more argument.
4886
4887 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4888
4889 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4890 (pselect) [!MS_DOS]: Redirect to sys_select.
4891
4892 * sysdep.c: Don't include dos.h and dosfns.h.
4893
4894 * process.c (sys_select):
4895 * msdos.c (sys_select): Accept one more argument and ignore it.
4896
4897 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4898 adapt data types and code to that.
4899
4900 * dosfns.c:
4901 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4902 which clashes with the gnulib function of the same name.
4903
4904 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4905
4906 * font.c (font_style_to_value, font_style_symbolic)
4907 (font_prop_validate_style): Add type checks for values in
4908 font_style_table.
4909
4910 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4911 argument.
4912 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4913 uses.
4914
4915 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4916
4917 * xdisp.c (try_window_id): Undo last change.
4918
4919 * w32.c (getwd): Adjust commentary about startup_dir.
4920 (init_environment): Always call sys_access, even in non-MSVC
4921 builds. Don't chdir to the directory of the Emacs executable.
4922 This undoes code from 1997 which was justified by the need to
4923 "avoid conflicts when removing and renaming directories". But its
4924 downside was that every relative file name was being interpreted
4925 relative to the directory of the Emacs executable, which can never
4926 be TRT. In particular, it broke sys_access when called with
4927 relative file names.
4928 (sys_access): Map GetLastError to errno.
4929
4930 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4931
4932 * window.h (struct window): Change type of 'fringes_outside_margins'
4933 to bitfield. Fix comment. Adjust users accordingly.
4934 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4935 Adjust comment.
4936 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4937 to ptrdiff_t.
4938
4939 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4940
4941 * gnutls.c (emacs_gnutls_handshake):
4942 Add QUIT to make the loop interruptible.
4943
4944 2012-06-29 Glenn Morris <rgm@gnu.org>
4945
4946 * charset.c (init_charset): Make lack of etc/charsets fatal.
4947
4948 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4949
4950 * editfns.c (region_limit): Fix type mismatch.
4951
4952 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4953
4954 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4955 undefined. Convert from xassert to eassert.
4956 * nsmenu.m: Convert from xassert to eassert.
4957 * nsterm.m: Likewise.
4958
4959 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4960
4961 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4962
4963 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4964
4965 Avoid integer overflow on scroll-left and scroll-right.
4966 * window.c (HSCROLL_MAX): New macro.
4967 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4968 overflow when requested scroll falls outside ptrdiff_t range.
4969
4970 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4971
4972 * window.h (struct window): Change type of 'hscroll',
4973 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4974 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4975 Adjust users accordingly.
4976 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4977 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4978 from EMACS_INT to ptrdiff_t.
4979 (make_window): Omit redundant initialization.
4980
4981 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4982
4983 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4984
4985 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4986
4987 * window.h (struct window): Change type of 'use_time' and
4988 'sequence_number' from Lisp_Object to int.
4989 * frame.c (make_frame): Adjust users accordingly.
4990 * print.c (print_object): Likewise.
4991 * window.c (select_window, Fwindow_use_time, make_parent_window)
4992 (make_window): Likewise.
4993
4994 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4995
4996 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4997 enabled with --enable-checking=[all,glyphs] configure option.
4998 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4999 adjust comments accordingly.
5000 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5001 undefined, adjust comments accordingly.
5002 * image.c: Likewise.
5003 * scroll.c: Likewise.
5004 * w32fns.c: Likewise.
5005 * w32term.c: Likewise.
5006 * xdisp.c: Likewise.
5007 * xfaces.c: Likewise.
5008 * xfns.c: Likewise.
5009 * xterm.c: Likewise.
5010
5011 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5012
5013 Generalize run-time debugging checks.
5014 * dispextern.h (XASSERTS): Remove.
5015 * fontset.c (xassert): Remove.
5016 Convert from xassert to eassert.
5017 * alloc.c: Convert from xassert to eassert.
5018 * bidi.c: Likewise.
5019 * dispnew.c: Likewise.
5020 * fns.c: Likewise.
5021 * fringe.c: Likewise.
5022 * ftfont.c: Likewise.
5023 * gtkutil.c: Likewise.
5024 * image.c: Likewise.
5025 * keyboard.c: Likewise.
5026 * menu.c: Likewise.
5027 * process.c: Likewise.
5028 * scroll.c: Likewise.
5029 * sound.c: Likewise.
5030 * term.c: Likewise.
5031 * w32console.c: Likewise.
5032 * w32fns.c: Likewise.
5033 * w32term.c: Likewise.
5034 * window.c: Likewise.
5035 * xdisp.c: Likewise.
5036 * xfaces.c: Likewise.
5037 * xfns.c: Likewise.
5038 * xselect.c: Likewise.
5039 * xterm.c: Likewise.
5040
5041 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5042
5043 * fns.c (maybe_resize_hash_table): Output message when growing the
5044 purify-hashtable.
5045
5046 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5047
5048 * alloc.c (allocate_string_data): Remove dead code.
5049 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5050 avoid GCC warning about unused macro.
5051
5052 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5053
5054 * alloc.c (allocate_string): Omit intervals initialization.
5055 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5056 as in make_pure_string and make_pure_c_string.
5057
5058 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5059
5060 * alloc.c (allocate_string): Fix last change.
5061
5062 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5063
5064 * alloc.c (allocate_string): Remove two redundant calls
5065 to memset, add explicit initialization where appropriate.
5066
5067 2012-06-27 Glenn Morris <rgm@gnu.org>
5068
5069 * lisp.mk (lisp): Remove paths.elc.
5070
5071 2012-06-27 Chong Yidong <cyd@gnu.org>
5072
5073 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5074
5075 2012-06-26 John Wiegley <johnw@newartisans.com>
5076
5077 * unexmacosx.c (copy_data_segment): Add two section names used
5078 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5079
5080 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5081 when building with Clang.
5082
5083 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5084
5085 * eval.c (Fapply): Allow calling it with a single argument.
5086
5087 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5088
5089 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5090 _stricmp and _strnicmp.
5091 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5092
5093 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5094
5095 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5096 allocated window.
5097 (allocate_process): Likewise for new process.
5098 (allocate_terminal): Change to use offsetof.
5099 (allocate_frame): Likewise.
5100 * frame.c (make_frame): Omit redundant initialization.
5101 * window.c (make_parent_window): Use memset.
5102 (make_window): Omit redundant initialization.
5103 * process.c (make_process): Omit redundant initialization.
5104 * terminal.c (create_terminal): Likewise.
5105
5106 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5107
5108 * term.c (delete_tty): Remove redundant call to memset.
5109
5110 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5111
5112 * alloc.c: Remove build_string.
5113 * lisp.h: Define build_string as static inline. This provides
5114 a better opportunity to optimize away calls to strlen when the
5115 function is called with compile-time constant argument.
5116 * image.c (imagemagick_error): Convert to build_string.
5117 * w32proc.c (sys_spawnve): Likewise.
5118 * xterm.c (x_term_init): Likewise.
5119
5120 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5121
5122 Use sprintf return value instead of invoking strlen on result.
5123 In the old days this wasn't portable, since some sprintf
5124 implementations returned char *. But they died out years ago and
5125 Emacs already assumes sprintf returns int.
5126 Similarly for float_to_string.
5127 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5128 * ccl.c (ccl_driver):
5129 * character.c (string_escape_byte8):
5130 * data.c (Fnumber_to_string):
5131 * doprnt.c (doprnt):
5132 * print.c (print_object):
5133 * xdisp.c (message_dolog):
5134 * xfns.c (syms_of_xfns):
5135 Use sprintf or float_to_string result to avoid need to call strlen.
5136 * data.c (Fnumber_to_string):
5137 Use make_unibyte_string, since the string must be ASCII.
5138 * lisp.h, print.c (float_to_string): Now returns int length.
5139 * term.c (produce_glyphless_glyph):
5140 Use sprintf result rather than recomputing it.
5141
5142 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5143 * Makefile.in (ALL_CFLAGS):
5144 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5145 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5146
5147 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5148
5149 * dispextern.h (xstrcasecmp): Define to library function
5150 strcasecmp if available.
5151 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5152
5153 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5154
5155 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5156 Avoid comma operator.
5157 * menu.c (push_submenu_start, push_submenu_end)
5158 (push_left_right_boundary, push_menu_pane): Likewise.
5159 * msdos.c (dos_rawgetc): Likewise.
5160
5161 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5162
5163 * xfns.c (xic_create_fontsetname): Remove redundant calls
5164 to memset.
5165
5166 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5167
5168 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5169 sprintf already null-terminates its output.
5170
5171 * xfns.c (x_window): Remove redundant cast.
5172
5173 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5174
5175 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5176 `const char *' to `char *' to avoid compiler warning.
5177
5178 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5179
5180 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5181 instead of truncating it to 63 (admittedly a generous limit).
5182
5183 * process.c: Fix spelling and caps in comments.
5184
5185 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5186
5187 * emacs.c (setpgrp): Remove definition, unused.
5188 * sysdep.c (setpgrp): Remove definition, not used in this file.
5189
5190 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5191
5192 * makefile.w32-in: Update dependencies.
5193
5194 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5195
5196 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5197 (SYSTIME_H): Add nt/inc/sys/time.h.
5198
5199 * systime.h [WINDOWSNT]: Include sys/time.h.
5200
5201 * s/ms-w32.h (struct timespec): Definition moved from
5202 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5203
5204 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5205
5206 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5207 * buffer.h (buffer_slot_type_mismatch):
5208 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5209 * eval.c (unwind_to_catch):
5210 * image.c (my_png_error, my_error_exit):
5211 * keyboard.c (quit_throw_to_read_char, user_error)
5212 (Fexit_recursive_edit, Fabort_recursive_edit):
5213 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5214 (wrong_type_argument, buffer_overflow, __executable_start)
5215 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5216 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5217 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5218 (fatal):
5219 (child_setup) [!DOS_NT]:
5220 * lread.c (end_of_file_error, invalid_syntax):
5221 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5222 * puresize.h (pure_write_error):
5223 * search.c (matcher_overflow):
5224 * sound.c (sound_perror, alsa_sound_perror):
5225 * sysdep.c, syssignal.h (croak):
5226 * term.c (maybe_fatal, vfatal):
5227 * textprop.c (text_read_only):
5228 * undo.c (user_error):
5229 * unexmacosx.c (unexec_error):
5230 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5231 Use _Noreturn rather than NO_RETURN.
5232 No need for separate decl merely because of _Noreturn.
5233 * sound.c (sound_warning, parse_sound):
5234 Remove unnecessary forward decls.
5235
5236 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5237
5238 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5239 * lisp.h (WAIT_READING_MAX): New macro.
5240 * dispnew.c (Fsleep_for, sit_for):
5241 * keyboard.c (kbd_buffer_get_event):
5242 * process.c (Faccept_process_output):
5243 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5244 This improves on the previous patch, which introduced a bug
5245 when time_t is unsigned and as wide as intmax_t.
5246 See <http://bugs.gnu.org/9000#51>.
5247
5248 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5249
5250 * dispnew.c (sit_for, Fsleep_for):
5251 * keyboard.c (kbd_buffer_get_event):
5252 * process.c (Faccept_process_output): Avoid compiler warnings when
5253 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5254
5255 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5256
5257 * makefile.w32-in: Update dependencies.
5258
5259 * w32.c (ltime): Add return type and declare static.
5260 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5261
5262 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5263
5264 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5265 Privately reported by Herbert J. Skuhra.
5266 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5267 All uses changed.
5268 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5269 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5270
5271 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5272
5273 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5274 last argument of make_unibyte_string.
5275
5276 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5277 language ID in the event parameters.
5278
5279 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5280 event.code, not the obscure "character set ID".
5281
5282 2012-06-23 Chong Yidong <cyd@gnu.org>
5283
5284 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5285
5286 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5287
5288 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5289 * w32.c (fdutimens): New function.
5290
5291 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5292
5293 * s/ms-w32.h (pselect): Redirect to sys_select.
5294
5295 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5296
5297 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5298 in the logic of incrementing and decrementing the value of
5299 use_relocatable_buffers.
5300
5301 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5302
5303 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5304 Privately reported by Herbert J. Skuhra.
5305 [__FreeBSD__]: Remove "*/" typo after "#include".
5306 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5307 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5308 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5309 Don't assume EMACS_TIME and struct timeval are the same type.
5310
5311 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5312
5313 Support higher-resolution time stamps (Bug#9000).
5314 The time stamps are only nanosecond-resolution at the C level,
5315 since that's the best that any real-world system supports now.
5316 But they are picosecond-resolution at the Lisp level, as that's
5317 easy, and leaves room for future OS improvements.
5318
5319 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5320 (LIBES): Use it.
5321
5322 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5323 Don't get current time unless it's needed.
5324
5325 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5326 now provides it if it's absent.
5327 (start_atimer): Port to higher-res time stamps.
5328 Check for time stamp overflow. Don't get current time more
5329 often than is needed.
5330
5331 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5332 Include systime.h, not time.h.
5333 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5334
5335 * dired.c: Include stat-time.h.
5336 (Ffile-attributes): File times now have higher resolution.
5337
5338 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5339 (struct image): Timestamp now has higher resolution.
5340
5341 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5342 has at least microseconds now. All uses removed.
5343 (update_frame, update_single_window, update_window, update_frame_1)
5344 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5345 (duration_to_sec_usec): Remove; no longer needed.
5346
5347 * editfns.c (time_overflow): Now extern.
5348 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5349 (float-time, Fformat_time_string, Fcurrent_time_string)
5350 (Fcurrent_time_zone): Accept and generate higher-resolution
5351 time stamps.
5352 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5353 (decode_time_components, lisp_seconds_argument): New functions.
5354 (make_time): Now static.
5355 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5356 Report an error if the time is invalid, rather than having the caller
5357 do that.
5358
5359 * fileio.c: Include <stat-time.h>
5360 (Fcopy_file): Copy higher-resolution time stamps.
5361 Prefer to set the time stamp via a file descriptor if that works.
5362 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5363 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5364 (Fvisited_file_modtime, Fset_visited_file_modtime):
5365 Support higher-resolution time stamps.
5366
5367 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5368
5369 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5370
5371 * image.c (prepare_image_for_display, clear_image_cache)
5372 (lookup_image): Port to higer-resolution time stamps.
5373
5374 * keyboard.c (start_polling, bind_polling_period):
5375 Check for time stamp overflow.
5376 (read_char, kbd_buffer_get_event, timer_start_idle)
5377 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5378 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5379 Port to higher-resolution time stamps. Do not assume time_t is signed.
5380 (decode_timer): New function. Timers are now vectors of length 9,
5381 not 8, to accommodate the picosecond component.
5382 (timer_check_2): Use it.
5383
5384 * nsterm.m (select_timeout, timeval_subtract): Remove.
5385 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5386 as they're a bit more accurate and handle overflow better.
5387 (ns_select): Change prototype to be compatible with pselect.
5388 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5389 * nsterm.h (ns_select): Adjust prototype.
5390
5391 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5392 us-resolution time stamps.
5393 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5394
5395 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5396
5397 * lisp.h (time_overflow): New decl.
5398 (wait_reading_process_output): First arg is now intmax_t, not int,
5399 to accommodate larger waits.
5400
5401 * process.h (struct Lisp_Process.read_output_delay):
5402 Now counts nanoseconds, not microseconds.
5403 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5404 EMACS_HAS_USECS.
5405 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5406 (wait_reading_process_output):
5407 Port to ns-resolution time stamps.
5408 (Faccept_process_output, wait_reading_process_output):
5409 Check for time stamp overflow. Do not assume time_t is signed.
5410 (select_wrapper): Remove; we now use pselect.
5411 (Fprocess_attributes): Now generates ns-resolution time stamps.
5412
5413 * sysdep.c: Include utimens.h. Don't include utime.h
5414 or worry about struct utimbuf; gnulib does that for us now.
5415 (gettimeofday): Remove; gnulib provides a substitute.
5416 (make_timeval): New function.
5417 (set_file_times): Now sets ns-resolution time stamps.
5418 New arg FD; all uses changed.
5419 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5420 (system_process_attributes):
5421 Now returns ns-resolution time stamp. All uses changed.
5422 Check for time stamp overflow.
5423
5424 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5425 provides a substitute now.
5426
5427 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5428 since it guarantees struct timespec.
5429 (EMACS_TIME): Now struct timespec, so that we can support
5430 ns-resolution time stamps.
5431 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5432 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5433 (EMACS_USECS): Remove.
5434 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5435 so multiply the arg by 1000 before storing it.
5436 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5437 New macros.
5438 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5439 Port to ns-resolution time stamps.
5440 (EMACS_TIME_NEG_P): Remove; replaced by....
5441 (EMACS_TIME_SIGN): New macro.
5442 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5443 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5444 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5445 (make_timeval, make_lisp_time, decode_time_components): New decls.
5446 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5447 that it mishandled time_t overflow. You can't compare by subtracting!
5448 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5449 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5450
5451 * term.c: Include <sys/time.h>.
5452 (timeval_to_Time): New function, for proper overflow wraparound.
5453 (term_mouse_position, term_mouse_click): Use it.
5454
5455 * undo.c (record_first_change): Support higher-resolution time stamps
5456 in the undo buffer.
5457 (Fprimitive_undo): Use them when restoring time stamps.
5458
5459 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5460 (w32_get_internal_run_time):
5461 Port to higher-resolution Emacs time stamps.
5462 (ltime): Now accepts single 64-bit integer, as that's more convenient
5463 for callers.
5464
5465 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5466
5467 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5468 for compatibility with pselect. Support ns-resolution time stamps.
5469
5470 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5471
5472 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5473 Check for time stamp overflow, and support ns-resolution time stamps.
5474
5475 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5476 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5477 (timeval_subtract): Remove; no longer needed.
5478 (XTflash, XTring_bell, x_wait_for_event):
5479 Port to ns-resolution time stamps. Don't assume time_t is signed.
5480
5481 2012-06-22 Chong Yidong <cyd@gnu.org>
5482
5483 * xdisp.c (x_consider_frame_title): Revert last change.
5484
5485 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5486
5487 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5488 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5489 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5490 staticidx goes up to 1597 out of 1600 = 0x640.)
5491
5492 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5493
5494 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5495 Otherwise, the umask might be mistakenly 0 while handling input signals.
5496
5497 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5498
5499 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5500
5501 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5502
5503 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5504 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5505 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5506 access to `contents' member of Lisp_Vector objects with AREF and ASET
5507 where appropriate.
5508
5509 2012-06-19 Chong Yidong <cyd@gnu.org>
5510
5511 * frame.c (delete_frame): When selecting a frame on a different
5512 text terminal, do not alter the terminal's top-frame.
5513
5514 * xdisp.c (format_mode_line_unwind_data): Record the target
5515 frame's selected window and its terminal's top-frame.
5516 (unwind_format_mode_line): Restore them.
5517 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5518 Callers changed.
5519 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5520 since tty frames can be explicitly named.
5521 (prepare_menu_bars): Likewise.
5522
5523 * term.c (Ftty_top_frame): New function.
5524
5525 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5526
5527 Port byte-code-meter to modern targets.
5528 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5529 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5530 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5531 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5532 (METER_1, METER_2): Simplify.
5533
5534 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5535
5536 * data.c (Fdefalias): Return `symbol' (bug#11686).
5537
5538 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5539
5540 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5541 gets killed during executing of this function (Bug#11665).
5542 Try to always return Qt when the buffer has been actually killed.
5543 (Vkill_buffer_query_functions): In doc-string say that functions
5544 run by this hook should not change the current buffer.
5545
5546 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5547
5548 Fix recently-introduced process.c problems found by static checking.
5549 * process.c (write_queue_push, write_queue_pop, send_process):
5550 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5551 (write_queue_pop): Fix pointer signedness problem.
5552 (send_process): Remove unused local.
5553
5554 2012-06-17 Chong Yidong <cyd@gnu.org>
5555
5556 * xdisp.c (redisplay_internal): No need to redisplay terminal
5557 frames that are not on top.
5558
5559 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5560
5561 * process.c (make_process): Initialize write_queue.
5562 (write_queue_push, write_queue_pop): New functions.
5563 (send_process): Use them to maintain correct ordering of process
5564 writes (Bug#10815).
5565
5566 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5567
5568 * lisp.h (eassert): Assume C89 or later.
5569 This removes the need for CHECK.
5570 (CHECK): Remove. Its comments about always evaluating its
5571 argument were confusing, as 'eassert' typically does not evaluate
5572 its argument.
5573
5574 * coding.c (produce_chars): Use ptrdiff_t, not int.
5575
5576 * xterm.c (x_draw_underwave): Check for integer overflow.
5577 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5578
5579 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5580
5581 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5582 referenced (Bug#11583).
5583
5584 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5585
5586 Implement wave-style variant of underlining.
5587 * dispextern.h (face_underline_type): New enum.
5588 (face): Add field for underline type.
5589 * nsterm.m (ns_draw_underwave): New function.
5590 (ns_draw_text_decoration): Use it.
5591 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5592 New functions.
5593 (x_draw_glyph_string): Use them.
5594 * xfaces.c (Qline, Qwave): New Lisp objects.
5595 (check_lface_attrs, merge_face_ref)
5596 (Finternal_set_lisp_face_attribute, realize_x_face):
5597 Handle wave-style underline face attributes.
5598 * xterm.c (x_draw_underwave): New function.
5599 (x_draw_glyph_string): Use it.
5600
5601 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5602
5603 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5604 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5605 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5606 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5607 ($(BLD)/w32select.$(O)): Update dependencies.
5608
5609 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5610
5611 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5612 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5613 * character.c (_fetch_multibyte_char_p): Remove.
5614 * alloc.c: Include "character.h" before "buffer.h".
5615 * bidi.c: Likewise.
5616 * buffer.c: Likewise.
5617 * bytecode.c: Likewise.
5618 * callint.c: Likewise.
5619 * callproc.c: Likewise.
5620 * casefiddle.c: Likewise.
5621 * casetab.c: Likewise.
5622 * category.c: Likewise.
5623 * cmds.c: Likewise.
5624 * coding.c: Likewise.
5625 * composite.c: Likewise.
5626 * dired.c: Likewise.
5627 * dispnew.c: Likewise.
5628 * doc.c: Likewise.
5629 * dosfns.c: Likewise.
5630 * editfns.c: Likewise.
5631 * emacs.c: Likewise.
5632 * fileio.c: Likewise.
5633 * filelock.c: Likewise.
5634 * font.c: Likewise.
5635 * fontset.c: Likewise.
5636 * fringe.c: Likewise.
5637 * indent.c: Likewise.
5638 * insdel.c: Likewise.
5639 * intervals.c: Likewise.
5640 * keyboard.c: Likewise.
5641 * keymap.c: Likewise.
5642 * lread.c: Likewise.
5643 * macros.c: Likewise.
5644 * marker.c: Likewise.
5645 * minibuf.c: Likewise.
5646 * nsfns.m: Likewise.
5647 * nsmenu.m: Likewise.
5648 * print.c: Likewise.
5649 * process.c: Likewise.
5650 * regex.c: Likewise.
5651 * region-cache.c: Likewise.
5652 * search.c: Likewise.
5653 * syntax.c: Likewise.
5654 * term.c: Likewise.
5655 * textprop.c: Likewise.
5656 * undo.c: Likewise.
5657 * unexsol.c: Likewise.
5658 * w16select.c: Likewise.
5659 * w32fns.c: Likewise.
5660 * w32menu.c: Likewise.
5661 * window.c: Likewise.
5662 * xdisp.c: Likewise.
5663 * xfns.c: Likewise.
5664 * xmenu.c: Likewise.
5665 * xml.c: Likewise.
5666 * xselect.c: Likewise.
5667
5668 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5669
5670 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5671 If all the glyphs of the glyph row came from strings, and we have no
5672 cursor positioning clues, put the cursor on the first glyph of the
5673 row.
5674 (handle_face_prop): Use chunk-relative overlay string index when
5675 indexing into it->string_overlays array. (Bug#11653)
5676 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5677 the rightmost. (Bug#11720)
5678
5679 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5680
5681 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5682 (CATEGORY_MEMBER): Enforce 1/0 value.
5683 * category.c (_temp_category_set): Remove.
5684
5685 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5686
5687 * window.c (Fdelete_other_windows_internal)
5688 (Fdelete_window_internal): Don't access frame's mouse highlight
5689 info of the initial frame. (Bug#11677)
5690
5691 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5692
5693 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5694 Assume USE_2_TAGS_FOR_INTS.
5695 (xreload): Adjust $tagmask width to match recent lisp.h change.
5696
5697 Simplify lisp.h in minor ways that should not affect code.
5698 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5699 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5700 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5701 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5702 (INTTYPEBITS): New macro, for clarity.
5703 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5704 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5705 Simplify now that USE_LSB_TAG is always defined.
5706 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5707 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5708
5709 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5710
5711 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5712
5713 2012-06-13 Glenn Morris <rgm@gnu.org>
5714
5715 * s/bsd-common.h (BSD4_3):
5716 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5717
5718 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5719
5720 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5721 instead of union.
5722 (XLI, XIL): Define.
5723 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5724 Use them.
5725 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5726 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5727 * alloc.c (widen_to_Lisp_Object): Remove.
5728 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5729 * frame.c (delete_frame): Remove outdated comment.
5730 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5731 USE_LISP_UNION_TYPE.
5732 (Fw32_unregister_hot_key): Likewise.
5733 (Fw32_toggle_lock_key): Likewise.
5734 * w32menu.c (add_menu_item): Likewise.
5735 (w32_menu_display_help): Use XIL instead of checking
5736 USE_LISP_UNION_TYPE.
5737 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5738 (init_heap): Likewise.
5739 * w32term.c (w32_read_socket): Update comment.
5740
5741 2012-06-13 Glenn Morris <rgm@gnu.org>
5742
5743 * s/usg5-4-common.h, src/s/unixware.h:
5744 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5745
5746 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5747
5748 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5749
5750 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5751 * alloc.c (make_number) [!defined make_number]:
5752 Remove, as lisp.h always defines this now.
5753 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5754 (roundup_size): Verify that it is a power of 2.
5755 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5756 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5757 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5758 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5759 USE_LSB_TAG now is always defined to be either 0 or 1.
5760 All uses changed.
5761 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5762 code works fine either way, and efficiency is not a concern here,
5763 as the union type is for debugging, not for production.
5764 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5765 Use an inline function on all platforms when using the union type,
5766 since this is simpler and 'static inline' can be used portably
5767 within Emacs now.
5768 (LISP_INITIALLY_ZERO): New macro.
5769 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5770 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5771
5772 2012-06-12 Glenn Morris <rgm@gnu.org>
5773
5774 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5775
5776 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5777
5778 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5779 Move BROKEN_SIGIO to configure.
5780
5781 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5782 Move NO_TERMIO to configure.
5783
5784 2012-06-12 Chong Yidong <cyd@gnu.org>
5785
5786 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5787 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5788 MagickExportImagePixels is undefined.
5789
5790 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5791
5792 * image.c (imagemagick_load_image): Remove unused label.
5793
5794 2012-06-11 Glenn Morris <rgm@gnu.org>
5795
5796 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5797 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5798 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5799 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5800
5801 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5802
5803 * alloc.c (make_byte_code): New function.
5804 (Fmake_byte_code): Use it. Don't purify here.
5805 * lread.c (read1): Use it as well to avoid extra allocation.
5806
5807 2012-06-11 Chong Yidong <cyd@gnu.org>
5808
5809 * image.c (imagemagick_load_image): Implement transparency.
5810
5811 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5812
5813 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5814 account for preceding backslashes. (Bug#11663)
5815
5816 2012-06-09 Chong Yidong <cyd@gnu.org>
5817
5818 * term.c: Support italics in capable terminals (Bug#9652).
5819 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5820 (turn_on_face): Output using TS_enter_italic_mode if available.
5821 Don't handle unused blinking and alt-charset cases.
5822 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5823 and tty_alt_charset_p cases.
5824 (tty_capable_p, init_tty): Support italics.
5825
5826 * termchar.h (struct tty_display_info): Add field for italics.
5827 Remove unused blink field.
5828
5829 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5830 Handle slant.
5831
5832 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5833 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5834 tty_alt_charset_p. Add tty_italic_p.
5835
5836 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5837
5838 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5839 dbus_type_is_basic if available.
5840 (xd_extract_signed, xd_extract_unsigned): Rename from
5841 extract_signed and extract_unsigned, respectively. Adapt callers.
5842
5843 2012-06-09 Chong Yidong <cyd@gnu.org>
5844
5845 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5846
5847 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5848 case (Bug#9752).
5849
5850 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5851
5852 * xdisp.c (vmessage): Treat frame message as multibyte.
5853 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5854 would generate the diagnostic "Making \302\247 buffer-local while
5855 let-bound!".
5856
5857 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5858
5859 * dispnew.c (showing_window_margins_p): Undo last change, which
5860 was done due to an inadvertent commit.
5861 (adjust_frame_glyphs_for_frame_redisplay): Do call
5862 showing_window_margins_p.
5863
5864 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5865
5866 * eval.c (Fmake_var_non_special): New primitive.
5867 (syms_of_eval): Defsubr it.
5868 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5869
5870 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5871
5872 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5873 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5874
5875 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5876
5877 * alloc.c (allocate_vectorlike): Fix last change.
5878
5879 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5880
5881 Block-based vector allocation of small vectors.
5882 * lisp.h (struct vectorlike_header): New field `nbytes',
5883 adjust comment accordingly.
5884 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5885 to denote vector blocks. Adjust users (live_vector_p,
5886 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5887 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5888 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5889 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5890 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5891 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5892 (roundup_size): New constant.
5893 (struct vector_block): New data type.
5894 (vector_blocks, vector_free_lists, zero_vector): New variables.
5895 (all_vectors): Rename to `large_vectors'.
5896 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5897 (sweep_vectors): New functions.
5898 (allocate_vectorlike): Return `zero_vector' as the only vector of
5899 0 items. Allocate new vector from block if vector size is less than
5900 or equal to VBLOCK_BYTES_MAX.
5901 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5902 (init_alloc_once): Add call to init_vectors.
5903
5904 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5905
5906 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5907
5908 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5909
5910 * doprnt.c (doprnt): Truncate multibyte char correctly.
5911 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5912 would mishandle a string argument "Xc" if X was a multibyte
5913 character of length 2: it would truncate after X's first byte
5914 rather than including all of X.
5915
5916 2012-06-06 Chong Yidong <cyd@gnu.org>
5917
5918 * buffer.c (word_wrap): Doc fix.
5919
5920 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5921
5922 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5923
5924 2012-06-03 Glenn Morris <rgm@gnu.org>
5925
5926 * xdisp.c (tool-bar-style): Doc fix.
5927
5928 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5929
5930 * Makefile.in (PAXCTL): Define.
5931 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5932 binary via PaX flags if the paxctl utility is available.
5933 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5934 Restore PaX flags to their default. (Bug#11398)
5935
5936 2012-06-03 Chong Yidong <cyd@gnu.org>
5937
5938 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5939 buffer (Bug#11226).
5940
5941 2012-06-03 Chong Yidong <cyd@gnu.org>
5942
5943 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5944 (note_mode_line_or_margin_highlight): If there is no help echo,
5945 use mode-line-default-help-echo. Handle the case where the mouse
5946 position is past the end of the mode line string.
5947
5948 * buffer.c (buffer_local_value_1): New function, split from
5949 Fbuffer_local_value; can return Qunbound.
5950 (Fbuffer_local_value): Use it.
5951 (Vmode_line_format): Docstring tweaks.
5952
5953 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 * sysdep.c (system_process_attributes): Improve comment.
5956
5957 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5958
5959 * keyboard.c: Export real-this-command to Elisp.
5960 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5961 and DEFVAR it. Update all users.
5962
5963 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5964
5965 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5966
5967 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5968 Convert pctcpu and pctmem to Lisp float properly.
5969 Let the compiler fold better, as 100.0/0x8000 is exact.
5970
5971 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5972
5973 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5974 cons_block.
5975
5976 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5977
5978 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5979
5980 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5981
5982 For a 'struct window', replace some Lisp_Object fields to
5983 bitfields where appropriate, remove unused fields.
5984 * window.h (struct window): Remove unused 'last_mark_x' and
5985 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5986 change it's type from Lisp_Object to bitfield.
5987 Change type of 'force_start', 'optional_new_start',
5988 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5989 fields from Lisp_Object to bitfield. Adjust users accordingly.
5990
5991 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5992
5993 Pacify gcc -Wdouble-precision when using Xaw.
5994 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5995 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5996 Use 'float' consistently, rather than 'float' in most places
5997 and 'double' in a couple of places.
5998
5999 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6000
6001 * xdisp.c (handle_stop): Detect whether we have overlay strings
6002 loaded by testing it->current.overlay_string_index to be
6003 non-negative, instead of checking whether n_overlay_strings is
6004 positive. (Bug#11587)
6005
6006 2012-05-31 Chong Yidong <cyd@gnu.org>
6007
6008 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6009
6010 * doc.c (Fsubstitute_command_keys): Doc fix.
6011
6012 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6013
6014 * search.c (search_buffer): Remove calls to
6015 r_alloc_inhibit_buffer_relocation, as it is now called by
6016 maybe_unify_char, which was the cause of relocation of buffer text
6017 in bug#11519.
6018
6019 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6020
6021 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6022 for the duration of call to load_charset, to avoid problems with
6023 callers of maybe_unify_char that access buffer text through C
6024 pointers.
6025
6026 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6027 decrement the inhibition flag, instead of just setting or
6028 resetting it.
6029
6030 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6031
6032 Remove obsolete '#define static' cruft.
6033 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6034 This #undef was "temporary" in 2000; it is no longer needed
6035 now that '#define static' has gone away.
6036 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6037 (gray_bitmap_bits): Remove; no longer needed.
6038 All uses replaced with definiens.
6039 * xterm.c: Include "bitmaps/gray.xbm".
6040
6041 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6042
6043 Clean up __executable_start, monstartup when --enable-profiling.
6044 The following changes affect the code only when profiling.
6045 * dispnew.c (__executable_start): Rename from safe_bcopy.
6046 Define only on platforms that need it.
6047 * emacs.c: Include <sys/gmon.h> when profiling.
6048 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6049 (__executable_start): Remove decl, since lisp.h does it now.
6050 (safe_bcopy): Remove decl; no longer has that name.
6051 (main): Coalesce #if into single bit of code, for simplicity.
6052 Cast pointers to uintptr_t, since standard libraries want integers
6053 and not pointers.
6054 * lisp.h (__executable_start): New decl.
6055
6056 2012-05-31 Glenn Morris <rgm@gnu.org>
6057
6058 * image.c (Fimagemagick_types): Doc fix.
6059
6060 2012-05-30 Jim Meyering <meyering@redhat.com>
6061
6062 * callproc.c (Fcall_process_region): Include directory component
6063 in mkstemp error message (Bug#11586).
6064
6065 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6066
6067 * alloc.c, lisp.h (make_pure_vector): Now static.
6068
6069 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6070
6071 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6072 Move to byte-run.el.
6073 (Fautoload): Do the hash-doc more carefully.
6074 * data.c (Fdefalias): Purify definition, except for keymaps.
6075 (Qdefun): Move from eval.c.
6076 * lisp.h (Qdefun): Remove.
6077 * lread.c (read1): Tiny simplification.
6078
6079 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6080
6081 Do not create empty overlays with the evaporate property (Bug#9642).
6082 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6083 Bug#9642, but explicitly check that the buffer the overlay would
6084 be moved to is live and rearrange lines to make sure that errors
6085 will not put the overlay in an inconsistent state.
6086 (Fdelete_overlay): Cosmetics.
6087
6088 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6089
6090 * w32term.c (my_bring_window_to_top): New function.
6091 (x_raise_frame): Use handle returned by DeferWindowPos, which
6092 could be different from the original one.
6093 Call my_bring_window_to_top instead of my_set_foreground_window.
6094 (Bug#11513)
6095
6096 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6097 by calling BringWindowToTop.
6098
6099 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6100 (WM_EMACS_END): Increase by one.
6101
6102 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6103
6104 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6105 This avoids undefined behavior that might cause the eassert
6106 to not catch an out-of-range value.
6107
6108 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6109
6110 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6111 Update dependencies.
6112
6113 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6114
6115 * bidi.c (bidi_mirror_char): Fix last change.
6116
6117 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6118
6119 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6120 when referring to sectname field in printf format.
6121
6122 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6123
6124 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6125 Only r_alloc_inhibit_buffer_relocation needed to be added;
6126 the others were already declared.
6127
6128 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6129 before checking whether it's out of range. Put the check inside
6130 eassert. See
6131 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6132
6133 2012-05-27 Ken Brown <kbrown@cornell.edu>
6134
6135 * callproc.c (Fcall_process): Restore a line that was accidentally
6136 commented out in the 2011-02-13 change (bug#11547).
6137
6138 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6139
6140 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6141 defined on ralloc.c.
6142
6143 * buffer.c [REL_ALLOC]: Remove prototypes of
6144 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6145 they are now on lisp.h.
6146
6147 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6148
6149 * search.c (search_buffer): Use it to inhibit relocation of buffer
6150 text while re_search_2 is doing its job, because re_search_2 is
6151 passed C pointers to buffer text. (Bug#11519)
6152
6153 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6154 Update value to 24.
6155
6156 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6157 state after an additional call to move_it_in_display_line_to, keep
6158 the values of it->max_ascent and it->max_descent found for the
6159 entire line.
6160 (pos_visible_p): Revert the comparison against bottom_y to what it
6161 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6162 (Bug#11464)
6163
6164 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6165
6166 Fix coding-related core dumps with gcc -ftrapv.
6167 The code was computing A - B, where A and B are pointers, and B is
6168 random garbage. This can lead to core dumps on platforms that
6169 have special pointer registers, and it also leads to core dumps on
6170 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6171 A - B only when B is initialized properly.
6172 * coding.c (coding_set_source, coding_set_destination): Return void.
6173 (coding_change_source, coding_change_destinations): New functions,
6174 with the old behaviors of coding_set_source and coding_set_destination.
6175 All callers that need an offset changed to use these new functions.
6176
6177 2012-05-26 Glenn Morris <rgm@gnu.org>
6178
6179 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6180
6181 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6182
6183 Extend mouse support on W32 text-mode console.
6184 * xdisp.c (draw_row_with_mouse_face):
6185 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6186
6187 * w32console.c: Include window.h.
6188 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6189 New functions.
6190 (initialize_w32_display): Initialize mouse-highlight data.
6191
6192 * w32inevt.c: Include termchar.h and window.h.
6193 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6194 moves, call note_mouse_highlight. If help_echo changed, call
6195 gen_help_event to produce help-echo message in the echo area.
6196 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6197 highlight info.
6198
6199 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6200
6201 * lread.c (read1): Simplify slightly to avoid an overflow warning
6202 with GCC 4.7.0 on x86-64.
6203
6204 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6205
6206 * bidi.c (bidi_mirror_char): Revert last change: an int is
6207 definitely wide enough here.
6208
6209 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6210
6211 Fix integer width and related bugs (Bug#9874).
6212 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6213 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6214 (string_bytes, check_sblock, allocate_string_data):
6215 (compact_small_strings, Fmake_bool_vector, make_string)
6216 (make_unibyte_string, make_multibyte_string)
6217 (make_string_from_bytes, make_specified_string)
6218 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6219 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6220 (mark_vectorlike):
6221 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6222 (allocate_pseudovector):
6223 Use int, not EMACS_INT, where int is wide enough.
6224 (inhibit_garbage_collection, Fgarbage_collect):
6225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6226 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6227 int might not be wide enough.
6228 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6229 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6230 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6231 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6232 (bidi_level_of_next_char, bidi_move_to_visually_next):
6233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6234 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6235 (Fkill_buffer, Fset_buffer_major_mode)
6236 (advance_to_char_boundary, Fbuffer_swap_text)
6237 (Fset_buffer_multibyte, overlays_at, overlays_in)
6238 (overlay_touches_p, struct sortvec, record_overlay_string)
6239 (overlay_strings, recenter_overlay_lists)
6240 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6241 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6242 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6243 (Foverlay_recenter, last_overlay_modification_hooks_used)
6244 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6246 (validate_region): Omit unnecessary test for b <= e,
6247 since that's guaranteed by the previous test.
6248 (adjust_overlays_for_delete): Avoid pos + length overflow.
6249 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6250 (report_overlay_modification):
6251 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6252 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6253 Omit pointer cast, which isn't needed anyway, and doesn't work
6254 after the EMACS_INT -> ptrdiff_t change.
6255 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6256 * buffer.h: Adjust decls to match defn changes elsewhere.
6257 (struct buffer_text, struct buffer):
6258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6259 Use EMACS_INT, not int, where int might not be wide enough.
6260 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6261 not int, to avoid needless 32-bit limit on 64-bit hosts.
6262 (exec_byte_code): Use tighter memory-full test, one that checks
6263 for alloca overflow. Don't compute the address of the object just
6264 before an array, as that's not portable. Use EMACS_INT, not
6265 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6266 * callint.c (Fcall_interactively):
6267 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6268 * callproc.c (call_process_kill, Fcall_process):
6269 Don't assume pid_t fits into an Emacs fixnum.
6270 (call_process_cleanup, Fcall_process, child_setup):
6271 Don't assume pid_t fits into int.
6272 (call_process_cleanup, Fcall_process, delete_temp_file)
6273 (Fcall_process_region):
6274 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6275 (Fcall_process): Simplify handling of volatile integers.
6276 Use int, not EMACS_INT, where int will do.
6277 * casefiddle.c (casify_object, casify_region, operate_on_word)
6278 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6279 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6280 (casify_object): Avoid integer overflow when overallocating buffer.
6281 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6282 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6283 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6284 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6285 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6286 integers are now checked earlier. All uses replaced with XINT.
6287 (ccl_driver):
6288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6289 For CCL_MapSingle, check that content and value are in int range.
6290 (ccl_driver, Fregister_code_conversion_map):
6291 Check that Vcode_version_map_vector is a vector.
6292 (resolve_symbol_ccl_program): Check that vector header is in range.
6293 Always copy the vector, so that we can check its contents reliably
6294 now rather than having to recheck each instruction as it's being
6295 executed. Check that vector words fit in 'int'.
6296 (ccl_get_compiled_code, Fregister_ccl_program)
6297 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6298 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6299 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6300 contents are in range.
6301 (Fccl_execute_on_string): Check that status is in range.
6302 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6303 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6304 Accept and return EMACS_INT, not int, because callers can pass values
6305 out of 'int' range.
6306 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6307 (multibyte_chars_in_text, parse_str_as_multibyte)
6308 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6309 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6310 (string_escape_byte8, Fget_byte):
6311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6312 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6313 avoid mishandling large integers.
6314 * character.h: Adjust decls to match defn changes elsewhere.
6315 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6316 (Ffind_charset_region):
6317 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6318 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6319 (load_charset_map_from_vector, Fdefine_charset_internal):
6320 Don't assume fixnum fits in int.
6321 (load_charset_map_from_vector, Fmap_charset_chars):
6322 Remove now-unnecessary CHECK_NATNUMs.
6323 (Fdefine_charset_internal): Check ranges here, more carefully.
6324 Don't rely on undefined behavior with signed left shift overflow.
6325 Don't assume unsigned int fits into fixnum, or that fixnum fits
6326 into unsigned int. Don't require max_code to be a valid fixnum;
6327 that's not true for gb10830 4-byte on a 32-bit host. Allow
6328 invalid_code to be a cons, for the same reason. Require code_offset
6329 to be a character. Avoid int overflow if max_char is close
6330 to INT_MAX.
6331 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6332 this is intended anyway and avoids some undefined behavior.
6333 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6334 INDEX_TO_CODE_POINT, as that's what it expects.
6335 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6336 * charset.h (DECODE_CHAR): Return int, not unsigned;
6337 this is what was intended anyway, and it avoids undefined behavior.
6338 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6339 integer-overflow issues.
6340 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6341 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6342 where the argument is EMACS_INT, and this behavior is not intended.
6343 * chartab.c (Fmake_char_table, Fset_char_table_range)
6344 (uniprop_get_decoder, uniprop_get_encoder):
6345 Don't assume fixnum fits in int.
6346 * cmds.c (move_point): New function, that does the gist of
6347 Fforward_char and Fbackward_char, but does so while checking
6348 for integer overflow more accurately.
6349 (Fforward_char, Fbackward_char): Use it.
6350 (Fforward_line, Fend_of_line, internal_self_insert)
6351 (internal_self_insert):
6352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6353 Fix a FIXME, by checking for integer overflow when calculating
6354 target_clm and actual_clm.
6355 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6356 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6357 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6358 (coding_alloc_by_making_gap, alloc_destination)
6359 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6360 (encode_coding_utf_16, detect_coding_emacs_mule)
6361 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6362 (detect_coding_iso_2022, decode_coding_iso_2022)
6363 (encode_invocation_designation, encode_designation_at_bol)
6364 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6365 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6366 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6367 (encode_coding_ccl, encode_coding_raw_text)
6368 (detect_coding_charset, decode_coding_charset)
6369 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6370 (produce_composition, produce_charset, produce_annotation)
6371 (decode_coding, handle_composition_annotation)
6372 (handle_charset_annotation, consume_chars, decode_coding_gap)
6373 (decode_coding_object, encode_coding_object, detect_coding_system)
6374 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6375 (code_convert_region, code_convert_string)
6376 (Fdefine_coding_system_internal)
6377 (coding_set_source, coding_set_destination):
6378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6379 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6380 (Fdefine_coding_system_internal):
6381 Don't assume fixnums fit in int.
6382 (decode_coding_gap, decode_coding_object, encode_coding_object)
6383 (Fread_coding_system, Fdetect_coding_region)
6384 (Funencodable_char_position, Fcheck_coding_systems_region)
6385 (get_translation, handle_composition_annotation, consume_chars):
6386 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6387 (consume_chars): Rewrite to not calculate an address outside buffer.
6388 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6389 Don't access memory outside of the args array.
6390 (Fdefine_coding_system_internal): Check for charset-id overflow.
6391 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6392 result of ENCODE_CHAR.
6393 * coding.h: Adjust decls to match defn changes elsewhere.
6394 (struct coding_system):
6395 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6396 * composite.c (get_composition_id, find_composition)
6397 (run_composition_function, update_compositions)
6398 (compose_text, composition_gstring_put_cache)
6399 (composition_gstring_p, composition_gstring_width)
6400 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6401 (composition_compute_stop_pos, composition_reseat_it)
6402 (composition_update_it, struct position_record)
6403 (find_automatic_composition, composition_adjust_point)
6404 (Fcomposition_get_gstring, Ffind_composition_internal):
6405 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6406 (update_compositions):
6407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6408 * composite.h: Adjust decls to match defn changes elsewhere.
6409 (struct composition):
6410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6411 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6412 Do not attempt to compute the address of the object just before a
6413 buffer; this is not portable.
6414 (Faref, Faset):
6415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6416 (Faset): Use int, not EMACS_INT, where int is wide enough.
6417 (Fstring_to_number): Don't assume fixnums fit in int.
6418 (Frem): Don't assume arg is nonnegative.
6419 * dbusbind.c (xd_append_arg): Check for integers out of range.
6420 (Fdbus_call_method): Don't overflow the timeout int.
6421 (extract_signed, extract_unsigned): New functions.
6422 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6423 (xd_get_connection_references): Return ptrdiff_t, not int.
6424 All uses changed.
6425 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6426 (xd_read_message_1):
6427 Use int, not unsigned, where the dbus API uses int.
6428 (Fdbus_message_internal): Don't overflow mtype.
6429 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6430 * dired.c (directory_files_internal, file_name_completion, scmp)
6431 (file_name_completion_stat):
6432 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6433 (file_name_completion): Don't overflow matchcount.
6434 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6435 * dispextern.h: Adjust decls to match defn changes elsewhere.
6436 (struct text_pos, struct glyph, struct bidi_saved_info)
6437 (struct bidi_string_data, struct bidi_it, struct composition_it)
6438 (struct it):
6439 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6440 (struct display_pos, struct composition_it, struct it):
6441 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6442 * dispnew.c (increment_matrix_positions)
6443 (increment_row_positions, mode_line_string)
6444 (marginal_area_string):
6445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6446 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6447 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6448 (duration_to_sec_usec): New function, to check for overflow better.
6449 (Fsleep_for, sit_for): Use it.
6450 * doc.c (get_doc_string, store_function_docstring):
6451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6452 (get_doc_string, Fsnarf_documentation):
6453 Use int, not EMACS_INT, where int is wide enough.
6454 (get_doc_string):
6455 Use SAFE_ALLOCA, not alloca.
6456 Check for overflow when converting EMACS_INT to off_t.
6457 * doprnt.c (doprnt):
6458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6459 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6460 Don't assume uid_t fits into fixnum.
6461 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6462 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6463 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6464 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6465 (general_insert_function)
6466 (Finsert_char, make_buffer_string, make_buffer_string_both)
6467 (update_buffer_properties, Fbuffer_substring)
6468 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6469 (Fsubst_char_in_region, check_translation)
6470 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6471 (transpose_markers, Ftranspose_regions):
6472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6473 (clip_to_bounds): Move to lisp.h as an inline function).
6474 (Fconstrain_to_field): Don't assume integers are nonnegative.
6475 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6476 (Fsubst_char_in_region, Fsave_restriction):
6477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6478 (Femacs_pid): Don't assume pid_t fits into fixnum.
6479 (lo_time): Use int, not EMACS_INT, when int suffices.
6480 (lisp_time_argument): Check for usec out of range.
6481 (Fencode_time): Don't assume fixnum fits in int.
6482 (Fuser_login_name, Fuser_full_name): Signal an error
6483 if a uid argument is out of range, rather than relying on
6484 undefined behavior.
6485 (Fformat_time_string): Remove now-unnecessary check.
6486 lisp_time_argument checks for out-of-range usec now.
6487 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6488 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6489 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6490 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6491 (init_cmdargs, Fdump_emacs):
6492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6493 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6494 the bottom (typically) 32 bits of the fixnum.
6495 * eval.c (specpdl_size, call_debugger):
6496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6497 (when_entered_debugger, Fbacktrace_debug):
6498 Don't assume fixnum can fit in int.
6499 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6500 the object just before a buffer; this is not portable.
6501 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6502 (grow_specpdl, unbind_to):
6503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6504 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6505 (grow_specpdl): Simplify allocation by using xpalloc.
6506 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6507 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6508 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6509 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6510 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6511 (a_write, e_write):
6512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6513 (Fcopy_file, non_regular_nbytes, read_non_regular)
6514 (Finsert_file_contents):
6515 Use int, not EMACS_INT, where int is wide enough.
6516 (READ_BUF_SIZE): Verify that it fits in int.
6517 (Finsert_file_contents): Check that counts are in proper range,
6518 rather than assuming fixnums fit into ptrdiff_t etc.
6519 Don't assume fixnums fit into int.
6520 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6521 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6522 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6523 (string_char_to_byte, string_byte_to_char)
6524 (string_make_multibyte, string_to_multibyte)
6525 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6526 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6527 (substring_both, Fdelete, internal_equal, Ffillarray)
6528 (Fclear_string, mapcar1)
6529 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6530 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6531 (larger_vector, make_hash_table, maybe_resize_hash_table)
6532 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6533 (Fmaphash, secure_hash):
6534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6535 (concat): Check for string index and length overflow.
6536 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6537 (Frequire):
6538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6539 (larger_vector): New API (vec, incr_min, size_max) replaces old
6540 one (vec, new_size, init). This catches size overflow.
6541 INIT was removed because it was always Qnil.
6542 All callers changed.
6543 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6544 the upper bound on a hash table index size.
6545 (make_hash_table, maybe_resize_hash_table): Use it.
6546 (secure_hash): Computer start_byte and end_byte only after
6547 they're known to be in ptrdiff_t range.
6548 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6549 (Ffont_get_glyphs, Ffont_at):
6550 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6551 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6552 (Flist_fonts, Fopen_font):
6553 Don't assume fixnum can fit in int.
6554 (check_gstring): Don't assume index can fit in int.
6555 (font_match_p): Check that fixnum is a character, not a nonnegative
6556 fixnum, since the later code needs to stuff it into an int.
6557 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6558 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6559 conversion overflow issues.
6560 (Fopen_font): Check for integer out of range.
6561 (Ffont_get_glyphs): Don't assume index can fit in int.
6562 * font.h: Adjust decls to match defn changes elsewhere.
6563 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6564 integer overflow.
6565 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6566 printmax_t, where ptrdiff_t is wide enough.
6567 (Finternal_char_font):
6568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6569 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6570 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6571 (Fset_frame_position, x_set_frame_parameters)
6572 (x_set_line_spacing, x_set_border_width)
6573 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6574 Check that fixnums are in proper range for system types.
6575 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6577 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6578 Use SAFE_ALLOCA_LISP, not alloca.
6579 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6580 intptr_t is wide enough.
6581 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6582 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6583 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6584 Check for fixnum out of range.
6585 * ftfont.c (ftfont_list): Don't assume index fits in int.
6586 Check that fixnums are in proper range for system types.
6587 (ftfont_shape_by_flt):
6588 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6589 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6591 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6592 Check that fixnums are in proper range for system types.
6593 * gnutls.h: Adjust decls to match defn changes elsewhere.
6594 * gtkutil.c (xg_dialog_run):
6595 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6596 (update_frame_tool_bar):
6597 Check that fixnums are in proper range for system types.
6598 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6599 (lookup_image): Check that fixnums are in range for system types.
6600 * indent.c (last_known_column, last_known_column_point):
6601 (current_column_bol_cache):
6602 (skip_invisible, current_column, check_display_width):
6603 (check_display_width, scan_for_column, current_column_1)
6604 (Findent_to, Fcurrent_indentation, position_indentation)
6605 (indented_beyond_p, Fmove_to_column, compute_motion):
6606 (Fcompute_motion, Fvertical_motion):
6607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6608 (last_known_column_modified): Use EMACS_INT, not int.
6609 (check_display_width):
6610 (Fcompute_motion):
6611 Check that fixnums and floats are in proper range for system types.
6612 (compute_motion): Don't assume index or fixnum fits in int.
6613 (compute_motion, Fcompute_motion):
6614 Use int, not EMACS_INT, when it is wide enough.
6615 (vmotion): Omit local var start_hpos that is always 0; that way
6616 we don't need to worry about overflow in expressions involving it.
6617 * indent.h: Adjust decls to match defn changes elsewhere.
6618 (struct position):
6619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6620 Use int, not EMACS_INT, where int is wide enough.
6621 Remove unused members ovstring_chars_done and tab_offset;
6622 all uses removed.
6623 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6624 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6625 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6626 (make_gap, copy_text, insert, insert_and_inherit)
6627 (insert_before_markers, insert_before_markers_and_inherit)
6628 (insert_1, count_combining_before, count_combining_after)
6629 (insert_1_both, insert_from_string)
6630 (insert_from_string_before_markers, insert_from_string_1)
6631 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6632 (adjust_after_replace, adjust_after_insert, replace_range)
6633 (replace_range_2, del_range, del_range_1, del_range_byte)
6634 (del_range_both, del_range_2, modify_region)
6635 (prepare_to_modify_buffer, signal_before_change)
6636 (signal_after_change, Fcombine_after_change_execute):
6637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6638 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6639 (balance_an_interval, split_interval_right, split_interval_left)
6640 (find_interval, next_interval, update_interval)
6641 (adjust_intervals_for_insertion, delete_node, delete_interval)
6642 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6643 (static_offset_intervals, offset_intervals)
6644 (merge_interval_right, merge_interval_left, make_new_interval)
6645 (graft_intervals_into_buffer, temp_set_point_both)
6646 (temp_set_point, set_point, adjust_for_invis_intang)
6647 (set_point_both, move_if_not_intangible, get_property_and_range)
6648 (get_local_map, copy_intervals, copy_intervals_to_string)
6649 (compare_string_intervals, set_intervals_multibyte_1):
6650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6651 * intervals.h: Adjust decls to match defn changes elsewhere.
6652 (struct interval):
6653 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6654 * keyboard.c (this_command_key_count, this_single_command_key_start)
6655 (before_command_key_count, before_command_echo_length, echo_now)
6656 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6657 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6658 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6659 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6661 (last_non_minibuf_size, last_point_position, echo_truncate)
6662 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6663 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6664 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6665 (stuff_buffered_input):
6666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6667 (last_auto_save, command_loop_1, read_char):
6668 Use EMACS_INT, not int, to avoid integer overflow.
6669 (record_char): Avoid overflow in total_keys computation.
6670 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6671 * keyboard.h: Adjust decls to match defn changes elsewhere.
6672 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6673 (Fkey_description, Fdescribe_vector, Flookup_key):
6674 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6675 (click_position): New function, to check that positions are in range.
6676 (Fcurrent_active_maps):
6677 (describe_command):
6678 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6679 (Faccessible_keymaps, Fkey_description):
6680 (preferred_sequence_p):
6681 Don't assume fixnum can fit into int.
6682 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6683 Check for integer overflow in size calculations.
6684 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6685 avoid mishandling large integers.
6686 * lisp.h: Adjust decls to match defn changes elsewhere.
6687 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6688 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6689 (struct Lisp_Marker):
6690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6691 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6692 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6693 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6694 All callers changed.
6695 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6696 Assume the arg has valid form, since it always does.
6697 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6698 unsigned integer system type.
6699 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6700 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6701 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6702 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6703 (duration_to_sec_usec): New decl.
6704 * lread.c (read_from_string_index, read_from_string_index_byte)
6705 (read_from_string_limit, readchar, unreadchar, openp)
6706 (read_internal_start, read1, oblookup):
6707 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6708 (Fload, readevalloop, Feval_buffer, Feval_region):
6709 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6710 (openp): Check for out-of-range argument to 'access'.
6711 (read1): Use int, not EMACS_INT, where int is wide enough.
6712 Don't assume fixnum fits into int.
6713 Fix off-by-one error that can read outside a buffer.
6714 (read_filtered_event): Use duration_to_sec_usec
6715 to do proper overflow checking on durations.
6716 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6717 in size calculation.
6718 (Fexecute_kbd_macro):
6719 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6720 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6721 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6722 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6723 (set_marker_both, set_marker_restricted_both, marker_position)
6724 (marker_byte_position, Fbuffer_has_markers_at):
6725 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6726 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6727 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6728 It now merely ensures that the menu is large enough, without
6729 necessarily growing it, as this avoids some integer overflow issues.
6730 All callers changed.
6731 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6732 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6733 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6734 Use SAFE_ALLOCA_LISP, not alloca.
6735 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6736 to EMACS_INT. Check that fixnums are in proper range for system types.
6737 * minibuf.c (minibuf_prompt_width, string_to_object)
6738 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6739 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6740 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6741 (get_minibuffer, read_minibuf_unwind):
6742 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6743 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6744 this simplifies overflow checking. All callers changed.
6745 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6746 (Ftest_completion):
6747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6748 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6749 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6750 Check that fixnums are in proper range for system types.
6751 (Fx_create_frame, Fx_show_tip):
6752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6753 * nsfont.m (ns_findfonts, nsfont_list_family):
6754 Don't assume fixnum fits in long.
6755 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6756 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6757 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6758 wide enough.
6759 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6761 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6762 (PRINTDECLARE, PRINTPREPARE):
6763 (strout, print_string):
6764 (print, print_preprocess, print_check_string_charset_prop)
6765 (print_object):
6766 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6767 (PRINTDECLARE):
6768 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6770 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6771 (printchar, strout): Use xpalloc to catch size calculation overflow.
6772 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6773 (print_error_message): Use SAFE_ALLOCA, not alloca.
6774 (print_object): Use int, not EMACS_INT, where int is wide enough.
6775 (print_depth, new_backquote_output, print_number_index):
6776 Use ptrdiff_t, not int, where int might not be wide enough.
6777 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6778 (Fset_process_window_size, Fformat_network_address)
6779 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6780 (sigchld_handler):
6781 Check that fixnums are in proper range for system types.
6782 (Fsignal_process): Simplify by avoiding a goto.
6783 Check for process-ids out of pid_t range rather than relying on
6784 undefined behavior.
6785 (process_tick, update_tick): Use EMACS_INT, not int.
6786 (Fformat_network_address, read_process_output, send_process)
6787 (Fprocess_send_region, status_notify):
6788 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6789 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6790 (wait_reading_process_output, read_process_output, exec_sentinel):
6791 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6792 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6793 (Faccept_process_output): Use duration_to_sec_usec to do proper
6794 overflow checking on durations.
6795 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6796 Don't assume pid_t fits in int.
6797 * process.h (struct Lisp_Process): Members tick and update_tick
6798 are now of type EMACS_INT, not int.
6799 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6800 configured --with-wide-int.
6801 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6802 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6803 * search.c (looking_at_1, string_match_1):
6804 (fast_string_match, fast_c_string_match_ignore_case)
6805 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6806 (scan_newline, find_before_next_newline, search_command)
6807 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6808 (set_search_regs, wordify):
6809 (Freplace_match):
6810 (Fmatch_data):
6811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6812 (string_match_1, search_buffer, set_search_regs):
6813 (Fmatch_data):
6814 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6815 (wordify): Check for overflow in size calculation.
6816 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6817 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6818 Check that fixnums are in proper range for system types.
6819 * sound.c (struct sound_device)
6820 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6822 (Fplay_sound_internal):
6823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6824 * syntax.c (struct lisp_parse_state, find_start_modiff)
6825 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6826 (Fparse_partial_sexp):
6827 Don't assume fixnums can fit in int.
6828 (struct lisp_parse_state, find_start_pos, find_start_value)
6829 (find_start_value_byte, find_start_begv)
6830 (update_syntax_table, char_quoted, dec_bytepos)
6831 (find_defun_start, prev_char_comend_first, back_comment):
6832 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6833 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6835 (Finternal_describe_syntax_value): Check that match_lisp is a
6836 character, not an integer, since the code stuffs it into int.
6837 (scan_words, scan_sexps_forward):
6838 Check that fixnums are in proper range for system types.
6839 (Fforward_word):
6840 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6841 (scan_sexps_forward):
6842 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6843 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6844 * syntax.h: Adjust decls to match defn changes elsewhere.
6845 (struct gl_state_s):
6846 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6847 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6848 MOST_POSITIVE_FIXNUM.
6849 * sysdep.c (wait_for_termination_1, wait_for_termination)
6850 (interruptible_wait_for_termination, mkdir):
6851 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6852 (emacs_read, emacs_write):
6853 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6854 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6855 and double all fit in int.
6856 * term.c (set_tty_color_mode):
6857 Check that fixnums are in proper range for system types.
6858 * termhooks.h (struct input_event):
6859 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6860 * textprop.c (validate_interval_range, interval_of)
6861 (Fadd_text_properties, set_text_properties_1)
6862 (Fremove_text_properties, Fremove_list_of_text_properties)
6863 (Ftext_property_any, Ftext_property_not_all)
6864 (copy_text_properties, text_property_list, extend_property_ranges)
6865 (verify_interval_modification):
6866 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6867 (Fnext_single_char_property_change)
6868 (Fprevious_single_char_property_change):
6869 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6870 (copy_text_properties):
6871 Check for integer overflow in index calculation.
6872 * undo.c (last_boundary_position, record_point, record_insert)
6873 (record_delete, record_marker_adjustment, record_change)
6874 (record_property_change):
6875 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6876 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6877 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6878 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6879 (Fx_hide_tip, Fx_file_dialog):
6880 * w32menu.c (set_frame_menubar):
6881 Use ptrdiff_t, not int, for consistency with rest of code.
6882 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6883 (select_window, Fdelete_other_windows_internal)
6884 (window_scroll_pixel_based, window_scroll_line_based)
6885 (Frecenter, Fset_window_configuration):
6886 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6887 (Fset_window_hscroll, run_window_configuration_change_hook)
6888 (set_window_buffer, temp_output_buffer_show, scroll_command)
6889 (Fscroll_other_window, Frecenter):
6890 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6891 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6892 Don't assume fixnum fits in int.
6893 (Fset_window_scroll_bars):
6894 Check that fixnums are in proper range for system types.
6895 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6896 (string_pos, c_string_pos, number_of_chars, init_iterator)
6897 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6898 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6899 (compute_display_string_end, handle_face_prop)
6900 (face_before_or_after_it_pos, handle_invisible_prop)
6901 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6902 (display_prop_intangible_p, string_buffer_position_lim)
6903 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6904 (get_overlay_strings_1, get_overlay_strings)
6905 (iterate_out_of_display_property, forward_to_next_line_start)
6906 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6907 (get_next_display_element, set_iterator_to_next)
6908 (get_visually_first_element, compute_stop_pos_backwards)
6909 (handle_stop_backwards, next_element_from_buffer)
6910 (move_it_in_display_line_to, move_it_in_display_line)
6911 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6912 (add_to_log, message_dolog, message_log_check_duplicate)
6913 (message2, message2_nolog, message3, message3_nolog
6914 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6915 (current_message_1, truncate_echo_area, truncate_message_1)
6916 (set_message, set_message_1, store_mode_line_noprop)
6917 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6918 (text_outside_line_unchanged_p, check_point_in_composition)
6919 (reconsider_clip_changes)
6920 (redisplay_internal, set_cursor_from_row, try_scrolling)
6921 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6922 (redisplay_window, find_last_unchanged_at_beg_row)
6923 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6924 (trailing_whitespace_p, find_row_edges, display_line)
6925 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6926 (display_mode_element, store_mode_line_string)
6927 (pint2str, pint2hrstr, decode_mode_spec)
6928 (display_count_lines, display_string, draw_glyphs)
6929 (x_produce_glyphs, x_insert_glyphs)
6930 (rows_from_pos_range, mouse_face_from_buffer_pos)
6931 (fast_find_string_pos, mouse_face_from_string_pos)
6932 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6934 (safe_call, init_from_display_pos, handle_fontified_prop)
6935 (handle_single_display_spec, load_overlay_strings)
6936 (with_echo_area_buffer, setup_echo_area_for_printing)
6937 (display_echo_area, echo_area_display)
6938 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6939 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6940 (redisplay_window, dump_glyph_row, display_mode_line)
6941 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6942 (handle_display_spec, display_prop_string_p):
6943 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6944 (handle_single_display_spec, build_desired_tool_bar_string)
6945 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6946 (get_specified_cursor_type):
6947 Check that fixnums are in proper range for system types.
6948 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6949 (Flookup_image_map):
6950 Don't assume fixnums fit in int.
6951 (compare_overlay_entries):
6952 Avoid mishandling comparisons due to subtraction overflow.
6953 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6954 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6955 (handle_tool_bar_click):
6956 Use int, not unsigned, since we prefer signed and the signedness
6957 doesn't matter here.
6958 (get_next_display_element, next_element_from_display_vector):
6959 Use int, not EMACS_INT, when int is wide enough.
6960 (start_hourglass): Use duration_to_sec_usec to do proper
6961 overflow checking on durations.
6962 * xfaces.c (Fbitmap_spec_p):
6963 Check that fixnums are in proper range for system types.
6964 (compare_fonts_by_sort_order):
6965 Avoid mishandling comparisons due to subtraction overflow.
6966 (Fx_family_fonts, realize_basic_faces):
6967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6968 (Fx_family_fonts):
6969 Don't assume fixnum fits in int.
6970 Use SAFE_ALLOCA_LISP, not alloca.
6971 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6972 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6973 (face_at_buffer_position, face_for_overlay_string)
6974 (face_at_string_position):
6975 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6976 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6977 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6978 (Fx_show_tip):
6979 Check that fixnums are in proper range for system types.
6980 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6981 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6982 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6983 (Fx_change_window_property): Don't assume fixnums fit in int.
6984 * xfont.c (xfont_chars_supported):
6985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6986 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6987 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6988 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6989 * xml.c (parse_region):
6990 * xrdb.c (magic_file_p):
6991 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6992 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6993 (x_get_local_selection, x_reply_selection_request)
6994 (x_handle_selection_request, wait_for_property_change):
6995 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6996 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6997 short is wide enough.
6998 (x_send_client_event): Don't assume fixnum fits in int.
6999 * xterm.c (x_x_to_emacs_modifiers):
7000 Don't assume EMACS_INT overflows nicely into int.
7001 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7002 may come from Lisp.
7003 (handle_one_xevent): NATNUMP can eval its arg twice.
7004 (x_connection_closed):
7005 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7006 * xterm.h: Adjust decls to match defn changes elsewhere.
7007 (struct scroll_bar): Use struct vectorlike_header
7008 rather than rolling our own approximation.
7009 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7010
7011 2012-05-25 Glenn Morris <rgm@gnu.org>
7012
7013 * lisp.mk (lisp): Update for more files being compiled now.
7014
7015 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7016
7017 * lread.c: Remove `read_pure' which makes no difference.
7018 (read_pure): Remove var.
7019 (unreadpure): Remove function.
7020 (readevalloop): Don't call read_list with -1 flag.
7021 (read1, read_vector): Don't test read_pure any more.
7022 (read_list): Simplify.
7023
7024 * fileio.c, character.h: Minor style tweaks.
7025
7026 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7027
7028 * window.h (clip_changed): Remove useless declaration.
7029
7030 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7031
7032 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7033 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7034
7035 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7036
7037 Remove src/m/*.
7038 This directory predates autoconf and is no longer needed nowadays.
7039 Move its few remaining bits of functionality to where they're needed.
7040 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7041 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7042 * m/template.h: Remove.
7043 * Makefile.in (M_FILE): Remove. All uses removed.
7044 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7045 * lisp.h (USE_LSB_TAG):
7046 * mem-limits.h (EXCEEDS_LISP_PTR):
7047 Use VAL_MAX, not VALBITS, in #if.
7048 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7049 (EMACS_UINT): Define unconditionally now.
7050 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7051 (BITS_PER_EMACS_INT): New constants, replacing
7052 what used to be in config.h, but not useful in #if.
7053 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7054 define them any more.
7055 (VAL_MAX): New macro.
7056 (VALMASK): Use it.
7057 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7058 BITS_PER_EMACS_INT, in #if.
7059 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7060 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7061 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7062 * s/ms-w32.h (DATA_START):
7063 Move here from removed file m/intel386.h.
7064 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7065 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7066
7067 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7068
7069 Assume C89 or later.
7070 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7071 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7072 (xrealloc):
7073 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7074 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7075 * textprop.c, tparam.c (NULL): Remove.
7076 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7077 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7078 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7079 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7080 * xterm.c (input_signal_count): Assume volatile works.
7081
7082 2012-05-21 Ken Brown <kbrown@cornell.edu>
7083
7084 * xgselect.c (xg_select): Fix first argument in call to 'select'
7085 (bug#11508).
7086
7087 2012-05-20 Ken Brown <kbrown@cornell.edu>
7088
7089 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7090 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7091
7092 2012-05-19 Ken Brown <kbrown@cornell.edu>
7093
7094 * xfns.c (x_in_use): Remove `static' qualifier.
7095 * xterm.h (x_in_use): Declare.
7096 * xgselect.c: Include xterm.h.
7097 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7098 and `display_arg' (bug#9754).
7099
7100 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7101
7102 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7103
7104 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7105 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7106
7107 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7108
7109 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7110
7111 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7112 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7113
7114 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7115 reference to image_cache->refcount.
7116 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7117
7118 2012-05-17 Juri Linkov <juri@jurta.org>
7119
7120 * search.c (Fword_search_regexp, Fword_search_backward)
7121 (Fword_search_forward, Fword_search_backward_lax)
7122 (Fword_search_forward_lax): Move functions to isearch.el
7123 (bug#10145, bug#11381).
7124
7125 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7126
7127 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7128
7129 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7130
7131 * lread.c (init_obarray): Declare Qt and Qnil as special.
7132
7133 2012-05-14 Glenn Morris <rgm@gnu.org>
7134
7135 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7136 Put "libexec" before "bin", for the sake of init_callproc_1.
7137
7138 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7139
7140 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7141
7142 * unexaix.c: Port to more-recent AIX compilers.
7143 (report_error, report_error_1, make_hdr, copy_sym)
7144 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7145 Make arguments const char *, not char *, to avoid violations of C
7146 standard and to fix some AIX warnings reported by Gilles Pion.
7147
7148 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7149
7150 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7151 already have overlays loaded.
7152 (handle_single_display_spec): Before returning without displaying
7153 fringe bitmap, synchronize the bidi iterator with the main display
7154 iterator, by calling iterate_out_of_display_property.
7155 (iterate_out_of_display_property): Detect buffer iteration by
7156 testing that it->string is a Lisp string.
7157 (get_next_display_element): When the current object is exhausted,
7158 and there's something on it->stack, call set_iterator_to_next to
7159 proceed with what's on the stack, instead of returning zero.
7160 (set_iterator_to_next): If called at the end of a Lisp string,
7161 proceed to consider_string_end without incrementing string
7162 position. Don't increment display vector index past the end of
7163 the display vector. (Bug#11417)
7164 (pos_visible_p): Don't report a position visible when move_it_to
7165 stopped at the last line of window, which happens to be scanned
7166 backwards by the bidi iteration. (Bug#11464)
7167
7168 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7169
7170 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7171 and right-margin display specs even if the spec is invalid or we
7172 are on a TTY, and thus unable to display on the fringes.
7173 That's because the text with the property will not be displayed anyway,
7174 so we need to signal to the caller that this is a "replacing"
7175 display spec. This fixes display when the spec is invalid or we
7176 are on a TTY.
7177
7178 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 * unexaix.c (make_hdr): Fix typo in prototype.
7181 This bug broke the build on AIX. Problem reported by Gilles Pion.
7182
7183 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7184
7185 * keyboard.c (kbd_buffer_get_event): Read special events also in
7186 batch mode. (Bug#11415)
7187
7188 2012-05-12 Glenn Morris <rgm@gnu.org>
7189
7190 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7191
7192 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7193
7194 * lisp.mk (lisp): Add newcomment.elc.
7195
7196 2012-05-12 Glenn Morris <rgm@gnu.org>
7197
7198 * Makefile.in (MKDIR_P): New, set by configure.
7199 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7200
7201 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7202
7203 Remove unused function hourglass_started.
7204 * dispextern.h (hourglass_started):
7205 * w32fns.c (hourglass_started):
7206 * xdisp.c (hourglass_started): Remove.
7207
7208 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7209
7210 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7211 Update dependencies.
7212
7213 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7214
7215 * xgselect.c (xg_select): Put maxfds+1 into a var.
7216 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7217
7218 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7219
7220 2012-05-10 Dave Abrahams <dave@boostpro.com>
7221
7222 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7223 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7224
7225 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7226
7227 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7228 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7229 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7230 Initialize xd_registered_buses.
7231
7232 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7233
7234 Untag more efficiently if USE_LSB_TAG.
7235 This is based on a proposal by YAMAMOTO Mitsuharu in
7236 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7237 For an admittedly artificial (nth 8000 longlist) benchmark on
7238 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7239 Emacs's overall text size by 1%.
7240 * lisp.h (XUNTAG): New macro.
7241 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7242 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7243 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7244 * eval.c (Fautoload):
7245 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7246 * frame.h (XFRAME): Use XUNTAG.
7247
7248 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7249 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7250 Remove unportable assumptions about print widths of types like
7251 dbus_uint32_t.
7252 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7253 intptr_t when converting between pointer and integer, to avoid GCC
7254 warnings about wrong width.
7255
7256 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7257
7258 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7259 stack for each reader_thread, instead of defaulting to 8MB
7260 determined by the linker. This avoids failures in creating
7261 subprocesses on Windows 7, see the discussion in this thread:
7262 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7263
7264 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7265
7266 Fix up display of the *Minibuf-0* buffer in the mini window.
7267 * keyboard.c (read_char): Don't clear the echo area if there's no
7268 message to clear.
7269 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7270 contents of *Minibuf-0*) if there's no message displayed in its stead.
7271
7272 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7273
7274 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7275 batch mode.
7276
7277 2012-05-06 Chong Yidong <cyd@gnu.org>
7278
7279 * lisp.mk (lisp): Update.
7280
7281 2012-05-05 Jim Meyering <meyering@redhat.com>
7282
7283 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7284
7285 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7286
7287 * data.c (PUT_ERROR): New macro.
7288 (syms_of_data): Use it. Add new error type `user-error'.
7289 * undo.c (user_error): New function.
7290 (Fprimitive_undo): Use it.
7291 * print.c (print_error_message): Adjust print style for `user-error'.
7292 * keyboard.c (user_error): New function.
7293 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7294
7295 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7296
7297 Do not limit current-time-string to years 1000..9999.
7298 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7299 (Fcurrent_time_string): Support any year that is supported by the
7300 underlying localtime representation. Don't use asctime, as it
7301 has undefined behavior for years outside the range -999..9999.
7302
7303 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7304
7305 Fix race conditions involving setenv, gmtime, localtime, asctime.
7306 Without this fix, interrupts could mess up code that uses these
7307 nonreentrant functions, since setting TZ invalidates existing
7308 tm_zone or tzname values, and since most of these functions return
7309 pointers to static storage.
7310 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7311 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7312 Grow the critical sections to include not just invoking
7313 localtime/gmtime, but also accessing these functions' results
7314 including their tm_zone values if any, and any related TZ setting.
7315 (format_time_string): Last arg is now struct tm *, not struct tm **,
7316 so that the struct tm is saved in the critical section.
7317 All callers changed. Simplify allocation of initial buffer, partly
7318 motivated by the fact that memory allocation needs to be outside
7319 the critical section.
7320
7321 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7322
7323 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7324 with RESET_INTERVAL.
7325
7326 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7327 Remove duplicated buffer name initialization.
7328
7329 2012-05-02 Jim Meyering <jim@meyering.net>
7330
7331 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7332
7333 * xfns.c (x_window): Use xstrdup (Bug#11375).
7334
7335 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7336
7337 * xdisp.c (pos_visible_p): If already at a newline from the
7338 display string before the 'while' loop, don't walk back the glyphs
7339 from it3.glyph_row. Solves assertion violation when the display
7340 string begins with a newline (egg.el). (Bug#11367)
7341
7342 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7343
7344 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7345 Move to simple.el.
7346
7347 2012-05-01 Glenn Morris <rgm@gnu.org>
7348
7349 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7350 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7351 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7352 All were removed before 23.1.
7353
7354 * dispnew.c: Remove HAVE_LIBNCURSES test;
7355 it is always true on relevant platforms.
7356
7357 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7358 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7359
7360 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7361
7362 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7363
7364 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7365 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7366 Remove.
7367
7368 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 Do not avoid creating empty evaporating overlays (Bug#9642).
7371 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7372 That is, do not delete an evaporating overlay if it becomes
7373 empty after its bounds are adjusted to fit within its buffer.
7374 This fix caused other problems, and I'm reverting it until we get
7375 to the bottom of them.
7376
7377 2012-04-27 Chong Yidong <cyd@gnu.org>
7378
7379 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7380
7381 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7382
7383 * xdisp.c (pos_visible_p): If the window start position is beyond
7384 ZV, start the display from buffer beginning. Prevents assertion
7385 violation in init_iterator when the minibuffer window is scrolled
7386 via the scroll bar.
7387
7388 * window.c (window_scroll_pixel_based): Likewise.
7389
7390 2012-04-27 Chong Yidong <cyd@gnu.org>
7391
7392 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7393
7394 2012-04-27 Glenn Morris <rgm@gnu.org>
7395
7396 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7397 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7398
7399 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7400
7401 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7402 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7403
7404 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7405
7406 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7407 display element, check also the underlying string or buffer
7408 character. (Bug#11341)
7409
7410 * w32menu.c: Include w32heap.h.
7411 (add_menu_item): If the call to AppendMenuW (via
7412 unicode_append_menu) fails, disable Unicode menus only if we are
7413 running on Windows 9X/Me.
7414
7415 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7416
7417 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7418 (xgetint): Add missing shift for LSB tags.
7419
7420 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7421
7422 * keyboard.c (read_char): Don't wipe echo area for select window
7423 events: These might get delayed via `mouse-autoselect-window'
7424 (Bug#11304).
7425
7426 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7427
7428 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7429 manipulation of :loaded-from data.
7430
7431 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7432
7433 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7434 now a cons (bug#11311).
7435
7436 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7437
7438 Do not create empty overlays with the evaporate property (Bug#9642).
7439 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7440 if it becomes empty after its bounds are adjusted to fit within
7441 its buffer. Without this fix, in a nonempty buffer (let ((o
7442 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7443 yields an empty overlay that has the evaporate property, which is
7444 not supposed to happen.
7445
7446 Fix minor GTK3 problems found by static checking.
7447 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7448 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7449 (struct _EmacsFixedClass, emacs_fixed_get_type):
7450 Move decls here from emacsgtkfixed.h, since they needn't be public.
7451 (emacs_fixed_get_type): Now static.
7452 (emacs_fixed_class_init): Omit unused local.
7453 (emacs_fixed_child_type): Remove; unused.
7454 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7455 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7456 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7457 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7458 (EMACS_FIXED_GET_CLASS): Remove; unused.
7459 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7460
7461 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7462 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7463
7464 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7465
7466 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7467 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7468 (__malloc_size_t, __malloc_ptrdiff_t):
7469 Remove. All uses removed, replaced by the definiens if needed,
7470 since we can assume C89 or better now.
7471 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7472 (protect_malloc_state, align, get_contiguous_space)
7473 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7474 (malloc_atfork_handler_child, malloc_enable_thread)
7475 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7476 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7477 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7478 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7479 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7480 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7481 Define using prototypes, not old style.
7482 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7483 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7484 (align): Don't assume that signed integer overflow wraps around.
7485 Omit unused local var.
7486 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7487 (_free_internal_nolock, memalign, mallochook, reallochook):
7488 Omit no-longer-needed casts.
7489 (valloc): Use getpagesize, not __getpagesize.
7490 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7491 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7492
7493 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7494
7495 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7496
7497 Move functions from C to Lisp. Make non-blocking method calls
7498 the default. Implement further D-Bus standard interfaces.
7499
7500 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7501 (QCdbus_request_name_allow_replacement)
7502 (QCdbus_request_name_replace_existing)
7503 (QCdbus_request_name_do_not_queue)
7504 (QCdbus_request_name_reply_primary_owner)
7505 (QCdbus_request_name_reply_in_queue)
7506 (QCdbus_request_name_reply_exists)
7507 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7508 (QCdbus_registered_serial, QCdbus_registered_method)
7509 (QCdbus_registered_signal): New Lisp objects.
7510 (XD_DEBUG_MESSAGE): Use sizeof.
7511 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7512 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7513 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7514 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7515 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7516 (xd_signature, xd_append_arg): Allow float for integer types.
7517 (xd_get_connection_references): New function.
7518 (xd_get_connection_address): Rename from xd_initialize.
7519 Return cached address.
7520 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7521 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7522 level.
7523 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7524 Return number of refcounts.
7525 (Fdbus_get_unique_name): Make stronger parameter check.
7526 (Fdbus_message_internal): New defun.
7527 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7528 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7529 (Fdbus_send_signal, Fdbus_register_service)
7530 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7531 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7532 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7533 (Vdbus_compiled_version, Vdbus_runtime_version)
7534 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7535 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7536 (Vdbus_message_type_signal): New defvars.
7537 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7538 Adapt docstring.
7539
7540 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7543 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7544 Do not assume ptrdiff_t is the same width as 'int'.
7545
7546 * alloc.c: Handle unusual debugging option combinations.
7547 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7548 since the two debugging options are incompatible.
7549 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7550 is defined.
7551 (mem_init, mem_insert, mem_insert_fixup):
7552 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7553 (NEED_MEM_INSERT): Remove; no longer needed.
7554
7555 2012-04-22 Leo Liu <sdl.web@gmail.com>
7556
7557 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7558
7559 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7560
7561 * sysdep.c [__FreeBSD__]: Minor cleanups.
7562 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7563 Use Emacs indenting style more consistently. Avoid some casts.
7564 Use 'double' consistently rather than mixing 'float' and 'double'.
7565
7566 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7567
7568 * sysdep.c (list_system_processes, system_process_attributes):
7569 Add implementation for FreeBSD (Bug#5243).
7570
7571 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7572
7573 * lisp.mk (lisp): Update.
7574
7575 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7576
7577 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7578 It is never used otherwise.
7579
7580 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7581
7582 * print.c (print_preprocess): Only check print_depth if print-circle
7583 is nil.
7584 (print_object): Check for cycles even when print-circle is nil and
7585 print-gensym is t, but only check print_depth if print-circle is nil.
7586
7587 2012-04-20 Chong Yidong <cyd@gnu.org>
7588
7589 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7590 set the status to "failed" and ensure that sentinel is run.
7591
7592 2012-04-20 Glenn Morris <rgm@gnu.org>
7593
7594 * process.c (Fset_process_inherit_coding_system_flag)
7595 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7596 (Fmake_network_process, Fmake_serial_process): Doc fix.
7597
7598 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7599
7600 * xdisp.c (string_buffer_position_lim): Limit starting position to
7601 BEGV.
7602 (set_cursor_from_row): If called for a mode-line or header-line
7603 row, return zero immediately.
7604 (try_cursor_movement): If inside continuation line, don't back up
7605 farther than the first row after the header line, if any.
7606 Don't consider the header-line row as "partially visible", even if
7607 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7608
7609 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7610
7611 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7612 (bug#11238).
7613
7614 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7615 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7616
7617 configure: new option --enable-gcc-warnings (Bug#11207)
7618 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7619 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7620 (ALL_CFLAGS): Use new macros rather than old.
7621 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7622 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7623 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7624 -Wunused-result, -Wunused-variable. This should go away once
7625 the Emacs and Gnulib regex code is merged.
7626 (xmalloc, xrealloc): Now static.
7627
7628 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7629
7630 * dired.c (Fsystem_groups): Remove unused local.
7631
7632 2012-04-17 Glenn Morris <rgm@gnu.org>
7633
7634 * dired.c (Fsystem_users): Doc fix.
7635
7636 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7637
7638 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7639 (syms_of_dired): Add them.
7640
7641 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7642
7643 Fix minor alloc.c problems found by static checking.
7644 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7645 New extern decls, to avoid calling undeclared functions.
7646 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7647 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7648 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7649 (NEED_MEM_INSERT): New macro.
7650 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7651 Remove one incorrect comment and fix another.
7652
7653 Fix minor ralloc.c problems found by static checking.
7654 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7655 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7656 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7657 (r_alloc_sbrk): Now static.
7658
7659 Improve ralloc.c interface checking.
7660 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7661 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7662 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7663 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7664 [REL_ALLOC]: ... to here, to check interface.
7665 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7666 Remove decls. This fixes an "It stinks!".
7667
7668 * alloc.c (which_symbols): Fix alignment issue / type clash.
7669
7670 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7671
7672 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7673 (struct Lisp_Misc_Any): Likewise.
7674 (struct Lisp_Free): Likewise.
7675 * alloc.c (union aligned_Lisp_Symbol): Define.
7676 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7677 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7678 (union aligned_Lisp_Misc): Define.
7679 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7680 aligned_Lisp_Misc instead of union Lisp_Misc.
7681 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7682
7683 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7684
7685 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7686 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7687 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7688 * s/netbsd.h, s/sol2-6.h:
7689 Remove definition of GC_MARK_STACK, since the default now works.
7690 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7691 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7692 no longer the default.
7693 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7694
7695 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7696
7697 * lread.c (lisp_file_lexically_bound_p):
7698 Fix hang at ";-*-\n" (bug#11238).
7699
7700 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7701
7702 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7703 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7704
7705 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7706
7707 * nsterm.m (constrainFrameRect): Always constrain when there is only
7708 one screen (Bug#10962).
7709
7710 2012-04-13 Ken Brown <kbrown@cornell.edu>
7711
7712 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7713
7714 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7715
7716 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7717
7718 2012-04-11 Daniel Colascione <dancol@dancol.org>
7719
7720 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7721 against is gone. It's better to use vfork now so that when Cygwin
7722 gains a new, working vfork, we use it automatically (bug#10398).
7723
7724 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7725
7726 * window.c (save_window_save): Obey window-point-insertion-type.
7727
7728 2012-04-11 Glenn Morris <rgm@gnu.org>
7729
7730 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7731
7732 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7733
7734 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7735
7736 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7737
7738 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7739 (force_quit_count): New var.
7740 (handle_interrupt): Use it.
7741
7742 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7743
7744 * w32.c (w32_delayed_load): Record the full path of the library
7745 being loaded (bug#10424).
7746
7747 2012-04-09 Glenn Morris <rgm@gnu.org>
7748
7749 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7750 not just in the obarray, before snarfing them. (Bug#11036)
7751
7752 * Makefile.in ($(leimdir)/leim-list.el):
7753 Pass EMACS rather than BUILT_EMACS.
7754
7755 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7756
7757 * process.c (make_process):
7758 * process.h: Add integer `gnutls_handshakes_tried' member to
7759 process struct.
7760
7761 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7762 Add convenience `GNUTLS_LOG2i' macro.
7763
7764 * gnutls.c (gnutls_log_function2i): Convenience log function.
7765 (emacs_gnutls_read): Use new log functions,
7766 `gnutls_handshakes_tried' process member, and
7767 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7768 attempts per process (connection).
7769
7770 2012-04-09 Chong Yidong <cyd@gnu.org>
7771
7772 * eval.c (Fuser_variable_p, user_variable_p_eh)
7773 (lisp_indirect_variable): Functions deleted.
7774 (Fdefvar): Caller changed.
7775
7776 * callint.c (Finteractive, Fcall_interactively):
7777 * minibuf.c (Fread_variable): Callers changed.
7778
7779 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7780
7781 * xdisp.c (set_cursor_from_row): If the display string appears in
7782 the buffer at position that is closer to point than the position
7783 after the display string, display the cursor on the first glyph of
7784 the display string. Fixes cursor display when a 'display' text
7785 property immediately follows invisible text. (Bug#11094)
7786
7787 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7788
7789 composite.c: use 'double' consistently
7790 * composite.c (get_composition_id): Use 'double' consistently
7791 instead of converting 'float' to 'double' and vice versa; this is
7792 easier to understand and avoids a GCC warning.
7793
7794 2012-04-09 Glenn Morris <rgm@gnu.org>
7795
7796 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7797 preparation for dumping it with emacs. (Bug#4789)
7798 (leimdir): New variable.
7799 ($(leimdir)/leim-list.el): New rule.
7800 (emacs$(EXEEXT)): Depend on leim-list.el.
7801
7802 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7803 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7804 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7805
7806 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7807
7808 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7809 proper alignment.
7810
7811 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7812
7813 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7814 Remove unused local variable.
7815
7816 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7817
7818 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7819 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7820 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7821 objects, as mark_maybe_pointer will catch them otherwise.
7822 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7823 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7824
7825 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7826
7827 Fix typo that broke non-Windows builds.
7828 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7829
7830 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7831
7832 Support building on MS-Windows with libxml2.
7833
7834 * makefile.w32-in (OBJ2): Add xml.$(O).
7835 (GLOBAL_SOURCES): Add xml.c.
7836 ($(BLD)/xml.$(O)): New dependency list.
7837
7838 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7839 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7840 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7841 [!WINDOWSNT]: New macros.
7842 (init_libxml2_functions, libxml2_loaded_p): New functions.
7843 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7844 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7845 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7846 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7847 linked in).
7848 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7849 Call init_libxml2_functions before calling libxml2 functions.
7850 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7851
7852 * emacs.c: Don't include libxml/parser.h.
7853 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7854 xmlCleanupParser directly.
7855
7856 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7857
7858 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7859
7860 * indent.c (Fvertical_motion): If there is a display string at
7861 point, use it.vpos to compute how many lines to backtrack after
7862 move_it_to point. (Bug#11133)
7863
7864 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7865
7866 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7867 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7868 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7869 macros related to unification of CJK characters. For the details,
7870 see the discussion following the message here:
7871 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7872
7873 2012-04-04 Chong Yidong <cyd@gnu.org>
7874
7875 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7876
7877 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7878
7879 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7880 instead of alloca. (Bug#11138)
7881
7882 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7883
7884 * w32menu.c (is_simple_dialog): Properly check lisp types.
7885 (Bug#11141)
7886
7887 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7888
7889 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7890 position we get to after a call to move_it_to fails the
7891 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7892 only if we wind up in a string from display property. (Bug#11063)
7893
7894 * window.c (Fdelete_other_windows_internal): Invalidate the row
7895 and column information about mouse highlight, so that redisplay
7896 restores it after reallocating the glyph matrices. (Bug#7464)
7897
7898 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7899 string comes from a `display' text property, use the buffer
7900 position of that property as if we actually saw that position in
7901 the row's glyphs.
7902 (move_it_by_lines): Remove the assertion that
7903 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7904 violated when there's a before-string at the beginning of a line.
7905 (Bug#11063)
7906
7907 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7908
7909 * xdisp.c (append_space_for_newline): If the default face was
7910 remapped, use the remapped face for the appended newline.
7911 (extend_face_to_end_of_line): Use the remapped default face for
7912 extending the face to the end of the line.
7913 (display_line): Call extend_face_to_end_of_line when the default
7914 face was remapped. (Bug#11068)
7915
7916 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7917
7918 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7919
7920 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7921
7922 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7923
7924 2012-03-27 Glenn Morris <rgm@gnu.org>
7925
7926 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7927 Doc fixes.
7928
7929 2012-03-26 Kenichi Handa <handa@m17n.org>
7930
7931 * dispextern.h (struct glyph): Fix previous change. Change the
7932 bit length of glyphless.ch to 25 (Bug#11082).
7933
7934 2012-03-26 Chong Yidong <cyd@gnu.org>
7935
7936 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7937 (command_loop_1): Use it; inhibit selection update for
7938 handle-select-window too (Bug#8996).
7939
7940 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7941
7942 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7943
7944 2012-03-25 Kenichi Handa <handa@m17n.org>
7945
7946 * dispextern.h (struct glyph): Change the bit length of
7947 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7948
7949 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7950
7951 * s/ms-w32.h (tzname): Include time.h before redirecting to
7952 _tzname. Fixes the MSVC build. (Bug#9960)
7953
7954 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7955
7956 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7957 characters.
7958
7959 * xterm.c (XTread_socket): Only modify handling_signal if
7960 !SYNC_INPUT. (Bug#11080)
7961
7962 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7963
7964 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7965 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7966 when fetching a multibyte character consumes more bytes than
7967 CHAR_BYTES returns, due to unification of CJK characters in
7968 string_char. (Bug#11073)
7969
7970 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7971
7972 * process.c (wait_reading_process_output): Handle pty disconnect
7973 by refraining from sending oneself a SIGCHLD (bug#10933).
7974
7975 2012-03-22 Chong Yidong <cyd@gnu.org>
7976
7977 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7978
7979 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7980 Mark string as coming from a prefix property.
7981 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7982 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7983
7984 2012-03-21 Chong Yidong <cyd@gnu.org>
7985
7986 * xfaces.c (Vface_remapping_alist): Doc fix.
7987
7988 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7989
7990 * w32proc.c (Fw32_set_console_codepage)
7991 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7992 Doc fixes.
7993
7994 2012-03-20 Chong Yidong <cyd@gnu.org>
7995
7996 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7997 to reflect default non-nil value of redisplay-dont-pause.
7998
7999 2012-03-19 Kenichi Handa <handa@m17n.org>
8000
8001 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8002 it fit in a valid range (Bug#11003).
8003
8004 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8005
8006 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8007 that is not from display property, accept the row as a "cursor
8008 row" if one of the string's character has a non-nil `cursor'
8009 property. Fixes cursor positioning when there are newlines in
8010 overlay strings, e.g. in icomplete.el. (Bug#11035)
8011
8012 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8013
8014 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8015
8016 2012-03-12 Chong Yidong <cyd@gnu.org>
8017
8018 * eval.c (inhibit_lisp_code): Rename from
8019 inhibit_window_configuration_change_hook; move from window.c.
8020
8021 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8022 * window.c (run_window_configuration_change_hook)
8023 (syms_of_window): Callers changed.
8024
8025 2012-03-11 Chong Yidong <cyd@gnu.org>
8026
8027 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8028
8029 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8030
8031 2012-03-10 Chong Yidong <cyd@gnu.org>
8032
8033 * frame.c (other_visible_frames): Don't assume the selected frame
8034 is visible (Bug#10955).
8035
8036 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8037
8038 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8039
8040 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8041
8042 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8043 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8044 zero (Bug#10954).
8045
8046 2012-03-03 Glenn Morris <rgm@gnu.org>
8047
8048 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8049
8050 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8051
8052 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8053 position past the first glyph_row that ends at ZV. (Bug#10902)
8054 (redisplay_window, next_element_from_string): Fix typos in
8055 comments.
8056 (redisplay_window): Pass to move_it_vertically the margin in
8057 pixels, not in screen lines.
8058
8059 2012-03-02 Glenn Morris <rgm@gnu.org>
8060
8061 * buffer.c (buffer-list-update-hook): Doc fix.
8062
8063 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8064
8065 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8066 push_it before setting up the iterator for the first overlay
8067 string, even if we have an empty string loaded.
8068 (next_overlay_string): If there's an empty string on the iterator
8069 stack, pop the stack. (Bug#10903)
8070
8071 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8072
8073 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8074 Suggested by Stefan Monnier in
8075 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8076 * alloc.c (widen_to_Lisp_Object): New static function.
8077 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8078 and widening them to Lisp_Objects. This would work even if
8079 USE_LSB_TAG is defined and wide integers are used, which might
8080 happen in a future version of Emacs.
8081
8082 2012-02-25 Chong Yidong <cyd@gnu.org>
8083
8084 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8085 Doc fix.
8086
8087 * xselect.c (Fx_selection_exists_p): Doc fix.
8088 (x_clipboard_manager_save_all): Print an informative message
8089 before saving to clipboard manager.
8090
8091 2012-02-24 Chong Yidong <cyd@gnu.org>
8092
8093 * keyboard.c (process_special_events): Handle all X selection
8094 requests in kbd_buffer, not just the next one (Bug#8869).
8095
8096 2012-02-23 Chong Yidong <cyd@gnu.org>
8097
8098 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8099 call when setting menu-bar-lines and tool-bar-lines parameters.
8100 (unwind_create_frame_1): New helper function.
8101
8102 * window.c (inhibit_window_configuration_change_hook): New var.
8103 (run_window_configuration_change_hook): Obey it.
8104 (syms_of_window): Initialize it.
8105
8106 2012-02-22 Chong Yidong <cyd@gnu.org>
8107
8108 * xterm.c (x_draw_image_relief): Add missing type check for
8109 Vtool_bar_button_margin (Bug#10743).
8110
8111 2012-02-21 Chong Yidong <cyd@gnu.org>
8112
8113 * fileio.c (Vfile_name_handler_alist): Doc fix.
8114
8115 * buffer.c (Fget_file_buffer): Protect against invalid file
8116 handler return value.
8117
8118 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8119
8120 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8121 when computing $valmask.
8122
8123 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8124 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8125 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8126 It's useless in that case, and it can cause problems on hosts
8127 that allocate halves of EMACS_INT values separately.
8128 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8129 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8130 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8131 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8132 it avoids undefined behavior on hosts where shifting right by more
8133 than the word width has undefined behavior.
8134
8135 2012-02-19 Chong Yidong <cyd@gnu.org>
8136
8137 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8138 (Funhandled_file_name_directory, Ffile_name_as_directory)
8139 (Fdirectory_file_name, Fexpand_file_name)
8140 (Fsubstitute_in_file_name): Protect against invalid file handler
8141 return values (Bug#10845).
8142
8143 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8144
8145 * .gdbinit (pitx): Fix incorrect references to fields of the
8146 iterator stack.
8147
8148 2012-02-17 Chong Yidong <cyd@gnu.org>
8149
8150 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8151
8152 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8153
8154 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8155 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8156
8157 2012-02-15 Chong Yidong <cyd@gnu.org>
8158
8159 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8160 marked as special. Also, starting docstrings with * is obsolete.
8161
8162 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8163
8164 * gnutls.c (emacs_gnutls_write): Fix last change.
8165
8166 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8167
8168 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8169 send_process.
8170
8171 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8172
8173 * keymap.c (Fsingle_key_description): Handle char ranges.
8174
8175 2012-02-12 Chong Yidong <cyd@gnu.org>
8176
8177 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8178 as that creates a dangerous corner case.
8179
8180 * window.c (Fdelete_window_internal): Invalidate the mouse
8181 highlight (Bug#9904).
8182
8183 2012-02-12 Glenn Morris <rgm@gnu.org>
8184
8185 * xselect.c (Fx_own_selection_internal)
8186 (Fx_get_selection_internal, Fx_disown_selection_internal)
8187 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8188 * nsselect.m (Fx_own_selection_internal)
8189 (Fx_disown_selection_internal, Fx_selection_exists_p)
8190 (Fx_selection_owner_p, Fx_get_selection_internal):
8191 Sync docs and argument specs with the xselect.c versions.
8192
8193 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8194
8195 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8196
8197 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8198
8199 * w32select.c (Fx_selection_exists_p): Sync doc string and
8200 argument list with xselect.c. (Bug#10783)
8201
8202 * w16select.c (Fx_selection_exists_p): Sync doc string and
8203 argument list with xselect.c. (Bug#10783)
8204
8205 2012-02-10 Glenn Morris <rgm@gnu.org>
8206
8207 * fns.c (Fsecure_hash): Doc fix.
8208
8209 2012-02-09 Kenichi Handa <handa@m17n.org>
8210
8211 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8212
8213 2012-02-07 Chong Yidong <cyd@gnu.org>
8214
8215 * buffer.c (Fbuffer_local_variables)
8216 (buffer_lisp_local_variables): Handle unbound vars correctly;
8217 don't let Qunbound leak into Lisp.
8218
8219 2012-02-07 Glenn Morris <rgm@gnu.org>
8220
8221 * image.c (Fimagemagick_types): Doc fix.
8222
8223 * image.c (imagemagick-render-type): Change it from a lisp object
8224 to an integer. Move the doc here from the lisp manual.
8225 Treat all values not equal to 0 the same.
8226
8227 2012-02-06 Chong Yidong <cyd@gnu.org>
8228
8229 * doc.c (store_function_docstring): Avoid applying docstring of
8230 alias to base function (Bug#2603).
8231
8232 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8233
8234 * .gdbinit (pp1, pv1): Remove redundant defines.
8235 (pr): Use pp.
8236
8237 2012-02-04 Chong Yidong <cyd@gnu.org>
8238
8239 * nsterm.m: Declare a global (Bug#10694).
8240
8241 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8242
8243 * w32.c (get_emacs_configuration_options):
8244 Include --enable-checking, if specified, in the return value.
8245
8246 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8247
8248 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8249 after rounding frame sizes. (Bug#9723)
8250
8251 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8252
8253 * keyboard.c (adjust_point_for_property): Don't position point
8254 before BEGV. (Bug#10696)
8255
8256 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 Handle overflow when computing char display width (Bug#9496).
8259 * character.c (char_width): Return EMACS_INT, not int.
8260 (char_width, c_string_width): Check for overflow when
8261 computing the width; this is possible now that individual
8262 characters can have unbounded width. Problem introduced
8263 by merge from Emacs 23 on 2012-01-19.
8264
8265 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8266
8267 * dbusbind.c (Fdbus_register_method): Mention the return value
8268 :ignore in the docstring.
8269
8270 2012-02-02 Glenn Morris <rgm@gnu.org>
8271
8272 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8273
8274 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8275 Unconditionally set to t. (Bug#10673)
8276 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8277 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8278 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8279
8280 2012-02-02 Kenichi Handa <handa@m17n.org>
8281
8282 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8283 0, do not call append_composite_glyph.
8284
8285 2012-02-02 Kenichi Handa <handa@m17n.org>
8286
8287 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8288 NULL (Bug#6988).
8289 (x_produce_glyphs): If the component of a composition is a null
8290 string, set it->pixel_width to 1 to avoid zero-width glyph.
8291
8292 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8293
8294 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8295 first 2 arguments are identical. This makes inserting large
8296 output from a subprocess an order of magnitude faster on
8297 MS-Windows, where all sbrk'ed memory is always contiguous.
8298
8299 2012-01-31 Glenn Morris <rgm@gnu.org>
8300
8301 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8302 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8303 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8304
8305 2012-01-29 Glenn Morris <rgm@gnu.org>
8306
8307 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8308
8309 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8310
8311 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8312
8313 2012-01-28 Chong Yidong <cyd@gnu.org>
8314
8315 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8316
8317 2012-01-26 Chong Yidong <cyd@gnu.org>
8318
8319 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8320
8321 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8322 repeat counts (Bug#10507).
8323
8324 2012-01-26 Glenn Morris <rgm@gnu.org>
8325
8326 * lread.c (syms_of_lread): Doc fix.
8327
8328 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8329
8330 * coding.c (encode_designation_at_bol): Change return value to
8331 EMACS_INT.
8332
8333 2012-01-25 Chong Yidong <cyd@gnu.org>
8334
8335 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8336
8337 2012-01-21 Chong Yidong <cyd@gnu.org>
8338
8339 * floatfns.c (Fcopysign): Make the second argument non-optional,
8340 since nil is not allowed anyway.
8341
8342 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8343
8344 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8345 (send_process): Likewise.
8346
8347 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8348
8349 * window.c (save_window_save, Fcurrent_window_configuration)
8350 (Vwindow_persistent_parameters): Do not use Qstate.
8351 Rewrite doc-strings.
8352
8353 2012-01-19 Kenichi Handa <handa@m17n.org>
8354
8355 * character.c (char_width): New function.
8356 (Fchar_width, c_string_width, lisp_string_width):
8357 Use char_width (Bug#9496).
8358
8359 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8360
8361 * window.c (Vwindow_persistent_parameters): New variable.
8362 (Fset_window_configuration, save_window_save): Handle persistent
8363 window parameters.
8364
8365 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8366
8367 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8368 thrashing the stack of the thread. (Bug#9087)
8369
8370 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8371
8372 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8373
8374 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8375
8376 * xdisp.c (rows_from_pos_range): Handle the case where the
8377 highlight ends on a newline. (Bug#10464)
8378 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8379 he end column for display of highlight that ends on a newline
8380 before a R2L line.
8381
8382 2012-01-11 Glenn Morris <rgm@gnu.org>
8383
8384 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8385 from load-path also when installation-directory is nil. (Bug#10208)
8386
8387 2012-01-10 Glenn Morris <rgm@gnu.org>
8388
8389 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8390
8391 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8392 Update template values to be closer to their typical values these days.
8393
8394 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8395
8396 * xdisp.c (rows_from_pos_range): Accept additional argument
8397 DISP_STRING, and accept any glyph in a row whose object is that
8398 string as eligible for mouse highlight. Fixes mouse highlight of
8399 display strings from overlays. (Bug#10464)
8400
8401 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8402
8403 emacs: fix an auto-save permissions race condition (Bug#10400)
8404 * fileio.c (auto_saving_dir_umask): New static var.
8405 (Fmake_directory_internal): Use it.
8406 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8407 creating the directory. The old code temporarily assigns
8408 too-generous permissions to the directory.
8409 (do_auto_save_eh): Clear it.
8410 (Fdo_auto_save): Catch all errors, not just file errors, so
8411 that the var is always cleared.
8412
8413 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8414
8415 * search.c (scan_buffer): Pass character positions to
8416 know_region_cache, not byte positions. (Bug#6540)
8417
8418 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8419
8420 * w32.c (sys_rename): Report EXDEV when rename of a directory
8421 fails because the target is on another logical disk. (Bug#10284)
8422
8423 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8424
8425 * xterm.c (x_embed_request_focus): New function.
8426
8427 * xterm.h: Add prototype.
8428
8429 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8430
8431 2012-01-05 Glenn Morris <rgm@gnu.org>
8432
8433 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8434
8435 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8436
8437 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8438 Load gnutls_transport_set_lowat only if GnuTLS version is below
8439 2.11.1.
8440 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8441 GnuTLS versions below 2.11.1.
8442
8443 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8444
8445 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8446 to the doc string advising against its use for altering the way
8447 windows are scrolled.
8448
8449 2011-12-28 Kenichi Handa <handa@m17n.org>
8450
8451 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8452 coding-system ASCII compatible only when it does not produce BOM
8453 on encoding (Bug#10383).
8454
8455 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8456
8457 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8458 can scroll.
8459 (create_and_show_popup_menu): Always use menu_position_func for
8460 Gtk3 (Bug#10361).
8461
8462 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8463
8464 * callint.c (Fcall_interactively): Don't truncate prompt string.
8465
8466 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8467
8468 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8469 property that ends at ZV, so that the bidi iteration could be
8470 resumed from there (after widening). (Bug#10360)
8471
8472 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8473
8474 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8475
8476 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8477
8478 * nsterm.m (x_free_frame_resources):
8479 Release f->output_data.ns->miniimage.
8480 (ns_index_color): Fix indentation. Do not retain
8481 color_table->colors[i].
8482
8483 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8484 before returning.
8485
8486 * nsfns.m (x_set_background_color): Assign return value from
8487 ns_index_color to face-background instead of NSColor*.
8488 (ns_implicitly_set_icon_type): Fix indentation.
8489 Change assignment in for loop to comparison.
8490
8491 * emacs.c (ns_pool): New variable.
8492 (main): Assign ns_pool.
8493 (Fkill_emacs): Call ns_release_autorelease_pool.
8494
8495 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8496 autorelease fdesc, release fdAttrs and tdict.
8497 (ns_get_covering_families): Release charset.
8498 (ns_findfonts): Release NSFontDescriptor created with new.
8499 (ns_uni_to_glyphs): Fix indentation.
8500 (setString): Release attrStr before assigning new value.
8501
8502 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8503
8504 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8505 and NS_IMPL_COCOA.
8506 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8507 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8508
8509 2011-12-18 David Reitter <reitter@cmu.edu>
8510
8511 * nsterm.m (ns_term_init): Subscribe for notifications
8512 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8513 to method trackingNotification in EmacsMenu.
8514
8515 * nsmenu.m (trackingMenu): New variable.
8516 (trackingNotification): New method (from Aquamacs).
8517 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8518 from Aquamacs (Bug#7030).
8519
8520 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8521
8522 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8523 (symbol_to_nsstring): Fix indentation.
8524 (ns_symbol_to_pb): New function.
8525 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8526 (Fns_rotate_cut_buffers_internal): Remove.
8527 (Fns_store_selection_internal): Rename from
8528 Fns_store_cut_buffer_internal.
8529 (ns_get_foreign_selection, Fx_own_selection_internal)
8530 (Fx_disown_selection_internal, Fx_selection_exists_p)
8531 (Fns_get_selection_internal, Fns_store_selection_internal):
8532 Use ns_symbol_to_pb and check if return value is nil.
8533 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8534 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8535 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8536 renamed to Sns_store_selection_internal.
8537 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8538 and remove this function.
8539 (ns_handle_selection_clear): Remove, never used.
8540 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8541 here.
8542
8543 2011-12-17 Ken Brown <kbrown@cornell.edu>
8544
8545 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8546 GID is unknown (Bug#10257).
8547
8548 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8549
8550 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8551 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8552 which caused a build failure on GNU/Linux IA-64. This problem was
8553 introduced by my 2011-10-07 patch.
8554
8555 2011-12-15 Juri Linkov <juri@jurta.org>
8556
8557 * image.c (imagemagick_error): New function. (Bug#10112)
8558 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8559 Use `imagemagick_error' where ImageMagick functions return
8560 `MagickFalse'.
8561 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8562 proper order.
8563
8564 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8565
8566 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8567 fill background (Bug#8992).
8568
8569 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8570
8571 * window.c (Vwindow_combination_resize)
8572 (Vwindow_combination_limit): Use t instead of non-nil in
8573 doc-strings.
8574 (Vrecenter_redisplay): Add first sentence of doc-string on
8575 separate line.
8576 (Frecenter): Fix doc-string typo.
8577
8578 2011-12-11 Kenichi Handa <handa@m17n.org>
8579
8580 * coding.c (Funencodable_char_position): Pay attention to the
8581 buffer text relocation (Bug#9389).
8582
8583 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8584
8585 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8586 gtk_init (Bug#10100).
8587
8588 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8589
8590 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8591 IT->string is nil. (Bug#10263)
8592
8593 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8594
8595 * nsterm.h (x_free_frame_resources): Declare.
8596
8597 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8598 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8599
8600 * nsterm.h (ns_get_defaults_value): Declare.
8601
8602 * nsterm.m (ns_default): Call ns_get_defaults_value.
8603
8604 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8605
8606 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8607 (Bug#10170)
8608
8609 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8610
8611 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8612 that where the value of an _OBJC_* symbol points to is in the .bss
8613 section (Bug#10240).
8614
8615 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8616
8617 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8618 after the loop to call ccl_driver at least once (Bug#8619).
8619
8620 2011-12-08 Kenichi Handa <handa@m17n.org>
8621
8622 * ftfont.c (get_adstyle_property): Fix previous change
8623 (Bug#10233).
8624
8625 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8626
8627 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8628 dirs from the default value of EMACSLOADPATH (bug#10208).
8629
8630 2011-12-07 Glenn Morris <rgm@gnu.org>
8631
8632 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8633 installation and source directories as well. (Bug#10208)
8634
8635 2011-12-06 Chong Yidong <cyd@gnu.org>
8636
8637 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8638
8639 2011-12-06 Glenn Morris <rgm@gnu.org>
8640
8641 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8642 as an error, not just -1. (Bug#10217)
8643
8644 2011-12-05 Chong Yidong <cyd@gnu.org>
8645
8646 * keyboard.c (process_special_events): New function.
8647 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8648
8649 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8650
8651 * coding.c (encode_designation_at_bol): Don't use uninitialized
8652 local variable (Bug#9318).
8653
8654 2011-12-05 Kenichi Handa <handa@m17n.org>
8655
8656 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8657 return Qnil (Bug#8046, Bug#10193).
8658
8659 2011-12-05 Kenichi Handa <handa@m17n.org>
8660
8661 * coding.c (encode_designation_at_bol): New args charbuf_end and
8662 dst. Return the number of produced bytes. Callers changed.
8663 (coding_set_source): Return how many bytes coding->source was
8664 relocated.
8665 (coding_set_destination): Return how many bytes
8666 coding->destination was relocated.
8667 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8668 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8669
8670 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8671
8672 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8673 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8674 macro (Bug#9318).
8675
8676 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8677
8678 The following changes are to fix Bug#9318.
8679
8680 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8681 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8682 (encode_coding_iso_2022, encode_coding_sjis)
8683 (encode_coding_big5, encode_coding_charset): Use the above macros.
8684
8685 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8686
8687 * lisp.h (process_quit_flag): Fix external declaration.
8688
8689 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8690
8691 Don't macro-inline non-performance-critical code.
8692 * eval.c (process_quit_flag): New function.
8693 * lisp.h (QUIT): Use it.
8694
8695 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8696
8697 * nsfns.m (get_geometry_from_preferences): New function.
8698 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8699
8700 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8701
8702 * emacs.c (Qkill_emacs): Define.
8703 (syms_of_emacs): Initialize it.
8704 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8705 Qquit_flag to `kill-emacs' instead.
8706 (quit_throw_to_read_char): Add parameter `from_signal'.
8707 All callers changed. Call Fkill_emacs if requested and safe.
8708 * lisp.h (QUIT): Call Fkill_emacs if requested.
8709
8710 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8711
8712 * widget.c (update_wm_hints): Return if wmshell is null.
8713 (widget_update_wm_size_hints): New function.
8714
8715 * widget.h (widget_update_wm_size_hints): Declare.
8716
8717 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8718 widget_update_wm_size_hints (Bug#10104).
8719
8720 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8721
8722 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8723 before a newline, prepare the bidi iterator for consuming the
8724 newline, and keep the current paragraph direction. (Bug#10183)
8725 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8726
8727 2011-12-02 Juri Linkov <juri@jurta.org>
8728
8729 * search.c (Fword_search_regexp): New Lisp function created from
8730 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8731 (Fword_search_backward, Fword_search_forward)
8732 (Fword_search_backward_lax, Fword_search_forward_lax):
8733 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8734 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8735
8736 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8737
8738 * fileio.c (Finsert_file_contents): Move after-change-function call
8739 to before the "handled:" label, since all "goto handled" appear in
8740 cases where the *-change-functions have already been properly called
8741 (bug#10117).
8742
8743 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8744
8745 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8746 waiting for input. (Bug#10169)
8747
8748 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8749
8750 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8751 verifies glyph row's hash code--we have just reallocated the
8752 glyphs, so their contents can be complete garbage. (Bug#10164)
8753
8754 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8755
8756 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8757
8758 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8759
8760 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8761 attributes are tested _before_ calling verify_row_hash, to protect
8762 against GCC re-ordering of the tests. (Bug#10164)
8763
8764 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8765
8766 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8767
8768 * xterm.c (handle_one_xevent): Only set async_visible and friends
8769 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8770 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8771 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8772
8773 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8774
8775 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8776 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8777 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8778 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8779 All uses changed to use GCPRO1 etc.
8780 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8781 Revert to old implementation (i.e., before 2011-03-11).
8782
8783 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8784
8785 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8786 of scroll runs so as to avoid assigning disabled bogus rows and
8787 unnecessary graphics copy operations.
8788
8789 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8790
8791 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8792 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8793 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8794 (malloc, free, realloc, calloc): Redirect to e_* only when
8795 compiling Emacs.
8796
8797 * lisp.h (GCTYPEBITS): Move before first use.
8798 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8799 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8800 this macro definition.
8801
8802 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8803 _MSC_VER.
8804
8805 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8806
8807 * gtkutil.c (xg_create_frame_widgets):
8808 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8809 present with Gtk+ 2.0.
8810
8811 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8812
8813 * fileio.c (Finsert_file_contents): Undo previous change; see
8814 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8815
8816 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8817
8818 Rename locals to avoid shadowing.
8819 * fileio.c (Finsert_file_contents):
8820 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8821 * process.c (wait_reading_process_output):
8822 Rename inner 'proc' to 'p' to avoid shadowing.
8823 Indent for consistency with usual Emacs style.
8824
8825 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8826
8827 * xdisp.c (redisplay_window): If cursor row is not fully visible
8828 after recentering, and scroll-conservatively is set to a large
8829 number, scroll window by a few more lines to make the cursor fully
8830 visible and out of scroll-margin. (Bug#10105)
8831 (start_display): Don't move to the next line if the display should
8832 start at a newline that is part of a display vector or an overlay
8833 string. (Bug#10119)
8834
8835 2011-11-24 Juri Linkov <juri@jurta.org>
8836
8837 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8838 after the `MagickPingImage' call. (Bug#10112)
8839
8840 2011-11-23 Chong Yidong <cyd@gnu.org>
8841
8842 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8843
8844 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8845
8846 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8847 making another buffer current. (Bug#10114)
8848
8849 2011-11-23 Glenn Morris <rgm@gnu.org>
8850
8851 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8852
8853 2011-11-23 Chong Yidong <cyd@gnu.org>
8854
8855 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8856 using it (Bug#5984).
8857
8858 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8859
8860 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8861 and header-lines, as they don't have one computed for them.
8862 (Bug#10098)
8863
8864 * .gdbinit (prow): Make displayed values more self-explaining.
8865 Add row's hash code.
8866
8867 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8868
8869 * process.c (wait_reading_process_output): Fix asynchrounous
8870 GnuTLS socket handling on some versions of the GnuTLS library.
8871 (wait_reading_process_output): Add comment and URL.
8872
8873 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8874
8875 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8876
8877 2011-11-21 Chong Yidong <cyd@gnu.org>
8878
8879 * window.c (Fnext_window, Fprevious_window): Doc fix.
8880
8881 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8882
8883 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8884
8885 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8886
8887 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8888
8889 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8890
8891 * window.c (Fset_window_combination_limit): Rename argument
8892 STATUS to LIMIT.
8893 (Vwindow_combination_limit): Remove "status" from doc-string.
8894
8895 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8896
8897 * m/ibms390.h: Remove.
8898 * m/ibms390x.h: Don't include "ibms390.h".
8899
8900 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8901
8902 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8903 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8904
8905 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8906
8907 * casetab.c (Fset_case_table):
8908 * charset.c (Fcharset_after): Fix typos.
8909
8910 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8911
8912 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8913 Otherwise, valgrind does not work on some platforms.
8914 Problem reported by Andreas Schwab in
8915 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8916 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8917 is set, removing the need for VIRT_ADDRESS_VARIES.
8918 (PURE_P): Use a more-efficient implementation that needs just one
8919 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8920 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8921 to 4 (xorl, subq, cmpq, setbe).
8922 * alloc.c (pure): Always extern now, since that's the
8923 VIRT_ADDR_VARIES behavior.
8924 (PURE_POINTER_P): Use a single comparison, not two, for
8925 consistency with the new puresize.h.
8926 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8927 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8928 Remove VIRT_ADDR_VARIES no longer needed.
8929
8930 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8931
8932 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8933 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8934 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8935 behave as if the cursor position were at the window margin.
8936
8937 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8938 and the cursor position is out of bounds, behave as if the cursor
8939 position were at the window margin. (Bug#10075)
8940
8941 2011-11-18 Chong Yidong <cyd@gnu.org>
8942
8943 * window.c (Fwindow_combination_limit): Make first argument
8944 non-optional, since it is meaningless for live windows like the
8945 selected window.
8946
8947 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8948
8949 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8950
8951 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8952
8953 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8954 (graft_intervals_into_buffer): Simplify.
8955
8956 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8957
8958 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8959 hash values of the two rows.
8960 (copy_row_except_pointers): Preserve the used[] arrays and the
8961 hash values of the two rows. (Bug#10035)
8962 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8963
8964 * xdisp.c (row_hash): New function, body extracted from
8965 compute_line_metrics.
8966 (compute_line_metrics): Call row_hash, instead of computing the
8967 hash code inline.
8968
8969 * dispnew.c (verify_row_hash): Call row_hash for computing the
8970 hash code of a row, instead of duplicating code from xdisp.c.
8971
8972 * dispextern.h (row_hash): Add prototype.
8973
8974 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8975
8976 * frame.c (delete_frame): Don't delete the terminal when the last
8977 X frame is closed if emacs is built with GTK toolkit.
8978
8979 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8980
8981 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8982
8983 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8984
8985 * window.c (Vwindow_splits): Rename to
8986 Vwindow_combination_resize. Suggested by Juri Linkov.
8987 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8988 of Vwindow_splits.
8989
8990 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8991
8992 * nsfns.m (Fns_font_name):
8993 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8994
8995 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8996
8997 * window.h (window): Rename slot "nest" to "combination_limit".
8998 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8999 (Fset_window_nest): Rename to Fset_window_combination_limit.
9000 (Vwindow_nest): Rename to Vwindow_combination_limit.
9001 (recombine_windows, make_parent_window, make_window)
9002 (Fsplit_window_internal, saved_window)
9003 (Fset_window_configuration, save_window_save): Rename all
9004 occurrences of window_nest to window_combination_limit.
9005
9006 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9007
9008 * image.c (imagemagick_load_image): Fix typo.
9009
9010 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9011
9012 * xdisp.c (display_line): Move the call to
9013 highlight_trailing_whitespace before the call to
9014 compute_line_metrics, since the latter needs to see the final
9015 faces of all the glyphs to compute ROW's hash value.
9016 Fixes assertion violations in row_equal_p. (Bug#10035)
9017
9018 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9019
9020 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9021 just return (bug#10044).
9022
9023 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9024
9025 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9026 with user-defined heap size. Bump the default size of the temacs
9027 heap to 27MB, to avoid memory warning when running temacs.
9028 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9029
9030 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9031 current_matrix and desired_matrix. (Bug#9990)
9032 (verify_row_hash) [XASSERTS]: New function.
9033 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9034 that the hash value of glyph rows is correct.
9035
9036 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9037
9038 * window.h (window): Remove splits slot.
9039 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9040 (Fdelete_other_windows_internal, make_parent_window)
9041 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9042 (Fset_window_configuration, save_window_save): Don't deal with
9043 split status of windows.
9044 (saved_window): Remove splits slot.
9045 (Vwindow_splits): Rewrite doc-string.
9046
9047 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9048
9049 * xfns.c (unwind_create_frame):
9050 * nsfns.m (unwind_create_frame):
9051 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9052 Vframe_list (Bug#9999).
9053
9054 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9055
9056 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9057
9058 2011-11-11 Kenichi Handa <handa@m17n.org>
9059
9060 * callproc.c (Fcall_process): Set the member dst_multibyte of
9061 process_coding.
9062
9063 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9064
9065 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9066 avoid a crash (bug#9496).
9067
9068 2011-11-09 Chong Yidong <cyd@gnu.org>
9069
9070 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9071 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9072
9073 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9074
9075 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9076
9077 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9078
9079 Avoid some portability problems by eschewing 'extern inline' functions.
9080 The trivial performance wins aren't worth the portability hassles; see
9081 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9082 et seq.
9083 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9084 (window_box_width, window_box_left, window_box_left_offset)
9085 (window_box_right, window_box_right_offset): Undo previous change,
9086 by removing the "extern"s.
9087 * intervals.c (adjust_intervals_for_insertion)
9088 (adjust_intervals_for_deletion): Undo previous change,
9089 making these static again.
9090 (offset_intervals, temp_set_point_both, temp_set_point)
9091 (copy_intervals_to_string): No longer inline.
9092 * xdisp.c (window_text_bottom_y, window_box_width)
9093 (window_box_height, window_box_left_offset)
9094 (window_box_right_offset, window_box_left, window_box_right)
9095 (window_box): No longer inline.
9096
9097 2011-11-08 Chong Yidong <cyd@gnu.org>
9098
9099 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9100 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9101 Signal an error if not a live window.
9102 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9103 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9104
9105 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9106
9107 * lisp.h (syms_of_abbrev): Remove declaration.
9108 Reported by CHENG Gao <chenggao@royau.me>.
9109
9110 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9111
9112 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9113 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9114 of temacs in GUI mode.
9115
9116 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9117
9118 * window.h: Declare delete_all_child_windows instead of
9119 delete_all_subwindows.
9120 * window.c (Fwindow_nest, Fset_window_nest)
9121 (Fset_window_new_total, Fset_window_new_normal)
9122 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9123 (delete_all_subwindows): Rename to delete_all_child_windows.
9124 (Fdelete_other_windows_internal, Fset_window_configuration):
9125 Call delete_all_child_windows instead of delete_all_subwindows.
9126 * frame.c (delete_frame): Call delete_all_child_windows instead
9127 of delete_all_subwindows.
9128
9129 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9130
9131 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9132 This is also needed for porting to any host where GC_MARK_STACK is
9133 not GC_MAKE_GCPROS_NOOPS.
9134 (which_symbols): Use it.
9135
9136 2011-11-07 Kenichi Handa <handa@m17n.org>
9137
9138 * coding.c (coding_set_destination): Check coding->src_pos only
9139 when coding->src_object is a buffer (bug#9910).
9140
9141 * process.c (send_process): Set the member src_multibyte of coding
9142 to 0 (bug#9911) when sending a unibyte text.
9143
9144 * callproc.c (Fcall_process): Set the member src_multibyte of
9145 process_coding to 0 (bug#9912).
9146
9147 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9148
9149 * xmenu.c (cleanup_widget_value_tree): New function.
9150 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9151 calling free_menubar_widget_value_tree directly (Bug#9830).
9152
9153 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9154
9155 Fix some portability problems with 'inline'.
9156 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9157 (window_box_width, window_box_left, window_box_left_offset)
9158 (window_box_right, window_box_right_offset): Declare extern.
9159 Otherwise, these inline functions do not conform to C99 and
9160 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9161 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9162 * intervals.c (adjust_intervals_for_insertion)
9163 (adjust_intervals_for_deletion): Now extern, because otherwise the
9164 extern inline functions 'offset_intervals' couldn't refer to it.
9165 (static_offset_intervals): Remove.
9166 (offset_intervals): Rewrite using the old contents of
9167 static_offset_intervals. The old version didn't conform to C99
9168 because an extern inline function contained a reference to an
9169 identifier with static linkage.
9170
9171 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9172
9173 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9174 GC.
9175
9176 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9177
9178 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9179 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9180 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9181 return Qleft_to_right.
9182
9183 2011-11-06 Chong Yidong <cyd@gnu.org>
9184
9185 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9186 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9187 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9188 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9189 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9190 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9191 (Fwindow_vscroll): Doc fix.
9192 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9193 argument, since it makes no sense to pass a live window and for
9194 consistency with window-child.
9195
9196 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9197
9198 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9199 support MSVC.
9200
9201 2011-11-05 Jason Rumney <jasonr@gnu.org>
9202
9203 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9204 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9205 fonts (Bug#6029).
9206 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9207 bitwise arithmetic preventing use of unicode-sip and non-truetype
9208 opentype fonts.
9209
9210 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9211
9212 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9213 "emacs"-only part.
9214
9215 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9216 initialization code to keep similarity to xfns.c after changes
9217 from 2011-11-05.
9218
9219 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9220
9221 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9222 (unwind_create_frame): New function (Bug#9943).
9223 (Fx_create_frame): Restructure code to be more similar to the one in
9224 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9225 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9226 Move terminal->reference_count++ just before making the frame official
9227 (Bug#9943).
9228
9229 * nsterm.m (x_free_frame_resources): New function.
9230 (x_destroy_window): Move code to x_free_frame_resources.
9231
9232 * xfns.c (unwind_create_frame): Fix comment.
9233 (Fx_create_frame, x_create_tip_frame):
9234 Move terminal->reference_count++ just before making the frame
9235 official. Move initialization of image_cache_refcount and
9236 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9237
9238 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9239
9240 Support MSVC build with newer versions of Visual Studio.
9241 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9242 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9243 nt/gmake.defs.
9244
9245 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9246 which are not supported by MSVC.
9247 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9248 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9249 bitfields.
9250 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9251 types in bitfields.
9252 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9253
9254 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9255
9256 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9257
9258 Support MSVC build with newer versions of Visual Studio.
9259 * w32.c: Don't include w32api.h for MSVC.
9260 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9261
9262 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9263 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9264 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9265 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9266 e_* cousins.
9267 (alloca) [_MSC_VER]: Define to _alloca.
9268
9269 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9270
9271 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9272
9273 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9274
9275 * xdisp.c (note_mouse_highlight): If either of
9276 previous/next-single-property-change returns nil, treat that as
9277 the beginning or the end of the buffer. (Bug#9955)
9278
9279 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9280
9281 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9282 label is not null (Bug#9951).
9283 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9284 may be NULL.
9285
9286 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9287
9288 * window.c (Fwindow_body_size): Mention in the doc string that the
9289 return value is in frame's canonical units. (Bug#9949)
9290
9291 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9292
9293 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9294
9295 * w32fns.c (unwind_create_frame): If needed, free the glyph
9296 matrices of the partially constructed frame. (Bug#9943)
9297 * xfns.c (unwind_create_frame): Likewise.
9298
9299 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9300
9301 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9302 Don't stop backward scan on the continuation glyph, even though
9303 its CHARPOS is positive.
9304 (mouse_face_from_buffer_pos, note_mouse_highlight):
9305 Rename cover_string to disp_string.
9306
9307 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9308
9309 * window.c (temp_output_buffer_show): Don't use
9310 Vtemp_buffer_show_specifiers.
9311 (Vtemp_buffer_show_specifiers): Remove unused variable.
9312
9313 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9314
9315 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9316 past the beginning of the current glyph matrix.
9317
9318 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9319
9320 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9321 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9322 HAVE_GTK3 (Bug#9869).
9323
9324 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9325 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9326
9327 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9328
9329 * xterm.c: Declare x_handle_net_wm_state to return int.
9330 (handle_one_xevent): Check if we are iconified but don't have
9331 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9332 (get_current_wm_state): Return non-zero if not hidden,
9333 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9334 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9335 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9336 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9337
9338 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9339
9340 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9341 so that this new function doesn't get optimized away by a
9342 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9343
9344 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9345
9346 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9347
9348 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9349
9350 Fix the `xbytecode' command.
9351 * .gdbinit (xprintbytestr): New command.
9352 (xwhichsymbols): Rename from `which'; all callers changed.
9353 (xbytecode): Print the byte-code string as well.
9354
9355 2011-10-29 Kim Storm <storm@cua.dk>
9356
9357 * alloc.c (which_symbols): New function.
9358
9359 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9360
9361 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9362 line. (Bug#9903)
9363
9364 2011-10-29 Glenn Morris <rgm@gnu.org>
9365
9366 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9367 Not clear what it was for, and it causes various bugs. (Bug#9839)
9368
9369 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9370
9371 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9372 possible random value that matches one of those tested as
9373 condition to clear the mouse face.
9374
9375 2011-10-28 Chong Yidong <cyd@gnu.org>
9376
9377 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9378
9379 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9380
9381 * window.c (make_window): Initialize phys_cursor_on_p.
9382
9383 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9384
9385 * lisp.h (struct Lisp_Symbol): Update comments.
9386
9387 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9388
9389 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9390
9391 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9392
9393 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9394 <oslsachem@gmail.com> for helping to debug this.
9395
9396 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9397 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9398 (g_b_init_get_glyph_outline_w): New static variables.
9399 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9400 (GetGlyphOutlineW_Proc): New typedefs.
9401 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9402 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9403 New functions.
9404 (w32font_open_internal, compute_metrics):
9405 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9406 instead of calling the "wide" APIs directly.
9407
9408 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9409
9410 * w32.h (syms_of_w32font): Add prototype.
9411
9412 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9413
9414 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9415 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9416 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9417 (Fmove_to_window_line): Doc fix.
9418
9419 2011-10-27 Chong Yidong <cyd@gnu.org>
9420
9421 * process.c (make_process): Set gnutls_state to NULL.
9422
9423 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9424 non-NULL, regardless of GNUTLS_INITSTAGE.
9425 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9426 an error. Set process slots as soon as we allocate them.
9427
9428 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9429
9430 2011-10-27 Chong Yidong <cyd@gnu.org>
9431
9432 * gnutls.c (emacs_gnutls_deinit): New function.
9433 Deallocate credentials structures as well as calling gnutls_deinit.
9434 (Fgnutls_deinit, Fgnutls_boot): Use it.
9435
9436 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9437 (deactivate_process): Call emacs_gnutls_deinit.
9438
9439 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9440
9441 * image.c (x_create_x_image_and_pixmap):
9442 * w32.c (sys_rename, w32_delayed_load):
9443 * w32font.c (fill_in_logfont):
9444 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9445
9446 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9447
9448 * w32fns.c (w32_default_color_map): New function,
9449 extracted from Fw32_default_color_map.
9450 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9451
9452 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9453
9454 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9455
9456 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9457
9458 * keyboard.c (test_undefined): New function (bug#9751).
9459 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9460
9461 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9462
9463 * sysdep.c (init_sys_modes): Fix the check for the controlling
9464 terminal (Bug#6649).
9465
9466 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9467
9468 * dispextern.h (struct bidi_it): New member next_en_type.
9469
9470 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9471 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9472 current character, check also for next_en_type being WEAK_EN.
9473 (bidi_resolve_weak): Don't enter the expensive loop if the current
9474 position is before next_en_pos. Record the bidi type of the first
9475 non-ET, non-BN character we find, in addition to its position.
9476 (bidi_level_of_next_char): Invalidate next_en_type when
9477 next_en_pos is over-stepped.
9478
9479 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9480
9481 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9482 * editfns.c: Rewrite current-time-zone so that it invokes
9483 the equivalent of (format-time-string "%Z") to get the time zone name.
9484 This fixes a bug when the time zone name contains characters that
9485 need converting from the system time locale to Emacs internal format.
9486 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9487 that patch fixed format-time-string to do the conversion, but
9488 I forgot to fix current-time-zone.
9489 (format_time_string): New function, containing most of
9490 what Fformat_time_string used to contain.
9491 (Fformat_time_string): Rewrite in terms of format_time_string.
9492 This doesn't change this function's behavior.
9493 (current-time-zone): Rewrite to use format_time_string.
9494 This fixes the bug reported by Michael Schierl in
9495 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9496 Jason Rumney's 2007-06-07 change worked around this bug, but
9497 didn't fix it.
9498 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9499
9500 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9501
9502 * xdisp.c (start_display): If the character at POS is displayed
9503 via a display vector, reset IT->current.dpvec_index to zero.
9504 (try_window_reusing_current_matrix): If a line ends in a display
9505 vector or the next line starts in a display vector, continue
9506 redrawing the window even though the character position of
9507 start_row was reached.
9508 (Bug#9771, part 2)
9509
9510 2011-10-18 Chong Yidong <cyd@gnu.org>
9511
9512 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9513 with nobreak-char-display too.
9514
9515 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9516
9517 Fix part 3 of bug#9771.
9518 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9519 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9520 non-neutral characters if the current character is a paragraph
9521 separator (a.k.a. Newline). This avoids running the same
9522 expensive loop twice, once when we consume the preceding newline
9523 and the other time when the line actually needs to be displayed.
9524 Avoid the loop when we see neutrals on the base embedding level
9525 following a character whose directionality is the same as the
9526 paragraph's. This avoids running the expensive loop when a line
9527 ends in a long sequence of neutrals, like control characters.
9528 Add assertion against STRONG_AL type. Slightly rearrange code
9529 that determines the type of a neutral given the first non-neutral
9530 that follows it.
9531 (bidi_level_of_next_char): Set next_en_pos to zero when
9532 invalidating its info.
9533
9534 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9535
9536 * xdisp.c (push_display_prop): Determine whether to record string
9537 or buffer position by IT->string, not by IT->method. Allow
9538 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9539 (move_it_vertically_backward): Don't look for character position
9540 immediately after the newline when in a continuation line.
9541 (Bug#9771, part 1)
9542
9543 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9544
9545 * window.c (coordinates_in_window): Rewrite and delabelize
9546 vertical border check. (Bug#5357) (Bug#9618)
9547
9548 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9549
9550 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9551 errors in XSetWindowBorder (bug#9310).
9552
9553 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9554
9555 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9556 avoid crash when xmalloc overrun checking is enabled.
9557
9558 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9559
9560 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9561 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9562 cursor motion with <left> and <right> arrow keys.
9563
9564 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9565 some callers set that themselves.
9566
9567 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9568
9569 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9570 display string and the previous row comes from the same string and
9571 is empty. (Bug#9739) (Bug#9738)
9572
9573 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9574
9575 * doc.c (get_doc_string): Encode file name (bug#9735).
9576
9577 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9578
9579 * bidi.c (bidi_level_of_next_char):
9580 * xdisp.c (get_visually_first_element): Remove old incorrect
9581 comments regarding the Unicode Line Separator character.
9582
9583 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9584
9585 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9586
9587 * alloc.c (Fgc_status): Do not access beyond zombies array
9588 boundary if nzombies > MAX_ZOMBIES.
9589 * alloc.c (dump_zombies): Add missing format specifier.
9590
9591 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9592
9593 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9594 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9595
9596 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9597 Some packages use them to denote characters with modifiers.
9598
9599 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9600
9601 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9602 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9603 matching a pp-number. Rename parameter var to var1.
9604
9605 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9606
9607 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9608
9609 2011-10-08 Glenn Morris <rgm@gnu.org>
9610
9611 * callint.c (Fcall_interactively): Give a more explicit error for the
9612 'c' case with a non-character input. (Bug#8479)
9613
9614 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9615
9616 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9617 lines.
9618 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9619 lines that are hscrolled on the left.
9620
9621 * dispnew.c (buffer_posn_from_coords): Account for a possible
9622 presence of header-line. (Bug#4426)
9623
9624 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9625
9626 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9627 Don't advertise functionality which we discourage or doesn't work.
9628
9629 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9630
9631 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9632 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9633 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9634 this makes Emacs dump core during garbage collection on rare
9635 occasions. sizeof is obviously inferior to offsetof here, so
9636 stick with offsetof.
9637 (GC_POINTER_ALIGNMENT): New macro.
9638 (mark_memory): Omit 3rd (offset) arg; caller changed.
9639 Don't assume EMACS_INT alignment is the same as pointer alignment.
9640
9641 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9642
9643 * keyboard.c (read_key_sequence_remapped): New var.
9644 (read_key_sequence): Compute remapping in the right buffer.
9645 (command_loop_1): Use read_key_sequence's remapping directly.
9646
9647 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9648
9649 * dired.c (file_name_completion): Don't expand file name.
9650 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9651 before checking file name handler.
9652
9653 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9654 they've been requested explicitly (bug#9591).
9655
9656 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9657
9658 * keymap.c (Fsingle_key_description): Use make_specified_string
9659 instead of build_string to build string from push_key_description.
9660 (Bug#5193)
9661
9662 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9663
9664 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9665 This fixes a Y2038 bug on 64-bit hosts.
9666 * buffer.c (reset_buffer):
9667 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9668 (Fclear_buffer_auto_save_failure):
9669 Use 0, not -1, to represent an unset failure time, since time_t
9670 might not be signed.
9671
9672 Remove dependency on glibc malloc internals.
9673 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9674 Move back here from lisp.h, but with their new implementations.
9675 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9676 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9677 * charset.c (charset_table_init): New static var.
9678 (syms_of_charset): Use it instead of xmalloc. This removes a
9679 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9680 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9681 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9682 Move back to alloc.c.
9683 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9684 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9685
9686 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9687
9688 * nsterm.m (windowDidResize): Call x_set_window_size only when
9689 ns_in_resize is true. Otherwise set pixelwidth/height and
9690 call change_frame_size (Bug#9628).
9691
9692 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9693
9694 Port --enable-checking=all to Fedora 14 x86-64.
9695 * charset.c (syms_of_charset): Also account for glibc malloc's
9696 internal overhead when calculating the initial malloc maximum.
9697
9698 Port --enable-checking=all to Fedora 14 x86.
9699 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9700 Move to lisp.h.
9701 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9702 (overrun_check_realloc, overrun_check_free):
9703 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9704 That way, xmalloc returns a properly-aligned pointer even if
9705 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9706 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9707 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9708 into account when calculating the initial malloc maximum.
9709 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9710 Move here from alloc.c, so that charset.c can use it too.
9711 Properly align; the old code wasn't right for common 32-bit hosts
9712 when configured with --enable-checking=all.
9713 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9714 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9715
9716 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9717
9718 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9719 use EDOM.
9720
9721 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9722
9723 * xdisp.c (compute_display_string_end): If there's no display
9724 string at CHARPOS, return -1.
9725
9726 * bidi.c (bidi_fetch_char): When compute_display_string_end
9727 returns a negative value, treat the character as a normal
9728 character not covered by a display string. (Bug#9624)
9729
9730 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9731
9732 * lread.c (Fread_from_string): Fix typo in docstring.
9733
9734 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9735
9736 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9737 newline, reseat the iterator instead of bidi-iterating there one
9738 character at a time. (Bug#9610)
9739 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9740 TO_CHARPOS if the bidi iterator is at base embedding level.
9741
9742 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9743
9744 * lread.c (readevalloop): Use correct code for NBSP.
9745 (read1): Likewise. (Bug#9608)
9746
9747 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9748
9749 * dbusbind.c (Fdbus_register_signal): When service is not
9750 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9751
9752 2011-09-25 Glenn Morris <rgm@gnu.org>
9753
9754 * buffer.c (truncate-lines): Doc fix.
9755
9756 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9757
9758 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9759 (Fset_window_next_buffers): Doc fix.
9760
9761 2011-09-24 Glenn Morris <rgm@gnu.org>
9762
9763 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9764
9765 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9766
9767 Fix minor problems found by static checking.
9768 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9769 * indent.c (Fvertical_motion): Fix == vs = typo.
9770
9771 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9772
9773 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9774 Default value is now t. Doc fix.
9775
9776 * indent.c (Fvertical_motion): Compute and apply the overshoot
9777 logic when moving up, not only when moving down. Fix the
9778 confusing name and values of the it_overshoot_expected variable;
9779 logic changes accordingly. (Bug#9254) (Bug#9549)
9780
9781 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9782 CHARPOS is covered by a display string which includes newlines.
9783 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9784 is covered by a display string with embedded newlines.
9785
9786 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9787
9788 * dbusbind.c (Fdbus_register_signal): Add match rule to
9789 Vdbus_registered_objects_table. (Bug#9581)
9790 (Fdbus_register_method, Vdbus_registered_objects_table):
9791 Fix docstring.
9792
9793 2011-09-24 Jim Meyering <meyering@redhat.com>
9794
9795 do not ignore write error for any output size
9796 The previous change was incomplete.
9797 While it makes emacs --batch detect the vast majority of stdout
9798 write failures, errors were still ignored whenever the output size is
9799 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9800 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9801 && echo FAIL: ignored write error
9802 FAIL: ignored write error
9803 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9804 && echo FAIL: ignored write error
9805 FAIL: ignored write error
9806 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9807
9808 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9809
9810 * emacs.c (Fkill_emacs): In noninteractive mode exit
9811 non-successfully if a write error occurred on stdout. (Bug#9574)
9812
9813 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9814
9815 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9816 the xassert test.
9817
9818 * dispextern.h (struct it): Update the comment documenting what
9819 can it->OBJECT be.
9820
9821 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9822
9823 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9824 a display string, extend search for cursor position to end of row.
9825 (find_row_edges): If the row ends in a newline from a display
9826 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9827 Handle the case of a display string with multiple newlines.
9828 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9829 non-empty line. Fixes confusing cursor motion with arrow keys at
9830 the beginning of a line that starts with whitespace.
9831
9832 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9833
9834 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9835 (bug#9493).
9836
9837 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9838
9839 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9840 boolean (Bug#9154).
9841
9842 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9843
9844 * xdisp.c (display_line): Record maximum and minimum buffer
9845 positions even if no glyphs were produced (e.g., by a zero-width
9846 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9847 buffer positions that will be removed from the glyph row because
9848 they don't fit.
9849 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9850 column is beyond frame width: don't subtract 1 "pixel" when
9851 computing width of the stretch.
9852 (reseat_at_next_visible_line_start): Undo the change made on
9853 2011-09-17 that saved paragraph information and restored it after
9854 the call to `reseat'. (Bug#9545)
9855
9856 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9857
9858 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9859 and turn window cursor on if cleared (Bug#9415).
9860
9861 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9862
9863 * search.c (boyer_moore): Take unibyte characters from pattern
9864 literally. (Bug#9458)
9865
9866 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9867
9868 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9869
9870 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9871
9872 Fix minor problem found by static checking.
9873 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9874 initialized, to pacify gcc -Wuninitialized.
9875
9876 * fileio.c: Report proper errno when syscall falls.
9877 (Finsert_file_contents): Save and restore errno,
9878 so that report_file_error outputs the correct diagnostic.
9879 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9880
9881 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9882
9883 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9884
9885 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9886
9887 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9888 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9889
9890 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9891
9892 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9893 about the current paragraph and restore it after the call to reseat.
9894
9895 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9896 (bidi_find_paragraph_start): Search back for paragraph beginning
9897 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9898 (bidi_move_to_visually_next): Only trigger paragraph-related
9899 computations when the last character is a newline or at EOB, not
9900 just any NEUTRAL_B. (Bug#9470)
9901
9902 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9903 truncated lines if point is covered by a display string. (Bug#9524)
9904
9905 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9906
9907 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9908 (cons_to_x_long): New function.
9909 (lisp_data_to_selection_data): Use it. Correct the test for
9910 short-versus-long data; it was negated. Break out of vector
9911 loop, for efficiency, when a long datum is discovered.
9912
9913 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9914
9915 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9916
9917 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9918
9919 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9920 GCC PR/17406) by declaring this function with external scope.
9921
9922 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9923
9924 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9925 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9926
9927 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9928
9929 * editfns.c (Fformat): Correctly handle text properties on "%%".
9930
9931 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9932
9933 * xterm.c (x_draw_composite_glyph_string_foreground):
9934 * w32term.c (x_draw_composite_glyph_string_foreground):
9935 * term.c (encode_terminal_code):
9936 * composite.c (composition_update_it, get_composition_id):
9937 * xdisp.c (get_next_display_element)
9938 (fill_composite_glyph_string): Add comments about special meaning
9939 of TAB characters in a composition.
9940
9941 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9942
9943 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9944 This occurs when processing a multibyte format.
9945 Problem reported by Wolfgang Jenker.
9946
9947 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9948
9949 * xdisp.c (try_cursor_movement): Only check for exact match if
9950 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9951
9952 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9953
9954 Remove unused external symbols.
9955 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9956 * xdisp.c (calc_pixel_width_or_height): Now static.
9957 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9958 * indent.c (check_display_width):
9959 * w32term.c: Fix comment to match code.
9960 * xterm.c, xterm.h (x_catching_errors): Remove.
9961
9962 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9963
9964 * xselect.c: Use signed conversions more consistently (Bug#9498).
9965 (selection_data_to_lisp_data): Assume incoming selection data are
9966 signed integers, not unsigned. This is to be consistent with
9967 outgoing selection data, which was modified to use signed integers
9968 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9969 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9970 expects long, not unsigned long.
9971
9972 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9973
9974 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9975 computation of loop end. Reported by Johan Bockgård
9976 <bojohan@gnu.org>.
9977
9978 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9979
9980 * frame.c (Fother_visible_frames_p): Function deleted.
9981
9982 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9983
9984 * indent.c (compute_motion): Process display vector front to back
9985 rather than the other way around. (Bug#2496)
9986
9987 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9988
9989 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9990
9991 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9992
9993 * minibuf.c (Fread_from_minibuffer): Doc fix.
9994
9995 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9996
9997 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9998 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9999
10000 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10001
10002 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10003 value for non-existent files.
10004
10005 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10006
10007 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10008 set its "size" to -1. This will set the modtime_size field of
10009 the corresponding buffer to -1, which is what
10010 verify-visited-file-modtime expects for files that do not exist.
10011 (Bug#9139)
10012
10013 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10014
10015 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10016 here ...
10017 * lisp.h: ... from here. push_key_description is no longer
10018 defined in keyboard.c, so its declaration should not be in
10019 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10020 logically belongs with push_key_description.
10021
10022 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10023
10024 * buffer.h: Include <sys/types.h> instead of <time.h>.
10025 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10026 Problem reported by Herbert J. Skuhra.
10027
10028 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10029
10030 * xml.c (parse_region): Make the parsing work for
10031 non-comment-starting XML files again (bug#9144).
10032
10033 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10034
10035 * image.c (gif_load): Fix calculation of bottom and right corner.
10036 (Bug#9468)
10037
10038 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10039
10040 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10041 redisplay in small windows.
10042
10043 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10044
10045 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10046
10047 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10048
10049 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10050 Operate on live windows only.
10051
10052 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10053
10054 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10055
10056 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10057
10058 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10059 only under bidi iteration.
10060
10061 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10062
10063 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10064
10065 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10066
10067 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10068 Without this fix, the command to link temacs failed due to an
10069 undefined symbol __builtin_isnan. This is because
10070 /usr/include/iso/math_c99.h #defines isnan(x) to
10071 __builtin_isnan(x), but the bundled gcc, which identifies itself
10072 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10073 a __builtin_isnan.
10074 * floatfns.c (isnan): #undef, and then #define to a clone of
10075 what's in data.c.
10076 (Fisnan): Always define, since it's always available now.
10077 (syms_of_floatfns): Always define isnan at the Lisp level.
10078
10079 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10080
10081 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10082
10083 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10084
10085 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10086 The previous code assumed that file offsets (off_t values) fit in
10087 EMACS_INT variables, which is not true on typical 32-bit hosts.
10088 The code messed up by falsely reporting buffer overflow in cases
10089 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10090 when "big" contains more than 2**29 bytes, even though this
10091 inserts just one byte and does not overflow the buffer.
10092 (Finsert_file_contents): Store file offsets as off_t
10093 values, not as EMACS_INT values. Check for overflow when
10094 converting between EMACS_INT and off_t. When checking for
10095 buffer overflow or for overlap, take the offsets into account.
10096 Don't use EMACS_INT for small values where int suffices.
10097 When checking for overlap, fix a typo: ZV was used where
10098 ZV_BYTE was intended.
10099 (Fwrite_region): Don't assume off_t fits into 'long'.
10100 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10101
10102 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10103
10104 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10105
10106 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10107
10108 sprintf-related integer and memory overflow issues (Bug#9412).
10109
10110 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10111 (esprintf, exprintf, evxprintf): New functions.
10112 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10113 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10114 (modify_event_symbol): Do not assume that the length of
10115 name_alist_or_stem is safe to alloca and fits in int.
10116 (Fexecute_extended_command): Likewise for function name and binding.
10117 (Frecursion_depth): Wrap around reliably on integer overflow.
10118 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10119 since some callers pass EMACS_INT values.
10120 (Fsingle_key_description): Don't crash if symbol name contains more
10121 than MAX_ALLOCA bytes.
10122 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10123 (get_minibuffer): Arg is now EMACS_INT, not int.
10124 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10125 (esprintf, exprintf, evxprintf): New decls.
10126 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10127
10128 * dbusbind.c (signature_cat): New function.
10129 (xd_signature, Fdbus_register_signal):
10130 Do not overrun buffer; instead, report string overflow.
10131
10132 * dispnew.c (add_window_display_history): Don't overrun buffer.
10133 Truncate instead; this is OK since it's just a log.
10134
10135 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10136 even if the time zone offset is outlandishly large.
10137 Don't mishandle offset == INT_MIN.
10138
10139 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10140 when creating daemon; the previous buffer-overflow check was incorrect.
10141
10142 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10143 which has the guts of the old verror function.
10144
10145 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10146 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10147
10148 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10149 (font_unparse_xlfd): Don't blindly alloca long strings.
10150 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10151 fits in int, when using sprintf. Use single snprintf to count
10152 length of string rather than counting it via multiple sprintfs;
10153 that's simpler and more reliable.
10154 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10155 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10156 sprintf, in case result does not fit in int.
10157
10158 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10159 (fontset_from_font): Print it.
10160
10161 * frame.c (tty_frame_count): Now printmax_t, not int.
10162 (make_terminal_frame, set_term_frame_name): Print it.
10163 (x_report_frame_params): In X, window IDs are unsigned long,
10164 not signed long, so print them as unsigned.
10165 (validate_x_resource_name): Check for implausibly long names,
10166 and don't assume name length fits in 'int'.
10167 (x_get_resource_string): Don't blindly alloca invocation name;
10168 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10169 not fit in int.
10170
10171 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10172 (xg_check_special_colors, xg_set_geometry):
10173 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10174
10175 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10176 Use esprintf, not sprintf, in case result does not fit in int.
10177
10178 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10179 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10180 it as a large positive number.
10181 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10182 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10183
10184 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10185 in case result does not fit in int.
10186
10187 * print.c (float_to_string): Detect width overflow more reliably.
10188 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10189 buffer overrun. Don't assume list length fits in 'int'. Treat
10190 print length of 0 as 0, not as infinity; to be consistent with other
10191 uses of print length in this function. Don't overflow print length
10192 index. Don't assume hash table size fits in 'long', or that
10193 vectorlike size fits in 'unsigned long'.
10194
10195 * process.c (make_process): Use printmax_t, not int, to format
10196 process-name gensyms.
10197
10198 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10199
10200 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10201 to avoid potential buffer overrun.
10202
10203 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10204 if X resource line is longer than 512 bytes.
10205
10206 * xfns.c (x_window): Make sprintf buffer a bit bigger
10207 to avoid potential buffer overrun.
10208
10209 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10210
10211 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10212
10213 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10214
10215 Integer overflow fixes for scrolling, etc.
10216 Without these, Emacs silently mishandles large integers sometimes.
10217 For example, "C-u 4294967297 M-x recenter" was treated as if
10218 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10219
10220 * xdisp.c (try_window_id): Check Emacs fixnum range before
10221 converting to 'int'.
10222
10223 * window.c (window_scroll_line_based, Frecenter):
10224 Check that an Emacs fixnum is in range before assigning it to 'int'.
10225 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10226 values converted from Emacs fixnums.
10227 (Frecenter): Don't wrap around a line count if it is out of 'int'
10228 range; instead, treat it as an extreme value.
10229 (Fset_window_configuration, compare_window_configurations):
10230 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10231
10232 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10233 that can exceed INT_MAX. Check that EMACS_INT value is in range
10234 before assigning it to the (possibly-narrower) index.
10235 (match_limit): Don't assume that a fixnum can fit in 'int'.
10236
10237 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10238 exceed INT_MAX.
10239
10240 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10241 (Fvertical_motion): Don't wrap around LINES values that don't fit
10242 in 'int'. Instead, treat them as extreme values. This is good
10243 enough for windows, which can't have more than INT_MAX lines anyway.
10244
10245 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10246
10247 * Require libxml/parser.h to avoid compilation warning.
10248
10249 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10250
10251 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10252 since this reportedly can destroy thread storage.
10253
10254 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10255
10256 * syntax.c (find_defun_start): Update all cache variables if
10257 exiting early (Bug#9401).
10258
10259 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10260
10261 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10262
10263 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10264 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10265 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10266
10267 * term.c (tty_append_glyph): New function.
10268 (produce_stretch_glyph): Static function and its prototype deleted.
10269
10270 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10271 Add prototypes.
10272
10273 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10274
10275 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10276 when checking :margin (Bug#9390).
10277 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10278 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10279 so that the name doesn't mislead. All uses changed.
10280
10281 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10282
10283 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10284 set_tty_hooks.
10285
10286 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10287
10288 * xdisp.c (move_it_to): Don't bail out early when reaching
10289 position beyond to_charpos, if we are scanning backwards.
10290 (move_it_vertically_backward): When DY == 0, make sure we get to
10291 the first character in the line after the newline.
10292
10293 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10294
10295 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10296 (ccl_driver): Do not generate an out-of-range pointer.
10297 (Fccl_execute_on_string): Remove unnecessary check for
10298 integer overflow, noted by Stefan Monnier in
10299 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10300 Remove a FIXME that didn't need fixing.
10301 Simplify the newly-introduced buffer reallocation code.
10302
10303 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10304
10305 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10306
10307 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10308
10309 Integer and memory overflow issues (Bug#9196).
10310
10311 * doc.c (get_doc_string): Rework so that
10312 get_doc_string_buffer_size is the actual buffer size, rather than
10313 being 1 less than the actual buffer size; this makes xpalloc more
10314 convenient.
10315
10316 * image.c (x_allocate_bitmap_record, cache_image):
10317 * xselect.c (Fx_register_dnd_atom):
10318 Simplify previous changes by using xpalloc.
10319
10320 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10321 since either will do and ptrdiff_t is convenient with xpalloc.
10322
10323 * charset.c (charset_table_size)
10324 (struct charset_sort_data.priority): Now ptrdiff_t.
10325 (charset_compare): Don't overflow if priorities differ greatly.
10326 (Fsort_charsets): Don't assume list length fits in int.
10327 Check for size-calculation overflow when allocating sort data.
10328 (syms_of_charset): Allocate an initial charset table that is
10329 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10330
10331 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10332
10333 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10334 The actual value is always <= INT_MAX, and leaving it unsigned made
10335 overflow checking harder.
10336
10337 * dispextern.h (struct glyph_matrix.rows_allocated)
10338 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10339 with xpalloc. The values are still always <= INT_MAX.
10340
10341 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10342
10343 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10344 (SAFE_NALLOCA): New macro.
10345
10346 * region-cache.c (struct boundary.pos, find_cache_boundary)
10347 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10348 (set_cache_region, invalidate_region_cache)
10349 (revalidate_region_cache, know_region_cache, region_cache_forward)
10350 (region_cache_backward, pp_cache):
10351 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10352 so that ptrdiff_t * can be passed to xpalloc.
10353 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10354 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10355 (pp_cache): Don't assume cache_len fits in int.
10356 * region-cache.h: Adjust extern decls to match.
10357
10358 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10359 EMACS_INT, since either will do, for xpalloc.
10360
10361 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10362 (xnmalloc, xnrealloc, xpalloc): New functions.
10363
10364 * bidi.c (bidi_shelve_header_size): New constant.
10365 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10366 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10367
10368 * bidi.c (bidi_cache_shrink):
10369 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10370 (overlay_strings):
10371 Don't update size of array until after memory allocation succeeds,
10372 because xmalloc/xrealloc may not return.
10373 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10374 now that we have proper integer overflow checking.
10375 (record_overlay_string, overlay_strings): Catch overflows when
10376 calculating size of overlay_str_buf.
10377
10378 * callproc.c (Fcall_process): Check for size overflow when
10379 calculating size of args2.
10380 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10381 Normally we prefer signed values, but sticking with ptrdiff_t would
10382 require adding more-complicated checks.
10383
10384 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10385 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10386 Redo buffer-overflow calculations to avoid integer overflow.
10387 Add a FIXME comment where memory seems to be over-allocated.
10388
10389 * character.c (Fstring): Check for size-calculation overflow.
10390
10391 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10392 unnecessary integer overflow. Check for size overflow.
10393 (encode_coding_object): Don't update size until xmalloc succeeds.
10394
10395 * composite.c (get_composition_id): Check for overflow in glyph
10396 length calculations.
10397
10398 Integer and memory overflow fixes for display code.
10399 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10400 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10401 (scrolling_window): Check for overflow in size calculations.
10402 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10403 Don't assume glyph table len fits in int.
10404 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10405 (row_table_size): Now ptrdiff_t, not int.
10406 (scrolling_window): Avoid overflow in size calculations.
10407 Don't update size until allocation succeeds.
10408 * fns.c (concat): Check for overflow in size calculations.
10409 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10410 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10411 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10412
10413 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10414 (get_doc_string): Check for size calculation overflow.
10415 Don't update size until allocation succeeds.
10416 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10417 EMACS_INT, where ptrdiff_t will do.
10418 (Fsubstitute_command_keys): Check for string overflow.
10419
10420 * editfns.c (set_time_zone_rule): Don't assume environment length
10421 fits in int.
10422 (message_length): Now ptrdiff_t, not int.
10423 (Fmessage_box): Don't update size until allocation succeeds.
10424 Don't assume message length fits in int.
10425 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10426
10427 * emacs.c (main): Do not reallocate argv, since there is a null at
10428 the end that can be overwritten, and this way there's no need to
10429 worry about size-calculation overflow.
10430 (sort_args): Check for size-calculation overflow.
10431
10432 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10433 alloc succeeds.
10434 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10435
10436 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10437 (x_set_scroll_bar_width, x_figure_window_size):
10438 Check for integer overflow.
10439 (x_set_alpha): Do not assume XINT fits in int.
10440
10441 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10442 This is for the members text_lines, text_cols, total_lines, total_cols,
10443 where the system imposes an 'int' limit.
10444
10445 * fringe.c (Fdefine_fringe_bitmap):
10446 Don't update size until alloc works.
10447
10448 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10449 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10450
10451 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10452 Check for size-calculation overflow.
10453 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10454 do, as we prefer signed integers.
10455 (id_to_widget.max_size, id_to_widget.used)
10456 (xg_store_widget_in_map, xg_remove_widget_from_map)
10457 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10458 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10459 Use and return ptrdiff_t, not int.
10460 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10461 * gtkutil.h: Change prototypes to match the above.
10462
10463 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10464 are duplicate now that they've been promoted to lisp.h.
10465 (x_allocate_bitmap_record, x_alloc_image_color)
10466 (make_image_cache, cache_image, xpm_load):
10467 Don't update size until alloc is done.
10468 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10469 (x_detect_edges):
10470 Check for size calculation overflow.
10471 (ct_colors_allocated_max): New constant.
10472 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10473 overflow.
10474
10475 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10476 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10477 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10478 Use ptrdiff_t, not int, to count maps.
10479 (read_char_minibuf_menu_prompt): Check for overflow in size
10480 calculations. Don't update size until allocation succeeds.
10481 Redo calculations to avoid overflow.
10482 * keyboard.h: Change prototypes to match the above.
10483
10484 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10485 to count maps.
10486 (current_minor_maps): Check for size calculation overflow.
10487 * keymap.h: Change prototypes to match the above.
10488
10489 * lread.c (read1, init_obarray): Don't update size until alloc done.
10490
10491 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10492 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10493
10494 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10495 Now ptrdiff_t, not int.
10496 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10497 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10498
10499 * process.c (Fnetwork_interface_list): Check for overflow
10500 in size calculation.
10501
10502 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10503
10504 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10505 overflow. Don't bother calling xmalloc when xrealloc will do.
10506
10507 * search.c (Freplace_match): Check for size calculation overflow.
10508 (Fset_match_data): Don't assume list lengths fit in 'int'.
10509
10510 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10511 for command line length. Do not attempt to address one before the
10512 beginning of an array, as that's not portable.
10513
10514 * term.c (max_frame_lines): Remove; unused.
10515 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10516 not int.
10517 (encode_terminal_code, calculate_costs): Check for size
10518 calculation overflow.
10519 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10520 table lengths and related sizes. Don't update size until alloc
10521 done. Redo calculations to avoid overflow.
10522 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10523
10524 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10525 subtracting pointers.
10526 (gobble_line): Check for overflow more carefully. Don't update size
10527 until alloc done.
10528
10529 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10530 Don't update size until alloc done.
10531 Redo size calculations to avoid overflow.
10532 Check for size calculation overflow.
10533 (main) [DEBUG]: Fix typo in invoking tparam1.
10534
10535 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10536 Use ptrdiff_t, not int, for sizes.
10537 (store_mode_line_noprop_char): Don't update size until alloc done.
10538
10539 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10540 Use ptrdiff_t, not int, for sizes.
10541 (Finternal_make_lisp_face, cache_face):
10542 Check for size calculation overflow.
10543 (cache_face): Treat size calculation overflows as if they were
10544 memory exhaustion (the usual treatment), rather than aborting.
10545
10546 * xfns.c (x_encode_text, x_set_name_internal)
10547 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10548 sizes, since they can exceed INT_MAX in size. Check for size
10549 calculation overflow.
10550
10551 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10552 (xg_select): Check for size calculation overflow.
10553 Don't update size until alloc done.
10554
10555 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10556 as sprintf is limited to int lengths.
10557
10558 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10559 (X_LONG_MIN): New macros.
10560 Use them to make the following changes clearer.
10561 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10562 This change doesn't affect the value now, but it may help remind
10563 future maintainers not to raise the value too much later.
10564 (SELECTION_QUANTUM): Remove, replacing with ...
10565 (selection_quantum): ... new function, which avoids overflow.
10566 All uses changed.
10567 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10568 assumption that selection length fits in 'int'.
10569 (x_reply_selection_request, x_handle_selection_request)
10570 (x_get_window_property, receive_incremental_selection)
10571 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10572 (lisp_data_to_selection_data, clean_local_selection_data):
10573 Use ptrdiff_t, not int, to record length of selection.
10574 (x_reply_selection_request, x_get_window_property)
10575 (receive_incremental_selection, x_property_data_to_lisp):
10576 Redo calculations to avoid overflow.
10577 (x_reply_selection_request): When sending hint, ceiling it at
10578 X_LONG_MAX rather than relying on wraparound overflow to send
10579 something.
10580 (x_get_window_property, receive_incremental_selection)
10581 (lisp_data_to_selection_data, x_property_data_to_lisp):
10582 Check for size-calculation overflow.
10583 (x_get_window_property, receive_incremental_selection)
10584 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10585 Don't store size until memory allocation succeeds.
10586 (x_get_window_property): Plug memory leak on memory exhaustion.
10587 Don't double-block input; malloc is safe here. Don't assume 2**34
10588 - 4 fits in unsigned long. Add an xassert to check
10589 XGetWindowProperty overflow. Be more careful about overflow
10590 calculations, and distinguish size from memory overflow better.
10591 (receive_incremental_selection): When tracing, don't assume
10592 unsigned int is less than INT_MAX.
10593 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10594 harmful) conversions of unsigned short to int.
10595 (lisp_data_to_selection_data): Don't assume that integers
10596 in the range -65535 through -1 fit in an X unsigned short.
10597 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10598 result parameters unless successful. Rely on cons_to_unsigned
10599 to report problems with elements; the old code wasn't right anyway.
10600 (x_check_property_data): Check for int overflow; we cannot use
10601 a wider type due to X limits.
10602 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10603
10604 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10605
10606 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10607 (x_term_init): Check for size calculation overflow.
10608 (x_color_cells): Don't store size until memory allocation succeeds.
10609 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10610 Don't assume alloca size is less than MAX_ALLOCA.
10611 (x_term_init): Don't assume length fits in int (sprintf is limited
10612 to int size).
10613
10614 Use ptrdiff_t for composition IDs.
10615 * character.c (lisp_string_width):
10616 * composite.c (composition_table_size, n_compositions)
10617 (get_composition_id, composition_gstring_from_id):
10618 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10619 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10620 * window.c (Frecenter):
10621 Use ptrdiff_t, not int, for composition IDs.
10622 * composite.c (get_composition_id): Check for integer overflow.
10623 * composite.h: Adjust prototypes to match the above changes.
10624
10625 Use ptrdiff_t for hash table indexes.
10626 * category.c (hash_get_category_set):
10627 * ccl.c (ccl_driver):
10628 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10629 * coding.c (coding_system_charset_list, detect_coding_system):
10630 * coding.h (struct coding_system.id):
10631 * composite.c (get_composition_id, gstring_lookup_cache):
10632 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10633 * image.c (xpm_get_color_table_h):
10634 * lisp.h (hash_lookup, hash_put):
10635 * minibuf.c (Ftest_completion):
10636 Use ptrdiff_t for hash table indexes, not int (which is too
10637 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10638 32-bit --with-wide-int hosts).
10639
10640 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10641 Add a FIXME comment about memory leaks.
10642 (syms_of_charset): Don't assume xmalloc returns.
10643
10644 Don't assume that stated character widths fit in int.
10645 * character.c (Fchar_width, c_string_width, lisp_string_width):
10646 * character.h (CHAR_WIDTH):
10647 * indent.c (MULTIBYTE_BYTES_WIDTH):
10648 Use sanitize_char_width to avoid undefined and/or bad behavior
10649 with outlandish widths.
10650 * character.h (sanitize_tab_width): Rename from sanitize_width,
10651 now that we have two such functions. All uses changed.
10652 (sanitize_char_width): New inline function.
10653
10654 Don't assume that tab-width fits in int.
10655 * character.h (sanitize_width): New inline function.
10656 (SANE_TAB_WIDTH): New macro.
10657 (ASCII_CHAR_WIDTH): Use it.
10658 * indent.c (sane_tab_width): Remove. All uses replaced by
10659 SANE_TAB_WIDTH (current_buffer).
10660 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10661
10662 * fileio.c: Integer overflow issues with file modes.
10663 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10664
10665 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10666 Remove unreachable code.
10667 (read_hex, load_charset_map_from_file): Check for integer overflow.
10668
10669 * xterm.c: Don't go over XClientMessageEvent limit.
10670 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10671 (x_send_scroll_bar_event): Likewise. Check that the size does not
10672 exceed limits imposed by XClientMessageEvent, as well as the usual
10673 ptrdiff_t and size_t limits.
10674
10675 * keyboard.c: Overflow, signedness and related fixes.
10676 (make_lispy_movement): Use same integer type in forward decl
10677 that is used in the definition.
10678 (read_key_sequence, keyremap_step):
10679 Change bufsize argument back to int, undoing my 2011-03-30 change.
10680 We prefer signed types, and int is wide enough here.
10681 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10682 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10683 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10684 length, not size_t. Use ptrdiff_t for index, not int.
10685 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10686 possibility of integer overflow.
10687
10688 Overflow, signedness and related fixes for images.
10689
10690 * dispextern.h (struct it.stack[0].u.image.image_id)
10691 (struct_it.image_id, struct image.id, struct image_cache.size)
10692 (struct image_cache.used, struct image_cache.ref_count):
10693 * gtkutil.c (update_frame_tool_bar):
10694 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10695 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10696 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10697 * nsmenu.m (update_frame_tool_bar):
10698 * xdisp.c (calc_pixel_width_or_height):
10699 * xfns.c (image_cache_refcount):
10700 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10701 on typical 64-bit hosts.
10702
10703 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10704 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10705 Omit unnecessary casts to int.
10706 (parse_image_spec): Check that integers fall into 'int' range
10707 when the callers expect that.
10708 (image_ascent): Redo ascent calculation to avoid int overflow.
10709 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10710 (lookup_image): Remove unnecessary tests.
10711 (xbm_image_p): Locals are now of int, not EMACS_INT,
10712 since parse_image_check makes sure they fit into int.
10713 (png_load, gif_load, svg_load_image):
10714 Prefer int to unsigned where either will do.
10715 (tiff_handler): New function, combining the cores of the
10716 old tiff_error_handler and tiff_warning_handler.
10717 This function is rewritten to use vsnprintf and thereby avoid
10718 stack buffer overflows. It uses only the features of vsnprintf
10719 that are common to both POSIX and native Microsoft.
10720 (tiff_error_handler, tiff_warning_handler): Use it.
10721 (tiff_load, gif_load, imagemagick_load_image):
10722 Don't assume :index value fits in 'int'.
10723 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10724 (imagemagick_load_image): Check that crop parameters fit into
10725 the integer types that MagickCropImage accepts. Don't assume
10726 Vimagemagick_render_type has a nonnegative value. Don't assume
10727 size_t fits in 'long'.
10728 (gs_load): Use printmax_t to print the widest integers possible.
10729 Check for integer overflow when computing image height and width.
10730
10731 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10732
10733 * xdisp.c (redisplay_window): Don't force window start if point
10734 will be invisible in the resulting window. (Bug#9324)
10735
10736 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10737
10738 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10739 the display spec is of the form `(space ...)'.
10740 (handle_display_spec): Return the value returned by
10741 handle_single_display_spec, not just 1 or zero.
10742 (handle_single_display_spec): If the display spec is of the form
10743 `(space ...)', and specifies display in the text area, return 2
10744 rather than 1.
10745 (try_cursor_movement): Check for the need to scroll more
10746 accurately, and prefer exact match for point under bidi.
10747 Don't advance `row' beyond the last row of the window.
10748
10749 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10750 into disp_prop; all users changed.
10751
10752 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10753 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10754 for the text covered by the display property.
10755
10756 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10757
10758 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10759 Change return value to nil.
10760 (Frecord_buffer): Delete unused function.
10761
10762 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10763
10764 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10765 buffers, return left-to-right.
10766 (set_cursor_from_row): Consider candidate row a win if its glyph
10767 represents a newline and point is on that newline. Fixes cursor
10768 positioning on the newline at EOL of R2L text within L2R
10769 paragraph, and vice versa.
10770 (try_cursor_movement): Check continued rows, in addition to
10771 continuation rows. Fixes unwarranted scroll when point enters a
10772 continued line of R2L text within an L2R paragraph, or vice versa.
10773 (cursor_row_p): Consider the case of point being equal to
10774 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10775 from the end of a short line to the beginning of a continued line
10776 of R2L text within L2R paragraph.
10777 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10778 composed characters.
10779
10780 * bidi.c (bidi_check_type): Use xassert.
10781 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10782 members.
10783
10784 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10785
10786 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10787 a character.
10788
10789 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10790
10791 * nsfont.m (ns_otf_to_script): Fix typo.
10792
10793 2011-08-22 Kenichi Handa <handa@m17n.org>
10794
10795 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10796 extra slot even if the purpose is char-code-property-table.
10797
10798 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10799
10800 * xdisp.c (redisplay_window): When computing centering_position,
10801 account for the height of the header line. (Bug#8874)
10802
10803 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10804 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10805 candidate is selected by the mouse, and that candidate has a
10806 composed character under the mouse.
10807
10808 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10809 coordinates reported by pos-visible-in-window-p for a composed
10810 character in column zero.
10811
10812 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10813
10814 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10815
10816 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10817
10818 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10819 consider it a hit if to_charpos is anywhere in the range of the
10820 composed buffer positions.
10821
10822 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10823
10824 * image.c (gif_load): Don't assume that each subimage has the same
10825 dimensions as the base image. Handle disposal method that is
10826 "undefined" by the gif spec (Bug#9335).
10827
10828 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10829
10830 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10831 (Fcondition_case): Document `debug' symbol in error handler.
10832
10833 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10834
10835 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10836 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10837 from an Org mode buffer to a Speedbar frame.
10838
10839 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10840 a composition, take its buffer position from IT->cmp_it.charpos.
10841 Fixes cursor positioning at the beginning of a line that begins
10842 with a composed character.
10843
10844 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10845
10846 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10847 character bidirectional type, use STRONG_L instead. Fixes crashes
10848 in a buffer produced by `describe-categories'.
10849
10850 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10851 members before the level stack, so they would be saved and
10852 restored when copying iterator state. Fixes incorrect reordering
10853 around TABs covered by display properties.
10854
10855 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10856
10857 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10858
10859 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10860
10861 * eval.c (internal_condition_case, internal_condition_case_1)
10862 (internal_condition_case_2, internal_condition_case_n):
10863 Remove unnecessary aborts (Bug#9081).
10864
10865 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10866
10867 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10868 has no `load' handler, try opening the file locally. (Bug#9311)
10869
10870 2011-08-16 Ken Brown <kbrown@cornell.edu>
10871
10872 * gmalloc.c: Expand comment.
10873
10874 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10875
10876 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10877 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10878
10879 2011-08-16 Ken Brown <kbrown@cornell.edu>
10880
10881 Fix memory allocation problems in Cygwin build (Bug#9273).
10882
10883 * unexcw.c ( __malloc_initialized): Declare external variable.
10884 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10885
10886 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10887 New variables.
10888 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10889 dumped emacs.
10890 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10891 in the static heap.
10892 [CYGWIN] (special_realloc): New function.
10893 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10894 requests to realloc storage in the static heap.
10895
10896 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10897
10898 * bidi.c (bidi_initialize): Remove unused local.
10899
10900 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10901
10902 * bidimirror.h:
10903 * biditype.h: Remove file.
10904 * makefile.w32-in ($(BLD)/bidi.$(O)):
10905 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10906
10907 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10908
10909 * chartab.c: Improve commentary for the uniprop_table API.
10910
10911 * bidi.c (bidi_paragraph_init): Support zero value of
10912 bidi_ignore_explicit_marks_for_paragraph_level.
10913 (bidi_initialize): Use uniprop_table instead of including
10914 biditype.h and bidimirror.h.
10915
10916 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10917 coordinates of the iterator when restoring from ppos_it.
10918 (Bug#9296)
10919
10920 2011-08-14 Kenichi Handa <handa@m17n.org>
10921
10922 * process.c (create_process): Call setup_process_coding_systems
10923 after the pid of the process is set to -1 (Bug#8162).
10924
10925 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10926
10927 * xdisp.c (move_it_in_display_line_to): Don't invoke
10928 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10929 ppos_it. Fixes vertical cursor motion when line beginning is
10930 covered by an image. (Bug#9296)
10931
10932 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10933
10934 * nsterm.h (ns_run_ascript): Declare.
10935 (NSAPP_DATA2_RUNASSCRIPT): Define.
10936
10937 * nsfns.m (as_script, as_result, as_status): New static variables.
10938 (ns_run_ascript): New function.
10939 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10940 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10941 the event loop. Get status from as_status (Bug#7276).
10942
10943 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10944 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10945 the event loop (Bug#7276).
10946
10947 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10948
10949 * gnutls.c (QCgnutls_bootprop_priority)
10950 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10951 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10952 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10953 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10954 (QCgnutls_bootprop_verify_hostname_error)
10955 (QCgnutls_bootprop_callbacks_verify): Rename from
10956 Qgnutls_bootprop_..., all uses changed.
10957
10958 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10959 uses changed.
10960
10961 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10962
10963 * xfaces.c (Qframe_set_background_mode): Now static.
10964 * dispextern.h (Qframe_set_background_mode): Remove decl.
10965
10966 * process.c (Fnetwork_interface_info): Declare local only if needed.
10967
10968 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10969
10970 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10971 (Fnetwork_interface_list): Allocate in increments of bytes instead
10972 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10973 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10974 sockaddr.
10975 (struct ifflag_def): notrailers is smart on OSX.
10976 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10977 Get hardware address with getifaddrs if available.
10978
10979 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10980
10981 * xdisp.c (iterate_out_of_display_property): xassert that
10982 IT->position is set to within IT->object's boundaries. Break from
10983 the loop as soon as EOB is reached; avoids infloops in redisplay
10984 when IT->position is set up wrongly due to some bug.
10985 Set IT->current to match the bidi iterator unconditionally.
10986 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10987 entry. Force push_it to save on the stack the current
10988 buffer/string position, to be restored by pop_it. Fix flags in
10989 the iterator structure wrt the object coming from a display
10990 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10991 properties. (Bug#9284)
10992
10993 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10994
10995 * fontset.c (fontset_get_font_group): Add proper type checks.
10996 (Bug#9172)
10997
10998 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10999
11000 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11001 and LC_VERSION_MIN_MACOSX.
11002 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11003 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11004
11005 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11006
11007 * xdisp.c (forward_to_next_line_start): Allow to use the
11008 no-display-properties-and-no-overlays under bidi display.
11009 Set disp_pos in the bidi iterator to avoid searches for display
11010 properties and overlays.
11011
11012 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11013
11014 * editfns.c (Fset_time_zone_rule): Document relationship with the
11015 setenv function.
11016
11017 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11018 the font entity extracted from the cache (Bug#8109).
11019
11020 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11021
11022 * composite.c (autocmp_chars): Don't reset point. That is done by
11023 restore_point_unwind (Bug#5984).
11024
11025 2011-08-07 Juri Linkov <juri@jurta.org>
11026
11027 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11028 to show the arg `TIME' instead of `TIMEVAL'.
11029
11030 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11031
11032 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11033 display property strides EOL and includes a newline, as in
11034 longlines-mode. (Bug#9254)
11035 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11036 word-wrap under bidirectional display. (Bug#9224)
11037
11038 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11039 is non-zero, even if the data buffer is NULL. Fixes a crash in
11040 vertical-motion with longlines-mode. (Bug#9254)
11041
11042 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11043
11044 * bidi.c <bidi_cache_total_alloc>: Now static.
11045 (bidi_initialize): Initialize bidi_cache_total_alloc.
11046
11047 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11048 cache. (Bug#9221)
11049
11050 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11051 amount allocated this far in `bidi_cache_total_alloc'.
11052 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11053 non-zero, only free the data buffer without restoring the cache
11054 contents. All callers changed.
11055
11056 * dispextern.h (bidi_unshelve_cache): Update prototype.
11057
11058 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11059 (move_it_in_display_line, move_it_to)
11060 (move_it_vertically_backward, move_it_by_lines): Replace the call
11061 to xfree to an equivalent call to bidi_unshelve_cache.
11062 (move_it_in_display_line_to): Fix logic of returning
11063 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11064
11065 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11066
11067 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11068 came from a string character with a `cursor' property. (Bug#9229)
11069
11070 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11071
11072 * Makefile.in (LIB_PTHREAD): New variable.
11073 (LIBES): Add LIB_PTHREAD (Bug#9216).
11074
11075 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11076 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11077
11078 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11079
11080 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11081
11082 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11083
11084 * xterm.c (x_find_topmost_parent): New function.
11085 (x_set_frame_alpha): Find topmost parent window with
11086 x_find_topmost_parent and set the property there also (bug#9181).
11087 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11088
11089 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11090
11091 * callproc.c (Fcall_process): Avoid vfork clobbering
11092 the local vars buffer, coding_systems, current_dir.
11093
11094 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11095
11096 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11097
11098 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11099
11100 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11101 so that it is not optimized away.
11102
11103 * xdisp.c (compute_display_string_pos): Remove unused local.
11104
11105 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11106
11107 Fix slow cursor motion and scrolling in large buffers with
11108 selective display, like Org Mode buffers. (Bug#9218)
11109
11110 * dispextern.h (struct bidi_it): New member disp_prop_p.
11111
11112 * xdisp.c: Remove one-slot cache of display string positions.
11113 (compute_display_string_pos): Accept an additional argument
11114 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11115 for a display string or property. If found, set DISP_PROP_P
11116 non-zero.
11117
11118 * bidi.c (bidi_fetch_char): Accept an additional argument
11119 DISP_PROP_P, and pass it to compute_display_string_pos.
11120 Only handle text covered by a display string if DISP_PROP_P is returned
11121 non-zero. All callers of bidi_fetch_char changed.
11122
11123 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11124
11125 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11126
11127 2010-12-03 Don March <don@ohspite.net>
11128
11129 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11130 last character M-[char] is translated to ESC [char] (bug#7541).
11131
11132 2011-08-02 Kenichi Handa <handa@m17n.org>
11133
11134 * lisp.h (uniprop_table): Extern it.
11135
11136 * chartab.c (uniprop_table): Make it non-static.
11137
11138 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11139
11140 * xdisp.c (forward_to_next_line_start): Accept additional argument
11141 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11142 on the newline.
11143 (reseat_at_next_visible_line_start): Use the bidi iterator state
11144 returned by forward_to_next_line_start to restore the state of
11145 it->bidi_it after backing up to previous newline. (Bug#9212)
11146
11147 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11148
11149 * regex.c (re_comp): Protoize.
11150 (re_exec): Fix return type.
11151 (regexec): Fix type of `ret'. (Bug#9203)
11152
11153 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11154
11155 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11156 This is needed if max-image-size is a floating-point number.
11157
11158 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11159
11160 * print.c (print_object): Print empty symbol as ##.
11161
11162 * lread.c (read1): Read ## as empty symbol.
11163
11164 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11165
11166 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11167 setting frame foreground color (Bug#9175).
11168 (x_set_background_color): Likewise.
11169
11170 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11171 contents (Bug#9176).
11172 (EmacsTooltip -init): Remove bezels and add shadows to
11173 tooltip windows.
11174
11175 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11176 or scroll bar (Bug#8470).
11177
11178 * nsfont.m (nsfont_open): Remove assignment to voffset and
11179 unnecessary vars hshink, expand, hd, full_height, min_height.
11180 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11181
11182 * nsterm.h (nsfont_info): Remove voffset field.
11183
11184 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11185
11186 Implement strike-through and overline on NextStep (Bug#8863).
11187
11188 * nsfont.m (nsfont_open): Use underline position provided by font,
11189 instead of hard-coded value of 2.
11190 (nsfont_draw): Call ns_draw_text_decoration instead.
11191
11192 * nsterm.h: Add declaration for ns_draw_text_decoration.
11193
11194 * nsterm.m (ns_draw_text_decoration): New function for drawing
11195 underline, overline, and strike-through.
11196 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11197 ns_draw_text_decoration. Change treatment of cursor drawing to
11198 accommodate underlining, etc.
11199
11200 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11201
11202 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11203 default.
11204
11205 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11206
11207 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11208 Without this fix, if a signal arrives just after memory fills up,
11209 'malloc' might be invoked reentrantly.
11210
11211 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11212 In other words, assume that every image size is allowed, on non-X
11213 hosts. This assumption is probably wrong, but it lets Emacs compile.
11214
11215 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11216
11217 * regex.c (re_iswctype): Convert return values to boolean.
11218
11219 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11220
11221 * xdisp.c (compute_display_string_pos): Don't use cached display
11222 string position if the buffer had its restriction changed.
11223 (Bug#9184)
11224
11225 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11226
11227 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11228
11229 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11230
11231 Integer signedness and overflow and related fixes. (Bug#9079)
11232
11233 * bidi.c: Integer size and overflow fixes.
11234 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11235 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11236 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11237 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11238 (bidi_find_other_level_edge):
11239 Use ptrdiff_t instead of EMACS_INT where either will do.
11240 This works better on 32-bit hosts configured --with-wide-int.
11241 (bidi_cache_ensure_space): Check for size-calculation overflow.
11242 Use % rather than repeated addition, for better worst-case speed.
11243 Don't set bidi_cache_size until after xrealloc returns, because it
11244 might not return.
11245 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11246 (bidi_cache_ensure_space): Also check that the bidi cache size
11247 does not exceed that of the largest Lisp string or buffer. See Eli
11248 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11249
11250 * alloc.c (__malloc_size_t): Remove.
11251 All uses replaced by size_t. See Andreas Schwab's note
11252 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11253
11254 * image.c: Improve checking for integer overflow.
11255 (check_image_size): Assume that f is nonnull, since
11256 it is always nonnull in practice. This is one less thing to
11257 worry about when checking for integer overflow later.
11258 (x_check_image_size): New function, which checks for integer
11259 overflow issues inside X.
11260 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11261 This removes the need for a memory_full check.
11262 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11263 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11264 (xbm_read_bitmap_data): Change locals back to 'int', since
11265 their values must fit in 'int'.
11266 (xpm_load_image, png_load, tiff_load):
11267 Invoke x_create_x_image_and_pixmap earlier,
11268 to avoid much needless work if the image is too large.
11269 (tiff_load): Treat overly large images as if
11270 x_create_x_image_and_pixmap failed, not as malloc failures.
11271 (gs_load): Use x_check_image_size.
11272
11273 * gtkutil.c: Omit integer casts.
11274 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11275 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11276
11277 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11278
11279 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11280 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11281 would wrongly return t on a 64-bit host.
11282
11283 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11284 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11285 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11286 and therefore cause GCC to emit a bogus diagnostic in some cases.
11287
11288 * image.c: Integer signedness and overflow and related fixes.
11289 This is not an exhaustive set of fixes, but it's time to
11290 record what I've got.
11291 (lookup_pixel_color, check_image_size): Remove redundant decls.
11292 (check_image_size): Don't assume that arbitrary EMACS_INT values
11293 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11294 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11295 (tiff_load, imagemagick_load_image):
11296 Check for overflow in size calculations.
11297 (x_create_x_image_and_pixmap): Remove unnecessary test for
11298 xmalloc returning NULL; that can't happen.
11299 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11300 (xpm_color_bucket): Use better integer hashing function.
11301 (xpm_cache_color): Don't possibly over-allocate memory.
11302 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11303 (gif_memory_source):
11304 Use ptrdiff_t, not int or size_t, to record sizes.
11305 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11306 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11307 either works, as we prefer signed integers.
11308 (tiff_read_from_memory, tiff_write_from_memory):
11309 Return tsize_t, not size_t, since that's what the TIFF API wants.
11310 (tiff_read_from_memory): Don't fail simply because the read would
11311 go past EOF; instead, return a short read.
11312 (tiff_load): Omit no-longer-needed casts.
11313 (Fimagemagick_types): Don't assume size fits into 'int'.
11314
11315 Improve hashing quality when configured --with-wide-int.
11316 * fns.c (hash_string): New function, taken from sxhash_string.
11317 Do not discard information about ASCII character case; this
11318 discarding is no longer needed.
11319 (sxhash-string): Use it. Change sig to match it. Caller changed.
11320 * lisp.h: Declare it.
11321 * lread.c (hash_string): Remove, since we now use fns.c's version.
11322 The fns.c version returns a wider integer if --with-wide-int is
11323 specified, so this should help the quality of the hashing a bit.
11324
11325 * emacs.c: Integer overflow minor fix.
11326 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11327 Define only if GNU_LINUX.
11328 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11329
11330 * dispnew.c: Integer signedness and overflow fixes.
11331 Remove unnecessary forward decls, that were a maintenance hassle.
11332 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11333 All uses changed.
11334 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11335 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11336 (prepare_desired_row, line_draw_cost):
11337 Use int, not unsigned, where either works.
11338 (save_current_matrix, restore_current_matrix):
11339 Use ptrdiff_t, not size_t, where either works.
11340 (init_display): Check for overflow more accurately, and without
11341 relying on undefined behavior.
11342
11343 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11344 Remove, replacing with the new symbols in lisp.h. All uses changed.
11345 * fileio.c (make_temp_name):
11346 * filelock.c (lock_file_1, lock_file):
11347 * xdisp.c (message_dolog):
11348 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11349 Use pMd etc. instead.
11350 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11351 replacing the pWIDE etc. symbols removed from editfns.c.
11352
11353 * keyboard.h (num_input_events): Now uintmax_t.
11354 This is (very slightly) less likely to mess up due to wraparound.
11355 All uses changed.
11356
11357 * buffer.c: Integer signedness fixes.
11358 (alloc_buffer_text, enlarge_buffer_text):
11359 Use ptrdiff_t rather than size_t when either will do, as we prefer
11360 signed integers.
11361
11362 * alloc.c: Integer signedness and overflow fixes.
11363 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11364 (__malloc_size_t): Default to size_t, not to int.
11365 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11366 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11367 Prefer ptrdiff_t to size_t when either would do, as we prefer
11368 signed integers.
11369 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11370 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11371 Now const. Initialize with values that are in range even if char
11372 is signed.
11373 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11374 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11375 These functions do the right thing with sizes > 2**32.
11376 (check_depth): Now ptrdiff_t, not int.
11377 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11378 Adjust to new way of storing sizes. Check for size overflow bugs
11379 in rest of code.
11380 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11381 slightly wrong anyway, as it missed one instance of
11382 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11383 (refill_memory_reserve): Omit needless cast to size_t.
11384 (mark_object_loop_halt): Mark as externally visible.
11385
11386 * xselect.c: Integer signedness and overflow fixes.
11387 (Fx_register_dnd_atom, x_handle_dnd_message):
11388 Use ptrdiff_t, not size_t, since we prefer signed.
11389 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11390 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11391 x_dnd_atoms_size and x_dnd_atoms_length.
11392
11393 * doprnt.c: Prefer signed to unsigned when either works.
11394 * eval.c (verror):
11395 * doprnt.c (doprnt):
11396 * lisp.h (doprnt):
11397 * xdisp.c (vmessage):
11398 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11399 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11400 prefer signed arithmetic to avoid comparison confusion.
11401 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11402 but is a bit tricky.
11403
11404 Assume freestanding C89 headers, string.h, stdlib.h.
11405 * data.c, doprnt.c, floatfns.c, print.c:
11406 Include float.h unconditionally.
11407 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11408 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11409 * regex.c: Likewise for stddef.h, string.h.
11410 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11411 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11412 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11413 (STDC_HEADERS): Remove obsolete defines.
11414 * sysdep.c: Include limits.h unconditionally.
11415
11416 Assume support for memcmp, memcpy, memmove, memset.
11417 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11418 * regex.c (memcmp, memcpy):
11419 Remove; we assume C89 now.
11420
11421 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11422 (__malloc_safe_bcopy): Remove; no longer needed.
11423
11424 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11425 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11426 well either way, and we prefer signed to unsigned.
11427
11428 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11429
11430 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11431 closes the connection while we're reading (bug#9182).
11432
11433 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11434
11435 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11436 are specified (Bug#9168).
11437
11438 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11439
11440 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11441 Found by GCC static checking and --with-wide-int on a 32-bit host.
11442
11443 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11444
11445 * xdisp.c (compute_display_string_pos): Fix logic of caching
11446 previous display string position. Initialize cached_prev_pos to
11447 -1. Fixes slow-down at the beginning of a buffer.
11448
11449 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11450
11451 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11452 for attrs[LFACE_FONTSET_INDEX].
11453
11454 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11455
11456 * xml.c (parse_region): Remove unused local
11457 that was recently introduced.
11458
11459 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11460
11461 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11462 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11463
11464 * xdisp.c (move_it_in_display_line_to): Record the best matching
11465 position for TO_CHARPOS while scanning the line, and restore it on
11466 exit if none of the characters scanned was an exact match.
11467 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11468 when exact match is impossible due to invisible text, and the
11469 lines are truncated.
11470
11471 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11472
11473 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11474 for OSX >= 10.7.
11475
11476 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11477
11478 Fix a significant slow-down of cursor motion with C-n, C-p,
11479 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11480 auto-repeat under bidi redisplay in fontified buffers.
11481 * xdisp.c (compute_stop_pos_backwards): New function.
11482 (next_element_from_buffer): Call compute_stop_pos_backwards to
11483 find a suitable prev_stop when we find ourselves before
11484 base_level_stop.
11485 (reseat): Don't look for prev_stop, as that could mean a very long
11486 run.
11487 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11488 <cached_disp_overlay_modiff>: Cache for last found display string
11489 position.
11490 (compute_display_string_pos): Return the cached position if asked
11491 about the same buffer in the same area of character positions, and
11492 the buffer wasn't changed since the time the display string
11493 position was cached.
11494
11495 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11496
11497 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11498 is an integer, which is important for empty lines. (Bug#9149)
11499
11500 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11501
11502 * frame.c (Fmodify_frame_parameters): In tty case, update the
11503 default face if necessary (Bug#4238).
11504
11505 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11506
11507 * editfns.c (Fstring_to_char): No need to explain what a character
11508 is in the docstring (Bug#6576).
11509
11510 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11511
11512 * xml.c (parse_region): Make sure we always return a tree.
11513
11514 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11515
11516 * xml.c (parse_region): If a document contains only comments,
11517 return that, too.
11518
11519 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11520
11521 * xml.c (make_dom): Return comments, too.
11522
11523 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11524
11525 Port to OpenBSD.
11526 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11527 and the surrounding thread.
11528 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11529 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11530 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11531 timer goes off.
11532 * s/openbsd.h (BROKEN_SIGIO): Define.
11533 * unexelf.c (unexec) [__OpenBSD__]:
11534 Don't update the .mdebug section of the Alpha COFF symbol table.
11535
11536 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11537
11538 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11539 (bug#8460).
11540
11541 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11542
11543 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11544 This fixes some race conditions on the permissions of any newly
11545 created file.
11546
11547 * alloc.c (valid_pointer_p): Use pipe, not open.
11548 This fixes some permissions issues when debugging.
11549
11550 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11551 If fchown fails to set both uid and gid, try to set just gid,
11552 as that is sometimes allowed. Adjust the file's mode to eliminate
11553 setuid or setgid bits that are inappropriate if fchown fails.
11554
11555 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11556
11557 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11558 to compare Lisp_Objects.
11559 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11560 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11561 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11562
11563 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11564
11565 * lread.c (read_integer): Unread even EOF character.
11566 (read1): Likewise. Properly record start position of symbol.
11567
11568 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11569 symbol character follows.
11570
11571 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11572
11573 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11574 This works around a problem with the previous change to Fcopy_file.
11575 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11576 and without this change, GCC might complain about discarding
11577 fchown's return value.
11578
11579 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11580
11581 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11582
11583 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11584
11585 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11586
11587 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11588
11589 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11590 it's used from the C level.
11591
11592 * process.c: Use the same condition for POLL_FOR_INPUT in both
11593 keyboard.c and process.c (bug#1858).
11594
11595 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11596
11597 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11598 (Fgnutls_boot): Use it.
11599
11600 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11601
11602 * doc.c (Fsubstitute_command_keys): Revert last change.
11603
11604 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11605
11606 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11607 quotes the next character, and doesn't affect other longer
11608 sequences (bug#8935).
11609
11610 * lread.c (syms_of_lread): Clarify that is isn't only
11611 `eval-buffer' and `eval-defun' that's affected by
11612 `lexical-binding' (bug#8460).
11613
11614 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11615
11616 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11617 bidi redisplay when a line includes both an image and is truncated.
11618
11619 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11620
11621 Fix minor problems found by static checking.
11622 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11623 (elsz): Now a signed constant, not a size_t var. We prefer signed
11624 types to unsigned, to avoid integer comparison confusion. Without
11625 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11626 "cannot optimize loop, the loop counter may overflow", a symptom
11627 of the confusion.
11628 * indent.c (Fvertical_motion): Mark locals as initialized.
11629 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11630
11631 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11632
11633 * search.c (Fre_search_backward): Mention `case-fold-search' in
11634 all the re_search_* functions (bug#8138).
11635
11636 * keyboard.c (Fopen_dribble_file): Document when the file is
11637 closed (bug#8056).
11638
11639 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11640
11641 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11642 bidi_cache_idx.
11643
11644 Support bidi reordering of display and overlay strings.
11645 * xdisp.c (compute_display_string_pos)
11646 (compute_display_string_end): Accept additional argument STRING.
11647 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11648 (reseat_to_string): Initialize bidi_it->string.s and
11649 bidi_it->string.schars.
11650 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11651 NULL (avoids a crash in bidi_paragraph_init).
11652 Initialize itb.string.lstring.
11653 (init_iterator): Call bidi_init_it only of a valid
11654 buffer position was specified. Initialize paragraph_embedding to
11655 L2R.
11656 (reseat_to_string): Initialize the bidi iterator.
11657 (display_string): If we need to ignore text properties of
11658 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11659 original value of -1 will not work with bidi.)
11660 (compute_display_string_pos): First arg is now struct
11661 `text_pos *'; all callers changed. Support display properties on
11662 Lisp strings.
11663 (compute_display_string_end): Support display properties on Lisp
11664 strings.
11665 (init_iterator, reseat_1, reseat_to_string): Initialize the
11666 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11667 when iterating on a string not from display properties).
11668 (compute_display_string_pos, compute_display_string_end):
11669 Fix calculation of the object to scan. Fixes an error when using
11670 arrow keys.
11671 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11672 base_level_stop; instead, set base_level_stop to BEGV.
11673 Fixes crashes in vertical-motion.
11674 (next_element_from_buffer): Improve commentary for when
11675 the iterator is before prev_stop.
11676 (init_iterator): Initialize bidi_p from the default value of
11677 bidi-display-reordering, not from buffer-local value. Use the
11678 buffer-local value only if initializing for buffer iteration.
11679 (handle_invisible_prop): Support invisible properties on strings
11680 that are being bidi-reordered.
11681 (set_iterator_to_next): Support bidi reordering of C strings and
11682 Lisp strings.
11683 (next_element_from_string): Support bidi reordering of Lisp
11684 strings.
11685 (handle_stop_backwards): Support Lisp strings as well.
11686 (display_string): Support display of R2L glyph rows.
11687 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11688 (init_iterator): Don't initialize it->bidi_p for strings
11689 here.
11690 (reseat_to_string): Initialize it->bidi_p for strings here.
11691 (next_element_from_string, next_element_from_c_string)
11692 (next_element_from_buffer): Add xassert's for correspondence
11693 between IT's object being iterated and it->bidi_it.string
11694 structure.
11695 (face_before_or_after_it_pos): Support bidi iteration.
11696 (next_element_from_c_string): Handle the case of the first string
11697 character that is not the first one in the visual order.
11698 (get_visually_first_element): New function, refactored from common
11699 parts of next_element_from_buffer, next_element_from_string, and
11700 next_element_from_c_string.
11701 (tool_bar_lines_needed, redisplay_tool_bar)
11702 (display_menu_bar): Force left-to-right direction. Add a FIXME
11703 comment for making that be controlled by a user option.
11704 (push_it, pop_it): Save and restore the state of the
11705 bidi iterator. Save and restore the bidi_p flag.
11706 (pop_it): Iterate out of display property for string iteration as
11707 well.
11708 (iterate_out_of_display_property): Support iteration over strings.
11709 (handle_single_display_spec): Set up it->bidi_it for iteration
11710 over a display string, and call bidi_init_it.
11711 (handle_single_display_spec, next_overlay_string)
11712 (get_overlay_strings_1, push_display_prop): Set up the bidi
11713 iterator for displaying display or overlay strings.
11714 (forward_to_next_line_start): Don't use the shortcut if
11715 bidi-iterating.
11716 (back_to_previous_visible_line_start): If handle_display_prop
11717 pushed the iterator stack, restore the internal state of the bidi
11718 iterator by calling bidi_pop_it same number of times.
11719 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11720 and we are bidi-iterating, don't decrement the iterator position;
11721 instead, set the first_elt flag in the bidi iterator, to produce
11722 the same effect.
11723 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11724 (push_display_prop): xassert that we are iterating a buffer.
11725 (push_it, pop_it): Save and restore paragraph_embedding member.
11726 (handle_single_display_spec, next_overlay_string)
11727 (get_overlay_strings_1, reseat_1, reseat_to_string)
11728 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11729 correctly. Don't assume unibyte strings are not bidi-reordered.
11730 (compute_display_string_pos)
11731 (compute_display_string_end): Fix handling the case of C string.
11732 (push_it, pop_it): Save and restore from_disp_prop_p.
11733 (handle_single_display_spec, push_display_prop): Set the
11734 from_disp_prop_p flag.
11735 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11736 (pop_it): Call iterate_out_of_display_property only if we are
11737 popping after iteration over a string that came from a display
11738 property. Fix a typo in popping stretch info. Add an assertion
11739 for verifying that the iterator position is in sync with the bidi
11740 iterator.
11741 (handle_single_display_spec, get_overlay_strings_1)
11742 (push_display_prop): Fix initialization of paragraph direction for
11743 string when that of the parent object is not yet determined.
11744 (reseat_1): Call bidi_init_it to resync the bidi
11745 iterator with IT's position. (Bug#7616)
11746 (find_row_edges): If ROW->start.pos gives position
11747 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11748 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11749 Reset the from_disp_prop_p flag.
11750 (SAVE_IT, RESTORE_IT): New macros.
11751 (pos_visible_p, face_before_or_after_it_pos)
11752 (back_to_previous_visible_line_start)
11753 (move_it_in_display_line_to, move_it_in_display_line)
11754 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11755 (try_scrolling, redisplay_window, display_line): Use them when
11756 saving a temporary copy of the iterator and restoring it back.
11757 (back_to_previous_visible_line_start, reseat_1)
11758 (init_iterator): Empty the bidi cache "stack".
11759 (move_it_in_display_line_to): If iterator ended up at
11760 EOL, but we never saw any buffer positions smaller than
11761 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11762 motion in bidi-reordered lines.
11763 (move_it_in_display_line_to): Record prev_method and prev_pos
11764 immediately before the call to set_iterator_to_next. Fixes cursor
11765 motion in bidi-reordered lines with stretch glyphs and strings
11766 displayed in margins. (Bug#8133) (Bug#8867)
11767 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11768 TO_CHARPOS.
11769 (pos_visible_p): Support positions in bidi-reordered lines.
11770 Save and restore bidi cache.
11771
11772 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11773 (bidi_paragraph_info): Delete unused struct.
11774 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11775 (bidi_cache_start): New variable.
11776 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11777 to zero.
11778 (bidi_cache_fetch_state, bidi_cache_search)
11779 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11780 (bidi_cache_find, bidi_peek_at_next_level)
11781 (bidi_level_of_next_char, bidi_find_other_level_edge)
11782 (bidi_move_to_visually_next): Compare cache index with
11783 bidi_cache_start rather than with zero.
11784 (bidi_fetch_char): Accept new argument STRING; all callers
11785 changed. Support iteration over a string. Support strings with
11786 display properties. Support unibyte strings. Fix the type of
11787 `len' according to what STRING_CHAR_AND_LENGTH expects.
11788 (bidi_paragraph_init, bidi_resolve_explicit_1)
11789 (bidi_resolve_explicit, bidi_resolve_weak)
11790 (bidi_level_of_next_char, bidi_move_to_visually_next):
11791 Support iteration over a string.
11792 (bidi_set_sor_type, bidi_resolve_explicit_1)
11793 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11794 can now be zero (for strings); special values 0 and -1 were
11795 changed to -1 and -2, respectively.
11796 (bidi_char_at_pos): New function.
11797 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11798 Call it instead of FETCH_MULTIBYTE_CHAR.
11799 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11800 initialized to valid values.
11801 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11802 values.
11803 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11804 the test for valid cached positions. Fix the logic for looking up
11805 the sentinel state in the cache. GCPRO the Lisp string we are
11806 iterating.
11807 (bidi_push_it, bidi_pop_it): New functions.
11808 (bidi_initialize): Initialize the bidi cache start stack pointer.
11809 (bidi_cache_ensure_space): New function, refactored from part of
11810 bidi_cache_iterator_state. Don't assume the required size is just
11811 one BIDI_CACHE_CHUNK away.
11812 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11813 (bidi_count_bytes, bidi_char_at_pos): New functions.
11814 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11815 always valid if bidi_cache_idx is valid.
11816 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11817 is valid if it's going to be used.
11818 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11819 (bidi_cache_fetch_state, bidi_cache_search)
11820 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11821 (bidi_cache_iterator_state, bidi_cache_find)
11822 (bidi_find_other_level_edge, bidi_cache_start_stack):
11823 All variables related to cache indices are now EMACS_INT.
11824
11825 * dispextern.h (struct bidi_string_data): New structure.
11826 (struct bidi_it): New member `string'. Make flag members be 1-bit
11827 fields, and put them last in the struct.
11828 (compute_display_string_pos, compute_display_string_end):
11829 Update prototypes.
11830 (bidi_push_it, bidi_pop_it): Add prototypes.
11831 (struct iterator_stack_entry): New members bidi_p,
11832 paragraph_embedding, and from_disp_prop_p.
11833 (struct it): Member bidi_p is now a bit field 1 bit wide.
11834 (bidi_shelve_cache, bidi_unshelve_cache):
11835 Declare prototypes.
11836
11837 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11838 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11839 and vector-like objects.
11840
11841 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11842 cache around display iteration.
11843
11844 * window.c (Fwindow_end, window_scroll_pixel_based)
11845 (displayed_window_lines, Frecenter): Save and restore the bidi
11846 cache around display iteration.
11847
11848 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11849
11850 * editfns.c (Fdelete_region): Clarify the use of the named
11851 parameters (bug#6788).
11852
11853 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11854
11855 * indent.c (Fvertical_motion): Set and restore w->pointm when
11856 saving and restoring the window's buffer (Bug#9006).
11857
11858 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11859
11860 * editfns.c (Fstring_to_char): Clarify just what is returned
11861 (bug#6576). Text by Eli Zaretskii.
11862
11863 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11864
11865 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11866
11867 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11868
11869 * buffer.c (mmap_find): Fix a typo.
11870
11871 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11872
11873 Fix execution of x selection hooks.
11874 * xselect.c (Qx_lost_selection_functions)
11875 (Qx_sent_selection_functions): New vars.
11876 (syms_of_xselect): DEFSYM them.
11877 (x_handle_selection_request): Pass Qx_sent_selection_functions
11878 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11879 (x_handle_selection_clear,x_clear_frame_selections):
11880 Pass Qx_lost_selection_functions rather than
11881 Vx_lost_selection_functions to Frun_hook_with_args.
11882
11883 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11884
11885 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11886 The old code sometimes used this field without initializing it.
11887
11888 * alloc.c (gc_sweep): Don't read past end of array.
11889 In theory, the old code could also have corrupted Emacs internals,
11890 though it'd be very unlikely.
11891
11892 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11893
11894 * character.c (Fcharacterp): Don't advertise optional ignored
11895 argument. (Bug#4026)
11896
11897 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11898
11899 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11900 key" (bug#4257).
11901
11902 * window.c (Fset_window_start): Doc fix (bug#4199).
11903 (Fset_window_hscroll): Ditto.
11904
11905 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11906
11907 Fix minor new problems caught by GCC 4.6.1.
11908 * term.c (init_tty): Remove unused local.
11909 * xsettings.c (store_monospaced_changed): Define this function only
11910 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11911 not used otherwise.
11912
11913 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11914
11915 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11916
11917 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11918
11919 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11920 are the mini-buffer and the echo area (bug#3320).
11921
11922 * term.c (init_tty): Remove support for supdup, c10 and perq
11923 terminals, which are no longer supported (bug#1482).
11924
11925 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11926
11927 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11928
11929 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11930
11931 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11932 for non-popups (Bug#3642).
11933
11934 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11935
11936 * alloc.c (reset_malloc_hooks): Protoize.
11937 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11938 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11939 * cm.c (losecursor): Likewise.
11940 * data.c (fmod): Likewise.
11941 * dispnew.c (swap_glyphs_in_rows): Likewise.
11942 * emacs.c (memory_warning_signal): Likewise.
11943 * floatfns.c (float_error): Likewise.
11944 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11945 (otf_open, font_otf_capability, generate_otf_features)
11946 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11947 Likewise.
11948 * image.c (pbm_read_file): Likewise.
11949 * indent.c (string_display_width): Likewise.
11950 * intervals.c (check_for_interval, search_for_interval)
11951 (inc_interval_count, count_intervals, root_interval)
11952 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11953 * lread.c (defalias): Likewise.
11954 * ralloc.c (r_alloc_check): Likewise.
11955 * regex.c (set_image_of_range_1, set_image_of_range)
11956 (regex_grow_registers): Likewise.
11957 * sysdep.c (strerror): Likewise.
11958 * termcap.c (valid_filename_p, tprint, main): Likewise.
11959 * tparam.c (main): Likewise.
11960 * unexhp9k800.c (run_time_remap, save_data_space)
11961 (update_file_ptrs, read_header, write_header, calculate_checksum)
11962 (copy_file, copy_rest, display_header): Likewise.
11963 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11964 Likewise.
11965 * xdisp.c (check_it): Likewise.
11966 * xfaces.c (register_color, unregister_color, unregister_colors):
11967 Likewise.
11968 * xfns.c (print_fontset_result): Likewise.
11969 * xrdb.c (member, fatal, main): Likewise.
11970
11971 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11972
11973 Fix minor problems found by static checking (Bug#9031).
11974 * chartab.c (char_table_set_range, map_sub_char_table):
11975 Remove unused locals.
11976 (uniprop_table): Now static.
11977 * composite.c (_work_char): Remove unused static var.
11978
11979 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11980
11981 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11982
11983 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11984
11985 * gtkutil.c (qttip_cb): Remove code without function.
11986
11987 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11988
11989 * w32.c (pthread_sigmask): New stub.
11990
11991 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11992
11993 Use pthread_sigmask, not sigprocmask (Bug#9010).
11994 sigprocmask is portable only for single-threaded applications, and
11995 Emacs can be multi-threaded when it uses GTK.
11996 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11997 (LIBES): Use it.
11998 * callproc.c (Fcall_process):
11999 * process.c (create_process):
12000 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12001 Use pthread_sigmask, not sigprocmask.
12002
12003 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12004
12005 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12006 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12007 wrong (Bug#8591).
12008
12009 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12010
12011 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12012 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12013 (xg_hide_tooltip): Fix comment.
12014
12015 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12016 in registerServicesMenuSendTypes.
12017 (validRequestorForSendType): Don't check ns_return_types.
12018
12019 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12020 ns_return_type.
12021
12022 2011-07-08 Jason Rumney <jasonr@gnu.org>
12023
12024 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12025 SH_SHOW for hidden windows (Bug#5482).
12026
12027 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12028 frame struct members of non-existent frames (Bug#6284).
12029
12030 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12031
12032 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12033 variable firstTime not needed on OSX >= 10.6.
12034 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12035 >= 10.5. Use setKnobProportion, setDoubleValue.
12036
12037 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12038 (MAC_OS_X_VERSION_10_5): Define if not defined.
12039 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12040 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12041 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12042
12043 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12044 cString and lossyCString on OSX >= 10.4.
12045
12046 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12047 sizeToFit on OSX >= 10.2.
12048
12049 * nsimage.m (allocInitFromFile): Don't use deprecated method
12050 bestRepresentationForDevice on OSX >= 10.6.
12051
12052 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12053 to avoid warning.
12054
12055 * emacs.c: Declare unexec_init_emacs_zone.
12056
12057 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12058
12059 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12060
12061 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12062 on svcsMenu (Bug#8842).
12063
12064 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12065 ns_return_types.
12066 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12067
12068 * nsterm.m (QUTF8_STRING): Declare.
12069 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12070 (validRequestorForSendType): Return type is (id).
12071 Change indexOfObjectIdenticalTo to indexOfObject.
12072 Check if we have local selection before returning self (Bug#8842).
12073 (writeSelectionToPasteboard): Put local selection into paste board
12074 if we have a local selection (Bug#8842).
12075 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12076
12077 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12078 (ns_get_local_selection): Declare.
12079
12080 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12081
12082 * keymap.c (describe_map_tree): Don't insert a double newline at
12083 the end of the buffer (bug#1169) and return whether we inserted
12084 something.
12085
12086 * callint.c (Fcall_interactively): Change "reading args" to
12087 "providing args" to try to clarify what it does (bug#1010).
12088
12089 2011-07-07 Kenichi Handa <handa@m17n.org>
12090
12091 * composite.c (composition_compute_stop_pos): Ignore a static
12092 composition starting before CHARPOS (Bug#8915).
12093
12094 * xdisp.c (handle_composition_prop): Likewise.
12095
12096 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12097
12098 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12099 (Bug#9015)
12100
12101 2011-07-07 Kenichi Handa <handa@m17n.org>
12102
12103 * character.h (unicode_category_t): New enum type.
12104
12105 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12106 (Qchar_code_property_table): New variable.
12107 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12108 (UNIPROP_COMPRESSED_FORM_P): New macros.
12109 (char_table_ascii): Uncompress the compressed values.
12110 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12111 Uncompress the compressed values.
12112 (sub_char_table_ref_and_range): Likewise.
12113 (char_table_ref_and_range): Uncompress the compressed values.
12114 (sub_char_table_set): New arg is_uniprop. Callers changed.
12115 Uncompress the compressed values.
12116 (sub_char_table_set_range): Args changed. Callers changed.
12117 (char_table_set_range): Adjuted for the above change.
12118 (map_sub_char_table): Delete args default_val and parent. Add arg
12119 top. Give decoded values to a Lisp function.
12120 (map_char_table): Adjust for the above change. Give decoded
12121 values to a Lisp function. Gcpro more variables.
12122 (uniprop_table_uncompress)
12123 (uniprop_decode_value_run_length): New functions.
12124 (uniprop_decoder, uniprop_decoder_count): New variables.
12125 (uniprop_get_decoder, uniprop_encode_value_character)
12126 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12127 New functions.
12128 (uniprop_encoder, uniprop_encoder_count): New variables.
12129 (uniprop_get_encoder, uniprop_table)
12130 (Funicode_property_table_internal, Fget_unicode_property_internal)
12131 (Fput_unicode_property_internal): New functions.
12132 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12133 Sunicode_property_table_internal, Sget_unicode_property_internal,
12134 and Sput_unicode_property_internal. Defvar_lisp
12135 char-code-property-alist.
12136
12137 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12138 Vunicode_category_table.
12139
12140 * font.c (font_range): Adjust for the change of
12141 Vunicode_category_table.
12142
12143 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12144
12145 * m/iris4d.h: Remove file, move contents ...
12146 * s/irix6-5.h: ... here.
12147
12148 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12149
12150 Remove unportable assumption about struct layout (Bug#8884).
12151 * alloc.c (mark_buffer):
12152 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12153 (clone_per_buffer_values): Don't assume that
12154 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12155 This isn't true in general, and it's particularly not true
12156 if Emacs is configured with --with-wide-int.
12157 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12158 New macros, used in the buffer.c change.
12159
12160 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12161
12162 * xsettings.c: Use both GConf and GSettings if both are available.
12163 (store_config_changed_event): Add comment.
12164 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12165 (store_tool_bar_style_changed): New functions.
12166 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12167 (struct xsettings): Move font inside HAVE_XFT.
12168 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12169 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12170 Move inside HAVE_XFT.
12171 (something_changed_gsettingsCB): Rename from something_changedCB.
12172 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12173 also.
12174 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12175 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12176 (something_changed_gconfCB): Rename from something_changedCB.
12177 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12178 (parse_settings): Move check for font inside HAVE_XFT.
12179 (read_settings, apply_xft_settings): Add comment.
12180 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12181 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12182 call store_font_name_changed.
12183 (xft_settings_event): Add comment.
12184 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12185 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12186 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12187 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12188 (xsettings_initialize): Call init_gsettings last.
12189 (xsettings_get_system_font, xsettings_get_system_normal_font):
12190 Add comment.
12191
12192 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12193
12194 Random fixes. E.g., (random) never returned negative values.
12195 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12196 subseconds part to the entropy, as that's a bit more random.
12197 Prefer signed to unsigned, since the signedness doesn't matter and
12198 in general we prefer signed. When given a limit, use a
12199 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12200 latter isn't right if USE_2_TAGS_FOR_INTS.
12201 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12202 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12203
12204 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12205
12206 * textprop.c (text_property_stickiness):
12207 Obey Vtext_property_default_nonsticky.
12208 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12209 * w32fns.c (syms_of_w32fns):
12210 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12211
12212 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12213
12214 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12215 This is more efficient than Ffile_directory_p and avoids a minor race.
12216
12217 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12218
12219 * buffer.c (Foverlay_put): Say what the return value is
12220 (bug#7835).
12221
12222 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12223 is a directory before asking whether to use the file name
12224 (bug#7564).
12225 (barf_or_query_if_file_exists): Make the "File is a directory"
12226 error be more correct.
12227
12228 * fns.c (Frequire): Remove the mention of the .gz files, since
12229 that's installation-specific, but keep the mention of
12230 `get-load-suffixes'.
12231
12232 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12233
12234 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12235 Report string overflow if the output is too long.
12236
12237 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12238
12239 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12240 (syms_of_gnutls): Remove duplicate DEFSYM for
12241 Qgnutls_bootprop_verify_hostname_error, an error for
12242 Qgnutls_bootprop_verify_error (which is no longer used).
12243
12244 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12245 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12246 Also (re)move comments that are misplaced or no longer relevant.
12247
12248 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12249
12250 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12251
12252 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12253
12254 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12255 and background color parameters if they have been changed.
12256
12257 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12258
12259 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12260
12261 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12262
12263 * xsettings.c (SYSTEM_FONT): Define only when used.
12264 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12265
12266 * keymap.c (access_keymap_1): Now static.
12267
12268 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12269
12270 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12271 leave any prefix arg for the up event (Bug#1586).
12272
12273 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12274
12275 * lread.c (syms_of_lread): Mention single symbols defined by
12276 `defvar' or `defconst' (bug#7154).
12277
12278 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12279 (Frequire): Mention get-load-suffixes.
12280
12281 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12282
12283 * window.h (window): Remove clone_number slot.
12284 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12285 Remove.
12286 (make_parent_window, make_window, saved_window)
12287 (Fset_window_configuration, save_window_save): Don't deal with
12288 clone numbers.
12289 * buffer.c (Qclone_number): Remove declaration.
12290 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12291
12292 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12293
12294 Add multiple inheritance to keymaps.
12295 * keymap.c (Fmake_composed_keymap): New function.
12296 (Fset_keymap_parent): Simplify.
12297 (fix_submap_inheritance): Remove.
12298 (access_keymap_1): New function extracted from access_keymap to handle
12299 embedded parents and handle lists of maps.
12300 (access_keymap): Use it.
12301 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12302 (Fcopy_keymap): Handle embedded parents.
12303 (Fcommand_remapping, define_as_prefix): Simplify.
12304 (Fkey_binding): Simplify.
12305 (syms_of_keymap): Move minibuffer-local-completion-map,
12306 minibuffer-local-filename-completion-map,
12307 minibuffer-local-must-match-map, and
12308 minibuffer-local-filename-must-match-map to Elisp.
12309 (syms_of_keymap): Defsubr make-composed-keymap.
12310 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12311 (parse_menu_item): Trivial simplification.
12312
12313 2011-07-01 Glenn Morris <rgm@gnu.org>
12314
12315 * Makefile.in (SETTINGS_LIBS): Fix typo.
12316
12317 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12318
12319 * coding.c (Fencode_coding_string): Record the last coding system
12320 used, as the function doc string says (bug#8738).
12321
12322 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12323
12324 * xsettings.c (store_monospaced_changed): Take new font as arg and
12325 check for change against current_mono_font.
12326 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12327 (emacs_settings_constructor, emacs_settings_get_property)
12328 (emacs_settings_set_property, emacs_settings_class_init)
12329 (emacs_settings_init, gsettings_obj): Remove.
12330 (something_changedCB): New function for HAVE_GSETTINGS.
12331 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12332 with value as argument.
12333 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12334 g_settings_new (Bug#8967). Do not create gsettings_obj.
12335 Remove calls to g_settings_bind. Connect something_changedCB to
12336 "changed".
12337
12338 * xgselect.c: Add defined (HAVE_GSETTINGS).
12339 (xgselect_initialize): Ditto.
12340
12341 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12342 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12343 xg_select.
12344
12345 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12346
12347 * eval.c (struct backtrace): Simplify and port the data structure.
12348 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12349 signed bit field, as this assumption is not portable and it makes
12350 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12351 "char debug_on_exit : 1" as this is not portable either; instead,
12352 use the portable "unsigned int debug_on_exit : 1". Remove unused
12353 member evalargs. Remove obsolete comments about cc bombing out.
12354
12355 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12356
12357 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12358 Let HAVE_GSETTINGS override HAVE_GCONF.
12359 (store_monospaced_changed): New function.
12360 (EMACS_SETTINGS): A new type derived from GObject to handle
12361 GSettings notifications.
12362 (emacs_settings_constructor, emacs_settings_get_property)
12363 (emacs_settings_set_property, emacs_settings_class_init):
12364 New functions.
12365 (gsettings_client, gsettings_obj): New variables.
12366 (GSETTINGS_SCHEMA): New define.
12367 (something_changedCB): Call store_monospaced_changed.
12368 (init_gsettings): New function.
12369 (xsettings_initialize): Call init_gsettings.
12370 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12371 to NULL.
12372
12373 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12374 GCONF_CFLAGS/LIBS.
12375
12376 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12377
12378 * window.c (resize_root_window, grow_mini_window)
12379 (shrink_mini_window): Rename Qresize_root_window to
12380 Qwindow_resize_root_window and Qresize_root_window_vertically to
12381 Qwindow_resize_root_window_vertically.
12382
12383 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12384
12385 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12386
12387 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12388
12389 * makefile.w32-in: Redesign dependencies so they reflect more
12390 clearly which files are directly included by each source file,
12391 and not through other includes.
12392
12393 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12394
12395 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12396 (sort_overlays, overlay_strings): When an overlay's clone number
12397 matches the window's clone number process the overlay even if
12398 the overlay's window property doesn't match the current window.
12399
12400 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12401 (Fwindow_hchild): Rename to Fwindow_left_child.
12402 (Fwindow_next): Rename to Fwindow_next_sibling.
12403 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12404 (resize_window_check): Rename to window_resize_check.
12405 (resize_window_apply): Rename to window_resize_apply.
12406 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12407 (Fdelete_other_windows_internal, resize_frame_windows)
12408 (Fsplit_window_internal, Fdelete_window_internal)
12409 (grow_mini_window, shrink_mini_window)
12410 (Fresize_mini_window_internal): Fix callers accordingly.
12411
12412 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12413
12414 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12415 (emacs_fixed_set_min_size): Remove.
12416 (emacs_fixed_new): Take frame as argument.
12417
12418 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12419 (_EmacsFixedPrivate): Remove minwidth/height.
12420 Add struct frame *f.
12421 (emacs_fixed_init): Initialize priv->f.
12422 (get_parent_class, emacs_fixed_set_min_size): Remove.
12423 (emacs_fixed_new): Set priv->f to argument.
12424 (emacs_fixed_get_preferred_width)
12425 (emacs_fixed_get_preferred_height): Use min_width/height from
12426 frames size_hint to set minimum and natural (Bug#8919).
12427 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12428 and use min_width/height from frames size_hint to set
12429 min_width/height (Bug#8919).
12430
12431 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12432 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12433 Fix indentation.
12434
12435 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12436
12437 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12438 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12439 called at ZV.
12440
12441 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12442
12443 * process.c (wait_reading_process_output): Bypass select if
12444 waiting for a cell while ignoring keyboard input, and input is
12445 pending. Suggested by Jan Djärv (Bug#8869).
12446
12447 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12448
12449 Use gnulib's dup2 module instead of rolling our own.
12450 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12451
12452 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12453
12454 * dispnew.c (scrolling_window): Before scrolling, turn off a
12455 mouse-highlight in the window being scrolled.
12456
12457 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12458
12459 Move DEFSYM to lisp.h and use everywhere.
12460
12461 * character.h (DEFSYM): Move declaration...
12462 * lisp.h (DEFSYM): ...here.
12463
12464 * gnutls.c:
12465 * minibuf.c:
12466 * w32menu.c:
12467 * w32proc.c:
12468 * w32select.c: Don't include character.h.
12469
12470 * alloc.c (syms_of_alloc):
12471 * buffer.c (syms_of_buffer):
12472 * bytecode.c (syms_of_bytecode):
12473 * callint.c (syms_of_callint):
12474 * casefiddle.c (syms_of_casefiddle):
12475 * casetab.c (init_casetab_once):
12476 * category.c (init_category_once, syms_of_category):
12477 * ccl.c (syms_of_ccl):
12478 * cmds.c (syms_of_cmds):
12479 * composite.c (syms_of_composite):
12480 * dbusbind.c (syms_of_dbusbind):
12481 * dired.c (syms_of_dired):
12482 * dispnew.c (syms_of_display):
12483 * doc.c (syms_of_doc):
12484 * editfns.c (syms_of_editfns):
12485 * emacs.c (syms_of_emacs):
12486 * eval.c (syms_of_eval):
12487 * fileio.c (syms_of_fileio):
12488 * fns.c (syms_of_fns):
12489 * frame.c (syms_of_frame):
12490 * fringe.c (syms_of_fringe):
12491 * insdel.c (syms_of_insdel):
12492 * keymap.c (syms_of_keymap):
12493 * lread.c (init_obarray, syms_of_lread):
12494 * macros.c (syms_of_macros):
12495 * msdos.c (syms_of_msdos):
12496 * print.c (syms_of_print):
12497 * process.c (syms_of_process):
12498 * search.c (syms_of_search):
12499 * sound.c (syms_of_sound):
12500 * syntax.c (init_syntax_once, syms_of_syntax):
12501 * terminal.c (syms_of_terminal):
12502 * textprop.c (syms_of_textprop):
12503 * undo.c (syms_of_undo):
12504 * w32.c (globals_of_w32):
12505 * window.c (syms_of_window):
12506 * xdisp.c (syms_of_xdisp):
12507 * xfaces.c (syms_of_xfaces):
12508 * xfns.c (syms_of_xfns):
12509 * xmenu.c (syms_of_xmenu):
12510 * xsettings.c (syms_of_xsettings):
12511 * xterm.c (syms_of_xterm): Use DEFSYM.
12512
12513 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12514
12515 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12516
12517 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12518
12519 Integer and buffer overflow fixes (Bug#8873).
12520
12521 * print.c (printchar, strout): Check for string overflow.
12522 (PRINTPREPARE, printchar, strout):
12523 Don't set size unless allocation succeeds.
12524
12525 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12526 for sizes. Check for string overflow more accurately.
12527 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12528
12529 * macros.c: Integer and buffer overflow fixes.
12530 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12531 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12532 Use ptrdiff_t, not int, for sizes.
12533 Don't increment bufsize until after realloc succeeds.
12534 Check for size-calculation overflow.
12535 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12536
12537 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12538
12539 * lread.c: Integer overflow fixes.
12540 (read_integer): Radix is now EMACS_INT, not int,
12541 to improve quality of diagnostics for out-of-range radices.
12542 Calculate buffer size correctly for out-of-range radices.
12543 (read1): Check for integer overflow in radices, and in
12544 read-circle numbers.
12545 (read_escape): Avoid int overflow.
12546 (Fload, openp, read_buffer_size, read1)
12547 (substitute_object_recurse, read_vector, read_list, map_obarray):
12548 Use ptrdiff_t, not int, for sizes.
12549 (read1): Use EMACS_INT, not int, for sizes.
12550 Check for size overflow.
12551
12552 * image.c (cache_image): Check for size arithmetic overflow.
12553
12554 * lread.c: Integer overflow issues.
12555 (saved_doc_string_size, saved_doc_string_length)
12556 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12557 Now ptrdiff_t, not int.
12558 (read1): Don't assume doc string length fits in int. Check for
12559 out-of-range doc string lengths.
12560 (read_list): Don't assume file position fits in int.
12561 (read_escape): Check for hex character overflow.
12562
12563 2011-06-22 Leo Liu <sdl.web@gmail.com>
12564
12565 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12566 Move to minibuffer.el.
12567
12568 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12569
12570 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12571 The following patches are for when GLYPH_DEBUG && !XASSERT.
12572 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12573 * dispnew.c (flush_stdout):
12574 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12575 Mark as externally visible.
12576 * dispnew.c (check_window_matrix_pointers): Now static.
12577 * dispnew.c (window_to_frame_vpos):
12578 * xfns.c (unwind_create_frame):
12579 * xterm.c (x_check_font): Remove unused local.
12580 * scroll.c (CHECK_BOUNDS):
12581 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12582 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12583 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12584 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12585 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12586 Now static.
12587 (debug_method_add): Use va_list and vsprintf rather than relying
12588 on undefined behavior with wrong number of arguments.
12589 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12590 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12591 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12592 since we're not interested in debugging glyphs with old libraries.
12593 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12594 GCC 4.6.0's static checking.
12595
12596 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12597
12598 Integer overflow and signedness fixes (Bug#8873).
12599 A few related buffer overrun fixes, too.
12600
12601 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12602
12603 * dispextern.h (struct face.stipple):
12604 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12605 (x_bitmap_mask, x_allocate_bitmap_record)
12606 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12607 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12608 (x_create_bitmap_from_xpm_data):
12609 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12610 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12611 (.bitmaps_last):
12612 * xfaces.c (load_pixmap):
12613 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12614 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12615 (.bitmaps_last, struct x_output.icon_bitmap):
12616 Use ptrdiff_t, not int, for bitmap indexes.
12617 (x_allocate_bitmap_record): Check for size overflow.
12618 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12619
12620 Use ptrdiff_t, not int, for overlay counts.
12621 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12622 * editfns.c (overlays_around, get_pos_property):
12623 * textprop.c (get_char_property_and_overlay):
12624 * xdisp.c (next_overlay_change, note_mouse_highlight):
12625 * xfaces.c (face_at_buffer_position):
12626 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12627 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12628 (Fnext_overlay_change, Fprevious_overlay_change)
12629 (mouse_face_overlay_overlaps, Foverlays_in):
12630 Use ptrdiff_t, not int, for sizes.
12631 (overlays_at, overlays_in): Check for size-calculation overflow.
12632
12633 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12634
12635 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12636 (x_session_initialize): Do not assume string length fits in int.
12637
12638 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12639 This is unlikely, but can occur if DPI is outlandish.
12640
12641 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12642 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12643
12644 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12645 * xrdb.c (magic_file_p, search_magic_path):
12646 Omit last arg SUFFIX; it was always 0. All callers changed.
12647 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12648
12649 * xfont.c (xfont_match): Avoid need for strlen.
12650
12651 * xfns.c: Don't assume strlen fits in int.
12652 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12653
12654 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12655 not unsigned long, as we prefer signed integers. All callers changed.
12656 Detect integer overflow in repeat count.
12657 (message_dolog): Don't assume print length fits in 39 bytes.
12658 (display_mode_element): Don't assume strlen fits in int.
12659
12660 * termcap.c: Don't assume sizes fit in int and never overflow.
12661 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12662 (gobble_line): Check for size-calculation overflow.
12663
12664 * minibuf.c (Fread_buffer):
12665 * lread.c (intern, intern_c_string):
12666 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12667 Don't assume string length fits in int.
12668
12669 * keyboard.c (parse_tool_bar_item):
12670 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12671
12672 * font.c: Don't assume string length fits in int.
12673 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12674 Use ptrdiff_t, not int.
12675 (font_intern_prop): Don't assume string length fits in int.
12676 Don't assume integer property fits in fixnum.
12677 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12678
12679 * filelock.c: Fix some buffer overrun and integer overflow issues.
12680 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12681 Reformulate so as not to need the command string.
12682 Invoke gzip -cd rather than gunzip, as it's more portable.
12683 (lock_info_type, lock_file_1, lock_file):
12684 Don't assume pid_t and time_t fit in unsigned long.
12685 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12686 (current_lock_owner): Prefer signed type for sizes.
12687 Use memcpy, not strncpy, where memcpy is what is really wanted.
12688 Don't assume (via atoi) that time_t and pid_t fit in int.
12689 Check for time_t and/or pid_t out of range, e.g., via a network share.
12690 Don't alloca where an auto var works fine.
12691
12692 * fileio.c: Fix some integer overflow issues.
12693 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12694 Don't assume string length fits in int.
12695 (directory_file_name): Don't assume string length fits in long.
12696 (make_temp_name): Don't assume pid fits in int, or that its print
12697 length is less than 20.
12698
12699 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12700
12701 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12702
12703 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12704
12705 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12706 We prefer signed integers, even for size calculations.
12707
12708 * emacs.c: Don't assume string length fits in 'int'.
12709 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12710 (main): Don't invoke strlen when not needed.
12711
12712 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12713 (XD_DEBUG_MESSAGE): Don't waste a byte.
12714
12715 * callproc.c (getenv_internal_1, getenv_internal)
12716 (Fgetenv_internal):
12717 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12718
12719 * lread.c (invalid_syntax): Omit length argument.
12720 All uses changed. This doesn't fix a bug, but it simplifies the
12721 code away from its former Hollerith-constant appearance, and it's
12722 one less 'int' to worry about when looking at integer-overflow issues.
12723 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12724
12725 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12726 This didn't break anything, but it didn't help either.
12727 It's confusing to put a bogus integer in a place where the actual
12728 value does not matter.
12729 (LIST_END_P): Remove unused macro and its bogus comment.
12730 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12731
12732 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12733 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12734 implementation.
12735 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12736 We prefer signed types, and the value cannot exceed the EMACS_INT
12737 range anyway (because otherwise the length would not be representable).
12738 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12739 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12740 This avoids a GCC warning when WIDE_EMACS_INT.
12741
12742 * indent.c (sane_tab_width): New function.
12743 (current_column, scan_for_column, Findent_to, position_indentation)
12744 (compute_motion): Use it. This is just for clarity.
12745 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12746
12747 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12748
12749 * lisp.h (lint_assume): New macro.
12750 * composite.c (composition_gstring_put_cache):
12751 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12752
12753 * editfns.c, insdel.c:
12754 Omit unnecessary forward decls, to simplify future changes.
12755
12756 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12757
12758 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12759
12760 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12761 Use much-faster test for byte-length change.
12762 Don't assume string byte-length fits in 'int'.
12763 Check that character arg fits in 'int'.
12764 (mapcar1): Declare byte as byte, for clarity.
12765
12766 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12767
12768 * fns.c (concat): Catch string overflow earlier.
12769 Do not rely on integer wraparound.
12770
12771 * dispextern.h (struct it.overlay_strings_charpos)
12772 (struct it.selective): Now EMACS_INT, not int.
12773 * xdisp.c (forward_to_next_line_start)
12774 (back_to_previous_visible_line_start)
12775 (reseat_at_next_visible_line_start, next_element_from_buffer):
12776 Don't arbitrarily truncate the value of 'selective' to int.
12777
12778 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12779
12780 * composite.c: Don't truncate sizes to 'int'.
12781 (composition_gstring_p, composition_reseat_it)
12782 (composition_adjust_point): Use EMACS_INT, not int.
12783 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12784 not EMACS_UINT, for indexes.
12785
12786 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12787
12788 * buffer.c: Include <verify.h>.
12789 (struct sortvec.priority, struct sortstr.priority):
12790 Now EMACS_INT, not int.
12791 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12792 (struct sortstr.size, record_overlay_string)
12793 (struct sortstrlist.size, struct sortlist.used):
12794 Don't truncate size to int.
12795 (record_overlay_string): Check for size-calculation overflow.
12796 (init_buffer_once): Check at compile-time, not run-time.
12797
12798 2011-06-22 Jim Meyering <meyering@redhat.com>
12799
12800 Don't leak an XBM-image-sized buffer
12801 * image.c (xbm_load): Free the image buffer after using it.
12802
12803 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12804
12805 Port to Sun C.
12806 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12807 that Sun C diagnosed.
12808 * fns.c (secure_hash): Fix pointer signedness issue.
12809 * intervals.c (static_offset_intervals): New function.
12810 (offset_intervals): Use it.
12811
12812 2011-06-21 Leo Liu <sdl.web@gmail.com>
12813
12814 * deps.mk (fns.o):
12815 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12816 sha512.h.
12817
12818 * fns.c (secure_hash): Rename from crypto_hash_function and change
12819 the first arg to accept symbols.
12820 (Fsecure_hash): New primitive.
12821 (syms_of_fns): New symbols.
12822
12823 2011-06-20 Deniz Dogan <deniz@dogan.se>
12824
12825 * process.c (Fset_process_buffer): Clarify return value in
12826 docstring.
12827
12828 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12829
12830 * dispnew.c (add_window_display_history): Use BVAR.
12831
12832 * xdisp.c (debug_method_add): Use BVAR.
12833 (check_window_end, dump_glyph_matrix, dump_glyph)
12834 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12835
12836 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12837 Likewise.
12838
12839 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12840 check till after the cache is created in init_frame_faces.
12841
12842 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12843
12844 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12845
12846 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12847
12848 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12849 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12850 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12851
12852 Improve buffer-overflow checking (Bug#8873).
12853 * fileio.c (Finsert_file_contents):
12854 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12855 Remove the old (too-loose) buffer overflow checks.
12856 They weren't needed, since make_gap checks for buffer overflow.
12857 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12858 The old code merely checked for Emacs fixnum overflow, and relied
12859 on undefined (wraparound) behavior. The new code avoids undefined
12860 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12861
12862 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12863 Tune. Don't use wider integers than needed. Don't use alloca.
12864 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12865
12866 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12867
12868 * insdel.c, lisp.h (buffer_overflow): New function.
12869 (insert_from_buffer_1, replace_range, replace_range_2):
12870 * insdel.c (make_gap_larger):
12871 * editfns.c (Finsert_char):
12872 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12873
12874 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12875
12876 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12877
12878 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12879
12880 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12881 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12882
12883 * fileio.c: Don't assume EMACS_INT fits in off_t.
12884 (emacs_lseek): New static function.
12885 (Finsert_file_contents, Fwrite_region): Use it.
12886 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12887
12888 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12889
12890 * fns.c: Don't overflow int when computing a list length.
12891 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12892 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12893 truncation on 64-bit hosts. Check for QUIT every
12894 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12895 faster and is responsive enough.
12896 (Flength): Report an error instead of overflowing an integer.
12897 (Fsafe_length): Return a float if the value is not representable
12898 as a fixnum. This shouldn't happen except in contrived situations.
12899 (Fnthcdr, Fsort): Don't assume list length fits in int.
12900 (Fcopy_sequence): Don't assume vector length fits in int.
12901
12902 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12903 (header_size, word_size): New constants.
12904 (allocate_vectorlike): Don't check size overflow here.
12905 (allocate_vector): Check it here instead, since this is the only
12906 caller of allocate_vectorlike that could cause overflow.
12907 Check that the new vector's length is representable as a fixnum.
12908
12909 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12910 The previous code was bogus. For example, next_almost_prime (32)
12911 returned 39, which is undesirable as it is a multiple of 3; and
12912 next_almost_prime (24) returned 25, which is a multiple of 5 so
12913 why was the code bothering to check for multiples of 7?
12914
12915 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12916
12917 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12918
12919 Variadic C functions now count arguments with ptrdiff_t.
12920 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12921 Back then I didn't know that the Emacs coding style prefers signed int.
12922 Also, in the meantime I found a few more instances where arguments
12923 were being counted with int, which may truncate counts on 64-bit
12924 machines, or EMACS_INT, which may be unnecessarily wide.
12925 * lisp.h (struct Lisp_Subr.function.aMANY)
12926 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12927 Arg counts are now ptrdiff_t, not size_t.
12928 All variadic functions and their callers changed accordingly.
12929 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12930 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12931 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12932 * callint.c (Fcall_interactively): Check arg count for overflow,
12933 to avoid potential buffer overrun. Use signed char, not 'int',
12934 for 'varies' array, so that we needn't bother to check its size
12935 calculation for overflow.
12936 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12937 * eval.c (apply_lambda):
12938 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12939 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12940 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12941
12942 * callint.c (Fcall_interactively): Don't use index var as event count.
12943
12944 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12945 * mem-limits.h (SIZE): Remove; no longer used.
12946
12947 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12948
12949 Remove unnecessary casts.
12950 * xterm.c (x_term_init):
12951 * xfns.c (x_set_border_pixel):
12952 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12953 These aren't needed now that we assume ANSI C.
12954
12955 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12956 It's more likely to cause problems (due to unsigned overflow)
12957 than to cure them.
12958
12959 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12960
12961 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12962
12963 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12964
12965 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12966
12967 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12968
12969 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12970
12971 GLYPH_CODE_FACE returns EMACS_INT, not int.
12972 * dispextern.h (merge_faces):
12973 * xfaces.c (merge_faces):
12974 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12975 Don't assume EMACS_INT fits in int.
12976
12977 * character.h (CHAR_VALID_P): Remove unused parameter.
12978 * fontset.c, lisp.h, xdisp.c: All uses changed.
12979
12980 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12981
12982 * fns.c (concat): Minor tuning based on overflow analysis.
12983 This doesn't fix any bugs. Use int to hold character, instead
12984 of constantly refetching from Emacs object. Use XFASTINT, not
12985 XINT, for value known to be a character. Don't bother comparing
12986 a single byte to 0400, as it's always less.
12987
12988 * floatfns.c (Fexpt):
12989 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12990
12991 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12992 for characters.
12993
12994 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12995
12996 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12997 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12998 incorrectly succeed when S was a string, because 4294967386 was
12999 truncated before it was used.
13000
13001 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13002 Otherwise, an out-of-range integer could cause undefined behavior
13003 on a 64-bit host.
13004
13005 * composite.c: Use int, not EMACS_INT, for characters.
13006 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13007 EMACS_INT, for values that are known to be in character range.
13008 This doesn't fix any bugs but is the usual style inside Emacs and
13009 may generate better code on 32-bit machines.
13010
13011 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13012 This is for reasons similar to the recent CHAR_STRING fix.
13013 * charset.c (Fencode_char): Check that character arg is actually
13014 a character. Pass an int to ENCODE_CHAR.
13015 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13016 wider than 'int', as a compile-time check to prevent future regressions
13017 in this area.
13018
13019 * character.c (char_string): Remove unnecessary casts.
13020
13021 Make sure a 64-bit char is never passed to CHAR_STRING.
13022 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13023 by silently ignoring the top 32 bits, allowing some values
13024 that were far too large to be valid characters.
13025 * character.h: Include <verify.h>.
13026 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13027 arguments are no wider than unsigned, as a compile-time check
13028 to prevent future regressions in this area.
13029 * data.c (Faset):
13030 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13031 (Fsubst_char_in_region):
13032 * fns.c (concat):
13033 * xdisp.c (decode_mode_spec_coding):
13034 Adjust to CHAR_STRING's new requirement.
13035 * editfns.c (Finsert_char, Fsubst_char_in_region):
13036 * fns.c (concat): Check that character args are actually
13037 characters. Without this test, these functions did the wrong
13038 thing with wildly out-of-range values on 64-bit hosts.
13039
13040 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13041 These casts should not be needed on 32-bit hosts, either.
13042 * keyboard.c (read_char):
13043 * lread.c (Fload): Remove casts to unsigned.
13044
13045 * lisp.h (UNSIGNED_CMP): New macro.
13046 This fixes comparison bugs on 64-bit hosts.
13047 (ASCII_CHAR_P): Use it.
13048 * casefiddle.c (casify_object):
13049 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13050 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13051 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13052 * dispextern.h (FACE_FROM_ID):
13053 * keyboard.c (read_char): Use UNSIGNED_CMP.
13054
13055 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13056 not to EMACS_INT, to avoid GCC warning.
13057
13058 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13059
13060 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13061 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13062 isn't needed on 32-bit machines.
13063
13064 * buffer.c (Fgenerate_new_buffer_name):
13065 Use EMACS_INT for count, not int.
13066 (advance_to_char_boundary): Return EMACS_INT, not int.
13067
13068 * data.c (Qcompiled_function): Now static.
13069
13070 * window.c (window_body_lines): Now static.
13071
13072 * image.c (gif_load): Rename local to avoid shadowing.
13073
13074 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13075 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13076 * alloc.c (make_save_value): Integer argument is now of type
13077 ptrdiff_t, not int.
13078 (mark_object): Use ptrdiff_t, not int.
13079 * lisp.h (pD): New macro.
13080 * print.c (print_object): Use it.
13081
13082 * alloc.c: Use EMACS_INT, not int, to count objects.
13083 (total_conses, total_markers, total_symbols, total_vector_size)
13084 (total_free_conses, total_free_markers, total_free_symbols)
13085 (total_free_floats, total_floats, total_free_intervals)
13086 (total_intervals, total_strings, total_free_strings):
13087 Now EMACS_INT, not int. All uses changed.
13088 (Fgarbage_collect): Compute overall total using a double, so that
13089 integer overflow is less likely to be a problem. Check for overflow
13090 when converting back to an integer.
13091 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13092 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13093 These were 'int' variables that could overflow on 64-bit hosts;
13094 they were never used, so remove them instead of repairing them.
13095 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13096 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13097 Previously, this ceilinged at INT_MAX, but that doesn't work on
13098 64-bit machines.
13099 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13100
13101 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13102 (allocate_vectorlike): Check for ptrdiff_t overflow.
13103 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13104 when a (possibly-narrower) signed value would do just as well.
13105 We prefer using signed arithmetic, to avoid comparison confusion.
13106
13107 * alloc.c: Catch some string size overflows that we were missing.
13108 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13109 for convenience in STRING_BYTES_MAX.
13110 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13111 The definition here is exact; the one in lisp.h was approximate.
13112 (allocate_string_data): Check for string overflow. This catches
13113 some instances we weren't catching before. Also, it catches
13114 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13115 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13116 and ptrdiff_t and EMACS_INT are both 64 bits.
13117
13118 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13119 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13120 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13121
13122 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13123
13124 * alloc.c (Fmake_string): Check for out-of-range init.
13125
13126 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13127
13128 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13129
13130 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13131
13132 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13133 xg_get_default_scrollbar_width.
13134
13135 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13136 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13137 (style_changed_cb): Call update_theme_scrollbar_width and call
13138 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13139 all frames (Bug#8505).
13140 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13141 Call gtk_window_set_resizable if HAVE_GTK3.
13142 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13143 and height if HAVE_GTK3 (Bug#8505).
13144 (scroll_bar_width_for_theme): New variable.
13145 (update_theme_scrollbar_width): New function.
13146 (xg_get_default_scrollbar_width): Move code to
13147 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13148 (xg_initialize): Call update_theme_scrollbar_width.
13149
13150 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13151
13152 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13153
13154 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13155
13156 * frame.c (make_frame): Call other_buffer_safely instead of
13157 other_buffer.
13158
13159 * window.c (temp_output_buffer_show): Call display_buffer with
13160 second argument Vtemp_buffer_show_specifiers and reset latter
13161 immediately after the call.
13162 (Vtemp_buffer_show_specifiers): New variable.
13163 (auto_window_vscroll_p, next_screen_context_lines)
13164 (Vscroll_preserve_screen_position): Remove leading asterisks from
13165 doc-strings.
13166
13167 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13168
13169 Fix minor problems found by GCC 4.6.0 static checking.
13170 * buffer.c (Qclone_number): Remove for now, as it's unused.
13171 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13172 (record_buffer): Remove unused local.
13173 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13174 (set_frame_buffer_list): Remove; unused.
13175 * frame.h (other_visible_frames): Remove decl.
13176 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13177 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13178 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13179 if HAVE_GPM.
13180 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13181 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13182 Define only if HAVE_GPM.
13183 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13184 (update_hints_inhibit): Remove; never set. All uses removed.
13185 * widgetprv.h (emacsFrameClassRec): Remove decl.
13186 * window.c (delete_deletable_window): Now returns void, since it
13187 wasn't returning anything.
13188 (compare_window_configurations): Remove unused locals.
13189 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13190 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13191 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13192 the same widths as pointers. This follows up on the 2011-05-06 patch.
13193 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13194 * xterm.h: Likewise.
13195 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13196
13197 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13198
13199 * makefile.w32-in: Update dependencies.
13200 (LISP_H): Add lib/intprops.h.
13201
13202 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13203
13204 * image.c (gif_load): Add animation frame delay to the metadata.
13205 (syms_of_image): Use DEFSYM. New symbol `delay'.
13206
13207 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13208
13209 * window.c (delete_deletable_window): Re-add.
13210 (Fset_window_configuration): Rewrite to handle dead buffers and
13211 consequently deletable windows.
13212 (window_tree, Fwindow_tree): Remove. Supply functionality in
13213 window.el.
13214 (compare_window_configurations): Simplify code.
13215
13216 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13217
13218 * image.c (imagemagick_load_image): Fix type mismatch.
13219 (Fimagemagick_types): Likewise.
13220
13221 * window.h (replace_buffer_in_windows): Declare.
13222
13223 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13224
13225 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13226 Qclone_number. Remove external declaration of Qdelete_window.
13227 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13228 code.
13229 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13230 Run Qbuffer_list_update_hook if allowed.
13231 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13232 buffer list implementation.
13233 (other_buffer_safely): New function.
13234 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13235 calls to replace_buffer_in_windows and
13236 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13237 if allowed.
13238 (record_buffer): Inhibit quitting and rewrite using quittable
13239 functions. Run Qbuffer_list_update_hook if allowed.
13240 (Frecord_buffer, Funrecord_buffer): New functions.
13241 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13242 Move switch-to-buffer to window.el.
13243 (bury-buffer): Move to window.el.
13244 (Vbuffer_list_update_hook): New variable.
13245
13246 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13247 section.
13248
13249 * window.h (resize_frame_windows): Move up in code.
13250 (Fwindow_frame): Remove EXFUN.
13251 (replace_buffer_in_all_windows): Remove prototype.
13252 (replace_buffer_in_windows_safely): Add prototype.
13253
13254 * window.c: Declare Qdelete_window static again. Move down
13255 declaration of select_count.
13256 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13257 (Fother_window): Move to window.el.
13258 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13259 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13260 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13261 window.el.
13262 (replace_buffer_in_windows): Implement by calling
13263 Qreplace_buffer_in_windows.
13264 (replace_buffer_in_all_windows): Remove with some functionality
13265 moved into replace_buffer_in_windows_safely.
13266 (replace_buffer_in_windows_safely): New function.
13267 (select_window_norecord, select_frame_norecord): Move in front
13268 of run_window_configuration_change_hook. Remove now obsolete
13269 declarations.
13270 (Fset_window_buffer): Rewrite doc-string.
13271 Call Qrecord_window_buffer.
13272 (keys_of_window): Move binding for other-window to window.el.
13273
13274 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13275
13276 * dispextern.h (struct image): Replace data member, whose int_val
13277 and ptr_val fields were not used by anything, with a single
13278 lisp_val object.
13279
13280 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13281 (gif_clear_image, gif_load, imagemagick_load_image)
13282 (gs_clear_image, gs_load): Callers changed.
13283
13284 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13285
13286 * buffer.h: Include <time.h>, for time_t.
13287 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13288
13289 Fix minor problems found by static checking.
13290
13291 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13292
13293 Make identifiers static if they are not used in other modules.
13294 * data.c (Qcompiled_function, Qframe, Qvector):
13295 * image.c (QimageMagick, Qsvg):
13296 * minibuf.c (Qmetadata):
13297 * window.c (resize_window_check, resize_root_window): Now static.
13298 * window.h (resize_window_check, resize_root_window): Remove decls.
13299
13300 * window.c (window_deletion_count, delete_deletable_window):
13301 Remove; unused.
13302 (window_body_lines): Now static.
13303 (Fdelete_other_windows_internal): Mark vars as initialized.
13304 Make sure 'resize_failed' is initialized.
13305 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13306 (resize_window_apply): Remove unused local.
13307 * window.h (delete_deletable_window): Remove decl.
13308
13309 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13310 (imagemagick_load_image): Fix pointer signedness problem by changing
13311 last arg from unsigned char * to char *. All uses changed.
13312 Also, fix a local for similar reasons.
13313 Remove unused locals. Remove locals to avoid shadowing.
13314 (fn_rsvg_handle_free): Remove; unused.
13315 (svg_load, svg_load_image): Fix pointer signedness problem.
13316 (imagemagick_load_image): Don't use garbage pointer image_wand.
13317
13318 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13319
13320 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13321
13322 * image.c (gif_load): Fix omitted cast error introduced by
13323 2011-06-06 change.
13324
13325 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13326
13327 * window.h (resize_proportionally, orig_total_lines)
13328 (orig_top_line): Remove from window structure.
13329 (set_window_height, set_window_width, change_window_heights)
13330 (Fdelete_window): Remove prototypes.
13331 (resize_frame_windows): Remove duplicate declaration.
13332
13333 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13334
13335 * window.h (resize_frame_windows, resize_window_check)
13336 (delete_deletable_window, resize_root_window)
13337 (resize_frame_windows): Declare prototypes.
13338
13339 * window.c (resize_window_apply): Make definition be "static" to
13340 match the prototype.
13341
13342 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13343
13344 * window.c: Remove declarations of Qwindow_size_fixed,
13345 window_min_size_1, window_min_size_2, window_min_size,
13346 size_window, window_fixed_size_p, enlarge_window, delete_window.
13347 Remove static from declaration of Qdelete_window, it's
13348 temporarily needed by Fbury_buffer.
13349 (replace_window): Don't assign orig_top_line and
13350 orig_total_lines.
13351 (Fdelete_window, delete_window): Remove. Window deletion is
13352 handled by window.el.
13353 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13354 Replace Fdelete_window calls with calls to Qdelete_window.
13355 (Fdelete_other_windows): Remove. Deleting other windows is
13356 handled by window.el.
13357 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13358 handled in window.el.
13359 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13360 Window minimum sizes are handled in window.el.
13361 (shrink_windows, size_window, set_window_height)
13362 (set_window_width, change_window_heights, window_height)
13363 (window_width, CURBEG, CURSIZE, enlarge_window)
13364 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13365 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13366 handled in window.el.
13367 (make_dummy_parent): Rename to make_parent_window and give it a
13368 second argument horflag.
13369 (make_window): Don't set resize_proportionally any more.
13370 (Fsplit_window): Remove. Windows are split in window.el.
13371 (save_restore_action, save_restore_orig_size)
13372 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13373 Resize mini windows in window.el.
13374 (grow_mini_window, shrink_mini_window): Implement by calling
13375 Qresize_root_window_vertically, resize_window_check and
13376 resize_window_apply.
13377 (saved_window, Fset_window_configuration, save_window_save):
13378 Do not handle orig_top_line, orig_total_lines, and
13379 resize_proportionally.
13380 (window_min_height, window_min_width): Move to window.el.
13381 (keys_of_window): Move bindings for delete-other-windows,
13382 split-window, delete-window and enlarge-window to window.el.
13383
13384 * buffer.c: Temporarily extern Qdelete_window.
13385 (Fbury_buffer): Temporarily call Qdelete_window instead of
13386 Fdelete_window (Fbury_buffer will move to window.el soon).
13387
13388 * frame.c (set_menu_bar_lines_1): Remove code handling
13389 orig_top_line and orig_total_lines.
13390
13391 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13392 set_window_height but set heights directly.
13393 (change_frame_size_1): Use resize_frame_windows.
13394
13395 * xdisp.c (init_xdisp): Don't use set_window_height but set
13396 heights directly.
13397
13398 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13399 Use resize_frame_windows instead of change_window_heights and run
13400 run_window_configuration_change_hook.
13401
13402 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13403 instead of change_window_heights and run
13404 run_window_configuration_change_hook.
13405
13406 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13407
13408 * window.c (replace_window): Rename second argument REPLACEMENT to
13409 NEW. New third argument SETFLAG. Rewrite.
13410 (delete_window, make_dummy_parent): Call replace_window with
13411 third argument 1.
13412 (window_list_1): Move down in code.
13413 (run_window_configuration_change_hook): Move set_buffer part
13414 before select_frame_norecord part in order to unwind correctly.
13415 Rename count1 to count.
13416 (recombine_windows, delete_deletable_window, resize_root_window)
13417 (Fdelete_other_windows_internal)
13418 (Frun_window_configuration_change_hook, make_parent_window)
13419 (resize_window_check, resize_window_apply, Fresize_window_apply)
13420 (resize_frame_windows, Fsplit_window_internal)
13421 (Fdelete_window_internal, Fresize_mini_window_internal):
13422 New functions.
13423 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13424
13425 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13426
13427 * window.h (window): Add some new members to window structure -
13428 normal_lines, normal_cols, new_total, new_normal, clone_number,
13429 splits, nest, prev_buffers, next_buffers.
13430 (WINDOW_TOTAL_SIZE): Move here from window.c.
13431 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13432
13433 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13434 Remove.
13435 (make_dummy_parent): Set new members of windows structure.
13436 (make_window): Move down in code. Handle new members of window
13437 structure.
13438 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13439 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13440 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13441 (Fset_window_prev_buffers, Fwindow_next_buffers)
13442 (Fset_window_next_buffers, Fset_window_clone_number):
13443 New functions.
13444 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13445 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13446 Doc-string fixes.
13447 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13448 Argument WINDOW can be now internal window too.
13449 (Fwindow_use_time): Move up in code.
13450 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13451 Rewrite doc-string.
13452 (Fset_window_configuration, saved_window)
13453 (Fcurrent_window_configuration, save_window_save): Handle new
13454 members of window structure.
13455 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13456 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13457 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13458 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13459 Qget_mru_window, Qresize_root_window,
13460 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13461 Qauto_buffer_name; staticpro them.
13462
13463 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13464
13465 * window.c (Fwindow_total_size, Fwindow_left_column)
13466 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13467 (Fwindow_list_1): New functions.
13468 (window_box_text_cols): Replace with window_body_cols.
13469 (Fwindow_width, Fscroll_left, Fscroll_right):
13470 Use window_body_cols instead of window_box_text_cols.
13471 (delete_window, Fset_window_configuration):
13472 Call delete_all_subwindows with window as argument.
13473 (delete_all_subwindows): Take a window as argument and not a
13474 structure. Rewrite.
13475 (window_loop): Remove handling of GET_LRU_WINDOW and
13476 GET_LARGEST_WINDOW.
13477 (Fget_lru_window, Fget_largest_window): Move to window.el.
13478
13479 * window.h: Extern window_body_cols instead of
13480 window_box_text_cols. delete_all_subwindows now takes a
13481 Lisp_Object as argument.
13482
13483 * indent.c (compute_motion, Fcompute_motion):
13484 Use window_body_cols instead of window_box_text_cols.
13485
13486 * frame.c (delete_frame): Call delete_all_subwindows with root
13487 window as argument.
13488
13489 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13490
13491 * fns.c (Fputhash): Document return value.
13492
13493 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13494
13495 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13496
13497 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13498
13499 Cons<->int and similar integer overflow fixes (Bug#8794).
13500
13501 Check for overflow when converting integer to cons and back.
13502 * charset.c (Fdefine_charset_internal, Fdecode_char):
13503 Use cons_to_unsigned to catch overflow.
13504 (Fencode_char): Use INTEGER_TO_CONS.
13505 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13506 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13507 * data.c (long_to_cons, cons_to_long): Remove.
13508 (cons_to_unsigned, cons_to_signed): New functions.
13509 These signal an error for invalid or out-of-range values.
13510 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13511 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13512 * font.c (Ffont_variation_glyphs):
13513 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13514 * lisp.h: Include <intprops.h>.
13515 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13516 (cons_to_signed, cons_to_unsigned): New decls.
13517 (long_to_cons, cons_to_long): Remove decls.
13518 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13519 (Fprimitive_undo): Use CONS_TO_INTEGER.
13520 * xfns.c (Fx_window_property): Likewise.
13521 * xselect.c: Include <limits.h>.
13522 (x_own_selection, selection_data_to_lisp_data):
13523 Use INTEGER_TO_CONS.
13524 (x_handle_selection_request, x_handle_selection_clear)
13525 (x_get_foreign_selection, Fx_disown_selection_internal)
13526 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13527 (lisp_data_to_selection_data): Use cons_to_unsigned.
13528 (x_fill_property_data): Use cons_to_signed.
13529 Report values out of range.
13530
13531 Check for buffer and string overflow more precisely.
13532 * buffer.h (BUF_BYTES_MAX): New macro.
13533 * lisp.h (STRING_BYTES_MAX): New macro.
13534 * alloc.c (Fmake_string):
13535 * character.c (string_escape_byte8):
13536 * coding.c (coding_alloc_by_realloc):
13537 * doprnt.c (doprnt):
13538 * editfns.c (Fformat):
13539 * eval.c (verror):
13540 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13541 since they may not be the same number.
13542 * editfns.c (Finsert_char):
13543 * fileio.c (Finsert_file_contents):
13544 Likewise for BUF_BYTES_MAX.
13545
13546 * image.c: Use ptrdiff_t, not int, for sizes.
13547 (slurp_file): Switch from int to ptrdiff_t.
13548 All uses changed.
13549 (slurp_file): Check that file size fits in both size_t (for
13550 malloc) and ptrdiff_t (for sanity and safety).
13551
13552 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13553 if b->modtime has its maximal value.
13554
13555 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13556
13557 Don't assume time_t can fit into int.
13558 * buffer.h (struct buffer.modtime): Now time_t, not int.
13559 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13560 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13561
13562 Minor fixes for signed vs unsigned integers.
13563 * character.h (MAYBE_UNIFY_CHAR):
13564 * charset.c (maybe_unify_char):
13565 * keyboard.c (read_char, reorder_modifiers):
13566 XINT -> XFASTINT, since the integer must be nonnegative.
13567 * ftfont.c (ftfont_spec_pattern):
13568 * keymap.c (access_keymap, silly_event_symbol_error):
13569 XUINT -> XFASTINT, since the integer must be nonnegative.
13570 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13571 since it makes no difference and we prefer signed.
13572 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13573 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13574 nonnegative.
13575
13576 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13577
13578 * window.h (Fwindow_frame): Declare.
13579
13580 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13581
13582 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13583 (SPARE_MEMORY): Always define.
13584 (LARGE_REQUEST): Remove.
13585 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13586
13587 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13588
13589 * lisp.h: Move EXFUNS for Fframe_root_window,
13590 Fframe_first_window and Fset_frame_selected_window to window.h.
13591
13592 * window.h: Move EXFUNS for Fframe_root_window,
13593 Fframe_first_window and Fset_frame_selected_window here from
13594 lisp.h.
13595
13596 * frame.c (Fwindow_frame, Fframe_first_window)
13597 (Fframe_root_window, Fframe_selected_window)
13598 (Fset_frame_selected_window): Move to window.c.
13599 (Factive_minibuffer_window): Move to minibuf.c.
13600 (Fother_visible_frames_p): New function.
13601
13602 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13603
13604 * window.c (decode_window, decode_any_window): Move up in code.
13605 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13606 (inhibit_frame_unsplittable): Remove unused variable.
13607 (Fwindow_buffer): Move up and rewrite doc-string.
13608 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13609 (Fwindow_prev): New functions.
13610 (Fwindow_frame): Move here from frame.c. Accept any window as
13611 argument.
13612 (Fframe_root_window, Fframe_first_window)
13613 (Fframe_selected_window): Move here from frame.c. Accept frame
13614 or arbitrary window as argument. Update doc-strings.
13615 (Fminibuffer_window): Move up in code.
13616 (Fwindow_minibuffer_p): Move up in code and simplify.
13617 (Fset_frame_selected_window): Move here from frame.c.
13618 Marginal rewrite.
13619 (Fselected_window, select_window, Fselect_window): Move up in
13620 code. Minor doc-string fixes.
13621
13622 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13623
13624 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13625 Do not assume that spare memory exists; that assumption is valid
13626 only if SYSTEM_MALLOC.
13627 (LARGE_REQUEST): New macro, so that the issue of large requests
13628 is separated from the issue of spare memory.
13629
13630 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13631
13632 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13633 format. (Bug#8806)
13634
13635 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13636
13637 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13638 before statements.
13639
13640 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13641
13642 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13643
13644 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13645
13646 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13647 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13648
13649 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13650
13651 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13652
13653 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13654
13655 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13656 (x_clipboard_manager_save): Add return value.
13657 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13658 New error handlers.
13659 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13660 Obey Vx_select_enable_clipboard_manager. Catch errors in
13661 x_clipboard_manager_save (Bug#8779).
13662 (Vx_select_enable_clipboard_manager): New variable.
13663 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13664
13665 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13666
13667 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13668
13669 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13670
13671 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13672 in the current matrix if keep_current_p is non-zero.
13673
13674 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13675
13676 * bidi.c (bidi_level_of_next_char): Fix last change.
13677
13678 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13679
13680 Support bidi reordering of text covered by display properties.
13681
13682 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13683 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13684 (bidi_cache_search, bidi_cache_iterator_state)
13685 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13686 (bidi_level_of_next_char, bidi_move_to_visually_next):
13687 Support character positions inside a run of characters covered by a
13688 display string.
13689 (bidi_paragraph_init, bidi_resolve_explicit_1)
13690 (bidi_level_of_next_char): Call bidi_fetch_char and
13691 bidi_fetch_char_advance instead of FETCH_CHAR and
13692 FETCH_CHAR_ADVANCE.
13693 (bidi_init_it): Initialize new members.
13694 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13695 definitions.
13696 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13697 instead of using explicit *_CHAR codes.
13698 (bidi_resolve_explicit, bidi_resolve_weak):
13699 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13700 bidirectional text is supported only in multibyte buffers.
13701 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13702 it to initialize the frame_window_p member of struct bidi_it.
13703 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13704 (bidi_resolve_explicit, bidi_resolve_weak)
13705 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13706 bidi_it->nchars is non-positive.
13707 (bidi_level_of_next_char): Don't try to lookup the cache for the
13708 next/previous character if nothing is cached there yet, or if we
13709 were just reseat()'ed to a new position.
13710
13711 * xdisp.c (set_cursor_from_row): Set start and stop points
13712 according to the row's direction when priming the loop that looks
13713 for the glyph on which to display cursor.
13714 (single_display_spec_intangible_p): Function deleted.
13715 (display_prop_intangible_p): Reimplement to call
13716 handle_display_spec instead of single_display_spec_intangible_p.
13717 Accept 3 additional arguments needed by handle_display_spec.
13718 This fixes incorrect cursor motion across display property with complex
13719 values: lists, `(when COND...)' forms, etc.
13720 (single_display_spec_string_p): Support property values that are
13721 lists with the argument STRING its top-level element.
13722 (display_prop_string_p): Fix the condition for processing a
13723 property that is a list to be consistent with handle_display_spec.
13724 (handle_display_spec): New function, refactored from the
13725 last portion of handle_display_prop.
13726 (compute_display_string_pos): Accept additional argument
13727 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13728 value of a `display' property is a "replacing spec".
13729 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13730 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13731 the display property, but just return a value indicating whether
13732 the display property will replace the characters it covers.
13733 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13734 frame_window_p members of struct bidi_it.
13735 (compute_display_string_pos, compute_display_string_end):
13736 New functions.
13737 (push_it): Accept second argument POSITION, where pop_it should
13738 jump to continue iteration.
13739 (reseat_1): Initialize bidi_it.disp_pos.
13740
13741 * keyboard.c (adjust_point_for_property): Adjust the call to
13742 display_prop_intangible_p to its new signature.
13743
13744 * dispextern.h (struct bidi_it): New member frame_window_p.
13745 (bidi_init_it): Update prototypes.
13746 (display_prop_intangible_p): Update prototype.
13747 (compute_display_string_pos, compute_display_string_end):
13748 Declare prototypes.
13749 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13750 EMACS_INT.
13751
13752 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13753
13754 Malloc failure behavior now depends on size of allocation.
13755 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13756 * lisp.h: Change signatures accordingly.
13757 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13758 All callers changed. (Bug#8762)
13759
13760 * gnutls.c: Use Emacs's memory allocators.
13761 Without this change, the gnutls library would invoke malloc etc.
13762 directly, which causes problems on non-SYNC_INPUT hosts, and which
13763 runs afoul of improving memory_full behavior. (Bug#8761)
13764 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13765 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13766 xfree instead of the default malloc, realloc, free.
13767 (Fgnutls_boot): No need to check for memory allocation failure,
13768 since xmalloc does that for us.
13769
13770 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13771 * category.c (hash_get_category_set):
13772 * ccl.c (ccl_driver):
13773 * charset.c (Fdefine_charset_internal):
13774 * charset.h (struct charset.hash_index):
13775 * composite.c (get_composition_id, gstring_lookup_cache)
13776 (composition_gstring_put_cache):
13777 * composite.h (struct composition.hash_index):
13778 * dispextern.h (struct image.hash):
13779 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13780 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13781 (hashfn_equal, hashfn_user_defined, make_hash_table)
13782 (maybe_resize_hash_table, hash_lookup, hash_put)
13783 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13784 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13785 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13786 * image.c (make_image, search_image_cache, lookup_image)
13787 (xpm_put_color_table_h):
13788 * lisp.h (struct Lisp_Hash_Table):
13789 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13790 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13791 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13792 * alloc.c (allocate_vectorlike):
13793 Check for overflow in vector size calculations.
13794 * ccl.c (ccl_driver):
13795 Check for overflow when converting EMACS_INT to int.
13796 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13797 need to be updated by these changes.
13798 * fns.c (make_hash_table, maybe_resize_hash_table):
13799 Check for integer overflow with large hash tables.
13800 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13801 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13802 (SXHASH_REDUCE): New macro.
13803 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13804 Use it instead of discarding useful hash info with large hash values.
13805 (sxhash_float): New function.
13806 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13807 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13808 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13809 Rewrite to use FIXNUM_BITS, as this simplifies things.
13810 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13811 Adjust signatures to match updated version of code.
13812 (consing_since_gc): Now EMACS_INT, since a single hash table can
13813 use more than INT_MAX bytes.
13814
13815 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13816
13817 Make it possible to build with GCC-4.6+ -O2 -flto.
13818
13819 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13820
13821 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13822
13823 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13824 Call minibuffer-inactive-mode.
13825
13826 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13827
13828 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13829 Update dependencies.
13830
13831 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13832
13833 * data.c (init_data): Remove code for UTS, this system is not
13834 supported anymore.
13835
13836 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13837
13838 Don't force ./temacs to start in terminal mode.
13839
13840 * frame.c (make_initial_frame): Initialize faces in all cases, not
13841 only when CANNOT_DUMP is defined.
13842 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13843
13844 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13845
13846 * dispnew.c (add_window_display_history): Use const for the string
13847 pointer. Remove declaration, not needed.
13848
13849 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13850
13851 Use 'inline', not 'INLINE'.
13852 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13853 * alloc.c, fontset.c (INLINE): Remove.
13854 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13855 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13856 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13857 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13858 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13859
13860 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13861
13862 Make it possible to run ./temacs.
13863
13864 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13865 syms_of_callproc does the same thing. Remove test for
13866 "initialized", do it in the caller.
13867 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13868
13869 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13870
13871 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13872 (read_minibuf): Use get_minibuffer.
13873 (syms_of_minibuf): Use DEFSYM.
13874 (Qmetadata): New var.
13875 * data.c (Qbuffer): Don't make it static.
13876 (syms_of_data): Use DEFSYM.
13877
13878 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13879
13880 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13881 (CCL_CODE_MIN): New macro.
13882
13883 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13884
13885 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13886
13887 * eval.c (Qdebug): Now static.
13888 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13889 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13890 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13891
13892 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13893
13894 * image.c: Various fixes to ImageMagick code comments.
13895 (Fimagemagick_types): Doc fix.
13896
13897 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13898
13899 Minor fixes prompted by GCC 4.6.0 warnings.
13900
13901 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13902
13903 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13904 (x_clipboard_manager_save_all): Move extern decl to ...
13905 * xterm.h: ... here, so that it can be checked for consistency.
13906
13907 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13908
13909 * xselect.c (x_clipboard_manager_save_frame)
13910 (x_clipboard_manager_save_all): New functions.
13911 (Fx_clipboard_manager_save): Lisp function deleted.
13912
13913 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13914 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13915
13916 * xterm.h: Update prototype.
13917
13918 2011-05-28 William Xu <william.xwl@gmail.com>
13919
13920 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13921 exiting (Bug#8239).
13922
13923 2011-05-28 Jim Meyering <meyering@redhat.com>
13924
13925 Avoid a sign-extension bug in crypto_hash_function.
13926 * fns.c (to_uchar): Define.
13927 (crypto_hash_function): Use it to convert some newly-signed
13928 variables to unsigned, to avoid sign-extension bugs. For example,
13929 without this change, (md5 "truc") would evaluate to
13930 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13931 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13932 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13933
13934 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13935
13936 Integer overflow fixes.
13937
13938 * dbusbind.c: Serial number integer overflow fixes.
13939 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13940 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13941 to hold a serial number that is too large for a fixnum.
13942 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13943 Check for serial numbers out of range. Decode any serial number
13944 that was so large that it became a float. (Bug#8722)
13945
13946 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13947 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13948 Use XFASTINT rather than XUINT when numbers are nonnegative.
13949 (xd_append_arg, Fdbus_method_return_internal):
13950 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13951 arguments, check that Lisp number is nonnegative, rather than
13952 silently wrapping negative numbers around. (Bug#8722)
13953 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13954 (Bug#8722)
13955
13956 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13957
13958 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13959
13960 ccl: Add integer overflow checks.
13961 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13962 (IN_INT_RANGE): New macros.
13963 (ccl_driver): Use them to check for integer overflow when
13964 decoding a CCL program. Many of the new checks are whether XINT (x)
13965 fits in int; it doesn't always, on 64-bit hosts. The new version
13966 doesn't catch all possible integer overflows, but it's an
13967 improvement. (Bug#8719)
13968
13969 * alloc.c (make_event_array): Use XINT, not XUINT.
13970 There's no need for unsigned here.
13971
13972 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13973 This follows up to the 2011-05-06 change that substituted uintptr_t
13974 for EMACS_INT. This case wasn't caught back then.
13975
13976 Rework Fformat to avoid integer overflow issues.
13977 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13978 now (part of C89). Include <verify.h>.
13979 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13980 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13981 (Fformat): Avoid the prepass trying to compute sizes; it was only
13982 approximate and thus did not catch overflow reliably. Instead, walk
13983 through the format just once, formatting and computing sizes as we go,
13984 checking for integer overflow at every step, and allocating a larger
13985 buffer as needed. Keep track separately whether the format is
13986 multibyte. Keep only the most-recently calculated precision, rather
13987 than them all. Record whether each argument has been converted to
13988 string. Use EMACS_INT, not int, for byte and char and arg counts.
13989 Support field widths and precisions larger than INT_MAX. Avoid
13990 sprintf's undefined behavior with conversion specifications such as %#d
13991 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13992 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13993 formatting out-of-range floating point numbers with int
13994 formats. (Bug#8668)
13995
13996 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13997
13998 * data.c: Avoid integer truncation in expressions involving floats.
13999 * data.c: Include <intprops.h>.
14000 (arith_driver): When there's an integer overflow in an expression
14001 involving floating point, convert the integers to floating point
14002 so that the resulting value does not suffer from catastrophic
14003 integer truncation. For example, on a 64-bit host (* 4
14004 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14005 Do not rely on undefined behavior after integer overflow.
14006
14007 merge count_size_as_multibyte, parse_str_to_multibyte
14008 * character.c, character.h (count_size_as_multibyte):
14009 Rename from parse_str_to_multibyte; all uses changed.
14010 Check for integer overflow.
14011 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14012 since it's now a duplicate of the other. This is more of
14013 a character than a buffer op, so better that it's in character.c.
14014 * fns.c, print.c: Adjust to above changes.
14015
14016 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14017
14018 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14019
14020 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14021
14022 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14023 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14024 (x_clipboard_manager_save): Now static.
14025 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14026
14027 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14028 (crypto_hash_function): Now static.
14029 Fix pointer signedness problems. Avoid unnecessary initializations.
14030
14031 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14032
14033 * termhooks.h (Vselection_alist): Make it terminal-local.
14034
14035 * terminal.c (create_terminal): Initialize it.
14036
14037 * xselect.c: Support for clipboard managers.
14038 (Vselection_alist): Move to termhooks.h as terminal-local var.
14039 (LOCAL_SELECTION): New macro.
14040 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14041 (symbol_to_x_atom): Remove gratuitous arg.
14042 (x_handle_selection_request, lisp_data_to_selection_data)
14043 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14044 (x_own_selection, x_get_local_selection, x_convert_selection):
14045 New arg, specifying work frame. Use terminal-local Vselection_alist.
14046 (some_frame_on_display): Delete unused function.
14047 (Fx_own_selection_internal, Fx_get_selection_internal)
14048 (Fx_disown_selection_internal, Fx_selection_owner_p)
14049 (Fx_selection_exists_p): New optional frame arg.
14050 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14051 (x_handle_selection_clear): Don't treat other terminals with the
14052 same keyboard specially. Use the terminal-local Vselection_alist.
14053 (x_clear_frame_selections): Use Frun_hook_with_args.
14054
14055 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14056
14057 * xterm.h: Add support for those atoms.
14058
14059 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14060
14061 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14062 (converted_selections, conversion_fail_tag): New global variables.
14063 (x_selection_request_lisp_error): Free the above.
14064 (x_get_local_selection): Remove unnecessary code.
14065 (x_reply_selection_request): Args changed; handle arbitrary array
14066 of converted selections stored in converted_selections.
14067 Separate the XChangeProperty and SelectionNotify steps.
14068 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14069 (x_convert_selection): New function.
14070 (x_handle_selection_event): Simplify.
14071 (x_get_foreign_selection): Don't ignore incoming requests while
14072 waiting for an answer; this will fail when we implement
14073 SAVE_TARGETS, and seems unnecessary anyway.
14074 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14075 (Vx_sent_selection_functions): Doc fix.
14076
14077 2011-05-26 Leo Liu <sdl.web@gmail.com>
14078
14079 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14080
14081 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14082
14083 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14084
14085 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14086 for fringe update if it has periodic bitmap.
14087 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14088 and fringe_bitmap_periodic_p.
14089
14090 * fringe.c (get_fringe_bitmap_data): New function.
14091 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14092 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14093 row. Mark glyph row for fringe update if periodicity changed.
14094
14095 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14096 for fringe update unless it has periodic bitmap.
14097
14098 2011-05-25 Kenichi Handa <handa@m17n.org>
14099
14100 * xdisp.c (get_next_display_element): Set correct it->face_id for
14101 a static composition.
14102
14103 2011-05-24 Leo Liu <sdl.web@gmail.com>
14104
14105 * deps.mk (fns.o):
14106 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14107
14108 * fns.c (crypto_hash_function, Fsha1): New function.
14109 (Fmd5): Use crypto_hash_function.
14110 (syms_of_fns): Add Ssha1.
14111
14112 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14113
14114 * gnutls.c: Remove unused macros.
14115 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14116 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14117 Remove macros that are defined and never used.
14118 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14119
14120 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14121
14122 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14123 (Fx_get_selection_internal): Minor cleanup.
14124 (Fx_own_selection_internal): Rename arguments for consistency with
14125 select.el.
14126
14127 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14128
14129 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14130
14131 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14132
14133 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14134
14135 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14136
14137 * dispnew.c (scrolling_window): Don't exclude the case that the
14138 last enabled row in the desired matrix touches the bottom boundary.
14139
14140 2011-05-21 Glenn Morris <rgm@gnu.org>
14141
14142 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14143 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14144 and add some more files.
14145
14146 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14147
14148 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14149 report_file_error introduced by the change from 2011-05-07.
14150
14151 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14152
14153 * systime.h (Time): Define only if emacs is defined.
14154 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14155 where the include path doesn't have X11/X.h by default. See
14156 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14157
14158 2011-05-20 Kenichi Handa <handa@m17n.org>
14159
14160 * composite.c (find_automatic_composition): Fix previous change.
14161
14162 2011-05-20 Glenn Morris <rgm@gnu.org>
14163
14164 * lisp.mk: New file, split from Makefile.in.
14165 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14166 (shortlisp): Remove.
14167 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14168
14169 2011-05-19 Glenn Morris <rgm@gnu.org>
14170
14171 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14172 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14173 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14174 (lisp): Set the order to that of loadup.el.
14175 (shortlisp): Make it a copy of $lisp.
14176 (SOME_MACHINE_LISP): Remove.
14177 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14178 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14179
14180 2011-05-18 Kenichi Handa <handa@m17n.org>
14181
14182 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14183 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14184 (find_automatic_composition): Mostly rewrite for efficiency.
14185
14186 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14187
14188 * makefile.w32-in: Update dependencies.
14189
14190 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14191
14192 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14193 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14194
14195 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14196
14197 Fix some integer overflow issues, such as string length overflow.
14198
14199 * insdel.c (count_size_as_multibyte): Check for string overflow.
14200
14201 * character.c (lisp_string_width): Check for string overflow.
14202 Use EMACS_INT, not int, for string indexes and lengths; in
14203 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14204 the resulting string length overflows an EMACS_INT; instead,
14205 report a string overflow if no precision given. When checking for
14206 precision exhaustion, use a check that cannot possibly have
14207 integer overflow. (Bug#8675)
14208 * character.h (lisp_string_width): Adjust to new signature.
14209
14210 * alloc.c (string_overflow): New function.
14211 (Fmake_string): Use it. This doesn't change behavior, but saves
14212 a few bytes and will simplify future changes.
14213 * character.c (string_escape_byte8): Likewise.
14214 * lisp.h (string_overflow): New decl.
14215
14216 Fixups, following up to the user-interface timestamp change.
14217 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14218 for UI timestamps, instead of unsigned long.
14219 * msdos.c (mouse_get_pos): Likewise.
14220 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14221 * w32gui.h (Time): Define by including "systime.h" rather than by
14222 declaring it ourselves. (Bug#8664)
14223
14224 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14225 * image.c (clear_image_cache): Likewise.
14226
14227 * term.c (term_mouse_position): Don't assume time_t wraparound.
14228
14229 Be more systematic about user-interface timestamps.
14230 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14231 and sometimes 'EMACS_UINT', to represent these timestamps.
14232 This change causes it to use 'Time' uniformly, as that's what X uses.
14233 This makes the code easier to follow, and makes it easier to catch
14234 integer overflow bugs such as Bug#8664.
14235 * frame.c (Fmouse_position, Fmouse_pixel_position):
14236 Use Time, not unsigned long, for user-interface timestamps.
14237 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14238 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14239 * keyboard.h (last_event_timestamp): Likewise.
14240 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14241 * menu.h (xmenu_show): Likewise.
14242 * term.c (term_mouse_position): Likewise.
14243 * termhooks.h (struct input_event.timestamp): Likewise.
14244 (struct terminal.mouse_position_hook): Likewise.
14245 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14246 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14247 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14248 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14249 what it was before.
14250 * menu.h, termhooks.h: Include "systime.h", for Time.
14251
14252 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14253 Don't assume that the difference between two unsigned long values
14254 can fit into an integer. At this point, we know button_down_time
14255 <= event->timestamp, so the difference must be nonnegative, so
14256 there's no need to cast the result if double-click-time is
14257 nonnegative, as it should be; check that it's nonnegative, just in
14258 case. This bug is triggered when events are more than 2**31 ms
14259 apart (about 25 days). (Bug#8664)
14260
14261 * xselect.c (last_event_timestamp): Remove duplicate decl.
14262 (x_own_selection): Remove needless cast to unsigned long.
14263
14264 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14265 that always fit in int. Use a sentinel instead of a counter, to
14266 avoid a temp and to allay GCC's concerns about possible int overflow.
14267 * frame.h (struct frame): Use int for menu_bar_items_used
14268 instead of EMACS_INT, since it always fits in int.
14269
14270 * menu.c (grow_menu_items): Check for int overflow.
14271
14272 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14273
14274 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14275 Before, the code was not consistent. These values cannot exceed
14276 2**31 - 1 so there's no need to make them unsigned.
14277 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14278 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14279 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14280 as modifiers.
14281 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14282
14283 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14284 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14285 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14286 presumably because the widths might not match.
14287
14288 * window.c (size_window): Avoid needless test at loop start.
14289
14290 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14291
14292 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14293
14294 2011-05-12 Drew Adams <drew.adams@oracle.com>
14295
14296 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14297
14298 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14299
14300 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14301 `width' to `bar_area_x' and `bar_area_width', respectively.
14302 (x_scroll_run): Take account of fringe background extension.
14303
14304 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14305 Rename local vars `left' and `width' to `bar_area_x' and
14306 `bar_area_width', respectively.
14307 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14308 background extension.
14309
14310 2011-05-10 Jim Meyering <meyering@redhat.com>
14311
14312 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14313
14314 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14315
14316 * image.c (Finit_image_library): Return t for built-in image types,
14317 like pbm and xbm. (Bug#8640)
14318
14319 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14320
14321 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14322
14323 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14324
14325 * w32console.c (Fset_screen_color): Doc fix.
14326 (Fget_screen_color): New function.
14327 (syms_of_ntterm): Defsubr it.
14328
14329 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14330 unlink the temporary file if Fcall_process didn't create it in the
14331 first place.
14332 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14333 child process will be redirected to a file specified with `:file'.
14334 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14335 cue to call_process_cleanup not to close that handle.
14336
14337 2011-05-07 Ben Key <bkey76@gmail.com>
14338
14339 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14340 one of two shell specific rules, either bootstrap-temacs-CMD or
14341 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14342 to the previous implementation of the bootstrap-temacs rule.
14343 The bootstrap-temacs-CMD rule is similar to the previous
14344 implementation of the bootstrap-temacs rule except that it
14345 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14346 variable.
14347
14348 These changes, along with some changes to nt/configure.bat,
14349 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14350 earlier fix to add support for --cflags and --ldflags options
14351 that include quotes so that it works whether make uses cmd or
14352 sh as the shell.
14353
14354 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14355
14356 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14357 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14358 is a constant.
14359 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14360 a string. Handle both cases.
14361 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14362 (Fdbus_register_method): Use Qinvalid_function.
14363
14364 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14365
14366 * makefile.w32-in: Update dependencies.
14367 (LISP_H): Add inttypes.h and stdin.h.
14368 (PROCESS_H): Add unistd.h.
14369
14370 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14371
14372 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14373 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14374
14375 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14376
14377 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14378
14379 * term.c (vfatal): Remove stray call to va_end.
14380 It's not needed and the C Standard doesn't allow it here anyway.
14381
14382 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14383 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14384
14385 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14386 bytes.
14387
14388 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14389
14390 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14391
14392 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14393
14394 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14395
14396 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14397
14398 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14399 * charset.c (Fdefine_charset_internal): Don't initialize
14400 charset.code_space[15]. The value was garbage, on hosts with
14401 32-bit int (Bug#8600).
14402
14403 * lread.c (read_integer): Be more consistent with string-to-number.
14404 Use string_to_number to do the actual conversion; this avoids
14405 rounding errors and fixes some other screwups. Without this fix,
14406 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14407 (digit_to_number): Move earlier, for benefit of read_integer.
14408 Return -1 if the digit is out of range for the base, -2 if it is
14409 not a digit in any supported base. (Bug#8602)
14410
14411 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14412
14413 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14414 to match comment at start of function. This also removes a
14415 GCC warning about overflow in a 32+64-bit port.
14416
14417 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14418
14419 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14420 Reported by Stefan Monnier in
14421 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14422 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14423 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14424
14425 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14426 (EMACS_UINTPTR): Likewise, with uintptr_t.
14427
14428 * lisp.h: Prefer 64-bit EMACS_INT if available.
14429 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14430 on 32-bit hosts that have 64-bit int, so that they can access
14431 large files.
14432 However, temporarily disable this change unless the temporary
14433 symbol WIDE_EMACS_INT is defined.
14434
14435 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14436
14437 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14438 This removes an assumption that EMACS_INT and long are the same
14439 width as pointers. The assumption is true for Emacs porting targets
14440 now, but we want to make other targets possible.
14441 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14442 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14443 In the rest of the code, change types of integers that hold casted
14444 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14445 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14446 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14447 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14448 No need to cast type when ORing.
14449 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14450 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14451 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14452 assume EMACS_INT is the same width as char *.
14453 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14454 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14455 Remove no-longer-needed casts.
14456 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14457 (xg_tool_bar_help_callback, xg_make_tool_item):
14458 Use EMACS_INTPTR to hold an integer
14459 that will be cast to void *; this can avoid a GCC warning
14460 if EMACS_INT is not the same width as void *.
14461 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14462 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14463 (current_message_1, set_message_1):
14464 Use a local to convert to proper width without a cast.
14465 * xmenu.c (dialog_selection_callback): Likewise.
14466
14467 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14468 Also, don't assume VALBITS / RAND_BITS is less than 5,
14469 and don't rely on undefined behavior when shifting a 1 left into
14470 the sign bit.
14471 * lisp.h (get_random): Change signature to match.
14472
14473 * lread.c (hash_string): Use size_t, not int, for hash computation.
14474 Normally we prefer signed values; but hashing is special, because
14475 it's better to use unsigned division on hash table sizes so that
14476 the remainder is nonnegative. Also, size_t is the natural width
14477 for hashing into memory. The previous code used 'int', which doesn't
14478 retain enough info to hash well into very large tables.
14479 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14480
14481 * dbusbind.c: Don't possibly lose pointer info when converting.
14482 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14483 Use XPNTR rather than XHASH, so that the high-order bits of
14484 the pointer aren't lost when converting through void *.
14485
14486 * eval.c (Fautoload): Don't double-shift a pointer.
14487
14488 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14489
14490 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14491
14492 * gnutls.c (DEF_GNUTLS_FN):
14493 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14494
14495 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14496
14497 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14498 marker. (Bug#8610)
14499
14500 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14501
14502 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14503 New version that can reserve upto 2GB of heap space.
14504
14505 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14506
14507 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14508
14509 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14510
14511 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14512 `gnutls_certificate_set_x509_key_file'.
14513
14514 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14515
14516 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14517 Update dependencies.
14518
14519 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14520
14521 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14522 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14523 Remove unused parameter `fildes'.
14524 * process.c (read_process_output, send_process): Don't pass it.
14525
14526 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14527
14528 Fix previous change: the library cache is defined in w32.c.
14529 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14530 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14531
14532 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14533
14534 Implement dynamic loading of GnuTLS on Windows.
14535
14536 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14537 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14538 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14539 Declare.
14540
14541 * gnutls.c (Qgnutls_dll): Define.
14542 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14543 (gnutls_*): Declare function pointers.
14544 (init_gnutls_functions): New function to initialize function pointers.
14545 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14546 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14547 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14548 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14549 (emacs_gnutls_write, emacs_gnutls_read)
14550 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14551 (Fgnutls_available_p): New function.
14552 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14553 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14554 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14555
14556 * image.c: Include w32.h.
14557 (Vimage_type_cache): Delete.
14558 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14559 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14560 (w32_delayed_load): Move to w32.c.
14561
14562 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14563
14564 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14565 (w32_delayed_load): Move from image.c. When loading a library, record
14566 its filename in the :loaded-from property of the library id.
14567 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14568 Initialize and staticpro them.
14569 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14570
14571 * process.c: Include lisp.h before w32.h, not after.
14572 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14573 instead of gnutls_record_check_pending.
14574
14575 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14576
14577 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14578
14579 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14580 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14581 as passed in.
14582
14583 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14584
14585 * xterm.c (x_set_frame_alpha): Do not set property on anything
14586 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14587
14588 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14589
14590 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14591
14592 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14593
14594 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14595 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14596 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14597 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14598 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14599 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14600 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14601 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14602 (Qgnutls_bootprop_callbacks_verify): Make static.
14603
14604 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14605
14606 * callproc.c: Indentation fixup.
14607
14608 * sysdep.c (wait_for_termination_1): Make static.
14609 (wait_for_termination, interruptible_wait_for_termination):
14610 Move after wait_for_termination_1.
14611
14612 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14613
14614 * sysdep.c (interruptible_wait_for_termination): New function
14615 which is like wait_for_termination, but allows keyboard
14616 interruptions.
14617
14618 * callproc.c (Fcall_process): Add (:file "file") as an option for
14619 the STDOUT buffer.
14620 (Fcall_process_region): Ditto.
14621
14622 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14623
14624 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14625 rather than `XVECTOR (FOO)->size'.
14626
14627 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14628 inttypes.h, as a gnulib replacement is used if it not available in
14629 system headers.
14630
14631 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14632
14633 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14634 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14635 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14636
14637 * coding.c (coding_alloc_by_realloc): Error out if destination
14638 will grow beyond MOST_POSITIVE_FIXNUM.
14639 (decode_coding_emacs_mule): Abort if there isn't enough place in
14640 charbuf for the composition carryover bytes. Reserve an extra
14641 space for up to 2 characters produced in a loop.
14642 (decode_coding_iso_2022): Abort if there isn't enough place in
14643 charbuf for the composition carryover bytes.
14644
14645 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14646
14647 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14648 aborting when %lld or %lll format is passed.
14649 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14650 %llo or %llx format is passed. (Bug#8545)
14651
14652 * window.c (window_scroll_line_based): Use a marker instead of
14653 simple variables to record original value of point. (Bug#7952)
14654
14655 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14656 produced by %s or %c overflows available buffer space. (Bug#8545)
14657
14658 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14659
14660 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14661 (SIZE_MAX): Move defn after all includes, as they might #define it.
14662
14663 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14664
14665 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14666
14667 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14668
14669 * keyboard.c (Qdelayed_warnings_hook): Define.
14670 (command_loop_1): Run `delayed-warnings-hook'
14671 if Vdelayed_warnings_list is non-nil.
14672 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14673 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14674
14675 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14676
14677 * doprnt.c (doprnt): Don't return value smaller than the buffer
14678 size if the message was truncated. (Bug#8545).
14679
14680 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14681
14682 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14683 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14684
14685 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14686
14687 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14688
14689 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14690
14691 * makefile.w32-in: Update dependencies.
14692
14693 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14694
14695 Improve `doprnt' and its usage. (Bug#8545)
14696 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14697 `format_end'. Remove support for %l as a conversion specifier.
14698 Don't use xrealloc. Improve diagnostics when the %l size modifier
14699 is used. Update the commentary.
14700
14701 * eval.c (verror): Simplify calculation of size_t.
14702
14703 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14704 messages.
14705
14706 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14707
14708 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14709 change.
14710
14711 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14712
14713 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14714 This makes this file independent of the recent pseudovector change.
14715
14716 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14717
14718 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14719
14720 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14721 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14722 Remove unused local.
14723 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14724
14725 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14726 GCC 4.6.0 optimizes based on type-based alias analysis.
14727 For example, if b is of type struct buffer * and v of type struct
14728 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14729 != &v->size, and therefore "v->size = 1; b->size = 2; return
14730 v->size;" must therefore return 1. This assumption is incorrect
14731 for Emacs, since it type-puns struct Lisp_Vector * with many other
14732 types. To fix this problem, this patch adds a new type struct
14733 vectorlike_header that documents the constraints on layout of vectors
14734 and pseudovectors, and helps optimizing compilers not get fooled
14735 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14736 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14737 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14738 the size member.
14739 (XSETPVECTYPE): Rewrite in terms of new macro.
14740 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14741 This is a bit clearer, and further avoids the possibility of
14742 undesirable aliasing.
14743 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14744 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14745 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14746 since Lisp_Subr is a special case (no "next" field).
14747 (ASIZE): Now uses header.size rather than size.
14748 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14749 to avoid the hassle of writing XVECTOR (foo)->header.size.
14750 (struct vectorlike_header): New type.
14751 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14752 object, to help avoid aliasing.
14753 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14754 (SUBRP): Likewise, since Lisp_Subr is a special case.
14755 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14756 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14757 (struct Lisp_Hash_Table): Combine first two members into a single
14758 struct vectorlike_header member. All uses of "size" and "next" members
14759 changed to be "header.size" and "header.next".
14760 * buffer.h (struct buffer): Likewise.
14761 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14762 * frame.h (struct frame): Likewise.
14763 * process.h (struct Lisp_Process): Likewise.
14764 * termhooks.h (struct terminal): Likewise.
14765 * window.c (struct save_window_data, struct saved_window): Likewise.
14766 * window.h (struct window): Likewise.
14767 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14768 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14769 * buffer.c (init_buffer_once): Likewise.
14770 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14771 special case.
14772 * process.c (Fformat_network_address): Use local var for size,
14773 for brevity.
14774
14775 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14776
14777 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14778 * data.c (atof): Remove decl; no longer used or needed.
14779 (digit_to_number): Move to lread.c.
14780 (Fstring_to_number): Use new string_to_number function, to be
14781 consistent with how the Lisp reader treats infinities and NaNs.
14782 Do not assume that floating-point numbers represent EMACS_INT
14783 without losing information; this is not true on most 64-bit hosts.
14784 Avoid double-rounding errors, by insisting on integers when
14785 parsing non-base-10 numbers, as the documentation specifies.
14786 * lisp.h (string_to_number): New decl, replacing ...
14787 (isfloat_string): Remove.
14788 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14789 (read1): Do not accept +. and -. as integers; this
14790 appears to have been a coding error. Similarly, do not accept
14791 strings like +-1e0 as floating point numbers. Do not report
14792 overflow for integer overflows unless the base is not 10 which
14793 means we have no simple and reliable way to continue.
14794 Break out the floating-point parsing into a new
14795 function string_to_number, so that Fstring_to_number parses
14796 floating point numbers consistently with the Lisp reader.
14797 (digit_to_number): Move here from data.c. Make it static inline.
14798 (E_CHAR, EXP_INT): Remove, replacing with ...
14799 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14800 (string_to_number): New function, replacing isfloat_string.
14801 This function checks for valid syntax and produces the resulting
14802 Lisp float number too. Rework it so that string-to-number
14803 no longer mishandles examples like "1.0e+". Use strtoumax,
14804 so that overflow for non-base-10 numbers is reported only when
14805 there's no portable and simple way to convert to floating point.
14806
14807 * textprop.c (set_text_properties_1): Rewrite for clarity,
14808 and to avoid GCC warning about integer overflow.
14809
14810 * intervals.h (struct interval): Use EMACS_INT for members
14811 where EMACS_UINT might cause problems. See
14812 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14813 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14814 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14815 All uses changed.
14816 (offset_intervals): Tell GCC not to worry about length overflow
14817 when negating a negative length.
14818
14819 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14820 (overrun_check_free): Likewise.
14821
14822 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14823 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14824 word size.
14825
14826 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14827 (gnutls_make_error): Rename local to avoid shadowing.
14828 (gnutls_emacs_global_deinit): ifdef out; not used.
14829 (Fgnutls_boot): Use const for pointer to readonly storage.
14830 Comment out unused local. Fix pointer signedness problems.
14831
14832 * lread.c (openp): Don't stuff size_t into an 'int'.
14833 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14834 about possible signed overflow.
14835
14836 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14837 (GDK_KEY_g): Don't define if already defined.
14838 (xg_prepare_tooltip): Avoid pointer signedness problem.
14839 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14840
14841 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14842 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14843
14844 * xfns.c (Fx_window_property): Simplify a bit,
14845 to make a bit faster and to avoid GCC 4.6.0 warning.
14846 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14847
14848 * fns.c (internal_equal): Don't assume size_t fits in int.
14849
14850 * alloc.c (compact_small_strings): Tighten assertion a little.
14851
14852 Replace pEd with more-general pI, and fix some printf arg casts.
14853 * lisp.h (pI): New macro, generalizing old pEd macro to other
14854 conversion specifiers. For example, use "...%"pI"d..." rather
14855 than "...%"pEd"...".
14856 (pEd): Remove. All uses replaced with similar uses of pI.
14857 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14858 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14859 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14860 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14861 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14862 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14863 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14864 64-bit hosts.
14865 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14866 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14867 * print.c (safe_debug_print, print_object): Likewise.
14868 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14869 to int.
14870 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14871 avoiding the 0 flag, which is not portable.
14872 * process.c (Fmake_network_process): Use pI to avoid cast.
14873 * region-cache.c (pp_cache): Likewise.
14874 * xdisp.c (decode_mode_spec): Likewise.
14875 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14876 behavior on 64-bit hosts with printf arg.
14877 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14878 (x_stop_queuing_selection_requests): Likewise.
14879 (x_get_window_property): Don't truncate byte count to an 'int'
14880 when tracing.
14881
14882 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14883 here, since it parses constructs like leading '-' and spaces,
14884 which are not wanted; and it overflows with large numbers.
14885 Instead, simply match F[0-9]+, which is what is wanted anyway.
14886
14887 * alloc.c: Remove unportable assumptions about struct layout.
14888 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14889 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14890 (allocate_vectorlike, make_pure_vector): Use the new macros,
14891 plus offsetof, to remove unportable assumptions about struct layout.
14892 These assumptions hold on all porting targets that I know of, but
14893 they are not guaranteed, they're easy to remove, and removing them
14894 makes further changes easier.
14895
14896 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14897 This doesn't fix a bug but makes the code clearer.
14898 (string_overrun_cookie): Now const. Use initializers that
14899 don't formally overflow signed char, to avoid warnings.
14900 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14901 can cause Emacs to crash when string overrun checking is enabled.
14902 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14903 multiple of sizeof (EMACS_INT); it need not be, if
14904 alignof(EMACS_INT) < sizeof (EMACS_INT).
14905 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14906
14907 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14908
14909 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14910
14911 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14912
14913 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14914 supposed to be handshaking. (Bug#8556)
14915 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14916
14917 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14918
14919 * lisp.h (Qdebug): List symbol.
14920 * eval.c (Qdebug): Restore global linkage.
14921 * keyboard.c (debug-on-event): New variable.
14922 (handle_user_signal): Break into debugger when debug-on-event
14923 matches the current signal symbol.
14924
14925 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14926
14927 * alloc.c (check_sblock, check_string_bytes)
14928 (check_string_free_list): Convert to standard C.
14929
14930 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14931
14932 * w32.c (emacs_gnutls_push): Fix typo.
14933
14934 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14935
14936 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14937 "cast to pointer from integer of different size".
14938
14939 Improve doprnt and its use in verror. (Bug#8545)
14940 * doprnt.c (doprnt): Document the set of format control sequences
14941 supported by the function. Use SAFE_ALLOCA instead of always
14942 using `alloca'.
14943
14944 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14945 is one byte too soon. Don't use xrealloc; instead xfree and
14946 xmalloc anew.
14947
14948 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14949
14950 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14951 callbacks stage.
14952
14953 * gnutls.c: Renamed global_initialized to
14954 gnutls_global_initialized. Added internals for the
14955 :verify-hostname-error, :verify-error, and :verify-flags
14956 parameters of `gnutls-boot' and documented those parameters in the
14957 docstring. Start callback support.
14958 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14959 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14960 on error. Return error code.
14961 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14962 (emacs_gnutls_read): Likewise.
14963 (Fgnutls_boot): Return handshake error code.
14964 (emacs_gnutls_handle_error): New function.
14965 (wsaerror_to_errno): Likewise.
14966
14967 * w32.h (emacs_gnutls_pull): Add prototype.
14968 (emacs_gnutls_push): Likewise.
14969
14970 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14971 (emacs_gnutls_push): Likewise.
14972
14973 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14974
14975 * process.c (wait_reading_process_output): Check if GnuTLS
14976 buffered some data internally if no FDs are set for TLS
14977 connections.
14978
14979 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14980 (LIBS): Link to USER_LIBS.
14981 ($(BLD)/gnutls.$(0)): New target.
14982
14983 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14984
14985 * xdisp.c (handle_single_display_spec): Rename the
14986 display_replaced_before_p argument into display_replaced_p, to
14987 make it consistent with the commentary. Fix typos in the
14988 commentary.
14989
14990 * textprop.c (syms_of_textprop): Remove dead code.
14991 (copy_text_properties): Delete obsolete commentary about an
14992 interface that was deleted long ago. Fix typos in the description
14993 of arguments.
14994
14995 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14996 to changes in oldXMenu/XMenu.h from 2011-04-16.
14997 <menu_help_message, prev_menu_help_message>: Constify.
14998 (IT_menu_make_room): menu->help_text is now `const char **';
14999 adjust.
15000
15001 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15002 to changes in oldXMenu/XMenu.h from 2011-04-16.
15003 (struct XMenu): Declare `help_text' `const char **'.
15004
15005 * xfaces.c <Qunspecified>: Make extern again.
15006
15007 * syntax.c: Include sys/types.h before including regex.h, as
15008 required by POSIX.
15009
15010 * doc.c (get_doc_string): Improve the format passed to `error'.
15011
15012 * doprnt.c (doprnt): Improve commentary.
15013
15014 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15015
15016 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15017 them with etags.
15018
15019 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15020 changes in globals.h immediately force recompilation.
15021 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15022 $(CURDIR)/s/ms-w32.h.
15023 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15024
15025 * character.c (Fchar_direction): Function deleted.
15026 (syms_of_character): Don't defsubr it.
15027 <char-direction-table>: Deleted.
15028
15029 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15030
15031 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15032 * doprnt.c: Include limits.h.
15033 (SIZE_MAX): New macro.
15034 (doprnt): Return a size_t value. 2nd arg is now size_t.
15035 Many local variables are now size_t instead of int or unsigned.
15036 Improve overflow protection. Support `l' modifier for integer
15037 conversions. Support %l conversion. Don't assume an EMACS_INT
15038 argument for integer conversions and for %c.
15039
15040 * lisp.h (doprnt): Restore prototype.
15041
15042 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15043 $(SRC)/character.h.
15044
15045 * Makefile.in (base_obj): Add back doprnt.o.
15046
15047 * deps.mk (doprnt.o): Add back prerequisites.
15048 (callint.o): Depend on character.h.
15049
15050 * eval.c (internal_lisp_condition_case): Include the handler
15051 representation in the error message.
15052 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15053 when breaking from the loop.
15054
15055 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15056
15057 * callint.c (Fcall_interactively): When displaying error message
15058 about invalid control letter, pass the character's codepoint, not
15059 a pointer to its multibyte form. Improve display of the character
15060 in octal and display also its hex code.
15061
15062 * character.c (char_string): Use %x to display the (unsigned)
15063 codepoint of an invalid character, to avoid displaying a bogus
15064 negative value.
15065
15066 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15067 `error', not SYMBOL_NAME itself.
15068
15069 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15070 character arguments to `error'.
15071
15072 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15073 to `error' in error message about FINAL_CHAR argument. Make sure
15074 FINAL_CHAR is a character, and use %c when it is passed as
15075 argument to `error'.
15076
15077 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15078
15079 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15080
15081 * w32.c: Include <time.h>.
15082 (sys_localtime): New function.
15083
15084 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15085
15086 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15087
15088 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15089
15090 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15091
15092 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15093 zombies (Bug#8467).
15094
15095 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15096
15097 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15098 gl_state.e_property when gl_state.object is Qt.
15099
15100 * insdel.c (make_gap_larger): Remove limitation of buffer size
15101 to <= INT_MAX.
15102
15103 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15104
15105 * xdisp.c (lookup_glyphless_char_display)
15106 (produce_glyphless_glyph): Handle cons cell entry in
15107 glyphless-char-display.
15108 (Vglyphless_char_display): Document it.
15109
15110 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15111 glyphless-char-display.
15112
15113 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15114
15115 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15116
15117 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15118
15119 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15120 definition for no-X builds.
15121
15122 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15123
15124 Static checks with GCC 4.6.0 and non-default toolkits.
15125
15126 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15127
15128 * process.c (keyboard_bit_set): Define only if SIGIO.
15129 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15130 (send_process): Repair possible setjmp clobbering.
15131
15132 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15133
15134 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15135
15136 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15137
15138 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15139 Define only if needed.
15140
15141 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15142 by pacifying GCC about it. Maybe it's time to retire it?
15143 * xfaces.c (USG, __TIMEVAL__): Likewise.
15144
15145 * dispextern.h (struct redisplay_interface): Rename param
15146 to avoid shadowing.
15147 * termhooks.h (struct terminal): Likewise.
15148 * xterm.c (xembed_send_message): Likewise.
15149
15150 * insdel.c (make_gap_smaller): Define only if
15151 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15152
15153 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15154 it.
15155
15156 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15157 so that we aren't warned about unused symbols.
15158
15159 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15160
15161 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15162
15163 * xfns.c (x_real_positions): Mark locals as initialized.
15164
15165 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15166
15167 * xterm.c: Fix problems found by static analysis with other toolkits.
15168 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15169 (x_dispatch_event): Declare static if USE_GTK, and
15170 define if USE_GTK || USE_X_TOOLKIT.
15171 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15172 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15173 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15174 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15175
15176 * xmenu.c (menu_help_callback): Pointer type fixes.
15177 Use const pointers when pointing at readonly data. Avoid pointer
15178 signedness clashes.
15179 (FALSE): Remove unused macro.
15180 (update_frame_menubar): Remove unused decl.
15181
15182 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15183
15184 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15185 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15186 (single_menu_item): Rename local to avoid shadowing.
15187
15188 * keyboard.c (make_lispy_event): Remove unused local var.
15189
15190 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15191 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15192
15193 * bitmaps: Change bitmaps from unsigned char back to the X11
15194 compatible char. Avoid the old compiler warnings about
15195 out-of-range initializers by using, for example, '\xab' rather
15196 than 0xab.
15197
15198 * xgselect.c (xgselect_initialize): Check vs interface
15199 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15200
15201 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15202
15203 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15204 to read-only memory.
15205
15206 * fns.c (vector): Remove; this old hack is no longer needed.
15207
15208 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15209 Remove unused var.
15210 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15211
15212 * xrdb.c (x_load_resources): Omit unused local.
15213
15214 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15215 (x_window): Rename locals to avoid shadowing.
15216 (USG): Use the kludged USG macro, to pacify gcc.
15217
15218 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15219 (x_term_init): Remove local to avoid shadowing.
15220
15221 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15222
15223 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15224 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15225
15226 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15227
15228 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15229
15230 Fix regex.c, syntax.c and friends for buffers > 2GB.
15231 * syntax.h (struct gl_state_s): Declare character position members
15232 EMACS_INT.
15233
15234 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15235
15236 * textprop.c (verify_interval_modification, interval_of):
15237 Declare arguments EMACS_INT.
15238
15239 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15240 EMACS_INT.
15241
15242 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15243
15244 * indent.c (Fvertical_motion): Local variable it_start is now
15245 EMACS_INT.
15246
15247 * regex.c (re_match, re_match_2, re_match_2_internal)
15248 (bcmp_translate, regcomp, regexec, print_double_string)
15249 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15250 (re_compile_pattern, re_exec): Declare arguments and local
15251 variables `size_t' and `ssize_t' and return values `regoff_t', as
15252 appropriate.
15253 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15254 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15255 <compile_stack_type>: `size' and `avail' are now `size_t'.
15256
15257 * regex.h <regoff_t>: Use ssize_t, not int.
15258 (re_search, re_search_2, re_match, re_match_2): Arguments that
15259 specify buffer/string position and length are now ssize_t and
15260 size_t. Return type is regoff_t.
15261
15262 2011-04-16 Ben Key <bkey76@gmail.com>
15263
15264 * nsfont.m: Fixed bugs in ns_get_family and
15265 ns_descriptor_to_entity that were caused by using free to
15266 deallocate memory blocks that were allocated by xmalloc (via
15267 xstrdup). This caused Emacs to crash when compiled with
15268 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15269 --enable-checking=xmallocoverrun). xfree is now used to
15270 deallocate these memory blocks.
15271
15272 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15273
15274 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15275
15276 emacs_write: Accept and return EMACS_INT for sizes.
15277 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15278 et seq.
15279 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15280 Accept and return EMACS_INT.
15281 (emacs_gnutls_write): Return the number of bytes written on
15282 partial writes.
15283 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15284 (emacs_read, emacs_write): Remove check for negative size, as the
15285 Emacs source code has been audited now.
15286 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15287 (emacs_read, emacs_write): Use it.
15288 * process.c (send_process): Adjust to the new signatures of
15289 emacs_write and emacs_gnutls_write. Do not attempt to store
15290 a byte offset into an 'int'; it might overflow.
15291 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15292
15293 * sound.c: Don't assume sizes fit in 'int'.
15294 (struct sound_device.period_size, alsa_period_size):
15295 Return EMACS_INT, not int.
15296 (struct sound_device.write, vox_write, alsa_write):
15297 Accept EMACS_INT, not int.
15298 (wav_play, au_play): Use EMACS_INT to store sizes and to
15299 record read return values.
15300
15301 2011-04-15 Ben Key <bkey76@gmail.com>
15302
15303 * keyboard.c (Qundefined): Don't declare static since it is used
15304 in nsfns.m.
15305 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15306 static since they are used in nsfont.m.
15307
15308 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15309
15310 * process.c (Qprocessp): Don't declare static.
15311 * lisp.h (Qprocessp): Declare again.
15312
15313 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15314
15315 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15316
15317 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15318
15319 Improve C-level modularity by making more things 'static'.
15320
15321 Don't publish debugger-only interfaces to other modules.
15322 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15323 (verify_bytepos, count_markers): Move decls to the only modules
15324 that need them.
15325 * region-cache.h (pp_cache): Likewise.
15326 * window.h (check_all_windows): Likewise.
15327 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15328
15329 * sysdep.c (croak): Now static, if
15330 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15331 * syssignal.h (croak): Declare only if not static.
15332
15333 * alloc.c (refill_memory_reserve): Now static if
15334 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15335 * lisp.h (refill_memory_reserve): Declare only if not static.
15336
15337 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15338 Define only if USE_LUCID.
15339
15340 * xrdb.c (x_customization_string, x_rm_string): Now static.
15341
15342 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15343 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15344
15345 * xdisp.c (draw_row_with_mouse_face): Now static.
15346 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15347
15348 * window.h (check_all_windows): Mark externally visible.
15349
15350 * window.c (window_deletion_count): Now static.
15351
15352 * undo.c: Make symbols static if they're not exported.
15353 (last_undo_buffer, last_boundary_position, pending_boundary):
15354 Now static.
15355
15356 * textprop.c (interval_insert_behind_hooks): Now static.
15357 (interval_insert_in_front_hooks): Likewise.
15358
15359 * term.c: Make symbols static if they're not exported.
15360 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15361 (max_frame_lines, tty_set_terminal_modes):
15362 (tty_reset_terminal_modes, tty_turn_off_highlight):
15363 (get_tty_terminal): Now static.
15364 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15365 * termhooks.h (term_mouse_moveto): Do not declare if
15366 HAVE_WINDOW_SYSTEM.
15367 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15368 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15369
15370 * sysdep.c: Make symbols static if they're not exported.
15371 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15372 Now static.
15373 (sigprocmask_set, full_mask): Remove; unused.
15374 (wait_debugging): Mark as visible.
15375 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15376 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15377
15378 * syntax.c (syntax_temp): Define only if !__GNUC__.
15379
15380 * sound.c (current_sound_device, current_sound): Now static.
15381
15382 * search.c (searchbufs, searchbuf_head): Now static.
15383
15384 * scroll.c (scroll_cost): Remove; unused.
15385 * dispextern.h (scroll_cost): Remove decl.
15386
15387 * region-cache.h (pp_cache): Mark as externally visible.
15388
15389 * process.c: Make symbols static if they're not exported.
15390 (process_tick, update_tick, create_process, chan_process):
15391 (Vprocess_alist, proc_buffered_char, datagram_access):
15392 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15393 (deactivate_process): Mark defn as static, as well as decl.
15394 * lisp.h (create_process): Remove decl.
15395 * process.h (chan_process, Vprocess_alist): Remove decls.
15396
15397 * print.c: Make symbols static if they're not exported.
15398 (print_depth, new_backquote_output, being_printed, print_buffer):
15399 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15400 (print_interval, print_number_index, initial_stderr_stream):
15401 Now static.
15402 * lisp.h (Fprinc): Remove decl.
15403 (debug_output_compilation_hack): Mark as externally visible.
15404
15405 * sysdep.c (croak): Move decl from here to syssignal.h.
15406 * syssignal.h (croak): Put it here, so the API can be checked when
15407 'croak' is called from dissociate_if_controlling_tty.
15408
15409 * minibuf.c: Make symbols static if they're not exported.
15410 (minibuf_save_list, choose_minibuf_frame): Now static.
15411 * lisp.h (choose_minibuf_frame): Remove decl.
15412
15413 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15414
15415 * lread.c: Make symbols static if they're not exported.
15416 (read_objects, initial_obarray, oblookup_last_bucket_number):
15417 Now static.
15418 (make_symbol): Remove; unused.
15419 * lisp.h (initial_obarray, make_symbol): Remove decls.
15420
15421 * keyboard.c: Make symbols static if they're not exported.
15422 (single_kboard, recent_keys_index, total_keys, recent_keys):
15423 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15424 (this_single_command_key_start, echoing, last_auto_save):
15425 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15426 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15427 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15428 (Vlispy_mouse_stem, double_click_count):
15429 Now static.
15430 (force_auto_save_soon): Define only if SIGDANGER.
15431 (ignore_mouse_drag_p): Now static if
15432 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15433 (print_help): Remove; unused.
15434 (stop_character, last_timer_event): Mark as externally visible.
15435 * keyboard.h (ignore_mouse_drag_p): Declare only if
15436 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15437 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15438 * lisp.h (echoing): Remove decl.
15439 (force_auto_save_soon): Declare only if SIGDANGER.
15440 * xdisp.c (redisplay_window): Simplify code, to make it more
15441 obvious that ignore_mouse_drag_p is not accessed if !defined
15442 USE_GTK && !defined HAVE_NS.
15443
15444 * intervals.c: Make symbols static if they're not exported.
15445 (merge_properties_sticky, merge_interval_right, delete_interval):
15446 Now static.
15447 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15448
15449 * insdel.c: Make symbols static if they're not exported.
15450 However, leave prepare_to_modify_buffer alone. It's never
15451 called from outside this function, but that appears to be a bug.
15452 (combine_after_change_list, combine_after_change_buffer):
15453 (adjust_after_replace, signal_before_change): Now static.
15454 (adjust_after_replace_noundo): Remove; unused.
15455 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15456 (signal_before_change): Remove decls.
15457
15458 * indent.c (val_compute_motion, val_vmotion): Now static.
15459
15460 * image.c: Make symbols static if they're not exported.
15461 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15462 if USE_GTK.
15463 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15464 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15465
15466 * fringe.c (standard_bitmaps): Now static.
15467 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15468
15469 * frame.c: Make symbols static if they're not exported.
15470 (x_report_frame_params, make_terminal_frame): Now static.
15471 (get_frame_param): Now static, unless HAVE_NS.
15472 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15473 (x_get_resource_string): Remove; not used.
15474 * frame.h (make_terminal_frame, x_report_frame_params):
15475 (x_get_resource_string); Remove decls.
15476 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15477 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15478
15479 * font.c, fontset.c: Make symbols static if they're not exported.
15480 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15481 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15482 * font.c (font_close_object): Now static.
15483 * font.h (font_close_object): Remove.
15484 * fontset.c (FONTSET_OBJLIST): Remove.
15485 (free_realized_fontset) #if-0 the body, which does nothing.
15486 (face_suitable_for_char_p): #if-0, as it's never called.
15487 * fontset.h (face_suitable_for_char_p): Remove decl.
15488 * xfaces.c (face_at_string_position):
15489 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15490 since 0 is always ASCII.
15491
15492 * fns.c (weak_hash_tables): Now static.
15493
15494 * fileio.c: Make symbols static if they're not exported.
15495 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15496 (Vwrite_region_annotation_buffers): Now static.
15497
15498 * eval.c: Make symbols static if they're not exported.
15499 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15500 * lisp.h (backtrace_list): Remove decl.
15501
15502 * emacs.c: Make symbols static if they're not exported.
15503 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15504 (fatal_error_code, fatal_error_signal_hook, standard_args):
15505 Now static.
15506 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15507 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15508 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15509 * lisp.h (fatal_error_signal_hook): Remove decl.
15510 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15511
15512 * editfns.c: Move a (normally-unused) function to its only use.
15513 * editfns.c, lisp.h (get_operating_system_release): Remove.
15514 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15515 worth the hassle of breaking this out.
15516
15517 * xterm.c: Make symbols static if they're not exported.
15518 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15519 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15520 (x_destroy_window, x_delete_display):
15521 Now static.
15522 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15523 (x_mouse_leave): Remove; unused.
15524 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15525 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15526 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15527 Remove decls.
15528 (x_mouse_leave): Declare only if WINDOWSNT.
15529 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15530 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15531 USE_X_TOOLKIT.
15532
15533 * ftxfont.c: Make symbols static if they're not exported.
15534 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15535 HAVE_FREETYPE.
15536 * font.h (ftxfont_driver): Likewise.
15537
15538 * xfns.c: Make symbols static if they're not exported.
15539 (x_last_font_name, x_display_info_for_name):
15540 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15541 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15542 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15543 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15544 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15545 (last_show_tip_args): Now static.
15546 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15547 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15548 (x_screen_planes): Remove; unused.
15549 * dispextern.h (x_screen_planes): Remove decl.
15550
15551 * dispnew.c: Make symbols static if they're not exported.
15552 * dispextern.h (redraw_garbaged_frames, scrolling):
15553 (increment_row_positions): Remove.
15554 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15555 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15556 Now static.
15557 (redraw_garbaged_frames): Remove; unused.
15558
15559 * xfaces.c: Make symbols static if they're not exported.
15560 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15561 Remove decls.
15562 * xterm.h (defined_color): Remove decls.
15563 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15564 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15565 (menu_face_changed_default, defined_color, free_realized_face):
15566 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15567 (ascii_face_of_lisp_face): Remove; unused.
15568
15569 * xdisp.c: Make symbols static if they're not exported.
15570 * dispextern.h (scratch_glyph_row, window_box_edges):
15571 (glyph_to_pixel_coords, set_cursor_from_row):
15572 (get_next_display_element, set_iterator_to_next):
15573 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15574 (show_mouse_face): Remove decls
15575 * frame.h (message_buf_print): Likewise.
15576 * lisp.h (pop_message, set_message, check_point_in_composition):
15577 Likewise.
15578 * xterm.h (set_vertical_scroll_bar): Likewise.
15579 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15580 (message_buf_print, scratch_glyph_row, displayed_buffer):
15581 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15582 (get_next_display_element, show_mouse_face, window_box_edges):
15583 (frame_to_window_pixel_xy, check_point_in_composition):
15584 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15585 (glyph_to_pixel_coords): Remove; unused.
15586
15587 * dired.c (file_name_completion): Now static.
15588
15589 * dbusbind.c (xd_in_read_queued_messages): Now static.
15590
15591 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15592 * data.c (circular_list_error): Remove.
15593
15594 * commands.h (last_point_position, last_point_position_buffer):
15595 (last_point_position_window): Remove decls.
15596 * keyboard.c: Make these variables static.
15597
15598 * coding.h (coding, code_convert_region, encode_coding_gap):
15599 Remove decls.
15600 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15601 (iso_code_class, detect_coding, code_convert_region): Now static.
15602 (encode_coding_gap): Remove; unused.
15603
15604 * chartab.c (chartab_chars, chartab_bits): Now static.
15605
15606 * charset.h (charset_iso_8859_1): Remove decl.
15607 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15608 Now static.
15609
15610 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15611 * ccl.c (Vccl_program_table): Now static.
15612 (check_ccl_update): Remove; unused.
15613
15614 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15615 * category.h: ... from here.
15616 * category.c (check_category_table, set_category_set): Now static.
15617
15618 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15619 * lisp.h: Remove these decls.
15620
15621 * buffer.c (buffer_count): Remove unused var.
15622
15623 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15624 so that it's not optimized away.
15625 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15626 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15627 exported only to the debugger.
15628
15629 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15630 * atimer.h (run_all_atimers): Remove; not exported.
15631
15632 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15633 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15634 was inaccessible from Lisp.
15635 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15636 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15637
15638 alloc.c: Import and export fewer symbols, and remove unused items.
15639 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15640 is defined.
15641 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15642 it's not optimized away by whole-program optimization.
15643 (message_enable_multibyte, free_misc): Remove.
15644 (catchlist, handlerlist, mark_backtrace):
15645 Declare only if BYTE_MARK_STACK.
15646 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15647 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15648 (message_enable_multibyte): Remove decl.
15649 (free_misc, interval_free_list, float_block, float_block_index):
15650 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15651 (cons_free_list, last_marked_index):
15652 Now static.
15653 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15654 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15655 (mark_backtrace): Define only if BYTE_MARK_STACK.
15656 * xdisp.c (message_enable_multibyte): Now static.
15657
15658 Declare Lisp_Object Q* variables to be 'static' if not exported.
15659 This makes it easier for human readers (and static analyzers)
15660 to see whether these variables are used from other modules.
15661 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15662 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15663 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15664 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15665 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15666 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15667 * xmenu.c, xselect.c:
15668 Declare Q* vars static if they are not used in other modules.
15669 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15670 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15671 Remove decls of unexported vars.
15672 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15673
15674 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15675
15676 Make Emacs functions such as Fatom 'static' by default.
15677 This makes it easier for human readers (and static analyzers)
15678 to see whether these functions can be called from other modules.
15679 DEFUN now defines a static function. To make the function external
15680 so that it can be used in other C modules, use the new macro DEFUE.
15681 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15682 (Finit_image_library):
15683 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15684 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15685 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15686 Remove decls, since these functions are now static.
15687 (Funintern, Fget_internal_run_time): New decls, since these functions
15688 were already external.
15689
15690 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15691 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15692 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15693 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15694 * keyboard.c, keymap.c, lread.c:
15695 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15696 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15697 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15698 Mark functions with DEFUE instead of DEFUN,
15699 if they are used in other modules.
15700 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15701 decls for now-static functions.
15702 * buffer.h (Fdelete_overlay): Remove decl.
15703 * callproc.c (Fgetenv_internal): Mark as internal.
15704 * composite.c (Fremove_list_of_text_properties): Remove decl.
15705 (Fcomposition_get_gstring): New forward static decl.
15706 * composite.h (Fcomposite_get_gstring): Remove decl.
15707 * dired.c (Ffile_attributes): New forward static decl.
15708 * doc.c (Fdocumntation_property): New forward static decl.
15709 * eval.c (Ffetch_bytecode): New forward static decl.
15710 (Funintern): Remove extern decl; now in .h file where it belongs.
15711 * fileio.c (Fmake_symbolic_link): New forward static decl.
15712 * image.c (Finit_image_library): New forward static decl.
15713 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15714 * intervals.h (Fprevious_property_change):
15715 (Fremove_list_of_text_properties): Remove decls.
15716 * keyboard.c (Fthis_command_keys): Remove decl.
15717 (Fcommand_execute): New forward static decl.
15718 * keymap.c (Flookup_key): New forward static decl.
15719 (Fcopy_keymap): Now static.
15720 * keymap.h (Flookup_key): Remove decl.
15721 * process.c (Fget_process): New forward static decl.
15722 (Fprocess_datagram_address): Mark as internal.
15723 * syntax.c (Fsyntax_table_p): New forward static decl.
15724 (skip_chars): Remove duplicate decl.
15725 * textprop.c (Fprevious_property_change): New forward static decl.
15726 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15727 Now internal.
15728 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15729 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15730
15731 * editfns.c (Fformat): Remove unreachable code.
15732
15733 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15734
15735 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15736 change. (Bug#8496)
15737
15738 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15739
15740 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15741 when at ZV. (Bug#8487)
15742
15743 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15744
15745 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15746 (Bug#8437)
15747 * keyboard.c (parse_tool_bar_item): Likewise.
15748 * sound.c (sound_cleanup, alsa_close): Likewise.
15749 * termcap.c (tgetent): Likewise.
15750 * xfns.c (x_default_font_parameter): Likewise.
15751 * xsettings.c (read_and_apply_settings): Likewise.
15752
15753 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15754 (overrun_check_free): Protoize.
15755
15756 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15757
15758 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15759 since callers should never pass a negative size.
15760 Change the signature to match that of plain 'read' and 'write'; see
15761 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15762 * lisp.h: Update prototypes of emacs_write and emacs_read.
15763
15764 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15765
15766 * xdisp.c (redisplay_window): Don't try to determine the character
15767 position of the scroll margin if the window start point w->startp
15768 is outside the buffer's accessible region. (Bug#8468)
15769
15770 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15771
15772 Fix write-region and its subroutines for buffers > 2GB.
15773 * fileio.c (a_write, e_write): Modify declaration of arguments and
15774 local variables to support buffers larger than 2GB.
15775 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15776
15777 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15778 argument, local variables, and return value.
15779
15780 * lisp.h: Update prototypes of emacs_write and emacs_read.
15781
15782 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15783
15784 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15785
15786 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15787
15788 Fix more problems found by GCC 4.6.0's static checks.
15789
15790 * xdisp.c (vmessage): Use a better test for character truncation.
15791
15792 * charset.c (load_charset_map): <, not <=, for optimization,
15793 and to avoid potential problems with integer overflow.
15794 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15795 * casetab.c (set_identity, shuffle): Likewise.
15796 * editfns.c (Fformat): Likewise.
15797 * syntax.c (skip_chars): Likewise.
15798
15799 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15800 This also lets GCC 4.6.0 generate slightly better loop code.
15801
15802 * callint.c (Fcall_interactively): <, not <=, for optimization.
15803 (Fcall_interactively): Count the number of arguments produced,
15804 not the number of arguments given. This is simpler and lets GCC
15805 4.6.0 generate slightly better code.
15806
15807 * ftfont.c: Distingish more carefully between FcChar8 and char.
15808 The previous code passed unsigned char * to a functions like
15809 strlen and xstrcasecmp that expect char *, which does not
15810 conform to the C standard.
15811 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15812 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15813 char * when the C standard requires it.
15814
15815 * keyboard.c (read_char): Remove unused var.
15816
15817 * eval.c: Port to Windows vsnprintf (Bug#8435).
15818 Include <limits.h>.
15819 (SIZE_MAX): Define if the headers do not.
15820 (verror): Do not give up if vsnprintf returns a negative count.
15821 Instead, grow the buffer. This ports to Windows vsnprintf, which
15822 does not conform to C99. Problem reported by Eli Zaretskii.
15823 Also, simplify the allocation scheme, by avoiding the need for
15824 calling realloc, and removing the ALLOCATED variable.
15825
15826 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15827
15828 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15829 But keep the doprint source code for now, as we might revamp it
15830 and use it again (Bug#8435).
15831 * lisp.h (doprnt): Remove.
15832 * Makefile.in (base_obj): Remove doprnt.o.
15833 * deps.mk (doprnt.o): Remove.
15834
15835 error: Print 32- and 64-bit integers portably (Bug#8435).
15836 Without this change, on typical 64-bit hosts error ("...%d...", N)
15837 was used to print both 32- and 64-bit integers N, which relied on
15838 undefined behavior.
15839 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15840 * lisp.h (error, verror): Mark as printf-like functions.
15841 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15842 Report overflow in size calculations when allocating printf buffer.
15843 Do not truncate output string at its first null byte.
15844 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15845 Truncate the output at a character boundary, since vsnprintf does not
15846 do that.
15847 * charset.c (check_iso_charset_parameter): Convert internal
15848 character to string before calling 'error', since %c now has the
15849 printf meaning.
15850 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15851 overflow when computing char to be passed to 'error'. Do not
15852 pass Lisp_Object to 'error'; pass the integer instead.
15853 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15854 formatted with plain %d.
15855
15856 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15857
15858 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15859
15860 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15861
15862 * xterm.c (x_catch_errors): Remove duplicate declaration.
15863
15864 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15865
15866 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15867
15868 2011-04-10 Jim Meyering <meyering@redhat.com>
15869
15870 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15871 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15872 return ssize_t not "int", and use size_t as the buffer length.
15873 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15874 * gnutls.h: Update declarations.
15875 * process.c (read_process_output): Use ssize_t, to match.
15876 (send_process): Likewise.
15877
15878 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15879
15880 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15881
15882 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15883
15884 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15885 Use unsigned char, to match FcChar8 type definition.
15886
15887 * xterm.c (handle_one_xevent):
15888 * xmenu.c (create_and_show_popup_menu):
15889 * xselect.c (x_decline_selection_request)
15890 (x_reply_selection_request): Avoid type-punned deref of X events.
15891
15892 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15893
15894 Fix some uses of `int' instead of EMACS_INT.
15895 * search.c (string_match_1, fast_string_match)
15896 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15897 (scan_buffer, find_next_newline_no_quit)
15898 (find_before_next_newline, search_command, Freplace_match)
15899 (Fmatch_data): Make some `int' variables be EMACS_INT.
15900
15901 * xdisp.c (display_count_lines): 3rd argument and return value now
15902 EMACS_INT. All callers changed.
15903 (pint2hrstr): Last argument is now EMACS_INT.
15904
15905 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15906 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15907 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15908 (decode_coding_utf_16, decode_coding_emacs_mule)
15909 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15910 (decode_coding_ccl, decode_coding_charset)
15911 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15912 (decode_coding_iso_2022, decode_coding_emacs_mule)
15913 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15914 <char_offset, last_offset>: Declare EMACS_INT.
15915 (encode_coding_utf_8, encode_coding_utf_16)
15916 (encode_coding_emacs_mule, encode_invocation_designation)
15917 (encode_designation_at_bol, encode_coding_iso_2022)
15918 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15919 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15920 Declare EMACS_INT.
15921 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15922 (encode_invocation_designation): Last argument P_NCHARS is now
15923 EMACS_INT.
15924 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15925 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15926
15927 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15928 All users changed.
15929
15930 * ccl.c (Fccl_execute_on_string): Declare some variables
15931 EMACS_INT.
15932
15933 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15934
15935 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15936
15937 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15938
15939 * process.c (Fformat_network_address): Doc fix.
15940
15941 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15942
15943 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15944
15945 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15946
15947 * keyboard.c (read_char): Call Lisp function help-form-show,
15948 instead of using internal_with_output_to_temp_buffer.
15949 (Qhelp_form_show): New var.
15950 (syms_of_keyboard): Use DEFSYM macro.
15951
15952 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15953
15954 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15955
15956 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15957
15958 * process.c (Flist_processes): Remove to Lisp.
15959 (list_processes_1): Delete.
15960
15961 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15962
15963 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15964
15965 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15966
15967 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15968
15969 Fix more problems found by GCC 4.6.0's static checks.
15970
15971 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15972
15973 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15974
15975 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15976
15977 * xdisp.c (vmessage): Mark as a printf-like function.
15978
15979 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15980
15981 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15982
15983 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15984 printf-like functions.
15985 (tiff_load): Add casts to remove these marks before passing them
15986 to system-supplied API.
15987
15988 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15989
15990 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15991 This avoids several warnings with gcc -Wstrict-overflow.
15992 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15993 directly, rather than having caller test rule sign. This avoids
15994 some unnecessary tests.
15995 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15996 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15997 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15998
15999 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16000 (xfont_open): Avoid unnecessary tests.
16001
16002 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16003
16004 * composite.h, composite.c (composition_gstring_put_cache):
16005 Use EMACS_INT, not int, for length.
16006
16007 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16008 breaking out part of COMPOSITION_DECODE_RULE.
16009 (COMPOSITION_DECODE_RULE): Use it.
16010 * composite.c (get_composition_id): Remove unused local vars,
16011 by using the new macro.
16012
16013 * textprop.c (set_text_properties_1): Change while to do-while,
16014 since the condition is always true at first.
16015
16016 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16017 (interval_deletion_adjustment): Return unsigned value.
16018 All uses changed.
16019
16020 * process.c (list_processes_1, create_pty, read_process_output):
16021 (exec_sentinel): Remove vars that were set but not used.
16022 (create_pty): Remove unnecessary "volatile"s.
16023 (Fnetwork_interface_info): Avoid possibility of int overflow.
16024 (read_process_output): Do adaptive read buffering even if carryover.
16025 (read_process_output): Simplify nbytes computation if buffered.
16026
16027 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16028
16029 * syntax.c (scan_words): Remove var that was set but not used.
16030 (update_syntax_table): Use unsigned instead of int.
16031
16032 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16033 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16034 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16035
16036 * print.c (print_error_message): Avoid int overflow.
16037
16038 * font.c (font_list_entities): Redo for clarity,
16039 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16040
16041 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16042 (font_score): Avoid potential overflow in diff calculation.
16043
16044 * fns.c (substring_both): Remove var that is set but not used.
16045 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16046
16047 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16048
16049 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16050 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16051 can always succeed if overflow has undefined behavior.
16052
16053 * search.c (boyer_moore, wordify): Remove vars set but not used.
16054 (wordify): Omit three unnecessary tests.
16055
16056 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16057 All callers changed. This avoids the need for an unused var.
16058
16059 * casefiddle.c (casify_region): Remove var that is set but not used.
16060
16061 * dired.c (file_name_completion): Remove var that is set but not used.
16062
16063 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16064
16065 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16066 (Finsert_file_contents): Remove unnecessary code checking fd.
16067
16068 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16069 Check for integer overflow on size calculations.
16070
16071 * buffer.c (Fprevious_overlay_change): Remove var that is set
16072 but not used.
16073
16074 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16075 Remove vars that are set but not used.
16076 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16077 (timer_check_2): Mark vars as initialized.
16078
16079 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16080
16081 * image.c (lookup_image): Remove var that is set but not used.
16082 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16083
16084 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16085 that are set but not used.
16086
16087 * xfns.c (make_invisible_cursor): Don't return garbage
16088 if XCreateBitmapFromData fails (Bug#8410).
16089
16090 * xselect.c (x_get_local_selection, x_handle_property_notify):
16091 Remove vars that are set but not used.
16092
16093 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16094 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16095
16096 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16097 Remove var that is set but not used.
16098 (scroll_bar_windows_size): Now size_t, not int.
16099 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16100 Check for overflow.
16101
16102 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16103 (map_tty_color) [!defined MSDOS]: Likewise.
16104
16105 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16106
16107 * coding.c: Remove vars that are set but not used.
16108 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16109 All callers changed.
16110 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16111 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16112 (decode_coding_charset): Remove vars that are set but not used.
16113
16114 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16115 that is set but not used.
16116
16117 * print.c (print_object): Remove var that is set but not used.
16118
16119 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16120 The gnulib version avoids calling malloc in the usual case,
16121 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16122 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16123 * filelock.c (current_lock_owner): Likewise.
16124 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16125 * sysdep.c: Include allocator.h, careadlinkat.h.
16126 (emacs_no_realloc_allocator): New static constant.
16127 (emacs_readlink): New function.
16128 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16129 ../lib/careadlinkat.h.
16130
16131 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16132
16133 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16134 first non-nil return value).
16135
16136 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16137
16138 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16139 if not defined (Bug#8403).
16140
16141 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16142
16143 * xdisp.c (display_count_lines): Remove parameter `start',
16144 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16145 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16146 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16147 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16148 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16149 and thereabouts. All callers changed.
16150 (get_per_char_metric): Remove parameter `f', unused since
16151 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16152
16153 2011-04-02 Jim Meyering <meyering@redhat.com>
16154
16155 do not dereference NULL upon failed strdup
16156 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16157 (ns_get_family): Likewise.
16158
16159 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16160
16161 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16162
16163 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16164
16165 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16166 later (Bug#8403).
16167
16168 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16169
16170 Add lexical binding.
16171
16172 * window.c (Ftemp_output_buffer_show): New fun.
16173 (Fsave_window_excursion):
16174 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16175
16176 * lread.c (lisp_file_lexically_bound_p): New function.
16177 (Fload): Bind Qlexical_binding.
16178 (readevalloop): Remove `evalfun' arg.
16179 Bind Qinternal_interpreter_environment.
16180 (Feval_buffer): Bind Qlexical_binding.
16181 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16182 Mark as dynamic.
16183 (syms_of_lread): Declare `lexical-binding'.
16184
16185 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16186
16187 * keyboard.c (eval_dyn): New fun.
16188 (menu_item_eval_property): Use it.
16189
16190 * image.c (parse_image_spec): Use Ffunctionp.
16191
16192 * fns.c (concat, mapcar1): Accept byte-code-functions.
16193
16194 * eval.c (Fsetq): Handle lexical vars.
16195 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16196 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16197 (FletX, Flet): Obey lexical binding.
16198 (Fcommandp): Handle closures.
16199 (Feval): New `lexical' arg.
16200 (eval_sub): New function extracted from Feval. Use it almost
16201 everywhere where Feval was used. Look up vars in lexical env.
16202 Handle closures.
16203 (Ffunctionp): Move from subr.el.
16204 (Ffuncall): Handle closures.
16205 (apply_lambda): Remove `eval_flags'.
16206 (funcall_lambda): Handle closures and new byte-code-functions.
16207 (Fspecial_variable_p): New function.
16208 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16209 but without exporting it to Lisp.
16210
16211 * doc.c (Fdocumentation, store_function_docstring):
16212 * data.c (Finteractive_form): Handle closures.
16213
16214 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16215 interactive spec.
16216
16217 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16218 New byte-codes.
16219 (exec_byte_code): New function extracted from Fbyte_code to handle new
16220 calling convention for byte-code-functions. Add new byte-codes.
16221
16222 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16223
16224 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16225
16226 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16227
16228 * xdisp.c (redisplay_internal): Fix prototype.
16229
16230 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16231
16232 * xdisp.c (SCROLL_LIMIT): New macro.
16233 (try_scrolling): Use it when setting scroll_limit.
16234 Limit scrolling to 100 screen lines.
16235 (redisplay_window): Even when falling back on "recentering",
16236 position point in the window according to scroll-conservatively,
16237 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16238
16239 (try_scrolling): When point is above the window, allow searching
16240 as far as scroll_max, or one screenful, to compute vertical
16241 distance from PT to the scroll margin position. This prevents
16242 try_scrolling from unnecessarily failing when
16243 scroll-conservatively is set to a value slightly larger than the
16244 window height. Clean up the case of PT below the margin at bottom
16245 of window: scroll_max can no longer be INT_MAX. When aggressive
16246 scrolling is in use, don't let point enter the opposite scroll
16247 margin as result of the scroll.
16248 (syms_of_xdisp) <scroll-conservatively>: Document the
16249 threshold of 100 lines for never-recentering scrolling.
16250
16251 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16252
16253 * dispextern.h (move_it_by_lines):
16254 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16255 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16256 (message_log_check_duplicate): Remove parameters `prev_bol' and
16257 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16258 (redisplay_internal): Remove parameter `preserve_echo_area',
16259 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16260
16261 * indent.c (Fvertical_motion):
16262 * window.c (window_scroll_pixel_based, Frecenter):
16263 Don't pass `need_y_p' to `move_it_by_lines'.
16264
16265 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16266
16267 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16268 steal a few bits to be more compact.
16269 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16270 Remove unneeded casts.
16271
16272 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16273
16274 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16275
16276 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16277 binding" message (bug#7967).
16278
16279 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16280
16281 Fix more problems found by GCC 4.6.0's static checks.
16282
16283 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16284 Remove unused local var.
16285
16286 * editfns.c (Fmessage_box): Remove unused local var.
16287
16288 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16289 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16290 Omit unused local vars.
16291 * window.c (shrink_windows): Omit unused local var.
16292 * menu.c (digest_single_submenu): Omit unused local var.
16293 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16294 Omit unused local var.
16295
16296 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16297 Don't assume string length fits in int.
16298 (keyremap_step, read_key_sequence): Use size_t for sizes.
16299 (read_key_sequence): Don't check last_real_key_start redundantly.
16300
16301 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16302 instead of alloca (Bug#8344).
16303
16304 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16305 (Fbacktrace_frame): Don't assume nframes fits in int.
16306
16307 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16308
16309 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16310 concerns.
16311
16312 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16313
16314 * cm.c (calccost): Turn while-do into do-while, for clarity.
16315
16316 * keyboard.c (syms_of_keyboard): Use the same style as later
16317 in this function when indexing through an array. This also
16318 works around GCC bug 48267.
16319
16320 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16321
16322 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16323
16324 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16325 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16326
16327 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16328 This avoids undefined behavior on integer overflow, and is a bit
16329 more convenient anyway since it is compared to a size_t variable.
16330
16331 Variadic C functions now count arguments with size_t, not int.
16332 This avoids an unnecessary limitation on 64-bit machines, which
16333 caused (substring ...) to crash on large vectors (Bug#8344).
16334 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16335 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16336 All variadic functions and their callers changed accordingly.
16337 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16338 * data.c (arith_driver, float_arith_driver): Likewise.
16339 * editfns.c (general_insert_function): Likewise.
16340 * eval.c (struct backtrace.nargs, interactive_p)
16341 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16342 (funcall_lambda, mark_backtrace): Likewise.
16343 * fns.c (concat): Likewise.
16344 * frame.c (x_set_frame_parameters): Likewise.
16345 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16346 0 if not found, not -1. All callers changed.
16347
16348 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16349 (stack_copy_size): Now size_t, not int.
16350 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16351
16352 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16353
16354 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16355 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16356 All callers changed.
16357
16358 * lisp.h (multibyte_char_to_unibyte):
16359 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16360 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16361 * character.h (CHAR_TO_BYTE8):
16362 * cmds.c (internal_self_insert):
16363 * editfns.c (general_insert_function):
16364 * keymap.c (push_key_description):
16365 * search.c (Freplace_match):
16366 * xdisp.c (message_dolog, set_message_1): All callers changed.
16367
16368 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16369
16370 * keyboard.c (safe_run_hook_funcall): New function.
16371 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16372 don't set the hook to nil, but remove the offending function instead.
16373 (Qcommand_hook_internal): Remove, unused.
16374 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16375 Vcommand_hook_internal.
16376
16377 * eval.c (enum run_hooks_condition): Remove.
16378 (funcall_nil, funcall_not): New functions.
16379 (run_hook_with_args): Call each function through a `funcall' argument.
16380 Remove `cond' argument, now redundant.
16381 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16382 (Frun_hook_with_args_until_failure): Adjust accordingly.
16383 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16384
16385 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16386
16387 * dispextern.h (string_buffer_position): Remove declaration.
16388
16389 * print.c (strout): Remove parameter `multibyte', unused since
16390 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16391
16392 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16393 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16394 All callers changed.
16395
16396 * w32.c (_wsa_errlist): Use braces for struct initializers.
16397
16398 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16399 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16400 All callers changed.
16401 (string_buffer_position): Likewise. Also, make static (it's never
16402 used outside xdisp.c).
16403 (cursor_row_p): Remove parameter `w', unused since
16404 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16405 (decode_mode_spec): Remove parameter `precision', introduced during
16406 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16407 All callers changed.
16408
16409 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16410
16411 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16412
16413 2011-03-27 Anders Lindgren <andlind@gmail.com>
16414
16415 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16416 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16417 (ns_update_auto_hide_menu_bar): New functions.
16418 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16419 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16420 ns_constrain_all_frames.
16421 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16422 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16423
16424 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16425
16426 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16427
16428 2011-03-27 Glenn Morris <rgm@gnu.org>
16429
16430 * syssignal.h: Replace RETSIGTYPE with void.
16431 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16432 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16433 Replace SIGTYPE with void everywhere.
16434 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16435 * s/template.h (SIGTYPE): Remove commented out definition.
16436
16437 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16438
16439 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16440 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16441
16442 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16443
16444 * w32.c (read_unc_volume): Use parameter `henum', instead of
16445 global variable `wget_enum_handle'.
16446
16447 * keymap.c (describe_vector): Remove parameters `indices' and
16448 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16449 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16450
16451 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16452
16453 * keyboard.c (timer_check): Remove parameter `do_it_now',
16454 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16455 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16456 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16457
16458 * keyboard.c (read_char):
16459 * w32menu.c (w32_menu_display_help):
16460 * xmenu.c (show_help_event, menu_help_callback):
16461 Adjust calls to `show_help_echo'.
16462
16463 * gtkutil.c (xg_maybe_add_timer):
16464 * keyboard.c (readable_events):
16465 * process.c (wait_reading_process_output):
16466 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16467
16468 * insdel.c (adjust_markers_gap_motion):
16469 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16470 (gap_left, gap_right): Don't call it.
16471
16472 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16473
16474 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16475 incurred during fontification.
16476
16477 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16478
16479 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16480 (DEFVAR_PER_BUFFER): Don't pass it.
16481
16482 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16483 (scrolling_window): Don't pass it.
16484
16485 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16486
16487 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16488
16489 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16490 and `suffix'.
16491 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16492 of variables specific to SELinux and computation of `encoded_absname'.
16493
16494 * image.c (XPutPixel): Remove unused variable `height'.
16495
16496 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16497
16498 * unexw32.c (get_section_info): Remove unused variable `section'.
16499
16500 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16501 (system_process_attributes): Remove unused variable `sess'.
16502 (sys_read): Remove unused variable `err'.
16503
16504 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16505 (w32_wnd_proc): Remove unused variable `isdead'.
16506 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16507 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16508 (x_create_tip_frame): Remove unused variable `tem'.
16509
16510 * w32inevt.c (w32_console_read_socket):
16511 Remove unused variable `no_events'.
16512
16513 * w32term.c (x_draw_composite_glyph_string_foreground):
16514 Remove unused variable `width'.
16515
16516 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16517
16518 * w32term.c (x_set_glyph_string_clipping):
16519 Don't pass uninitialized region to CombineRgn.
16520
16521 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16522
16523 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16524 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16525 (Fx_close_connection): Remove unused variable `i'.
16526
16527 * w32font.c (w32font_draw): Return number of glyphs.
16528 (w32font_open_internal): Remove unused variable `i'.
16529 (w32font_driver): Add missing initializer.
16530
16531 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16532 (fill_in_menu): Remove unused variable `items_added'.
16533
16534 * w32term.c (last_mouse_press_frame): Remove static global variable.
16535 (w32_clip_to_row): Remove unused variable `f'.
16536 (x_delete_terminal): Remove unused variable `i'.
16537
16538 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16539 (NOTHING): Remove unused static global variable.
16540 (uniscribe_check_otf): Remove unused variable `table'.
16541 (uniscribe_font_driver): Add missing initializers.
16542
16543 2011-03-23 Julien Danjou <julien@danjou.info>
16544
16545 * term.c (Fsuspend_tty, Fresume_tty):
16546 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16547 * window.c (temp_output_buffer_show):
16548 * insdel.c (signal_before_change):
16549 * frame.c (Fhandle_switch_frame):
16550 * fileio.c (Fdo_auto_save):
16551 * emacs.c (Fkill_emacs):
16552 * editfns.c (save_excursion_restore):
16553 * cmds.c (internal_self_insert):
16554 * callint.c (Fcall_interactively):
16555 * buffer.c (Fkill_all_local_variables):
16556 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16557 Use Frun_hooks.
16558 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16559 unconditionally since it does the check itself.
16560
16561 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16562
16563 Fix more problems found by GCC 4.5.2's static checks.
16564
16565 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16566 the first time through the loop, since we know p0 < p1 then.
16567 This also avoids a gcc -Wstrict-overflow warning.
16568
16569 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16570 leading to a memory leak, possible in functions like
16571 load_charset_map_from_file that can allocate an unbounded number
16572 of objects (Bug#8318).
16573
16574 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16575 that could (at least in theory) be that large.
16576
16577 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16578 This is less likely to overflow, and avoids undefined behavior if
16579 overflow does occur. All callers changed. Use strtoul to scan
16580 for the unsigned long integer.
16581 (pint2hrstr): Simplify and tune code slightly.
16582 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16583
16584 * scroll.c (do_scrolling): Work around GCC bug 48228.
16585 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16586
16587 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16588 This also avoids a warning with gcc -Wstrict-overflow.
16589 (validate_x_resource_name): Simplify count usage.
16590 This also avoids a warning with gcc -Wstrict-overflow.
16591
16592 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16593 fail (Bug#8306).
16594
16595 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16596
16597 * process.c (Fmake_network_process): Use socklen_t, not int,
16598 where POSIX says socklen_t is required in portable programs.
16599 This fixes a porting bug on hosts like 64-bit HP-UX, where
16600 socklen_t is wider than int (Bug#8277).
16601 (Fmake_network_process, server_accept_connection):
16602 (wait_reading_process_output, read_process_output):
16603 Likewise.
16604
16605 * process.c: Rename or move locals to avoid shadowing.
16606 (list_processes_1, Fmake_network_process):
16607 (read_process_output_error_handler, exec_sentinel_error_handler):
16608 Rename or move locals.
16609 (Fmake_network_process): Define label "retry_connect" only if needed.
16610 (Fnetwork_interface_info): Fix pointer signedness.
16611 (process_send_signal): Add cast to avoid pointer signedness problem.
16612 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16613 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16614
16615 Make tparam.h and terminfo.c consistent.
16616 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16617 Include tparam.h instead, since it declares them.
16618 * cm.h (PC): Remove extern decl; tparam.h now does this.
16619 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16620 * terminfo.c: Include tparam.h, to check interfaces.
16621 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16622 (tparam): Adjust signature to match interface in tparam.h;
16623 this removes some undefined behavior. Check that outstring and len
16624 are zero, which they always are with Emacs.
16625 * tparam.h (PC, BC, UP): New extern decls.
16626
16627 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16628 (xftfont_open): Rename locals to avoid shadowing.
16629
16630 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16631 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16632 (OTF_TAG_SYM): Omit macro if not needed.
16633 (ftfont_list): Remove unused local.
16634 (get_adstyle_property, ftfont_pattern_entity):
16635 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16636 Rename locals to avoid shadowing.
16637
16638 * xfont.c (xfont_list_family): Mark var as initialized.
16639
16640 * xml.c (make_dom): Now static.
16641
16642 * composite.c (composition_compute_stop_pos): Rename local to
16643 avoid shadowing.
16644 (composition_reseat_it): Remove unused locals.
16645 (find_automatic_composition, composition_adjust_point): Likewise.
16646 (composition_update_it): Mark var as initialized.
16647 (find_automatic_composition): Mark vars as initialized,
16648 with a FIXME (Bug#8290).
16649
16650 character.h: Rename locals to avoid shadowing.
16651 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16652 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16653 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16654 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16655 to avoid shadowing.
16656
16657 * textprop.c (property_change_between_p): Remove; unused.
16658
16659 * intervals.c (interval_start_pos): Now static.
16660
16661 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16662
16663 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16664 Rename locals to avoid shadowing.
16665
16666 * sound.c (wav_play, au_play, Fplay_sound_internal):
16667 Fix pointer signedness.
16668 (alsa_choose_format): Remove unused local var.
16669 (wav_play): Initialize a variable to 0, to prevent undefined
16670 behavior (Bug#8278).
16671
16672 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16673
16674 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16675
16676 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16677 clobbering (Bug#8298).
16678 * sysdep.c (sys_subshell): Likewise.
16679 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16680
16681 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16682 This should get cleaned up, so that child_setup has the
16683 same signature on all platforms.
16684
16685 * callproc.c (call_process_cleanup): Now static.
16686 (relocate_fd): Rename locals to avoid shadowing.
16687
16688 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16689
16690 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16691 not to be necessary, and produces flickering.
16692
16693 2011-03-20 Glenn Morris <rgm@gnu.org>
16694
16695 * config.in: Remove file.
16696
16697 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16698
16699 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16700 are now in src/globals.h.
16701 (syms_of_minibuf): Remove spurious & from previous change.
16702
16703 2011-03-20 Leo Liu <sdl.web@gmail.com>
16704
16705 * minibuf.c (completing-read-function): New variable.
16706 (completing-read-default): Rename from completing-read.
16707 (completing-read): Call completing-read-function.
16708
16709 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16710
16711 * xfaces.c (Fx_load_color_file):
16712 Read color file from absolute filename (bug#8250).
16713
16714 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16715
16716 * makefile.w32-in: Update dependencies.
16717
16718 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16719
16720 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16721
16722 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16723
16724 Fix more problems found by GCC 4.5.2's static checks.
16725
16726 * process.c (make_serial_process_unwind, send_process_trap):
16727 (sigchld_handler): Now static.
16728
16729 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16730 That way, the code declares only the vars that it needs.
16731 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16732 * s/cygwin.h (PTY_ITERATION): Likewise.
16733 * s/darwin.h (PTY_ITERATION): Likewise.
16734 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16735
16736 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16737 * process.c (allocate_pty): Don't declare stb unless it's needed.
16738
16739 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16740 (CONSTANTLIM): Remove; unused.
16741 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16742 Define only if needed.
16743
16744 * unexelf.c (unexec): Name an expression,
16745 to avoid gcc -Wbad-function-cast warning.
16746 Use a different way to cause a compilation error if anyone uses
16747 n rather than nn, a way that does not involve shadowing.
16748 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16749
16750 * deps.mk (unexalpha.o): Remove; unused.
16751
16752 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16753 * unexec.h: New file.
16754 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16755 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16756 Depend on unexec.h.
16757 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16758 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16759 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16760 Change as necessary to match prototype in unexec.h.
16761
16762 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16763 shadowing.
16764 (back_comment, skip_chars): Mark vars as initialized.
16765
16766 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16767 Rename locals to avoid shadowing.
16768
16769 * lread.c (read1): Rewrite so as not to use empty "else".
16770 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16771
16772 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16773
16774 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16775 warning when compiling print.c.
16776
16777 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16778 instead of using an uninitialized var.
16779 (font_sort_entities): Mark var as initialized.
16780
16781 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16782
16783 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16784 pointers to constants.
16785 (font_parse_fcname): Remove unused vars.
16786 (font_delete_unmatched): Now static.
16787 (font_get_spec): Remove; unused.
16788 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16789 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16790 Rename or move locals to avoid shadowing.
16791
16792 * fns.c (require_nesting_list, require_unwind): Now static.
16793 (Ffillarray): Rename locals to avoid shadowing.
16794
16795 * floatfns.c (domain_error2): Define only if needed.
16796 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16797
16798 * alloc.c (mark_backtrace): Move decl from here ...
16799 * lisp.h: ... to here, so that it can be checked.
16800
16801 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16802 (Fdefvar): Rewrite so as not to use empty "else".
16803 (lisp_indirect_variable): Name an expression,
16804 to avoid gcc -Wbad-function-cast warning.
16805 (Fdefvar): Rename locals to avoid shadowing.
16806
16807 * callint.c (quotify_arg, quotify_args): Now static.
16808 (Fcall_interactively): Rename locals to avoid shadowing.
16809 Use const pointer when appropriate.
16810
16811 * lisp.h (get_system_name, get_operating_system_release):
16812 Move decls here, to check interfaces.
16813 * process.c (get_operating_system_release): Move decl to lisp.h.
16814 * xrdb.c (get_system_name): Likewise.
16815 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16816 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16817 some of which prompt warnings from gcc -Wbad-function-cast.
16818 (Fformat_time_string, Fencode_time, Finsert_char):
16819 (Ftranslate_region_internal, Fformat):
16820 Rename or remove local vars to avoid shadowing.
16821 (Ftranslate_region_internal): Mark var as initialized.
16822
16823 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16824 avoid shadowing.
16825
16826 * lisp.h (eassert): Check that the argument compiles, even if
16827 ENABLE_CHECKING is not defined.
16828
16829 * data.c (Findirect_variable): Name an expression, to avoid
16830 gcc -Wbad-function-cast warning.
16831 (default_value, arithcompare, arith_driver, arith_error): Now static.
16832 (store_symval_forwarding): Rename local to avoid shadowing.
16833 (Fmake_variable_buffer_local, Fmake_local_variable):
16834 Mark variables as initialized.
16835 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16836
16837 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16838 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16839 Rename locals to avoid shadowing.
16840 (mark_stack): Move local variables into the #ifdef region where
16841 they're used.
16842 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16843 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16844 needed otherwise.
16845 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16846 (GC_STRING_CHARS): Remove; not used.
16847 (Fmemory_limit): Cast sbrk's returned value to char *.
16848
16849 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16850 avoids undefined behavior in theory.
16851
16852 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16853
16854 Use functions, not macros, for up- and down-casing (Bug#8254).
16855 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16856 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16857 to use the following functions instead of these macros.
16858 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16859 EMACS_INT, since callers assume the returned value fits in int.
16860 (upcase1): Likewise, for UPCASE_TABLE.
16861 (uppercasep, lowercasep, upcase): New static inline functions.
16862 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16863 the race-condition problem in the old DOWNCASE.
16864
16865 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16866 Rename locals to avoid shadowing.
16867 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16868 (regex_compile, re_search_2, re_match_2_internal):
16869 Remove unused local vars.
16870 (FREE_VAR): Rewrite so as not to use empty "else",
16871 which gcc can warn about.
16872 (regex_compile, re_match_2_internal): Mark locals as initialized.
16873 (RETALLOC_IF): Define only if needed.
16874 (WORDCHAR_P): Likewise. This one is never needed, but is used
16875 only in a comment talking about a compiler bug, so put inside
16876 the #if 0 of that comment.
16877 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16878 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16879 Remove; unused.
16880
16881 * search.c (boyer_moore): Rename locals to avoid shadowing.
16882 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16883 (PREV_CHAR_BOUNDARY): Likewise.
16884
16885 * search.c (simple_search): Remove unused var.
16886
16887 * dired.c (compile_pattern): Move decl from here ...
16888 * lisp.h: ... to here, so that it can be checked.
16889 (struct re_registers): New forward decl.
16890
16891 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16892
16893 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16894 All uses changed.
16895 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16896 Rename locals to avoid shadowing.
16897 (Fvertical_motion): Mark locals as initialized.
16898
16899 * casefiddle.c (casify_object, casify_region): Now static.
16900 (casify_region): Mark local as initialized.
16901
16902 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16903
16904 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16905 New macros, so that the caller can use some names other than
16906 gcpro1, gcpro2, etc.
16907 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16908 of the new macros.
16909 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16910 argument, for consistency with GCPRO2_VAR, etc: it is now the
16911 prefix of the variable, not the variable itself. All uses
16912 changed.
16913 * dired.c (directory_files_internal, file_name_completion):
16914 Rename locals to avoid shadowing.
16915
16916 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16917 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16918 dired.c's scmp function, had undefined behavior.
16919 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16920 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16921 * buffer.h: ... to here, because these macros use current_buffer,
16922 and the new implementation with inline functions needs to have
16923 current_buffer in scope now, rather than later when the macros
16924 are used.
16925 (downcase, upcase1): New static inline functions.
16926 (DOWNCASE, UPCASE1): Reimplement using these functions.
16927 This avoids undefined behavior in expressions like
16928 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16929 from race conditions in accessing the global variables
16930 case_temp1 and case_temp2.
16931 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16932 * lisp.h (case_temp1, case_temp2): Remove their decls.
16933 * character.h (ASCII_CHAR_P): Move from here ...
16934 * lisp.h: ... to here, so that the inline functions mentioned
16935 above can use them.
16936
16937 * dired.c (directory_files_internal_unwind): Now static.
16938
16939 * fileio.c (file_name_as_directory, directory_file_name):
16940 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16941 Now static.
16942 (file_name_as_directory): Use const pointers when appropriate.
16943 (Fexpand_file_name): Likewise. In particular, newdir might
16944 point at constant storage, so make it a const pointer.
16945 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16946 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16947 signedness issues.
16948 (Fset_file_times, Finsert_file_contents, auto_save_error):
16949 Rename locals to avoid shadowing.
16950
16951 * minibuf.c (choose_minibuf_frame_1): Now static.
16952 (Ftry_completion, Fall_completions): Rename or remove locals
16953 to avoid shadowing.
16954
16955 * marker.c (bytepos_to_charpos): Remove; unused.
16956
16957 * lisp.h (verify_bytepos, count_markers): New decls,
16958 so that gcc does not warn that these functions aren't declared.
16959
16960 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16961 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16962 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16963 (copy_text): Remove unused local var.
16964
16965 * filelock.c (within_one_second): Now static.
16966 (lock_file_1): Rename local to avoid shadowing.
16967
16968 * buffer.c (fix_overlays_before): Mark locals as initialized.
16969 (fix_start_end_in_overlays): Likewise. This function should be
16970 simplified by using pointers-to-pointers, but that's a different
16971 matter.
16972 (switch_to_buffer_1): Now static.
16973 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16974 (report_overlay_modification): Rename locals to avoid shadowing.
16975
16976 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16977 Fix pointer signedness issue.
16978 (sys_subshell): Mark local as volatile if checking for lint,
16979 to suppress a gcc -Wclobbered warning that does not seem to be right.
16980 (MAXPATHLEN): Define only if needed.
16981
16982 * process.c (serial_open, serial_configure): Move decls from here ...
16983 * systty.h: ... to here, so that they can be checked.
16984
16985 * fns.c (get_random, seed_random): Move extern decls from here ...
16986 * lisp.h: ... to here, so that they can be checked.
16987
16988 * sysdep.c (reset_io): Now static.
16989 (wait_for_termination_signal): Remove; unused.
16990
16991 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16992 (copy_keymap_item, append_key, push_text_char_description):
16993 Now static.
16994 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16995 (DENSE_TABLE_SIZE): Remove; unused.
16996 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16997 (describe_map_tree):
16998 Rename locals to avoid shadowing.
16999
17000 * keyboard.c: Declare functions static if they are not used elsewhere.
17001 (echo_char, echo_dash, cmd_error, top_level_2):
17002 (poll_for_input, handle_async_input): Now static.
17003 (read_char, kbd_buffer_get_event, make_lispy_position):
17004 (make_lispy_event, make_lispy_movement, apply_modifiers):
17005 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17006 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17007 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17008 (read_key_sequence, read_char): Mark locals as initialized.
17009 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17010
17011 * keyboard.h (make_ctrl_char): New decl.
17012 (mark_kboards): Move decl here ...
17013 * alloc.c (mark_kboards): ... from here.
17014
17015 * lisp.h (force_auto_save_soon): New decl.
17016
17017 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17018 (DEFINE_DUMMY_FUNCTION): New macro.
17019 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17020 Use it.
17021 (main): Add casts to avoid warnings
17022 if GCC considers string literals to be constants.
17023
17024 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17025
17026 * dbusbind.c: Pointer signedness fixes.
17027 (xd_signature, xd_append_arg, xd_initialize):
17028 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17029 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17030 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17031 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17032
17033 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17034 if GCC considers string literals to be constants.
17035 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17036
17037 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17038
17039 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17040 (print_preprocess, print_object): New macro to fix last change.
17041
17042 * print.c (print_preprocess): Don't forget font objects.
17043
17044 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17045
17046 * emacs.c (USAGE3): Doc fixes.
17047
17048 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17049
17050 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17051 structure.
17052
17053 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17054
17055 * lisp.h (VWindow_system, Qfile_name_history):
17056 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17057 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17058 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17059
17060 * w32select.c: Don't #include "keyboard.h".
17061 (run_protected): Add extern declaration for waiting_for_input.
17062
17063 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17064 * w32console.c (detect_input_pending, read_input_pending)
17065 (encode_terminal_code):
17066 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17067 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17068 (w32_system_caret_y, Qfile_name_history):
17069 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17070 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17071 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17072 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17073 * w32proc.c (Qlocal, report_file_error):
17074 * w32term.c (Vwindow_system, updating_frame):
17075 * w32uniscribe.c (initialized, uniscribe_font_driver):
17076 Remove unneeded extern declarations.
17077
17078 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17079
17080 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17081
17082 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17083
17084 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17085 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17086 These macros can no longer be used for assignment.
17087
17088 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17089 Assign struct members directly, instead of using BUF_BEGV etc.
17090 (record_buffer_markers, fetch_buffer_markers): New functions for
17091 recording and fetching special buffer markers.
17092 (set_buffer_internal_1, set_buffer_temp): Use them.
17093
17094 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17095
17096 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17097
17098 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17099 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17100
17101 * xdisp.c (hscroll_window_tree):
17102 (reconsider_clip_changes): Use PT instead of BUF_PT.
17103
17104 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17105
17106 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17107 $(EMACS_ROOT)/lib/intprops.h.
17108
17109 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17110
17111 Fix more problems found by GCC 4.5.2's static checks.
17112
17113 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17114 to unsigned char * to avoid compiler diagnostic.
17115 (xg_free_frame_widgets): Make it clear that a local variable is
17116 needed only if USE_GTK_TOOLTIP.
17117 (gdk_window_get_screen): Make it clear that this macro is needed
17118 only if USE_GTK_TOOLTIP.
17119 (int_gtk_range_get_value): New function, which avoids a diagnostic
17120 from gcc -Wbad-function-cast.
17121 (xg_set_toolkit_scroll_bar_thumb): Use it.
17122 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17123 diagnostic from gcc -Wbad-function-cast.
17124 (get_utf8_string, xg_get_file_with_chooser):
17125 Rename locals to avoid shadowing.
17126 (create_dialog): Move locals to avoid shadowing.
17127
17128 * xgselect.c (xg_select): Remove unused var.
17129
17130 * image.c (four_corners_best): Mark locals as initialized.
17131 (gif_load): Initialize transparent_p to zero (Bug#8238).
17132 Mark another local as initialized.
17133 (my_png_error, my_error_exit): Mark with NO_RETURN.
17134
17135 * image.c (clear_image_cache): Now static.
17136 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17137 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17138 (x_edge_detection): Remove unnecessary cast that
17139 gcc -Wbad-function-cast diagnoses.
17140 (gif_load): Fix pointer signedness.
17141 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17142 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17143
17144 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17145
17146 Improve quality of tests for time stamp overflow.
17147 For example, without this patch (encode-time 0 0 0 1 1
17148 1152921504606846976) returns the obviously-bogus value (-948597
17149 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17150 reports time overflow. See
17151 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17152 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17153 * editfns.c: Include limits.h and intprops.h.
17154 (TIME_T_MIN, TIME_T_MAX): New macros.
17155 (time_overflow): Move earlier, to before first use.
17156 (hi_time, lo_time): New functions, for an accurate test for
17157 out-of-range times.
17158 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17159 (Fget_internal_run_time): Don't assume time_t fits in int.
17160 (make_time): Use list2 instead of Fcons twice.
17161 (Fdecode_time): More accurate test for out-of-range times.
17162 (check_tm_member): New function.
17163 (Fencode_time): Use it, to test for out-of-range times.
17164 (lisp_time_argument): Don't rely on undefined left-shift and
17165 right-shift behavior when checking for time stamp overflow.
17166
17167 * editfns.c (time_overflow): New function, refactoring common code.
17168 (Fformat_time_string, Fdecode_time, Fencode_time):
17169 (Fcurrent_time_string): Use it.
17170
17171 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17172 * dired.c (make_time): Move to ...
17173 * editfns.c (make_time): ... here.
17174 * systime.h: Note the move.
17175
17176 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17177
17178 * fringe.c (update_window_fringes): Remove unused variables.
17179
17180 * unexmacosx.c (copy_data_segment): Also copy __got section.
17181 (Bug#8223)
17182
17183 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17184
17185 * termcap.c [MSDOS]: Include "msdos.h".
17186 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17187 Constify `char *' arguments and their references according to
17188 prototypes in tparam.h.
17189
17190 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17191
17192 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17193 Adapt all references accordingly.
17194
17195 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17196
17197 2011-03-11 Tom Tromey <tromey@redhat.com>
17198
17199 * buffer.c (syms_of_buffer): Remove obsolete comment.
17200
17201 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17202
17203 * termhooks.h (encode_terminal_code): Declare prototype.
17204
17205 * msdos.c (encode_terminal_code): Don't declare prototype.
17206
17207 * term.c (encode_terminal_code): Now external again, used by
17208 w32console.c and msdos.c.
17209
17210 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17211 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17212
17213 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17214
17215 Fix some minor problems found by GCC 4.5.2's static checks.
17216
17217 * fringe.c (update_window_fringes): Mark locals as initialized
17218 (Bug#8227).
17219 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17220
17221 * alloc.c (mark_fringe_data): Move decl from here ...
17222 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17223 to check its interface.
17224 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17225
17226 * fontset.c (free_realized_fontset): Now static.
17227 (Fset_fontset_font): Rename local to avoid shadowing.
17228 (fontset_font): Mark local as initialized.
17229 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17230
17231 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17232
17233 * xselect.c (x_disown_buffer_selections): Remove; not used.
17234 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17235 (x_own_selection, Fx_disown_selection_internal): Rename locals
17236 to avoid shadowing.
17237 (x_handle_dnd_message): Remove local to avoid shadowing.
17238
17239 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17240 so that the caller can use some name other than gcpro1.
17241 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17242 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17243 (Fx_backspace_delete_keys_p):
17244 Use them to avoid shadowing, and rename vars to avoid shadowing.
17245 (x_decode_color, x_set_name, x_window): Now static.
17246 (Fx_create_frame): Add braces to silence GCC warning.
17247 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17248 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17249 Remove unused locals.
17250 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17251 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17252 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17253 macros.
17254
17255 * xterm.h (x_mouse_leave): New decl.
17256
17257 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17258 Remove unused functions.
17259 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17260 (x_calc_absolute_position): Now static.
17261 (XTread_socket): Don't define label "out" unless it's used.
17262 Don't declare local "event" unless it's used.
17263 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17264 unless they are used.
17265 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17266 (x_fatal_error_signal): Remove; not used.
17267 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17268 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17269 (x_error_catcher, x_connection_closed, x_error_handler):
17270 (x_error_quitter, xembed_send_message, x_iconify_frame):
17271 (my_log_handler): Rename locals to avoid shadowing.
17272 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17273 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17274
17275 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17276 Rename or move locals to avoid shadowing.
17277 (tty_defined_color, merge_face_heights): Now static.
17278 (free_realized_faces_for_fontset): Remove; not used.
17279 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17280 does not deduce is never used uninitialized.
17281 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17282 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17283
17284 * terminal.c (store_terminal_param): Now static.
17285
17286 * xmenu.c (menu_highlight_callback): Now static.
17287 (set_frame_menubar): Remove unused local.
17288 (xmenu_show): Rename parameter to avoid shadowing.
17289 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17290 since they might point to immutable storage.
17291 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17292 since it's unused otherwise.
17293
17294 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17295 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17296 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17297 avoids a gcc -Wuninitialized diagnostic.
17298 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17299 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17300 does not deduce are never used uninitialized.
17301
17302 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17303
17304 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17305 * window.c (window_loop, size_window):
17306 (run_window_configuration_change_hook, enlarge_window): Likewise.
17307
17308 * window.c (display_buffer): Now static.
17309 (size_window): Mark variables that gcc -Wuninitialized
17310 does not deduce are never used uninitialized.
17311 * window.h (check_all_windows): New decl, to forestall
17312 gcc -Wmissing-prototypes diagnostic.
17313 * dispextern.h (bidi_dump_cached_states): Likewise.
17314
17315 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17316 shadowing.
17317 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17318 Include <limits.h>.
17319 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17320 and to avoid gcc -Wuninitialized warning.
17321 (load_charset_map): Mark variables that gcc -Wuninitialized
17322 does not deduce are never used uninitialized.
17323 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17324
17325 * coding.c (coding_set_source, coding_set_destination):
17326 Use "else { /* comment */ }" rather than "else /* comment */;"
17327 for clarity, and to avoid gcc -Wempty-body warning.
17328 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17329 a block, when the outer 'i' will do.
17330 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17331 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17332 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17333 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17334 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17335 Rename locals to avoid shadowing.
17336 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17337 * coding.c (emacs_mule_char, encode_invocation_designation):
17338 Now static, since they're not used elsewhere.
17339 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17340 (decode_coding_object, encode_coding_object, detect_coding_system):
17341 (decode_coding_emacs_mule): Mark variables that gcc
17342 -Wuninitialized does not deduce are never used uninitialized.
17343 (detect_coding_iso_2022): Initialize a local variable that might
17344 be used uninitialized. Leave a FIXME because it's not clear that
17345 this initialization is needed. (Bug#8211)
17346 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17347 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17348 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17349 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17350 Remove unused macros.
17351
17352 * category.c (hash_get_category_set): Remove unused local var.
17353 (copy_category_table): Now static, since it's not used elsewhere.
17354 * character.c (string_count_byte8): Likewise.
17355
17356 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17357 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17358
17359 * chartab.c (copy_sub_char_table): Now static, since it's not used
17360 elsewhere.
17361 (sub_char_table_ref_and_range, char_table_ref_and_range):
17362 Rename locals to avoid shadowing.
17363 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17364
17365 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17366 (BIDI_BOB): Remove unused macro.
17367
17368 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17369 deduce are never used uninitialized.
17370 * term.c (encode_terminal_code): Likewise.
17371
17372 * term.c (encode_terminal_code): Now static. Remove unused local.
17373
17374 * tparam.h: New file.
17375 * term.c, tparam.h: Include it.
17376 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17377 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17378 Move these decls to tparam.h, and make them agree with what
17379 is actually in tparam.c. The previous trick of using incompatible
17380 decls in different modules does not conform to the C standard.
17381 All callers of tparam changed to use tparam's actual API.
17382 * tparam.c (tparam1, tparam, tgoto):
17383 Use const pointers where appropriate.
17384
17385 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17386 * cm.h (struct cm): Likewise.
17387 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17388 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17389 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17390 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17391 (turn_on_face, init_tty): Likewise.
17392 * termchar.h (struct tty_display_info): Likewise.
17393
17394 * term.c (term_mouse_position): Rename local to avoid shadowing.
17395
17396 * alloc.c (mark_ttys): Move decl from here ...
17397 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17398
17399 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17400
17401 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17402
17403 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17404
17405 * search.c (compile_pattern_1): Remove argument regp, unused since
17406 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17407 (compile_pattern): Don't pass it.
17408
17409 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17410
17411 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17412 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17413 for ! HAVE_GTK3.
17414 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17415
17416 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17417
17418 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17419 gdk_window_get_screen, gdk_window_get_geometry,
17420 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17421 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17422 (xg_get_pixbuf_from_pixmap): New function.
17423 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17424 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17425 Call xg_get_pixbuf_from_pixmap instead of
17426 gdk_pixbuf_get_from_drawable.
17427 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17428 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17429 (xg_check_special_colors): Use GtkStyleContext and its functions
17430 for HAVE_GTK3.
17431 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17432 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17433 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17434 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17435 Call gtk_widget_get_preferred_size.
17436 (xg_frame_resized): gdk_window_get_geometry only takes 5
17437 parameters.
17438 (xg_win_to_widget, xg_event_is_for_menubar):
17439 Call gdk_x11_window_lookup_for_display.
17440 (xg_set_widget_bg): New function.
17441 (delete_cb): New function.
17442 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17443 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17444 (xg_set_background_color): Call xg_set_widget_bg.
17445 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17446 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17447 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17448 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17449 if ! HAVE_GTK3.
17450 (update_frame_tool_bar): Call gtk_widget_hide.
17451 (xg_initialize): Use GDK_KEY_g.
17452
17453 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17454 if ! HAVE_GTK3
17455 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17456
17457 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17458 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17459 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17460
17461 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17462
17463 * w32xfns.c (select_palette): Check success of RealizePalette against
17464 GDI_ERROR, not zero.
17465
17466 See ChangeLog.11 for earlier changes.
17467
17468 ;; Local Variables:
17469 ;; coding: utf-8
17470 ;; End:
17471
17472 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17473
17474 This file is part of GNU Emacs.
17475
17476 GNU Emacs is free software: you can redistribute it and/or modify
17477 it under the terms of the GNU General Public License as published by
17478 the Free Software Foundation, either version 3 of the License, or
17479 (at your option) any later version.
17480
17481 GNU Emacs is distributed in the hope that it will be useful,
17482 but WITHOUT ANY WARRANTY; without even the implied warranty of
17483 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17484 GNU General Public License for more details.
17485
17486 You should have received a copy of the GNU General Public License
17487 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.