be734134adfa018a5b416ec10e659258d851f070
[bpt/emacs.git] / src / ChangeLog
1 2012-09-17 Kenichi Handa <handa@gnu.org>
2
3 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
4 not covert the last few charactes.
5
6 2012-09-16 Kenichi Handa <handa@gnu.org>
7
8 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
9 here, but just check the validity of glyphs in the glyph-string.
10
11 2012-09-16 Martin Rudalics <rudalics@gmx.at>
12
13 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
14 any window as argument (Bug#12452).
15
16 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
17
18 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
19 to ns_term_init to avoid memory leak.
20
21 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
22 explicit retain/release.
23 (ns_term_init): Only allow one display. Initialize outerpool and
24 ns_*_types.
25
26 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
27
28 Port _setjmp fix to POSIXish hosts as well as Microsoft.
29 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
30 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
31 the Microsoft problem in a different way, by altering ../nt/config.nt.
32
33 2012-09-15 Eli Zaretskii <eliz@gnu.org>
34
35 * w32xfns.c:
36 * w32uniscribe.c:
37 * w32term.c:
38 * w32select.c:
39 * w32reg.c:
40 * w32proc.c:
41 * w32menu.c:
42 * w32inevt.c:
43 * w32heap.c:
44 * w32font.c:
45 * w32fns.c:
46 * w32console.c:
47 * w32.c:
48 * w16select.c: Remove inclusion of setjmp.h, as it is now included
49 by lisp.h. This completes removal of setjmp.h inclusion
50 erroneously announced in the previous commit. (Bug#12446)
51
52 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
53 more accurate.
54
55 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
56 not defined as a macro. The latter happens on MS-Windows.
57 (Bug#12446)
58
59 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
60
61 Port better to POSIX hosts lacking _setjmp (Bug#12446).
62 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
63 Some instances of '#include <setjmp.h>' removed, if the
64 only reason for the instance was because "lisp.h" was included.
65 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
66 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
67 and _longjmp with the new symbols. Emacs already uses _setjmp if
68 available, so this change affects only POSIXish hosts that have
69 sigsetjmp but not _setjmp, such as some versions of Solaris and
70 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
71 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
72 (png_load_body) [HAVE_PNG]:
73 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
74 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
75 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
76 since PNG requires jmp_buf. This is the only exception to the
77 general rule that we now use sys_setjmp and sys_longjmp.
78 This exception is OK since this code does not change the signal
79 mask or longjmp out of a signal handler.
80
81 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
82
83 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
84 Include "syssignal.h", for 'main_thread'.
85
86 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
87
88 Avoid out-of-range marker position (Bug#12426).
89 * insdel.c (replace_range, replace_range_2): Adjust
90 markers before overlays, as suggested by comments.
91 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
92 Remove redundant check before calling offset_intervals.
93
94 2012-09-14 Martin Rudalics <rudalics@gmx.at>
95
96 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
97 current buffer (Bug#12387).
98
99 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
100
101 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
102
103 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
104
105 Use a more backwards-compatible timer format (Bug#12430).
106 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
107 vector element, not from the 4th, since PSECS is now at the end.
108 (Fcurrent_idle_time): Doc fix.
109
110 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
111
112 Function to mark objects and remove killed buffers at once.
113 * alloc.c (discard_killed_buffers): Rename to ...
114 (mark_discard_killed buffers) ... new name. Add marking
115 of remaining objects. Fix comment. Adjust users.
116 (mark_object): Do not touch frame buffer lists here.
117 * frame.c (delete_frame): Reset frame buffer lists here.
118
119 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
120
121 Better workaround for GNOME bug when --enable-gcc-warnings.
122 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
123 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
124 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
125
126 Simplify SIGIO usage (Bug#12408).
127 The code that dealt with SIGIO was crufty and confusing, e.g., it
128 played tricks like "#undef SIGIO" but these tricks were not used
129 consistently. Simplify mostly by not #undeffing standard symbols,
130 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
131 or not as we please) rather than "defined SIGIO" (standard symbol
132 that we probably shouldn't #undef).
133 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
134 Modules that need it can include it.
135 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
136 * dispextern.h (ignore_sigio): New decl.
137 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
138 unconditionally, since it's now a no-op if !USABLE_SIGIO.
139 * emacs.c (shut_down_emacs):
140 * keyboard.c (kbd_buffer_store_event_hold):
141 Use ignore_sigio rather than invoking 'signal' directly.
142 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
143 for FIONREAD.
144 (FIONREAD, SIGIO): Do not #undef.
145 (tty_read_avail_input): Use #error rather than a syntax error.
146 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
147 for I_PIPE, used by SETUP_SLAVE_PTY.
148 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
149 * sysdep.c (croak): Remove; no longer needed. This bit of
150 temporary code, with Fred N. Fish's comment that it's temporary,
151 has been in Emacs since at least 1992!
152 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
153 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
154 * syssignal.h (croak): Remove decl.
155 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
156 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
157 now that we're termios-only.
158 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
159 * term.c (dissociate_if_controlling_tty): Use #error rather than
160 a run-time error.
161
162 Work around GCC and GNOME bugs when --enable-gcc-warnings.
163 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
164 to work around GNOME bug 683906.
165 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
166 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
167 This works around GCC bug 54561.
168
169 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
170
171 More fixes for 'volatile' and setjmp/longjmp.
172 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
173 * image.c (struct png_load_context) [HAVE_PNG]: New type.
174 (png_load_body) [HAVE_PNG]:
175 (jpeg_load_body) [HAVE_JPEG]:
176 New function, with most of the old parent function's body.
177 (png_load) [HAVE_PNG]:
178 (jpeg_load) [HAVE_JPEG]:
179 Invoke the new function, to avoid longjmp munging our locals.
180 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
181 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
182 longjmp is passed 2, as the C standard doesn't guarantee this.
183 Instead, store the failure code into mgr->failure_code.
184
185 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
186
187 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
188 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
189 (syms_of_keyboard): Remove support for unread-command-char.
190
191 2012-09-12 Eli Zaretskii <eliz@gnu.org>
192
193 * w32proc.c (sys_kill): If PID is our process ID and the signal is
194 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
195 violation. (Bug#12426)
196
197 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
198
199 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
200
201 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
202
203 * eval.c: Add `inhibit-debugger'.
204 (Qinhibit_debugger): New symbol.
205 (call_debugger): Bind it instead of Qdebug_on_error.
206 (maybe_call_debugger): Test Vinhibit_debugger.
207 (syms_of_eval): Define inhibit-debugger.
208 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
209 (syms_of_xdisp): Remove inhibit-debug-on-message.
210
211 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
212
213 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
214 If a nonvolatile local variable is written before a _longjmp to
215 the frame containing the variable, and is read after the _longjmp,
216 the value read is indeterminate. Some local variables of type
217 'struct handler' and 'struct catchtag' are used in this way, so
218 mark each of their slots as volatile if the slot can be set before
219 _longjmp and read afterwards.
220 * lisp.h (struct handler): var and chosen_clause are now volatile.
221 (struct catchtag): val, next, and pdlcount are now volatile.
222
223 * bidi.c (bidi_push_it, bidi_pop_it):
224 * fns.c (copy_hash_table):
225 * image.c (define_image_type):
226 * keyboard.c (kbd_buffer_store_event_hold):
227 * process.c (Fprocess_send_eof):
228 * xfaces.c (x_create_gc) [HAVE_NS]:
229 * xgselect.c (xg_select):
230 Prefer assignment to memcpy when either will do.
231
232 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
233 Use pointer-to-a-pointer to simplify and avoid a NILP check each
234 time an item is removed. No need to mark this function 'inline';
235 the compiler knows better than we do.
236
237 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
238
239 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
240 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
241 to change_frame_size (Bug#12388).
242 (windowDidResize:): Pass YES to updateFrameSize.
243
244 * nsterm.h: Add delay parameter to updateFrameSize.
245
246 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
247
248 Discard killed buffers from deleted window and frame objects.
249 This reduces an amount of references to killed buffers and
250 helps GC to reclaim them faster.
251 * alloc.c (discard_killed_buffers): New function.
252 (mark_object): Use it for deleted windows and frames.
253 (mark_object): If symbol's value is set up for a killed buffer
254 or deleted frame, restore it's global binding.
255 * data.c (swap_in_global_binding): Add GC notice.
256 (swap_in_symval_forwarding): Use convenient set_blv_where.
257 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
258 * window.h: ... to here.
259
260 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
261
262 Convenient macro to check whether the buffer is live.
263 * buffer.h (BUFFER_LIVE_P): New macro.
264 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
265 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
266
267 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
268
269 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
270 composition cases (Bug#12364).
271
272 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
273 overhang of succeeding glyphs overlapping box cursor.
274
275 * w32term.c (x_draw_glyph_string): Likewise.
276
277 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
278
279 Simplify, document, and port floating-point (Bug#12381).
280 The porting part of this patch fixes bugs on non-IEEE platforms
281 with frexp, ldexp, logb.
282 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
283 Now static.
284 * floatfns.c: Simplify discussion of functions that Emacs doesn't
285 support, by removing commented-out code and briefly listing the
286 C89 functions excluded. The commented-out stuff was confusing
287 maintenance, e.g., we thought we needed cbrt but it was commented out.
288 (logb): Remove decl; no longer needed.
289 (isfinite): New macro, if not already supplied.
290 (isnan): Don't replace any existing macro.
291 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
292 are present on all C89 platforms.
293 (Ffrexp): Do not special-case zero, as frexp does the right thing
294 for that case.
295 (Flogb): Do not use logb, as it doesn't have the desired meaning
296 on hosts that use non-base-2 floating point. Instead, stick with
297 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
298 frexp, to avoid getting an unspecified result.
299
300 * xdisp.c (Qinhibit_debug_on_message): Now static.
301
302 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
303
304 * nsterm.m (ns_update_begin): Set clip path to whole view by using
305 NSBezierPath (Bug#12131).
306
307 2012-09-10 Chong Yidong <cyd@gnu.org>
308
309 * fns.c (Fdelq, Fdelete): Doc fix.
310
311 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
312
313 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
314 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
315
316 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
317
318 * lisp.h (make_lisp_ptr): New macro to replace XSET.
319 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
320 Use it.
321
322 2012-09-09 Eli Zaretskii <eliz@gnu.org>
323
324 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
325 left fringe if the window has a left margin. This avoids leaving
326 traces of the cursor because its leftmost pixel is not drawn over.
327
328 * dispnew.c (update_window_line): When the left margin area of a
329 screen line is updated, set the redraw_fringe_bitmaps_p flag of
330 that screen line. (Bug#12277)
331
332 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
333
334 Assume C89 or later for math functions (Bug#12381).
335 This simplifies the code, and makes it a bit smaller and faster,
336 and (most important) makes it easier to clean up signal handling
337 since we can stop worring about floating-point exceptions in
338 library code. That was a problem before C89, but the problem
339 went away many years ago on all practical Emacs targets.
340 * data.c, image.c, lread.c, print.c:
341 Don't include <math.h>; no longer needed.
342 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
343 might be autoconfigured, as that never happens.
344 * data.c (fmod):
345 * doprnt.c (DBL_MAX_10_EXP):
346 * print.c (DBL_DIG):
347 Remove. C89 or later always defines these.
348 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
349 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
350 (arith_error, domain_error, domain_error2):
351 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
352 no longer needed -- we simply return what C returns. All uses removed.
353 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
354 the wrapped code.
355 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
356 Remove. All uses expanded, as these macros are no longer used
357 more than once and are now more trouble than they're worth.
358 (Ftan): Use tan, not sin / cos.
359 (Flogb): Assume C89 frexp.
360 (fmod_float): Assume C89 fmod.
361 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
362 (init_floatfns): Remove. All uses removed.
363
364 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
365
366 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
367 compositeToPoint for OSX < 10.6 (Bug#12390).
368
369 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
370
371 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
372 This produces more-accurate results.
373
374 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
375
376 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
377 changes (Bug#12088).
378
379 2012-09-08 Chong Yidong <cyd@gnu.org>
380
381 * syntax.c (Fstring_to_syntax): Doc fix.
382
383 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
384
385 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
386 in the internal border.
387 (x_set_window_size): Remove static variables and their usage.
388 (ns_redraw_scroll_bars): Fix NSTRACE arg.
389 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
390 fringe/internal border adjustment (Bug#11052).
391 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
392 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
393 (ns_fix_rect_ibw): Remove.
394 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
395 (ns_dumpglyphs_box_or_relief): Ditto.
396 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
397 adjustment.
398 (ns_dumpglyphs_image): Ditto.
399 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
400 border adjustment.
401 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
402 their usage. Add fringe_extended_p and its use as in other terms.
403 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
404 scroll bar was removed.
405 (updateFrameSize): New function.
406 (windowDidResize): Move code to updateFrameSize and call it.
407
408 * nsterm.h (EmacsView): Add updateFrameSize.
409
410 2012-09-07 Chong Yidong <cyd@gnu.org>
411
412 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
413
414 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
415
416 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
417
418 More signal-handler cleanup (Bug#12327).
419 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
420 Problem introduced when merging patches. Noted by Eli Zaretskii in
421 <http://bugs.gnu.org/12327#67>.
422 * floatfns.c: Comment fix.
423 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
424 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
425 and anyway the declaration is harmless even if SIGDANGER is not defined.
426 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
427 defined BROKEN_FIONREAD). systty.h formerly did this, but other
428 source files not surprisingly expected syssignal.h to define, or
429 not define, SIGIO, and it's cleaner to do it that way, for consistency.
430 Include <sys/ioctl.h>, for FIONREAD.
431 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
432 This eliminates a problem whereby other files mysteriously had
433 to include "syssignal.h" before including "systty.h" if they
434 wanted to use "#ifdef SIGIO".
435
436 2012-09-07 Eli Zaretskii <eliz@gnu.org>
437
438 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
439
440 * w32.c (sigemptyset): Empty the set.
441 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
442
443 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
444
445 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
446
447 * alloc.c (mark_buffer): Revert unsafe marking optimization.
448 (mark_object): Likewise for frame objects.
449
450 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
451
452 * syssignal.h (handle_on_main_thread): Always declare,
453 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
454 This ports to platforms without HAVE_PTHREAD.
455
456 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
457
458 Signal-handler cleanup (Bug#12327).
459 Emacs's signal handlers were written in the old 4.2BSD style with
460 sigblock and sigmask and so forth, and this led to some
461 inefficiencies and confusion. Rewrite these to use
462 pthread_sigmask etc. without copying signal sets around. Also,
463 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
464 'signal', and instead use functions that do not attempt to take
465 over the system name space. This patch causes Emacs's text
466 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
467 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
468 Do not include <signal.h> or "syssignal.h", as these
469 modules do not use signals.
470 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
471 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
472 Do not include <signal.h>, as "syssignal.h" does that for us now.
473 * atimer.c (sigmask_atimers): New function.
474 (block_atimers, unblock_atimers): New functions,
475 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
476 All uses replaced.
477 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
478 no longer needed here.
479 * emacs.c (main): Inspect existing signal handler with sigaction,
480 so that there's no need to block and unblock SIGHUP.
481 * sysdep.c (struct save_signal): New member 'action', replacing
482 old member 'handler'.
483 (save_signal_handlers, restore_signal_handlers):
484 Use sigaction instead of 'signal' to save and restore.
485 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
486 New function. All users of 'signal' modified to use set_sighandler
487 if they're writeonly, and to use sys_signal if they're read+write.
488 (emacs_sigaction_init, forwarded_signal): New functions.
489 (sys_signal): Remove. All uses replaced by calls to sigaction
490 and emacs_sigaction_init, or by direct calls to 'signal'.
491 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
492 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
493 all uses replaced by pthread_sigmask etc. calls.
494 * syssignal.h: Include <signal.h>.
495 (emacs_sigaction_init, forwarded_signal): New decls.
496 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
497 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
498 (sigmask, sys_sigmask): Remove; no longer needed.
499 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
500 (sigblock, sigunblock, sigfree):
501 (sigsetmask) [!defined sigsetmask]:
502 Remove. All uses replaced by pthread_sigmask.
503 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
504 no longer need to be replaced, and its typical old uses
505 are now done via emacs_sigaction_init and sigaction.
506 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
507 (sys_sigdel): Remove; unused.
508 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
509
510 2012-09-06 Eli Zaretskii <eliz@gnu.org>
511
512 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
513 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
514
515 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
516
517 Explicitly mark buffer_defaults and buffer_local_symbols.
518 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
519 mark_local_symbols here.
520 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
521 since special buffers aren't marked here any more.
522 (allocate_buffer): Chain new buffer with all_buffers here...
523 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
524 not here.
525 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
526 (syms_of_buffer): Remove staticpro of the above.
527 (init_buffer_once): Set names for buffer_defaults and
528 buffer_local_symbols.
529
530 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
531
532 Use bool for booleans in font-related modules.
533 * font.c (font_intern_prop, font_style_to_value)
534 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
535 (generate_otf_features, font_check_otf_features, font_check_otf)
536 (font_match_p, font_list_entities, font_at):
537 * fontset.c (fontset_id_valid_p, reorder_font_vector
538 (fontset_find_font, Fset_fontset_font)
539 (face_suitable_for_char_p) [0]:
540 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
541 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
542 (m17n_flt_initialized, ftfont_shape_by_flt):
543 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
544 * nsfont.m (nsfont_draw):
545 * w32font.c (w32font_draw):
546 * w32term.c (x_draw_glyphless_glyph_string_foreground):
547 Use bool for booleans.
548 * font.h: Adjust to above API changes.
549 (struct font, struct font_driver, struct font_driver_list):
550 Use bool for booleans.
551 (struct font): Remove useless member encoding_type.
552 All users removed.
553 * fontset.c, xftfont.c: Omit unnecessary static decls.
554
555 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
556
557 * alloc.c (mark_object): Revert window marking code
558 since it's unsafe for the Fset_window_configuration.
559
560 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
561
562 Fix race conditions with signal handlers and errno (Bug#12327).
563 Be more systematic about preserving errno whenever a signal
564 handler returns, even if it's not in the main thread. Do this by
565 renaming signal handlers to distinguish between signal delivery
566 and signal handling. All uses changed.
567 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
568 * data.c (deliver_arith_signal): Rename from arith_error.
569 * dispnew.c (deliver_window_change_signal): Rename from
570 window_change_signal.
571 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
572 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
573 * keyboard.c (deliver_input_available_signal): Rename from
574 input_available_signal.
575 (deliver_user_signal): Rename from handle_user_signal.
576 (deliver_interrupt_signal): Rename from interrupt_signal.
577 * process.c (deliver_pipe_signal): Rename from send_process_trap.
578 (deliver_child_signal): Rename from sigchld_handler.
579 * atimer.c (handle_alarm_signal):
580 * data.c (handle_arith_signal):
581 * dispnew.c (handle_window_change_signal):
582 * emacs.c (handle_fatal_signal, handle_danger_signal):
583 * keyboard.c (handle_input_available_signal):
584 * keyboard.c (handle_user_signal, handle_interrupt_signal):
585 * process.c (handle_pipe_signal, handle_child_signal):
586 New functions, with the actual signal-handling code taken from the
587 original respective signal handlers, sans the sporadic attempts to
588 preserve errno, since that's now done by handle_on_main_thread.
589 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
590 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
591 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
592 Move to sysdep.c.
593 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
594 Move initialization of main_thread to sysdep.c's init_signals.
595 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
596 our usage, and simplifies the mainline code.
597 (record_child_status_change): New static function, as a helper
598 for handle_child_signal, and with most of the old child handler's
599 contents.
600 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
601 (handle_child_signal): Use the above.
602 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
603 Moved here from emacs.c.
604 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
605 code moved here from emacs.c's main function.
606 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
607 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
608 lets callers save and restore errno properly.
609
610 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
611
612 Remove redundant or unused things here and there.
613 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
614 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
615 * editfns.c (Fcompare_buffer_substrings): Likewise.
616 * frame.h (struct terminal, struct font_driver_list):
617 Remove redundant declarations.
618 * window.h (Qleft, Qright): Likewise.
619
620 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
621
622 Do not mark objects from deleted buffers, windows and frames.
623 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
624 (mark_object): Likewise for windows and frames.
625
626 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
627
628 * alloc.c (valid_lisp_object_p): Treat killed buffers,
629 buffer_defaults and buffer_local_symbols as valid objects.
630 Return special value to denote them.
631
632 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
633
634 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
635 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
636 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
637 (file_name_absolute_p, Fsubstitute_in_file_name):
638 (check_executable, check_writable, Ffile_accessible_directory_p)
639 (Fset_file_selinux_context, Fdefault_file_modes)
640 (Finsert_file_contents, choose_write_coding_system)
641 (Fwrite_region, build_annotations, a_write, e_write)
642 (Fdo_auto_save):
643 * filelock.c (boot_time_initialized, get_boot_time)
644 (get_boot_time_1, lock_file_1, within_one_second):
645 * floatfns.c (in_float):
646 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
647 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
648 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
649 * lisp.h (struct Lisp_Hash_Table.cmpfn):
650 * window.c (compare_window_configurations):
651 Use bool for booleans.
652 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
653 (Fdefault_file_modes): Now mode_t, not int, for modes.
654 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
655 (internal_delete_file): Now returns void, not a (boolean) int,
656 since nobody was looking at the return value.
657 * lisp.h, window.h: Adjust to above API changes.
658
659 * xdisp.c (set_message): Simplify and reindent last change.
660
661 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
662
663 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
664
665 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
666
667 * eval.c (call_debugger): Make the function non-static so that we
668 can call it from set_message.
669
670 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
671 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
672
673 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
674
675 Give more-useful info on a fatal error (Bug#12328).
676 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
677 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
678 of doing the work ourselves.
679 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
680 do most of the work.
681 (fatal_error_backtrace): New function, taken from the guts
682 of the old fatal_error_signal, but with a new option to output
683 a backtrace.
684 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
685 info about the signal than just its number.
686 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
687 * sysdep.c: Include <execinfo.h>
688 (emacs_backtrace): New function, taken partly from the previous
689 code of the 'die' function.
690 (emacs_abort): Call fatal_error_backtrace rather than abort.
691
692 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
693
694 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
695 eager (load-time) macro-expansion.
696 * lisp.mk (lisp): Add macroexp.
697
698 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
699
700 Simplify redefinition of 'abort' (Bug#12316).
701 Do not try to redefine the 'abort' function. Instead, redo
702 the code so that it calls 'emacs_abort' rather than 'abort'.
703 This removes the need for the NO_ABORT configure-time macro
704 and makes it easier to change the abort code to do a backtrace.
705 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
706 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
707 Remove; sysdep.c's emacs_abort now takes its place.
708 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
709 'abort' changed to use 'emacs_abort'.
710 * msdos.c (dos_abort) [defined abort]: Remove; not used.
711 (abort) [!defined abort]: Rename to ...
712 (emacs_abort): ... new name.
713 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
714 the place of the old 'abort' in emacs.c.
715 * w32.c, w32fns.c (abort): Do not #undef.
716 * w32.c (emacs_abort): Rename from w32_abort.
717
718 2012-09-04 Eli Zaretskii <eliz@gnu.org>
719
720 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
721 offsets[j].dv, since the y axis of the screen coordinates points
722 down, while the y axis of the font definition coordinates points
723 up. This fixes display of Arabic diacritics such as KASRA and
724 KASRATAN. (Bug#11860)
725
726 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
727
728 Be more systematic about _setjmp vs setjmp.
729 * alloc.c (test_setjmp, mark_stack):
730 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
731 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
732 (png_load, my_error_exit, jpeg_load):
733 * process.c (send_process_trap, send_process):
734 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
735 The underscored versions are up to 30x faster on some hosts.
736 Formerly, the code used setjmp+longjmp sometimes and
737 _setjmp+_longjmp at other times, with no particular reason to
738 prefer setjmp+longjmp.
739
740 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
741
742 Fix minor problem found by static checking.
743 * buffer.c (Fdelete_all_overlays): Return nil.
744
745 2012-09-03 Martin Rudalics <rudalics@gmx.at>
746
747 * buffer.c (Fdelete_all_overlays): New function.
748
749 2012-09-03 Chong Yidong <cyd@gnu.org>
750
751 * gtkutil.c: Add extern decl for Qxft.
752
753 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
754
755 * emacs.c, eval.c: Use bool for boolean.
756 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
757 (malloc_using_checking) [DOUG_LEA_MALLOC]:
758 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
759 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
760 (main, decode_env_path, Fdaemon_initialized):
761 * eval.c (call_debugger, Finteractive_p, interactive_p):
762 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
763 (maybe_call_debugger, Fbacktrace):
764 * process.c (read_process_output, exec_sentinel):
765 Use bool for booleans.
766 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
767 All callers changed.
768 * eval.c (interactive_p): Omit always-true boolean argument
769 EXCLUDE_SUBRS_P. All callers changed.
770 * dispextern.h, lisp.h: Reflect above API changes.
771 * firstfile.c (dummy): Use the address of 'main', whose signature
772 won't change, instead of the address of 'initialize', whose
773 signature just changed from int to bool.
774 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
775 * msdos.c (fatal_error_in_progress): ... from here.
776 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
777 of incrementing it.
778 (redisplay_internal, unwind_redisplay): Simply clear
779 REDISPLAYING_P when unwinding, instead of saving its previous,
780 always-false value and then restoring it.
781
782 Clean up some extern decls.
783 Mostly, this hoists extern decls out of .c files and into .h files.
784 That way, we're more likely to catch errors if the interfaces change.
785 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
786 declare xg_mark_data.
787 * dispextern.h (x_frame_parm_handlers):
788 * font.h (Qxft):
789 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
790 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
791 (Qultra_bold, Qoblique, Qitalic):
792 Move extern decl here from .c file.
793 * alloc.c (xg_mark_data) [USE_GTK]:
794 * doc.c (Qclosure):
795 * eval.c (Qlexical_binding):
796 * fns.c (time) [!HAVE_UNISTD_H]:
797 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
798 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
799 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
800 * lread.c (Qinternal_interpreter_environment):
801 * minibuf.c (Qbuffer):
802 * process.c (QCfamily, QCfilter):
803 * widget.c (free_frame_faces):
804 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
805 * xfont.c (x_clear_errors):
806 * xterm.c (x_frame_parm_handlers):
807 Remove now-redundant extern decls.
808 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
809 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
810 Now static.
811 * xfaces.c: Remove unnecessary static decls.
812 * xterm.c (updating_frame): Remove decl of nonexistent object.
813
814 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
815 when building globals.h, as the objects that are not built on
816 this host are not needed to compile C files on this host.
817
818 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
819
820 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
821
822 * frame.h: Add missing prototype for x_wm_set_size_hint.
823
824 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
825
826 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
827 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
828 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
829 (Fsubstitute_command_keys):
830 * editfns.c (region_limit, find_field, Fconstrain_to_field)
831 (save_excursion_save, save_excursion_restore)
832 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
833 (format_time_string, general_insert_function)
834 (make_buffer_string, make_buffer_string_both)
835 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
836 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
837 (copy_text, insert_1, insert_1_both, insert_from_string)
838 (insert_from_string_before_markers, insert_from_string_1)
839 (insert_from_buffer, insert_from_buffer_1, replace_range)
840 (replace_range_2, del_range_1, del_range_byte, del_range_both)
841 (del_range_2, modify_region):
842 * intervals.c (intervals_equal, balance_possible_root_interval)
843 (adjust_intervals_for_insertion, merge_properties_sticky)
844 (graft_intervals_into_buffer, lookup_char_property)
845 (adjust_for_invis_intang, set_point_both)
846 (get_property_and_range, compare_string_intervals)
847 (set_intervals_multibyte_1, set_intervals_multibyte):
848 * keyboard.c (decode_timer):
849 Use bool for boolean.
850 * intervals.h, lisp.h, systime.h: Reflect above API changes.
851 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
852
853 2012-09-02 Chong Yidong <cyd@gnu.org>
854
855 * keymap.c (push_key_description): Print M-TAB as C-M-i
856 (Bug#11758).
857
858 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
859
860 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
861 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
862 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
863 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
864 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
865 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
866 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
867
868 2012-09-01 Eli Zaretskii <eliz@gnu.org>
869
870 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
871 more than one grapheme cluster passed to the shaper: compute the
872 offset adjustment values separately for each cluster. (Bug#11860)
873
874 * image.c: Restore mistakenly removed inclusion of w32.h. Without
875 it, GCC doesn't see prototypes of w32_delayed_load, and complains
876 about implicit conversions from integer to pointer.
877
878 2012-09-01 Daniel Colascione <dancol@dancol.org>
879
880 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
881 system used too early.
882
883 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
884
885 Better seed support for (random).
886 * emacs.c (main): Call init_random.
887 * fns.c (Frandom): Set the seed from a string argument, if given.
888 Remove long-obsolete Gentzel cruft.
889 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
890 (init_random): New function.
891
892 2012-09-01 Daniel Colascione <dancol@dancol.org>
893
894 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
895 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
896 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
897 x_wm_set_size_hint, x_query_colors, x_real_positions,
898 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
899 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
900 all of which have been moved to common code.
901
902 * xfaces.c: Include TERM_HEADER instead of listing all possible
903 window-system headers.
904
905 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
906 to match header.
907
908 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
909 directly accessing frame internals.
910
911 * w32font.h: Include font.h. Define syms_of_w32font and
912 globals_of_w32font.
913
914 * process.c: Include TERM_HEADER instead of listing all possible
915 window-system headers.
916
917 * nsterm.h: Remove declarations now in frame.h. Define
918 FRAME_X_SCREEN, FRAME_X_VISUAL.
919
920 * menu.c: Include TERM_HEADER instead of listing all possible
921 window-system headers.
922
923 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
924 window system.
925
926 * keyboard.c: Include TERM_HEADER instead of listing all possible
927 window-system headers.
928
929 * image.c: Include TERM_HEADER instead of listing all possible
930 window-system headers. Declare Vlibrary_cache when compiling for
931 Windows.
932
933 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
934 window system declarations.
935
936 * frame.h: Move common functions here: set_frame_menubar,
937 x_set_window_size, x_sync, x_get_focus_frame,
938 x_set_mouse_position, x_set_mouse_pixel_position,
939 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
940 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
941 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
942 x_activate_menubar, x_real_positions, x_bitmap_icon,
943 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
944 and x_query_colors.
945
946 * frame.c: Include TERM_HEADER instead of listing all possible
947 window-system headers.
948
949 * font.c: Include TERM_HEADER instead of listing all possible
950 window-system headers.
951
952 * emacs.c: Include TERM_HEADER.
953
954 * dispnew.c: Include TERM_HEADER instead of listing all possible
955 window-system headers.
956
957 * ccl.h: Include character.h.
958
959 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
960 the current window system; include in list of objects to link into
961 Emacs.
962
963 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
964
965 Remove mark_ttys function and fix tty_display_info initialization.
966 * lisp.h (mark_ttys): Remove prototype.
967 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
968 to mark_ttys because all possible values of 'top_frame' slot are
969 the frames which are reachable from Vframe_list.
970 * term.c (mark_ttys): Remove.
971 (init_tty): Safely initialize 'top_frame' slot with Qnil.
972
973 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
974
975 Change struct frame bitfields from unsigned char to unsigned.
976 * frame.h (struct frame): Change type of 'display_preempted',
977 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
978 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
979 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
980 bitfields from unsigned char to unsigned.
981
982 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
983
984 Remove unused member of struct x_output and struct w32_output.
985 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
986 * w32term.h (struct w32_output): Likewise.
987
988 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
989
990 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
991 does not become zero (Bug#12234).
992
993 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
994
995 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
996 for GCC 4.7.1 x86-64.
997
998 2012-08-30 Glenn Morris <rgm@gnu.org>
999
1000 * lread.c (init_lread): For out-of-tree builds, only add the
1001 source directory's site-lisp dir to the load-path if it exists,
1002 consistent with in-tree builds. (Bug#12302)
1003
1004 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1005
1006 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1007 button_values to NULL. Call setStykeMask so dialogs get a close button.
1008 (windowShouldClose:): Set window_closed.
1009 (dealloc): New member, free button_values.
1010 (process_dialog:): Make member function. Remove window argument,
1011 replace window with self. Count buttons and allocate and store values
1012 in button_values.
1013 (addButton:value:row:): value is int with the name tag. Call setTag
1014 with tag. Remove return self, declare return value as void.
1015 (addString:row:): Remove return self, declare return value as void.
1016 (addSplit): Remove return self, declare return value as void.
1017 (clicked:): Remove return self, declare return value as void.
1018 Set dialog_return to button_values[seltag]. Code formatting change.
1019 (initFromContents:isQuestion:): Adjust call to process_dialog.
1020 Code formatting change.
1021 (timeout_handler:): Set timer_fired to YES.
1022 (runDialogAt:): Set timer_fired to NO.
1023 Handle click on close button as quit.
1024
1025 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1026 Add window_closed and button_values. Add void as return value for
1027 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1028 Add process_dialog as new member.
1029
1030 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1031
1032 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1033 is not one of the heaps we manage. (Bug#12242)
1034
1035 2012-08-28 Glenn Morris <rgm@gnu.org>
1036
1037 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1038
1039 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1040
1041 * window.c (Fset_window_configuration): Remove handling of
1042 auto-buffer-name window parameter. Install revision of reverted
1043 fix.
1044
1045 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1046
1047 Do not allow to set major mode for a dead buffer.
1048 * buffer.c (Fset_buffer_major_mode): Signal an error
1049 if the buffer is dead.
1050 (Fother_buffer, other_buffer_safely): Remove redundant
1051 nested declaration.
1052
1053 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1054
1055 Always use set_buffer_if_live to restore original buffer at unwind.
1056 * buffer.h (record_unwind_current_buffer): New function.
1057 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1058 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1059 * undo.c, window.c: Adjust users.
1060 * buffer.c (set_buffer_if_live): Fix comment.
1061
1062 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1063
1064 Fix usage of set_buffer_internal.
1065 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1066 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1067 * coding.c (decode_coding): Omit redundant test.
1068 * fileio.c (decide_coding_unwind): Likewise.
1069 * fns.c (secure_hash): Likewise.
1070 * insdel.c (modify_region): Likewise.
1071 * keyboard.c (command_loop_1): Likewise.
1072 * print.c (PRINTFINISH): Likewise.
1073 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1074
1075 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1076
1077 * dispnew.c: Use bool for boolean.
1078 (frame_garbaged, display_completed, delayed_size_change)
1079 (fonts_changed_p, add_window_display_history)
1080 (add_frame_display_history, verify_row_hash)
1081 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1082 (row_equal_p, realloc_glyph_pool)
1083 (allocate_matrices_for_frame_redisplay)
1084 (showing_window_margins_p)
1085 (adjust_frame_glyphs_for_frame_redisplay)
1086 (build_frame_matrix_from_leaf_window, make_current)
1087 (mirrored_line_dance, mirror_line_dance, update_frame)
1088 (update_window_tree, update_single_window)
1089 (check_current_matrix_flags, update_window, update_text_area)
1090 (update_window_line, set_window_update_flags, scrolling_window)
1091 (update_frame_1, scrolling, buffer_posn_from_coords)
1092 (do_pending_window_change, change_frame_size)
1093 (change_frame_size_1, sit_for):
1094 Use bool for boolean.
1095 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1096 and remove last int (actually boolean) argument, which was always 0.
1097 All callers changed.
1098 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1099 * dispextern.h (struct composition_it): Use bool for boolean.
1100 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1101 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1102 * dired.c (file_name_completion):
1103 Use bool for boolean. (This was missed in an earlier change.)
1104
1105 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1106
1107 * window.c (Fset_window_configuration): Revert first part of
1108 last change.
1109
1110 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1111
1112 * nsterm.h (NSPanel): New class variable dialog_return.
1113
1114 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1115 dialog_return.
1116 (windowShouldClose:): Use stop instead of stopModalWithCode.
1117 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1118 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1119 event.
1120 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1121 modal loop returns.
1122
1123 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1124
1125 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1126 * composite.c (find_composition, composition_gstring_p)
1127 (composition_reseat_it, find_automatic_composition):
1128 * data.c (let_shadows_buffer_binding_p)
1129 (let_shadows_global_binding_p, set_internal, make_blv)
1130 (Fmake_variable_buffer_local, Fmake_local_variable)
1131 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1132 (cons_to_signed, arith_driver):
1133 * dbusbind.c (xd_in_read_queued_messages):
1134 * dired.c (directory_files_internal, file_name_completion):
1135 Use bool for booleans.
1136 * dired.c (file_name_completion):
1137 * process.h (fd_callback):
1138 Omit int (actually boolean) argument. It wasn't being used.
1139 All uses changed.
1140 * composite.h, lisp.h: Reflect above API changes.
1141
1142 * cmds.c, coding.c: Use bool for booleans.
1143 * cmds.c (move_point, Fself_insert_command):
1144 * coding.h (struct composition status, struct coding_system):
1145 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1146 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1147 (emacs_mule_char, decode_coding_emacs_mule)
1148 (encode_coding_emacs_mule, detect_coding_iso_2022)
1149 (decode_coding_iso_2022, encode_invocation_designation)
1150 (encode_designation_at_bol, encode_coding_iso_2022)
1151 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1152 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1153 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1154 (encode_coding_raw_text, detect_coding_charset)
1155 (decode_coding_charset, encode_coding_charset, detect_eol)
1156 (detect_coding, get_translation_table, produce_chars)
1157 (consume_chars, reused_workbuf_in_use)
1158 (make_conversion_work_buffer, code_conversion_save)
1159 (decode_coding_object, encode_coding_object)
1160 (detect_coding_system, char_encodable_p)
1161 (Funencodable_char_position, code_convert_region)
1162 (code_convert_string, code_convert_string_norecord)
1163 (Fset_coding_system_priority):
1164 * fileio.c (Finsert_file_contents):
1165 Use bool for booleans.
1166 * coding.h, lisp.h: Reflect above API changes.
1167 * coding.c: Remove unnecessary static function decls.
1168 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1169 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1170 not a boolean 'int', since callers never look at the return value.
1171 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1172 * coding.h (decoding_buffer_size, encoding_buffer_size)
1173 (emacs_mule_string_char): Remove unused extern decls.
1174 (struct iso_2022_spec, struct coding_system):
1175 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1176 (struct emacs_mule_spec): Remove unused field 'full_support'.
1177 All initializations removed.
1178 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1179
1180 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1181
1182 Fix spare memory change (Bug#12286).
1183 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1184 (valid_lisp_object_p): Likewise.
1185
1186 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1187
1188 * window.c (Fset_window_configuration): Record any window's old
1189 buffer if it's replaced (see Bug#8789). If the new current
1190 buffer doesn't appear in the selected window, go to its old
1191 point (Bug#12208).
1192
1193 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1194
1195 Special MEM_TYPE_SPARE to denote reserved memory.
1196 * alloc.c (enum mem_type): New memory type.
1197 (refill_memory_reserve): Use new type for spare memory.
1198 This prevents live_cons_p and live_string_p from incorrect
1199 detection of uninitialized objects from spare memory as live.
1200
1201 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1202
1203 Spelling fixes.
1204 * Makefile.in (.PHONY): versioclean -> versionclean.
1205
1206 Remove unused external symbols.
1207 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1208 * window.c (Qwindow_valid_p, decode_valid_window):
1209 Now static, not extern.
1210 * data.c (Qinterval): Remove; unused.
1211 (syms_of_data): Do not define 'interval'.
1212 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1213 * window.h (decode_valid_window):
1214 Remove decls.
1215
1216 * character.c, charset.c, chartab.c: Use bool for booleans.
1217 * character.c (lisp_string_width, string_count_byte8)
1218 (string_escape_byte8):
1219 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1220 (load_charset_map_from_file, map_charset_chars)
1221 (Fdefine_charset_internal, define_charset_internal)
1222 (Fdeclare_equiv_charset, find_charsets_in_text)
1223 (Ffind_charset_region, char_charset, Fiso_charset):
1224 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1225 (sub_char_table_set, sub_char_table_set_range)
1226 (char_table_set_range, optimize_sub_char_table)
1227 (map_sub_char_table):
1228 Use bool for boolean.
1229 * character.c (str_to_unibyte): Omit last boolean argument; it was
1230 always 0. All callers changed.
1231 * character.h, charset.h: Adjust to match previous changes.
1232 * character.h (char_printable_p): Remove decl of nonexistent function.
1233 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1234 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1235 are all boolean, so make them single-bit bitfields.
1236
1237 * lisp.h (ASET): Remove attempt to detect side effects.
1238 It was meant to be temporary and it often doesn't work,
1239 because when IDX has side effects the behavior of IDX==IDX
1240 is undefined. See Stefan Monnier in
1241 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1242
1243 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1244
1245 * lisp.h (functionp): New function (extracted from Ffunctionp).
1246 (FUNCTIONP): Use it.
1247 * eval.c (Ffunctionp): Use it.
1248
1249 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1250
1251 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1252 as that's faster and simpler than static storage. Don't bother
1253 with the g_main_context_query overhead if g_main_context_pending
1254 says no events are pending.
1255 (gfds, gfds_size): Remove these static vars.
1256 (xgselect_initialize): Remove; no longer needed.
1257 All uses and decls removed.
1258
1259 * emacs.c (fatal_error_signal_hook): Remove.
1260 All uses removed. This leftover from old code was always 0.
1261
1262 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1263 * casefiddle.c (casify_object, casify_region):
1264 * casetab.c (set_case_table):
1265 * category.c, category.h (word_boundary_p):
1266 * category.h (CHAR_HAS_CATEGORY):
1267 Use bool for booleans, instead of int.
1268
1269 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1270
1271 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1272
1273 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1274
1275 On assertion failure, print backtrace if available.
1276 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1277 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1278 * Makefile.in (LIB_EXECINFO): New macro.
1279 (LIBES): Use it.
1280
1281 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1282 * bytecode.c (exec_byte_code):
1283 * callint.c (check_mark, Fcall_interactively):
1284 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1285 (getenv_internal, sync_process_alive, call_process_exited):
1286 * lisp.h (USE_SAFE_ALLOCA):
1287 Use bool for booleans, instead of int.
1288 * lisp.h, process.h: Adjust prototypes to match above changes.
1289 * callint.c (Fcall_interactively): Don't assume the mark's
1290 offset fits in 'int'.
1291
1292 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1293
1294 * buffer.c, buffer.h: Use bool for boolean.
1295 * buffer.c (reset_buffer_local_variables)
1296 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1297 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1298 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1299 (overlay_touches_p, overlay_strings, Foverlay_put)
1300 (report_overlay_modification, call_overlay_mod_hooks):
1301 (mmap_enlarge, mmap_set_vars):
1302 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1303 Use bool for booleans, instead of int.
1304 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1305 since the 1-or-0 return value is always ignored anyway.
1306 (mmap_initialized_p):
1307 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1308 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1309
1310 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1311
1312 * bidi.c: Use bool for boolean.
1313 This is a bit more readable, and makes the text segment of bidi.o
1314 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1315 Presumably it's faster too.
1316 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1317 Now bool.
1318 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1319 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1320 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1321 (bidi_explicit_dir_char, bidi_level_of_next_char)
1322 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1323 Use bool for booleans, instead of int.
1324 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1325 (bidi_unshelve_cache): Adjust decls to match code.
1326
1327 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1328
1329 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1330 argument.
1331
1332 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1333
1334 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1335 * atimer.h: Include <stdbool.h>.
1336
1337 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1338
1339 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1340 compile time tests instead of run time tests on systems that do
1341 not use them.
1342 (FRAME_MAC_P): Remove leftover from deleted code.
1343 * frame.c (syms_of_frame): Remove leftover from deleted code.
1344
1345 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1346
1347 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1348
1349 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1350
1351 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1352 Otherwise, the compiler complains about (A?B:C) where B is void
1353 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1354 (fontset_add): Return void, for FONTSET_ADD.
1355
1356 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1357
1358 * alloc.c: Use bool for booleans.
1359 (gc_in_progress, abort_on_gc)
1360 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1361 (dont_register_blocks) [GC_MALLOC_CHECK]:
1362 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1363 (check_string_bytes, make_specified_string, memory_full)
1364 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1365 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1366 (mark_stack, valid_pointer_p, make_pure_string)
1367 (Fgarbage_collect, survives_gc_p, gc_sweep):
1368 Use bool for booleans, instead of int.
1369 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1370 Remove unused local.
1371 * alloc.c (PURE_POINTER_P):
1372 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1373 * editfns.c (Fformat):
1374 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1375 (Fdo_auto_save):
1376 * fns.c (sweep_weak_table):
1377 * lisp.h (suppress_checking, push_message, survives_gc_p)
1378 (make_pure_string, gc_in_progress, abort_on_gc):
1379 * lread.c (readchar, read1):
1380 * print.c (Fprin1_to_string):
1381 * xdisp.c (push_message):
1382 Use bool for booleans affected directly or indirectly by
1383 alloc.c's changes.
1384
1385 Make recently-introduced setters macros.
1386 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1387 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1388 (set_fontset_default, set_fontset_fallback): Rename from their
1389 upper-case counterparts, and make them functions rather than macros.
1390 This is more consistent with the other recently-introduced setters.
1391 These don't need to be inline, since they're local.
1392
1393 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1394
1395 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1396 the loop (Bug#12247).
1397
1398 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1399
1400 * lisp.h (vcopy): Use memcpy rather than our own loop.
1401 This fixes a performance regression introduced by the recent
1402 addition of vcopy. This means 'vcopy' will need to be modified
1403 for a copying collector, but that's OK. Also, tighten the
1404 checking in the assertion.
1405
1406 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1407
1408 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1409 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1410 non-base glyph for the width of the base character, according to
1411 what x_draw_composite_glyph_string_foreground expects.
1412 Generate WADJUST value according to composition_gstring_width's
1413 expectations, to produce correct width of the composed character.
1414 Reverse the sign of the DU offset produced by ScriptPlace.
1415
1416 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1417
1418 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1419
1420 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1421
1422 Avoid direct writes to contents member of struct Lisp_Vector.
1423 * lisp.h (vcopy): New function to copy data into vector.
1424 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1425 * fns.c (Ffillarray): Use ASET.
1426 * keyboard.c (timer_check_2): Use AREF and ASET.
1427 (append_tool_bar_item, Frecent_keys): Use vcopy.
1428 * lread.c (read_vector): Use ASET.
1429 * msdos.c (Frecent_doskeys): Use vcopy.
1430 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1431 (Finternal_merge_in_global_face): Use ASET and vcopy.
1432 * xfont.c (xfont_list_pattern): Likewise.
1433
1434 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1435
1436 * window.c (Fwindow_point): For the selected window always return
1437 the position of its buffer's point.
1438 (Fset_window_point): For the selected window always go in its
1439 buffer to the specified position.
1440
1441 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1442
1443 Setter macros for fontsets.
1444 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1445 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1446 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1447 Adjust users.
1448
1449 2012-08-20 Glenn Morris <rgm@gnu.org>
1450
1451 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1452 Don't assume that `ln -f' works.
1453
1454 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1455
1456 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1457 and later about non-assignments with no effect. See discussion at
1458 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1459 details.
1460
1461 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1462
1463 Inline setter functions for Lisp_Objects slots of struct specbinding.
1464 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1465 Adjust users.
1466
1467 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1468
1469 * window.c (select_window): Always make selected window's buffer
1470 current.
1471
1472 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1473
1474 Use AREF and ASET for docstrings of category tables.
1475 * category.h (CATEGORY_DOCSTRING): Use AREF.
1476 (SET_CATEGORY_DOCSTRING): Use ASET.
1477 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1478
1479 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1480
1481 Inline setter functions for hash table members.
1482 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1483 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1484 (set_hash_key_and_value, set_hash_index, set_hash_next)
1485 (set_hash_hash): New functions.
1486 * charset.c, fns.c: Adjust users.
1487
1488 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1489
1490 Inline getter and setter functions for per-buffer values.
1491 * buffer.h (per_buffer_default, set_per_buffer_default)
1492 (per_buffer_value, set_per_buffer_value): New functions.
1493 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1494 * buffer.c, data.c: Adjust users.
1495
1496 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1497
1498 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1499
1500 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1501
1502 Rely on <config.h> + <unistd.h> to declare 'environ',
1503 as gnulib does this if the system doesn't.
1504 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1505 Remove declaration. MS-Windows declares it on stdlib.h which is
1506 included by conf_post.h.
1507 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1508 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1509 * vm-limit.c: Include <unistd.h>, for 'environ'.
1510
1511 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1512 (start_of_data): Remove decl; mem-limits.h provides it.
1513
1514 * xdisp.c (handle_invisible_prop): Make it a bit faster
1515 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1516
1517 2012-08-19 Chong Yidong <cyd@gnu.org>
1518
1519 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1520 ends (Bug#3874).
1521
1522 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1523
1524 * .gdbinit: Use call instead of set when calling a function in the
1525 inferior.
1526
1527 * data.c (set_internal): Don't use set_blv_found.
1528 (Fkill_local_variable): Likewise.
1529
1530 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1531
1532 * nsfont.m (ns_ascii_average_width): Ensure the string
1533 ascii_printable is initialized with a null-terminated character
1534 array. Otherwise, it can contain undesired extra characters.
1535
1536 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1537
1538 port new setting code to Sun C 5.8 2005/10/13
1539 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1540 Return void, not Lisp_Object. Otherwise, the compiler
1541 complains about (A?B:C) where B is void and C is Lisp_Object
1542 when compiling CHAR_TABLE_SET, due to the recent change to
1543 the API of sub_char_table_set_contents.
1544
1545 2012-08-18 Chong Yidong <cyd@gnu.org>
1546
1547 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1548 for the string case (Bug#3874).
1549
1550 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1551
1552 * buffer.h (BSET): Remove (Bug#12215).
1553 Replace all uses with calls to new setter functions.
1554 (bset_bidi_paragraph_direction, bset_case_canon_table)
1555 (bset_case_eqv_table, bset_directory, bset_display_count)
1556 (bset_display_time, bset_downcase_table)
1557 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1558 (bset_last_selected_window, bset_local_var_alist)
1559 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1560 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1561 (bset_width_table):
1562 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1563 (bset_auto_fill_function, bset_auto_save_file_format)
1564 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1565 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1566 (bset_cache_long_line_scans, bset_case_fold_search)
1567 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1568 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1569 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1570 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1571 (bset_header_line_format, bset_indicate_buffer_boundaries)
1572 (bset_indicate_empty_lines, bset_invisibility_spec)
1573 (bset_left_fringe_width, bset_major_mode, bset_mark)
1574 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1575 (bset_name, bset_overwrite_mode, bset_pt_marker)
1576 (bset_right_fringe_width, bset_save_length)
1577 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1578 (bset_scroll_up_aggressively, bset_selective_display)
1579 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1580 (bset_word_wrap, bset_zv_marker):
1581 * category.c (bset_category_table):
1582 * syntax.c (bset_syntax_table):
1583 New setter functions.
1584
1585 * process.h (PSET): Remove (Bug#12215).
1586 Replace all uses with calls to new setter functions.
1587 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1588 (PROCESS_INLINE): New macro.
1589 (pset_childp): New setter function.
1590 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1591 * process.c (PROCESS_INLINE):
1592 Define to EXTERN_INLINE, so that the corresponding functions
1593 are compiled into code.
1594 (pset_buffer, pset_command, pset_decode_coding_system)
1595 (pset_decoding_buf, pset_encode_coding_system)
1596 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1597 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1598 (pset_type, pset_write_queue): New setter functions.
1599
1600 * window.h (WSET): Remove (Bug#12215).
1601 Replace all uses with calls to new setter functions.
1602 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1603 (WINDOW_INLINE): New macro.
1604 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1605 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1606 (wset_total_lines, wset_vertical_scroll_bar)
1607 (wset_window_end_pos, wset_window_end_valid)
1608 (wset_window_end_vpos): New setter functions.
1609 * window.c (WINDOW_INLINE):
1610 Define to EXTERN_INLINE, so that the corresponding functions
1611 are compiled into code.
1612 (wset_combination_limit, wset_dedicated, wset_display_table)
1613 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1614 (wset_new_normal, wset_new_total, wset_next_buffers)
1615 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1616 (wset_prev_buffers, wset_right_fringe_width)
1617 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1618 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1619 (wset_window_parameters):
1620 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1621 (wset_column_number_displayed, wset_region_showing):
1622 New setter functions.
1623
1624 * termhooks.h (TSET): Remove (Bug#12215).
1625 Replace all uses with calls to new setter functions.
1626 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1627 (TERMHOOKS_INLINE): New macro.
1628 (tset_charset_list, tset_selection_alist): New setter functions.
1629 * terminal.c (TERMHOOKS_INLINE):
1630 Define to EXTERN_INLINE, so that the corresponding functions
1631 are compiled into code.
1632 (tset_param_alist): New setter function.
1633
1634 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1635
1636 * keyboard.h (KSET): Remove (Bug#12215).
1637 Replace all uses with calls to new setter functions.
1638 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1639 (KEYBOARD_INLINE): New macro.
1640 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1641 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1642 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1643 New setter functions.
1644 * keyboard.c (KEYBOARD_INLINE):
1645 Define to EXTERN_INLINE, so that the corresponding functions
1646 are compiled into code.
1647 (kset_echo_string, kset_kbd_queue)
1648 (kset_keyboard_translate_table, kset_last_prefix_arg)
1649 (kset_last_repeatable_command, kset_local_function_key_map)
1650 (kset_overriding_terminal_local_map, kset_real_last_command)
1651 (kset_system_key_syms): New setter functions.
1652
1653 * frame.h (FSET): Remove (Bug#12215).
1654 Replace all uses with calls to new setter functions.
1655 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1656 (FRAME_INLINE): New macro.
1657 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1658 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1659 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1660 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1661 (fset_param_alist, fset_root_window, fset_scroll_bars)
1662 (fset_selected_window, fset_title, fset_tool_bar_items)
1663 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1664 * frame.c (FRAME_INLINE):
1665 Define to EXTERN_INLINE, so that the corresponding functions
1666 are compiled into code.
1667 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1668
1669 A few more naming-convention fixes for getters and setters.
1670 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1671 and rename from buffer_overlays_set_before.
1672 (set_buffer_overlays_after): Move here from buffer.h, and rename
1673 from buffer_overlays_set_after.
1674 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1675 All uses changed.
1676 (set_buffer_intervals): Rename from buffer_set_intervals.
1677 * intervals.c (set_interval_object): Move here from intervals.h,
1678 and rename from interval_set_object.
1679 (set_interval_left): Move here from intervals.h, and rename from
1680 interval_set_left.
1681 (set_interval_right): Move here from intervals.h, and rename from
1682 interval_set_right.
1683 (copy_interval_parent): Move here from intervals.h, and rename from
1684 interval_copy_parent.
1685 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1686 (set_interval_plist): Rename from interval_set_plist.
1687 Return void, not Lisp_Object, since no caller uses the result.
1688 * lisp.h (string_intervals): Rename from string_get_intervals.
1689 (set_string_intervals): Rename from string_set_intervals.
1690
1691 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1692 (set_char_table_contents): Rename from char_table_set_contents.
1693 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1694 All uses changed. See the end of
1695 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1696
1697 * lisp.h (CSET): Remove (Bug#12215).
1698 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1699 (set_char_table_purpose): New functions,
1700 replacing CSET. All uses changed. For example, replace
1701 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1702 "set_char_table_parent (char_table, parent);".
1703 The old version was confusing because it used the same name
1704 'parent' for two different things.
1705
1706 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1707
1708 Functions to get and set Lisp_Object fields of buffer-local variables.
1709 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1710 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1711 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1712 * data.c, eval.c, frame.c: Adjust users.
1713
1714 2012-08-17 Chong Yidong <cyd@gnu.org>
1715
1716 * xfaces.c (merge_face_vectors): If the target font specfies a
1717 font spec, make the font's attributes take precedence over
1718 directly-specified attributes.
1719 (merge_face_ref): Recognize :font.
1720
1721 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1722
1723 Do not use memcpy for copying intervals.
1724 * intervals.c (reproduce_interval): New function.
1725 (reproduce_tree, reproduce_tree_obj): Use it.
1726 (reproduce_tree_obj): Remove prototype.
1727
1728 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1729
1730 * lisp.h (duration_to_sec_usec): Remove unused decl.
1731
1732 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1733
1734 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1735 to an allocated instance of NSString, not to the class itself.
1736
1737 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1738
1739 * makefile.w32-in (C_CTYPE_H): New macro.
1740 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1741 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1742 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1743
1744 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1745
1746 Use ASCII tests for character types.
1747 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1748 * xfns.c, xterm.c:
1749 Don't include <ctype.h>; was not needed.
1750 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1751 * sysdep.c, xfaces.c:
1752 Include <c-ctype.h> instead of <ctype.h>.
1753 * nsterm.m: Include <c-ctype.h>.
1754 * charset.c (read_hex):
1755 * doc.c (Fsnarf_documentation):
1756 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1757 (DRIVE_LETTER) [DOS_NT]:
1758 (Ffile_name_directory, Fexpand_file_name)
1759 (Fsubstitute_in_file_name):
1760 * font.c (font_parse_xlfd, font_parse_fcname):
1761 * frame.c (x_set_font_backend):
1762 * gtkutil.c (xg_get_font):
1763 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1764 * nsimage.m (hexchar):
1765 * nsterm.m (ns_xlfd_to_fontname):
1766 * sysdep.c (system_process_attributes):
1767 * xfaces.c (hash_string_case_insensitive):
1768 Use C-locale tests instead of locale-specific tests for character
1769 types, since we want the ASCII interpretation here, not the
1770 interpretation suitable for whatever happens to be the current locale.
1771
1772 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1773
1774 Consistently check windows for validity/liveness
1775 (Bug#11984, Bug#12025, Bug#12026).
1776 * lisp.h (CHECK_VALID_WINDOW): New macro.
1777 * window.c (decode_window): Rename to decode_live_window.
1778 (decode_valid_window, Fwindow_valid_p): New functions.
1779 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1780 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1781 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1782 (Fwindow_prev_sibling, Fwindow_combination_limit)
1783 (Fset_window_combination_limit, Fwindow_use_time)
1784 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1785 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1786 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1787 (Fwindow_hscroll, Fset_window_hscroll)
1788 (Fwindow_redisplay_end_trigger)
1789 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1790 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1791 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1792 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1793 (Fwindow_end, Fset_window_point, Fset_window_start)
1794 (Fpos_visible_in_window_p, Fwindow_line_height)
1795 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1796 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1797 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1798 (Fset_window_parameter, Fwindow_display_table)
1799 (Fset_window_display_table, Fdelete_other_windows_internal)
1800 (Fset_window_buffer, Fset_window_new_total)
1801 (Fset_window_new_normal, Fdelete_window_internal)
1802 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1803 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1804 (Fwindow_scroll_bars): Check whether argument window is a valid or
1805 live window. Update doc-strings.
1806 (syms_of_window): New symbol Qwindow_valid_p.
1807 * keyboard.c (Fposn_at_x_y): Check whether argument
1808 frame_or_window denotes a valid window.
1809
1810 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1811
1812 Fix previous char table change.
1813 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1814 * chartab.c (optimize_sub_char_table): Likewise.
1815
1816 2012-08-16 Chong Yidong <cyd@gnu.org>
1817
1818 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1819
1820 * xfont.c (xfont_open):
1821 * xftfont.c (xftfont_open): Set the font's max_width field.
1822
1823 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1824 min_width to space_width and average_width to the average over
1825 printable ASCII characters.
1826 (ns_char_width): Code cleanup.
1827 (ns_ascii_average_width): New utility function.
1828
1829 * font.h (struct font): Update comments.
1830
1831 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1832
1833 Simple interface to set Lisp_Object fields of character tables.
1834 * lisp.h (CSET): New macro.
1835 (char_table_set_extras, char_table_set_contents)
1836 (sub_char_table_set_contents): New function.
1837 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1838 * syntax.c: Adjust users.
1839
1840 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1841
1842 * eval.c (eval_sub): Bind lexical-binding.
1843 * lread.c (Qlexical_binding): Make non-static.
1844
1845 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1846
1847 * nsmenu.m (popupSession): Remove.
1848 (pop_down_menu): Remove endModalSession.
1849 (timeout_handler:): New method.
1850 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1851 Call runModalForWindow. Check timer_fired when it returns.
1852 If not set, cancel timer and break out of loop.
1853 Otherwise loop again, with a new timeout.
1854
1855 * nsterm.m: Include fcntl.h if present.
1856 (fd_entry, t_readfds, inNsSelect): Remove.
1857 (select_writefds, select_valid, select_timeout, selfds)
1858 (select_mutex, apploopnr): Add.
1859 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1860 Otherwise call kbd_buffer_store_event.
1861 (ns_send_appdefined): Remove release of fd_entry.
1862 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1863 Increment and decrement apploopnr.
1864 (ns_select): If no file descriptors, just do a NSTimer.
1865 Otherwise copy read/write masks and start select thread (fd_handler).
1866 Start main loop and wait for application defined event.
1867 Inform select thread to stop selecting after main loop is exited.
1868 (ns_term_init): Create selfds pipe and set non-blocking.
1869 Initialize select_mutex. Start the select thread (fd_handler).
1870 (fd_handler:): Loop forever, wait for info from the main thread
1871 to either start or stop selecting. When select returns, send
1872 and appdefined event.
1873 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1874 If not call kbd_buffer_store_event.
1875
1876 * nsterm.h (EmacsApp): fd_handler takes id argument.
1877 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1878
1879 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1880
1881 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1882
1883 * region-cache.c (move_cache_gap): Update gap_len using the actual
1884 growth of the boundaries array. Do not change cache_len.
1885 (Bug#12196)
1886
1887 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1888
1889 Generalize and cleanup font subsystem checks.
1890 * font.h (FONT_DEBUG, font_assert): Remove.
1891 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1892 Change font_assert to eassert. Use eassert where appropriate.
1893
1894 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1895
1896 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1897
1898 2012-08-15 Chong Yidong <cyd@gnu.org>
1899
1900 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1901 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1902 extract the font descriptor instead of just the font name.
1903 In that case, return a font spec instead of a string.
1904 (x_last_font_name): Move to this file from xfns.c.
1905
1906 * xfns.c (Fx_select_font): The return value can also be a font
1907 spec. Move x_last_font_name management to gtkutil.c.
1908
1909 * xfaces.c: Make font weight and style symbols non-static.
1910
1911 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1912
1913 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1914 (bug#12117).
1915
1916 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1917
1918 * alloc.c (Fgarbage_collect): Use plural form consistently.
1919
1920 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1921
1922 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1923 iteration through the command loop. Fixes a problem whereby mouse
1924 movements are ignored until the first mouse click.
1925
1926 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1927
1928 Use bool, not int, for Lisp booleans.
1929 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1930 makes Emacs a bit smaller and presumably a bit faster.
1931 * lisp.h: Include <stdbool.h>.
1932 (struct Lisp_Boolfwd, defvar_bool):
1933 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1934 * regex.c [!emacs]: Include <stdbool.h>.
1935 (false, true): Remove; <stdbool.h> does this for us now.
1936
1937 2012-08-14 Chong Yidong <cyd@gnu.org>
1938
1939 * character.c (Fcharacterp): Doc fix (Bug#12076).
1940
1941 * data.c (Findirect_variable): Doc fix (Bug#11040).
1942
1943 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1944
1945 * editfns.c (Fformat): Doc fix (Bug#12059).
1946 (Fsave_current_buffer): Doc fix (Bug#11542).
1947
1948 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1949
1950 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1951 (bug#12022).
1952
1953 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1954
1955 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1956 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1957 * minibuf.c (choose_minibuf_frame, read_minibuf):
1958 * w32fns.c (x_create_tip_frame):
1959 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1960 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1961
1962 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1963
1964 * intervals.c (offset_intervals): Remove obsolete comment.
1965
1966 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1967
1968 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1969
1970 2012-08-14 Gergely Risko <gergely@risko.hu>
1971
1972 * coding.c (decode_coding): Record buffer modification before
1973 disabling undo_list (Bug#11773).
1974
1975 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1976
1977 Revert and cleanup some recent overlay changes.
1978 * buffer.h (enum overlay_type): Remove.
1979 (buffer_get_overlays, buffer_set_overlays): Likewise.
1980 (buffer_set_overlays_before, buffer_set_overlays_after):
1981 New function. Adjust users.
1982 (unchain_both): Add eassert.
1983
1984 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1985
1986 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1987
1988 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1989
1990 * gtkutil.c (xg_mark_data): Don't assume C99.
1991
1992 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1993
1994 * gtkutil.c (xg_frame_tb_info): New struct.
1995 (TB_INFO_KEY): New define.
1996 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1997 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1998 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1999 if not present.
2000 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2001 is up to date. Otherwise store new data.
2002 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2003
2004 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2005
2006 Use KSET for write access to Lisp_Object members of struct kboard.
2007 * keyboard.h (KSET): New macro.
2008 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2009 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2010 * xterm.c: Adjust users.
2011
2012 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2013
2014 Use BSET for write access to Lisp_Object members of struct buffer.
2015 * buffer.h (BSET): New macro.
2016 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2017 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2018 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2019 * window.c, xdisp.c, xfns.c: Adjust users.
2020
2021 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2022
2023 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2024
2025 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2026
2027 * nsterm.m (not_in_argv): New function.
2028 (application:openFile, application:openTempFile:):
2029 (application:openFileWithoutUI:, application:openFiles:): Open file
2030 if not_in_argv returns non-zero (bug#12171).
2031
2032 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2033 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2034 Define for Gtk+ versions less than 3.2.
2035 (xg_get_font_name): Use those functions/macros here.
2036 Reported by Frans Oilinki <moilinki@gmail.com>.
2037
2038 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2039
2040 * unexmacosx.c (copy_data_segment): Copy initialized data in
2041 statically linked libraries from input file rather than memory.
2042
2043 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2044 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2045 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2046
2047 2012-08-10 Glenn Morris <rgm@gnu.org>
2048
2049 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2050 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2051
2052 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2053
2054 Fix last change to allow compilation with low optimization levels.
2055 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2056 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2057
2058 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2059
2060 Use common inline syntax in intervals.h.
2061 * intervals.h (INTERVALS_INLINE): New macro.
2062 Change all users from LISP_INLINE.
2063
2064 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2065
2066 Define Qnone once for all platforms.
2067 * frame.c (Qnone): Define here.
2068 (syms_of_frame): DEFSYM it.
2069 * lisp.h (Qnone): New declaration.
2070 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2071 * xfns.c: Remove duplication. Adjust users.
2072
2073 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2074
2075 Remove unused macros from intervals.h.
2076 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2077 * intervals.c: Adjust comment.
2078
2079 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2080
2081 * w32fns.c <w32_unicode_gui>: New static variable.
2082 (globals_of_w32fns): Initialize it according to os_subtype.
2083 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2084 testing os_subtype.
2085
2086 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2087 Eli Zaretskii <eliz@gnu.org>
2088
2089 Fix bug #10299 with Unicode characters sent by customized
2090 keyboards created by MSKLC.
2091 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2092 (w32_init_class): Use it to initialize the Emacs class with either
2093 ANSI or Unicode API calls.
2094 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2095 later.
2096 (w32_wnd_proc): If the character code sent by WM_CHAR or
2097 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2098 original message. Call DefWindowProcW on NT and later.
2099
2100 2012-08-10 Glenn Morris <rgm@gnu.org>
2101
2102 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2103
2104 * lisp.h (DIRECTORY_SEP): Let configure set it.
2105
2106 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2107
2108 Use TSET for write access to Lisp_Object slots of struct terminal.
2109 * termhooks.h (TSET): New macro.
2110 * coding.c, terminal.c, xselect.c: Adjust users.
2111
2112 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2113
2114 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2115 the failing expression, include them in the error message.
2116 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2117 * lisp.h (internal_condition_case_n): Update declaration.
2118
2119 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2120
2121 Inline functions to examine and change buffer overlays.
2122 * buffer.c (unchain_both): New function.
2123 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2124 (buffer_has_overlays): New function.
2125 (enum overlay_type): New enum.
2126 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2127 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2128
2129 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2130
2131 Inline functions to examine and change buffer intervals.
2132 * alloc.c (mark_interval_tree): Remove.
2133 (MARK_INTERVAL_TREE): Simplify.
2134 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2135 * intervals.c (buffer_balance_intervals): New function.
2136 (graft_intervals_into_buffer): Adjust indentation.
2137 (set_intervals_multibyte): Simplify.
2138 * buffer.h (BUF_INTERVALS): Remove.
2139 (buffer_get_intervals, buffer_set_intervals): New function.
2140 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2141 * intervals.c, textprop.c: Adjust users.
2142
2143 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2144
2145 Inline functions to examine and change string intervals.
2146 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2147 (string_get_intervals, string_set_intervals): New function.
2148 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2149 * lread.c, print.c, textprop.c: Adjust users.
2150
2151 2012-08-08 Glenn Morris <rgm@gnu.org>
2152
2153 * lisp.mk (lisp): Remove language/persian.elc.
2154
2155 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2156
2157 Cleanup intervals.
2158 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2159 (NULL_INTERVAL_P): Likewise. Adjust users.
2160 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2161 Adjust comment. Move under #if 0.
2162 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2163 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2164
2165 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2166
2167 Check total length of intervals with eassert.
2168 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2169 * intervals.c: Change all users to eassert.
2170
2171 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2172
2173 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2174 Rename fields to match removal of FGET and WGET and disuse of
2175 INTERNAL_FIELD in Lisp_Cons.
2176
2177 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2178
2179 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2180 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2181 name since all xname users are fixed long time ago. Do not
2182 use INTERNAL_FIELD.
2183 (set_symbol_name, set_symbol_function, set_symbol_plist):
2184 (set_symbol_next, set_overlay_plist): New function.
2185 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2186 (struct Lisp_Overlay): Likewise.
2187 (CVAR, MVAR, SVAR): Remove.
2188 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2189 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2190 * xterm.c: Adjust users.
2191 * .gdbinit: Change to use name field of struct Lisp_Symbol
2192 where appropriate.
2193
2194 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2195
2196 Basic functions to set Lisp_Object and pointer slots of intervals.
2197 * intervals.h (interval_set_parent, interval_set_object):
2198 (interval_set_left, interval_set_right, interval_set_plist):
2199 (interval_copy_parent): New function.
2200 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2201 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2202 Adjust indentation.
2203 (INTERVAL_SIZE): Remove. Adjust users.
2204 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2205
2206 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2207
2208 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2209 * process.h (PGET): Remove.
2210 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2211 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2212
2213 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2214
2215 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2216 * window.h (WGET): Remove.
2217 (struct window): Do not use INTERNAL_FIELD.
2218 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2219 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2220 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2221 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2222 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2223 Adjust users.
2224
2225 2012-08-07 Chong Yidong <cyd@gnu.org>
2226
2227 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2228 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2229 (Fdelete_window_internal): Signal an error if the window is not on
2230 a live frame (Bug#12025).
2231
2232 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2233
2234 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2235 * frame.h (FGET): Remove.
2236 (struct frame): Do not use INTERNAL_FIELD.
2237 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2238 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2239 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2240 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2241
2242 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2243
2244 * w32.c: Silence compiler warnings.
2245 (map_w32_filename): Remove unused variable `is_fat'.
2246 (chase_symlinks): Add parentheses around expression.
2247
2248 2012-08-06 Glenn Morris <rgm@gnu.org>
2249
2250 * sysdep.c: Respect BROKEN_GETWD.
2251
2252 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2253 Let configure handle it.
2254 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2255
2256 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2257
2258 Use GCALIGNMENT where appropriate.
2259 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2260 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2261 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2262
2263 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2264
2265 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2266 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2267
2268 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2269
2270 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2271 that should be sufficient for everyone.
2272
2273 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2274
2275 * keyboard.c (timer_check_2): Add break so timer_check returns next
2276 timeout.
2277
2278 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2279
2280 Fix Windows build errors introduced after converting to WGET and WSET.
2281 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2282 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2283
2284 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2285
2286 * nsterm.m (ns_frame_rehighlight): Use FSET.
2287
2288 * nsmenu.m (ns_update_menubar): Use FSET.
2289
2290 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2291
2292 Separate read and write access to Lisp_Object slots of Lisp_Process.
2293 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2294 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2295
2296 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2297
2298 Separate read and write access to Lisp_Object slots of struct window.
2299 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2300 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2301 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2302 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2303 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2304 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2305 Adjust users.
2306
2307 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2308
2309 Fix Windows build errors introduced after converting to FGET and FSET.
2310 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2311 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2312 (w32_judge_scroll_bars): Change to use FSET.
2313 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2314
2315 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2316
2317 Fix replacement typo.
2318 * window.c (replace_window): Set root_window instead of
2319 selected_window. This fixes a total window subsystem
2320 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2321
2322 2012-08-06 Glenn Morris <rgm@gnu.org>
2323
2324 * lisp.mk (lisp): Add language/persian.elc.
2325
2326 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2327
2328 Separate read and write access to Lisp_Object slots of struct frame.
2329 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2330 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2331 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2332 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2333 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2334
2335 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2336
2337 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2338
2339 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2340
2341 Generalize common compile-time constants.
2342 * lisp.h (header_size, bool_header_size, word_size): Now here.
2343 (struct Lisp_Vector): Add comment.
2344 (struct Lisp_Bool_Vector): Move up to define handy constants.
2345 (VECSIZE, PSEUDOVECSIZE): Simplify.
2346 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2347 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2348 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2349 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2350 * xfont.c, xmenu.c: Use word_size where appropriate.
2351
2352 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2353
2354 * search.c (Freplace_match): Treat \? in the replacement text
2355 literally (Bug#8161).
2356
2357 2012-08-05 Chong Yidong <cyd@gnu.org>
2358
2359 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2360 * frame.c (Vdelete_frame_functions):
2361 * emacs.c (Vkill_emacs_hook): Doc fix.
2362
2363 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2364
2365 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2366 --with-x-toolkit=no builds.
2367 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2368
2369 2012-08-04 Chong Yidong <cyd@gnu.org>
2370
2371 * syntax.c (Fmodify_syntax_entry): Doc fix.
2372
2373 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2374
2375 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2376 * w32.c (init_environment): Change the default values of many
2377 environment variables in dflt_envvars[] to NULL, to avoid pushing
2378 them into environment when they were not already defined.
2379 Remove the code that deletes site-lisp subdirectories from the default
2380 value of EMACSLOADPATH, as it is no longer needed.
2381 (check_windows_init_file): Now external, not static.
2382 Use Vload_path as is, without adding anything, as this function is now
2383 called when Vload_path is already set up.
2384
2385 * w32.h (check_windows_init_file): Add prototype.
2386
2387 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2388 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2389 compatibility with Posix platforms.
2390 (main): Move the call to check_windows_init_file to here from
2391 w32.c.
2392 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2393 any, in the DEFALT argument into the root of the Emacs build or
2394 installation tree, as appropriate.
2395
2396 * callproc.c (init_callproc_1): Call decode_env_path instead of
2397 doing its equivalent by hand.
2398 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2399 the code that sets Vexec_path run on MS-Windows.
2400
2401 * lread.c (init_lread): Add comments to #ifdef's.
2402
2403 * msdos.c (dos_set_window_size, IT_update_begin)
2404 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2405 instead of direct references.
2406
2407 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2408
2409 Export DEFAULT_REHASH_* to GDB.
2410 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2411 Now constants, not macros.
2412
2413 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2414
2415 Remove unnecessary casts involving pointers.
2416 These casts are no longer needed now that we assume C89 or later,
2417 since they involve casting to or from void *.
2418 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2419 (make_pure_float, make_pure_vector):
2420 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2421 * macros.c (Fstart_kbd_macro):
2422 * menu.c (find_and_return_menu_selection):
2423 * minibuf.c (read_minibuf_noninteractive):
2424 * sysdep.c (closedir):
2425 * xdisp.c (x_produce_glyphs):
2426 * xfaces.c (compare_fonts_by_sort_order):
2427 * xfns.c (x_real_positions, select_visual):
2428 * xselect.c (x_stop_queuing_selection_requests)
2429 (x_get_window_property, x_get_window_property_as_lisp_data):
2430 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2431 Remove unnecessary pointer casts.
2432 * alloc.c (record_xmalloc): New function.
2433 * lisp.h (record_xmalloc): New decl.
2434 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2435 more like a function. This is because the pointer cast is not
2436 needed. All uses changed.
2437 * print.c (print_string, print_error_message): Avoid length recalc.
2438
2439 Improve fix for macroexp crash with debugging (Bug#12118).
2440 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2441 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2442 not supposed to be invoked from the garbage collector.
2443 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2444 (gc_aset): New function, which is like ASET but can be
2445 used in the garbage collector.
2446 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2447 (set_hash_index): Use it instead of ASET.
2448
2449 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2450
2451 Support symlinks on latest versions of MS-Windows.
2452 * w32.c: Include winioctl.h and aclapi.h.
2453 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2454 (revert_to_self): Forward declarations of static functions.
2455 <static BOOL g_b_init_get_security_info>:
2456 <g_b_init_create_symbolic_link>: New static flags.
2457 (globals_of_w32): Initialize them to zero.
2458 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2459 (map_w32_filename): Improve commentary. Simplify switch.
2460 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2461 headers (most versions of MinGW w32api don't).
2462 (get_security_info, create_symbolic_link)
2463 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2464 New functions.
2465 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2466 in the argument file name.
2467 (sys_access): Call unc_volume_file_attributes only if
2468 GetFileAttributes fails with network-related error codes.
2469 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2470 have the required privileges.
2471 (get_file_security_desc_by_name): Rename from
2472 get_file_security_desc.
2473 (stat_worker): New function, with most of the guts of 'stat', and
2474 with addition of handling of symlinks and support for 'lstat'.
2475 If possible, get file's attributes and security information by
2476 handle, not by name. Produce S_IFLNK bit for symlinks, when
2477 called from 'lstat'.
2478 (stat, lstat): New functions, call 'stat_worker'.
2479 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2480 symlinks when the underlying filesystem supports them.
2481
2482 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2483
2484 Fix macroexp crash on Windows with debugging (Bug#12118).
2485 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2486 checking subscripts; problem introduced with the recent
2487 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2488 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2489 since it's used in non-static inline functions now.
2490
2491 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2492 Don't assume buffer size fits in 'int'. Remove unused local.
2493
2494 Use C99-style 'extern inline' if available.
2495 * buffer.h (BUFFER_INLINE):
2496 * category.h (CATEGORY_INLINE):
2497 * character.h (CHARACTER_INLINE):
2498 * charset.h (CHARSET_INLINE):
2499 * composite.h (COMPOSITE_INLINE):
2500 * dispextern.h (DISPEXTERN_INLINE):
2501 * lisp.h (LISP_INLINE):
2502 * systime.h (SYSTIME_INLINE):
2503 New macro, replacing 'static inline' in this header.
2504 * buffer.h, category.h, character.h, charset.h, composite.h:
2505 * dispextern.h, lisp.h, systime.h:
2506 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2507 * alloc.c (LISP_INLINE):
2508 * buffer.c (BUFFER_INLINE):
2509 * category.c (CATEGORY_INLINE):
2510 * character.c (CHARACTER_INLINE):
2511 * charset.c (CHARSET_INLINE):
2512 * composite.c (COMPOSITE_INLINE):
2513 * dispnew.c (DISPEXTERN_INLINE):
2514 * sysdep.c (SYSTIME_INLINE):
2515 Define to EXTERN_INLINE, so that the corresponding functions
2516 are compiled into code.
2517 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2518 (INLINE_HEADER_END): New macros.
2519 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2520 since it's used in non-static inline functions now.
2521 (VALMASK) [!USE_LSB_TAG]: Likewise.
2522
2523 2012-08-02 Glenn Morris <rgm@gnu.org>
2524
2525 * s/: Remove empty directory.
2526
2527 * s/ms-w32.h: Move to ../nt/inc.
2528 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2529 Update for new ms-w32.h location.
2530
2531 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2532
2533 Port to Solaris 8.
2534 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2535
2536 2012-08-02 Glenn Morris <rgm@gnu.org>
2537
2538 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2539 hard-coding the path separator.
2540
2541 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2542
2543 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2544 This how ASET and AREF are supposed to work, and makes
2545 it easier to think about future improvements. See
2546 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2547 * charset.h (set_charset_attr): New function.
2548 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2549 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2550 (aref_addr): New function. All uses of &AREF(...) changed.
2551 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2552 (set_hash_index): New functions. All lvalue-style uses of
2553 HASH_KEY etc. changed.
2554 * keyboard.c (set_prop): New function. All lvalue-style uses
2555 of PROP changed.
2556
2557 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2558
2559 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2560 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2561 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2562 * nsfns.m (ns_set_name_as_filename): Likewise.
2563 * nsmenu.m (ns_update_menubar): Likewise.
2564 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2565
2566 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2567
2568 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2569 Adapt to latest changes in field names of the corresponding Lisp
2570 objects.
2571
2572 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2573
2574 2012-08-01 Glenn Morris <rgm@gnu.org>
2575
2576 * s/msdos.h: Remove file.
2577 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2578 * Makefile.in (S_FILE): Remove.
2579 (config_h): Remove S_FILE.
2580
2581 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2582
2583 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2584 Remove; moved to nt/config.nt.
2585
2586 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2587
2588 Use INTERNAL_FIELD for conses and overlays.
2589 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2590 Remove obsolete comment.
2591 (MVAR): New macro.
2592 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2593 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2594
2595 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2596
2597 Use INTERNAL_FIELD for symbols.
2598 * lisp.h (SVAR): New macro. Adjust users.
2599 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2600 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2601
2602 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2603
2604 Use INTERNAL_FIELD for processes.
2605 * process.h (PVAR): New macro. Adjust style.
2606 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2607 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2608
2609 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2610
2611 Use INTERNAL_FIELD for windows.
2612 * window.h (WVAR): New macro.
2613 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2614 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2615 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2616 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2617 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2618 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2619
2620 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2621
2622 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2623
2624 2012-08-01 Glenn Morris <rgm@gnu.org>
2625
2626 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2627 Move to configure.ac.
2628
2629 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2630
2631 * makefile.w32-in (CONFIG_H): Update dependencies.
2632 (CONF_POST_H): New macro.
2633
2634 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2635
2636 2012-07-31 Glenn Morris <rgm@gnu.org>
2637
2638 * Makefile.in (S_FILE): No longer set by configure.
2639
2640 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2641 is available.
2642 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2643
2644 * process.h (NULL_DEVICE):
2645 * emacs.c (SEPCHAR):
2646 * editfns.c (USER_FULL_NAME): Let configure set them.
2647
2648 * s/README, s/template.h: Remove files.
2649
2650 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2651
2652 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2653 Move to configure.ac.
2654
2655 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2656
2657 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2658 resulting renaming of 'struct frame' members.
2659
2660 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2661
2662 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2663 after introduction of FVAR.
2664
2665 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2666
2667 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2668
2669 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2670 instead of compositeToPoint.
2671 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2672
2673 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2674
2675 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2676
2677 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2678 * lisp.h (INTERNAL_FIELD): New macro.
2679 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2680 (BVAR): Change to use INTERNAL_FIELD.
2681 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2682 (KVAR): Change to use INTERNAL_FIELD.
2683 * frame.h (FVAR): New macro.
2684 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2685 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2686 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2687 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2688 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2689
2690 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2691
2692 Miscellaneous fixes for non-default X toolkits.
2693 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2694 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2695 Move under #ifdef USE_LUCID.
2696 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2697 definition and usage to avoid warnings.
2698
2699 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2700
2701 * nsterm.m (openFiles): Fix previous checkin.
2702
2703 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2704
2705 * indent.c (compute_motion): Remove unused local.
2706
2707 2012-07-31 Glenn Morris <rgm@gnu.org>
2708
2709 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2710
2711 * conf_post.h [USG5_4]:
2712 Move remaining contents of s/usg5-4-common.h here.
2713 * s/usg5-4-common.h: Remove file.
2714
2715 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2716 * s/irix6-5.h: Remove file.
2717
2718 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2719 * s/darwin.h: Remove file.
2720
2721 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2722 * s/hpux10-20.h: Remove file, which is now empty.
2723
2724 2012-07-30 Glenn Morris <rgm@gnu.org>
2725
2726 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2727 * Makefile.in (config_h): Add conf_post.h.
2728 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2729
2730 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2731
2732 * nsterm.m (ns_do_open_file): New variable.
2733 (ns_term_init): Set ns_do_open_file to YES after run returns.
2734 (openFile, openTempFile, openFileWithoutUI, openFiles):
2735 Open files only if ns_do_open_file.
2736
2737 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2738
2739 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2740 This no-op macro hasn't been needed for many years.
2741 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2742
2743 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2744 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2745 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2746 gdb_make_enums_visible.
2747 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2748 (DIRECTORY_SEP): Now a constant, not a macro.
2749
2750 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2751
2752 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2753 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2754
2755 * w32term.c <w32_keyboard_codepage>: Renamed from
2756 keyboard_codepage and now external. All users changed.
2757
2758 * w32term.h: Add declaration of w32_keyboard_codepage.
2759
2760 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2761 the codepage to translate keys to Unicode. If this argument is
2762 -1, use the value returned by GetConsoleCP. All callers changed.
2763
2764 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2765
2766 Update .PHONY listings in makefiles.
2767 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2768 bootstrap-clean, distclean, maintainer-clean, versioclean,
2769 extraclean, frc.
2770
2771 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2772 This is a bit clearer. Fix some commentary typos.
2773
2774 2012-07-30 Glenn Morris <rgm@gnu.org>
2775
2776 * s/netbsd.h: Let configure include signal.h if needed.
2777 Remove file, which is now empty.
2778
2779 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2780 Let configure set them.
2781 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2782 No more need to undefine.
2783
2784 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2785
2786 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2787 non-single-byte char when adding meta modifier. (Bug#12090)
2788
2789 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2790
2791 Convert safe_call to use variable number of arguments.
2792 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2793 (safe_call2): Fix comment.
2794 * lisp.h (safe_call): Adjust prototype.
2795 * coding.c (encode_coding_object): Change to use safe_call2.
2796 * xfaces.c (merge_face_heights): Change to use safe_call1.
2797
2798 2012-07-30 Glenn Morris <rgm@gnu.org>
2799
2800 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2801 does that unconditionally. Remove file, which is now empty.
2802
2803 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2804 Remove empty files.
2805
2806 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2807
2808 Export to GDB most of lisp.h's remaining object-like macros.
2809 * lisp.h (min, max): Move earlier, because they're used earlier now.
2810 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2811 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2812 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2813 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2814 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2815 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2816 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2817 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2818 Now constants, for GDB. They need not be macros.
2819 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2820 Now constants, for GDB, as well as macros, for static initializers.
2821 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2822 Move to after the definition of struct Lisp_Char_Table,
2823 since the former now needs that type defined.
2824 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2825 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2826 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2827 New enums, for gdb_make_enums_visible.
2828 (GLYPH_MODE_LINE_FACE): Remove; unused.
2829 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2830 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2831 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2832 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2833 enum maxargs, enum MAX_ALLOCA.
2834 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2835 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2836 no longer needed, now that they are done in lisp.h.
2837
2838 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2839
2840 Cleanup string bytes checking.
2841 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2842 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2843 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2844 (check_sblock, compact_small_strings): Simplify.
2845
2846 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2847
2848 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2849 These macros are confusing and no longer need to be defined, as
2850 the enum values now suffice. All uses replaced with definiens.
2851 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2852
2853 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2854
2855 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2856 ($(BLD)/w32console.$(O)): Update dependencies.
2857
2858 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2859
2860 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2861 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2862 time. Adjust users.
2863 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2864
2865 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2866
2867 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2868 setting sitelisp (Bug#12010).
2869
2870 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2871
2872 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2873
2874 * w32heap.c (cache_system_info):
2875 * w32.c (sys_rename):
2876 * w32proc.c (find_child_console, sys_kill): All users changed.
2877
2878 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2879
2880 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2881
2882 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2883
2884 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2885
2886 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2887
2888 Cleanup statistics calculation in Fgarbage_collect.
2889 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2890 Fix zombies percentage calculation. Simplify elapsed time calculation.
2891
2892 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2895 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2896 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2897 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2898 (replace_range, replace_range_2, del_range_2): Change to eassert.
2899 * marker.c (byte_char_debug_check): Adjust style.
2900
2901 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2902
2903 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2904 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2905 long-ago-commented-out code that talks about "WIN32".
2906 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2907 All uses changed.
2908
2909 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2910
2911 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2912 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2913 Simplify by using alignof.
2914 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2915 * lisp.h: Include <stdalign.h>.
2916 (GCALIGNMENT): New macro and constant.
2917 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2918 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2919 (stdalign): New macro, if not already defined.
2920
2921 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2922
2923 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2924 * w32inevt.c: Include w32inevt.h.
2925 (w32_read_console_input): New inline function, calls either
2926 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2927 w32_console_unicode_input.
2928 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2929 (w32_kbd_patch_key, key_event): Use the codepage returned by
2930 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2931 (key_event): use uChar.UnicodeChar only if
2932 w32_console_unicode_input is non-zero.
2933
2934 * w32console.c: Include w32heap.h.
2935 <w32_console_unicode_input>: New global variable.
2936 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2937 family of Windows, zero otherwise.
2938
2939 * w32inevt.h: Declare w32_console_unicode_input.
2940
2941 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2942 --without-x. (Bug#11742)
2943
2944 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2945
2946 Adjust GDB to reflect pvec_type changes (Bug#12036).
2947 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2948 2012-07-04 changes to pseudovector representation.
2949 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2950
2951 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2952
2953 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2954 bus address.
2955 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2956
2957 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2958
2959 * alloc.c (listn): Fix the order the arguments are consed onto the
2960 list.
2961
2962 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2963 enumeration constants, as PURE and HEAP are too general, and clash
2964 with other headers and sources, such as gmalloc.c and the
2965 MS-Windows system headers. All users changed.
2966
2967 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2968
2969 Revert last save_excursion_save and save_excursion_restore changes.
2970 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2971 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2972
2973 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2974
2975 Fix recently-introduced typos in Windows port.
2976 Reported by Martin Rudalics <rudalics@gmx.at>.
2977 * w32.c (init_environment): Replace comma with semicolon.
2978 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2979
2980 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2981
2982 Improve GDB symbol export (Bug#12036).
2983 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2984 arms of an 'if', not using conditional expressions; otherwise GDB
2985 complains about the types in the unevaluated arm when the argument
2986 is an integer literal.
2987 (xgetint): Simplify expression.
2988 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2989 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2990 Zaretskii in <http://bugs.gnu.org/12036#13>.
2991 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2992 needed now that we have gdb_make_enums_visible.
2993 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2994 (enum enum_USE_LSB_TAG):
2995 New enum types, packaging up enums that need to be exported to GDB.
2996
2997 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2998
2999 Utility function to make a list from specified amount of objects.
3000 * lisp.h (enum constype): New datatype.
3001 (listn): New prototype.
3002 * alloc.c (listn): New function.
3003 (Fmemory_use_count, syms_of_alloc): Use it.
3004 * buffer.c (syms_of_buffer): Likewise.
3005 * callint.c (syms_of_callint): Likewise.
3006 * charset.c (define_charset_internal): Likewise.
3007 * coding.c (syms_of_coding): Likewise.
3008 * keymap.c (syms_of_keymap): Likewise.
3009 * search.c (syms_of_search): Likewise.
3010 * syntax.c (syms_of_syntax): Likewise.
3011 * w32.c (init_environment): Likewise.
3012 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3013 * xdisp.c (syms_of_xdisp): Likewise.
3014 * xfns.c (syms_of_xfns): Likewise.
3015
3016 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3017
3018 Fast save_excursion_save and save_excursion_restore.
3019 * lisp.h (struct Lisp_Excursion): New data type.
3020 (PVEC_EXCURSION): New pseudovector type.
3021 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3022 to deal with it. Adjust comments.
3023 (init_marker, attach_marker): New prototype.
3024 (unchain_marker): Adjust prototype.
3025 * marker.c (attach_marker): Change to global.
3026 (init_marker): New function.
3027 * alloc.c (Fmake_marker, build_marker): Use it.
3028 (build_marker): More easserts.
3029 (mark_object): Handle struct Lisp_Excursion.
3030 * editfns.c (save_excursion_save, save_excursion_restore):
3031 Reimplement to use struct Lisp_Excursion. Add comments.
3032
3033 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3034
3035 Fix export of symbols to GDB (Bug#12036).
3036 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3037 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3038 emacs.c, as this is a more-suitable home. Had this been done earlier
3039 the fix for 12036 would have avoided some of the problems noted in
3040 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3041 would have been more obvious.
3042 * emacs.c: Do not include <verify.h>; no longer needed.
3043 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3044 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3045 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3046 Remove; now done in lisp.h.
3047 * lisp.h (PUBLISH_TO_GDB): New macro.
3048 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3049 (DATA_SEG_BITS): Use it.
3050 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3051 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3052 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3053 not be usable in #if. This simplifies things.
3054
3055 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3056
3057 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3058
3059 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3060
3061 Simplify export of symbols to GDB (Bug#12036).
3062 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3063 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3064 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3065 Adjust to changes in lisp.h and emacs.c, by using
3066 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3067 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3068 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3069 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3070 instead of gdb_valbits.
3071 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3072 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3073 instead of gdb_array_mark_flag.
3074 (xboolvector): Get size from $->size, not $->header.size.
3075 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3076 (xreload, hook-run, hookpost-run): Remove.
3077 * emacs.c: Include <verify.h>.
3078 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3079 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3080 Remove.
3081 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3082 (gdb_USE_LSB_TAG): New enum constants.
3083 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3084 Also define these as enum constants, so they're visible to GDB.
3085 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3086 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3087 as constants, so they're visible to GDB.
3088 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3089 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3090 Now enum constants, not macros, so they're visible to GDB.
3091 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3092 more convenient now. All uses changed.
3093 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3094 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3095
3096 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3097
3098 Explicitly free restriction data that are not needed anymore.
3099 * editfns.c (save_restriction_restore): Free restriction data.
3100
3101 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3102
3103 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3104 add argument, tune behavior, and adjust all callers.
3105
3106 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3107
3108 Use typedef for EMACS_INT, EMACS_UINT.
3109 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3110 than macros. This simplifies debugging in the usual case, since
3111 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3112 and it allows expressions involving EMACS_INT casts.
3113 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3114
3115 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3116
3117 * nsterm.m (ns_read_socket): Return early if there is a modal
3118 window (Bug#12043).
3119
3120 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3121
3122 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3123 that FOCUS-FRAME can be omitted.
3124
3125 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3126
3127 Adjust buffer text indirection counters at the end of Fkill_buffer.
3128 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3129 buffer is definitely dead. This should really fix an issue reported
3130 by Christoph Scholtes again. (Bug#12007).
3131 (init_buffer_once): Initialize indirection counters of
3132 buffer_defaults and buffer_local_symbols (for sanity and safety).
3133
3134 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3135
3136 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3137 and continuation glyphs on tooltip frames, leave them at zero.
3138 Avoids continued lines in tooltips. (Bug#11832)
3139
3140 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3141
3142 Simplify copy_overlay.
3143 * buffer.c (copy_overlay): Simplify. Use build_marker.
3144 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3145
3146 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3147
3148 * print.c (print_object): Don't crash when a frame's name is nil
3149 or invalid. (Bug#12025)
3150
3151 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3152 it signals an error when a tooltip frame is being created.
3153
3154 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3155
3156 Cleanup miscellaneous objects allocation and initialization.
3157 * alloc.c (allocate_misc): Change to static. Add argument to
3158 specify the subtype. Adjust comment and users.
3159 (build_overlay): New function.
3160 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3161 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3162 (allocate_misc): Remove prototype.
3163 (build_overlay): Add prototype.
3164
3165 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3166
3167 Swap buffer text indirection counters in Fbuffer_swap_text.
3168 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3169 This avoids crash reported by Christoph Scholtes at
3170 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3171
3172 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3173
3174 * nsmenu.m (Popdown_data): New struct.
3175 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3176 free Popdown_data.
3177 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3178 (initWithContentRect): Make imgView and contentView non-static
3179 and autorelease them. Also autorelease img and matrix (Bug#12005).
3180 (dealloc): Remove (Bug#12005).
3181
3182 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3183
3184 Adjust consing_since_gc when objects are explicitly freed.
3185 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3186 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3187 (free_cons, free_misc): Subtract object size from consing_since_gc.
3188
3189 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3190
3191 Simplify and cleanup markers positioning code.
3192 * marker.c (attach_marker): More useful eassert.
3193 (live_buffer, set_marker_internal): New function.
3194 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3195 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3196
3197 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3198
3199 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3200 as it's limited by the amount of memory, not by INT_MAX.
3201
3202 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3203
3204 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3205 in special-event-map. See the discussion at
3206 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3207 for the reasons.
3208
3209 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3210 info.dwItemData. Fixes crashes on 64-bit Windows.
3211 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3212
3213 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3214
3215 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3216 (conversationIdentifier): Return value is NSInteger.
3217 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3218
3219 2012-07-21 Chong Yidong <cyd@gnu.org>
3220
3221 * window.c (decode_any_window): Signal an error if the window is
3222 on a dead frame (Bug#11984).
3223
3224 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3225
3226 Add indirection counting to speed up Fkill_buffer.
3227 * buffer.h (struct buffer): New member.
3228 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3229 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3230 base buffer indirection counter.
3231 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3232 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3233 through buffer list if indirection counter is 0.
3234
3235 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3236
3237 Extend the value returned by Fgarbage_collect with heap statistics.
3238 * alloc.c (Qheap): New symbol.
3239 (syms_of_alloc): DEFSYM it.
3240 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3241 (Fmemory_free): Remove.
3242 (syms_of_alloc): Don't defsubr it.
3243 * buffer.c (Fcompact_buffer): Remove.
3244 (syms_of_buffer): Don't defsubr it.
3245
3246 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3247
3248 Make maybe_gc inline.
3249 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3250 * lisp.h (consing_since_gc, gc_relative_threshold)
3251 (memory_full_cons_threshold): Revert declaration.
3252 (maybe_gc): Remove prototype, define as inline.
3253 * alloc.c: Remove old commented-out code.
3254 (consing_since_gc, gc_relative_threshold)
3255 (memory_full_cons_threshold): Revert to global.
3256 (maybe_gc): Remove.
3257
3258 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3259
3260 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3261 * lisp.h (build_unibyte_string): New function.
3262 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3263 * sysdep.c, w32fns.c, xfns.c: Use it.
3264 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3265 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3266 Adjust users accordingly.
3267 * font.h (font_open_by_name): Adjust prototype.
3268
3269 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3270
3271 Cleanup calls to Fgarbage_collect.
3272 * lisp.h (maybe_gc): New prototype.
3273 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3274 Remove declarations.
3275 * alloc.c (maybe_gc): New function.
3276 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3277 Make them static.
3278 * bytecode.c (MAYBE_GC): Use maybe_gc.
3279 * eval.c (eval_sub, Ffuncall): Likewise.
3280 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3281 to avoid dependency from auto-save feature.
3282
3283 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3284
3285 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3286 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3287 'for_each_per_buffer_object_at'.
3288 All uses changed. It's better to use upper-case for macros that
3289 cannot be implemented as functions, to give the reader a clue
3290 that they're special.
3291
3292 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3293
3294 * alloc.c (Fgarbage_collect): Tweak docstring.
3295
3296 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3297
3298 Tweak the value returned from Fgarbage_collect again.
3299 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3300 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3301 Adjust documentation.
3302 (total_vector_bytes): Rename to total_vector_slots, adjust
3303 accounting.
3304 (total_free_vector_bytes): Rename to total_free_vector_slots,
3305 adjust accounting.
3306 (Qstring_bytes, Qvector_slots): New symbols.
3307 (syms_of_alloc): DEFSYM them.
3308
3309 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3310
3311 Buffer compaction primitive which may be used from Lisp.
3312 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3313 (syms_of_buffer): Register Fcompact_buffer.
3314 * alloc.c (Fgarbage_collect): Use compact_buffer.
3315 * buffer.h (compact_buffer): New prototype.
3316 (struct buffer_text): New member.
3317
3318 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3319
3320 New macro to iterate over all buffers, miscellaneous cleanups.
3321 * lisp.h (all_buffers): Remove declaration.
3322 * buffer.h (all_buffers): Add declaration, with comment.
3323 (for_each_buffer): New macro.
3324 * alloc.c (Fgarbage_collect, mark_object): Use it.
3325 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3326 (init_buffer): Likewise.
3327 * data.c (Fset_default): Likewise.
3328 * coding.c (code_conversion_restore): Remove redundant check
3329 for dead buffer.
3330 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3331
3332 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3333
3334 Fix bug that created negative-length intervals.
3335 * intervals.c (merge_interval_right, merge_interval_left):
3336 Do not zero out this interval if it is absorbed by its children,
3337 as this interval's total length doesn't change in that case. See
3338 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3339
3340 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3341
3342 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3343 when invoking (make-bool-vector N t) and N is a positive
3344 multiple of 8 -- the last 8 bits were mistakenly cleared.
3345
3346 Remove some struct layout assumptions in bool vectors.
3347 * alloc.c (bool_header_size): New constant.
3348 (header_size, word_size): Move earlier, as they're now used earlier.
3349 Use 'word_size' in a few more places, where it's appropriate.
3350 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3351 padding before the data member of a bool vector.
3352 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3353 than doing the check by hand with an abort ().
3354
3355 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3356
3357 * eval.c (Fdefvar): Don't check constants since we only set the var if
3358 it's not yet defined anyway (bug#11904).
3359
3360 * lisp.h (last_undo_boundary): Declare new var.
3361 * keyboard.c (command_loop_1): Set it.
3362 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3363 were auto-added by the command loop (bug#11774).
3364
3365 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3366
3367 * w32font.c (Qsymbol): Remove local definition.
3368 (syms_of_w32font): Don't DEFSYM it.
3369
3370 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3371
3372 Fix sweep_vectors to handle large bool vectors correctly.
3373 * alloc.c (sweep_vectors): Account total_vector_bytes for
3374 bool vectors larger than VBLOCK_BYTES_MAX.
3375
3376 2012-07-18 Chong Yidong <cyd@gnu.org>
3377
3378 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3379 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3380
3381 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3382
3383 Return more descriptive data from Fgarbage_collect.
3384 Suggested by Stefan Monnier in
3385 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3386 * alloc.c (bounded_number): New function.
3387 (total_buffers, total_vectors): New variable.
3388 (total_string_size): Rename to total_string_bytes, adjust users.
3389 (total_vector_size): Rename to total_vector_bytes, adjust users.
3390 (sweep_vectors): Account total_vectors and total_vector_bytes.
3391 (Fgarbage_collect): New return value. Adjust documentation.
3392 (gc_sweep): Account total_buffers.
3393 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3394 (VECTOR_SIZE): Remove.
3395 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3396 (Qinterval, Qmisc): New symbols.
3397 (syms_of_data): Initialize them.
3398 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3399 (Qcons, Qbuffer): New declarations.
3400
3401 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3402
3403 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3404 Round up, not down. Improve doc.
3405
3406 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3407
3408 Restore old code in allocate_string_data to avoid Faset breakage.
3409 Reported by Julien Danjou <julien@danjou.info> in
3410 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3411 * alloc.c (allocate_string_data): Restore old code with minor
3412 adjustments, fix comment to explain this subtle issue.
3413
3414 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3415
3416 Remove FILE_SYSTEM_CASE.
3417 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3418
3419 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3420 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3421 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3422 call-process-region passes it through expand-file-name.
3423
3424 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3425
3426 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3427
3428 Fix crash when creating indirect buffer (Bug#11917)
3429 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3430 Don't handle unbound variables specially if non-zero.
3431 (Fbuffer_local_variables): Pass zero.
3432 (clone_per_buffer_values): Pass non-zero.
3433
3434 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3435
3436 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3437 to make the loop interruptible.
3438
3439 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3440
3441 * gnutls.c (emacs_gnutls_handshake): Only retry if
3442 GNUTLS_E_INTERRUPTED.
3443
3444 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3445
3446 Cleanup and convert miscellaneous checks to eassert.
3447 * alloc.c (mark_interval): Fix comment, partially rephrase
3448 old comment from intervals.h (see below).
3449 * intervals.c (find_interval, adjust_intervals_for_insertion)
3450 (delete_interval, adjust_intervals_for_deletion)
3451 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3452 Convert to eassert.
3453 (adjust_intervals_for_insertion, make_new_interval):
3454 Remove obsolete and unused code.
3455 * intervals.h (struct interval): Remove obsolete comment.
3456 * textprotp.c (erase_properties): Remove unused code.
3457 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3458 (Fremove_list_of_text_properties): Convert to eassert.
3459
3460 2012-07-17 Chong Yidong <cyd@gnu.org>
3461
3462 * editfns.c (Finsert_char): Doc fix.
3463
3464 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3465
3466 Fix previous change to make Fmemory_free always accurate.
3467 * alloc.c (make_interval): Update total_free_intervals.
3468 (make_float): Likewise for total_free_floats.
3469 (free_cons, Fcons): Likewise for total_free_conses.
3470 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3471 Likewise for total_free_vector_bytes.
3472 (Fmake_symbol): Likewise for total_free_symbols.
3473 (bytes_free): Remove.
3474
3475 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3476
3477 Simple free memory accounting feature.
3478 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3479 (sweep_vectors): Accumulate size of free vectors.
3480 (Fgarbage_collect): Setup bytes_free.
3481 (Fmemory_free): New function.
3482 (syms_of_alloc): Register it.
3483
3484 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3485
3486 Cleanup overlays checking.
3487 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3488 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3489 eassert and OVERLAYP.
3490 (sort_overlays): Change to use OVERLAYP.
3491
3492 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3493
3494 * editfns.c (Finsert_char): Make it interactive, and make the
3495 second arg optional. Copy interactive spec and docstring from
3496 ucs-insert.
3497
3498 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3499
3500 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3501 Unlike the other wrapped functions, fabs has an unspecified
3502 effect on errno.
3503
3504 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3505
3506 * nsterm.m (keyDown): Interpret flags without left/right bits
3507 as the left key (Bug#11670).
3508
3509 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3510
3511 Remove empty and useless init functions.
3512 * lisp.h (init_character_once, init_fns, init_image)
3513 (init_filelock, init_sound): Remove prototype.
3514 * character.c (init_character_once): Remove.
3515 * filelock.c (init_filelock): Likewise.
3516 * fns.c (init_fns): Likewise.
3517 * image.c (init_image): Likewise.
3518 * sound.c (init_sound): Likewise.
3519 * emacs.c (main): Adjust accordingly.
3520
3521 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3522
3523 * gtkutil.h: Tiny cleanups.
3524 (use_old_gtk_file_dialog): Remove useless declaration.
3525 (xg_uses_old_file_dialog): Add suggested const attribute.
3526
3527 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3528
3529 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3530 (bidi_paragraph_init): Use it to limit search forward for a strong
3531 directional character in abnormally large paragraphs full of
3532 neutral or weak characters. (Bug#11943)
3533
3534 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3535
3536 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3537 the toolbar (Bug#9451).
3538 (xg_make_tool_item): Give the widget event box a transparent
3539 background.
3540
3541 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3542
3543 Cleanup basic allocation variables and functions.
3544 * alloc.c (ignore_warnings, init_intervals, init_float)
3545 (init_cons, init_symbol, init_marker): Remove.
3546 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3547 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3548 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3549 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3550 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3551 (staticidx, init_alloc_once, init_strings, free_ablock):
3552 Remove redundant initialization.
3553 * fns.c (init_weak_hash_tables): Remove.
3554 * lisp.h (init_weak_hash_tables): Remove prototype.
3555
3556 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3557
3558 Use zero_vector where appropriate.
3559 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3560 accordingly.
3561 * lisp.h (zero_vector): New declaration.
3562 * font.c (null_vector): Remove.
3563 (syms_of_font): Remove initialization and staticpro.
3564 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3565 * keymap.c (Faccessible_keymaps): Likewise.
3566
3567 2012-07-15 Leo Liu <sdl.web@gmail.com>
3568
3569 * fringe.c: Fix typo in comments.
3570
3571 2012-07-14 Leo Liu <sdl.web@gmail.com>
3572
3573 * fringe.c: Add a new bitmap exclamation-mark.
3574
3575 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3576
3577 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3578
3579 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3580 (HAVE_MENUS): Don't define, defined by editing config.in with
3581 msdos/sed2v2.inp.
3582 (GMALLOC_INHIBIT_VALLOC): Don't define.
3583 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3584
3585 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3586
3587 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3588
3589 2012-07-14 Glenn Morris <rgm@gnu.org>
3590
3591 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3592 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3593 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3594
3595 2012-07-13 Glenn Morris <rgm@gnu.org>
3596
3597 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3598
3599 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3600 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3601
3602 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3603
3604 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3605 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3606 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3607 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3608 where appropriate.
3609 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3610 as boolean expression.
3611 (x_set_window_size): Remove unused variable toolbar.
3612 (ns_get_color_default, ns_mod_to_lisp): Remove.
3613 (ns_mouse_position): Remove unused variables xchar and ychar.
3614 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3615 (ns_set_vertical_scroll_bar): Remove unused variable count.
3616 (ns_delete_terminal): Remove unused variable i.
3617 (ns_term_init): Remove unused variables r, g and b.
3618 (mouseDown): Remove unused variable window.
3619 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3620 (initFrameFromEmacs): Remove unused variable vbextra.
3621 (mouseEntered): Remove unused variables p and dpyinfo.
3622 (mouseExited): Remove unused variables p and r.
3623 (ns_define_frame_cursor, ns_clear_frame_area)
3624 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3625 (menuDown): Assign [sender tag] to variable and cast the variable.
3626
3627 * nsterm.h (menuDown): Add id as type to argument sender.
3628 (ns_display_info_for_name): Add Lisp_Object argument.
3629 (ns_term_init): Add Lisp_Object argument.
3630 (ns_map_event_to_object): Add void argument.
3631 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3632 prototype with arguments and only declare if __OBJC__.
3633 (nxatoms_of_nsselect): Add void argument.
3634 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3635 (ns_alloc_autorelease_pool): Add void argument.
3636 (ns_release_autorelease_pool): Add void* argument.
3637 (ns_get_defaults_value): Add const char* argument.
3638
3639 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3640 (initFromContents): Use SSDATA where appropriate.
3641 (ns_update_menubar): Add braces to ambigous if-else.
3642 (initWithTitle): Put () around assignment in if statement.
3643 (ns_menu_show): Remove unused variables window and keymap.
3644 (update_frame_tool_bar): Remove unused variable selected_p.
3645 (initWithContentRect): Remove unused variable this_cmd_name.
3646
3647 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3648 appropriate.
3649 (setXBMColor): Remove unused variable len.
3650 (setPixmapData): Put () around assignment in loop statement.
3651
3652 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3653 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3654 where appropriate.
3655 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3656 around assignment in loop statement.
3657 (nsfont_open): Remove unused variable i.
3658 (nsfont_open): Remove unused variable len.
3659 (nsfont_draw): Remove unused variable cs.
3660
3661 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3662 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3663 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3664 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3665 (Fns_font_name, Fns_perform_service)
3666 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3667 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3668 (ns_set_name): Remove unused variable view.
3669 (x_set_menu_bar_lines): Remove unused variable olines.
3670 (x_set_tool_bar_lines): Remove unused variable root_window.
3671 (Fns_list_colors): Put () around assignment in while statement.
3672 (Fns_perform_service): Remove unused variable len.
3673 (Fns_display_usable_bounds): Remove unused variable top.
3674 (syms_of_nsfns): Remove unused variable i.
3675
3676 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3677 memcpy (Bug#11907).
3678
3679 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3680
3681 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3682 and free it with DestroyExceptionInfo (Bug#11558).
3683
3684 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3685
3686 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3687 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3688 Set here, not in nt/config.nt.
3689
3690 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3691
3692 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3693 cursor overflow into the last glyph on display line when the right
3694 fringe is off. (Bug#11832)
3695
3696 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3697
3698 * xdisp.c (produce_special_glyphs): Now static.
3699 * dispextern.h (produce_special_glyphs): Remove decl.
3700
3701 2012-07-13 Glenn Morris <rgm@gnu.org>
3702
3703 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3704 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3705
3706 * s/usg5-4-common.h (USG, USG5):
3707 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3708 * s/sol2-6.h (SOLARIS2):
3709 * s/irix6-5.h (IRIX6_5):
3710 * s/hpux10-20.h (USG, USG5, HPUX):
3711 * s/gnu-linux.h (USG, GNU_LINUX):
3712 * s/freebsd.h (BSD_SYSTEM):
3713 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3714 * s/cygwin.h (CYGWIN):
3715 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3716 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3717
3718 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3719
3720 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3721
3722 2012-07-13 Glenn Morris <rgm@gnu.org>
3723
3724 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3725
3726 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3727
3728 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3729 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3730
3731 2012-07-12 Glenn Morris <rgm@gnu.org>
3732
3733 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3734
3735 * process.c (init_process_emacs): Rename from init_process.
3736 The old name is also the name of a Mach system call.
3737 * lisp.h, emacs.c: Update for this name change.
3738 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3739 longer needed.
3740
3741 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3742
3743 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3744 memmove call that removes glyphs covered by the left truncation
3745 glyph. Improve commentary.
3746 (display_line): Fix display of continuation glyphs on GUI frames
3747 when the right fringe is turned off and variable-size fonts are
3748 used in the window. Move the code that appends a stretch glyph to
3749 produce_special_glyphs, so that it could be used for truncation
3750 and continuation glyphs alike.
3751 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3752 glyph of a suitably computed width, to align the special glyphs at
3753 the window margin. Code moved from display_line. (Bug#11832)
3754
3755 2012-07-12 Glenn Morris <rgm@gnu.org>
3756
3757 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3758
3759 * s/gnu-linux.h, s/hpux10-20.h:
3760 Do not unconditionally define HAVE_XRMSETDATABASE.
3761
3762 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3763
3764 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3765
3766 Fix typos that broke OS X build.
3767 Reported by Randal L. Schwartz in
3768 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3769 * nsterm.m (ns_timeout): Add missing local decl.
3770 (ns_get_color): snprintf -> sprintf, to fix typo.
3771
3772 2012-07-12 Glenn Morris <rgm@gnu.org>
3773
3774 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3775 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3776 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3777 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3778
3779 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3780 Move PTY_OPEN to configure.
3781
3782 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3783 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3784 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3785
3786 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3787
3788 Use empty_unibyte_string where applicable.
3789 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3790 * lread.c (read1): Likewise.
3791 * xsettings.c (syms_of_xsettings): Likewise.
3792
3793 2012-07-12 Glenn Morris <rgm@gnu.org>
3794
3795 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3796 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3797 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3798 * s/hpux10-20.h (RUN_TIME_REMAP):
3799 * s/bsd-common.h (TABDLY): Move to configure.
3800
3801 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3802
3803 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3804
3805 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3806 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3807
3808 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3809
3810 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3811 * s/template.h: Move NARROWPROTO to configure.
3812
3813 2012-07-11 Glenn Morris <rgm@gnu.org>
3814
3815 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3816 unused since 2011-01-17 change to systty.h.
3817
3818 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3819 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3820 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3821
3822 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3823
3824 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3825
3826 2012-07-11 Glenn Morris <rgm@gnu.org>
3827
3828 * s/darwin.h, s/gnu-linux.h, s/template.h:
3829 Move INTERRUPT_INPUT to configure.
3830
3831 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3832
3833 Minor adjustments to interning code.
3834 * lisp.h (intern, intern_c_string): Redefine as static inline
3835 wrappers for intern_1 and intern_c_string_1, respectively.
3836 (intern_1, intern_c_string_1): Rename prototypes.
3837 * lread.c (intern_1, intern_c_string_1, oblookup):
3838 Simplify Vobarray checking.
3839 * font.c (font_intern_prop): Likewise. Adjust comment.
3840 * w32font.c (intern_font_name): Likewise.
3841
3842 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3843
3844 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3845
3846 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3847 of Fcar/Fcdr if possible.
3848 * font.c (check_otf_features): Likewise.
3849 * fontset.c (Fnew_fontset): Likewise.
3850 * gnutls.c (Fgnutls_boot): Likewise.
3851 * minibuf.c (read_minibuf): Likewise.
3852 * msdos.c (IT_set_frame_parameters): Likewise.
3853 * xmenu.c (Fx_popup_dialog): Likewise.
3854 * w32menu.c (Fx_popup_dialog): Likewise.
3855
3856 2012-07-11 Glenn Morris <rgm@gnu.org>
3857
3858 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3859 since nothing has defined it on these platforms.
3860
3861 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3862 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3863
3864 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3865 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3866 Move CLASH_DETECTION to configure.
3867
3868 * s/gnu.h: Remove file, which is now empty.
3869
3870 * s/gnu.h, s/gnu-linux.h:
3871 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3872
3873 2012-07-11 John Wiegley <johnw@newartisans.com>
3874
3875 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3876 function attribute, so we only use it if it exists in the
3877 compiler.
3878
3879 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3880
3881 Avoid call to strlen in fast_c_string_match_ignore_case.
3882 * search.c (fast_c_string_match_ignore_case): Change to use
3883 length argument. Adjust users accordingly.
3884 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3885
3886 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3887
3888 Assume mkdir, rmdir.
3889 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3890 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3891
3892 Assume rename.
3893 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3894
3895 Assume perror.
3896 * s/hpux10-20.h (HAVE_PERROR): Remove.
3897 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3898 Remove dummy definition, as this problem was obsolete long ago.
3899
3900 Assume strerror.
3901 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3902
3903 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3904
3905 Avoid calls to strlen in font processing functions.
3906 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3907 (font_open_by_name): Change to use length argument.
3908 Adjust users accordingly.
3909 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3910 Adjust prototypes.
3911 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3912 Change to return ptrdiff_t.
3913 (xfont_list_pattern, xfont_match): Use length returned by
3914 xfont_decode_coding_xlfd.
3915 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3916
3917 2012-07-11 Glenn Morris <rgm@gnu.org>
3918
3919 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3920 Move DONT_REOPEN_PTY to configure.
3921
3922 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3923 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3924
3925 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3926
3927 Remove "#define unix" that is no longer needed (Bug#11905).
3928 * s/aix4-2.h (unix): Remove; no longer needed.
3929
3930 EMACS_TIME simplification (Bug#11875).
3931 This replaces macros (which typically do not work in GDB)
3932 with functions, typedefs and enums, making the code easier to debug.
3933 The functional style also makes code easier to read and maintain.
3934 * systime.h: Include <sys/time.h> on all hosts, not just if
3935 WINDOWSNT, since 'struct timeval' is needed in general.
3936 (EMACS_TIME): Now a typedef, not a macro.
3937 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3938 not macros.
3939 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3940 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3941 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3942 (EMACS_TIME_LE): Now functions, not macros.
3943 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3944 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3945 which are not functions. All uses rewritten to use:
3946 (make_emacs_time): New function.
3947 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3948 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3949 not functions. All uses rewritten to use the following, respectively:
3950 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3951 (add_emacs_time, sub_emacs_time): New functions.
3952 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3953 * fileio.c (Fcopy_file):
3954 * xterm.c (XTflash): Get the current time closer to when it's used.
3955 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3956
3957 * bytecode.c (targets): Suppress -Woverride-init warnings.
3958
3959 Simplify by avoiding confusing use of strncpy etc.
3960 * doc.c (Fsnarf_documentation):
3961 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3962 * frame.c (Fmake_terminal_frame):
3963 * gtkutil.c (get_utf8_string):
3964 * lread.c (openp):
3965 * nsmenu.m (ns_update_menubar):
3966 * regex.c (regerror):
3967 Prefer memcpy to strncpy and strncat when either will do.
3968 * fileio.c (Fsubstitute_in_file_name):
3969 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3970 (menu_separator_name_p):
3971 * nsmenu.m (ns_update_menubar):
3972 Prefer memcmp to strncmp when either will do.
3973 * nsterm.m: Include <ftoastr.h>.
3974 (ns_get_color):
3975 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3976 Prefer snprintf to strncpy.
3977 * nsterm.m (ns_term_init):
3978 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3979 * nsterm.m (ns_term_init):
3980 Avoid the need for strncpy, by using build_string or
3981 make_unibyte_string directly. Use dtoastr, not snprintf.
3982 * process.c (Fmake_network_process): Diagnose service names that
3983 are too long, rather than silently truncating them or creating
3984 non-null-terminated names.
3985 (Fnetwork_interface_info): Likewise, for interface names.
3986 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3987 Prefer sprintf to strncat.
3988 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3989 Prefer vsnprintf to vsprintf + strncpy.
3990
3991 2012-07-10 Glenn Morris <rgm@gnu.org>
3992
3993 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3994 Clarify fallback case.
3995
3996 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3997
3998 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3999 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4000 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4001 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4002 where argument type is known to be a Lisp_Cons.
4003
4004 2012-07-10 Tom Tromey <tromey@redhat.com>
4005
4006 * bytecode.c (BYTE_CODE_THREADED): New macro.
4007 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4008 (enum byte_code_op): New type.
4009 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4010 (exec_byte_code): Use them. Use token threading when applicable.
4011
4012 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4013
4014 Optimize pure C strings initialization.
4015 * lisp.h (make_pure_string): Fix prototype.
4016 (build_pure_c_string): New function, defined as static inline. This
4017 provides a better opportunity to optimize away calls to strlen when
4018 the function is called with compile-time constant argument.
4019 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4020 argument, adjust users accordingly. Use build_pure_c_string where
4021 appropriate.
4022 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4023 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4024 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4025
4026 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4027
4028 Avoid calls to strlen in miscellaneous functions.
4029 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4030 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4031 * lread.c (openp): Likewise.
4032
4033 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4034
4035 Avoid calls to strlen in path processing functions.
4036 * fileio.c (file_name_as_directory): Add comment. Change to add
4037 srclen argument and return the length of result. Adjust users
4038 accordingly.
4039 (directory_file_name): Fix comment. Change to add srclen argument,
4040 swap 1st and 2nd arguments to obey the common convention.
4041 Adjust users accordingly.
4042 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4043
4044 2012-07-10 Glenn Morris <rgm@gnu.org>
4045
4046 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4047 Move PENDING_OUTPUT_COUNT definition to configure.
4048
4049 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4050 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4051 * s/gnu.h (DATA_START): Move definitions to configure.
4052
4053 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4054 We include usg5-4-common.h, which defines them both.
4055
4056 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4057 O_RDONLY already includes it).
4058
4059 Stop ns builds setting the EMACSLOADPATH environment variable.
4060 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4061 Now it does not set EMACSLOADPATH, just returns the load-path string.
4062 * nsterm.h: Update accordingly.
4063 * lread.c [HAVE_NS]: Include nsterm.h.
4064 (init_lread) [HAVE_NS]: Use ns_load_path.
4065 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4066
4067 2012-07-09 Glenn Morris <rgm@gnu.org>
4068
4069 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4070 since the included bsd-common.h does so.
4071
4072 Stop ns builds setting the EMACSPATH environment variable.
4073 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4074 (ns_init_paths): Do not set EMACSPATH.
4075 * nsterm.h (ns_exec_path): Add it.
4076 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4077 Use ns_exec_path.
4078
4079 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4080
4081 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4082
4083 * process.c (wait_reading_process_output): 'waitchannels' was unset
4084 when read_kbd || !NILP (wait_for_cell); fix this.
4085
4086 Add GCC-style 'const' attribute to functions that can use it.
4087 * character.h (char_resolve_modifier_mask):
4088 * keyboard.h (make_ctrl_char):
4089 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4090 (init_character_once, next_almost_prime, init_fns, init_image)
4091 (flush_pending_output, init_sound):
4092 * mem-limits.h (start_of_data):
4093 * menu.h (finish_menu_items):
4094 Add ATTRIBUTE_CONST.
4095 * emacs.c (DEFINE_DUMMY_FUNCTION):
4096 Declare the dummy function with ATTRIBUTE_CONST.
4097 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4098 Add decls with ATTRIBUTE_CONST.
4099
4100 Minor improvements to make_formatted_string.
4101 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4102 where int is good enough, as vsprintf returns an int.
4103 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4104
4105 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4106
4107 Use make_formatted_string to avoid double length calculation.
4108 * lisp.h (make_formatted_string): New prototype.
4109 * alloc.c (make_formatted_string): New function.
4110 * buffer.c (Fgenerate_new_buffer_name): Use it.
4111 * dbus.c (syms_of_dbusbind): Likewise.
4112 * editfns.c (Fcurrent_time_zone): Likewise.
4113 * filelock.c (get_boot_time): Likewise.
4114 * frame.c (make_terminal_frame, set_term_frame_name)
4115 (x_report_frame_params): Likewise.
4116 * image.c (gs_load): Likewise.
4117 * minibuf.c (get_minibuffer): Likewise.
4118 * msdos.c (dos_set_window_size): Likewise.
4119 * process.c (make_process): Likewise.
4120 * xdisp.c (ensure_echo_area_buffers): Likewise.
4121 * xsettings.c (apply_xft_settings): Likewise.
4122
4123 2012-07-09 Glenn Morris <rgm@gnu.org>
4124
4125 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4126 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4127 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4128 * nsterm.h (ns_etc_directory): Add it.
4129 * callproc.c [HAVE_NS]: Include nsterm.h.
4130 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4131
4132 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4133
4134 Move marker debugging code under MARKER_DEBUG.
4135 * marker.c (MARKER_DEBUG): Move marker debugging code under
4136 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4137 for bootstrap with --enable-checking (~3x slowdown reported
4138 by Juanma Barranquero <lekktu@gmail.com>).
4139 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4140
4141 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4142
4143 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4144 See <http://bugs.gnu.org/11825#29>.
4145
4146 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4147
4148 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4149 has no font, use the frame's font. (Bug#11813)
4150 (display_line): Add commentary about displaying truncation glyphs
4151 on GUI frames.
4152 (produce_special_glyphs): Move here from term.c.
4153
4154 * term.c (produce_special_glyphs): Move to xdisp.c.
4155
4156 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4157 section.
4158
4159 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4160
4161 * xdisp.c (display_line): Avoid warning about implicit declaration
4162 of FRAME_FONT.
4163
4164 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4165
4166 * lisp.h: Remove empty conditional.
4167
4168 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4169
4170 * lread.c (load_path_check): Now static.
4171
4172 Fix some minor --with-ns problems found by static checking.
4173 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4174 (x_set_font) [!HAVE_X_WINDOWS]:
4175 * image.c (xpm_load_image) [HAVE_NS]:
4176 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4177 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4178 Remove unused local.
4179 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4180 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4181 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4182 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4183 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4184 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4185 Fix pointer signedness problem.
4186 * xfaces.c (FRAME_X_FONT_TABLE):
4187 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4188
4189 2012-07-07 Glenn Morris <rgm@gnu.org>
4190
4191 * lread.c (load_path_check): New function, split from init_lread.
4192 (init_lread): Reorganize. Motivation:
4193 If EMACSLOADPATH is set, check/warn about that rather than the
4194 defaults, which we are not going to use. Hence we can remove
4195 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4196 Don't warn if site-lisp directories are missing.
4197 If not installed, start from a blank load-path, since
4198 PATH_LOADSEARCH refers to the eventual installation directories.
4199
4200 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4201
4202 Support truncation and continuation glyphs on GUI frames, when
4203 fringes are disabled. (Bug#11832)
4204 * xdisp.c (init_iterator): Get dimensions of truncation and
4205 continuation glyphs even if on GUI frames.
4206 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4207 or both, are absent.
4208 (start_display, move_it_in_display_line_to): Handle the case of a
4209 GUI frame without a fringe to display continuation or truncation
4210 glyphs.
4211 (insert_left_trunc_glyphs): Support GUI frames: make sure
4212 truncation glyphs overwrite enough glyphs from the current line to
4213 have sufficient space in pixels.
4214 (display_line): Support truncation and continuation glyphs on GUI
4215 frames. If some spare pixels are left on the line after inserting
4216 the truncation glyphs, fill that space with a stretch glyph of a
4217 suitably computed width.
4218
4219 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4220 produce_glyphs, to support GUI sessions.
4221
4222 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4223
4224 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4225
4226 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4227
4228 Do not require float-time's arg to fit in time_t (Bug#11825).
4229 This works better on hosts where time_t is unsigned, and where
4230 float-time is applied to the (negative) difference between two times.
4231 * editfns.c (decode_time_components): Last arg is now double *,
4232 not int *, and means to store all the result as a double, without
4233 worrying about whether the seconds part fits in time_t.
4234 All callers changed.
4235 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4236 All callers changed.
4237 (Ffloat_time): Do not fail merely because the specified time falls
4238 outside of time_t range.
4239
4240 2012-07-07 Glenn Morris <rgm@gnu.org>
4241
4242 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4243 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4244 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4245
4246 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4247
4248 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4249 Update dependencies.
4250
4251 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4252
4253 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4254
4255 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4256 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4257 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4258 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4259 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4260 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4261
4262 * xfont.c (compare_font_names): Redo to omit the need for casts.
4263
4264 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4265
4266 * xfns.c (Fx_change_window_property): Doc fix.
4267 * w32fns.c (Fx_change_window_property): Doc fix.
4268
4269 * w32fns.c (Fx_window_property): Accept the same arguments as the
4270 X Windows version. Doc fix.
4271 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4272
4273 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4274 Eli Zaretskii <eliz@gnu.org>
4275
4276 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4277 Windows-specific code from nt/config.nt moved here.
4278 Obsolete settings removed.
4279
4280 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4281
4282 * process.c: Avoid unnecessary calls to gettime.
4283 (wait_reading_process_output): Don't get the time of day
4284 when gobbling data immediately and not waiting, as there's no need
4285 for it in that case. This removes a FIXME.
4286
4287 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4288
4289 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4290 is defined (Bug#11768).
4291
4292 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4293
4294 Fix marker debugging code.
4295 * marker.c (byte_char_debug_check): Do not perform the check
4296 if buffer is not multibyte.
4297 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4298 Call byte_char_debug_check with correct arguments.
4299
4300 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4301
4302 Compile marker debugging code only if ENABLE_CHECKING is defined.
4303 * marker.c (byte_char_debug_check, count_markers):
4304 Use only if ENABLE_CHECKING is defined.
4305 (byte_debug_flag): Remove.
4306 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4307 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4308
4309 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4310
4311 Avoid code repetition in marker-related functions.
4312 * marker.c (attach_marker): New function.
4313 (Fset_marker, set_marker_restricted, set_marker_both)
4314 (set_marker_restricted_both): Use it.
4315 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4316 Consistently rename charno to charpos.
4317 (marker_position): Add eassert.
4318 (marker_byte_position): Convert to eassert.
4319
4320 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4321
4322 Simplify list operations in unchain_overlay and unchain_marker.
4323 * buffer.c (unchain_overlay): Simplify. Add comment.
4324 * marker.c (unchain_marker): Simplify. Fix comments.
4325
4326 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4327
4328 Introduce fast path for the widely used marker operation.
4329 * alloc.c (build_marker): New function.
4330 * lisp.h (build_marker): New prototype.
4331 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4332 * composite.c (autocmp_chars): Likewise.
4333 * editfns.c (buildmark): Remove.
4334 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4335 (save_restriction_save): Use build_marker.
4336 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4337 * window.c (save_window_save): Likewise.
4338
4339 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4340
4341 Do not use Fdelete_overlay in delete_all_overlays
4342 to avoid redundant calls to unchain_overlay.
4343 * buffer.c (drop_overlay): New function.
4344 (delete_all_overlays, Fdelete_overlay): Use it.
4345 * minibuf.c (get_minibuffer): Fix comment.
4346
4347 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4348
4349 Port to OpenBSD 5.1 amd64.
4350 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4351 This is needed for OpenBSD, and should be harmless on all BSD systems.
4352 Also, include <sys/sysctl.h>, as it should be available on all
4353 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4354 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4355 use p_pid member, not kp_proc.pid.
4356
4357 2012-07-06 Glenn Morris <rgm@gnu.org>
4358
4359 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4360
4361 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4362
4363 More xmalloc and related cleanup.
4364 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4365 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4366 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4367 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4368 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4369 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4370 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4371 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4372 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4373 * xterm.c:
4374 Omit needless casts involving void * pointers and allocation.
4375 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4376 as the former is more robust if P's type is changed.
4377 Prefer xzalloc to xmalloc + memset 0.
4378 Simplify malloc-or-realloc to realloc.
4379 Don't worry about xmalloc returning a null pointer.
4380 Prefer xstrdup to xmalloc + strcpy.
4381 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4382 growing it.
4383 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4384 alloca of a constant.
4385
4386 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4387
4388 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4389 hscroll is larger than the line width. Fixes long and futile
4390 looping inside extend_face_to_end_of_line (on a TTY) producing
4391 glyphs that are not needed and thrown away.
4392
4393 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4394
4395 * marker.c (set_marker_restricted_both): Simplify by using
4396 clip_to_bounds.
4397
4398 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4399
4400 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4401
4402 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4403
4404 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4405 not defined (Bug#11768).
4406 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4407 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4408 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4409 followed by gtk_box_set_homogeneous (Bug#11768).
4410 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4411 (update_theme_scrollbar_width, xg_create_scroll_bar):
4412 Use gtk_scrollbar_new (Bug#11768).
4413 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4414 (is_box_type): New function (Bug#11768).
4415 (xg_tool_item_stale_p): Call is_box_type.
4416 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4417 with default display (Bug#11768).
4418
4419 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4420
4421 * xdisp.c (window_hscroll_limited): New function.
4422 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4423 coordinates when window's hscroll is set to insanely large
4424 values. (Bug#11857)
4425
4426 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4427
4428 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4429 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4430
4431 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Cleanup xmalloc.
4434 * lisp.h (xzalloc): New prototype. Omit needless casts.
4435 * alloc.c (xzalloc): New function. Omit needless casts.
4436 * charset.c: Omit needless casts. Convert all calls to
4437 xmalloc with following memset to xzalloc.
4438 * dispnew.c: Likewise.
4439 * fringe.c: Likewise.
4440 * image.c: Likewise.
4441 * sound.c: Likewise.
4442 * term.c: Likewise.
4443 * w32fns.c: Likewise.
4444 * w32font.c: Likewise.
4445 * w32term.c: Likewise.
4446 * xfaces.c: Likewise.
4447 * xfns.c: Likewise.
4448 * xterm.c: Likewise.
4449 * atimer.c: Omit needless casts.
4450 * buffer.c: Likewise.
4451 * callproc.c: Likewise.
4452 * ccl.c: Likewise.
4453 * coding.c: Likewise.
4454 * composite.c: Likewise.
4455 * doc.c: Likewise.
4456 * doprnt.c: Likewise.
4457 * editfns.c: Likewise.
4458 * emacs.c: Likewise.
4459 * eval.c: Likewise.
4460 * filelock.c: Likewise.
4461 * fns.c: Likewise.
4462 * gtkutil.c: Likewise.
4463 * keyboard.c: Likewise.
4464 * lisp.h: Likewise.
4465 * lread.c: Likewise.
4466 * minibuf.c: Likewise.
4467 * msdos.c: Likewise.
4468 * print.c: Likewise.
4469 * process.c: Likewise.
4470 * region-cache.c: Likewise.
4471 * search.c: Likewise.
4472 * sysdep.c: Likewise.
4473 * termcap.c: Likewise.
4474 * terminal.c: Likewise.
4475 * tparam.c: Likewise.
4476 * w16select.c: Likewise.
4477 * w32.c: Likewise.
4478 * w32reg.c: Likewise.
4479 * w32select.c: Likewise.
4480 * w32uniscribe.c: Likewise.
4481 * widget.c: Likewise.
4482 * xdisp.c: Likewise.
4483 * xmenu.c: Likewise.
4484 * xrdb.c: Likewise.
4485 * xselect.c: Likewise.
4486
4487 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4488
4489 * fileio.c (time_error_value): Check the right error number.
4490 Problem reported by Troels Nielsen in
4491 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4492
4493 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4494
4495 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4496 This should be fixed in a better way; see Eli Zaretskii in
4497 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4498 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4499
4500 * fileio.c (time_error_value): Rename from special_mtime.
4501 The old name's problems were noted by Eli Zaretskii in
4502 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4503
4504 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4505 This variable's comment says Emacs needs at least one GDB-visible
4506 symbol of type enum pvec_type, to work around GDB problems.
4507 The symbol's value doesn't matter.
4508
4509 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4510 that causes compilation to fail on pre-C99 compilers.
4511
4512 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4513
4514 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4515 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4516
4517 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4518
4519 * buffer.c (init_buffer_once): Fix initialization of
4520 headers for buffer_defaults and buffer_local_symbols.
4521 Reported by Juanma Barranquero <lekktu@gmail.com>.
4522
4523 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4524
4525 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4526 * lisp.h (enum pvec_type): Use fewer bits.
4527 (PSEUDOVECTOR_SIZE_BITS): New constant.
4528 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4529 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4530 change in pvec_type.
4531 (PSEUDOVECTOR_TYPEP): New macro.
4532 (TYPED_PSEUDOVECTORP): Use it.
4533 * fns.c (internal_equal): Adapt code to extract pvectype.
4534 * emacs.c (gdb_pvec_type): Update type.
4535 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4536 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4537 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4538 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4539 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4540 abusing vector->header.next.nbytes.
4541 (live_vector_p): Use PVEC_TYPE.
4542 (mark_object): Adapt code to extract pvectype. Use switch.
4543
4544 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4545
4546 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4547 Tighten new eassert a bit.
4548
4549 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4550
4551 Fix compilation with --enable-gcc-warnings and -O1
4552 optimization level.
4553 * doprnt.c (doprnt): Change type of tem to int, initialize
4554 to avoid compiler warning. Add eassert.
4555 * search.c (simple_search): Initialize match_byte to avoid
4556 compiler warning. Add eassert.
4557
4558 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4559
4560 Avoid weird behavior with large horizontal scrolls.
4561 Without this change, for example, large hscroll values would
4562 mess up Emacs's display on Fedora 15 x86, presumably due to
4563 overflows in int calculations in the display code.
4564 Also, if buffers had long lines, Emacs would freeze.
4565 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4566 (set_window_hscroll): New function, containing the old guts of
4567 Fset_window_hscroll. Return the clipped value.
4568 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4569 This avoids the need to check against PTRDIFF_MAX.
4570
4571 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4572
4573 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4576
4577 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4578
4579 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4580 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4581 since GCC 4.4.6 issues a bogus warning for them.
4582
4583 Fix bugs in file timestamp newness comparisons.
4584 * fileio.c (Ffile_newer_than_file_p):
4585 * lread.c (Fload): Use full timestamp resolution of files,
4586 not just the 1-second resolution, so that files that are only
4587 slightly newer still count as newer.
4588 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4589 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4590
4591 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4592
4593 * fileio.c: Improve handling of file time marker. (Bug#11852)
4594 (special_mtime): New function.
4595 (Finsert_file_contents, Fverify_visited_file_modtime):
4596 Use it to set special mtime values consistently.
4597
4598 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4599
4600 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4601 marker for non-existing file. (Bug#11852)
4602
4603 2012-07-03 Glenn Morris <rgm@gnu.org>
4604
4605 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4606 and did not make it into globals.h).
4607
4608 2012-07-03 Tom Tromey <tromey@redhat.com>
4609
4610 * window.c (Fset_window_margins, Fset_window_fringes)
4611 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4612 * textprop.c (Fprevious_property_change): No longer static.
4613 * syntax.c (Fsyntax_table_p): No longer static.
4614 * process.c (Fget_process, Fprocess_datagram_address): No longer
4615 static.
4616 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4617 * keyboard.c (Fcommand_execute): No longer static.
4618 Remove EXFUN.
4619 * insdel.c (Fcombine_after_change_execute): No longer static.
4620 * image.c (Finit_image_library): No longer static.
4621 * fileio.c (Fmake_symbolic_link): No longer static.
4622 * eval.c (Ffetch_bytecode): No longer static.
4623 * editfns.c (Fuser_full_name): No longer static.
4624 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4625 No longer static.
4626 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4627 static.
4628 * dired.c (Ffile_attributes): No longer static.
4629 * composite.c (Fcomposition_get_gstring): No longer static.
4630 * callproc.c (Fgetenv_internal): No longer static.
4631
4632 * ccl.h: Remove EXFUNs.
4633 * buffer.h: Remove EXFUNs.
4634 * dispextern.h: Remove EXFUNs.
4635 * intervals.h: Remove EXFUNs.
4636 * fontset.h: Remove EXFUN.
4637 * font.h: Remove EXFUNs.
4638 * dosfns.c (system_process_attributes): Remove EXFUN.
4639 * keymap.h: Remove EXFUNs.
4640 * lisp.h: Remove EXFUNs.
4641 * w32term.h: Remove EXFUNs.
4642 * window.h: Remove EXFUNs.
4643 * xsettings.h: Remove EXFUN.
4644 * xterm.h: Remove EXFUN.
4645
4646 2012-07-03 Glenn Morris <rgm@gnu.org>
4647
4648 * lisp.h (Frandom): Make it visible to C.
4649 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4650 buffer for invisible buffers. (Bug#1229)
4651
4652 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4653
4654 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4655 values which aren't power of 2.
4656 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4657 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4658 accordingly.
4659
4660 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4661
4662 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4663
4664 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4665
4666 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4667
4668 * alloc.c (allocate_vector_block): Remove redundant
4669 calls to mallopt if DOUG_LEA_MALLOC is defined.
4670 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4671 avoid calls to mallopt if zero_vector is returned.
4672
4673 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4674
4675 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4676 is enabled, avoid dereferencing NULL current_sblock if
4677 running undumped.
4678
4679 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4680
4681 Cleanup basic buffer management.
4682 * buffer.h (struct buffer): Change layout to use generic vector
4683 marking code. Fix some comments. Change type of 'clip_changed'
4684 to bitfield. Remove unused #ifndef old.
4685 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4686 (GET_OVERLAYS_AT): Fix indentation.
4687 (for_each_per_buffer_object_at): New macro.
4688 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4689 (Fbuffer_local_variables): Use it.
4690 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4691 * alloc.c (allocate_buffer): Adjust to match new layout of
4692 struct buffer. Fix comment.
4693 (mark_overlay): New function.
4694 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4695 Lisp area of struct buffer.
4696 (mark_object): Use it. Adjust marking of misc objects
4697 and related comments.
4698
4699 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4700
4701 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4702 wrapper that is not needed because the wrapped code is a no-op (zero
4703 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4704 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4705
4706 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4707
4708 * alloc.c (mark_buffer): Simplify. Remove prototype.
4709 (mark_object): Add comment. Reorganize marking of vector-like
4710 objects. Use CHECK_LIVE for all vector-like objects except buffers
4711 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4712 Avoid redundant calls to mark_vectorlike for bool vectors.
4713
4714 2012-06-30 Glenn Morris <rgm@gnu.org>
4715
4716 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4717
4718 * epaths.in (PATH_SITELOADSEARCH): New.
4719 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4720 This is rather than relying on --enable-locallisppath elements
4721 having "site-lisp" in their names. (Bug#10208#25, 11658)
4722
4723 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4724
4725 * w32proc.c (sys_select): Accept and ignore one more argument.
4726
4727 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4728
4729 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4730 (pselect) [!MS_DOS]: Redirect to sys_select.
4731
4732 * sysdep.c: Don't include dos.h and dosfns.h.
4733
4734 * process.c (sys_select):
4735 * msdos.c (sys_select): Accept one more argument and ignore it.
4736
4737 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4738 adapt data types and code to that.
4739
4740 * dosfns.c:
4741 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4742 which clashes with the gnulib function of the same name.
4743
4744 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4745
4746 * font.c (font_style_to_value, font_style_symbolic)
4747 (font_prop_validate_style): Add type checks for values in
4748 font_style_table.
4749
4750 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4751 argument.
4752 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4753 uses.
4754
4755 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4756
4757 * xdisp.c (try_window_id): Undo last change.
4758
4759 * w32.c (getwd): Adjust commentary about startup_dir.
4760 (init_environment): Always call sys_access, even in non-MSVC
4761 builds. Don't chdir to the directory of the Emacs executable.
4762 This undoes code from 1997 which was justified by the need to
4763 "avoid conflicts when removing and renaming directories". But its
4764 downside was that every relative file name was being interpreted
4765 relative to the directory of the Emacs executable, which can never
4766 be TRT. In particular, it broke sys_access when called with
4767 relative file names.
4768 (sys_access): Map GetLastError to errno.
4769
4770 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4771
4772 * window.h (struct window): Change type of 'fringes_outside_margins'
4773 to bitfield. Fix comment. Adjust users accordingly.
4774 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4775 Adjust comment.
4776 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4777 to ptrdiff_t.
4778
4779 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4780
4781 * gnutls.c (emacs_gnutls_handshake):
4782 Add QUIT to make the loop interruptible.
4783
4784 2012-06-29 Glenn Morris <rgm@gnu.org>
4785
4786 * charset.c (init_charset): Make lack of etc/charsets fatal.
4787
4788 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4789
4790 * editfns.c (region_limit): Fix type mismatch.
4791
4792 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4793
4794 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4795 undefined. Convert from xassert to eassert.
4796 * nsmenu.m: Convert from xassert to eassert.
4797 * nsterm.m: Likewise.
4798
4799 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4800
4801 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4802
4803 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4804
4805 Avoid integer overflow on scroll-left and scroll-right.
4806 * window.c (HSCROLL_MAX): New macro.
4807 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4808 overflow when requested scroll falls outside ptrdiff_t range.
4809
4810 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4811
4812 * window.h (struct window): Change type of 'hscroll',
4813 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4814 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4815 Adjust users accordingly.
4816 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4817 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4818 from EMACS_INT to ptrdiff_t.
4819 (make_window): Omit redundant initialization.
4820
4821 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4822
4823 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4824
4825 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4826
4827 * window.h (struct window): Change type of 'use_time' and
4828 'sequence_number' from Lisp_Object to int.
4829 * frame.c (make_frame): Adjust users accordingly.
4830 * print.c (print_object): Likewise.
4831 * window.c (select_window, Fwindow_use_time, make_parent_window)
4832 (make_window): Likewise.
4833
4834 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4835
4836 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4837 enabled with --enable-checking=[all,glyphs] configure option.
4838 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4839 adjust comments accordingly.
4840 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4841 undefined, adjust comments accordingly.
4842 * image.c: Likewise.
4843 * scroll.c: Likewise.
4844 * w32fns.c: Likewise.
4845 * w32term.c: Likewise.
4846 * xdisp.c: Likewise.
4847 * xfaces.c: Likewise.
4848 * xfns.c: Likewise.
4849 * xterm.c: Likewise.
4850
4851 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4852
4853 Generalize run-time debugging checks.
4854 * dispextern.h (XASSERTS): Remove.
4855 * fontset.c (xassert): Remove.
4856 Convert from xassert to eassert.
4857 * alloc.c: Convert from xassert to eassert.
4858 * bidi.c: Likewise.
4859 * dispnew.c: Likewise.
4860 * fns.c: Likewise.
4861 * fringe.c: Likewise.
4862 * ftfont.c: Likewise.
4863 * gtkutil.c: Likewise.
4864 * image.c: Likewise.
4865 * keyboard.c: Likewise.
4866 * menu.c: Likewise.
4867 * process.c: Likewise.
4868 * scroll.c: Likewise.
4869 * sound.c: Likewise.
4870 * term.c: Likewise.
4871 * w32console.c: Likewise.
4872 * w32fns.c: Likewise.
4873 * w32term.c: Likewise.
4874 * window.c: Likewise.
4875 * xdisp.c: Likewise.
4876 * xfaces.c: Likewise.
4877 * xfns.c: Likewise.
4878 * xselect.c: Likewise.
4879 * xterm.c: Likewise.
4880
4881 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4882
4883 * fns.c (maybe_resize_hash_table): Output message when growing the
4884 purify-hashtable.
4885
4886 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4887
4888 * alloc.c (allocate_string_data): Remove dead code.
4889 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4890 avoid GCC warning about unused macro.
4891
4892 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4893
4894 * alloc.c (allocate_string): Omit intervals initialization.
4895 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4896 as in make_pure_string and make_pure_c_string.
4897
4898 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4899
4900 * alloc.c (allocate_string): Fix last change.
4901
4902 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4903
4904 * alloc.c (allocate_string): Remove two redundant calls
4905 to memset, add explicit initialization where appropriate.
4906
4907 2012-06-27 Glenn Morris <rgm@gnu.org>
4908
4909 * lisp.mk (lisp): Remove paths.elc.
4910
4911 2012-06-27 Chong Yidong <cyd@gnu.org>
4912
4913 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4914
4915 2012-06-26 John Wiegley <johnw@newartisans.com>
4916
4917 * unexmacosx.c (copy_data_segment): Add two section names used
4918 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4919
4920 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4921 when building with Clang.
4922
4923 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4924
4925 * eval.c (Fapply): Allow calling it with a single argument.
4926
4927 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4928
4929 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4930 _stricmp and _strnicmp.
4931 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4932
4933 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4934
4935 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4936 allocated window.
4937 (allocate_process): Likewise for new process.
4938 (allocate_terminal): Change to use offsetof.
4939 (allocate_frame): Likewise.
4940 * frame.c (make_frame): Omit redundant initialization.
4941 * window.c (make_parent_window): Use memset.
4942 (make_window): Omit redundant initialization.
4943 * process.c (make_process): Omit redundant initialization.
4944 * terminal.c (create_terminal): Likewise.
4945
4946 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4947
4948 * term.c (delete_tty): Remove redundant call to memset.
4949
4950 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4951
4952 * alloc.c: Remove build_string.
4953 * lisp.h: Define build_string as static inline. This provides
4954 a better opportunity to optimize away calls to strlen when the
4955 function is called with compile-time constant argument.
4956 * image.c (imagemagick_error): Convert to build_string.
4957 * w32proc.c (sys_spawnve): Likewise.
4958 * xterm.c (x_term_init): Likewise.
4959
4960 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4961
4962 Use sprintf return value instead of invoking strlen on result.
4963 In the old days this wasn't portable, since some sprintf
4964 implementations returned char *. But they died out years ago and
4965 Emacs already assumes sprintf returns int.
4966 Similarly for float_to_string.
4967 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4968 * ccl.c (ccl_driver):
4969 * character.c (string_escape_byte8):
4970 * data.c (Fnumber_to_string):
4971 * doprnt.c (doprnt):
4972 * print.c (print_object):
4973 * xdisp.c (message_dolog):
4974 * xfns.c (syms_of_xfns):
4975 Use sprintf or float_to_string result to avoid need to call strlen.
4976 * data.c (Fnumber_to_string):
4977 Use make_unibyte_string, since the string must be ASCII.
4978 * lisp.h, print.c (float_to_string): Now returns int length.
4979 * term.c (produce_glyphless_glyph):
4980 Use sprintf result rather than recomputing it.
4981
4982 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4983 * Makefile.in (ALL_CFLAGS):
4984 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4985 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4986
4987 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4988
4989 * dispextern.h (xstrcasecmp): Define to library function
4990 strcasecmp if available.
4991 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4992
4993 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4994
4995 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4996 Avoid comma operator.
4997 * menu.c (push_submenu_start, push_submenu_end)
4998 (push_left_right_boundary, push_menu_pane): Likewise.
4999 * msdos.c (dos_rawgetc): Likewise.
5000
5001 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5002
5003 * xfns.c (xic_create_fontsetname): Remove redundant calls
5004 to memset.
5005
5006 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5007
5008 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5009 sprintf already null-terminates its output.
5010
5011 * xfns.c (x_window): Remove redundant cast.
5012
5013 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5014
5015 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5016 `const char *' to `char *' to avoid compiler warning.
5017
5018 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5019
5020 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5021 instead of truncating it to 63 (admittedly a generous limit).
5022
5023 * process.c: Fix spelling and caps in comments.
5024
5025 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5026
5027 * emacs.c (setpgrp): Remove definition, unused.
5028 * sysdep.c (setpgrp): Remove definition, not used in this file.
5029
5030 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5031
5032 * makefile.w32-in: Update dependencies.
5033
5034 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5035
5036 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5037 (SYSTIME_H): Add nt/inc/sys/time.h.
5038
5039 * systime.h [WINDOWSNT]: Include sys/time.h.
5040
5041 * s/ms-w32.h (struct timespec): Definition moved from
5042 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5043
5044 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5045
5046 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5047 * buffer.h (buffer_slot_type_mismatch):
5048 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5049 * eval.c (unwind_to_catch):
5050 * image.c (my_png_error, my_error_exit):
5051 * keyboard.c (quit_throw_to_read_char, user_error)
5052 (Fexit_recursive_edit, Fabort_recursive_edit):
5053 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5054 (wrong_type_argument, buffer_overflow, __executable_start)
5055 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5056 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5057 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5058 (fatal):
5059 (child_setup) [!DOS_NT]:
5060 * lread.c (end_of_file_error, invalid_syntax):
5061 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5062 * puresize.h (pure_write_error):
5063 * search.c (matcher_overflow):
5064 * sound.c (sound_perror, alsa_sound_perror):
5065 * sysdep.c, syssignal.h (croak):
5066 * term.c (maybe_fatal, vfatal):
5067 * textprop.c (text_read_only):
5068 * undo.c (user_error):
5069 * unexmacosx.c (unexec_error):
5070 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5071 Use _Noreturn rather than NO_RETURN.
5072 No need for separate decl merely because of _Noreturn.
5073 * sound.c (sound_warning, parse_sound):
5074 Remove unnecessary forward decls.
5075
5076 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5077
5078 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5079 * lisp.h (WAIT_READING_MAX): New macro.
5080 * dispnew.c (Fsleep_for, sit_for):
5081 * keyboard.c (kbd_buffer_get_event):
5082 * process.c (Faccept_process_output):
5083 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5084 This improves on the previous patch, which introduced a bug
5085 when time_t is unsigned and as wide as intmax_t.
5086 See <http://bugs.gnu.org/9000#51>.
5087
5088 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5089
5090 * dispnew.c (sit_for, Fsleep_for):
5091 * keyboard.c (kbd_buffer_get_event):
5092 * process.c (Faccept_process_output): Avoid compiler warnings when
5093 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5094
5095 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5096
5097 * makefile.w32-in: Update dependencies.
5098
5099 * w32.c (ltime): Add return type and declare static.
5100 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5101
5102 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5103
5104 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5105 Privately reported by Herbert J. Skuhra.
5106 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5107 All uses changed.
5108 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5109 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5110
5111 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5112
5113 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5114 last argument of make_unibyte_string.
5115
5116 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5117 language ID in the event parameters.
5118
5119 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5120 event.code, not the obscure "character set ID".
5121
5122 2012-06-23 Chong Yidong <cyd@gnu.org>
5123
5124 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5125
5126 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5127
5128 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5129 * w32.c (fdutimens): New function.
5130
5131 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5132
5133 * s/ms-w32.h (pselect): Redirect to sys_select.
5134
5135 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5136
5137 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5138 in the logic of incrementing and decrementing the value of
5139 use_relocatable_buffers.
5140
5141 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5142
5143 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5144 Privately reported by Herbert J. Skuhra.
5145 [__FreeBSD__]: Remove "*/" typo after "#include".
5146 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5147 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5148 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5149 Don't assume EMACS_TIME and struct timeval are the same type.
5150
5151 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5152
5153 Support higher-resolution time stamps (Bug#9000).
5154 The time stamps are only nanosecond-resolution at the C level,
5155 since that's the best that any real-world system supports now.
5156 But they are picosecond-resolution at the Lisp level, as that's
5157 easy, and leaves room for future OS improvements.
5158
5159 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5160 (LIBES): Use it.
5161
5162 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5163 Don't get current time unless it's needed.
5164
5165 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5166 now provides it if it's absent.
5167 (start_atimer): Port to higher-res time stamps.
5168 Check for time stamp overflow. Don't get current time more
5169 often than is needed.
5170
5171 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5172 Include systime.h, not time.h.
5173 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5174
5175 * dired.c: Include stat-time.h.
5176 (Ffile-attributes): File times now have higher resolution.
5177
5178 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5179 (struct image): Timestamp now has higher resolution.
5180
5181 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5182 has at least microseconds now. All uses removed.
5183 (update_frame, update_single_window, update_window, update_frame_1)
5184 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5185 (duration_to_sec_usec): Remove; no longer needed.
5186
5187 * editfns.c (time_overflow): Now extern.
5188 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5189 (float-time, Fformat_time_string, Fcurrent_time_string)
5190 (Fcurrent_time_zone): Accept and generate higher-resolution
5191 time stamps.
5192 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5193 (decode_time_components, lisp_seconds_argument): New functions.
5194 (make_time): Now static.
5195 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5196 Report an error if the time is invalid, rather than having the caller
5197 do that.
5198
5199 * fileio.c: Include <stat-time.h>
5200 (Fcopy_file): Copy higher-resolution time stamps.
5201 Prefer to set the time stamp via a file descriptor if that works.
5202 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5203 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5204 (Fvisited_file_modtime, Fset_visited_file_modtime):
5205 Support higher-resolution time stamps.
5206
5207 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5208
5209 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5210
5211 * image.c (prepare_image_for_display, clear_image_cache)
5212 (lookup_image): Port to higer-resolution time stamps.
5213
5214 * keyboard.c (start_polling, bind_polling_period):
5215 Check for time stamp overflow.
5216 (read_char, kbd_buffer_get_event, timer_start_idle)
5217 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5218 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5219 Port to higher-resolution time stamps. Do not assume time_t is signed.
5220 (decode_timer): New function. Timers are now vectors of length 9,
5221 not 8, to accommodate the picosecond component.
5222 (timer_check_2): Use it.
5223
5224 * nsterm.m (select_timeout, timeval_subtract): Remove.
5225 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5226 as they're a bit more accurate and handle overflow better.
5227 (ns_select): Change prototype to be compatible with pselect.
5228 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5229 * nsterm.h (ns_select): Adjust prototype.
5230
5231 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5232 us-resolution time stamps.
5233 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5234
5235 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5236
5237 * lisp.h (time_overflow): New decl.
5238 (wait_reading_process_output): First arg is now intmax_t, not int,
5239 to accommodate larger waits.
5240
5241 * process.h (struct Lisp_Process.read_output_delay):
5242 Now counts nanoseconds, not microseconds.
5243 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5244 EMACS_HAS_USECS.
5245 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5246 (wait_reading_process_output):
5247 Port to ns-resolution time stamps.
5248 (Faccept_process_output, wait_reading_process_output):
5249 Check for time stamp overflow. Do not assume time_t is signed.
5250 (select_wrapper): Remove; we now use pselect.
5251 (Fprocess_attributes): Now generates ns-resolution time stamps.
5252
5253 * sysdep.c: Include utimens.h. Don't include utime.h
5254 or worry about struct utimbuf; gnulib does that for us now.
5255 (gettimeofday): Remove; gnulib provides a substitute.
5256 (make_timeval): New function.
5257 (set_file_times): Now sets ns-resolution time stamps.
5258 New arg FD; all uses changed.
5259 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5260 (system_process_attributes):
5261 Now returns ns-resolution time stamp. All uses changed.
5262 Check for time stamp overflow.
5263
5264 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5265 provides a substitute now.
5266
5267 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5268 since it guarantees struct timespec.
5269 (EMACS_TIME): Now struct timespec, so that we can support
5270 ns-resolution time stamps.
5271 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5272 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5273 (EMACS_USECS): Remove.
5274 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5275 so multiply the arg by 1000 before storing it.
5276 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5277 New macros.
5278 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5279 Port to ns-resolution time stamps.
5280 (EMACS_TIME_NEG_P): Remove; replaced by....
5281 (EMACS_TIME_SIGN): New macro.
5282 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5283 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5284 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5285 (make_timeval, make_lisp_time, decode_time_components): New decls.
5286 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5287 that it mishandled time_t overflow. You can't compare by subtracting!
5288 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5289 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5290
5291 * term.c: Include <sys/time.h>.
5292 (timeval_to_Time): New function, for proper overflow wraparound.
5293 (term_mouse_position, term_mouse_click): Use it.
5294
5295 * undo.c (record_first_change): Support higher-resolution time stamps
5296 in the undo buffer.
5297 (Fprimitive_undo): Use them when restoring time stamps.
5298
5299 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5300 (w32_get_internal_run_time):
5301 Port to higher-resolution Emacs time stamps.
5302 (ltime): Now accepts single 64-bit integer, as that's more convenient
5303 for callers.
5304
5305 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5306
5307 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5308 for compatibility with pselect. Support ns-resolution time stamps.
5309
5310 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5311
5312 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5313 Check for time stamp overflow, and support ns-resolution time stamps.
5314
5315 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5316 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5317 (timeval_subtract): Remove; no longer needed.
5318 (XTflash, XTring_bell, x_wait_for_event):
5319 Port to ns-resolution time stamps. Don't assume time_t is signed.
5320
5321 2012-06-22 Chong Yidong <cyd@gnu.org>
5322
5323 * xdisp.c (x_consider_frame_title): Revert last change.
5324
5325 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5326
5327 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5328 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5329 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5330 staticidx goes up to 1597 out of 1600 = 0x640.)
5331
5332 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5333
5334 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5335 Otherwise, the umask might be mistakenly 0 while handling input signals.
5336
5337 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5338
5339 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5340
5341 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5342
5343 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5344 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5345 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5346 access to `contents' member of Lisp_Vector objects with AREF and ASET
5347 where appropriate.
5348
5349 2012-06-19 Chong Yidong <cyd@gnu.org>
5350
5351 * frame.c (delete_frame): When selecting a frame on a different
5352 text terminal, do not alter the terminal's top-frame.
5353
5354 * xdisp.c (format_mode_line_unwind_data): Record the target
5355 frame's selected window and its terminal's top-frame.
5356 (unwind_format_mode_line): Restore them.
5357 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5358 Callers changed.
5359 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5360 since tty frames can be explicitly named.
5361 (prepare_menu_bars): Likewise.
5362
5363 * term.c (Ftty_top_frame): New function.
5364
5365 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5366
5367 Port byte-code-meter to modern targets.
5368 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5369 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5370 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5371 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5372 (METER_1, METER_2): Simplify.
5373
5374 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5375
5376 * data.c (Fdefalias): Return `symbol' (bug#11686).
5377
5378 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5379
5380 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5381 gets killed during executing of this function (Bug#11665).
5382 Try to always return Qt when the buffer has been actually killed.
5383 (Vkill_buffer_query_functions): In doc-string say that functions
5384 run by this hook should not change the current buffer.
5385
5386 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5387
5388 Fix recently-introduced process.c problems found by static checking.
5389 * process.c (write_queue_push, write_queue_pop, send_process):
5390 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5391 (write_queue_pop): Fix pointer signedness problem.
5392 (send_process): Remove unused local.
5393
5394 2012-06-17 Chong Yidong <cyd@gnu.org>
5395
5396 * xdisp.c (redisplay_internal): No need to redisplay terminal
5397 frames that are not on top.
5398
5399 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5400
5401 * process.c (make_process): Initialize write_queue.
5402 (write_queue_push, write_queue_pop): New functions.
5403 (send_process): Use them to maintain correct ordering of process
5404 writes (Bug#10815).
5405
5406 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5407
5408 * lisp.h (eassert): Assume C89 or later.
5409 This removes the need for CHECK.
5410 (CHECK): Remove. Its comments about always evaluating its
5411 argument were confusing, as 'eassert' typically does not evaluate
5412 its argument.
5413
5414 * coding.c (produce_chars): Use ptrdiff_t, not int.
5415
5416 * xterm.c (x_draw_underwave): Check for integer overflow.
5417 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5418
5419 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5420
5421 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5422 referenced (Bug#11583).
5423
5424 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5425
5426 Implement wave-style variant of underlining.
5427 * dispextern.h (face_underline_type): New enum.
5428 (face): Add field for underline type.
5429 * nsterm.m (ns_draw_underwave): New function.
5430 (ns_draw_text_decoration): Use it.
5431 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5432 New functions.
5433 (x_draw_glyph_string): Use them.
5434 * xfaces.c (Qline, Qwave): New Lisp objects.
5435 (check_lface_attrs, merge_face_ref)
5436 (Finternal_set_lisp_face_attribute, realize_x_face):
5437 Handle wave-style underline face attributes.
5438 * xterm.c (x_draw_underwave): New function.
5439 (x_draw_glyph_string): Use it.
5440
5441 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5442
5443 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5444 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5445 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5446 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5447 ($(BLD)/w32select.$(O)): Update dependencies.
5448
5449 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5450
5451 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5452 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5453 * character.c (_fetch_multibyte_char_p): Remove.
5454 * alloc.c: Include "character.h" before "buffer.h".
5455 * bidi.c: Likewise.
5456 * buffer.c: Likewise.
5457 * bytecode.c: Likewise.
5458 * callint.c: Likewise.
5459 * callproc.c: Likewise.
5460 * casefiddle.c: Likewise.
5461 * casetab.c: Likewise.
5462 * category.c: Likewise.
5463 * cmds.c: Likewise.
5464 * coding.c: Likewise.
5465 * composite.c: Likewise.
5466 * dired.c: Likewise.
5467 * dispnew.c: Likewise.
5468 * doc.c: Likewise.
5469 * dosfns.c: Likewise.
5470 * editfns.c: Likewise.
5471 * emacs.c: Likewise.
5472 * fileio.c: Likewise.
5473 * filelock.c: Likewise.
5474 * font.c: Likewise.
5475 * fontset.c: Likewise.
5476 * fringe.c: Likewise.
5477 * indent.c: Likewise.
5478 * insdel.c: Likewise.
5479 * intervals.c: Likewise.
5480 * keyboard.c: Likewise.
5481 * keymap.c: Likewise.
5482 * lread.c: Likewise.
5483 * macros.c: Likewise.
5484 * marker.c: Likewise.
5485 * minibuf.c: Likewise.
5486 * nsfns.m: Likewise.
5487 * nsmenu.m: Likewise.
5488 * print.c: Likewise.
5489 * process.c: Likewise.
5490 * regex.c: Likewise.
5491 * region-cache.c: Likewise.
5492 * search.c: Likewise.
5493 * syntax.c: Likewise.
5494 * term.c: Likewise.
5495 * textprop.c: Likewise.
5496 * undo.c: Likewise.
5497 * unexsol.c: Likewise.
5498 * w16select.c: Likewise.
5499 * w32fns.c: Likewise.
5500 * w32menu.c: Likewise.
5501 * window.c: Likewise.
5502 * xdisp.c: Likewise.
5503 * xfns.c: Likewise.
5504 * xmenu.c: Likewise.
5505 * xml.c: Likewise.
5506 * xselect.c: Likewise.
5507
5508 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5509
5510 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5511 If all the glyphs of the glyph row came from strings, and we have no
5512 cursor positioning clues, put the cursor on the first glyph of the
5513 row.
5514 (handle_face_prop): Use chunk-relative overlay string index when
5515 indexing into it->string_overlays array. (Bug#11653)
5516 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5517 the rightmost. (Bug#11720)
5518
5519 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5520
5521 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5522 (CATEGORY_MEMBER): Enforce 1/0 value.
5523 * category.c (_temp_category_set): Remove.
5524
5525 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5526
5527 * window.c (Fdelete_other_windows_internal)
5528 (Fdelete_window_internal): Don't access frame's mouse highlight
5529 info of the initial frame. (Bug#11677)
5530
5531 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5532
5533 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5534 Assume USE_2_TAGS_FOR_INTS.
5535 (xreload): Adjust $tagmask width to match recent lisp.h change.
5536
5537 Simplify lisp.h in minor ways that should not affect code.
5538 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5539 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5540 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5541 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5542 (INTTYPEBITS): New macro, for clarity.
5543 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5544 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5545 Simplify now that USE_LSB_TAG is always defined.
5546 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5547 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5548
5549 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5550
5551 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5552
5553 2012-06-13 Glenn Morris <rgm@gnu.org>
5554
5555 * s/bsd-common.h (BSD4_3):
5556 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5557
5558 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5559
5560 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5561 instead of union.
5562 (XLI, XIL): Define.
5563 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5564 Use them.
5565 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5566 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5567 * alloc.c (widen_to_Lisp_Object): Remove.
5568 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5569 * frame.c (delete_frame): Remove outdated comment.
5570 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5571 USE_LISP_UNION_TYPE.
5572 (Fw32_unregister_hot_key): Likewise.
5573 (Fw32_toggle_lock_key): Likewise.
5574 * w32menu.c (add_menu_item): Likewise.
5575 (w32_menu_display_help): Use XIL instead of checking
5576 USE_LISP_UNION_TYPE.
5577 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5578 (init_heap): Likewise.
5579 * w32term.c (w32_read_socket): Update comment.
5580
5581 2012-06-13 Glenn Morris <rgm@gnu.org>
5582
5583 * s/usg5-4-common.h, src/s/unixware.h:
5584 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5585
5586 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5587
5588 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5589
5590 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5591 * alloc.c (make_number) [!defined make_number]:
5592 Remove, as lisp.h always defines this now.
5593 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5594 (roundup_size): Verify that it is a power of 2.
5595 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5596 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5597 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5598 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5599 USE_LSB_TAG now is always defined to be either 0 or 1.
5600 All uses changed.
5601 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5602 code works fine either way, and efficiency is not a concern here,
5603 as the union type is for debugging, not for production.
5604 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5605 Use an inline function on all platforms when using the union type,
5606 since this is simpler and 'static inline' can be used portably
5607 within Emacs now.
5608 (LISP_INITIALLY_ZERO): New macro.
5609 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5610 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5611
5612 2012-06-12 Glenn Morris <rgm@gnu.org>
5613
5614 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5615
5616 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5617
5618 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5619 Move BROKEN_SIGIO to configure.
5620
5621 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5622 Move NO_TERMIO to configure.
5623
5624 2012-06-12 Chong Yidong <cyd@gnu.org>
5625
5626 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5627 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5628 MagickExportImagePixels is undefined.
5629
5630 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5631
5632 * image.c (imagemagick_load_image): Remove unused label.
5633
5634 2012-06-11 Glenn Morris <rgm@gnu.org>
5635
5636 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5637 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5638 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5639 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5640
5641 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5642
5643 * alloc.c (make_byte_code): New function.
5644 (Fmake_byte_code): Use it. Don't purify here.
5645 * lread.c (read1): Use it as well to avoid extra allocation.
5646
5647 2012-06-11 Chong Yidong <cyd@gnu.org>
5648
5649 * image.c (imagemagick_load_image): Implement transparency.
5650
5651 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5652
5653 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5654 account for preceding backslashes. (Bug#11663)
5655
5656 2012-06-09 Chong Yidong <cyd@gnu.org>
5657
5658 * term.c: Support italics in capable terminals (Bug#9652).
5659 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5660 (turn_on_face): Output using TS_enter_italic_mode if available.
5661 Don't handle unused blinking and alt-charset cases.
5662 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5663 and tty_alt_charset_p cases.
5664 (tty_capable_p, init_tty): Support italics.
5665
5666 * termchar.h (struct tty_display_info): Add field for italics.
5667 Remove unused blink field.
5668
5669 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5670 Handle slant.
5671
5672 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5673 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5674 tty_alt_charset_p. Add tty_italic_p.
5675
5676 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5677
5678 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5679 dbus_type_is_basic if available.
5680 (xd_extract_signed, xd_extract_unsigned): Rename from
5681 extract_signed and extract_unsigned, respectively. Adapt callers.
5682
5683 2012-06-09 Chong Yidong <cyd@gnu.org>
5684
5685 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5686
5687 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5688 case (Bug#9752).
5689
5690 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5691
5692 * xdisp.c (vmessage): Treat frame message as multibyte.
5693 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5694 would generate the diagnostic "Making \302\247 buffer-local while
5695 let-bound!".
5696
5697 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5698
5699 * dispnew.c (showing_window_margins_p): Undo last change, which
5700 was done due to an inadvertent commit.
5701 (adjust_frame_glyphs_for_frame_redisplay): Do call
5702 showing_window_margins_p.
5703
5704 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5705
5706 * eval.c (Fmake_var_non_special): New primitive.
5707 (syms_of_eval): Defsubr it.
5708 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5709
5710 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5711
5712 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5713 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5714
5715 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5716
5717 * alloc.c (allocate_vectorlike): Fix last change.
5718
5719 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5720
5721 Block-based vector allocation of small vectors.
5722 * lisp.h (struct vectorlike_header): New field `nbytes',
5723 adjust comment accordingly.
5724 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5725 to denote vector blocks. Adjust users (live_vector_p,
5726 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5727 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5728 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5729 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5730 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5731 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5732 (roundup_size): New constant.
5733 (struct vector_block): New data type.
5734 (vector_blocks, vector_free_lists, zero_vector): New variables.
5735 (all_vectors): Rename to `large_vectors'.
5736 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5737 (sweep_vectors): New functions.
5738 (allocate_vectorlike): Return `zero_vector' as the only vector of
5739 0 items. Allocate new vector from block if vector size is less than
5740 or equal to VBLOCK_BYTES_MAX.
5741 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5742 (init_alloc_once): Add call to init_vectors.
5743
5744 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5745
5746 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5747
5748 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5749
5750 * doprnt.c (doprnt): Truncate multibyte char correctly.
5751 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5752 would mishandle a string argument "Xc" if X was a multibyte
5753 character of length 2: it would truncate after X's first byte
5754 rather than including all of X.
5755
5756 2012-06-06 Chong Yidong <cyd@gnu.org>
5757
5758 * buffer.c (word_wrap): Doc fix.
5759
5760 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5761
5762 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5763
5764 2012-06-03 Glenn Morris <rgm@gnu.org>
5765
5766 * xdisp.c (tool-bar-style): Doc fix.
5767
5768 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5769
5770 * Makefile.in (PAXCTL): Define.
5771 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5772 binary via PaX flags if the paxctl utility is available.
5773 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5774 Restore PaX flags to their default. (Bug#11398)
5775
5776 2012-06-03 Chong Yidong <cyd@gnu.org>
5777
5778 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5779 buffer (Bug#11226).
5780
5781 2012-06-03 Chong Yidong <cyd@gnu.org>
5782
5783 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5784 (note_mode_line_or_margin_highlight): If there is no help echo,
5785 use mode-line-default-help-echo. Handle the case where the mouse
5786 position is past the end of the mode line string.
5787
5788 * buffer.c (buffer_local_value_1): New function, split from
5789 Fbuffer_local_value; can return Qunbound.
5790 (Fbuffer_local_value): Use it.
5791 (Vmode_line_format): Docstring tweaks.
5792
5793 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5794
5795 * sysdep.c (system_process_attributes): Improve comment.
5796
5797 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5798
5799 * keyboard.c: Export real-this-command to Elisp.
5800 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5801 and DEFVAR it. Update all users.
5802
5803 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5804
5805 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5806
5807 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5808 Convert pctcpu and pctmem to Lisp float properly.
5809 Let the compiler fold better, as 100.0/0x8000 is exact.
5810
5811 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5812
5813 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5814 cons_block.
5815
5816 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5817
5818 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5819
5820 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5821
5822 For a 'struct window', replace some Lisp_Object fields to
5823 bitfields where appropriate, remove unused fields.
5824 * window.h (struct window): Remove unused 'last_mark_x' and
5825 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5826 change it's type from Lisp_Object to bitfield.
5827 Change type of 'force_start', 'optional_new_start',
5828 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5829 fields from Lisp_Object to bitfield. Adjust users accordingly.
5830
5831 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5832
5833 Pacify gcc -Wdouble-precision when using Xaw.
5834 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5835 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5836 Use 'float' consistently, rather than 'float' in most places
5837 and 'double' in a couple of places.
5838
5839 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5840
5841 * xdisp.c (handle_stop): Detect whether we have overlay strings
5842 loaded by testing it->current.overlay_string_index to be
5843 non-negative, instead of checking whether n_overlay_strings is
5844 positive. (Bug#11587)
5845
5846 2012-05-31 Chong Yidong <cyd@gnu.org>
5847
5848 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5849
5850 * doc.c (Fsubstitute_command_keys): Doc fix.
5851
5852 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5853
5854 * search.c (search_buffer): Remove calls to
5855 r_alloc_inhibit_buffer_relocation, as it is now called by
5856 maybe_unify_char, which was the cause of relocation of buffer text
5857 in bug#11519.
5858
5859 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5860
5861 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5862 for the duration of call to load_charset, to avoid problems with
5863 callers of maybe_unify_char that access buffer text through C
5864 pointers.
5865
5866 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5867 decrement the inhibition flag, instead of just setting or
5868 resetting it.
5869
5870 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5871
5872 Remove obsolete '#define static' cruft.
5873 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5874 This #undef was "temporary" in 2000; it is no longer needed
5875 now that '#define static' has gone away.
5876 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5877 (gray_bitmap_bits): Remove; no longer needed.
5878 All uses replaced with definiens.
5879 * xterm.c: Include "bitmaps/gray.xbm".
5880
5881 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5882
5883 Clean up __executable_start, monstartup when --enable-profiling.
5884 The following changes affect the code only when profiling.
5885 * dispnew.c (__executable_start): Rename from safe_bcopy.
5886 Define only on platforms that need it.
5887 * emacs.c: Include <sys/gmon.h> when profiling.
5888 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5889 (__executable_start): Remove decl, since lisp.h does it now.
5890 (safe_bcopy): Remove decl; no longer has that name.
5891 (main): Coalesce #if into single bit of code, for simplicity.
5892 Cast pointers to uintptr_t, since standard libraries want integers
5893 and not pointers.
5894 * lisp.h (__executable_start): New decl.
5895
5896 2012-05-31 Glenn Morris <rgm@gnu.org>
5897
5898 * image.c (Fimagemagick_types): Doc fix.
5899
5900 2012-05-30 Jim Meyering <meyering@redhat.com>
5901
5902 * callproc.c (Fcall_process_region): Include directory component
5903 in mkstemp error message (Bug#11586).
5904
5905 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5906
5907 * alloc.c, lisp.h (make_pure_vector): Now static.
5908
5909 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5910
5911 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5912 Move to byte-run.el.
5913 (Fautoload): Do the hash-doc more carefully.
5914 * data.c (Fdefalias): Purify definition, except for keymaps.
5915 (Qdefun): Move from eval.c.
5916 * lisp.h (Qdefun): Remove.
5917 * lread.c (read1): Tiny simplification.
5918
5919 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5920
5921 Do not create empty overlays with the evaporate property (Bug#9642).
5922 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5923 Bug#9642, but explicitly check that the buffer the overlay would
5924 be moved to is live and rearrange lines to make sure that errors
5925 will not put the overlay in an inconsistent state.
5926 (Fdelete_overlay): Cosmetics.
5927
5928 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5929
5930 * w32term.c (my_bring_window_to_top): New function.
5931 (x_raise_frame): Use handle returned by DeferWindowPos, which
5932 could be different from the original one.
5933 Call my_bring_window_to_top instead of my_set_foreground_window.
5934 (Bug#11513)
5935
5936 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5937 by calling BringWindowToTop.
5938
5939 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5940 (WM_EMACS_END): Increase by one.
5941
5942 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5943
5944 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5945 This avoids undefined behavior that might cause the eassert
5946 to not catch an out-of-range value.
5947
5948 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5949
5950 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5951 Update dependencies.
5952
5953 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5954
5955 * bidi.c (bidi_mirror_char): Fix last change.
5956
5957 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5958
5959 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5960 when referring to sectname field in printf format.
5961
5962 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5963
5964 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5965 Only r_alloc_inhibit_buffer_relocation needed to be added;
5966 the others were already declared.
5967
5968 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5969 before checking whether it's out of range. Put the check inside
5970 eassert. See
5971 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5972
5973 2012-05-27 Ken Brown <kbrown@cornell.edu>
5974
5975 * callproc.c (Fcall_process): Restore a line that was accidentally
5976 commented out in the 2011-02-13 change (bug#11547).
5977
5978 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5979
5980 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5981 defined on ralloc.c.
5982
5983 * buffer.c [REL_ALLOC]: Remove prototypes of
5984 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5985 they are now on lisp.h.
5986
5987 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5988
5989 * search.c (search_buffer): Use it to inhibit relocation of buffer
5990 text while re_search_2 is doing its job, because re_search_2 is
5991 passed C pointers to buffer text. (Bug#11519)
5992
5993 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5994 Update value to 24.
5995
5996 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5997 state after an additional call to move_it_in_display_line_to, keep
5998 the values of it->max_ascent and it->max_descent found for the
5999 entire line.
6000 (pos_visible_p): Revert the comparison against bottom_y to what it
6001 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6002 (Bug#11464)
6003
6004 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 Fix coding-related core dumps with gcc -ftrapv.
6007 The code was computing A - B, where A and B are pointers, and B is
6008 random garbage. This can lead to core dumps on platforms that
6009 have special pointer registers, and it also leads to core dumps on
6010 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6011 A - B only when B is initialized properly.
6012 * coding.c (coding_set_source, coding_set_destination): Return void.
6013 (coding_change_source, coding_change_destinations): New functions,
6014 with the old behaviors of coding_set_source and coding_set_destination.
6015 All callers that need an offset changed to use these new functions.
6016
6017 2012-05-26 Glenn Morris <rgm@gnu.org>
6018
6019 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6020
6021 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6022
6023 Extend mouse support on W32 text-mode console.
6024 * xdisp.c (draw_row_with_mouse_face):
6025 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6026
6027 * w32console.c: Include window.h.
6028 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6029 New functions.
6030 (initialize_w32_display): Initialize mouse-highlight data.
6031
6032 * w32inevt.c: Include termchar.h and window.h.
6033 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6034 moves, call note_mouse_highlight. If help_echo changed, call
6035 gen_help_event to produce help-echo message in the echo area.
6036 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6037 highlight info.
6038
6039 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 * lread.c (read1): Simplify slightly to avoid an overflow warning
6042 with GCC 4.7.0 on x86-64.
6043
6044 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6045
6046 * bidi.c (bidi_mirror_char): Revert last change: an int is
6047 definitely wide enough here.
6048
6049 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6050
6051 Fix integer width and related bugs (Bug#9874).
6052 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6053 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6054 (string_bytes, check_sblock, allocate_string_data):
6055 (compact_small_strings, Fmake_bool_vector, make_string)
6056 (make_unibyte_string, make_multibyte_string)
6057 (make_string_from_bytes, make_specified_string)
6058 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6059 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6060 (mark_vectorlike):
6061 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6062 (allocate_pseudovector):
6063 Use int, not EMACS_INT, where int is wide enough.
6064 (inhibit_garbage_collection, Fgarbage_collect):
6065 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6066 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6067 int might not be wide enough.
6068 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6069 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6070 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6071 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6072 (bidi_level_of_next_char, bidi_move_to_visually_next):
6073 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6074 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6075 (Fkill_buffer, Fset_buffer_major_mode)
6076 (advance_to_char_boundary, Fbuffer_swap_text)
6077 (Fset_buffer_multibyte, overlays_at, overlays_in)
6078 (overlay_touches_p, struct sortvec, record_overlay_string)
6079 (overlay_strings, recenter_overlay_lists)
6080 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6081 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6082 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6083 (Foverlay_recenter, last_overlay_modification_hooks_used)
6084 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6086 (validate_region): Omit unnecessary test for b <= e,
6087 since that's guaranteed by the previous test.
6088 (adjust_overlays_for_delete): Avoid pos + length overflow.
6089 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6090 (report_overlay_modification):
6091 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6092 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6093 Omit pointer cast, which isn't needed anyway, and doesn't work
6094 after the EMACS_INT -> ptrdiff_t change.
6095 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6096 * buffer.h: Adjust decls to match defn changes elsewhere.
6097 (struct buffer_text, struct buffer):
6098 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6099 Use EMACS_INT, not int, where int might not be wide enough.
6100 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6101 not int, to avoid needless 32-bit limit on 64-bit hosts.
6102 (exec_byte_code): Use tighter memory-full test, one that checks
6103 for alloca overflow. Don't compute the address of the object just
6104 before an array, as that's not portable. Use EMACS_INT, not
6105 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6106 * callint.c (Fcall_interactively):
6107 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6108 * callproc.c (call_process_kill, Fcall_process):
6109 Don't assume pid_t fits into an Emacs fixnum.
6110 (call_process_cleanup, Fcall_process, child_setup):
6111 Don't assume pid_t fits into int.
6112 (call_process_cleanup, Fcall_process, delete_temp_file)
6113 (Fcall_process_region):
6114 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6115 (Fcall_process): Simplify handling of volatile integers.
6116 Use int, not EMACS_INT, where int will do.
6117 * casefiddle.c (casify_object, casify_region, operate_on_word)
6118 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6120 (casify_object): Avoid integer overflow when overallocating buffer.
6121 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6122 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6123 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6124 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6125 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6126 integers are now checked earlier. All uses replaced with XINT.
6127 (ccl_driver):
6128 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6129 For CCL_MapSingle, check that content and value are in int range.
6130 (ccl_driver, Fregister_code_conversion_map):
6131 Check that Vcode_version_map_vector is a vector.
6132 (resolve_symbol_ccl_program): Check that vector header is in range.
6133 Always copy the vector, so that we can check its contents reliably
6134 now rather than having to recheck each instruction as it's being
6135 executed. Check that vector words fit in 'int'.
6136 (ccl_get_compiled_code, Fregister_ccl_program)
6137 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6138 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6139 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6140 contents are in range.
6141 (Fccl_execute_on_string): Check that status is in range.
6142 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6143 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6144 Accept and return EMACS_INT, not int, because callers can pass values
6145 out of 'int' range.
6146 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6147 (multibyte_chars_in_text, parse_str_as_multibyte)
6148 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6149 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6150 (string_escape_byte8, Fget_byte):
6151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6152 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6153 avoid mishandling large integers.
6154 * character.h: Adjust decls to match defn changes elsewhere.
6155 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6156 (Ffind_charset_region):
6157 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6158 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6159 (load_charset_map_from_vector, Fdefine_charset_internal):
6160 Don't assume fixnum fits in int.
6161 (load_charset_map_from_vector, Fmap_charset_chars):
6162 Remove now-unnecessary CHECK_NATNUMs.
6163 (Fdefine_charset_internal): Check ranges here, more carefully.
6164 Don't rely on undefined behavior with signed left shift overflow.
6165 Don't assume unsigned int fits into fixnum, or that fixnum fits
6166 into unsigned int. Don't require max_code to be a valid fixnum;
6167 that's not true for gb10830 4-byte on a 32-bit host. Allow
6168 invalid_code to be a cons, for the same reason. Require code_offset
6169 to be a character. Avoid int overflow if max_char is close
6170 to INT_MAX.
6171 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6172 this is intended anyway and avoids some undefined behavior.
6173 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6174 INDEX_TO_CODE_POINT, as that's what it expects.
6175 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6176 * charset.h (DECODE_CHAR): Return int, not unsigned;
6177 this is what was intended anyway, and it avoids undefined behavior.
6178 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6179 integer-overflow issues.
6180 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6181 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6182 where the argument is EMACS_INT, and this behavior is not intended.
6183 * chartab.c (Fmake_char_table, Fset_char_table_range)
6184 (uniprop_get_decoder, uniprop_get_encoder):
6185 Don't assume fixnum fits in int.
6186 * cmds.c (move_point): New function, that does the gist of
6187 Fforward_char and Fbackward_char, but does so while checking
6188 for integer overflow more accurately.
6189 (Fforward_char, Fbackward_char): Use it.
6190 (Fforward_line, Fend_of_line, internal_self_insert)
6191 (internal_self_insert):
6192 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6193 Fix a FIXME, by checking for integer overflow when calculating
6194 target_clm and actual_clm.
6195 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6196 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6197 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6198 (coding_alloc_by_making_gap, alloc_destination)
6199 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6200 (encode_coding_utf_16, detect_coding_emacs_mule)
6201 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6202 (detect_coding_iso_2022, decode_coding_iso_2022)
6203 (encode_invocation_designation, encode_designation_at_bol)
6204 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6205 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6206 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6207 (encode_coding_ccl, encode_coding_raw_text)
6208 (detect_coding_charset, decode_coding_charset)
6209 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6210 (produce_composition, produce_charset, produce_annotation)
6211 (decode_coding, handle_composition_annotation)
6212 (handle_charset_annotation, consume_chars, decode_coding_gap)
6213 (decode_coding_object, encode_coding_object, detect_coding_system)
6214 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6215 (code_convert_region, code_convert_string)
6216 (Fdefine_coding_system_internal)
6217 (coding_set_source, coding_set_destination):
6218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6219 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6220 (Fdefine_coding_system_internal):
6221 Don't assume fixnums fit in int.
6222 (decode_coding_gap, decode_coding_object, encode_coding_object)
6223 (Fread_coding_system, Fdetect_coding_region)
6224 (Funencodable_char_position, Fcheck_coding_systems_region)
6225 (get_translation, handle_composition_annotation, consume_chars):
6226 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6227 (consume_chars): Rewrite to not calculate an address outside buffer.
6228 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6229 Don't access memory outside of the args array.
6230 (Fdefine_coding_system_internal): Check for charset-id overflow.
6231 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6232 result of ENCODE_CHAR.
6233 * coding.h: Adjust decls to match defn changes elsewhere.
6234 (struct coding_system):
6235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6236 * composite.c (get_composition_id, find_composition)
6237 (run_composition_function, update_compositions)
6238 (compose_text, composition_gstring_put_cache)
6239 (composition_gstring_p, composition_gstring_width)
6240 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6241 (composition_compute_stop_pos, composition_reseat_it)
6242 (composition_update_it, struct position_record)
6243 (find_automatic_composition, composition_adjust_point)
6244 (Fcomposition_get_gstring, Ffind_composition_internal):
6245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6246 (update_compositions):
6247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6248 * composite.h: Adjust decls to match defn changes elsewhere.
6249 (struct composition):
6250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6251 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6252 Do not attempt to compute the address of the object just before a
6253 buffer; this is not portable.
6254 (Faref, Faset):
6255 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6256 (Faset): Use int, not EMACS_INT, where int is wide enough.
6257 (Fstring_to_number): Don't assume fixnums fit in int.
6258 (Frem): Don't assume arg is nonnegative.
6259 * dbusbind.c (xd_append_arg): Check for integers out of range.
6260 (Fdbus_call_method): Don't overflow the timeout int.
6261 (extract_signed, extract_unsigned): New functions.
6262 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6263 (xd_get_connection_references): Return ptrdiff_t, not int.
6264 All uses changed.
6265 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6266 (xd_read_message_1):
6267 Use int, not unsigned, where the dbus API uses int.
6268 (Fdbus_message_internal): Don't overflow mtype.
6269 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6270 * dired.c (directory_files_internal, file_name_completion, scmp)
6271 (file_name_completion_stat):
6272 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6273 (file_name_completion): Don't overflow matchcount.
6274 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6275 * dispextern.h: Adjust decls to match defn changes elsewhere.
6276 (struct text_pos, struct glyph, struct bidi_saved_info)
6277 (struct bidi_string_data, struct bidi_it, struct composition_it)
6278 (struct it):
6279 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6280 (struct display_pos, struct composition_it, struct it):
6281 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6282 * dispnew.c (increment_matrix_positions)
6283 (increment_row_positions, mode_line_string)
6284 (marginal_area_string):
6285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6286 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6287 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6288 (duration_to_sec_usec): New function, to check for overflow better.
6289 (Fsleep_for, sit_for): Use it.
6290 * doc.c (get_doc_string, store_function_docstring):
6291 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6292 (get_doc_string, Fsnarf_documentation):
6293 Use int, not EMACS_INT, where int is wide enough.
6294 (get_doc_string):
6295 Use SAFE_ALLOCA, not alloca.
6296 Check for overflow when converting EMACS_INT to off_t.
6297 * doprnt.c (doprnt):
6298 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6299 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6300 Don't assume uid_t fits into fixnum.
6301 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6302 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6303 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6304 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6305 (general_insert_function)
6306 (Finsert_char, make_buffer_string, make_buffer_string_both)
6307 (update_buffer_properties, Fbuffer_substring)
6308 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6309 (Fsubst_char_in_region, check_translation)
6310 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6311 (transpose_markers, Ftranspose_regions):
6312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6313 (clip_to_bounds): Move to lisp.h as an inline function).
6314 (Fconstrain_to_field): Don't assume integers are nonnegative.
6315 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6316 (Fsubst_char_in_region, Fsave_restriction):
6317 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6318 (Femacs_pid): Don't assume pid_t fits into fixnum.
6319 (lo_time): Use int, not EMACS_INT, when int suffices.
6320 (lisp_time_argument): Check for usec out of range.
6321 (Fencode_time): Don't assume fixnum fits in int.
6322 (Fuser_login_name, Fuser_full_name): Signal an error
6323 if a uid argument is out of range, rather than relying on
6324 undefined behavior.
6325 (Fformat_time_string): Remove now-unnecessary check.
6326 lisp_time_argument checks for out-of-range usec now.
6327 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6328 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6329 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6330 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6331 (init_cmdargs, Fdump_emacs):
6332 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6333 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6334 the bottom (typically) 32 bits of the fixnum.
6335 * eval.c (specpdl_size, call_debugger):
6336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6337 (when_entered_debugger, Fbacktrace_debug):
6338 Don't assume fixnum can fit in int.
6339 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6340 the object just before a buffer; this is not portable.
6341 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6342 (grow_specpdl, unbind_to):
6343 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6344 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6345 (grow_specpdl): Simplify allocation by using xpalloc.
6346 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6347 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6348 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6350 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6351 (a_write, e_write):
6352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6353 (Fcopy_file, non_regular_nbytes, read_non_regular)
6354 (Finsert_file_contents):
6355 Use int, not EMACS_INT, where int is wide enough.
6356 (READ_BUF_SIZE): Verify that it fits in int.
6357 (Finsert_file_contents): Check that counts are in proper range,
6358 rather than assuming fixnums fit into ptrdiff_t etc.
6359 Don't assume fixnums fit into int.
6360 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6361 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6362 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6363 (string_char_to_byte, string_byte_to_char)
6364 (string_make_multibyte, string_to_multibyte)
6365 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6366 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6367 (substring_both, Fdelete, internal_equal, Ffillarray)
6368 (Fclear_string, mapcar1)
6369 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6370 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6371 (larger_vector, make_hash_table, maybe_resize_hash_table)
6372 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6373 (Fmaphash, secure_hash):
6374 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6375 (concat): Check for string index and length overflow.
6376 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6377 (Frequire):
6378 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6379 (larger_vector): New API (vec, incr_min, size_max) replaces old
6380 one (vec, new_size, init). This catches size overflow.
6381 INIT was removed because it was always Qnil.
6382 All callers changed.
6383 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6384 the upper bound on a hash table index size.
6385 (make_hash_table, maybe_resize_hash_table): Use it.
6386 (secure_hash): Computer start_byte and end_byte only after
6387 they're known to be in ptrdiff_t range.
6388 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6389 (Ffont_get_glyphs, Ffont_at):
6390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6391 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6392 (Flist_fonts, Fopen_font):
6393 Don't assume fixnum can fit in int.
6394 (check_gstring): Don't assume index can fit in int.
6395 (font_match_p): Check that fixnum is a character, not a nonnegative
6396 fixnum, since the later code needs to stuff it into an int.
6397 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6398 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6399 conversion overflow issues.
6400 (Fopen_font): Check for integer out of range.
6401 (Ffont_get_glyphs): Don't assume index can fit in int.
6402 * font.h: Adjust decls to match defn changes elsewhere.
6403 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6404 integer overflow.
6405 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6406 printmax_t, where ptrdiff_t is wide enough.
6407 (Finternal_char_font):
6408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6409 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6410 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6411 (Fset_frame_position, x_set_frame_parameters)
6412 (x_set_line_spacing, x_set_border_width)
6413 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6414 Check that fixnums are in proper range for system types.
6415 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6416 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6417 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6418 Use SAFE_ALLOCA_LISP, not alloca.
6419 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6420 intptr_t is wide enough.
6421 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6422 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6423 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6424 Check for fixnum out of range.
6425 * ftfont.c (ftfont_list): Don't assume index fits in int.
6426 Check that fixnums are in proper range for system types.
6427 (ftfont_shape_by_flt):
6428 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6429 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6431 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6432 Check that fixnums are in proper range for system types.
6433 * gnutls.h: Adjust decls to match defn changes elsewhere.
6434 * gtkutil.c (xg_dialog_run):
6435 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6436 (update_frame_tool_bar):
6437 Check that fixnums are in proper range for system types.
6438 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6439 (lookup_image): Check that fixnums are in range for system types.
6440 * indent.c (last_known_column, last_known_column_point):
6441 (current_column_bol_cache):
6442 (skip_invisible, current_column, check_display_width):
6443 (check_display_width, scan_for_column, current_column_1)
6444 (Findent_to, Fcurrent_indentation, position_indentation)
6445 (indented_beyond_p, Fmove_to_column, compute_motion):
6446 (Fcompute_motion, Fvertical_motion):
6447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6448 (last_known_column_modified): Use EMACS_INT, not int.
6449 (check_display_width):
6450 (Fcompute_motion):
6451 Check that fixnums and floats are in proper range for system types.
6452 (compute_motion): Don't assume index or fixnum fits in int.
6453 (compute_motion, Fcompute_motion):
6454 Use int, not EMACS_INT, when it is wide enough.
6455 (vmotion): Omit local var start_hpos that is always 0; that way
6456 we don't need to worry about overflow in expressions involving it.
6457 * indent.h: Adjust decls to match defn changes elsewhere.
6458 (struct position):
6459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6460 Use int, not EMACS_INT, where int is wide enough.
6461 Remove unused members ovstring_chars_done and tab_offset;
6462 all uses removed.
6463 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6464 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6465 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6466 (make_gap, copy_text, insert, insert_and_inherit)
6467 (insert_before_markers, insert_before_markers_and_inherit)
6468 (insert_1, count_combining_before, count_combining_after)
6469 (insert_1_both, insert_from_string)
6470 (insert_from_string_before_markers, insert_from_string_1)
6471 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6472 (adjust_after_replace, adjust_after_insert, replace_range)
6473 (replace_range_2, del_range, del_range_1, del_range_byte)
6474 (del_range_both, del_range_2, modify_region)
6475 (prepare_to_modify_buffer, signal_before_change)
6476 (signal_after_change, Fcombine_after_change_execute):
6477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6478 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6479 (balance_an_interval, split_interval_right, split_interval_left)
6480 (find_interval, next_interval, update_interval)
6481 (adjust_intervals_for_insertion, delete_node, delete_interval)
6482 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6483 (static_offset_intervals, offset_intervals)
6484 (merge_interval_right, merge_interval_left, make_new_interval)
6485 (graft_intervals_into_buffer, temp_set_point_both)
6486 (temp_set_point, set_point, adjust_for_invis_intang)
6487 (set_point_both, move_if_not_intangible, get_property_and_range)
6488 (get_local_map, copy_intervals, copy_intervals_to_string)
6489 (compare_string_intervals, set_intervals_multibyte_1):
6490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6491 * intervals.h: Adjust decls to match defn changes elsewhere.
6492 (struct interval):
6493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6494 * keyboard.c (this_command_key_count, this_single_command_key_start)
6495 (before_command_key_count, before_command_echo_length, echo_now)
6496 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6497 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6498 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6499 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6500 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6501 (last_non_minibuf_size, last_point_position, echo_truncate)
6502 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6503 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6504 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6505 (stuff_buffered_input):
6506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6507 (last_auto_save, command_loop_1, read_char):
6508 Use EMACS_INT, not int, to avoid integer overflow.
6509 (record_char): Avoid overflow in total_keys computation.
6510 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6511 * keyboard.h: Adjust decls to match defn changes elsewhere.
6512 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6513 (Fkey_description, Fdescribe_vector, Flookup_key):
6514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6515 (click_position): New function, to check that positions are in range.
6516 (Fcurrent_active_maps):
6517 (describe_command):
6518 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6519 (Faccessible_keymaps, Fkey_description):
6520 (preferred_sequence_p):
6521 Don't assume fixnum can fit into int.
6522 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6523 Check for integer overflow in size calculations.
6524 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6525 avoid mishandling large integers.
6526 * lisp.h: Adjust decls to match defn changes elsewhere.
6527 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6528 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6529 (struct Lisp_Marker):
6530 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6531 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6532 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6533 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6534 All callers changed.
6535 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6536 Assume the arg has valid form, since it always does.
6537 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6538 unsigned integer system type.
6539 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6540 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6541 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6542 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6543 (duration_to_sec_usec): New decl.
6544 * lread.c (read_from_string_index, read_from_string_index_byte)
6545 (read_from_string_limit, readchar, unreadchar, openp)
6546 (read_internal_start, read1, oblookup):
6547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6548 (Fload, readevalloop, Feval_buffer, Feval_region):
6549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6550 (openp): Check for out-of-range argument to 'access'.
6551 (read1): Use int, not EMACS_INT, where int is wide enough.
6552 Don't assume fixnum fits into int.
6553 Fix off-by-one error that can read outside a buffer.
6554 (read_filtered_event): Use duration_to_sec_usec
6555 to do proper overflow checking on durations.
6556 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6557 in size calculation.
6558 (Fexecute_kbd_macro):
6559 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6560 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6561 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6562 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6563 (set_marker_both, set_marker_restricted_both, marker_position)
6564 (marker_byte_position, Fbuffer_has_markers_at):
6565 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6566 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6567 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6568 It now merely ensures that the menu is large enough, without
6569 necessarily growing it, as this avoids some integer overflow issues.
6570 All callers changed.
6571 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6572 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6573 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6574 Use SAFE_ALLOCA_LISP, not alloca.
6575 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6576 to EMACS_INT. Check that fixnums are in proper range for system types.
6577 * minibuf.c (minibuf_prompt_width, string_to_object)
6578 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6579 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6581 (get_minibuffer, read_minibuf_unwind):
6582 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6583 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6584 this simplifies overflow checking. All callers changed.
6585 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6586 (Ftest_completion):
6587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6588 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6589 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6590 Check that fixnums are in proper range for system types.
6591 (Fx_create_frame, Fx_show_tip):
6592 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6593 * nsfont.m (ns_findfonts, nsfont_list_family):
6594 Don't assume fixnum fits in long.
6595 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6596 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6597 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6598 wide enough.
6599 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6600 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6601 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6602 (PRINTDECLARE, PRINTPREPARE):
6603 (strout, print_string):
6604 (print, print_preprocess, print_check_string_charset_prop)
6605 (print_object):
6606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6607 (PRINTDECLARE):
6608 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6610 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6611 (printchar, strout): Use xpalloc to catch size calculation overflow.
6612 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6613 (print_error_message): Use SAFE_ALLOCA, not alloca.
6614 (print_object): Use int, not EMACS_INT, where int is wide enough.
6615 (print_depth, new_backquote_output, print_number_index):
6616 Use ptrdiff_t, not int, where int might not be wide enough.
6617 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6618 (Fset_process_window_size, Fformat_network_address)
6619 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6620 (sigchld_handler):
6621 Check that fixnums are in proper range for system types.
6622 (Fsignal_process): Simplify by avoiding a goto.
6623 Check for process-ids out of pid_t range rather than relying on
6624 undefined behavior.
6625 (process_tick, update_tick): Use EMACS_INT, not int.
6626 (Fformat_network_address, read_process_output, send_process)
6627 (Fprocess_send_region, status_notify):
6628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6629 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6630 (wait_reading_process_output, read_process_output, exec_sentinel):
6631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6632 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6633 (Faccept_process_output): Use duration_to_sec_usec to do proper
6634 overflow checking on durations.
6635 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6636 Don't assume pid_t fits in int.
6637 * process.h (struct Lisp_Process): Members tick and update_tick
6638 are now of type EMACS_INT, not int.
6639 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6640 configured --with-wide-int.
6641 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6642 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6643 * search.c (looking_at_1, string_match_1):
6644 (fast_string_match, fast_c_string_match_ignore_case)
6645 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6646 (scan_newline, find_before_next_newline, search_command)
6647 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6648 (set_search_regs, wordify):
6649 (Freplace_match):
6650 (Fmatch_data):
6651 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6652 (string_match_1, search_buffer, set_search_regs):
6653 (Fmatch_data):
6654 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6655 (wordify): Check for overflow in size calculation.
6656 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6657 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6658 Check that fixnums are in proper range for system types.
6659 * sound.c (struct sound_device)
6660 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6662 (Fplay_sound_internal):
6663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6664 * syntax.c (struct lisp_parse_state, find_start_modiff)
6665 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6666 (Fparse_partial_sexp):
6667 Don't assume fixnums can fit in int.
6668 (struct lisp_parse_state, find_start_pos, find_start_value)
6669 (find_start_value_byte, find_start_begv)
6670 (update_syntax_table, char_quoted, dec_bytepos)
6671 (find_defun_start, prev_char_comend_first, back_comment):
6672 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6673 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6675 (Finternal_describe_syntax_value): Check that match_lisp is a
6676 character, not an integer, since the code stuffs it into int.
6677 (scan_words, scan_sexps_forward):
6678 Check that fixnums are in proper range for system types.
6679 (Fforward_word):
6680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6681 (scan_sexps_forward):
6682 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6683 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6684 * syntax.h: Adjust decls to match defn changes elsewhere.
6685 (struct gl_state_s):
6686 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6687 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6688 MOST_POSITIVE_FIXNUM.
6689 * sysdep.c (wait_for_termination_1, wait_for_termination)
6690 (interruptible_wait_for_termination, mkdir):
6691 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6692 (emacs_read, emacs_write):
6693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6694 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6695 and double all fit in int.
6696 * term.c (set_tty_color_mode):
6697 Check that fixnums are in proper range for system types.
6698 * termhooks.h (struct input_event):
6699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6700 * textprop.c (validate_interval_range, interval_of)
6701 (Fadd_text_properties, set_text_properties_1)
6702 (Fremove_text_properties, Fremove_list_of_text_properties)
6703 (Ftext_property_any, Ftext_property_not_all)
6704 (copy_text_properties, text_property_list, extend_property_ranges)
6705 (verify_interval_modification):
6706 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6707 (Fnext_single_char_property_change)
6708 (Fprevious_single_char_property_change):
6709 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6710 (copy_text_properties):
6711 Check for integer overflow in index calculation.
6712 * undo.c (last_boundary_position, record_point, record_insert)
6713 (record_delete, record_marker_adjustment, record_change)
6714 (record_property_change):
6715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6716 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6718 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6719 (Fx_hide_tip, Fx_file_dialog):
6720 * w32menu.c (set_frame_menubar):
6721 Use ptrdiff_t, not int, for consistency with rest of code.
6722 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6723 (select_window, Fdelete_other_windows_internal)
6724 (window_scroll_pixel_based, window_scroll_line_based)
6725 (Frecenter, Fset_window_configuration):
6726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6727 (Fset_window_hscroll, run_window_configuration_change_hook)
6728 (set_window_buffer, temp_output_buffer_show, scroll_command)
6729 (Fscroll_other_window, Frecenter):
6730 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6731 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6732 Don't assume fixnum fits in int.
6733 (Fset_window_scroll_bars):
6734 Check that fixnums are in proper range for system types.
6735 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6736 (string_pos, c_string_pos, number_of_chars, init_iterator)
6737 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6738 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6739 (compute_display_string_end, handle_face_prop)
6740 (face_before_or_after_it_pos, handle_invisible_prop)
6741 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6742 (display_prop_intangible_p, string_buffer_position_lim)
6743 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6744 (get_overlay_strings_1, get_overlay_strings)
6745 (iterate_out_of_display_property, forward_to_next_line_start)
6746 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6747 (get_next_display_element, set_iterator_to_next)
6748 (get_visually_first_element, compute_stop_pos_backwards)
6749 (handle_stop_backwards, next_element_from_buffer)
6750 (move_it_in_display_line_to, move_it_in_display_line)
6751 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6752 (add_to_log, message_dolog, message_log_check_duplicate)
6753 (message2, message2_nolog, message3, message3_nolog
6754 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6755 (current_message_1, truncate_echo_area, truncate_message_1)
6756 (set_message, set_message_1, store_mode_line_noprop)
6757 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6758 (text_outside_line_unchanged_p, check_point_in_composition)
6759 (reconsider_clip_changes)
6760 (redisplay_internal, set_cursor_from_row, try_scrolling)
6761 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6762 (redisplay_window, find_last_unchanged_at_beg_row)
6763 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6764 (trailing_whitespace_p, find_row_edges, display_line)
6765 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6766 (display_mode_element, store_mode_line_string)
6767 (pint2str, pint2hrstr, decode_mode_spec)
6768 (display_count_lines, display_string, draw_glyphs)
6769 (x_produce_glyphs, x_insert_glyphs)
6770 (rows_from_pos_range, mouse_face_from_buffer_pos)
6771 (fast_find_string_pos, mouse_face_from_string_pos)
6772 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6773 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6774 (safe_call, init_from_display_pos, handle_fontified_prop)
6775 (handle_single_display_spec, load_overlay_strings)
6776 (with_echo_area_buffer, setup_echo_area_for_printing)
6777 (display_echo_area, echo_area_display)
6778 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6779 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6780 (redisplay_window, dump_glyph_row, display_mode_line)
6781 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6782 (handle_display_spec, display_prop_string_p):
6783 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6784 (handle_single_display_spec, build_desired_tool_bar_string)
6785 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6786 (get_specified_cursor_type):
6787 Check that fixnums are in proper range for system types.
6788 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6789 (Flookup_image_map):
6790 Don't assume fixnums fit in int.
6791 (compare_overlay_entries):
6792 Avoid mishandling comparisons due to subtraction overflow.
6793 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6794 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6795 (handle_tool_bar_click):
6796 Use int, not unsigned, since we prefer signed and the signedness
6797 doesn't matter here.
6798 (get_next_display_element, next_element_from_display_vector):
6799 Use int, not EMACS_INT, when int is wide enough.
6800 (start_hourglass): Use duration_to_sec_usec to do proper
6801 overflow checking on durations.
6802 * xfaces.c (Fbitmap_spec_p):
6803 Check that fixnums are in proper range for system types.
6804 (compare_fonts_by_sort_order):
6805 Avoid mishandling comparisons due to subtraction overflow.
6806 (Fx_family_fonts, realize_basic_faces):
6807 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6808 (Fx_family_fonts):
6809 Don't assume fixnum fits in int.
6810 Use SAFE_ALLOCA_LISP, not alloca.
6811 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6812 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6813 (face_at_buffer_position, face_for_overlay_string)
6814 (face_at_string_position):
6815 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6816 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6817 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6818 (Fx_show_tip):
6819 Check that fixnums are in proper range for system types.
6820 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6821 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6822 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6823 (Fx_change_window_property): Don't assume fixnums fit in int.
6824 * xfont.c (xfont_chars_supported):
6825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6826 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6827 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6829 * xml.c (parse_region):
6830 * xrdb.c (magic_file_p):
6831 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6832 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6833 (x_get_local_selection, x_reply_selection_request)
6834 (x_handle_selection_request, wait_for_property_change):
6835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6836 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6837 short is wide enough.
6838 (x_send_client_event): Don't assume fixnum fits in int.
6839 * xterm.c (x_x_to_emacs_modifiers):
6840 Don't assume EMACS_INT overflows nicely into int.
6841 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6842 may come from Lisp.
6843 (handle_one_xevent): NATNUMP can eval its arg twice.
6844 (x_connection_closed):
6845 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6846 * xterm.h: Adjust decls to match defn changes elsewhere.
6847 (struct scroll_bar): Use struct vectorlike_header
6848 rather than rolling our own approximation.
6849 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6850
6851 2012-05-25 Glenn Morris <rgm@gnu.org>
6852
6853 * lisp.mk (lisp): Update for more files being compiled now.
6854
6855 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6856
6857 * lread.c: Remove `read_pure' which makes no difference.
6858 (read_pure): Remove var.
6859 (unreadpure): Remove function.
6860 (readevalloop): Don't call read_list with -1 flag.
6861 (read1, read_vector): Don't test read_pure any more.
6862 (read_list): Simplify.
6863
6864 * fileio.c, character.h: Minor style tweaks.
6865
6866 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6867
6868 * window.h (clip_changed): Remove useless declaration.
6869
6870 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6871
6872 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6873 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6874
6875 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6876
6877 Remove src/m/*.
6878 This directory predates autoconf and is no longer needed nowadays.
6879 Move its few remaining bits of functionality to where they're needed.
6880 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6881 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6882 * m/template.h: Remove.
6883 * Makefile.in (M_FILE): Remove. All uses removed.
6884 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6885 * lisp.h (USE_LSB_TAG):
6886 * mem-limits.h (EXCEEDS_LISP_PTR):
6887 Use VAL_MAX, not VALBITS, in #if.
6888 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6889 (EMACS_UINT): Define unconditionally now.
6890 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6891 (BITS_PER_EMACS_INT): New constants, replacing
6892 what used to be in config.h, but not useful in #if.
6893 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6894 define them any more.
6895 (VAL_MAX): New macro.
6896 (VALMASK): Use it.
6897 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6898 BITS_PER_EMACS_INT, in #if.
6899 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6900 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6901 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6902 * s/ms-w32.h (DATA_START):
6903 Move here from removed file m/intel386.h.
6904 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6905 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6906
6907 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6908
6909 Assume C89 or later.
6910 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6911 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6912 (xrealloc):
6913 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6914 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6915 * textprop.c, tparam.c (NULL): Remove.
6916 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6917 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6918 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6919 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6920 * xterm.c (input_signal_count): Assume volatile works.
6921
6922 2012-05-21 Ken Brown <kbrown@cornell.edu>
6923
6924 * xgselect.c (xg_select): Fix first argument in call to 'select'
6925 (bug#11508).
6926
6927 2012-05-20 Ken Brown <kbrown@cornell.edu>
6928
6929 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6930 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6931
6932 2012-05-19 Ken Brown <kbrown@cornell.edu>
6933
6934 * xfns.c (x_in_use): Remove `static' qualifier.
6935 * xterm.h (x_in_use): Declare.
6936 * xgselect.c: Include xterm.h.
6937 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6938 and `display_arg' (bug#9754).
6939
6940 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6941
6942 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6943
6944 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6945 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6946
6947 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6948
6949 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6950
6951 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6952 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6953
6954 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6955 reference to image_cache->refcount.
6956 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6957
6958 2012-05-17 Juri Linkov <juri@jurta.org>
6959
6960 * search.c (Fword_search_regexp, Fword_search_backward)
6961 (Fword_search_forward, Fword_search_backward_lax)
6962 (Fword_search_forward_lax): Move functions to isearch.el
6963 (bug#10145, bug#11381).
6964
6965 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6966
6967 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6968
6969 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6970
6971 * lread.c (init_obarray): Declare Qt and Qnil as special.
6972
6973 2012-05-14 Glenn Morris <rgm@gnu.org>
6974
6975 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6976 Put "libexec" before "bin", for the sake of init_callproc_1.
6977
6978 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6979
6980 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6981
6982 * unexaix.c: Port to more-recent AIX compilers.
6983 (report_error, report_error_1, make_hdr, copy_sym)
6984 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6985 Make arguments const char *, not char *, to avoid violations of C
6986 standard and to fix some AIX warnings reported by Gilles Pion.
6987
6988 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6989
6990 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6991 already have overlays loaded.
6992 (handle_single_display_spec): Before returning without displaying
6993 fringe bitmap, synchronize the bidi iterator with the main display
6994 iterator, by calling iterate_out_of_display_property.
6995 (iterate_out_of_display_property): Detect buffer iteration by
6996 testing that it->string is a Lisp string.
6997 (get_next_display_element): When the current object is exhausted,
6998 and there's something on it->stack, call set_iterator_to_next to
6999 proceed with what's on the stack, instead of returning zero.
7000 (set_iterator_to_next): If called at the end of a Lisp string,
7001 proceed to consider_string_end without incrementing string
7002 position. Don't increment display vector index past the end of
7003 the display vector. (Bug#11417)
7004 (pos_visible_p): Don't report a position visible when move_it_to
7005 stopped at the last line of window, which happens to be scanned
7006 backwards by the bidi iteration. (Bug#11464)
7007
7008 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7009
7010 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7011 and right-margin display specs even if the spec is invalid or we
7012 are on a TTY, and thus unable to display on the fringes.
7013 That's because the text with the property will not be displayed anyway,
7014 so we need to signal to the caller that this is a "replacing"
7015 display spec. This fixes display when the spec is invalid or we
7016 are on a TTY.
7017
7018 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7019
7020 * unexaix.c (make_hdr): Fix typo in prototype.
7021 This bug broke the build on AIX. Problem reported by Gilles Pion.
7022
7023 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7024
7025 * keyboard.c (kbd_buffer_get_event): Read special events also in
7026 batch mode. (Bug#11415)
7027
7028 2012-05-12 Glenn Morris <rgm@gnu.org>
7029
7030 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7031
7032 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7033
7034 * lisp.mk (lisp): Add newcomment.elc.
7035
7036 2012-05-12 Glenn Morris <rgm@gnu.org>
7037
7038 * Makefile.in (MKDIR_P): New, set by configure.
7039 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7040
7041 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7042
7043 Remove unused function hourglass_started.
7044 * dispextern.h (hourglass_started):
7045 * w32fns.c (hourglass_started):
7046 * xdisp.c (hourglass_started): Remove.
7047
7048 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7049
7050 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7051 Update dependencies.
7052
7053 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7054
7055 * xgselect.c (xg_select): Put maxfds+1 into a var.
7056 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7057
7058 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7059
7060 2012-05-10 Dave Abrahams <dave@boostpro.com>
7061
7062 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7063 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7064
7065 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7066
7067 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7068 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7069 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7070 Initialize xd_registered_buses.
7071
7072 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7073
7074 Untag more efficiently if USE_LSB_TAG.
7075 This is based on a proposal by YAMAMOTO Mitsuharu in
7076 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7077 For an admittedly artificial (nth 8000 longlist) benchmark on
7078 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7079 Emacs's overall text size by 1%.
7080 * lisp.h (XUNTAG): New macro.
7081 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7082 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7083 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7084 * eval.c (Fautoload):
7085 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7086 * frame.h (XFRAME): Use XUNTAG.
7087
7088 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7089 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7090 Remove unportable assumptions about print widths of types like
7091 dbus_uint32_t.
7092 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7093 intptr_t when converting between pointer and integer, to avoid GCC
7094 warnings about wrong width.
7095
7096 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7097
7098 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7099 stack for each reader_thread, instead of defaulting to 8MB
7100 determined by the linker. This avoids failures in creating
7101 subprocesses on Windows 7, see the discussion in this thread:
7102 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7103
7104 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7105
7106 Fix up display of the *Minibuf-0* buffer in the mini window.
7107 * keyboard.c (read_char): Don't clear the echo area if there's no
7108 message to clear.
7109 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7110 contents of *Minibuf-0*) if there's no message displayed in its stead.
7111
7112 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7113
7114 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7115 batch mode.
7116
7117 2012-05-06 Chong Yidong <cyd@gnu.org>
7118
7119 * lisp.mk (lisp): Update.
7120
7121 2012-05-05 Jim Meyering <meyering@redhat.com>
7122
7123 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7124
7125 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7126
7127 * data.c (PUT_ERROR): New macro.
7128 (syms_of_data): Use it. Add new error type `user-error'.
7129 * undo.c (user_error): New function.
7130 (Fprimitive_undo): Use it.
7131 * print.c (print_error_message): Adjust print style for `user-error'.
7132 * keyboard.c (user_error): New function.
7133 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7134
7135 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7136
7137 Do not limit current-time-string to years 1000..9999.
7138 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7139 (Fcurrent_time_string): Support any year that is supported by the
7140 underlying localtime representation. Don't use asctime, as it
7141 has undefined behavior for years outside the range -999..9999.
7142
7143 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7144
7145 Fix race conditions involving setenv, gmtime, localtime, asctime.
7146 Without this fix, interrupts could mess up code that uses these
7147 nonreentrant functions, since setting TZ invalidates existing
7148 tm_zone or tzname values, and since most of these functions return
7149 pointers to static storage.
7150 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7151 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7152 Grow the critical sections to include not just invoking
7153 localtime/gmtime, but also accessing these functions' results
7154 including their tm_zone values if any, and any related TZ setting.
7155 (format_time_string): Last arg is now struct tm *, not struct tm **,
7156 so that the struct tm is saved in the critical section.
7157 All callers changed. Simplify allocation of initial buffer, partly
7158 motivated by the fact that memory allocation needs to be outside
7159 the critical section.
7160
7161 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7162
7163 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7164 with RESET_INTERVAL.
7165
7166 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7167 Remove duplicated buffer name initialization.
7168
7169 2012-05-02 Jim Meyering <jim@meyering.net>
7170
7171 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7172
7173 * xfns.c (x_window): Use xstrdup (Bug#11375).
7174
7175 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7176
7177 * xdisp.c (pos_visible_p): If already at a newline from the
7178 display string before the 'while' loop, don't walk back the glyphs
7179 from it3.glyph_row. Solves assertion violation when the display
7180 string begins with a newline (egg.el). (Bug#11367)
7181
7182 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7183
7184 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7185 Move to simple.el.
7186
7187 2012-05-01 Glenn Morris <rgm@gnu.org>
7188
7189 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7190 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7191 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7192 All were removed before 23.1.
7193
7194 * dispnew.c: Remove HAVE_LIBNCURSES test;
7195 it is always true on relevant platforms.
7196
7197 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7198 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7199
7200 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7201
7202 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7203
7204 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7205 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7206 Remove.
7207
7208 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7209
7210 Do not avoid creating empty evaporating overlays (Bug#9642).
7211 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7212 That is, do not delete an evaporating overlay if it becomes
7213 empty after its bounds are adjusted to fit within its buffer.
7214 This fix caused other problems, and I'm reverting it until we get
7215 to the bottom of them.
7216
7217 2012-04-27 Chong Yidong <cyd@gnu.org>
7218
7219 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7220
7221 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7222
7223 * xdisp.c (pos_visible_p): If the window start position is beyond
7224 ZV, start the display from buffer beginning. Prevents assertion
7225 violation in init_iterator when the minibuffer window is scrolled
7226 via the scroll bar.
7227
7228 * window.c (window_scroll_pixel_based): Likewise.
7229
7230 2012-04-27 Chong Yidong <cyd@gnu.org>
7231
7232 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7233
7234 2012-04-27 Glenn Morris <rgm@gnu.org>
7235
7236 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7237 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7238
7239 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7240
7241 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7242 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7243
7244 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7245
7246 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7247 display element, check also the underlying string or buffer
7248 character. (Bug#11341)
7249
7250 * w32menu.c: Include w32heap.h.
7251 (add_menu_item): If the call to AppendMenuW (via
7252 unicode_append_menu) fails, disable Unicode menus only if we are
7253 running on Windows 9X/Me.
7254
7255 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7256
7257 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7258 (xgetint): Add missing shift for LSB tags.
7259
7260 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7261
7262 * keyboard.c (read_char): Don't wipe echo area for select window
7263 events: These might get delayed via `mouse-autoselect-window'
7264 (Bug#11304).
7265
7266 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7267
7268 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7269 manipulation of :loaded-from data.
7270
7271 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7272
7273 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7274 now a cons (bug#11311).
7275
7276 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7277
7278 Do not create empty overlays with the evaporate property (Bug#9642).
7279 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7280 if it becomes empty after its bounds are adjusted to fit within
7281 its buffer. Without this fix, in a nonempty buffer (let ((o
7282 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7283 yields an empty overlay that has the evaporate property, which is
7284 not supposed to happen.
7285
7286 Fix minor GTK3 problems found by static checking.
7287 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7288 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7289 (struct _EmacsFixedClass, emacs_fixed_get_type):
7290 Move decls here from emacsgtkfixed.h, since they needn't be public.
7291 (emacs_fixed_get_type): Now static.
7292 (emacs_fixed_class_init): Omit unused local.
7293 (emacs_fixed_child_type): Remove; unused.
7294 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7295 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7296 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7297 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7298 (EMACS_FIXED_GET_CLASS): Remove; unused.
7299 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7300
7301 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7302 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7303
7304 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7305
7306 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7307 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7308 (__malloc_size_t, __malloc_ptrdiff_t):
7309 Remove. All uses removed, replaced by the definiens if needed,
7310 since we can assume C89 or better now.
7311 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7312 (protect_malloc_state, align, get_contiguous_space)
7313 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7314 (malloc_atfork_handler_child, malloc_enable_thread)
7315 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7316 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7317 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7318 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7319 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7320 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7321 Define using prototypes, not old style.
7322 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7323 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7324 (align): Don't assume that signed integer overflow wraps around.
7325 Omit unused local var.
7326 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7327 (_free_internal_nolock, memalign, mallochook, reallochook):
7328 Omit no-longer-needed casts.
7329 (valloc): Use getpagesize, not __getpagesize.
7330 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7331 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7332
7333 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7334
7335 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7336
7337 Move functions from C to Lisp. Make non-blocking method calls
7338 the default. Implement further D-Bus standard interfaces.
7339
7340 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7341 (QCdbus_request_name_allow_replacement)
7342 (QCdbus_request_name_replace_existing)
7343 (QCdbus_request_name_do_not_queue)
7344 (QCdbus_request_name_reply_primary_owner)
7345 (QCdbus_request_name_reply_in_queue)
7346 (QCdbus_request_name_reply_exists)
7347 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7348 (QCdbus_registered_serial, QCdbus_registered_method)
7349 (QCdbus_registered_signal): New Lisp objects.
7350 (XD_DEBUG_MESSAGE): Use sizeof.
7351 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7352 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7353 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7354 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7355 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7356 (xd_signature, xd_append_arg): Allow float for integer types.
7357 (xd_get_connection_references): New function.
7358 (xd_get_connection_address): Rename from xd_initialize.
7359 Return cached address.
7360 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7361 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7362 level.
7363 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7364 Return number of refcounts.
7365 (Fdbus_get_unique_name): Make stronger parameter check.
7366 (Fdbus_message_internal): New defun.
7367 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7368 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7369 (Fdbus_send_signal, Fdbus_register_service)
7370 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7371 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7372 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7373 (Vdbus_compiled_version, Vdbus_runtime_version)
7374 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7375 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7376 (Vdbus_message_type_signal): New defvars.
7377 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7378 Adapt docstring.
7379
7380 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7381
7382 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7383 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7384 Do not assume ptrdiff_t is the same width as 'int'.
7385
7386 * alloc.c: Handle unusual debugging option combinations.
7387 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7388 since the two debugging options are incompatible.
7389 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7390 is defined.
7391 (mem_init, mem_insert, mem_insert_fixup):
7392 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7393 (NEED_MEM_INSERT): Remove; no longer needed.
7394
7395 2012-04-22 Leo Liu <sdl.web@gmail.com>
7396
7397 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7398
7399 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7400
7401 * sysdep.c [__FreeBSD__]: Minor cleanups.
7402 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7403 Use Emacs indenting style more consistently. Avoid some casts.
7404 Use 'double' consistently rather than mixing 'float' and 'double'.
7405
7406 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7407
7408 * sysdep.c (list_system_processes, system_process_attributes):
7409 Add implementation for FreeBSD (Bug#5243).
7410
7411 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7412
7413 * lisp.mk (lisp): Update.
7414
7415 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7416
7417 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7418 It is never used otherwise.
7419
7420 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7421
7422 * print.c (print_preprocess): Only check print_depth if print-circle
7423 is nil.
7424 (print_object): Check for cycles even when print-circle is nil and
7425 print-gensym is t, but only check print_depth if print-circle is nil.
7426
7427 2012-04-20 Chong Yidong <cyd@gnu.org>
7428
7429 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7430 set the status to "failed" and ensure that sentinel is run.
7431
7432 2012-04-20 Glenn Morris <rgm@gnu.org>
7433
7434 * process.c (Fset_process_inherit_coding_system_flag)
7435 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7436 (Fmake_network_process, Fmake_serial_process): Doc fix.
7437
7438 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7439
7440 * xdisp.c (string_buffer_position_lim): Limit starting position to
7441 BEGV.
7442 (set_cursor_from_row): If called for a mode-line or header-line
7443 row, return zero immediately.
7444 (try_cursor_movement): If inside continuation line, don't back up
7445 farther than the first row after the header line, if any.
7446 Don't consider the header-line row as "partially visible", even if
7447 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7448
7449 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7450
7451 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7452 (bug#11238).
7453
7454 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7455 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7456
7457 configure: new option --enable-gcc-warnings (Bug#11207)
7458 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7459 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7460 (ALL_CFLAGS): Use new macros rather than old.
7461 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7462 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7463 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7464 -Wunused-result, -Wunused-variable. This should go away once
7465 the Emacs and Gnulib regex code is merged.
7466 (xmalloc, xrealloc): Now static.
7467
7468 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7469
7470 * dired.c (Fsystem_groups): Remove unused local.
7471
7472 2012-04-17 Glenn Morris <rgm@gnu.org>
7473
7474 * dired.c (Fsystem_users): Doc fix.
7475
7476 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7477
7478 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7479 (syms_of_dired): Add them.
7480
7481 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7482
7483 Fix minor alloc.c problems found by static checking.
7484 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7485 New extern decls, to avoid calling undeclared functions.
7486 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7487 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7488 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7489 (NEED_MEM_INSERT): New macro.
7490 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7491 Remove one incorrect comment and fix another.
7492
7493 Fix minor ralloc.c problems found by static checking.
7494 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7495 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7496 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7497 (r_alloc_sbrk): Now static.
7498
7499 Improve ralloc.c interface checking.
7500 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7501 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7502 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7503 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7504 [REL_ALLOC]: ... to here, to check interface.
7505 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7506 Remove decls. This fixes an "It stinks!".
7507
7508 * alloc.c (which_symbols): Fix alignment issue / type clash.
7509
7510 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7511
7512 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7513 (struct Lisp_Misc_Any): Likewise.
7514 (struct Lisp_Free): Likewise.
7515 * alloc.c (union aligned_Lisp_Symbol): Define.
7516 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7517 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7518 (union aligned_Lisp_Misc): Define.
7519 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7520 aligned_Lisp_Misc instead of union Lisp_Misc.
7521 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7522
7523 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7524
7525 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7526 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7527 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7528 * s/netbsd.h, s/sol2-6.h:
7529 Remove definition of GC_MARK_STACK, since the default now works.
7530 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7531 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7532 no longer the default.
7533 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7534
7535 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7536
7537 * lread.c (lisp_file_lexically_bound_p):
7538 Fix hang at ";-*-\n" (bug#11238).
7539
7540 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7541
7542 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7543 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7544
7545 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7546
7547 * nsterm.m (constrainFrameRect): Always constrain when there is only
7548 one screen (Bug#10962).
7549
7550 2012-04-13 Ken Brown <kbrown@cornell.edu>
7551
7552 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7553
7554 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7555
7556 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7557
7558 2012-04-11 Daniel Colascione <dancol@dancol.org>
7559
7560 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7561 against is gone. It's better to use vfork now so that when Cygwin
7562 gains a new, working vfork, we use it automatically (bug#10398).
7563
7564 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7565
7566 * window.c (save_window_save): Obey window-point-insertion-type.
7567
7568 2012-04-11 Glenn Morris <rgm@gnu.org>
7569
7570 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7571
7572 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7573
7574 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7575
7576 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7577
7578 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7579 (force_quit_count): New var.
7580 (handle_interrupt): Use it.
7581
7582 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7583
7584 * w32.c (w32_delayed_load): Record the full path of the library
7585 being loaded (bug#10424).
7586
7587 2012-04-09 Glenn Morris <rgm@gnu.org>
7588
7589 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7590 not just in the obarray, before snarfing them. (Bug#11036)
7591
7592 * Makefile.in ($(leimdir)/leim-list.el):
7593 Pass EMACS rather than BUILT_EMACS.
7594
7595 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7596
7597 * process.c (make_process):
7598 * process.h: Add integer `gnutls_handshakes_tried' member to
7599 process struct.
7600
7601 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7602 Add convenience `GNUTLS_LOG2i' macro.
7603
7604 * gnutls.c (gnutls_log_function2i): Convenience log function.
7605 (emacs_gnutls_read): Use new log functions,
7606 `gnutls_handshakes_tried' process member, and
7607 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7608 attempts per process (connection).
7609
7610 2012-04-09 Chong Yidong <cyd@gnu.org>
7611
7612 * eval.c (Fuser_variable_p, user_variable_p_eh)
7613 (lisp_indirect_variable): Functions deleted.
7614 (Fdefvar): Caller changed.
7615
7616 * callint.c (Finteractive, Fcall_interactively):
7617 * minibuf.c (Fread_variable): Callers changed.
7618
7619 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7620
7621 * xdisp.c (set_cursor_from_row): If the display string appears in
7622 the buffer at position that is closer to point than the position
7623 after the display string, display the cursor on the first glyph of
7624 the display string. Fixes cursor display when a 'display' text
7625 property immediately follows invisible text. (Bug#11094)
7626
7627 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7628
7629 composite.c: use 'double' consistently
7630 * composite.c (get_composition_id): Use 'double' consistently
7631 instead of converting 'float' to 'double' and vice versa; this is
7632 easier to understand and avoids a GCC warning.
7633
7634 2012-04-09 Glenn Morris <rgm@gnu.org>
7635
7636 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7637 preparation for dumping it with emacs. (Bug#4789)
7638 (leimdir): New variable.
7639 ($(leimdir)/leim-list.el): New rule.
7640 (emacs$(EXEEXT)): Depend on leim-list.el.
7641
7642 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7643 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7644 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7645
7646 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7647
7648 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7649 proper alignment.
7650
7651 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7652
7653 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7654 Remove unused local variable.
7655
7656 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7657
7658 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7659 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7660 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7661 objects, as mark_maybe_pointer will catch them otherwise.
7662 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7663 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7664
7665 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7666
7667 Fix typo that broke non-Windows builds.
7668 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7669
7670 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7671
7672 Support building on MS-Windows with libxml2.
7673
7674 * makefile.w32-in (OBJ2): Add xml.$(O).
7675 (GLOBAL_SOURCES): Add xml.c.
7676 ($(BLD)/xml.$(O)): New dependency list.
7677
7678 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7679 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7680 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7681 [!WINDOWSNT]: New macros.
7682 (init_libxml2_functions, libxml2_loaded_p): New functions.
7683 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7684 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7685 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7686 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7687 linked in).
7688 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7689 Call init_libxml2_functions before calling libxml2 functions.
7690 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7691
7692 * emacs.c: Don't include libxml/parser.h.
7693 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7694 xmlCleanupParser directly.
7695
7696 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7697
7698 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7699
7700 * indent.c (Fvertical_motion): If there is a display string at
7701 point, use it.vpos to compute how many lines to backtrack after
7702 move_it_to point. (Bug#11133)
7703
7704 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7705
7706 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7707 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7708 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7709 macros related to unification of CJK characters. For the details,
7710 see the discussion following the message here:
7711 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7712
7713 2012-04-04 Chong Yidong <cyd@gnu.org>
7714
7715 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7716
7717 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7718
7719 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7720 instead of alloca. (Bug#11138)
7721
7722 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7723
7724 * w32menu.c (is_simple_dialog): Properly check lisp types.
7725 (Bug#11141)
7726
7727 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7728
7729 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7730 position we get to after a call to move_it_to fails the
7731 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7732 only if we wind up in a string from display property. (Bug#11063)
7733
7734 * window.c (Fdelete_other_windows_internal): Invalidate the row
7735 and column information about mouse highlight, so that redisplay
7736 restores it after reallocating the glyph matrices. (Bug#7464)
7737
7738 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7739 string comes from a `display' text property, use the buffer
7740 position of that property as if we actually saw that position in
7741 the row's glyphs.
7742 (move_it_by_lines): Remove the assertion that
7743 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7744 violated when there's a before-string at the beginning of a line.
7745 (Bug#11063)
7746
7747 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7748
7749 * xdisp.c (append_space_for_newline): If the default face was
7750 remapped, use the remapped face for the appended newline.
7751 (extend_face_to_end_of_line): Use the remapped default face for
7752 extending the face to the end of the line.
7753 (display_line): Call extend_face_to_end_of_line when the default
7754 face was remapped. (Bug#11068)
7755
7756 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7757
7758 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7759
7760 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7761
7762 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7763
7764 2012-03-27 Glenn Morris <rgm@gnu.org>
7765
7766 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7767 Doc fixes.
7768
7769 2012-03-26 Kenichi Handa <handa@m17n.org>
7770
7771 * dispextern.h (struct glyph): Fix previous change. Change the
7772 bit length of glyphless.ch to 25 (Bug#11082).
7773
7774 2012-03-26 Chong Yidong <cyd@gnu.org>
7775
7776 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7777 (command_loop_1): Use it; inhibit selection update for
7778 handle-select-window too (Bug#8996).
7779
7780 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7781
7782 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7783
7784 2012-03-25 Kenichi Handa <handa@m17n.org>
7785
7786 * dispextern.h (struct glyph): Change the bit length of
7787 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7788
7789 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7790
7791 * s/ms-w32.h (tzname): Include time.h before redirecting to
7792 _tzname. Fixes the MSVC build. (Bug#9960)
7793
7794 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7795
7796 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7797 characters.
7798
7799 * xterm.c (XTread_socket): Only modify handling_signal if
7800 !SYNC_INPUT. (Bug#11080)
7801
7802 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7803
7804 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7805 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7806 when fetching a multibyte character consumes more bytes than
7807 CHAR_BYTES returns, due to unification of CJK characters in
7808 string_char. (Bug#11073)
7809
7810 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7811
7812 * process.c (wait_reading_process_output): Handle pty disconnect
7813 by refraining from sending oneself a SIGCHLD (bug#10933).
7814
7815 2012-03-22 Chong Yidong <cyd@gnu.org>
7816
7817 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7818
7819 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7820 Mark string as coming from a prefix property.
7821 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7822 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7823
7824 2012-03-21 Chong Yidong <cyd@gnu.org>
7825
7826 * xfaces.c (Vface_remapping_alist): Doc fix.
7827
7828 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7829
7830 * w32proc.c (Fw32_set_console_codepage)
7831 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7832 Doc fixes.
7833
7834 2012-03-20 Chong Yidong <cyd@gnu.org>
7835
7836 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7837 to reflect default non-nil value of redisplay-dont-pause.
7838
7839 2012-03-19 Kenichi Handa <handa@m17n.org>
7840
7841 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7842 it fit in a valid range (Bug#11003).
7843
7844 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7845
7846 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7847 that is not from display property, accept the row as a "cursor
7848 row" if one of the string's character has a non-nil `cursor'
7849 property. Fixes cursor positioning when there are newlines in
7850 overlay strings, e.g. in icomplete.el. (Bug#11035)
7851
7852 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7853
7854 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7855
7856 2012-03-12 Chong Yidong <cyd@gnu.org>
7857
7858 * eval.c (inhibit_lisp_code): Rename from
7859 inhibit_window_configuration_change_hook; move from window.c.
7860
7861 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7862 * window.c (run_window_configuration_change_hook)
7863 (syms_of_window): Callers changed.
7864
7865 2012-03-11 Chong Yidong <cyd@gnu.org>
7866
7867 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7868
7869 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7870
7871 2012-03-10 Chong Yidong <cyd@gnu.org>
7872
7873 * frame.c (other_visible_frames): Don't assume the selected frame
7874 is visible (Bug#10955).
7875
7876 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7877
7878 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7879
7880 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7881
7882 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7883 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7884 zero (Bug#10954).
7885
7886 2012-03-03 Glenn Morris <rgm@gnu.org>
7887
7888 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7889
7890 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7891
7892 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7893 position past the first glyph_row that ends at ZV. (Bug#10902)
7894 (redisplay_window, next_element_from_string): Fix typos in
7895 comments.
7896 (redisplay_window): Pass to move_it_vertically the margin in
7897 pixels, not in screen lines.
7898
7899 2012-03-02 Glenn Morris <rgm@gnu.org>
7900
7901 * buffer.c (buffer-list-update-hook): Doc fix.
7902
7903 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7904
7905 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7906 push_it before setting up the iterator for the first overlay
7907 string, even if we have an empty string loaded.
7908 (next_overlay_string): If there's an empty string on the iterator
7909 stack, pop the stack. (Bug#10903)
7910
7911 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7912
7913 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7914 Suggested by Stefan Monnier in
7915 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7916 * alloc.c (widen_to_Lisp_Object): New static function.
7917 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7918 and widening them to Lisp_Objects. This would work even if
7919 USE_LSB_TAG is defined and wide integers are used, which might
7920 happen in a future version of Emacs.
7921
7922 2012-02-25 Chong Yidong <cyd@gnu.org>
7923
7924 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7925 Doc fix.
7926
7927 * xselect.c (Fx_selection_exists_p): Doc fix.
7928 (x_clipboard_manager_save_all): Print an informative message
7929 before saving to clipboard manager.
7930
7931 2012-02-24 Chong Yidong <cyd@gnu.org>
7932
7933 * keyboard.c (process_special_events): Handle all X selection
7934 requests in kbd_buffer, not just the next one (Bug#8869).
7935
7936 2012-02-23 Chong Yidong <cyd@gnu.org>
7937
7938 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7939 call when setting menu-bar-lines and tool-bar-lines parameters.
7940 (unwind_create_frame_1): New helper function.
7941
7942 * window.c (inhibit_window_configuration_change_hook): New var.
7943 (run_window_configuration_change_hook): Obey it.
7944 (syms_of_window): Initialize it.
7945
7946 2012-02-22 Chong Yidong <cyd@gnu.org>
7947
7948 * xterm.c (x_draw_image_relief): Add missing type check for
7949 Vtool_bar_button_margin (Bug#10743).
7950
7951 2012-02-21 Chong Yidong <cyd@gnu.org>
7952
7953 * fileio.c (Vfile_name_handler_alist): Doc fix.
7954
7955 * buffer.c (Fget_file_buffer): Protect against invalid file
7956 handler return value.
7957
7958 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7959
7960 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7961 when computing $valmask.
7962
7963 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7964 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7965 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7966 It's useless in that case, and it can cause problems on hosts
7967 that allocate halves of EMACS_INT values separately.
7968 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7969 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7970 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7971 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7972 it avoids undefined behavior on hosts where shifting right by more
7973 than the word width has undefined behavior.
7974
7975 2012-02-19 Chong Yidong <cyd@gnu.org>
7976
7977 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7978 (Funhandled_file_name_directory, Ffile_name_as_directory)
7979 (Fdirectory_file_name, Fexpand_file_name)
7980 (Fsubstitute_in_file_name): Protect against invalid file handler
7981 return values (Bug#10845).
7982
7983 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7984
7985 * .gdbinit (pitx): Fix incorrect references to fields of the
7986 iterator stack.
7987
7988 2012-02-17 Chong Yidong <cyd@gnu.org>
7989
7990 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7991
7992 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7993
7994 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7995 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7996
7997 2012-02-15 Chong Yidong <cyd@gnu.org>
7998
7999 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8000 marked as special. Also, starting docstrings with * is obsolete.
8001
8002 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8003
8004 * gnutls.c (emacs_gnutls_write): Fix last change.
8005
8006 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8007
8008 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8009 send_process.
8010
8011 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8012
8013 * keymap.c (Fsingle_key_description): Handle char ranges.
8014
8015 2012-02-12 Chong Yidong <cyd@gnu.org>
8016
8017 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8018 as that creates a dangerous corner case.
8019
8020 * window.c (Fdelete_window_internal): Invalidate the mouse
8021 highlight (Bug#9904).
8022
8023 2012-02-12 Glenn Morris <rgm@gnu.org>
8024
8025 * xselect.c (Fx_own_selection_internal)
8026 (Fx_get_selection_internal, Fx_disown_selection_internal)
8027 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8028 * nsselect.m (Fx_own_selection_internal)
8029 (Fx_disown_selection_internal, Fx_selection_exists_p)
8030 (Fx_selection_owner_p, Fx_get_selection_internal):
8031 Sync docs and argument specs with the xselect.c versions.
8032
8033 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8034
8035 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8036
8037 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8038
8039 * w32select.c (Fx_selection_exists_p): Sync doc string and
8040 argument list with xselect.c. (Bug#10783)
8041
8042 * w16select.c (Fx_selection_exists_p): Sync doc string and
8043 argument list with xselect.c. (Bug#10783)
8044
8045 2012-02-10 Glenn Morris <rgm@gnu.org>
8046
8047 * fns.c (Fsecure_hash): Doc fix.
8048
8049 2012-02-09 Kenichi Handa <handa@m17n.org>
8050
8051 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8052
8053 2012-02-07 Chong Yidong <cyd@gnu.org>
8054
8055 * buffer.c (Fbuffer_local_variables)
8056 (buffer_lisp_local_variables): Handle unbound vars correctly;
8057 don't let Qunbound leak into Lisp.
8058
8059 2012-02-07 Glenn Morris <rgm@gnu.org>
8060
8061 * image.c (Fimagemagick_types): Doc fix.
8062
8063 * image.c (imagemagick-render-type): Change it from a lisp object
8064 to an integer. Move the doc here from the lisp manual.
8065 Treat all values not equal to 0 the same.
8066
8067 2012-02-06 Chong Yidong <cyd@gnu.org>
8068
8069 * doc.c (store_function_docstring): Avoid applying docstring of
8070 alias to base function (Bug#2603).
8071
8072 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8073
8074 * .gdbinit (pp1, pv1): Remove redundant defines.
8075 (pr): Use pp.
8076
8077 2012-02-04 Chong Yidong <cyd@gnu.org>
8078
8079 * nsterm.m: Declare a global (Bug#10694).
8080
8081 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8082
8083 * w32.c (get_emacs_configuration_options):
8084 Include --enable-checking, if specified, in the return value.
8085
8086 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8087
8088 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8089 after rounding frame sizes. (Bug#9723)
8090
8091 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8092
8093 * keyboard.c (adjust_point_for_property): Don't position point
8094 before BEGV. (Bug#10696)
8095
8096 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8097
8098 Handle overflow when computing char display width (Bug#9496).
8099 * character.c (char_width): Return EMACS_INT, not int.
8100 (char_width, c_string_width): Check for overflow when
8101 computing the width; this is possible now that individual
8102 characters can have unbounded width. Problem introduced
8103 by merge from Emacs 23 on 2012-01-19.
8104
8105 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8106
8107 * dbusbind.c (Fdbus_register_method): Mention the return value
8108 :ignore in the docstring.
8109
8110 2012-02-02 Glenn Morris <rgm@gnu.org>
8111
8112 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8113
8114 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8115 Unconditionally set to t. (Bug#10673)
8116 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8117 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8118 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8119
8120 2012-02-02 Kenichi Handa <handa@m17n.org>
8121
8122 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8123 0, do not call append_composite_glyph.
8124
8125 2012-02-02 Kenichi Handa <handa@m17n.org>
8126
8127 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8128 NULL (Bug#6988).
8129 (x_produce_glyphs): If the component of a composition is a null
8130 string, set it->pixel_width to 1 to avoid zero-width glyph.
8131
8132 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8133
8134 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8135 first 2 arguments are identical. This makes inserting large
8136 output from a subprocess an order of magnitude faster on
8137 MS-Windows, where all sbrk'ed memory is always contiguous.
8138
8139 2012-01-31 Glenn Morris <rgm@gnu.org>
8140
8141 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8142 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8143 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8144
8145 2012-01-29 Glenn Morris <rgm@gnu.org>
8146
8147 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8148
8149 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8150
8151 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8152
8153 2012-01-28 Chong Yidong <cyd@gnu.org>
8154
8155 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8156
8157 2012-01-26 Chong Yidong <cyd@gnu.org>
8158
8159 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8160
8161 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8162 repeat counts (Bug#10507).
8163
8164 2012-01-26 Glenn Morris <rgm@gnu.org>
8165
8166 * lread.c (syms_of_lread): Doc fix.
8167
8168 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8169
8170 * coding.c (encode_designation_at_bol): Change return value to
8171 EMACS_INT.
8172
8173 2012-01-25 Chong Yidong <cyd@gnu.org>
8174
8175 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8176
8177 2012-01-21 Chong Yidong <cyd@gnu.org>
8178
8179 * floatfns.c (Fcopysign): Make the second argument non-optional,
8180 since nil is not allowed anyway.
8181
8182 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8183
8184 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8185 (send_process): Likewise.
8186
8187 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8188
8189 * window.c (save_window_save, Fcurrent_window_configuration)
8190 (Vwindow_persistent_parameters): Do not use Qstate.
8191 Rewrite doc-strings.
8192
8193 2012-01-19 Kenichi Handa <handa@m17n.org>
8194
8195 * character.c (char_width): New function.
8196 (Fchar_width, c_string_width, lisp_string_width):
8197 Use char_width (Bug#9496).
8198
8199 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8200
8201 * window.c (Vwindow_persistent_parameters): New variable.
8202 (Fset_window_configuration, save_window_save): Handle persistent
8203 window parameters.
8204
8205 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8206
8207 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8208 thrashing the stack of the thread. (Bug#9087)
8209
8210 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8211
8212 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8213
8214 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8215
8216 * xdisp.c (rows_from_pos_range): Handle the case where the
8217 highlight ends on a newline. (Bug#10464)
8218 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8219 he end column for display of highlight that ends on a newline
8220 before a R2L line.
8221
8222 2012-01-11 Glenn Morris <rgm@gnu.org>
8223
8224 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8225 from load-path also when installation-directory is nil. (Bug#10208)
8226
8227 2012-01-10 Glenn Morris <rgm@gnu.org>
8228
8229 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8230
8231 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8232 Update template values to be closer to their typical values these days.
8233
8234 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8235
8236 * xdisp.c (rows_from_pos_range): Accept additional argument
8237 DISP_STRING, and accept any glyph in a row whose object is that
8238 string as eligible for mouse highlight. Fixes mouse highlight of
8239 display strings from overlays. (Bug#10464)
8240
8241 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8242
8243 emacs: fix an auto-save permissions race condition (Bug#10400)
8244 * fileio.c (auto_saving_dir_umask): New static var.
8245 (Fmake_directory_internal): Use it.
8246 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8247 creating the directory. The old code temporarily assigns
8248 too-generous permissions to the directory.
8249 (do_auto_save_eh): Clear it.
8250 (Fdo_auto_save): Catch all errors, not just file errors, so
8251 that the var is always cleared.
8252
8253 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8254
8255 * search.c (scan_buffer): Pass character positions to
8256 know_region_cache, not byte positions. (Bug#6540)
8257
8258 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8259
8260 * w32.c (sys_rename): Report EXDEV when rename of a directory
8261 fails because the target is on another logical disk. (Bug#10284)
8262
8263 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8264
8265 * xterm.c (x_embed_request_focus): New function.
8266
8267 * xterm.h: Add prototype.
8268
8269 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8270
8271 2012-01-05 Glenn Morris <rgm@gnu.org>
8272
8273 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8274
8275 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8276
8277 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8278 Load gnutls_transport_set_lowat only if GnuTLS version is below
8279 2.11.1.
8280 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8281 GnuTLS versions below 2.11.1.
8282
8283 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8284
8285 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8286 to the doc string advising against its use for altering the way
8287 windows are scrolled.
8288
8289 2011-12-28 Kenichi Handa <handa@m17n.org>
8290
8291 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8292 coding-system ASCII compatible only when it does not produce BOM
8293 on encoding (Bug#10383).
8294
8295 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8296
8297 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8298 can scroll.
8299 (create_and_show_popup_menu): Always use menu_position_func for
8300 Gtk3 (Bug#10361).
8301
8302 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8303
8304 * callint.c (Fcall_interactively): Don't truncate prompt string.
8305
8306 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8307
8308 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8309 property that ends at ZV, so that the bidi iteration could be
8310 resumed from there (after widening). (Bug#10360)
8311
8312 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8313
8314 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8315
8316 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8317
8318 * nsterm.m (x_free_frame_resources):
8319 Release f->output_data.ns->miniimage.
8320 (ns_index_color): Fix indentation. Do not retain
8321 color_table->colors[i].
8322
8323 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8324 before returning.
8325
8326 * nsfns.m (x_set_background_color): Assign return value from
8327 ns_index_color to face-background instead of NSColor*.
8328 (ns_implicitly_set_icon_type): Fix indentation.
8329 Change assignment in for loop to comparison.
8330
8331 * emacs.c (ns_pool): New variable.
8332 (main): Assign ns_pool.
8333 (Fkill_emacs): Call ns_release_autorelease_pool.
8334
8335 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8336 autorelease fdesc, release fdAttrs and tdict.
8337 (ns_get_covering_families): Release charset.
8338 (ns_findfonts): Release NSFontDescriptor created with new.
8339 (ns_uni_to_glyphs): Fix indentation.
8340 (setString): Release attrStr before assigning new value.
8341
8342 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8343
8344 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8345 and NS_IMPL_COCOA.
8346 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8347 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8348
8349 2011-12-18 David Reitter <reitter@cmu.edu>
8350
8351 * nsterm.m (ns_term_init): Subscribe for notifications
8352 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8353 to method trackingNotification in EmacsMenu.
8354
8355 * nsmenu.m (trackingMenu): New variable.
8356 (trackingNotification): New method (from Aquamacs).
8357 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8358 from Aquamacs (Bug#7030).
8359
8360 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8361
8362 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8363 (symbol_to_nsstring): Fix indentation.
8364 (ns_symbol_to_pb): New function.
8365 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8366 (Fns_rotate_cut_buffers_internal): Remove.
8367 (Fns_store_selection_internal): Rename from
8368 Fns_store_cut_buffer_internal.
8369 (ns_get_foreign_selection, Fx_own_selection_internal)
8370 (Fx_disown_selection_internal, Fx_selection_exists_p)
8371 (Fns_get_selection_internal, Fns_store_selection_internal):
8372 Use ns_symbol_to_pb and check if return value is nil.
8373 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8374 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8375 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8376 renamed to Sns_store_selection_internal.
8377 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8378 and remove this function.
8379 (ns_handle_selection_clear): Remove, never used.
8380 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8381 here.
8382
8383 2011-12-17 Ken Brown <kbrown@cornell.edu>
8384
8385 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8386 GID is unknown (Bug#10257).
8387
8388 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8389
8390 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8391 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8392 which caused a build failure on GNU/Linux IA-64. This problem was
8393 introduced by my 2011-10-07 patch.
8394
8395 2011-12-15 Juri Linkov <juri@jurta.org>
8396
8397 * image.c (imagemagick_error): New function. (Bug#10112)
8398 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8399 Use `imagemagick_error' where ImageMagick functions return
8400 `MagickFalse'.
8401 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8402 proper order.
8403
8404 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8405
8406 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8407 fill background (Bug#8992).
8408
8409 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8410
8411 * window.c (Vwindow_combination_resize)
8412 (Vwindow_combination_limit): Use t instead of non-nil in
8413 doc-strings.
8414 (Vrecenter_redisplay): Add first sentence of doc-string on
8415 separate line.
8416 (Frecenter): Fix doc-string typo.
8417
8418 2011-12-11 Kenichi Handa <handa@m17n.org>
8419
8420 * coding.c (Funencodable_char_position): Pay attention to the
8421 buffer text relocation (Bug#9389).
8422
8423 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8424
8425 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8426 gtk_init (Bug#10100).
8427
8428 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8429
8430 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8431 IT->string is nil. (Bug#10263)
8432
8433 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8434
8435 * nsterm.h (x_free_frame_resources): Declare.
8436
8437 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8438 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8439
8440 * nsterm.h (ns_get_defaults_value): Declare.
8441
8442 * nsterm.m (ns_default): Call ns_get_defaults_value.
8443
8444 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8445
8446 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8447 (Bug#10170)
8448
8449 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8450
8451 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8452 that where the value of an _OBJC_* symbol points to is in the .bss
8453 section (Bug#10240).
8454
8455 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8456
8457 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8458 after the loop to call ccl_driver at least once (Bug#8619).
8459
8460 2011-12-08 Kenichi Handa <handa@m17n.org>
8461
8462 * ftfont.c (get_adstyle_property): Fix previous change
8463 (Bug#10233).
8464
8465 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8466
8467 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8468 dirs from the default value of EMACSLOADPATH (bug#10208).
8469
8470 2011-12-07 Glenn Morris <rgm@gnu.org>
8471
8472 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8473 installation and source directories as well. (Bug#10208)
8474
8475 2011-12-06 Chong Yidong <cyd@gnu.org>
8476
8477 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8478
8479 2011-12-06 Glenn Morris <rgm@gnu.org>
8480
8481 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8482 as an error, not just -1. (Bug#10217)
8483
8484 2011-12-05 Chong Yidong <cyd@gnu.org>
8485
8486 * keyboard.c (process_special_events): New function.
8487 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8488
8489 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8490
8491 * coding.c (encode_designation_at_bol): Don't use uninitialized
8492 local variable (Bug#9318).
8493
8494 2011-12-05 Kenichi Handa <handa@m17n.org>
8495
8496 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8497 return Qnil (Bug#8046, Bug#10193).
8498
8499 2011-12-05 Kenichi Handa <handa@m17n.org>
8500
8501 * coding.c (encode_designation_at_bol): New args charbuf_end and
8502 dst. Return the number of produced bytes. Callers changed.
8503 (coding_set_source): Return how many bytes coding->source was
8504 relocated.
8505 (coding_set_destination): Return how many bytes
8506 coding->destination was relocated.
8507 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8508 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8509
8510 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8511
8512 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8513 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8514 macro (Bug#9318).
8515
8516 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8517
8518 The following changes are to fix Bug#9318.
8519
8520 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8521 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8522 (encode_coding_iso_2022, encode_coding_sjis)
8523 (encode_coding_big5, encode_coding_charset): Use the above macros.
8524
8525 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8526
8527 * lisp.h (process_quit_flag): Fix external declaration.
8528
8529 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8530
8531 Don't macro-inline non-performance-critical code.
8532 * eval.c (process_quit_flag): New function.
8533 * lisp.h (QUIT): Use it.
8534
8535 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8536
8537 * nsfns.m (get_geometry_from_preferences): New function.
8538 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8539
8540 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8541
8542 * emacs.c (Qkill_emacs): Define.
8543 (syms_of_emacs): Initialize it.
8544 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8545 Qquit_flag to `kill-emacs' instead.
8546 (quit_throw_to_read_char): Add parameter `from_signal'.
8547 All callers changed. Call Fkill_emacs if requested and safe.
8548 * lisp.h (QUIT): Call Fkill_emacs if requested.
8549
8550 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8551
8552 * widget.c (update_wm_hints): Return if wmshell is null.
8553 (widget_update_wm_size_hints): New function.
8554
8555 * widget.h (widget_update_wm_size_hints): Declare.
8556
8557 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8558 widget_update_wm_size_hints (Bug#10104).
8559
8560 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8561
8562 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8563 before a newline, prepare the bidi iterator for consuming the
8564 newline, and keep the current paragraph direction. (Bug#10183)
8565 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8566
8567 2011-12-02 Juri Linkov <juri@jurta.org>
8568
8569 * search.c (Fword_search_regexp): New Lisp function created from
8570 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8571 (Fword_search_backward, Fword_search_forward)
8572 (Fword_search_backward_lax, Fword_search_forward_lax):
8573 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8574 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8575
8576 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8577
8578 * fileio.c (Finsert_file_contents): Move after-change-function call
8579 to before the "handled:" label, since all "goto handled" appear in
8580 cases where the *-change-functions have already been properly called
8581 (bug#10117).
8582
8583 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8584
8585 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8586 waiting for input. (Bug#10169)
8587
8588 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8589
8590 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8591 verifies glyph row's hash code--we have just reallocated the
8592 glyphs, so their contents can be complete garbage. (Bug#10164)
8593
8594 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8595
8596 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8597
8598 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8599
8600 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8601 attributes are tested _before_ calling verify_row_hash, to protect
8602 against GCC re-ordering of the tests. (Bug#10164)
8603
8604 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8605
8606 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8607
8608 * xterm.c (handle_one_xevent): Only set async_visible and friends
8609 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8610 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8611 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8612
8613 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8614
8615 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8616 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8617 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8618 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8619 All uses changed to use GCPRO1 etc.
8620 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8621 Revert to old implementation (i.e., before 2011-03-11).
8622
8623 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8624
8625 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8626 of scroll runs so as to avoid assigning disabled bogus rows and
8627 unnecessary graphics copy operations.
8628
8629 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8630
8631 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8632 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8633 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8634 (malloc, free, realloc, calloc): Redirect to e_* only when
8635 compiling Emacs.
8636
8637 * lisp.h (GCTYPEBITS): Move before first use.
8638 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8639 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8640 this macro definition.
8641
8642 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8643 _MSC_VER.
8644
8645 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8646
8647 * gtkutil.c (xg_create_frame_widgets):
8648 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8649 present with Gtk+ 2.0.
8650
8651 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8652
8653 * fileio.c (Finsert_file_contents): Undo previous change; see
8654 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8655
8656 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8657
8658 Rename locals to avoid shadowing.
8659 * fileio.c (Finsert_file_contents):
8660 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8661 * process.c (wait_reading_process_output):
8662 Rename inner 'proc' to 'p' to avoid shadowing.
8663 Indent for consistency with usual Emacs style.
8664
8665 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8666
8667 * xdisp.c (redisplay_window): If cursor row is not fully visible
8668 after recentering, and scroll-conservatively is set to a large
8669 number, scroll window by a few more lines to make the cursor fully
8670 visible and out of scroll-margin. (Bug#10105)
8671 (start_display): Don't move to the next line if the display should
8672 start at a newline that is part of a display vector or an overlay
8673 string. (Bug#10119)
8674
8675 2011-11-24 Juri Linkov <juri@jurta.org>
8676
8677 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8678 after the `MagickPingImage' call. (Bug#10112)
8679
8680 2011-11-23 Chong Yidong <cyd@gnu.org>
8681
8682 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8683
8684 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8685
8686 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8687 making another buffer current. (Bug#10114)
8688
8689 2011-11-23 Glenn Morris <rgm@gnu.org>
8690
8691 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8692
8693 2011-11-23 Chong Yidong <cyd@gnu.org>
8694
8695 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8696 using it (Bug#5984).
8697
8698 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8699
8700 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8701 and header-lines, as they don't have one computed for them.
8702 (Bug#10098)
8703
8704 * .gdbinit (prow): Make displayed values more self-explaining.
8705 Add row's hash code.
8706
8707 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8708
8709 * process.c (wait_reading_process_output): Fix asynchrounous
8710 GnuTLS socket handling on some versions of the GnuTLS library.
8711 (wait_reading_process_output): Add comment and URL.
8712
8713 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8714
8715 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8716
8717 2011-11-21 Chong Yidong <cyd@gnu.org>
8718
8719 * window.c (Fnext_window, Fprevious_window): Doc fix.
8720
8721 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8722
8723 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8724
8725 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8726
8727 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8728
8729 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8730
8731 * window.c (Fset_window_combination_limit): Rename argument
8732 STATUS to LIMIT.
8733 (Vwindow_combination_limit): Remove "status" from doc-string.
8734
8735 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8736
8737 * m/ibms390.h: Remove.
8738 * m/ibms390x.h: Don't include "ibms390.h".
8739
8740 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8741
8742 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8743 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8744
8745 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8746
8747 * casetab.c (Fset_case_table):
8748 * charset.c (Fcharset_after): Fix typos.
8749
8750 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8751
8752 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8753 Otherwise, valgrind does not work on some platforms.
8754 Problem reported by Andreas Schwab in
8755 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8756 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8757 is set, removing the need for VIRT_ADDRESS_VARIES.
8758 (PURE_P): Use a more-efficient implementation that needs just one
8759 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8760 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8761 to 4 (xorl, subq, cmpq, setbe).
8762 * alloc.c (pure): Always extern now, since that's the
8763 VIRT_ADDR_VARIES behavior.
8764 (PURE_POINTER_P): Use a single comparison, not two, for
8765 consistency with the new puresize.h.
8766 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8767 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8768 Remove VIRT_ADDR_VARIES no longer needed.
8769
8770 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8771
8772 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8773 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8774 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8775 behave as if the cursor position were at the window margin.
8776
8777 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8778 and the cursor position is out of bounds, behave as if the cursor
8779 position were at the window margin. (Bug#10075)
8780
8781 2011-11-18 Chong Yidong <cyd@gnu.org>
8782
8783 * window.c (Fwindow_combination_limit): Make first argument
8784 non-optional, since it is meaningless for live windows like the
8785 selected window.
8786
8787 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8788
8789 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8790
8791 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8792
8793 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8794 (graft_intervals_into_buffer): Simplify.
8795
8796 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8797
8798 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8799 hash values of the two rows.
8800 (copy_row_except_pointers): Preserve the used[] arrays and the
8801 hash values of the two rows. (Bug#10035)
8802 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8803
8804 * xdisp.c (row_hash): New function, body extracted from
8805 compute_line_metrics.
8806 (compute_line_metrics): Call row_hash, instead of computing the
8807 hash code inline.
8808
8809 * dispnew.c (verify_row_hash): Call row_hash for computing the
8810 hash code of a row, instead of duplicating code from xdisp.c.
8811
8812 * dispextern.h (row_hash): Add prototype.
8813
8814 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8815
8816 * frame.c (delete_frame): Don't delete the terminal when the last
8817 X frame is closed if emacs is built with GTK toolkit.
8818
8819 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8820
8821 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8822
8823 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8824
8825 * window.c (Vwindow_splits): Rename to
8826 Vwindow_combination_resize. Suggested by Juri Linkov.
8827 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8828 of Vwindow_splits.
8829
8830 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8831
8832 * nsfns.m (Fns_font_name):
8833 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8834
8835 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8836
8837 * window.h (window): Rename slot "nest" to "combination_limit".
8838 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8839 (Fset_window_nest): Rename to Fset_window_combination_limit.
8840 (Vwindow_nest): Rename to Vwindow_combination_limit.
8841 (recombine_windows, make_parent_window, make_window)
8842 (Fsplit_window_internal, saved_window)
8843 (Fset_window_configuration, save_window_save): Rename all
8844 occurrences of window_nest to window_combination_limit.
8845
8846 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8847
8848 * image.c (imagemagick_load_image): Fix typo.
8849
8850 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8851
8852 * xdisp.c (display_line): Move the call to
8853 highlight_trailing_whitespace before the call to
8854 compute_line_metrics, since the latter needs to see the final
8855 faces of all the glyphs to compute ROW's hash value.
8856 Fixes assertion violations in row_equal_p. (Bug#10035)
8857
8858 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8859
8860 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8861 just return (bug#10044).
8862
8863 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8864
8865 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8866 with user-defined heap size. Bump the default size of the temacs
8867 heap to 27MB, to avoid memory warning when running temacs.
8868 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8869
8870 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8871 current_matrix and desired_matrix. (Bug#9990)
8872 (verify_row_hash) [XASSERTS]: New function.
8873 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8874 that the hash value of glyph rows is correct.
8875
8876 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8877
8878 * window.h (window): Remove splits slot.
8879 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8880 (Fdelete_other_windows_internal, make_parent_window)
8881 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8882 (Fset_window_configuration, save_window_save): Don't deal with
8883 split status of windows.
8884 (saved_window): Remove splits slot.
8885 (Vwindow_splits): Rewrite doc-string.
8886
8887 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8888
8889 * xfns.c (unwind_create_frame):
8890 * nsfns.m (unwind_create_frame):
8891 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8892 Vframe_list (Bug#9999).
8893
8894 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8895
8896 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8897
8898 2011-11-11 Kenichi Handa <handa@m17n.org>
8899
8900 * callproc.c (Fcall_process): Set the member dst_multibyte of
8901 process_coding.
8902
8903 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8904
8905 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8906 avoid a crash (bug#9496).
8907
8908 2011-11-09 Chong Yidong <cyd@gnu.org>
8909
8910 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8911 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8912
8913 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8914
8915 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8916
8917 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8918
8919 Avoid some portability problems by eschewing 'extern inline' functions.
8920 The trivial performance wins aren't worth the portability hassles; see
8921 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8922 et seq.
8923 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8924 (window_box_width, window_box_left, window_box_left_offset)
8925 (window_box_right, window_box_right_offset): Undo previous change,
8926 by removing the "extern"s.
8927 * intervals.c (adjust_intervals_for_insertion)
8928 (adjust_intervals_for_deletion): Undo previous change,
8929 making these static again.
8930 (offset_intervals, temp_set_point_both, temp_set_point)
8931 (copy_intervals_to_string): No longer inline.
8932 * xdisp.c (window_text_bottom_y, window_box_width)
8933 (window_box_height, window_box_left_offset)
8934 (window_box_right_offset, window_box_left, window_box_right)
8935 (window_box): No longer inline.
8936
8937 2011-11-08 Chong Yidong <cyd@gnu.org>
8938
8939 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8940 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8941 Signal an error if not a live window.
8942 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8943 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8944
8945 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8946
8947 * lisp.h (syms_of_abbrev): Remove declaration.
8948 Reported by CHENG Gao <chenggao@royau.me>.
8949
8950 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8951
8952 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8953 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8954 of temacs in GUI mode.
8955
8956 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8957
8958 * window.h: Declare delete_all_child_windows instead of
8959 delete_all_subwindows.
8960 * window.c (Fwindow_nest, Fset_window_nest)
8961 (Fset_window_new_total, Fset_window_new_normal)
8962 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8963 (delete_all_subwindows): Rename to delete_all_child_windows.
8964 (Fdelete_other_windows_internal, Fset_window_configuration):
8965 Call delete_all_child_windows instead of delete_all_subwindows.
8966 * frame.c (delete_frame): Call delete_all_child_windows instead
8967 of delete_all_subwindows.
8968
8969 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8970
8971 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8972 This is also needed for porting to any host where GC_MARK_STACK is
8973 not GC_MAKE_GCPROS_NOOPS.
8974 (which_symbols): Use it.
8975
8976 2011-11-07 Kenichi Handa <handa@m17n.org>
8977
8978 * coding.c (coding_set_destination): Check coding->src_pos only
8979 when coding->src_object is a buffer (bug#9910).
8980
8981 * process.c (send_process): Set the member src_multibyte of coding
8982 to 0 (bug#9911) when sending a unibyte text.
8983
8984 * callproc.c (Fcall_process): Set the member src_multibyte of
8985 process_coding to 0 (bug#9912).
8986
8987 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8988
8989 * xmenu.c (cleanup_widget_value_tree): New function.
8990 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8991 calling free_menubar_widget_value_tree directly (Bug#9830).
8992
8993 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8994
8995 Fix some portability problems with 'inline'.
8996 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8997 (window_box_width, window_box_left, window_box_left_offset)
8998 (window_box_right, window_box_right_offset): Declare extern.
8999 Otherwise, these inline functions do not conform to C99 and
9000 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9001 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9002 * intervals.c (adjust_intervals_for_insertion)
9003 (adjust_intervals_for_deletion): Now extern, because otherwise the
9004 extern inline functions 'offset_intervals' couldn't refer to it.
9005 (static_offset_intervals): Remove.
9006 (offset_intervals): Rewrite using the old contents of
9007 static_offset_intervals. The old version didn't conform to C99
9008 because an extern inline function contained a reference to an
9009 identifier with static linkage.
9010
9011 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9012
9013 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9014 GC.
9015
9016 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9017
9018 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9019 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9020 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9021 return Qleft_to_right.
9022
9023 2011-11-06 Chong Yidong <cyd@gnu.org>
9024
9025 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9026 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9027 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9028 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9029 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9030 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9031 (Fwindow_vscroll): Doc fix.
9032 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9033 argument, since it makes no sense to pass a live window and for
9034 consistency with window-child.
9035
9036 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9037
9038 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9039 support MSVC.
9040
9041 2011-11-05 Jason Rumney <jasonr@gnu.org>
9042
9043 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9044 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9045 fonts (Bug#6029).
9046 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9047 bitwise arithmetic preventing use of unicode-sip and non-truetype
9048 opentype fonts.
9049
9050 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9051
9052 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9053 "emacs"-only part.
9054
9055 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9056 initialization code to keep similarity to xfns.c after changes
9057 from 2011-11-05.
9058
9059 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9060
9061 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9062 (unwind_create_frame): New function (Bug#9943).
9063 (Fx_create_frame): Restructure code to be more similar to the one in
9064 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9065 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9066 Move terminal->reference_count++ just before making the frame official
9067 (Bug#9943).
9068
9069 * nsterm.m (x_free_frame_resources): New function.
9070 (x_destroy_window): Move code to x_free_frame_resources.
9071
9072 * xfns.c (unwind_create_frame): Fix comment.
9073 (Fx_create_frame, x_create_tip_frame):
9074 Move terminal->reference_count++ just before making the frame
9075 official. Move initialization of image_cache_refcount and
9076 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9077
9078 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9079
9080 Support MSVC build with newer versions of Visual Studio.
9081 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9082 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9083 nt/gmake.defs.
9084
9085 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9086 which are not supported by MSVC.
9087 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9088 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9089 bitfields.
9090 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9091 types in bitfields.
9092 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9093
9094 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9095
9096 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9097
9098 Support MSVC build with newer versions of Visual Studio.
9099 * w32.c: Don't include w32api.h for MSVC.
9100 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9101
9102 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9103 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9104 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9105 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9106 e_* cousins.
9107 (alloca) [_MSC_VER]: Define to _alloca.
9108
9109 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9110
9111 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9112
9113 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9114
9115 * xdisp.c (note_mouse_highlight): If either of
9116 previous/next-single-property-change returns nil, treat that as
9117 the beginning or the end of the buffer. (Bug#9955)
9118
9119 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9120
9121 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9122 label is not null (Bug#9951).
9123 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9124 may be NULL.
9125
9126 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9127
9128 * window.c (Fwindow_body_size): Mention in the doc string that the
9129 return value is in frame's canonical units. (Bug#9949)
9130
9131 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9132
9133 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9134
9135 * w32fns.c (unwind_create_frame): If needed, free the glyph
9136 matrices of the partially constructed frame. (Bug#9943)
9137 * xfns.c (unwind_create_frame): Likewise.
9138
9139 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9140
9141 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9142 Don't stop backward scan on the continuation glyph, even though
9143 its CHARPOS is positive.
9144 (mouse_face_from_buffer_pos, note_mouse_highlight):
9145 Rename cover_string to disp_string.
9146
9147 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9148
9149 * window.c (temp_output_buffer_show): Don't use
9150 Vtemp_buffer_show_specifiers.
9151 (Vtemp_buffer_show_specifiers): Remove unused variable.
9152
9153 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9154
9155 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9156 past the beginning of the current glyph matrix.
9157
9158 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9159
9160 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9161 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9162 HAVE_GTK3 (Bug#9869).
9163
9164 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9165 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9166
9167 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9168
9169 * xterm.c: Declare x_handle_net_wm_state to return int.
9170 (handle_one_xevent): Check if we are iconified but don't have
9171 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9172 (get_current_wm_state): Return non-zero if not hidden,
9173 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9174 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9175 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9176 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9177
9178 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9179
9180 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9181 so that this new function doesn't get optimized away by a
9182 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9183
9184 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9185
9186 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9187
9188 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9189
9190 Fix the `xbytecode' command.
9191 * .gdbinit (xprintbytestr): New command.
9192 (xwhichsymbols): Rename from `which'; all callers changed.
9193 (xbytecode): Print the byte-code string as well.
9194
9195 2011-10-29 Kim Storm <storm@cua.dk>
9196
9197 * alloc.c (which_symbols): New function.
9198
9199 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9200
9201 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9202 line. (Bug#9903)
9203
9204 2011-10-29 Glenn Morris <rgm@gnu.org>
9205
9206 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9207 Not clear what it was for, and it causes various bugs. (Bug#9839)
9208
9209 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9210
9211 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9212 possible random value that matches one of those tested as
9213 condition to clear the mouse face.
9214
9215 2011-10-28 Chong Yidong <cyd@gnu.org>
9216
9217 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9218
9219 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9220
9221 * window.c (make_window): Initialize phys_cursor_on_p.
9222
9223 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9224
9225 * lisp.h (struct Lisp_Symbol): Update comments.
9226
9227 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9228
9229 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9230
9231 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9232
9233 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9234 <oslsachem@gmail.com> for helping to debug this.
9235
9236 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9237 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9238 (g_b_init_get_glyph_outline_w): New static variables.
9239 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9240 (GetGlyphOutlineW_Proc): New typedefs.
9241 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9242 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9243 New functions.
9244 (w32font_open_internal, compute_metrics):
9245 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9246 instead of calling the "wide" APIs directly.
9247
9248 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9249
9250 * w32.h (syms_of_w32font): Add prototype.
9251
9252 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9253
9254 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9255 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9256 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9257 (Fmove_to_window_line): Doc fix.
9258
9259 2011-10-27 Chong Yidong <cyd@gnu.org>
9260
9261 * process.c (make_process): Set gnutls_state to NULL.
9262
9263 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9264 non-NULL, regardless of GNUTLS_INITSTAGE.
9265 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9266 an error. Set process slots as soon as we allocate them.
9267
9268 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9269
9270 2011-10-27 Chong Yidong <cyd@gnu.org>
9271
9272 * gnutls.c (emacs_gnutls_deinit): New function.
9273 Deallocate credentials structures as well as calling gnutls_deinit.
9274 (Fgnutls_deinit, Fgnutls_boot): Use it.
9275
9276 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9277 (deactivate_process): Call emacs_gnutls_deinit.
9278
9279 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9280
9281 * image.c (x_create_x_image_and_pixmap):
9282 * w32.c (sys_rename, w32_delayed_load):
9283 * w32font.c (fill_in_logfont):
9284 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9285
9286 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9287
9288 * w32fns.c (w32_default_color_map): New function,
9289 extracted from Fw32_default_color_map.
9290 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9291
9292 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9293
9294 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9295
9296 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9297
9298 * keyboard.c (test_undefined): New function (bug#9751).
9299 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9300
9301 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9302
9303 * sysdep.c (init_sys_modes): Fix the check for the controlling
9304 terminal (Bug#6649).
9305
9306 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9307
9308 * dispextern.h (struct bidi_it): New member next_en_type.
9309
9310 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9311 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9312 current character, check also for next_en_type being WEAK_EN.
9313 (bidi_resolve_weak): Don't enter the expensive loop if the current
9314 position is before next_en_pos. Record the bidi type of the first
9315 non-ET, non-BN character we find, in addition to its position.
9316 (bidi_level_of_next_char): Invalidate next_en_type when
9317 next_en_pos is over-stepped.
9318
9319 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9320
9321 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9322 * editfns.c: Rewrite current-time-zone so that it invokes
9323 the equivalent of (format-time-string "%Z") to get the time zone name.
9324 This fixes a bug when the time zone name contains characters that
9325 need converting from the system time locale to Emacs internal format.
9326 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9327 that patch fixed format-time-string to do the conversion, but
9328 I forgot to fix current-time-zone.
9329 (format_time_string): New function, containing most of
9330 what Fformat_time_string used to contain.
9331 (Fformat_time_string): Rewrite in terms of format_time_string.
9332 This doesn't change this function's behavior.
9333 (current-time-zone): Rewrite to use format_time_string.
9334 This fixes the bug reported by Michael Schierl in
9335 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9336 Jason Rumney's 2007-06-07 change worked around this bug, but
9337 didn't fix it.
9338 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9339
9340 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9341
9342 * xdisp.c (start_display): If the character at POS is displayed
9343 via a display vector, reset IT->current.dpvec_index to zero.
9344 (try_window_reusing_current_matrix): If a line ends in a display
9345 vector or the next line starts in a display vector, continue
9346 redrawing the window even though the character position of
9347 start_row was reached.
9348 (Bug#9771, part 2)
9349
9350 2011-10-18 Chong Yidong <cyd@gnu.org>
9351
9352 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9353 with nobreak-char-display too.
9354
9355 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9356
9357 Fix part 3 of bug#9771.
9358 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9359 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9360 non-neutral characters if the current character is a paragraph
9361 separator (a.k.a. Newline). This avoids running the same
9362 expensive loop twice, once when we consume the preceding newline
9363 and the other time when the line actually needs to be displayed.
9364 Avoid the loop when we see neutrals on the base embedding level
9365 following a character whose directionality is the same as the
9366 paragraph's. This avoids running the expensive loop when a line
9367 ends in a long sequence of neutrals, like control characters.
9368 Add assertion against STRONG_AL type. Slightly rearrange code
9369 that determines the type of a neutral given the first non-neutral
9370 that follows it.
9371 (bidi_level_of_next_char): Set next_en_pos to zero when
9372 invalidating its info.
9373
9374 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9375
9376 * xdisp.c (push_display_prop): Determine whether to record string
9377 or buffer position by IT->string, not by IT->method. Allow
9378 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9379 (move_it_vertically_backward): Don't look for character position
9380 immediately after the newline when in a continuation line.
9381 (Bug#9771, part 1)
9382
9383 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9384
9385 * window.c (coordinates_in_window): Rewrite and delabelize
9386 vertical border check. (Bug#5357) (Bug#9618)
9387
9388 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9389
9390 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9391 errors in XSetWindowBorder (bug#9310).
9392
9393 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9394
9395 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9396 avoid crash when xmalloc overrun checking is enabled.
9397
9398 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9399
9400 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9401 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9402 cursor motion with <left> and <right> arrow keys.
9403
9404 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9405 some callers set that themselves.
9406
9407 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9408
9409 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9410 display string and the previous row comes from the same string and
9411 is empty. (Bug#9739) (Bug#9738)
9412
9413 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9414
9415 * doc.c (get_doc_string): Encode file name (bug#9735).
9416
9417 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9418
9419 * bidi.c (bidi_level_of_next_char):
9420 * xdisp.c (get_visually_first_element): Remove old incorrect
9421 comments regarding the Unicode Line Separator character.
9422
9423 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9424
9425 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9426
9427 * alloc.c (Fgc_status): Do not access beyond zombies array
9428 boundary if nzombies > MAX_ZOMBIES.
9429 * alloc.c (dump_zombies): Add missing format specifier.
9430
9431 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9432
9433 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9434 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9435
9436 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9437 Some packages use them to denote characters with modifiers.
9438
9439 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9440
9441 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9442 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9443 matching a pp-number. Rename parameter var to var1.
9444
9445 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9446
9447 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9448
9449 2011-10-08 Glenn Morris <rgm@gnu.org>
9450
9451 * callint.c (Fcall_interactively): Give a more explicit error for the
9452 'c' case with a non-character input. (Bug#8479)
9453
9454 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9455
9456 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9457 lines.
9458 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9459 lines that are hscrolled on the left.
9460
9461 * dispnew.c (buffer_posn_from_coords): Account for a possible
9462 presence of header-line. (Bug#4426)
9463
9464 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9465
9466 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9467 Don't advertise functionality which we discourage or doesn't work.
9468
9469 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9470
9471 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9472 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9473 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9474 this makes Emacs dump core during garbage collection on rare
9475 occasions. sizeof is obviously inferior to offsetof here, so
9476 stick with offsetof.
9477 (GC_POINTER_ALIGNMENT): New macro.
9478 (mark_memory): Omit 3rd (offset) arg; caller changed.
9479 Don't assume EMACS_INT alignment is the same as pointer alignment.
9480
9481 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9482
9483 * keyboard.c (read_key_sequence_remapped): New var.
9484 (read_key_sequence): Compute remapping in the right buffer.
9485 (command_loop_1): Use read_key_sequence's remapping directly.
9486
9487 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9488
9489 * dired.c (file_name_completion): Don't expand file name.
9490 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9491 before checking file name handler.
9492
9493 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9494 they've been requested explicitly (bug#9591).
9495
9496 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9497
9498 * keymap.c (Fsingle_key_description): Use make_specified_string
9499 instead of build_string to build string from push_key_description.
9500 (Bug#5193)
9501
9502 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9503
9504 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9505 This fixes a Y2038 bug on 64-bit hosts.
9506 * buffer.c (reset_buffer):
9507 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9508 (Fclear_buffer_auto_save_failure):
9509 Use 0, not -1, to represent an unset failure time, since time_t
9510 might not be signed.
9511
9512 Remove dependency on glibc malloc internals.
9513 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9514 Move back here from lisp.h, but with their new implementations.
9515 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9516 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9517 * charset.c (charset_table_init): New static var.
9518 (syms_of_charset): Use it instead of xmalloc. This removes a
9519 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9520 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9521 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9522 Move back to alloc.c.
9523 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9524 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9525
9526 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9527
9528 * nsterm.m (windowDidResize): Call x_set_window_size only when
9529 ns_in_resize is true. Otherwise set pixelwidth/height and
9530 call change_frame_size (Bug#9628).
9531
9532 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9533
9534 Port --enable-checking=all to Fedora 14 x86-64.
9535 * charset.c (syms_of_charset): Also account for glibc malloc's
9536 internal overhead when calculating the initial malloc maximum.
9537
9538 Port --enable-checking=all to Fedora 14 x86.
9539 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9540 Move to lisp.h.
9541 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9542 (overrun_check_realloc, overrun_check_free):
9543 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9544 That way, xmalloc returns a properly-aligned pointer even if
9545 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9546 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9547 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9548 into account when calculating the initial malloc maximum.
9549 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9550 Move here from alloc.c, so that charset.c can use it too.
9551 Properly align; the old code wasn't right for common 32-bit hosts
9552 when configured with --enable-checking=all.
9553 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9554 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9555
9556 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9557
9558 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9559 use EDOM.
9560
9561 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9562
9563 * xdisp.c (compute_display_string_end): If there's no display
9564 string at CHARPOS, return -1.
9565
9566 * bidi.c (bidi_fetch_char): When compute_display_string_end
9567 returns a negative value, treat the character as a normal
9568 character not covered by a display string. (Bug#9624)
9569
9570 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9571
9572 * lread.c (Fread_from_string): Fix typo in docstring.
9573
9574 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9575
9576 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9577 newline, reseat the iterator instead of bidi-iterating there one
9578 character at a time. (Bug#9610)
9579 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9580 TO_CHARPOS if the bidi iterator is at base embedding level.
9581
9582 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9583
9584 * lread.c (readevalloop): Use correct code for NBSP.
9585 (read1): Likewise. (Bug#9608)
9586
9587 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9588
9589 * dbusbind.c (Fdbus_register_signal): When service is not
9590 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9591
9592 2011-09-25 Glenn Morris <rgm@gnu.org>
9593
9594 * buffer.c (truncate-lines): Doc fix.
9595
9596 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9597
9598 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9599 (Fset_window_next_buffers): Doc fix.
9600
9601 2011-09-24 Glenn Morris <rgm@gnu.org>
9602
9603 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9604
9605 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 Fix minor problems found by static checking.
9608 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9609 * indent.c (Fvertical_motion): Fix == vs = typo.
9610
9611 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9612
9613 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9614 Default value is now t. Doc fix.
9615
9616 * indent.c (Fvertical_motion): Compute and apply the overshoot
9617 logic when moving up, not only when moving down. Fix the
9618 confusing name and values of the it_overshoot_expected variable;
9619 logic changes accordingly. (Bug#9254) (Bug#9549)
9620
9621 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9622 CHARPOS is covered by a display string which includes newlines.
9623 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9624 is covered by a display string with embedded newlines.
9625
9626 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9627
9628 * dbusbind.c (Fdbus_register_signal): Add match rule to
9629 Vdbus_registered_objects_table. (Bug#9581)
9630 (Fdbus_register_method, Vdbus_registered_objects_table):
9631 Fix docstring.
9632
9633 2011-09-24 Jim Meyering <meyering@redhat.com>
9634
9635 do not ignore write error for any output size
9636 The previous change was incomplete.
9637 While it makes emacs --batch detect the vast majority of stdout
9638 write failures, errors were still ignored whenever the output size is
9639 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9640 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9641 && echo FAIL: ignored write error
9642 FAIL: ignored write error
9643 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9644 && echo FAIL: ignored write error
9645 FAIL: ignored write error
9646 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9647
9648 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9649
9650 * emacs.c (Fkill_emacs): In noninteractive mode exit
9651 non-successfully if a write error occurred on stdout. (Bug#9574)
9652
9653 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9654
9655 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9656 the xassert test.
9657
9658 * dispextern.h (struct it): Update the comment documenting what
9659 can it->OBJECT be.
9660
9661 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9662
9663 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9664 a display string, extend search for cursor position to end of row.
9665 (find_row_edges): If the row ends in a newline from a display
9666 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9667 Handle the case of a display string with multiple newlines.
9668 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9669 non-empty line. Fixes confusing cursor motion with arrow keys at
9670 the beginning of a line that starts with whitespace.
9671
9672 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9673
9674 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9675 (bug#9493).
9676
9677 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9678
9679 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9680 boolean (Bug#9154).
9681
9682 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9683
9684 * xdisp.c (display_line): Record maximum and minimum buffer
9685 positions even if no glyphs were produced (e.g., by a zero-width
9686 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9687 buffer positions that will be removed from the glyph row because
9688 they don't fit.
9689 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9690 column is beyond frame width: don't subtract 1 "pixel" when
9691 computing width of the stretch.
9692 (reseat_at_next_visible_line_start): Undo the change made on
9693 2011-09-17 that saved paragraph information and restored it after
9694 the call to `reseat'. (Bug#9545)
9695
9696 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9697
9698 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9699 and turn window cursor on if cleared (Bug#9415).
9700
9701 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9702
9703 * search.c (boyer_moore): Take unibyte characters from pattern
9704 literally. (Bug#9458)
9705
9706 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9707
9708 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9709
9710 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9711
9712 Fix minor problem found by static checking.
9713 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9714 initialized, to pacify gcc -Wuninitialized.
9715
9716 * fileio.c: Report proper errno when syscall falls.
9717 (Finsert_file_contents): Save and restore errno,
9718 so that report_file_error outputs the correct diagnostic.
9719 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9720
9721 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9722
9723 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9724
9725 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9726
9727 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9728 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9729
9730 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9731
9732 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9733 about the current paragraph and restore it after the call to reseat.
9734
9735 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9736 (bidi_find_paragraph_start): Search back for paragraph beginning
9737 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9738 (bidi_move_to_visually_next): Only trigger paragraph-related
9739 computations when the last character is a newline or at EOB, not
9740 just any NEUTRAL_B. (Bug#9470)
9741
9742 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9743 truncated lines if point is covered by a display string. (Bug#9524)
9744
9745 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9746
9747 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9748 (cons_to_x_long): New function.
9749 (lisp_data_to_selection_data): Use it. Correct the test for
9750 short-versus-long data; it was negated. Break out of vector
9751 loop, for efficiency, when a long datum is discovered.
9752
9753 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9754
9755 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9756
9757 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9758
9759 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9760 GCC PR/17406) by declaring this function with external scope.
9761
9762 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9763
9764 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9765 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9766
9767 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9768
9769 * editfns.c (Fformat): Correctly handle text properties on "%%".
9770
9771 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9772
9773 * xterm.c (x_draw_composite_glyph_string_foreground):
9774 * w32term.c (x_draw_composite_glyph_string_foreground):
9775 * term.c (encode_terminal_code):
9776 * composite.c (composition_update_it, get_composition_id):
9777 * xdisp.c (get_next_display_element)
9778 (fill_composite_glyph_string): Add comments about special meaning
9779 of TAB characters in a composition.
9780
9781 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9782
9783 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9784 This occurs when processing a multibyte format.
9785 Problem reported by Wolfgang Jenker.
9786
9787 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9788
9789 * xdisp.c (try_cursor_movement): Only check for exact match if
9790 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9791
9792 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9793
9794 Remove unused external symbols.
9795 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9796 * xdisp.c (calc_pixel_width_or_height): Now static.
9797 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9798 * indent.c (check_display_width):
9799 * w32term.c: Fix comment to match code.
9800 * xterm.c, xterm.h (x_catching_errors): Remove.
9801
9802 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9803
9804 * xselect.c: Use signed conversions more consistently (Bug#9498).
9805 (selection_data_to_lisp_data): Assume incoming selection data are
9806 signed integers, not unsigned. This is to be consistent with
9807 outgoing selection data, which was modified to use signed integers
9808 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9809 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9810 expects long, not unsigned long.
9811
9812 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9813
9814 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9815 computation of loop end. Reported by Johan Bockgård
9816 <bojohan@gnu.org>.
9817
9818 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9819
9820 * frame.c (Fother_visible_frames_p): Function deleted.
9821
9822 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9823
9824 * indent.c (compute_motion): Process display vector front to back
9825 rather than the other way around. (Bug#2496)
9826
9827 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9828
9829 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9830
9831 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9832
9833 * minibuf.c (Fread_from_minibuffer): Doc fix.
9834
9835 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9836
9837 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9838 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9839
9840 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9841
9842 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9843 value for non-existent files.
9844
9845 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9846
9847 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9848 set its "size" to -1. This will set the modtime_size field of
9849 the corresponding buffer to -1, which is what
9850 verify-visited-file-modtime expects for files that do not exist.
9851 (Bug#9139)
9852
9853 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9854
9855 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9856 here ...
9857 * lisp.h: ... from here. push_key_description is no longer
9858 defined in keyboard.c, so its declaration should not be in
9859 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9860 logically belongs with push_key_description.
9861
9862 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9863
9864 * buffer.h: Include <sys/types.h> instead of <time.h>.
9865 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9866 Problem reported by Herbert J. Skuhra.
9867
9868 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9869
9870 * xml.c (parse_region): Make the parsing work for
9871 non-comment-starting XML files again (bug#9144).
9872
9873 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9874
9875 * image.c (gif_load): Fix calculation of bottom and right corner.
9876 (Bug#9468)
9877
9878 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9879
9880 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9881 redisplay in small windows.
9882
9883 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9884
9885 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9886
9887 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9888
9889 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9890 Operate on live windows only.
9891
9892 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9893
9894 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9895
9896 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9897
9898 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9899 only under bidi iteration.
9900
9901 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9902
9903 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9904
9905 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9906
9907 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9908 Without this fix, the command to link temacs failed due to an
9909 undefined symbol __builtin_isnan. This is because
9910 /usr/include/iso/math_c99.h #defines isnan(x) to
9911 __builtin_isnan(x), but the bundled gcc, which identifies itself
9912 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9913 a __builtin_isnan.
9914 * floatfns.c (isnan): #undef, and then #define to a clone of
9915 what's in data.c.
9916 (Fisnan): Always define, since it's always available now.
9917 (syms_of_floatfns): Always define isnan at the Lisp level.
9918
9919 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9920
9921 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9922
9923 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9924
9925 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9926 The previous code assumed that file offsets (off_t values) fit in
9927 EMACS_INT variables, which is not true on typical 32-bit hosts.
9928 The code messed up by falsely reporting buffer overflow in cases
9929 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9930 when "big" contains more than 2**29 bytes, even though this
9931 inserts just one byte and does not overflow the buffer.
9932 (Finsert_file_contents): Store file offsets as off_t
9933 values, not as EMACS_INT values. Check for overflow when
9934 converting between EMACS_INT and off_t. When checking for
9935 buffer overflow or for overlap, take the offsets into account.
9936 Don't use EMACS_INT for small values where int suffices.
9937 When checking for overlap, fix a typo: ZV was used where
9938 ZV_BYTE was intended.
9939 (Fwrite_region): Don't assume off_t fits into 'long'.
9940 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9941
9942 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9943
9944 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9945
9946 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9947
9948 sprintf-related integer and memory overflow issues (Bug#9412).
9949
9950 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9951 (esprintf, exprintf, evxprintf): New functions.
9952 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9953 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9954 (modify_event_symbol): Do not assume that the length of
9955 name_alist_or_stem is safe to alloca and fits in int.
9956 (Fexecute_extended_command): Likewise for function name and binding.
9957 (Frecursion_depth): Wrap around reliably on integer overflow.
9958 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9959 since some callers pass EMACS_INT values.
9960 (Fsingle_key_description): Don't crash if symbol name contains more
9961 than MAX_ALLOCA bytes.
9962 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9963 (get_minibuffer): Arg is now EMACS_INT, not int.
9964 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9965 (esprintf, exprintf, evxprintf): New decls.
9966 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9967
9968 * dbusbind.c (signature_cat): New function.
9969 (xd_signature, Fdbus_register_signal):
9970 Do not overrun buffer; instead, report string overflow.
9971
9972 * dispnew.c (add_window_display_history): Don't overrun buffer.
9973 Truncate instead; this is OK since it's just a log.
9974
9975 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9976 even if the time zone offset is outlandishly large.
9977 Don't mishandle offset == INT_MIN.
9978
9979 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9980 when creating daemon; the previous buffer-overflow check was incorrect.
9981
9982 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9983 which has the guts of the old verror function.
9984
9985 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9986 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9987
9988 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9989 (font_unparse_xlfd): Don't blindly alloca long strings.
9990 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9991 fits in int, when using sprintf. Use single snprintf to count
9992 length of string rather than counting it via multiple sprintfs;
9993 that's simpler and more reliable.
9994 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9995 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9996 sprintf, in case result does not fit in int.
9997
9998 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9999 (fontset_from_font): Print it.
10000
10001 * frame.c (tty_frame_count): Now printmax_t, not int.
10002 (make_terminal_frame, set_term_frame_name): Print it.
10003 (x_report_frame_params): In X, window IDs are unsigned long,
10004 not signed long, so print them as unsigned.
10005 (validate_x_resource_name): Check for implausibly long names,
10006 and don't assume name length fits in 'int'.
10007 (x_get_resource_string): Don't blindly alloca invocation name;
10008 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10009 not fit in int.
10010
10011 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10012 (xg_check_special_colors, xg_set_geometry):
10013 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10014
10015 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10016 Use esprintf, not sprintf, in case result does not fit in int.
10017
10018 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10019 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10020 it as a large positive number.
10021 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10022 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10023
10024 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10025 in case result does not fit in int.
10026
10027 * print.c (float_to_string): Detect width overflow more reliably.
10028 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10029 buffer overrun. Don't assume list length fits in 'int'. Treat
10030 print length of 0 as 0, not as infinity; to be consistent with other
10031 uses of print length in this function. Don't overflow print length
10032 index. Don't assume hash table size fits in 'long', or that
10033 vectorlike size fits in 'unsigned long'.
10034
10035 * process.c (make_process): Use printmax_t, not int, to format
10036 process-name gensyms.
10037
10038 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10039
10040 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10041 to avoid potential buffer overrun.
10042
10043 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10044 if X resource line is longer than 512 bytes.
10045
10046 * xfns.c (x_window): Make sprintf buffer a bit bigger
10047 to avoid potential buffer overrun.
10048
10049 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10050
10051 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10052
10053 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10054
10055 Integer overflow fixes for scrolling, etc.
10056 Without these, Emacs silently mishandles large integers sometimes.
10057 For example, "C-u 4294967297 M-x recenter" was treated as if
10058 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10059
10060 * xdisp.c (try_window_id): Check Emacs fixnum range before
10061 converting to 'int'.
10062
10063 * window.c (window_scroll_line_based, Frecenter):
10064 Check that an Emacs fixnum is in range before assigning it to 'int'.
10065 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10066 values converted from Emacs fixnums.
10067 (Frecenter): Don't wrap around a line count if it is out of 'int'
10068 range; instead, treat it as an extreme value.
10069 (Fset_window_configuration, compare_window_configurations):
10070 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10071
10072 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10073 that can exceed INT_MAX. Check that EMACS_INT value is in range
10074 before assigning it to the (possibly-narrower) index.
10075 (match_limit): Don't assume that a fixnum can fit in 'int'.
10076
10077 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10078 exceed INT_MAX.
10079
10080 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10081 (Fvertical_motion): Don't wrap around LINES values that don't fit
10082 in 'int'. Instead, treat them as extreme values. This is good
10083 enough for windows, which can't have more than INT_MAX lines anyway.
10084
10085 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10086
10087 * Require libxml/parser.h to avoid compilation warning.
10088
10089 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10090
10091 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10092 since this reportedly can destroy thread storage.
10093
10094 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10095
10096 * syntax.c (find_defun_start): Update all cache variables if
10097 exiting early (Bug#9401).
10098
10099 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10100
10101 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10102
10103 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10104 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10105 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10106
10107 * term.c (tty_append_glyph): New function.
10108 (produce_stretch_glyph): Static function and its prototype deleted.
10109
10110 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10111 Add prototypes.
10112
10113 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10114
10115 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10116 when checking :margin (Bug#9390).
10117 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10118 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10119 so that the name doesn't mislead. All uses changed.
10120
10121 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10122
10123 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10124 set_tty_hooks.
10125
10126 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10127
10128 * xdisp.c (move_it_to): Don't bail out early when reaching
10129 position beyond to_charpos, if we are scanning backwards.
10130 (move_it_vertically_backward): When DY == 0, make sure we get to
10131 the first character in the line after the newline.
10132
10133 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10134
10135 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10136 (ccl_driver): Do not generate an out-of-range pointer.
10137 (Fccl_execute_on_string): Remove unnecessary check for
10138 integer overflow, noted by Stefan Monnier in
10139 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10140 Remove a FIXME that didn't need fixing.
10141 Simplify the newly-introduced buffer reallocation code.
10142
10143 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10144
10145 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10146
10147 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10148
10149 Integer and memory overflow issues (Bug#9196).
10150
10151 * doc.c (get_doc_string): Rework so that
10152 get_doc_string_buffer_size is the actual buffer size, rather than
10153 being 1 less than the actual buffer size; this makes xpalloc more
10154 convenient.
10155
10156 * image.c (x_allocate_bitmap_record, cache_image):
10157 * xselect.c (Fx_register_dnd_atom):
10158 Simplify previous changes by using xpalloc.
10159
10160 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10161 since either will do and ptrdiff_t is convenient with xpalloc.
10162
10163 * charset.c (charset_table_size)
10164 (struct charset_sort_data.priority): Now ptrdiff_t.
10165 (charset_compare): Don't overflow if priorities differ greatly.
10166 (Fsort_charsets): Don't assume list length fits in int.
10167 Check for size-calculation overflow when allocating sort data.
10168 (syms_of_charset): Allocate an initial charset table that is
10169 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10170
10171 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10172
10173 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10174 The actual value is always <= INT_MAX, and leaving it unsigned made
10175 overflow checking harder.
10176
10177 * dispextern.h (struct glyph_matrix.rows_allocated)
10178 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10179 with xpalloc. The values are still always <= INT_MAX.
10180
10181 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10182
10183 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10184 (SAFE_NALLOCA): New macro.
10185
10186 * region-cache.c (struct boundary.pos, find_cache_boundary)
10187 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10188 (set_cache_region, invalidate_region_cache)
10189 (revalidate_region_cache, know_region_cache, region_cache_forward)
10190 (region_cache_backward, pp_cache):
10191 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10192 so that ptrdiff_t * can be passed to xpalloc.
10193 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10194 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10195 (pp_cache): Don't assume cache_len fits in int.
10196 * region-cache.h: Adjust extern decls to match.
10197
10198 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10199 EMACS_INT, since either will do, for xpalloc.
10200
10201 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10202 (xnmalloc, xnrealloc, xpalloc): New functions.
10203
10204 * bidi.c (bidi_shelve_header_size): New constant.
10205 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10206 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10207
10208 * bidi.c (bidi_cache_shrink):
10209 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10210 (overlay_strings):
10211 Don't update size of array until after memory allocation succeeds,
10212 because xmalloc/xrealloc may not return.
10213 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10214 now that we have proper integer overflow checking.
10215 (record_overlay_string, overlay_strings): Catch overflows when
10216 calculating size of overlay_str_buf.
10217
10218 * callproc.c (Fcall_process): Check for size overflow when
10219 calculating size of args2.
10220 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10221 Normally we prefer signed values, but sticking with ptrdiff_t would
10222 require adding more-complicated checks.
10223
10224 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10225 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10226 Redo buffer-overflow calculations to avoid integer overflow.
10227 Add a FIXME comment where memory seems to be over-allocated.
10228
10229 * character.c (Fstring): Check for size-calculation overflow.
10230
10231 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10232 unnecessary integer overflow. Check for size overflow.
10233 (encode_coding_object): Don't update size until xmalloc succeeds.
10234
10235 * composite.c (get_composition_id): Check for overflow in glyph
10236 length calculations.
10237
10238 Integer and memory overflow fixes for display code.
10239 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10240 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10241 (scrolling_window): Check for overflow in size calculations.
10242 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10243 Don't assume glyph table len fits in int.
10244 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10245 (row_table_size): Now ptrdiff_t, not int.
10246 (scrolling_window): Avoid overflow in size calculations.
10247 Don't update size until allocation succeeds.
10248 * fns.c (concat): Check for overflow in size calculations.
10249 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10250 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10251 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10252
10253 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10254 (get_doc_string): Check for size calculation overflow.
10255 Don't update size until allocation succeeds.
10256 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10257 EMACS_INT, where ptrdiff_t will do.
10258 (Fsubstitute_command_keys): Check for string overflow.
10259
10260 * editfns.c (set_time_zone_rule): Don't assume environment length
10261 fits in int.
10262 (message_length): Now ptrdiff_t, not int.
10263 (Fmessage_box): Don't update size until allocation succeeds.
10264 Don't assume message length fits in int.
10265 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10266
10267 * emacs.c (main): Do not reallocate argv, since there is a null at
10268 the end that can be overwritten, and this way there's no need to
10269 worry about size-calculation overflow.
10270 (sort_args): Check for size-calculation overflow.
10271
10272 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10273 alloc succeeds.
10274 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10275
10276 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10277 (x_set_scroll_bar_width, x_figure_window_size):
10278 Check for integer overflow.
10279 (x_set_alpha): Do not assume XINT fits in int.
10280
10281 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10282 This is for the members text_lines, text_cols, total_lines, total_cols,
10283 where the system imposes an 'int' limit.
10284
10285 * fringe.c (Fdefine_fringe_bitmap):
10286 Don't update size until alloc works.
10287
10288 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10289 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10290
10291 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10292 Check for size-calculation overflow.
10293 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10294 do, as we prefer signed integers.
10295 (id_to_widget.max_size, id_to_widget.used)
10296 (xg_store_widget_in_map, xg_remove_widget_from_map)
10297 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10298 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10299 Use and return ptrdiff_t, not int.
10300 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10301 * gtkutil.h: Change prototypes to match the above.
10302
10303 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10304 are duplicate now that they've been promoted to lisp.h.
10305 (x_allocate_bitmap_record, x_alloc_image_color)
10306 (make_image_cache, cache_image, xpm_load):
10307 Don't update size until alloc is done.
10308 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10309 (x_detect_edges):
10310 Check for size calculation overflow.
10311 (ct_colors_allocated_max): New constant.
10312 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10313 overflow.
10314
10315 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10316 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10317 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10318 Use ptrdiff_t, not int, to count maps.
10319 (read_char_minibuf_menu_prompt): Check for overflow in size
10320 calculations. Don't update size until allocation succeeds.
10321 Redo calculations to avoid overflow.
10322 * keyboard.h: Change prototypes to match the above.
10323
10324 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10325 to count maps.
10326 (current_minor_maps): Check for size calculation overflow.
10327 * keymap.h: Change prototypes to match the above.
10328
10329 * lread.c (read1, init_obarray): Don't update size until alloc done.
10330
10331 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10332 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10333
10334 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10335 Now ptrdiff_t, not int.
10336 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10337 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10338
10339 * process.c (Fnetwork_interface_list): Check for overflow
10340 in size calculation.
10341
10342 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10343
10344 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10345 overflow. Don't bother calling xmalloc when xrealloc will do.
10346
10347 * search.c (Freplace_match): Check for size calculation overflow.
10348 (Fset_match_data): Don't assume list lengths fit in 'int'.
10349
10350 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10351 for command line length. Do not attempt to address one before the
10352 beginning of an array, as that's not portable.
10353
10354 * term.c (max_frame_lines): Remove; unused.
10355 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10356 not int.
10357 (encode_terminal_code, calculate_costs): Check for size
10358 calculation overflow.
10359 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10360 table lengths and related sizes. Don't update size until alloc
10361 done. Redo calculations to avoid overflow.
10362 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10363
10364 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10365 subtracting pointers.
10366 (gobble_line): Check for overflow more carefully. Don't update size
10367 until alloc done.
10368
10369 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10370 Don't update size until alloc done.
10371 Redo size calculations to avoid overflow.
10372 Check for size calculation overflow.
10373 (main) [DEBUG]: Fix typo in invoking tparam1.
10374
10375 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10376 Use ptrdiff_t, not int, for sizes.
10377 (store_mode_line_noprop_char): Don't update size until alloc done.
10378
10379 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10380 Use ptrdiff_t, not int, for sizes.
10381 (Finternal_make_lisp_face, cache_face):
10382 Check for size calculation overflow.
10383 (cache_face): Treat size calculation overflows as if they were
10384 memory exhaustion (the usual treatment), rather than aborting.
10385
10386 * xfns.c (x_encode_text, x_set_name_internal)
10387 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10388 sizes, since they can exceed INT_MAX in size. Check for size
10389 calculation overflow.
10390
10391 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10392 (xg_select): Check for size calculation overflow.
10393 Don't update size until alloc done.
10394
10395 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10396 as sprintf is limited to int lengths.
10397
10398 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10399 (X_LONG_MIN): New macros.
10400 Use them to make the following changes clearer.
10401 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10402 This change doesn't affect the value now, but it may help remind
10403 future maintainers not to raise the value too much later.
10404 (SELECTION_QUANTUM): Remove, replacing with ...
10405 (selection_quantum): ... new function, which avoids overflow.
10406 All uses changed.
10407 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10408 assumption that selection length fits in 'int'.
10409 (x_reply_selection_request, x_handle_selection_request)
10410 (x_get_window_property, receive_incremental_selection)
10411 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10412 (lisp_data_to_selection_data, clean_local_selection_data):
10413 Use ptrdiff_t, not int, to record length of selection.
10414 (x_reply_selection_request, x_get_window_property)
10415 (receive_incremental_selection, x_property_data_to_lisp):
10416 Redo calculations to avoid overflow.
10417 (x_reply_selection_request): When sending hint, ceiling it at
10418 X_LONG_MAX rather than relying on wraparound overflow to send
10419 something.
10420 (x_get_window_property, receive_incremental_selection)
10421 (lisp_data_to_selection_data, x_property_data_to_lisp):
10422 Check for size-calculation overflow.
10423 (x_get_window_property, receive_incremental_selection)
10424 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10425 Don't store size until memory allocation succeeds.
10426 (x_get_window_property): Plug memory leak on memory exhaustion.
10427 Don't double-block input; malloc is safe here. Don't assume 2**34
10428 - 4 fits in unsigned long. Add an xassert to check
10429 XGetWindowProperty overflow. Be more careful about overflow
10430 calculations, and distinguish size from memory overflow better.
10431 (receive_incremental_selection): When tracing, don't assume
10432 unsigned int is less than INT_MAX.
10433 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10434 harmful) conversions of unsigned short to int.
10435 (lisp_data_to_selection_data): Don't assume that integers
10436 in the range -65535 through -1 fit in an X unsigned short.
10437 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10438 result parameters unless successful. Rely on cons_to_unsigned
10439 to report problems with elements; the old code wasn't right anyway.
10440 (x_check_property_data): Check for int overflow; we cannot use
10441 a wider type due to X limits.
10442 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10443
10444 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10445
10446 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10447 (x_term_init): Check for size calculation overflow.
10448 (x_color_cells): Don't store size until memory allocation succeeds.
10449 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10450 Don't assume alloca size is less than MAX_ALLOCA.
10451 (x_term_init): Don't assume length fits in int (sprintf is limited
10452 to int size).
10453
10454 Use ptrdiff_t for composition IDs.
10455 * character.c (lisp_string_width):
10456 * composite.c (composition_table_size, n_compositions)
10457 (get_composition_id, composition_gstring_from_id):
10458 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10459 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10460 * window.c (Frecenter):
10461 Use ptrdiff_t, not int, for composition IDs.
10462 * composite.c (get_composition_id): Check for integer overflow.
10463 * composite.h: Adjust prototypes to match the above changes.
10464
10465 Use ptrdiff_t for hash table indexes.
10466 * category.c (hash_get_category_set):
10467 * ccl.c (ccl_driver):
10468 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10469 * coding.c (coding_system_charset_list, detect_coding_system):
10470 * coding.h (struct coding_system.id):
10471 * composite.c (get_composition_id, gstring_lookup_cache):
10472 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10473 * image.c (xpm_get_color_table_h):
10474 * lisp.h (hash_lookup, hash_put):
10475 * minibuf.c (Ftest_completion):
10476 Use ptrdiff_t for hash table indexes, not int (which is too
10477 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10478 32-bit --with-wide-int hosts).
10479
10480 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10481 Add a FIXME comment about memory leaks.
10482 (syms_of_charset): Don't assume xmalloc returns.
10483
10484 Don't assume that stated character widths fit in int.
10485 * character.c (Fchar_width, c_string_width, lisp_string_width):
10486 * character.h (CHAR_WIDTH):
10487 * indent.c (MULTIBYTE_BYTES_WIDTH):
10488 Use sanitize_char_width to avoid undefined and/or bad behavior
10489 with outlandish widths.
10490 * character.h (sanitize_tab_width): Rename from sanitize_width,
10491 now that we have two such functions. All uses changed.
10492 (sanitize_char_width): New inline function.
10493
10494 Don't assume that tab-width fits in int.
10495 * character.h (sanitize_width): New inline function.
10496 (SANE_TAB_WIDTH): New macro.
10497 (ASCII_CHAR_WIDTH): Use it.
10498 * indent.c (sane_tab_width): Remove. All uses replaced by
10499 SANE_TAB_WIDTH (current_buffer).
10500 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10501
10502 * fileio.c: Integer overflow issues with file modes.
10503 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10504
10505 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10506 Remove unreachable code.
10507 (read_hex, load_charset_map_from_file): Check for integer overflow.
10508
10509 * xterm.c: Don't go over XClientMessageEvent limit.
10510 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10511 (x_send_scroll_bar_event): Likewise. Check that the size does not
10512 exceed limits imposed by XClientMessageEvent, as well as the usual
10513 ptrdiff_t and size_t limits.
10514
10515 * keyboard.c: Overflow, signedness and related fixes.
10516 (make_lispy_movement): Use same integer type in forward decl
10517 that is used in the definition.
10518 (read_key_sequence, keyremap_step):
10519 Change bufsize argument back to int, undoing my 2011-03-30 change.
10520 We prefer signed types, and int is wide enough here.
10521 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10522 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10523 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10524 length, not size_t. Use ptrdiff_t for index, not int.
10525 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10526 possibility of integer overflow.
10527
10528 Overflow, signedness and related fixes for images.
10529
10530 * dispextern.h (struct it.stack[0].u.image.image_id)
10531 (struct_it.image_id, struct image.id, struct image_cache.size)
10532 (struct image_cache.used, struct image_cache.ref_count):
10533 * gtkutil.c (update_frame_tool_bar):
10534 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10535 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10536 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10537 * nsmenu.m (update_frame_tool_bar):
10538 * xdisp.c (calc_pixel_width_or_height):
10539 * xfns.c (image_cache_refcount):
10540 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10541 on typical 64-bit hosts.
10542
10543 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10544 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10545 Omit unnecessary casts to int.
10546 (parse_image_spec): Check that integers fall into 'int' range
10547 when the callers expect that.
10548 (image_ascent): Redo ascent calculation to avoid int overflow.
10549 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10550 (lookup_image): Remove unnecessary tests.
10551 (xbm_image_p): Locals are now of int, not EMACS_INT,
10552 since parse_image_check makes sure they fit into int.
10553 (png_load, gif_load, svg_load_image):
10554 Prefer int to unsigned where either will do.
10555 (tiff_handler): New function, combining the cores of the
10556 old tiff_error_handler and tiff_warning_handler.
10557 This function is rewritten to use vsnprintf and thereby avoid
10558 stack buffer overflows. It uses only the features of vsnprintf
10559 that are common to both POSIX and native Microsoft.
10560 (tiff_error_handler, tiff_warning_handler): Use it.
10561 (tiff_load, gif_load, imagemagick_load_image):
10562 Don't assume :index value fits in 'int'.
10563 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10564 (imagemagick_load_image): Check that crop parameters fit into
10565 the integer types that MagickCropImage accepts. Don't assume
10566 Vimagemagick_render_type has a nonnegative value. Don't assume
10567 size_t fits in 'long'.
10568 (gs_load): Use printmax_t to print the widest integers possible.
10569 Check for integer overflow when computing image height and width.
10570
10571 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10572
10573 * xdisp.c (redisplay_window): Don't force window start if point
10574 will be invisible in the resulting window. (Bug#9324)
10575
10576 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10577
10578 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10579 the display spec is of the form `(space ...)'.
10580 (handle_display_spec): Return the value returned by
10581 handle_single_display_spec, not just 1 or zero.
10582 (handle_single_display_spec): If the display spec is of the form
10583 `(space ...)', and specifies display in the text area, return 2
10584 rather than 1.
10585 (try_cursor_movement): Check for the need to scroll more
10586 accurately, and prefer exact match for point under bidi.
10587 Don't advance `row' beyond the last row of the window.
10588
10589 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10590 into disp_prop; all users changed.
10591
10592 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10593 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10594 for the text covered by the display property.
10595
10596 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10597
10598 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10599 Change return value to nil.
10600 (Frecord_buffer): Delete unused function.
10601
10602 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10603
10604 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10605 buffers, return left-to-right.
10606 (set_cursor_from_row): Consider candidate row a win if its glyph
10607 represents a newline and point is on that newline. Fixes cursor
10608 positioning on the newline at EOL of R2L text within L2R
10609 paragraph, and vice versa.
10610 (try_cursor_movement): Check continued rows, in addition to
10611 continuation rows. Fixes unwarranted scroll when point enters a
10612 continued line of R2L text within an L2R paragraph, or vice versa.
10613 (cursor_row_p): Consider the case of point being equal to
10614 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10615 from the end of a short line to the beginning of a continued line
10616 of R2L text within L2R paragraph.
10617 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10618 composed characters.
10619
10620 * bidi.c (bidi_check_type): Use xassert.
10621 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10622 members.
10623
10624 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10625
10626 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10627 a character.
10628
10629 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10630
10631 * nsfont.m (ns_otf_to_script): Fix typo.
10632
10633 2011-08-22 Kenichi Handa <handa@m17n.org>
10634
10635 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10636 extra slot even if the purpose is char-code-property-table.
10637
10638 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10639
10640 * xdisp.c (redisplay_window): When computing centering_position,
10641 account for the height of the header line. (Bug#8874)
10642
10643 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10644 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10645 candidate is selected by the mouse, and that candidate has a
10646 composed character under the mouse.
10647
10648 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10649 coordinates reported by pos-visible-in-window-p for a composed
10650 character in column zero.
10651
10652 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10653
10654 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10655
10656 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10657
10658 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10659 consider it a hit if to_charpos is anywhere in the range of the
10660 composed buffer positions.
10661
10662 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10663
10664 * image.c (gif_load): Don't assume that each subimage has the same
10665 dimensions as the base image. Handle disposal method that is
10666 "undefined" by the gif spec (Bug#9335).
10667
10668 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10669
10670 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10671 (Fcondition_case): Document `debug' symbol in error handler.
10672
10673 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10674
10675 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10676 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10677 from an Org mode buffer to a Speedbar frame.
10678
10679 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10680 a composition, take its buffer position from IT->cmp_it.charpos.
10681 Fixes cursor positioning at the beginning of a line that begins
10682 with a composed character.
10683
10684 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10685
10686 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10687 character bidirectional type, use STRONG_L instead. Fixes crashes
10688 in a buffer produced by `describe-categories'.
10689
10690 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10691 members before the level stack, so they would be saved and
10692 restored when copying iterator state. Fixes incorrect reordering
10693 around TABs covered by display properties.
10694
10695 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10696
10697 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10698
10699 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10700
10701 * eval.c (internal_condition_case, internal_condition_case_1)
10702 (internal_condition_case_2, internal_condition_case_n):
10703 Remove unnecessary aborts (Bug#9081).
10704
10705 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10706
10707 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10708 has no `load' handler, try opening the file locally. (Bug#9311)
10709
10710 2011-08-16 Ken Brown <kbrown@cornell.edu>
10711
10712 * gmalloc.c: Expand comment.
10713
10714 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10715
10716 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10717 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10718
10719 2011-08-16 Ken Brown <kbrown@cornell.edu>
10720
10721 Fix memory allocation problems in Cygwin build (Bug#9273).
10722
10723 * unexcw.c ( __malloc_initialized): Declare external variable.
10724 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10725
10726 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10727 New variables.
10728 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10729 dumped emacs.
10730 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10731 in the static heap.
10732 [CYGWIN] (special_realloc): New function.
10733 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10734 requests to realloc storage in the static heap.
10735
10736 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10737
10738 * bidi.c (bidi_initialize): Remove unused local.
10739
10740 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10741
10742 * bidimirror.h:
10743 * biditype.h: Remove file.
10744 * makefile.w32-in ($(BLD)/bidi.$(O)):
10745 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10746
10747 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10748
10749 * chartab.c: Improve commentary for the uniprop_table API.
10750
10751 * bidi.c (bidi_paragraph_init): Support zero value of
10752 bidi_ignore_explicit_marks_for_paragraph_level.
10753 (bidi_initialize): Use uniprop_table instead of including
10754 biditype.h and bidimirror.h.
10755
10756 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10757 coordinates of the iterator when restoring from ppos_it.
10758 (Bug#9296)
10759
10760 2011-08-14 Kenichi Handa <handa@m17n.org>
10761
10762 * process.c (create_process): Call setup_process_coding_systems
10763 after the pid of the process is set to -1 (Bug#8162).
10764
10765 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10766
10767 * xdisp.c (move_it_in_display_line_to): Don't invoke
10768 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10769 ppos_it. Fixes vertical cursor motion when line beginning is
10770 covered by an image. (Bug#9296)
10771
10772 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10773
10774 * nsterm.h (ns_run_ascript): Declare.
10775 (NSAPP_DATA2_RUNASSCRIPT): Define.
10776
10777 * nsfns.m (as_script, as_result, as_status): New static variables.
10778 (ns_run_ascript): New function.
10779 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10780 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10781 the event loop. Get status from as_status (Bug#7276).
10782
10783 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10784 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10785 the event loop (Bug#7276).
10786
10787 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10788
10789 * gnutls.c (QCgnutls_bootprop_priority)
10790 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10791 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10792 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10793 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10794 (QCgnutls_bootprop_verify_hostname_error)
10795 (QCgnutls_bootprop_callbacks_verify): Rename from
10796 Qgnutls_bootprop_..., all uses changed.
10797
10798 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10799 uses changed.
10800
10801 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10802
10803 * xfaces.c (Qframe_set_background_mode): Now static.
10804 * dispextern.h (Qframe_set_background_mode): Remove decl.
10805
10806 * process.c (Fnetwork_interface_info): Declare local only if needed.
10807
10808 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10809
10810 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10811 (Fnetwork_interface_list): Allocate in increments of bytes instead
10812 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10813 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10814 sockaddr.
10815 (struct ifflag_def): notrailers is smart on OSX.
10816 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10817 Get hardware address with getifaddrs if available.
10818
10819 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10820
10821 * xdisp.c (iterate_out_of_display_property): xassert that
10822 IT->position is set to within IT->object's boundaries. Break from
10823 the loop as soon as EOB is reached; avoids infloops in redisplay
10824 when IT->position is set up wrongly due to some bug.
10825 Set IT->current to match the bidi iterator unconditionally.
10826 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10827 entry. Force push_it to save on the stack the current
10828 buffer/string position, to be restored by pop_it. Fix flags in
10829 the iterator structure wrt the object coming from a display
10830 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10831 properties. (Bug#9284)
10832
10833 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10834
10835 * fontset.c (fontset_get_font_group): Add proper type checks.
10836 (Bug#9172)
10837
10838 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10839
10840 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10841 and LC_VERSION_MIN_MACOSX.
10842 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10843 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10844
10845 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10846
10847 * xdisp.c (forward_to_next_line_start): Allow to use the
10848 no-display-properties-and-no-overlays under bidi display.
10849 Set disp_pos in the bidi iterator to avoid searches for display
10850 properties and overlays.
10851
10852 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10853
10854 * editfns.c (Fset_time_zone_rule): Document relationship with the
10855 setenv function.
10856
10857 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10858 the font entity extracted from the cache (Bug#8109).
10859
10860 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10861
10862 * composite.c (autocmp_chars): Don't reset point. That is done by
10863 restore_point_unwind (Bug#5984).
10864
10865 2011-08-07 Juri Linkov <juri@jurta.org>
10866
10867 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10868 to show the arg `TIME' instead of `TIMEVAL'.
10869
10870 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10871
10872 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10873 display property strides EOL and includes a newline, as in
10874 longlines-mode. (Bug#9254)
10875 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10876 word-wrap under bidirectional display. (Bug#9224)
10877
10878 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10879 is non-zero, even if the data buffer is NULL. Fixes a crash in
10880 vertical-motion with longlines-mode. (Bug#9254)
10881
10882 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10883
10884 * bidi.c <bidi_cache_total_alloc>: Now static.
10885 (bidi_initialize): Initialize bidi_cache_total_alloc.
10886
10887 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10888 cache. (Bug#9221)
10889
10890 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10891 amount allocated this far in `bidi_cache_total_alloc'.
10892 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10893 non-zero, only free the data buffer without restoring the cache
10894 contents. All callers changed.
10895
10896 * dispextern.h (bidi_unshelve_cache): Update prototype.
10897
10898 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10899 (move_it_in_display_line, move_it_to)
10900 (move_it_vertically_backward, move_it_by_lines): Replace the call
10901 to xfree to an equivalent call to bidi_unshelve_cache.
10902 (move_it_in_display_line_to): Fix logic of returning
10903 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10904
10905 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10906
10907 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10908 came from a string character with a `cursor' property. (Bug#9229)
10909
10910 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10911
10912 * Makefile.in (LIB_PTHREAD): New variable.
10913 (LIBES): Add LIB_PTHREAD (Bug#9216).
10914
10915 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10916 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10917
10918 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10919
10920 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10921
10922 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10923
10924 * xterm.c (x_find_topmost_parent): New function.
10925 (x_set_frame_alpha): Find topmost parent window with
10926 x_find_topmost_parent and set the property there also (bug#9181).
10927 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10928
10929 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10930
10931 * callproc.c (Fcall_process): Avoid vfork clobbering
10932 the local vars buffer, coding_systems, current_dir.
10933
10934 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10935
10936 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10937
10938 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10939
10940 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10941 so that it is not optimized away.
10942
10943 * xdisp.c (compute_display_string_pos): Remove unused local.
10944
10945 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10946
10947 Fix slow cursor motion and scrolling in large buffers with
10948 selective display, like Org Mode buffers. (Bug#9218)
10949
10950 * dispextern.h (struct bidi_it): New member disp_prop_p.
10951
10952 * xdisp.c: Remove one-slot cache of display string positions.
10953 (compute_display_string_pos): Accept an additional argument
10954 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10955 for a display string or property. If found, set DISP_PROP_P
10956 non-zero.
10957
10958 * bidi.c (bidi_fetch_char): Accept an additional argument
10959 DISP_PROP_P, and pass it to compute_display_string_pos.
10960 Only handle text covered by a display string if DISP_PROP_P is returned
10961 non-zero. All callers of bidi_fetch_char changed.
10962
10963 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10964
10965 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10966
10967 2010-12-03 Don March <don@ohspite.net>
10968
10969 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10970 last character M-[char] is translated to ESC [char] (bug#7541).
10971
10972 2011-08-02 Kenichi Handa <handa@m17n.org>
10973
10974 * lisp.h (uniprop_table): Extern it.
10975
10976 * chartab.c (uniprop_table): Make it non-static.
10977
10978 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10979
10980 * xdisp.c (forward_to_next_line_start): Accept additional argument
10981 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10982 on the newline.
10983 (reseat_at_next_visible_line_start): Use the bidi iterator state
10984 returned by forward_to_next_line_start to restore the state of
10985 it->bidi_it after backing up to previous newline. (Bug#9212)
10986
10987 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10988
10989 * regex.c (re_comp): Protoize.
10990 (re_exec): Fix return type.
10991 (regexec): Fix type of `ret'. (Bug#9203)
10992
10993 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10994
10995 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10996 This is needed if max-image-size is a floating-point number.
10997
10998 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10999
11000 * print.c (print_object): Print empty symbol as ##.
11001
11002 * lread.c (read1): Read ## as empty symbol.
11003
11004 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11005
11006 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11007 setting frame foreground color (Bug#9175).
11008 (x_set_background_color): Likewise.
11009
11010 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11011 contents (Bug#9176).
11012 (EmacsTooltip -init): Remove bezels and add shadows to
11013 tooltip windows.
11014
11015 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11016 or scroll bar (Bug#8470).
11017
11018 * nsfont.m (nsfont_open): Remove assignment to voffset and
11019 unnecessary vars hshink, expand, hd, full_height, min_height.
11020 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11021
11022 * nsterm.h (nsfont_info): Remove voffset field.
11023
11024 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11025
11026 Implement strike-through and overline on NextStep (Bug#8863).
11027
11028 * nsfont.m (nsfont_open): Use underline position provided by font,
11029 instead of hard-coded value of 2.
11030 (nsfont_draw): Call ns_draw_text_decoration instead.
11031
11032 * nsterm.h: Add declaration for ns_draw_text_decoration.
11033
11034 * nsterm.m (ns_draw_text_decoration): New function for drawing
11035 underline, overline, and strike-through.
11036 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11037 ns_draw_text_decoration. Change treatment of cursor drawing to
11038 accommodate underlining, etc.
11039
11040 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11041
11042 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11043 default.
11044
11045 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11046
11047 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11048 Without this fix, if a signal arrives just after memory fills up,
11049 'malloc' might be invoked reentrantly.
11050
11051 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11052 In other words, assume that every image size is allowed, on non-X
11053 hosts. This assumption is probably wrong, but it lets Emacs compile.
11054
11055 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11056
11057 * regex.c (re_iswctype): Convert return values to boolean.
11058
11059 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11060
11061 * xdisp.c (compute_display_string_pos): Don't use cached display
11062 string position if the buffer had its restriction changed.
11063 (Bug#9184)
11064
11065 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11066
11067 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11068
11069 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11070
11071 Integer signedness and overflow and related fixes. (Bug#9079)
11072
11073 * bidi.c: Integer size and overflow fixes.
11074 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11075 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11076 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11077 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11078 (bidi_find_other_level_edge):
11079 Use ptrdiff_t instead of EMACS_INT where either will do.
11080 This works better on 32-bit hosts configured --with-wide-int.
11081 (bidi_cache_ensure_space): Check for size-calculation overflow.
11082 Use % rather than repeated addition, for better worst-case speed.
11083 Don't set bidi_cache_size until after xrealloc returns, because it
11084 might not return.
11085 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11086 (bidi_cache_ensure_space): Also check that the bidi cache size
11087 does not exceed that of the largest Lisp string or buffer. See Eli
11088 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11089
11090 * alloc.c (__malloc_size_t): Remove.
11091 All uses replaced by size_t. See Andreas Schwab's note
11092 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11093
11094 * image.c: Improve checking for integer overflow.
11095 (check_image_size): Assume that f is nonnull, since
11096 it is always nonnull in practice. This is one less thing to
11097 worry about when checking for integer overflow later.
11098 (x_check_image_size): New function, which checks for integer
11099 overflow issues inside X.
11100 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11101 This removes the need for a memory_full check.
11102 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11103 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11104 (xbm_read_bitmap_data): Change locals back to 'int', since
11105 their values must fit in 'int'.
11106 (xpm_load_image, png_load, tiff_load):
11107 Invoke x_create_x_image_and_pixmap earlier,
11108 to avoid much needless work if the image is too large.
11109 (tiff_load): Treat overly large images as if
11110 x_create_x_image_and_pixmap failed, not as malloc failures.
11111 (gs_load): Use x_check_image_size.
11112
11113 * gtkutil.c: Omit integer casts.
11114 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11115 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11116
11117 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11118
11119 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11120 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11121 would wrongly return t on a 64-bit host.
11122
11123 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11124 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11125 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11126 and therefore cause GCC to emit a bogus diagnostic in some cases.
11127
11128 * image.c: Integer signedness and overflow and related fixes.
11129 This is not an exhaustive set of fixes, but it's time to
11130 record what I've got.
11131 (lookup_pixel_color, check_image_size): Remove redundant decls.
11132 (check_image_size): Don't assume that arbitrary EMACS_INT values
11133 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11134 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11135 (tiff_load, imagemagick_load_image):
11136 Check for overflow in size calculations.
11137 (x_create_x_image_and_pixmap): Remove unnecessary test for
11138 xmalloc returning NULL; that can't happen.
11139 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11140 (xpm_color_bucket): Use better integer hashing function.
11141 (xpm_cache_color): Don't possibly over-allocate memory.
11142 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11143 (gif_memory_source):
11144 Use ptrdiff_t, not int or size_t, to record sizes.
11145 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11146 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11147 either works, as we prefer signed integers.
11148 (tiff_read_from_memory, tiff_write_from_memory):
11149 Return tsize_t, not size_t, since that's what the TIFF API wants.
11150 (tiff_read_from_memory): Don't fail simply because the read would
11151 go past EOF; instead, return a short read.
11152 (tiff_load): Omit no-longer-needed casts.
11153 (Fimagemagick_types): Don't assume size fits into 'int'.
11154
11155 Improve hashing quality when configured --with-wide-int.
11156 * fns.c (hash_string): New function, taken from sxhash_string.
11157 Do not discard information about ASCII character case; this
11158 discarding is no longer needed.
11159 (sxhash-string): Use it. Change sig to match it. Caller changed.
11160 * lisp.h: Declare it.
11161 * lread.c (hash_string): Remove, since we now use fns.c's version.
11162 The fns.c version returns a wider integer if --with-wide-int is
11163 specified, so this should help the quality of the hashing a bit.
11164
11165 * emacs.c: Integer overflow minor fix.
11166 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11167 Define only if GNU_LINUX.
11168 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11169
11170 * dispnew.c: Integer signedness and overflow fixes.
11171 Remove unnecessary forward decls, that were a maintenance hassle.
11172 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11173 All uses changed.
11174 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11175 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11176 (prepare_desired_row, line_draw_cost):
11177 Use int, not unsigned, where either works.
11178 (save_current_matrix, restore_current_matrix):
11179 Use ptrdiff_t, not size_t, where either works.
11180 (init_display): Check for overflow more accurately, and without
11181 relying on undefined behavior.
11182
11183 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11184 Remove, replacing with the new symbols in lisp.h. All uses changed.
11185 * fileio.c (make_temp_name):
11186 * filelock.c (lock_file_1, lock_file):
11187 * xdisp.c (message_dolog):
11188 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11189 Use pMd etc. instead.
11190 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11191 replacing the pWIDE etc. symbols removed from editfns.c.
11192
11193 * keyboard.h (num_input_events): Now uintmax_t.
11194 This is (very slightly) less likely to mess up due to wraparound.
11195 All uses changed.
11196
11197 * buffer.c: Integer signedness fixes.
11198 (alloc_buffer_text, enlarge_buffer_text):
11199 Use ptrdiff_t rather than size_t when either will do, as we prefer
11200 signed integers.
11201
11202 * alloc.c: Integer signedness and overflow fixes.
11203 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11204 (__malloc_size_t): Default to size_t, not to int.
11205 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11206 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11207 Prefer ptrdiff_t to size_t when either would do, as we prefer
11208 signed integers.
11209 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11210 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11211 Now const. Initialize with values that are in range even if char
11212 is signed.
11213 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11214 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11215 These functions do the right thing with sizes > 2**32.
11216 (check_depth): Now ptrdiff_t, not int.
11217 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11218 Adjust to new way of storing sizes. Check for size overflow bugs
11219 in rest of code.
11220 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11221 slightly wrong anyway, as it missed one instance of
11222 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11223 (refill_memory_reserve): Omit needless cast to size_t.
11224 (mark_object_loop_halt): Mark as externally visible.
11225
11226 * xselect.c: Integer signedness and overflow fixes.
11227 (Fx_register_dnd_atom, x_handle_dnd_message):
11228 Use ptrdiff_t, not size_t, since we prefer signed.
11229 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11230 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11231 x_dnd_atoms_size and x_dnd_atoms_length.
11232
11233 * doprnt.c: Prefer signed to unsigned when either works.
11234 * eval.c (verror):
11235 * doprnt.c (doprnt):
11236 * lisp.h (doprnt):
11237 * xdisp.c (vmessage):
11238 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11239 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11240 prefer signed arithmetic to avoid comparison confusion.
11241 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11242 but is a bit tricky.
11243
11244 Assume freestanding C89 headers, string.h, stdlib.h.
11245 * data.c, doprnt.c, floatfns.c, print.c:
11246 Include float.h unconditionally.
11247 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11248 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11249 * regex.c: Likewise for stddef.h, string.h.
11250 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11251 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11252 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11253 (STDC_HEADERS): Remove obsolete defines.
11254 * sysdep.c: Include limits.h unconditionally.
11255
11256 Assume support for memcmp, memcpy, memmove, memset.
11257 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11258 * regex.c (memcmp, memcpy):
11259 Remove; we assume C89 now.
11260
11261 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11262 (__malloc_safe_bcopy): Remove; no longer needed.
11263
11264 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11265 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11266 well either way, and we prefer signed to unsigned.
11267
11268 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11269
11270 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11271 closes the connection while we're reading (bug#9182).
11272
11273 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11274
11275 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11276 are specified (Bug#9168).
11277
11278 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11279
11280 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11281 Found by GCC static checking and --with-wide-int on a 32-bit host.
11282
11283 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11284
11285 * xdisp.c (compute_display_string_pos): Fix logic of caching
11286 previous display string position. Initialize cached_prev_pos to
11287 -1. Fixes slow-down at the beginning of a buffer.
11288
11289 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11290
11291 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11292 for attrs[LFACE_FONTSET_INDEX].
11293
11294 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11295
11296 * xml.c (parse_region): Remove unused local
11297 that was recently introduced.
11298
11299 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11300
11301 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11302 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11303
11304 * xdisp.c (move_it_in_display_line_to): Record the best matching
11305 position for TO_CHARPOS while scanning the line, and restore it on
11306 exit if none of the characters scanned was an exact match.
11307 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11308 when exact match is impossible due to invisible text, and the
11309 lines are truncated.
11310
11311 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11312
11313 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11314 for OSX >= 10.7.
11315
11316 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11317
11318 Fix a significant slow-down of cursor motion with C-n, C-p,
11319 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11320 auto-repeat under bidi redisplay in fontified buffers.
11321 * xdisp.c (compute_stop_pos_backwards): New function.
11322 (next_element_from_buffer): Call compute_stop_pos_backwards to
11323 find a suitable prev_stop when we find ourselves before
11324 base_level_stop.
11325 (reseat): Don't look for prev_stop, as that could mean a very long
11326 run.
11327 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11328 <cached_disp_overlay_modiff>: Cache for last found display string
11329 position.
11330 (compute_display_string_pos): Return the cached position if asked
11331 about the same buffer in the same area of character positions, and
11332 the buffer wasn't changed since the time the display string
11333 position was cached.
11334
11335 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11336
11337 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11338 is an integer, which is important for empty lines. (Bug#9149)
11339
11340 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11341
11342 * frame.c (Fmodify_frame_parameters): In tty case, update the
11343 default face if necessary (Bug#4238).
11344
11345 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11346
11347 * editfns.c (Fstring_to_char): No need to explain what a character
11348 is in the docstring (Bug#6576).
11349
11350 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11351
11352 * xml.c (parse_region): Make sure we always return a tree.
11353
11354 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11355
11356 * xml.c (parse_region): If a document contains only comments,
11357 return that, too.
11358
11359 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11360
11361 * xml.c (make_dom): Return comments, too.
11362
11363 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11364
11365 Port to OpenBSD.
11366 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11367 and the surrounding thread.
11368 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11369 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11370 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11371 timer goes off.
11372 * s/openbsd.h (BROKEN_SIGIO): Define.
11373 * unexelf.c (unexec) [__OpenBSD__]:
11374 Don't update the .mdebug section of the Alpha COFF symbol table.
11375
11376 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11377
11378 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11379 (bug#8460).
11380
11381 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11382
11383 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11384 This fixes some race conditions on the permissions of any newly
11385 created file.
11386
11387 * alloc.c (valid_pointer_p): Use pipe, not open.
11388 This fixes some permissions issues when debugging.
11389
11390 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11391 If fchown fails to set both uid and gid, try to set just gid,
11392 as that is sometimes allowed. Adjust the file's mode to eliminate
11393 setuid or setgid bits that are inappropriate if fchown fails.
11394
11395 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11396
11397 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11398 to compare Lisp_Objects.
11399 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11400 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11401 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11402
11403 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11404
11405 * lread.c (read_integer): Unread even EOF character.
11406 (read1): Likewise. Properly record start position of symbol.
11407
11408 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11409 symbol character follows.
11410
11411 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11412
11413 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11414 This works around a problem with the previous change to Fcopy_file.
11415 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11416 and without this change, GCC might complain about discarding
11417 fchown's return value.
11418
11419 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11420
11421 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11422
11423 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11424
11425 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11426
11427 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11428
11429 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11430 it's used from the C level.
11431
11432 * process.c: Use the same condition for POLL_FOR_INPUT in both
11433 keyboard.c and process.c (bug#1858).
11434
11435 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11436
11437 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11438 (Fgnutls_boot): Use it.
11439
11440 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11441
11442 * doc.c (Fsubstitute_command_keys): Revert last change.
11443
11444 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11445
11446 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11447 quotes the next character, and doesn't affect other longer
11448 sequences (bug#8935).
11449
11450 * lread.c (syms_of_lread): Clarify that is isn't only
11451 `eval-buffer' and `eval-defun' that's affected by
11452 `lexical-binding' (bug#8460).
11453
11454 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11455
11456 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11457 bidi redisplay when a line includes both an image and is truncated.
11458
11459 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11460
11461 Fix minor problems found by static checking.
11462 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11463 (elsz): Now a signed constant, not a size_t var. We prefer signed
11464 types to unsigned, to avoid integer comparison confusion. Without
11465 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11466 "cannot optimize loop, the loop counter may overflow", a symptom
11467 of the confusion.
11468 * indent.c (Fvertical_motion): Mark locals as initialized.
11469 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11470
11471 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11472
11473 * search.c (Fre_search_backward): Mention `case-fold-search' in
11474 all the re_search_* functions (bug#8138).
11475
11476 * keyboard.c (Fopen_dribble_file): Document when the file is
11477 closed (bug#8056).
11478
11479 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11480
11481 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11482 bidi_cache_idx.
11483
11484 Support bidi reordering of display and overlay strings.
11485 * xdisp.c (compute_display_string_pos)
11486 (compute_display_string_end): Accept additional argument STRING.
11487 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11488 (reseat_to_string): Initialize bidi_it->string.s and
11489 bidi_it->string.schars.
11490 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11491 NULL (avoids a crash in bidi_paragraph_init).
11492 Initialize itb.string.lstring.
11493 (init_iterator): Call bidi_init_it only of a valid
11494 buffer position was specified. Initialize paragraph_embedding to
11495 L2R.
11496 (reseat_to_string): Initialize the bidi iterator.
11497 (display_string): If we need to ignore text properties of
11498 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11499 original value of -1 will not work with bidi.)
11500 (compute_display_string_pos): First arg is now struct
11501 `text_pos *'; all callers changed. Support display properties on
11502 Lisp strings.
11503 (compute_display_string_end): Support display properties on Lisp
11504 strings.
11505 (init_iterator, reseat_1, reseat_to_string): Initialize the
11506 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11507 when iterating on a string not from display properties).
11508 (compute_display_string_pos, compute_display_string_end):
11509 Fix calculation of the object to scan. Fixes an error when using
11510 arrow keys.
11511 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11512 base_level_stop; instead, set base_level_stop to BEGV.
11513 Fixes crashes in vertical-motion.
11514 (next_element_from_buffer): Improve commentary for when
11515 the iterator is before prev_stop.
11516 (init_iterator): Initialize bidi_p from the default value of
11517 bidi-display-reordering, not from buffer-local value. Use the
11518 buffer-local value only if initializing for buffer iteration.
11519 (handle_invisible_prop): Support invisible properties on strings
11520 that are being bidi-reordered.
11521 (set_iterator_to_next): Support bidi reordering of C strings and
11522 Lisp strings.
11523 (next_element_from_string): Support bidi reordering of Lisp
11524 strings.
11525 (handle_stop_backwards): Support Lisp strings as well.
11526 (display_string): Support display of R2L glyph rows.
11527 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11528 (init_iterator): Don't initialize it->bidi_p for strings
11529 here.
11530 (reseat_to_string): Initialize it->bidi_p for strings here.
11531 (next_element_from_string, next_element_from_c_string)
11532 (next_element_from_buffer): Add xassert's for correspondence
11533 between IT's object being iterated and it->bidi_it.string
11534 structure.
11535 (face_before_or_after_it_pos): Support bidi iteration.
11536 (next_element_from_c_string): Handle the case of the first string
11537 character that is not the first one in the visual order.
11538 (get_visually_first_element): New function, refactored from common
11539 parts of next_element_from_buffer, next_element_from_string, and
11540 next_element_from_c_string.
11541 (tool_bar_lines_needed, redisplay_tool_bar)
11542 (display_menu_bar): Force left-to-right direction. Add a FIXME
11543 comment for making that be controlled by a user option.
11544 (push_it, pop_it): Save and restore the state of the
11545 bidi iterator. Save and restore the bidi_p flag.
11546 (pop_it): Iterate out of display property for string iteration as
11547 well.
11548 (iterate_out_of_display_property): Support iteration over strings.
11549 (handle_single_display_spec): Set up it->bidi_it for iteration
11550 over a display string, and call bidi_init_it.
11551 (handle_single_display_spec, next_overlay_string)
11552 (get_overlay_strings_1, push_display_prop): Set up the bidi
11553 iterator for displaying display or overlay strings.
11554 (forward_to_next_line_start): Don't use the shortcut if
11555 bidi-iterating.
11556 (back_to_previous_visible_line_start): If handle_display_prop
11557 pushed the iterator stack, restore the internal state of the bidi
11558 iterator by calling bidi_pop_it same number of times.
11559 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11560 and we are bidi-iterating, don't decrement the iterator position;
11561 instead, set the first_elt flag in the bidi iterator, to produce
11562 the same effect.
11563 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11564 (push_display_prop): xassert that we are iterating a buffer.
11565 (push_it, pop_it): Save and restore paragraph_embedding member.
11566 (handle_single_display_spec, next_overlay_string)
11567 (get_overlay_strings_1, reseat_1, reseat_to_string)
11568 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11569 correctly. Don't assume unibyte strings are not bidi-reordered.
11570 (compute_display_string_pos)
11571 (compute_display_string_end): Fix handling the case of C string.
11572 (push_it, pop_it): Save and restore from_disp_prop_p.
11573 (handle_single_display_spec, push_display_prop): Set the
11574 from_disp_prop_p flag.
11575 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11576 (pop_it): Call iterate_out_of_display_property only if we are
11577 popping after iteration over a string that came from a display
11578 property. Fix a typo in popping stretch info. Add an assertion
11579 for verifying that the iterator position is in sync with the bidi
11580 iterator.
11581 (handle_single_display_spec, get_overlay_strings_1)
11582 (push_display_prop): Fix initialization of paragraph direction for
11583 string when that of the parent object is not yet determined.
11584 (reseat_1): Call bidi_init_it to resync the bidi
11585 iterator with IT's position. (Bug#7616)
11586 (find_row_edges): If ROW->start.pos gives position
11587 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11588 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11589 Reset the from_disp_prop_p flag.
11590 (SAVE_IT, RESTORE_IT): New macros.
11591 (pos_visible_p, face_before_or_after_it_pos)
11592 (back_to_previous_visible_line_start)
11593 (move_it_in_display_line_to, move_it_in_display_line)
11594 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11595 (try_scrolling, redisplay_window, display_line): Use them when
11596 saving a temporary copy of the iterator and restoring it back.
11597 (back_to_previous_visible_line_start, reseat_1)
11598 (init_iterator): Empty the bidi cache "stack".
11599 (move_it_in_display_line_to): If iterator ended up at
11600 EOL, but we never saw any buffer positions smaller than
11601 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11602 motion in bidi-reordered lines.
11603 (move_it_in_display_line_to): Record prev_method and prev_pos
11604 immediately before the call to set_iterator_to_next. Fixes cursor
11605 motion in bidi-reordered lines with stretch glyphs and strings
11606 displayed in margins. (Bug#8133) (Bug#8867)
11607 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11608 TO_CHARPOS.
11609 (pos_visible_p): Support positions in bidi-reordered lines.
11610 Save and restore bidi cache.
11611
11612 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11613 (bidi_paragraph_info): Delete unused struct.
11614 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11615 (bidi_cache_start): New variable.
11616 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11617 to zero.
11618 (bidi_cache_fetch_state, bidi_cache_search)
11619 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11620 (bidi_cache_find, bidi_peek_at_next_level)
11621 (bidi_level_of_next_char, bidi_find_other_level_edge)
11622 (bidi_move_to_visually_next): Compare cache index with
11623 bidi_cache_start rather than with zero.
11624 (bidi_fetch_char): Accept new argument STRING; all callers
11625 changed. Support iteration over a string. Support strings with
11626 display properties. Support unibyte strings. Fix the type of
11627 `len' according to what STRING_CHAR_AND_LENGTH expects.
11628 (bidi_paragraph_init, bidi_resolve_explicit_1)
11629 (bidi_resolve_explicit, bidi_resolve_weak)
11630 (bidi_level_of_next_char, bidi_move_to_visually_next):
11631 Support iteration over a string.
11632 (bidi_set_sor_type, bidi_resolve_explicit_1)
11633 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11634 can now be zero (for strings); special values 0 and -1 were
11635 changed to -1 and -2, respectively.
11636 (bidi_char_at_pos): New function.
11637 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11638 Call it instead of FETCH_MULTIBYTE_CHAR.
11639 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11640 initialized to valid values.
11641 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11642 values.
11643 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11644 the test for valid cached positions. Fix the logic for looking up
11645 the sentinel state in the cache. GCPRO the Lisp string we are
11646 iterating.
11647 (bidi_push_it, bidi_pop_it): New functions.
11648 (bidi_initialize): Initialize the bidi cache start stack pointer.
11649 (bidi_cache_ensure_space): New function, refactored from part of
11650 bidi_cache_iterator_state. Don't assume the required size is just
11651 one BIDI_CACHE_CHUNK away.
11652 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11653 (bidi_count_bytes, bidi_char_at_pos): New functions.
11654 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11655 always valid if bidi_cache_idx is valid.
11656 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11657 is valid if it's going to be used.
11658 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11659 (bidi_cache_fetch_state, bidi_cache_search)
11660 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11661 (bidi_cache_iterator_state, bidi_cache_find)
11662 (bidi_find_other_level_edge, bidi_cache_start_stack):
11663 All variables related to cache indices are now EMACS_INT.
11664
11665 * dispextern.h (struct bidi_string_data): New structure.
11666 (struct bidi_it): New member `string'. Make flag members be 1-bit
11667 fields, and put them last in the struct.
11668 (compute_display_string_pos, compute_display_string_end):
11669 Update prototypes.
11670 (bidi_push_it, bidi_pop_it): Add prototypes.
11671 (struct iterator_stack_entry): New members bidi_p,
11672 paragraph_embedding, and from_disp_prop_p.
11673 (struct it): Member bidi_p is now a bit field 1 bit wide.
11674 (bidi_shelve_cache, bidi_unshelve_cache):
11675 Declare prototypes.
11676
11677 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11678 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11679 and vector-like objects.
11680
11681 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11682 cache around display iteration.
11683
11684 * window.c (Fwindow_end, window_scroll_pixel_based)
11685 (displayed_window_lines, Frecenter): Save and restore the bidi
11686 cache around display iteration.
11687
11688 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11689
11690 * editfns.c (Fdelete_region): Clarify the use of the named
11691 parameters (bug#6788).
11692
11693 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11694
11695 * indent.c (Fvertical_motion): Set and restore w->pointm when
11696 saving and restoring the window's buffer (Bug#9006).
11697
11698 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11699
11700 * editfns.c (Fstring_to_char): Clarify just what is returned
11701 (bug#6576). Text by Eli Zaretskii.
11702
11703 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11704
11705 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11706
11707 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11708
11709 * buffer.c (mmap_find): Fix a typo.
11710
11711 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11712
11713 Fix execution of x selection hooks.
11714 * xselect.c (Qx_lost_selection_functions)
11715 (Qx_sent_selection_functions): New vars.
11716 (syms_of_xselect): DEFSYM them.
11717 (x_handle_selection_request): Pass Qx_sent_selection_functions
11718 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11719 (x_handle_selection_clear,x_clear_frame_selections):
11720 Pass Qx_lost_selection_functions rather than
11721 Vx_lost_selection_functions to Frun_hook_with_args.
11722
11723 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11724
11725 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11726 The old code sometimes used this field without initializing it.
11727
11728 * alloc.c (gc_sweep): Don't read past end of array.
11729 In theory, the old code could also have corrupted Emacs internals,
11730 though it'd be very unlikely.
11731
11732 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11733
11734 * character.c (Fcharacterp): Don't advertise optional ignored
11735 argument. (Bug#4026)
11736
11737 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11738
11739 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11740 key" (bug#4257).
11741
11742 * window.c (Fset_window_start): Doc fix (bug#4199).
11743 (Fset_window_hscroll): Ditto.
11744
11745 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11746
11747 Fix minor new problems caught by GCC 4.6.1.
11748 * term.c (init_tty): Remove unused local.
11749 * xsettings.c (store_monospaced_changed): Define this function only
11750 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11751 not used otherwise.
11752
11753 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11754
11755 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11756
11757 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11758
11759 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11760 are the mini-buffer and the echo area (bug#3320).
11761
11762 * term.c (init_tty): Remove support for supdup, c10 and perq
11763 terminals, which are no longer supported (bug#1482).
11764
11765 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11766
11767 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11768
11769 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11770
11771 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11772 for non-popups (Bug#3642).
11773
11774 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11775
11776 * alloc.c (reset_malloc_hooks): Protoize.
11777 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11778 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11779 * cm.c (losecursor): Likewise.
11780 * data.c (fmod): Likewise.
11781 * dispnew.c (swap_glyphs_in_rows): Likewise.
11782 * emacs.c (memory_warning_signal): Likewise.
11783 * floatfns.c (float_error): Likewise.
11784 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11785 (otf_open, font_otf_capability, generate_otf_features)
11786 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11787 Likewise.
11788 * image.c (pbm_read_file): Likewise.
11789 * indent.c (string_display_width): Likewise.
11790 * intervals.c (check_for_interval, search_for_interval)
11791 (inc_interval_count, count_intervals, root_interval)
11792 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11793 * lread.c (defalias): Likewise.
11794 * ralloc.c (r_alloc_check): Likewise.
11795 * regex.c (set_image_of_range_1, set_image_of_range)
11796 (regex_grow_registers): Likewise.
11797 * sysdep.c (strerror): Likewise.
11798 * termcap.c (valid_filename_p, tprint, main): Likewise.
11799 * tparam.c (main): Likewise.
11800 * unexhp9k800.c (run_time_remap, save_data_space)
11801 (update_file_ptrs, read_header, write_header, calculate_checksum)
11802 (copy_file, copy_rest, display_header): Likewise.
11803 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11804 Likewise.
11805 * xdisp.c (check_it): Likewise.
11806 * xfaces.c (register_color, unregister_color, unregister_colors):
11807 Likewise.
11808 * xfns.c (print_fontset_result): Likewise.
11809 * xrdb.c (member, fatal, main): Likewise.
11810
11811 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11812
11813 Fix minor problems found by static checking (Bug#9031).
11814 * chartab.c (char_table_set_range, map_sub_char_table):
11815 Remove unused locals.
11816 (uniprop_table): Now static.
11817 * composite.c (_work_char): Remove unused static var.
11818
11819 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11820
11821 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11822
11823 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11824
11825 * gtkutil.c (qttip_cb): Remove code without function.
11826
11827 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11828
11829 * w32.c (pthread_sigmask): New stub.
11830
11831 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11832
11833 Use pthread_sigmask, not sigprocmask (Bug#9010).
11834 sigprocmask is portable only for single-threaded applications, and
11835 Emacs can be multi-threaded when it uses GTK.
11836 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11837 (LIBES): Use it.
11838 * callproc.c (Fcall_process):
11839 * process.c (create_process):
11840 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11841 Use pthread_sigmask, not sigprocmask.
11842
11843 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11844
11845 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11846 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11847 wrong (Bug#8591).
11848
11849 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11850
11851 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11852 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11853 (xg_hide_tooltip): Fix comment.
11854
11855 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11856 in registerServicesMenuSendTypes.
11857 (validRequestorForSendType): Don't check ns_return_types.
11858
11859 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11860 ns_return_type.
11861
11862 2011-07-08 Jason Rumney <jasonr@gnu.org>
11863
11864 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11865 SH_SHOW for hidden windows (Bug#5482).
11866
11867 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11868 frame struct members of non-existent frames (Bug#6284).
11869
11870 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11871
11872 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11873 variable firstTime not needed on OSX >= 10.6.
11874 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11875 >= 10.5. Use setKnobProportion, setDoubleValue.
11876
11877 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11878 (MAC_OS_X_VERSION_10_5): Define if not defined.
11879 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11880 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11881 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11882
11883 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11884 cString and lossyCString on OSX >= 10.4.
11885
11886 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11887 sizeToFit on OSX >= 10.2.
11888
11889 * nsimage.m (allocInitFromFile): Don't use deprecated method
11890 bestRepresentationForDevice on OSX >= 10.6.
11891
11892 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11893 to avoid warning.
11894
11895 * emacs.c: Declare unexec_init_emacs_zone.
11896
11897 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11898
11899 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11900
11901 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11902 on svcsMenu (Bug#8842).
11903
11904 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11905 ns_return_types.
11906 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11907
11908 * nsterm.m (QUTF8_STRING): Declare.
11909 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11910 (validRequestorForSendType): Return type is (id).
11911 Change indexOfObjectIdenticalTo to indexOfObject.
11912 Check if we have local selection before returning self (Bug#8842).
11913 (writeSelectionToPasteboard): Put local selection into paste board
11914 if we have a local selection (Bug#8842).
11915 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11916
11917 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11918 (ns_get_local_selection): Declare.
11919
11920 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11921
11922 * keymap.c (describe_map_tree): Don't insert a double newline at
11923 the end of the buffer (bug#1169) and return whether we inserted
11924 something.
11925
11926 * callint.c (Fcall_interactively): Change "reading args" to
11927 "providing args" to try to clarify what it does (bug#1010).
11928
11929 2011-07-07 Kenichi Handa <handa@m17n.org>
11930
11931 * composite.c (composition_compute_stop_pos): Ignore a static
11932 composition starting before CHARPOS (Bug#8915).
11933
11934 * xdisp.c (handle_composition_prop): Likewise.
11935
11936 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11937
11938 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11939 (Bug#9015)
11940
11941 2011-07-07 Kenichi Handa <handa@m17n.org>
11942
11943 * character.h (unicode_category_t): New enum type.
11944
11945 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11946 (Qchar_code_property_table): New variable.
11947 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11948 (UNIPROP_COMPRESSED_FORM_P): New macros.
11949 (char_table_ascii): Uncompress the compressed values.
11950 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11951 Uncompress the compressed values.
11952 (sub_char_table_ref_and_range): Likewise.
11953 (char_table_ref_and_range): Uncompress the compressed values.
11954 (sub_char_table_set): New arg is_uniprop. Callers changed.
11955 Uncompress the compressed values.
11956 (sub_char_table_set_range): Args changed. Callers changed.
11957 (char_table_set_range): Adjuted for the above change.
11958 (map_sub_char_table): Delete args default_val and parent. Add arg
11959 top. Give decoded values to a Lisp function.
11960 (map_char_table): Adjust for the above change. Give decoded
11961 values to a Lisp function. Gcpro more variables.
11962 (uniprop_table_uncompress)
11963 (uniprop_decode_value_run_length): New functions.
11964 (uniprop_decoder, uniprop_decoder_count): New variables.
11965 (uniprop_get_decoder, uniprop_encode_value_character)
11966 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11967 New functions.
11968 (uniprop_encoder, uniprop_encoder_count): New variables.
11969 (uniprop_get_encoder, uniprop_table)
11970 (Funicode_property_table_internal, Fget_unicode_property_internal)
11971 (Fput_unicode_property_internal): New functions.
11972 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11973 Sunicode_property_table_internal, Sget_unicode_property_internal,
11974 and Sput_unicode_property_internal. Defvar_lisp
11975 char-code-property-alist.
11976
11977 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11978 Vunicode_category_table.
11979
11980 * font.c (font_range): Adjust for the change of
11981 Vunicode_category_table.
11982
11983 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11984
11985 * m/iris4d.h: Remove file, move contents ...
11986 * s/irix6-5.h: ... here.
11987
11988 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11989
11990 Remove unportable assumption about struct layout (Bug#8884).
11991 * alloc.c (mark_buffer):
11992 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11993 (clone_per_buffer_values): Don't assume that
11994 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11995 This isn't true in general, and it's particularly not true
11996 if Emacs is configured with --with-wide-int.
11997 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11998 New macros, used in the buffer.c change.
11999
12000 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12001
12002 * xsettings.c: Use both GConf and GSettings if both are available.
12003 (store_config_changed_event): Add comment.
12004 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12005 (store_tool_bar_style_changed): New functions.
12006 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12007 (struct xsettings): Move font inside HAVE_XFT.
12008 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12009 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12010 Move inside HAVE_XFT.
12011 (something_changed_gsettingsCB): Rename from something_changedCB.
12012 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12013 also.
12014 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12015 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12016 (something_changed_gconfCB): Rename from something_changedCB.
12017 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12018 (parse_settings): Move check for font inside HAVE_XFT.
12019 (read_settings, apply_xft_settings): Add comment.
12020 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12021 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12022 call store_font_name_changed.
12023 (xft_settings_event): Add comment.
12024 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12025 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12026 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12027 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12028 (xsettings_initialize): Call init_gsettings last.
12029 (xsettings_get_system_font, xsettings_get_system_normal_font):
12030 Add comment.
12031
12032 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12033
12034 Random fixes. E.g., (random) never returned negative values.
12035 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12036 subseconds part to the entropy, as that's a bit more random.
12037 Prefer signed to unsigned, since the signedness doesn't matter and
12038 in general we prefer signed. When given a limit, use a
12039 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12040 latter isn't right if USE_2_TAGS_FOR_INTS.
12041 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12042 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12043
12044 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12045
12046 * textprop.c (text_property_stickiness):
12047 Obey Vtext_property_default_nonsticky.
12048 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12049 * w32fns.c (syms_of_w32fns):
12050 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12051
12052 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12053
12054 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12055 This is more efficient than Ffile_directory_p and avoids a minor race.
12056
12057 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12058
12059 * buffer.c (Foverlay_put): Say what the return value is
12060 (bug#7835).
12061
12062 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12063 is a directory before asking whether to use the file name
12064 (bug#7564).
12065 (barf_or_query_if_file_exists): Make the "File is a directory"
12066 error be more correct.
12067
12068 * fns.c (Frequire): Remove the mention of the .gz files, since
12069 that's installation-specific, but keep the mention of
12070 `get-load-suffixes'.
12071
12072 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12073
12074 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12075 Report string overflow if the output is too long.
12076
12077 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12078
12079 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12080 (syms_of_gnutls): Remove duplicate DEFSYM for
12081 Qgnutls_bootprop_verify_hostname_error, an error for
12082 Qgnutls_bootprop_verify_error (which is no longer used).
12083
12084 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12085 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12086 Also (re)move comments that are misplaced or no longer relevant.
12087
12088 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12089
12090 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12091
12092 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12093
12094 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12095 and background color parameters if they have been changed.
12096
12097 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12098
12099 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12100
12101 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12102
12103 * xsettings.c (SYSTEM_FONT): Define only when used.
12104 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12105
12106 * keymap.c (access_keymap_1): Now static.
12107
12108 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12109
12110 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12111 leave any prefix arg for the up event (Bug#1586).
12112
12113 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12114
12115 * lread.c (syms_of_lread): Mention single symbols defined by
12116 `defvar' or `defconst' (bug#7154).
12117
12118 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12119 (Frequire): Mention get-load-suffixes.
12120
12121 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12122
12123 * window.h (window): Remove clone_number slot.
12124 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12125 Remove.
12126 (make_parent_window, make_window, saved_window)
12127 (Fset_window_configuration, save_window_save): Don't deal with
12128 clone numbers.
12129 * buffer.c (Qclone_number): Remove declaration.
12130 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12131
12132 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12133
12134 Add multiple inheritance to keymaps.
12135 * keymap.c (Fmake_composed_keymap): New function.
12136 (Fset_keymap_parent): Simplify.
12137 (fix_submap_inheritance): Remove.
12138 (access_keymap_1): New function extracted from access_keymap to handle
12139 embedded parents and handle lists of maps.
12140 (access_keymap): Use it.
12141 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12142 (Fcopy_keymap): Handle embedded parents.
12143 (Fcommand_remapping, define_as_prefix): Simplify.
12144 (Fkey_binding): Simplify.
12145 (syms_of_keymap): Move minibuffer-local-completion-map,
12146 minibuffer-local-filename-completion-map,
12147 minibuffer-local-must-match-map, and
12148 minibuffer-local-filename-must-match-map to Elisp.
12149 (syms_of_keymap): Defsubr make-composed-keymap.
12150 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12151 (parse_menu_item): Trivial simplification.
12152
12153 2011-07-01 Glenn Morris <rgm@gnu.org>
12154
12155 * Makefile.in (SETTINGS_LIBS): Fix typo.
12156
12157 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12158
12159 * coding.c (Fencode_coding_string): Record the last coding system
12160 used, as the function doc string says (bug#8738).
12161
12162 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12163
12164 * xsettings.c (store_monospaced_changed): Take new font as arg and
12165 check for change against current_mono_font.
12166 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12167 (emacs_settings_constructor, emacs_settings_get_property)
12168 (emacs_settings_set_property, emacs_settings_class_init)
12169 (emacs_settings_init, gsettings_obj): Remove.
12170 (something_changedCB): New function for HAVE_GSETTINGS.
12171 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12172 with value as argument.
12173 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12174 g_settings_new (Bug#8967). Do not create gsettings_obj.
12175 Remove calls to g_settings_bind. Connect something_changedCB to
12176 "changed".
12177
12178 * xgselect.c: Add defined (HAVE_GSETTINGS).
12179 (xgselect_initialize): Ditto.
12180
12181 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12182 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12183 xg_select.
12184
12185 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12186
12187 * eval.c (struct backtrace): Simplify and port the data structure.
12188 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12189 signed bit field, as this assumption is not portable and it makes
12190 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12191 "char debug_on_exit : 1" as this is not portable either; instead,
12192 use the portable "unsigned int debug_on_exit : 1". Remove unused
12193 member evalargs. Remove obsolete comments about cc bombing out.
12194
12195 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12196
12197 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12198 Let HAVE_GSETTINGS override HAVE_GCONF.
12199 (store_monospaced_changed): New function.
12200 (EMACS_SETTINGS): A new type derived from GObject to handle
12201 GSettings notifications.
12202 (emacs_settings_constructor, emacs_settings_get_property)
12203 (emacs_settings_set_property, emacs_settings_class_init):
12204 New functions.
12205 (gsettings_client, gsettings_obj): New variables.
12206 (GSETTINGS_SCHEMA): New define.
12207 (something_changedCB): Call store_monospaced_changed.
12208 (init_gsettings): New function.
12209 (xsettings_initialize): Call init_gsettings.
12210 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12211 to NULL.
12212
12213 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12214 GCONF_CFLAGS/LIBS.
12215
12216 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12217
12218 * window.c (resize_root_window, grow_mini_window)
12219 (shrink_mini_window): Rename Qresize_root_window to
12220 Qwindow_resize_root_window and Qresize_root_window_vertically to
12221 Qwindow_resize_root_window_vertically.
12222
12223 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12224
12225 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12226
12227 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12228
12229 * makefile.w32-in: Redesign dependencies so they reflect more
12230 clearly which files are directly included by each source file,
12231 and not through other includes.
12232
12233 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12234
12235 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12236 (sort_overlays, overlay_strings): When an overlay's clone number
12237 matches the window's clone number process the overlay even if
12238 the overlay's window property doesn't match the current window.
12239
12240 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12241 (Fwindow_hchild): Rename to Fwindow_left_child.
12242 (Fwindow_next): Rename to Fwindow_next_sibling.
12243 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12244 (resize_window_check): Rename to window_resize_check.
12245 (resize_window_apply): Rename to window_resize_apply.
12246 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12247 (Fdelete_other_windows_internal, resize_frame_windows)
12248 (Fsplit_window_internal, Fdelete_window_internal)
12249 (grow_mini_window, shrink_mini_window)
12250 (Fresize_mini_window_internal): Fix callers accordingly.
12251
12252 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12253
12254 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12255 (emacs_fixed_set_min_size): Remove.
12256 (emacs_fixed_new): Take frame as argument.
12257
12258 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12259 (_EmacsFixedPrivate): Remove minwidth/height.
12260 Add struct frame *f.
12261 (emacs_fixed_init): Initialize priv->f.
12262 (get_parent_class, emacs_fixed_set_min_size): Remove.
12263 (emacs_fixed_new): Set priv->f to argument.
12264 (emacs_fixed_get_preferred_width)
12265 (emacs_fixed_get_preferred_height): Use min_width/height from
12266 frames size_hint to set minimum and natural (Bug#8919).
12267 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12268 and use min_width/height from frames size_hint to set
12269 min_width/height (Bug#8919).
12270
12271 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12272 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12273 Fix indentation.
12274
12275 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12276
12277 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12278 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12279 called at ZV.
12280
12281 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12282
12283 * process.c (wait_reading_process_output): Bypass select if
12284 waiting for a cell while ignoring keyboard input, and input is
12285 pending. Suggested by Jan Djärv (Bug#8869).
12286
12287 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12288
12289 Use gnulib's dup2 module instead of rolling our own.
12290 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12291
12292 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12293
12294 * dispnew.c (scrolling_window): Before scrolling, turn off a
12295 mouse-highlight in the window being scrolled.
12296
12297 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12298
12299 Move DEFSYM to lisp.h and use everywhere.
12300
12301 * character.h (DEFSYM): Move declaration...
12302 * lisp.h (DEFSYM): ...here.
12303
12304 * gnutls.c:
12305 * minibuf.c:
12306 * w32menu.c:
12307 * w32proc.c:
12308 * w32select.c: Don't include character.h.
12309
12310 * alloc.c (syms_of_alloc):
12311 * buffer.c (syms_of_buffer):
12312 * bytecode.c (syms_of_bytecode):
12313 * callint.c (syms_of_callint):
12314 * casefiddle.c (syms_of_casefiddle):
12315 * casetab.c (init_casetab_once):
12316 * category.c (init_category_once, syms_of_category):
12317 * ccl.c (syms_of_ccl):
12318 * cmds.c (syms_of_cmds):
12319 * composite.c (syms_of_composite):
12320 * dbusbind.c (syms_of_dbusbind):
12321 * dired.c (syms_of_dired):
12322 * dispnew.c (syms_of_display):
12323 * doc.c (syms_of_doc):
12324 * editfns.c (syms_of_editfns):
12325 * emacs.c (syms_of_emacs):
12326 * eval.c (syms_of_eval):
12327 * fileio.c (syms_of_fileio):
12328 * fns.c (syms_of_fns):
12329 * frame.c (syms_of_frame):
12330 * fringe.c (syms_of_fringe):
12331 * insdel.c (syms_of_insdel):
12332 * keymap.c (syms_of_keymap):
12333 * lread.c (init_obarray, syms_of_lread):
12334 * macros.c (syms_of_macros):
12335 * msdos.c (syms_of_msdos):
12336 * print.c (syms_of_print):
12337 * process.c (syms_of_process):
12338 * search.c (syms_of_search):
12339 * sound.c (syms_of_sound):
12340 * syntax.c (init_syntax_once, syms_of_syntax):
12341 * terminal.c (syms_of_terminal):
12342 * textprop.c (syms_of_textprop):
12343 * undo.c (syms_of_undo):
12344 * w32.c (globals_of_w32):
12345 * window.c (syms_of_window):
12346 * xdisp.c (syms_of_xdisp):
12347 * xfaces.c (syms_of_xfaces):
12348 * xfns.c (syms_of_xfns):
12349 * xmenu.c (syms_of_xmenu):
12350 * xsettings.c (syms_of_xsettings):
12351 * xterm.c (syms_of_xterm): Use DEFSYM.
12352
12353 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12354
12355 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12356
12357 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12358
12359 Integer and buffer overflow fixes (Bug#8873).
12360
12361 * print.c (printchar, strout): Check for string overflow.
12362 (PRINTPREPARE, printchar, strout):
12363 Don't set size unless allocation succeeds.
12364
12365 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12366 for sizes. Check for string overflow more accurately.
12367 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12368
12369 * macros.c: Integer and buffer overflow fixes.
12370 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12371 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12372 Use ptrdiff_t, not int, for sizes.
12373 Don't increment bufsize until after realloc succeeds.
12374 Check for size-calculation overflow.
12375 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12376
12377 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12378
12379 * lread.c: Integer overflow fixes.
12380 (read_integer): Radix is now EMACS_INT, not int,
12381 to improve quality of diagnostics for out-of-range radices.
12382 Calculate buffer size correctly for out-of-range radices.
12383 (read1): Check for integer overflow in radices, and in
12384 read-circle numbers.
12385 (read_escape): Avoid int overflow.
12386 (Fload, openp, read_buffer_size, read1)
12387 (substitute_object_recurse, read_vector, read_list, map_obarray):
12388 Use ptrdiff_t, not int, for sizes.
12389 (read1): Use EMACS_INT, not int, for sizes.
12390 Check for size overflow.
12391
12392 * image.c (cache_image): Check for size arithmetic overflow.
12393
12394 * lread.c: Integer overflow issues.
12395 (saved_doc_string_size, saved_doc_string_length)
12396 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12397 Now ptrdiff_t, not int.
12398 (read1): Don't assume doc string length fits in int. Check for
12399 out-of-range doc string lengths.
12400 (read_list): Don't assume file position fits in int.
12401 (read_escape): Check for hex character overflow.
12402
12403 2011-06-22 Leo Liu <sdl.web@gmail.com>
12404
12405 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12406 Move to minibuffer.el.
12407
12408 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12409
12410 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12411 The following patches are for when GLYPH_DEBUG && !XASSERT.
12412 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12413 * dispnew.c (flush_stdout):
12414 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12415 Mark as externally visible.
12416 * dispnew.c (check_window_matrix_pointers): Now static.
12417 * dispnew.c (window_to_frame_vpos):
12418 * xfns.c (unwind_create_frame):
12419 * xterm.c (x_check_font): Remove unused local.
12420 * scroll.c (CHECK_BOUNDS):
12421 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12422 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12423 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12424 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12425 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12426 Now static.
12427 (debug_method_add): Use va_list and vsprintf rather than relying
12428 on undefined behavior with wrong number of arguments.
12429 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12430 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12431 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12432 since we're not interested in debugging glyphs with old libraries.
12433 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12434 GCC 4.6.0's static checking.
12435
12436 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12437
12438 Integer overflow and signedness fixes (Bug#8873).
12439 A few related buffer overrun fixes, too.
12440
12441 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12442
12443 * dispextern.h (struct face.stipple):
12444 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12445 (x_bitmap_mask, x_allocate_bitmap_record)
12446 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12447 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12448 (x_create_bitmap_from_xpm_data):
12449 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12450 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12451 (.bitmaps_last):
12452 * xfaces.c (load_pixmap):
12453 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12454 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12455 (.bitmaps_last, struct x_output.icon_bitmap):
12456 Use ptrdiff_t, not int, for bitmap indexes.
12457 (x_allocate_bitmap_record): Check for size overflow.
12458 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12459
12460 Use ptrdiff_t, not int, for overlay counts.
12461 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12462 * editfns.c (overlays_around, get_pos_property):
12463 * textprop.c (get_char_property_and_overlay):
12464 * xdisp.c (next_overlay_change, note_mouse_highlight):
12465 * xfaces.c (face_at_buffer_position):
12466 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12467 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12468 (Fnext_overlay_change, Fprevious_overlay_change)
12469 (mouse_face_overlay_overlaps, Foverlays_in):
12470 Use ptrdiff_t, not int, for sizes.
12471 (overlays_at, overlays_in): Check for size-calculation overflow.
12472
12473 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12474
12475 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12476 (x_session_initialize): Do not assume string length fits in int.
12477
12478 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12479 This is unlikely, but can occur if DPI is outlandish.
12480
12481 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12482 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12483
12484 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12485 * xrdb.c (magic_file_p, search_magic_path):
12486 Omit last arg SUFFIX; it was always 0. All callers changed.
12487 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12488
12489 * xfont.c (xfont_match): Avoid need for strlen.
12490
12491 * xfns.c: Don't assume strlen fits in int.
12492 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12493
12494 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12495 not unsigned long, as we prefer signed integers. All callers changed.
12496 Detect integer overflow in repeat count.
12497 (message_dolog): Don't assume print length fits in 39 bytes.
12498 (display_mode_element): Don't assume strlen fits in int.
12499
12500 * termcap.c: Don't assume sizes fit in int and never overflow.
12501 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12502 (gobble_line): Check for size-calculation overflow.
12503
12504 * minibuf.c (Fread_buffer):
12505 * lread.c (intern, intern_c_string):
12506 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12507 Don't assume string length fits in int.
12508
12509 * keyboard.c (parse_tool_bar_item):
12510 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12511
12512 * font.c: Don't assume string length fits in int.
12513 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12514 Use ptrdiff_t, not int.
12515 (font_intern_prop): Don't assume string length fits in int.
12516 Don't assume integer property fits in fixnum.
12517 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12518
12519 * filelock.c: Fix some buffer overrun and integer overflow issues.
12520 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12521 Reformulate so as not to need the command string.
12522 Invoke gzip -cd rather than gunzip, as it's more portable.
12523 (lock_info_type, lock_file_1, lock_file):
12524 Don't assume pid_t and time_t fit in unsigned long.
12525 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12526 (current_lock_owner): Prefer signed type for sizes.
12527 Use memcpy, not strncpy, where memcpy is what is really wanted.
12528 Don't assume (via atoi) that time_t and pid_t fit in int.
12529 Check for time_t and/or pid_t out of range, e.g., via a network share.
12530 Don't alloca where an auto var works fine.
12531
12532 * fileio.c: Fix some integer overflow issues.
12533 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12534 Don't assume string length fits in int.
12535 (directory_file_name): Don't assume string length fits in long.
12536 (make_temp_name): Don't assume pid fits in int, or that its print
12537 length is less than 20.
12538
12539 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12540
12541 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12542
12543 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12544
12545 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12546 We prefer signed integers, even for size calculations.
12547
12548 * emacs.c: Don't assume string length fits in 'int'.
12549 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12550 (main): Don't invoke strlen when not needed.
12551
12552 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12553 (XD_DEBUG_MESSAGE): Don't waste a byte.
12554
12555 * callproc.c (getenv_internal_1, getenv_internal)
12556 (Fgetenv_internal):
12557 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12558
12559 * lread.c (invalid_syntax): Omit length argument.
12560 All uses changed. This doesn't fix a bug, but it simplifies the
12561 code away from its former Hollerith-constant appearance, and it's
12562 one less 'int' to worry about when looking at integer-overflow issues.
12563 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12564
12565 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12566 This didn't break anything, but it didn't help either.
12567 It's confusing to put a bogus integer in a place where the actual
12568 value does not matter.
12569 (LIST_END_P): Remove unused macro and its bogus comment.
12570 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12571
12572 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12573 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12574 implementation.
12575 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12576 We prefer signed types, and the value cannot exceed the EMACS_INT
12577 range anyway (because otherwise the length would not be representable).
12578 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12579 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12580 This avoids a GCC warning when WIDE_EMACS_INT.
12581
12582 * indent.c (sane_tab_width): New function.
12583 (current_column, scan_for_column, Findent_to, position_indentation)
12584 (compute_motion): Use it. This is just for clarity.
12585 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12586
12587 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12588
12589 * lisp.h (lint_assume): New macro.
12590 * composite.c (composition_gstring_put_cache):
12591 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12592
12593 * editfns.c, insdel.c:
12594 Omit unnecessary forward decls, to simplify future changes.
12595
12596 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12597
12598 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12599
12600 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12601 Use much-faster test for byte-length change.
12602 Don't assume string byte-length fits in 'int'.
12603 Check that character arg fits in 'int'.
12604 (mapcar1): Declare byte as byte, for clarity.
12605
12606 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12607
12608 * fns.c (concat): Catch string overflow earlier.
12609 Do not rely on integer wraparound.
12610
12611 * dispextern.h (struct it.overlay_strings_charpos)
12612 (struct it.selective): Now EMACS_INT, not int.
12613 * xdisp.c (forward_to_next_line_start)
12614 (back_to_previous_visible_line_start)
12615 (reseat_at_next_visible_line_start, next_element_from_buffer):
12616 Don't arbitrarily truncate the value of 'selective' to int.
12617
12618 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12619
12620 * composite.c: Don't truncate sizes to 'int'.
12621 (composition_gstring_p, composition_reseat_it)
12622 (composition_adjust_point): Use EMACS_INT, not int.
12623 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12624 not EMACS_UINT, for indexes.
12625
12626 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12627
12628 * buffer.c: Include <verify.h>.
12629 (struct sortvec.priority, struct sortstr.priority):
12630 Now EMACS_INT, not int.
12631 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12632 (struct sortstr.size, record_overlay_string)
12633 (struct sortstrlist.size, struct sortlist.used):
12634 Don't truncate size to int.
12635 (record_overlay_string): Check for size-calculation overflow.
12636 (init_buffer_once): Check at compile-time, not run-time.
12637
12638 2011-06-22 Jim Meyering <meyering@redhat.com>
12639
12640 Don't leak an XBM-image-sized buffer
12641 * image.c (xbm_load): Free the image buffer after using it.
12642
12643 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12644
12645 Port to Sun C.
12646 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12647 that Sun C diagnosed.
12648 * fns.c (secure_hash): Fix pointer signedness issue.
12649 * intervals.c (static_offset_intervals): New function.
12650 (offset_intervals): Use it.
12651
12652 2011-06-21 Leo Liu <sdl.web@gmail.com>
12653
12654 * deps.mk (fns.o):
12655 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12656 sha512.h.
12657
12658 * fns.c (secure_hash): Rename from crypto_hash_function and change
12659 the first arg to accept symbols.
12660 (Fsecure_hash): New primitive.
12661 (syms_of_fns): New symbols.
12662
12663 2011-06-20 Deniz Dogan <deniz@dogan.se>
12664
12665 * process.c (Fset_process_buffer): Clarify return value in
12666 docstring.
12667
12668 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12669
12670 * dispnew.c (add_window_display_history): Use BVAR.
12671
12672 * xdisp.c (debug_method_add): Use BVAR.
12673 (check_window_end, dump_glyph_matrix, dump_glyph)
12674 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12675
12676 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12677 Likewise.
12678
12679 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12680 check till after the cache is created in init_frame_faces.
12681
12682 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12683
12684 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12685
12686 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12687
12688 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12689 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12690 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12691
12692 Improve buffer-overflow checking (Bug#8873).
12693 * fileio.c (Finsert_file_contents):
12694 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12695 Remove the old (too-loose) buffer overflow checks.
12696 They weren't needed, since make_gap checks for buffer overflow.
12697 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12698 The old code merely checked for Emacs fixnum overflow, and relied
12699 on undefined (wraparound) behavior. The new code avoids undefined
12700 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12701
12702 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12703 Tune. Don't use wider integers than needed. Don't use alloca.
12704 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12705
12706 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12707
12708 * insdel.c, lisp.h (buffer_overflow): New function.
12709 (insert_from_buffer_1, replace_range, replace_range_2):
12710 * insdel.c (make_gap_larger):
12711 * editfns.c (Finsert_char):
12712 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12713
12714 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12715
12716 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12717
12718 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12719
12720 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12721 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12722
12723 * fileio.c: Don't assume EMACS_INT fits in off_t.
12724 (emacs_lseek): New static function.
12725 (Finsert_file_contents, Fwrite_region): Use it.
12726 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12727
12728 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12729
12730 * fns.c: Don't overflow int when computing a list length.
12731 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12732 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12733 truncation on 64-bit hosts. Check for QUIT every
12734 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12735 faster and is responsive enough.
12736 (Flength): Report an error instead of overflowing an integer.
12737 (Fsafe_length): Return a float if the value is not representable
12738 as a fixnum. This shouldn't happen except in contrived situations.
12739 (Fnthcdr, Fsort): Don't assume list length fits in int.
12740 (Fcopy_sequence): Don't assume vector length fits in int.
12741
12742 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12743 (header_size, word_size): New constants.
12744 (allocate_vectorlike): Don't check size overflow here.
12745 (allocate_vector): Check it here instead, since this is the only
12746 caller of allocate_vectorlike that could cause overflow.
12747 Check that the new vector's length is representable as a fixnum.
12748
12749 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12750 The previous code was bogus. For example, next_almost_prime (32)
12751 returned 39, which is undesirable as it is a multiple of 3; and
12752 next_almost_prime (24) returned 25, which is a multiple of 5 so
12753 why was the code bothering to check for multiples of 7?
12754
12755 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12756
12757 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12758
12759 Variadic C functions now count arguments with ptrdiff_t.
12760 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12761 Back then I didn't know that the Emacs coding style prefers signed int.
12762 Also, in the meantime I found a few more instances where arguments
12763 were being counted with int, which may truncate counts on 64-bit
12764 machines, or EMACS_INT, which may be unnecessarily wide.
12765 * lisp.h (struct Lisp_Subr.function.aMANY)
12766 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12767 Arg counts are now ptrdiff_t, not size_t.
12768 All variadic functions and their callers changed accordingly.
12769 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12770 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12771 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12772 * callint.c (Fcall_interactively): Check arg count for overflow,
12773 to avoid potential buffer overrun. Use signed char, not 'int',
12774 for 'varies' array, so that we needn't bother to check its size
12775 calculation for overflow.
12776 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12777 * eval.c (apply_lambda):
12778 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12779 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12780 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12781
12782 * callint.c (Fcall_interactively): Don't use index var as event count.
12783
12784 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12785 * mem-limits.h (SIZE): Remove; no longer used.
12786
12787 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12788
12789 Remove unnecessary casts.
12790 * xterm.c (x_term_init):
12791 * xfns.c (x_set_border_pixel):
12792 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12793 These aren't needed now that we assume ANSI C.
12794
12795 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12796 It's more likely to cause problems (due to unsigned overflow)
12797 than to cure them.
12798
12799 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12800
12801 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12802
12803 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12804
12805 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12806
12807 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12808
12809 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12810
12811 GLYPH_CODE_FACE returns EMACS_INT, not int.
12812 * dispextern.h (merge_faces):
12813 * xfaces.c (merge_faces):
12814 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12815 Don't assume EMACS_INT fits in int.
12816
12817 * character.h (CHAR_VALID_P): Remove unused parameter.
12818 * fontset.c, lisp.h, xdisp.c: All uses changed.
12819
12820 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12821
12822 * fns.c (concat): Minor tuning based on overflow analysis.
12823 This doesn't fix any bugs. Use int to hold character, instead
12824 of constantly refetching from Emacs object. Use XFASTINT, not
12825 XINT, for value known to be a character. Don't bother comparing
12826 a single byte to 0400, as it's always less.
12827
12828 * floatfns.c (Fexpt):
12829 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12830
12831 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12832 for characters.
12833
12834 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12835
12836 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12837 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12838 incorrectly succeed when S was a string, because 4294967386 was
12839 truncated before it was used.
12840
12841 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12842 Otherwise, an out-of-range integer could cause undefined behavior
12843 on a 64-bit host.
12844
12845 * composite.c: Use int, not EMACS_INT, for characters.
12846 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12847 EMACS_INT, for values that are known to be in character range.
12848 This doesn't fix any bugs but is the usual style inside Emacs and
12849 may generate better code on 32-bit machines.
12850
12851 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12852 This is for reasons similar to the recent CHAR_STRING fix.
12853 * charset.c (Fencode_char): Check that character arg is actually
12854 a character. Pass an int to ENCODE_CHAR.
12855 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12856 wider than 'int', as a compile-time check to prevent future regressions
12857 in this area.
12858
12859 * character.c (char_string): Remove unnecessary casts.
12860
12861 Make sure a 64-bit char is never passed to CHAR_STRING.
12862 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12863 by silently ignoring the top 32 bits, allowing some values
12864 that were far too large to be valid characters.
12865 * character.h: Include <verify.h>.
12866 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12867 arguments are no wider than unsigned, as a compile-time check
12868 to prevent future regressions in this area.
12869 * data.c (Faset):
12870 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12871 (Fsubst_char_in_region):
12872 * fns.c (concat):
12873 * xdisp.c (decode_mode_spec_coding):
12874 Adjust to CHAR_STRING's new requirement.
12875 * editfns.c (Finsert_char, Fsubst_char_in_region):
12876 * fns.c (concat): Check that character args are actually
12877 characters. Without this test, these functions did the wrong
12878 thing with wildly out-of-range values on 64-bit hosts.
12879
12880 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12881 These casts should not be needed on 32-bit hosts, either.
12882 * keyboard.c (read_char):
12883 * lread.c (Fload): Remove casts to unsigned.
12884
12885 * lisp.h (UNSIGNED_CMP): New macro.
12886 This fixes comparison bugs on 64-bit hosts.
12887 (ASCII_CHAR_P): Use it.
12888 * casefiddle.c (casify_object):
12889 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12890 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12891 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12892 * dispextern.h (FACE_FROM_ID):
12893 * keyboard.c (read_char): Use UNSIGNED_CMP.
12894
12895 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12896 not to EMACS_INT, to avoid GCC warning.
12897
12898 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12899
12900 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12901 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12902 isn't needed on 32-bit machines.
12903
12904 * buffer.c (Fgenerate_new_buffer_name):
12905 Use EMACS_INT for count, not int.
12906 (advance_to_char_boundary): Return EMACS_INT, not int.
12907
12908 * data.c (Qcompiled_function): Now static.
12909
12910 * window.c (window_body_lines): Now static.
12911
12912 * image.c (gif_load): Rename local to avoid shadowing.
12913
12914 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12915 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12916 * alloc.c (make_save_value): Integer argument is now of type
12917 ptrdiff_t, not int.
12918 (mark_object): Use ptrdiff_t, not int.
12919 * lisp.h (pD): New macro.
12920 * print.c (print_object): Use it.
12921
12922 * alloc.c: Use EMACS_INT, not int, to count objects.
12923 (total_conses, total_markers, total_symbols, total_vector_size)
12924 (total_free_conses, total_free_markers, total_free_symbols)
12925 (total_free_floats, total_floats, total_free_intervals)
12926 (total_intervals, total_strings, total_free_strings):
12927 Now EMACS_INT, not int. All uses changed.
12928 (Fgarbage_collect): Compute overall total using a double, so that
12929 integer overflow is less likely to be a problem. Check for overflow
12930 when converting back to an integer.
12931 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12932 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12933 These were 'int' variables that could overflow on 64-bit hosts;
12934 they were never used, so remove them instead of repairing them.
12935 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12936 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12937 Previously, this ceilinged at INT_MAX, but that doesn't work on
12938 64-bit machines.
12939 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12940
12941 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12942 (allocate_vectorlike): Check for ptrdiff_t overflow.
12943 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12944 when a (possibly-narrower) signed value would do just as well.
12945 We prefer using signed arithmetic, to avoid comparison confusion.
12946
12947 * alloc.c: Catch some string size overflows that we were missing.
12948 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12949 for convenience in STRING_BYTES_MAX.
12950 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12951 The definition here is exact; the one in lisp.h was approximate.
12952 (allocate_string_data): Check for string overflow. This catches
12953 some instances we weren't catching before. Also, it catches
12954 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12955 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12956 and ptrdiff_t and EMACS_INT are both 64 bits.
12957
12958 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12959 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12960 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12961
12962 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12963
12964 * alloc.c (Fmake_string): Check for out-of-range init.
12965
12966 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12967
12968 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12969
12970 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12971
12972 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12973 xg_get_default_scrollbar_width.
12974
12975 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12976 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12977 (style_changed_cb): Call update_theme_scrollbar_width and call
12978 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12979 all frames (Bug#8505).
12980 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12981 Call gtk_window_set_resizable if HAVE_GTK3.
12982 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12983 and height if HAVE_GTK3 (Bug#8505).
12984 (scroll_bar_width_for_theme): New variable.
12985 (update_theme_scrollbar_width): New function.
12986 (xg_get_default_scrollbar_width): Move code to
12987 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12988 (xg_initialize): Call update_theme_scrollbar_width.
12989
12990 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12991
12992 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12993
12994 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12995
12996 * frame.c (make_frame): Call other_buffer_safely instead of
12997 other_buffer.
12998
12999 * window.c (temp_output_buffer_show): Call display_buffer with
13000 second argument Vtemp_buffer_show_specifiers and reset latter
13001 immediately after the call.
13002 (Vtemp_buffer_show_specifiers): New variable.
13003 (auto_window_vscroll_p, next_screen_context_lines)
13004 (Vscroll_preserve_screen_position): Remove leading asterisks from
13005 doc-strings.
13006
13007 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13008
13009 Fix minor problems found by GCC 4.6.0 static checking.
13010 * buffer.c (Qclone_number): Remove for now, as it's unused.
13011 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13012 (record_buffer): Remove unused local.
13013 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13014 (set_frame_buffer_list): Remove; unused.
13015 * frame.h (other_visible_frames): Remove decl.
13016 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13017 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13018 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13019 if HAVE_GPM.
13020 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13021 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13022 Define only if HAVE_GPM.
13023 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13024 (update_hints_inhibit): Remove; never set. All uses removed.
13025 * widgetprv.h (emacsFrameClassRec): Remove decl.
13026 * window.c (delete_deletable_window): Now returns void, since it
13027 wasn't returning anything.
13028 (compare_window_configurations): Remove unused locals.
13029 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13030 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13031 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13032 the same widths as pointers. This follows up on the 2011-05-06 patch.
13033 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13034 * xterm.h: Likewise.
13035 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13036
13037 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13038
13039 * makefile.w32-in: Update dependencies.
13040 (LISP_H): Add lib/intprops.h.
13041
13042 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13043
13044 * image.c (gif_load): Add animation frame delay to the metadata.
13045 (syms_of_image): Use DEFSYM. New symbol `delay'.
13046
13047 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13048
13049 * window.c (delete_deletable_window): Re-add.
13050 (Fset_window_configuration): Rewrite to handle dead buffers and
13051 consequently deletable windows.
13052 (window_tree, Fwindow_tree): Remove. Supply functionality in
13053 window.el.
13054 (compare_window_configurations): Simplify code.
13055
13056 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13057
13058 * image.c (imagemagick_load_image): Fix type mismatch.
13059 (Fimagemagick_types): Likewise.
13060
13061 * window.h (replace_buffer_in_windows): Declare.
13062
13063 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13064
13065 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13066 Qclone_number. Remove external declaration of Qdelete_window.
13067 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13068 code.
13069 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13070 Run Qbuffer_list_update_hook if allowed.
13071 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13072 buffer list implementation.
13073 (other_buffer_safely): New function.
13074 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13075 calls to replace_buffer_in_windows and
13076 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13077 if allowed.
13078 (record_buffer): Inhibit quitting and rewrite using quittable
13079 functions. Run Qbuffer_list_update_hook if allowed.
13080 (Frecord_buffer, Funrecord_buffer): New functions.
13081 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13082 Move switch-to-buffer to window.el.
13083 (bury-buffer): Move to window.el.
13084 (Vbuffer_list_update_hook): New variable.
13085
13086 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13087 section.
13088
13089 * window.h (resize_frame_windows): Move up in code.
13090 (Fwindow_frame): Remove EXFUN.
13091 (replace_buffer_in_all_windows): Remove prototype.
13092 (replace_buffer_in_windows_safely): Add prototype.
13093
13094 * window.c: Declare Qdelete_window static again. Move down
13095 declaration of select_count.
13096 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13097 (Fother_window): Move to window.el.
13098 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13099 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13100 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13101 window.el.
13102 (replace_buffer_in_windows): Implement by calling
13103 Qreplace_buffer_in_windows.
13104 (replace_buffer_in_all_windows): Remove with some functionality
13105 moved into replace_buffer_in_windows_safely.
13106 (replace_buffer_in_windows_safely): New function.
13107 (select_window_norecord, select_frame_norecord): Move in front
13108 of run_window_configuration_change_hook. Remove now obsolete
13109 declarations.
13110 (Fset_window_buffer): Rewrite doc-string.
13111 Call Qrecord_window_buffer.
13112 (keys_of_window): Move binding for other-window to window.el.
13113
13114 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13115
13116 * dispextern.h (struct image): Replace data member, whose int_val
13117 and ptr_val fields were not used by anything, with a single
13118 lisp_val object.
13119
13120 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13121 (gif_clear_image, gif_load, imagemagick_load_image)
13122 (gs_clear_image, gs_load): Callers changed.
13123
13124 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13125
13126 * buffer.h: Include <time.h>, for time_t.
13127 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13128
13129 Fix minor problems found by static checking.
13130
13131 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13132
13133 Make identifiers static if they are not used in other modules.
13134 * data.c (Qcompiled_function, Qframe, Qvector):
13135 * image.c (QimageMagick, Qsvg):
13136 * minibuf.c (Qmetadata):
13137 * window.c (resize_window_check, resize_root_window): Now static.
13138 * window.h (resize_window_check, resize_root_window): Remove decls.
13139
13140 * window.c (window_deletion_count, delete_deletable_window):
13141 Remove; unused.
13142 (window_body_lines): Now static.
13143 (Fdelete_other_windows_internal): Mark vars as initialized.
13144 Make sure 'resize_failed' is initialized.
13145 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13146 (resize_window_apply): Remove unused local.
13147 * window.h (delete_deletable_window): Remove decl.
13148
13149 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13150 (imagemagick_load_image): Fix pointer signedness problem by changing
13151 last arg from unsigned char * to char *. All uses changed.
13152 Also, fix a local for similar reasons.
13153 Remove unused locals. Remove locals to avoid shadowing.
13154 (fn_rsvg_handle_free): Remove; unused.
13155 (svg_load, svg_load_image): Fix pointer signedness problem.
13156 (imagemagick_load_image): Don't use garbage pointer image_wand.
13157
13158 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13159
13160 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13161
13162 * image.c (gif_load): Fix omitted cast error introduced by
13163 2011-06-06 change.
13164
13165 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13166
13167 * window.h (resize_proportionally, orig_total_lines)
13168 (orig_top_line): Remove from window structure.
13169 (set_window_height, set_window_width, change_window_heights)
13170 (Fdelete_window): Remove prototypes.
13171 (resize_frame_windows): Remove duplicate declaration.
13172
13173 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13174
13175 * window.h (resize_frame_windows, resize_window_check)
13176 (delete_deletable_window, resize_root_window)
13177 (resize_frame_windows): Declare prototypes.
13178
13179 * window.c (resize_window_apply): Make definition be "static" to
13180 match the prototype.
13181
13182 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13183
13184 * window.c: Remove declarations of Qwindow_size_fixed,
13185 window_min_size_1, window_min_size_2, window_min_size,
13186 size_window, window_fixed_size_p, enlarge_window, delete_window.
13187 Remove static from declaration of Qdelete_window, it's
13188 temporarily needed by Fbury_buffer.
13189 (replace_window): Don't assign orig_top_line and
13190 orig_total_lines.
13191 (Fdelete_window, delete_window): Remove. Window deletion is
13192 handled by window.el.
13193 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13194 Replace Fdelete_window calls with calls to Qdelete_window.
13195 (Fdelete_other_windows): Remove. Deleting other windows is
13196 handled by window.el.
13197 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13198 handled in window.el.
13199 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13200 Window minimum sizes are handled in window.el.
13201 (shrink_windows, size_window, set_window_height)
13202 (set_window_width, change_window_heights, window_height)
13203 (window_width, CURBEG, CURSIZE, enlarge_window)
13204 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13205 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13206 handled in window.el.
13207 (make_dummy_parent): Rename to make_parent_window and give it a
13208 second argument horflag.
13209 (make_window): Don't set resize_proportionally any more.
13210 (Fsplit_window): Remove. Windows are split in window.el.
13211 (save_restore_action, save_restore_orig_size)
13212 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13213 Resize mini windows in window.el.
13214 (grow_mini_window, shrink_mini_window): Implement by calling
13215 Qresize_root_window_vertically, resize_window_check and
13216 resize_window_apply.
13217 (saved_window, Fset_window_configuration, save_window_save):
13218 Do not handle orig_top_line, orig_total_lines, and
13219 resize_proportionally.
13220 (window_min_height, window_min_width): Move to window.el.
13221 (keys_of_window): Move bindings for delete-other-windows,
13222 split-window, delete-window and enlarge-window to window.el.
13223
13224 * buffer.c: Temporarily extern Qdelete_window.
13225 (Fbury_buffer): Temporarily call Qdelete_window instead of
13226 Fdelete_window (Fbury_buffer will move to window.el soon).
13227
13228 * frame.c (set_menu_bar_lines_1): Remove code handling
13229 orig_top_line and orig_total_lines.
13230
13231 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13232 set_window_height but set heights directly.
13233 (change_frame_size_1): Use resize_frame_windows.
13234
13235 * xdisp.c (init_xdisp): Don't use set_window_height but set
13236 heights directly.
13237
13238 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13239 Use resize_frame_windows instead of change_window_heights and run
13240 run_window_configuration_change_hook.
13241
13242 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13243 instead of change_window_heights and run
13244 run_window_configuration_change_hook.
13245
13246 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13247
13248 * window.c (replace_window): Rename second argument REPLACEMENT to
13249 NEW. New third argument SETFLAG. Rewrite.
13250 (delete_window, make_dummy_parent): Call replace_window with
13251 third argument 1.
13252 (window_list_1): Move down in code.
13253 (run_window_configuration_change_hook): Move set_buffer part
13254 before select_frame_norecord part in order to unwind correctly.
13255 Rename count1 to count.
13256 (recombine_windows, delete_deletable_window, resize_root_window)
13257 (Fdelete_other_windows_internal)
13258 (Frun_window_configuration_change_hook, make_parent_window)
13259 (resize_window_check, resize_window_apply, Fresize_window_apply)
13260 (resize_frame_windows, Fsplit_window_internal)
13261 (Fdelete_window_internal, Fresize_mini_window_internal):
13262 New functions.
13263 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13264
13265 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13266
13267 * window.h (window): Add some new members to window structure -
13268 normal_lines, normal_cols, new_total, new_normal, clone_number,
13269 splits, nest, prev_buffers, next_buffers.
13270 (WINDOW_TOTAL_SIZE): Move here from window.c.
13271 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13272
13273 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13274 Remove.
13275 (make_dummy_parent): Set new members of windows structure.
13276 (make_window): Move down in code. Handle new members of window
13277 structure.
13278 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13279 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13280 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13281 (Fset_window_prev_buffers, Fwindow_next_buffers)
13282 (Fset_window_next_buffers, Fset_window_clone_number):
13283 New functions.
13284 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13285 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13286 Doc-string fixes.
13287 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13288 Argument WINDOW can be now internal window too.
13289 (Fwindow_use_time): Move up in code.
13290 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13291 Rewrite doc-string.
13292 (Fset_window_configuration, saved_window)
13293 (Fcurrent_window_configuration, save_window_save): Handle new
13294 members of window structure.
13295 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13296 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13297 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13298 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13299 Qget_mru_window, Qresize_root_window,
13300 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13301 Qauto_buffer_name; staticpro them.
13302
13303 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13304
13305 * window.c (Fwindow_total_size, Fwindow_left_column)
13306 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13307 (Fwindow_list_1): New functions.
13308 (window_box_text_cols): Replace with window_body_cols.
13309 (Fwindow_width, Fscroll_left, Fscroll_right):
13310 Use window_body_cols instead of window_box_text_cols.
13311 (delete_window, Fset_window_configuration):
13312 Call delete_all_subwindows with window as argument.
13313 (delete_all_subwindows): Take a window as argument and not a
13314 structure. Rewrite.
13315 (window_loop): Remove handling of GET_LRU_WINDOW and
13316 GET_LARGEST_WINDOW.
13317 (Fget_lru_window, Fget_largest_window): Move to window.el.
13318
13319 * window.h: Extern window_body_cols instead of
13320 window_box_text_cols. delete_all_subwindows now takes a
13321 Lisp_Object as argument.
13322
13323 * indent.c (compute_motion, Fcompute_motion):
13324 Use window_body_cols instead of window_box_text_cols.
13325
13326 * frame.c (delete_frame): Call delete_all_subwindows with root
13327 window as argument.
13328
13329 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13330
13331 * fns.c (Fputhash): Document return value.
13332
13333 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13334
13335 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13336
13337 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13338
13339 Cons<->int and similar integer overflow fixes (Bug#8794).
13340
13341 Check for overflow when converting integer to cons and back.
13342 * charset.c (Fdefine_charset_internal, Fdecode_char):
13343 Use cons_to_unsigned to catch overflow.
13344 (Fencode_char): Use INTEGER_TO_CONS.
13345 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13346 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13347 * data.c (long_to_cons, cons_to_long): Remove.
13348 (cons_to_unsigned, cons_to_signed): New functions.
13349 These signal an error for invalid or out-of-range values.
13350 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13351 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13352 * font.c (Ffont_variation_glyphs):
13353 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13354 * lisp.h: Include <intprops.h>.
13355 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13356 (cons_to_signed, cons_to_unsigned): New decls.
13357 (long_to_cons, cons_to_long): Remove decls.
13358 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13359 (Fprimitive_undo): Use CONS_TO_INTEGER.
13360 * xfns.c (Fx_window_property): Likewise.
13361 * xselect.c: Include <limits.h>.
13362 (x_own_selection, selection_data_to_lisp_data):
13363 Use INTEGER_TO_CONS.
13364 (x_handle_selection_request, x_handle_selection_clear)
13365 (x_get_foreign_selection, Fx_disown_selection_internal)
13366 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13367 (lisp_data_to_selection_data): Use cons_to_unsigned.
13368 (x_fill_property_data): Use cons_to_signed.
13369 Report values out of range.
13370
13371 Check for buffer and string overflow more precisely.
13372 * buffer.h (BUF_BYTES_MAX): New macro.
13373 * lisp.h (STRING_BYTES_MAX): New macro.
13374 * alloc.c (Fmake_string):
13375 * character.c (string_escape_byte8):
13376 * coding.c (coding_alloc_by_realloc):
13377 * doprnt.c (doprnt):
13378 * editfns.c (Fformat):
13379 * eval.c (verror):
13380 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13381 since they may not be the same number.
13382 * editfns.c (Finsert_char):
13383 * fileio.c (Finsert_file_contents):
13384 Likewise for BUF_BYTES_MAX.
13385
13386 * image.c: Use ptrdiff_t, not int, for sizes.
13387 (slurp_file): Switch from int to ptrdiff_t.
13388 All uses changed.
13389 (slurp_file): Check that file size fits in both size_t (for
13390 malloc) and ptrdiff_t (for sanity and safety).
13391
13392 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13393 if b->modtime has its maximal value.
13394
13395 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13396
13397 Don't assume time_t can fit into int.
13398 * buffer.h (struct buffer.modtime): Now time_t, not int.
13399 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13400 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13401
13402 Minor fixes for signed vs unsigned integers.
13403 * character.h (MAYBE_UNIFY_CHAR):
13404 * charset.c (maybe_unify_char):
13405 * keyboard.c (read_char, reorder_modifiers):
13406 XINT -> XFASTINT, since the integer must be nonnegative.
13407 * ftfont.c (ftfont_spec_pattern):
13408 * keymap.c (access_keymap, silly_event_symbol_error):
13409 XUINT -> XFASTINT, since the integer must be nonnegative.
13410 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13411 since it makes no difference and we prefer signed.
13412 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13413 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13414 nonnegative.
13415
13416 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13417
13418 * window.h (Fwindow_frame): Declare.
13419
13420 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13421
13422 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13423 (SPARE_MEMORY): Always define.
13424 (LARGE_REQUEST): Remove.
13425 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13426
13427 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13428
13429 * lisp.h: Move EXFUNS for Fframe_root_window,
13430 Fframe_first_window and Fset_frame_selected_window to window.h.
13431
13432 * window.h: Move EXFUNS for Fframe_root_window,
13433 Fframe_first_window and Fset_frame_selected_window here from
13434 lisp.h.
13435
13436 * frame.c (Fwindow_frame, Fframe_first_window)
13437 (Fframe_root_window, Fframe_selected_window)
13438 (Fset_frame_selected_window): Move to window.c.
13439 (Factive_minibuffer_window): Move to minibuf.c.
13440 (Fother_visible_frames_p): New function.
13441
13442 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13443
13444 * window.c (decode_window, decode_any_window): Move up in code.
13445 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13446 (inhibit_frame_unsplittable): Remove unused variable.
13447 (Fwindow_buffer): Move up and rewrite doc-string.
13448 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13449 (Fwindow_prev): New functions.
13450 (Fwindow_frame): Move here from frame.c. Accept any window as
13451 argument.
13452 (Fframe_root_window, Fframe_first_window)
13453 (Fframe_selected_window): Move here from frame.c. Accept frame
13454 or arbitrary window as argument. Update doc-strings.
13455 (Fminibuffer_window): Move up in code.
13456 (Fwindow_minibuffer_p): Move up in code and simplify.
13457 (Fset_frame_selected_window): Move here from frame.c.
13458 Marginal rewrite.
13459 (Fselected_window, select_window, Fselect_window): Move up in
13460 code. Minor doc-string fixes.
13461
13462 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13463
13464 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13465 Do not assume that spare memory exists; that assumption is valid
13466 only if SYSTEM_MALLOC.
13467 (LARGE_REQUEST): New macro, so that the issue of large requests
13468 is separated from the issue of spare memory.
13469
13470 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13471
13472 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13473 format. (Bug#8806)
13474
13475 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13476
13477 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13478 before statements.
13479
13480 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13481
13482 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13483
13484 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13485
13486 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13487 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13488
13489 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13490
13491 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13492
13493 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13494
13495 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13496 (x_clipboard_manager_save): Add return value.
13497 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13498 New error handlers.
13499 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13500 Obey Vx_select_enable_clipboard_manager. Catch errors in
13501 x_clipboard_manager_save (Bug#8779).
13502 (Vx_select_enable_clipboard_manager): New variable.
13503 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13504
13505 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13506
13507 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13508
13509 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13510
13511 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13512 in the current matrix if keep_current_p is non-zero.
13513
13514 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13515
13516 * bidi.c (bidi_level_of_next_char): Fix last change.
13517
13518 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13519
13520 Support bidi reordering of text covered by display properties.
13521
13522 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13523 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13524 (bidi_cache_search, bidi_cache_iterator_state)
13525 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13526 (bidi_level_of_next_char, bidi_move_to_visually_next):
13527 Support character positions inside a run of characters covered by a
13528 display string.
13529 (bidi_paragraph_init, bidi_resolve_explicit_1)
13530 (bidi_level_of_next_char): Call bidi_fetch_char and
13531 bidi_fetch_char_advance instead of FETCH_CHAR and
13532 FETCH_CHAR_ADVANCE.
13533 (bidi_init_it): Initialize new members.
13534 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13535 definitions.
13536 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13537 instead of using explicit *_CHAR codes.
13538 (bidi_resolve_explicit, bidi_resolve_weak):
13539 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13540 bidirectional text is supported only in multibyte buffers.
13541 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13542 it to initialize the frame_window_p member of struct bidi_it.
13543 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13544 (bidi_resolve_explicit, bidi_resolve_weak)
13545 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13546 bidi_it->nchars is non-positive.
13547 (bidi_level_of_next_char): Don't try to lookup the cache for the
13548 next/previous character if nothing is cached there yet, or if we
13549 were just reseat()'ed to a new position.
13550
13551 * xdisp.c (set_cursor_from_row): Set start and stop points
13552 according to the row's direction when priming the loop that looks
13553 for the glyph on which to display cursor.
13554 (single_display_spec_intangible_p): Function deleted.
13555 (display_prop_intangible_p): Reimplement to call
13556 handle_display_spec instead of single_display_spec_intangible_p.
13557 Accept 3 additional arguments needed by handle_display_spec.
13558 This fixes incorrect cursor motion across display property with complex
13559 values: lists, `(when COND...)' forms, etc.
13560 (single_display_spec_string_p): Support property values that are
13561 lists with the argument STRING its top-level element.
13562 (display_prop_string_p): Fix the condition for processing a
13563 property that is a list to be consistent with handle_display_spec.
13564 (handle_display_spec): New function, refactored from the
13565 last portion of handle_display_prop.
13566 (compute_display_string_pos): Accept additional argument
13567 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13568 value of a `display' property is a "replacing spec".
13569 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13570 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13571 the display property, but just return a value indicating whether
13572 the display property will replace the characters it covers.
13573 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13574 frame_window_p members of struct bidi_it.
13575 (compute_display_string_pos, compute_display_string_end):
13576 New functions.
13577 (push_it): Accept second argument POSITION, where pop_it should
13578 jump to continue iteration.
13579 (reseat_1): Initialize bidi_it.disp_pos.
13580
13581 * keyboard.c (adjust_point_for_property): Adjust the call to
13582 display_prop_intangible_p to its new signature.
13583
13584 * dispextern.h (struct bidi_it): New member frame_window_p.
13585 (bidi_init_it): Update prototypes.
13586 (display_prop_intangible_p): Update prototype.
13587 (compute_display_string_pos, compute_display_string_end):
13588 Declare prototypes.
13589 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13590 EMACS_INT.
13591
13592 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13593
13594 Malloc failure behavior now depends on size of allocation.
13595 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13596 * lisp.h: Change signatures accordingly.
13597 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13598 All callers changed. (Bug#8762)
13599
13600 * gnutls.c: Use Emacs's memory allocators.
13601 Without this change, the gnutls library would invoke malloc etc.
13602 directly, which causes problems on non-SYNC_INPUT hosts, and which
13603 runs afoul of improving memory_full behavior. (Bug#8761)
13604 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13605 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13606 xfree instead of the default malloc, realloc, free.
13607 (Fgnutls_boot): No need to check for memory allocation failure,
13608 since xmalloc does that for us.
13609
13610 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13611 * category.c (hash_get_category_set):
13612 * ccl.c (ccl_driver):
13613 * charset.c (Fdefine_charset_internal):
13614 * charset.h (struct charset.hash_index):
13615 * composite.c (get_composition_id, gstring_lookup_cache)
13616 (composition_gstring_put_cache):
13617 * composite.h (struct composition.hash_index):
13618 * dispextern.h (struct image.hash):
13619 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13620 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13621 (hashfn_equal, hashfn_user_defined, make_hash_table)
13622 (maybe_resize_hash_table, hash_lookup, hash_put)
13623 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13624 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13625 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13626 * image.c (make_image, search_image_cache, lookup_image)
13627 (xpm_put_color_table_h):
13628 * lisp.h (struct Lisp_Hash_Table):
13629 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13630 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13631 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13632 * alloc.c (allocate_vectorlike):
13633 Check for overflow in vector size calculations.
13634 * ccl.c (ccl_driver):
13635 Check for overflow when converting EMACS_INT to int.
13636 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13637 need to be updated by these changes.
13638 * fns.c (make_hash_table, maybe_resize_hash_table):
13639 Check for integer overflow with large hash tables.
13640 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13641 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13642 (SXHASH_REDUCE): New macro.
13643 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13644 Use it instead of discarding useful hash info with large hash values.
13645 (sxhash_float): New function.
13646 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13647 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13648 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13649 Rewrite to use FIXNUM_BITS, as this simplifies things.
13650 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13651 Adjust signatures to match updated version of code.
13652 (consing_since_gc): Now EMACS_INT, since a single hash table can
13653 use more than INT_MAX bytes.
13654
13655 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13656
13657 Make it possible to build with GCC-4.6+ -O2 -flto.
13658
13659 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13660
13661 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13662
13663 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13664 Call minibuffer-inactive-mode.
13665
13666 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13667
13668 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13669 Update dependencies.
13670
13671 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13672
13673 * data.c (init_data): Remove code for UTS, this system is not
13674 supported anymore.
13675
13676 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13677
13678 Don't force ./temacs to start in terminal mode.
13679
13680 * frame.c (make_initial_frame): Initialize faces in all cases, not
13681 only when CANNOT_DUMP is defined.
13682 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13683
13684 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13685
13686 * dispnew.c (add_window_display_history): Use const for the string
13687 pointer. Remove declaration, not needed.
13688
13689 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13690
13691 Use 'inline', not 'INLINE'.
13692 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13693 * alloc.c, fontset.c (INLINE): Remove.
13694 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13695 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13696 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13697 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13698 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13699
13700 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13701
13702 Make it possible to run ./temacs.
13703
13704 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13705 syms_of_callproc does the same thing. Remove test for
13706 "initialized", do it in the caller.
13707 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13708
13709 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13710
13711 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13712 (read_minibuf): Use get_minibuffer.
13713 (syms_of_minibuf): Use DEFSYM.
13714 (Qmetadata): New var.
13715 * data.c (Qbuffer): Don't make it static.
13716 (syms_of_data): Use DEFSYM.
13717
13718 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13719
13720 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13721 (CCL_CODE_MIN): New macro.
13722
13723 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13724
13725 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13726
13727 * eval.c (Qdebug): Now static.
13728 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13729 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13730 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13731
13732 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13733
13734 * image.c: Various fixes to ImageMagick code comments.
13735 (Fimagemagick_types): Doc fix.
13736
13737 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13738
13739 Minor fixes prompted by GCC 4.6.0 warnings.
13740
13741 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13742
13743 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13744 (x_clipboard_manager_save_all): Move extern decl to ...
13745 * xterm.h: ... here, so that it can be checked for consistency.
13746
13747 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13748
13749 * xselect.c (x_clipboard_manager_save_frame)
13750 (x_clipboard_manager_save_all): New functions.
13751 (Fx_clipboard_manager_save): Lisp function deleted.
13752
13753 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13754 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13755
13756 * xterm.h: Update prototype.
13757
13758 2011-05-28 William Xu <william.xwl@gmail.com>
13759
13760 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13761 exiting (Bug#8239).
13762
13763 2011-05-28 Jim Meyering <meyering@redhat.com>
13764
13765 Avoid a sign-extension bug in crypto_hash_function.
13766 * fns.c (to_uchar): Define.
13767 (crypto_hash_function): Use it to convert some newly-signed
13768 variables to unsigned, to avoid sign-extension bugs. For example,
13769 without this change, (md5 "truc") would evaluate to
13770 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13771 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13772 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13773
13774 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13775
13776 Integer overflow fixes.
13777
13778 * dbusbind.c: Serial number integer overflow fixes.
13779 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13780 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13781 to hold a serial number that is too large for a fixnum.
13782 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13783 Check for serial numbers out of range. Decode any serial number
13784 that was so large that it became a float. (Bug#8722)
13785
13786 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13787 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13788 Use XFASTINT rather than XUINT when numbers are nonnegative.
13789 (xd_append_arg, Fdbus_method_return_internal):
13790 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13791 arguments, check that Lisp number is nonnegative, rather than
13792 silently wrapping negative numbers around. (Bug#8722)
13793 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13794 (Bug#8722)
13795
13796 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13797
13798 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13799
13800 ccl: Add integer overflow checks.
13801 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13802 (IN_INT_RANGE): New macros.
13803 (ccl_driver): Use them to check for integer overflow when
13804 decoding a CCL program. Many of the new checks are whether XINT (x)
13805 fits in int; it doesn't always, on 64-bit hosts. The new version
13806 doesn't catch all possible integer overflows, but it's an
13807 improvement. (Bug#8719)
13808
13809 * alloc.c (make_event_array): Use XINT, not XUINT.
13810 There's no need for unsigned here.
13811
13812 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13813 This follows up to the 2011-05-06 change that substituted uintptr_t
13814 for EMACS_INT. This case wasn't caught back then.
13815
13816 Rework Fformat to avoid integer overflow issues.
13817 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13818 now (part of C89). Include <verify.h>.
13819 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13820 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13821 (Fformat): Avoid the prepass trying to compute sizes; it was only
13822 approximate and thus did not catch overflow reliably. Instead, walk
13823 through the format just once, formatting and computing sizes as we go,
13824 checking for integer overflow at every step, and allocating a larger
13825 buffer as needed. Keep track separately whether the format is
13826 multibyte. Keep only the most-recently calculated precision, rather
13827 than them all. Record whether each argument has been converted to
13828 string. Use EMACS_INT, not int, for byte and char and arg counts.
13829 Support field widths and precisions larger than INT_MAX. Avoid
13830 sprintf's undefined behavior with conversion specifications such as %#d
13831 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13832 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13833 formatting out-of-range floating point numbers with int
13834 formats. (Bug#8668)
13835
13836 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13837
13838 * data.c: Avoid integer truncation in expressions involving floats.
13839 * data.c: Include <intprops.h>.
13840 (arith_driver): When there's an integer overflow in an expression
13841 involving floating point, convert the integers to floating point
13842 so that the resulting value does not suffer from catastrophic
13843 integer truncation. For example, on a 64-bit host (* 4
13844 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13845 Do not rely on undefined behavior after integer overflow.
13846
13847 merge count_size_as_multibyte, parse_str_to_multibyte
13848 * character.c, character.h (count_size_as_multibyte):
13849 Rename from parse_str_to_multibyte; all uses changed.
13850 Check for integer overflow.
13851 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13852 since it's now a duplicate of the other. This is more of
13853 a character than a buffer op, so better that it's in character.c.
13854 * fns.c, print.c: Adjust to above changes.
13855
13856 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13857
13858 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13859
13860 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13861
13862 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13863 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13864 (x_clipboard_manager_save): Now static.
13865 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13866
13867 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13868 (crypto_hash_function): Now static.
13869 Fix pointer signedness problems. Avoid unnecessary initializations.
13870
13871 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13872
13873 * termhooks.h (Vselection_alist): Make it terminal-local.
13874
13875 * terminal.c (create_terminal): Initialize it.
13876
13877 * xselect.c: Support for clipboard managers.
13878 (Vselection_alist): Move to termhooks.h as terminal-local var.
13879 (LOCAL_SELECTION): New macro.
13880 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13881 (symbol_to_x_atom): Remove gratuitous arg.
13882 (x_handle_selection_request, lisp_data_to_selection_data)
13883 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13884 (x_own_selection, x_get_local_selection, x_convert_selection):
13885 New arg, specifying work frame. Use terminal-local Vselection_alist.
13886 (some_frame_on_display): Delete unused function.
13887 (Fx_own_selection_internal, Fx_get_selection_internal)
13888 (Fx_disown_selection_internal, Fx_selection_owner_p)
13889 (Fx_selection_exists_p): New optional frame arg.
13890 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13891 (x_handle_selection_clear): Don't treat other terminals with the
13892 same keyboard specially. Use the terminal-local Vselection_alist.
13893 (x_clear_frame_selections): Use Frun_hook_with_args.
13894
13895 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13896
13897 * xterm.h: Add support for those atoms.
13898
13899 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13900
13901 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13902 (converted_selections, conversion_fail_tag): New global variables.
13903 (x_selection_request_lisp_error): Free the above.
13904 (x_get_local_selection): Remove unnecessary code.
13905 (x_reply_selection_request): Args changed; handle arbitrary array
13906 of converted selections stored in converted_selections.
13907 Separate the XChangeProperty and SelectionNotify steps.
13908 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13909 (x_convert_selection): New function.
13910 (x_handle_selection_event): Simplify.
13911 (x_get_foreign_selection): Don't ignore incoming requests while
13912 waiting for an answer; this will fail when we implement
13913 SAVE_TARGETS, and seems unnecessary anyway.
13914 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13915 (Vx_sent_selection_functions): Doc fix.
13916
13917 2011-05-26 Leo Liu <sdl.web@gmail.com>
13918
13919 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13920
13921 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13922
13923 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13924
13925 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13926 for fringe update if it has periodic bitmap.
13927 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13928 and fringe_bitmap_periodic_p.
13929
13930 * fringe.c (get_fringe_bitmap_data): New function.
13931 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13932 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13933 row. Mark glyph row for fringe update if periodicity changed.
13934
13935 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13936 for fringe update unless it has periodic bitmap.
13937
13938 2011-05-25 Kenichi Handa <handa@m17n.org>
13939
13940 * xdisp.c (get_next_display_element): Set correct it->face_id for
13941 a static composition.
13942
13943 2011-05-24 Leo Liu <sdl.web@gmail.com>
13944
13945 * deps.mk (fns.o):
13946 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13947
13948 * fns.c (crypto_hash_function, Fsha1): New function.
13949 (Fmd5): Use crypto_hash_function.
13950 (syms_of_fns): Add Ssha1.
13951
13952 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13953
13954 * gnutls.c: Remove unused macros.
13955 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13956 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13957 Remove macros that are defined and never used.
13958 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13959
13960 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13961
13962 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13963 (Fx_get_selection_internal): Minor cleanup.
13964 (Fx_own_selection_internal): Rename arguments for consistency with
13965 select.el.
13966
13967 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13968
13969 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13970
13971 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13972
13973 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13974
13975 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13976
13977 * dispnew.c (scrolling_window): Don't exclude the case that the
13978 last enabled row in the desired matrix touches the bottom boundary.
13979
13980 2011-05-21 Glenn Morris <rgm@gnu.org>
13981
13982 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13983 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13984 and add some more files.
13985
13986 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13987
13988 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13989 report_file_error introduced by the change from 2011-05-07.
13990
13991 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13992
13993 * systime.h (Time): Define only if emacs is defined.
13994 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13995 where the include path doesn't have X11/X.h by default. See
13996 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13997
13998 2011-05-20 Kenichi Handa <handa@m17n.org>
13999
14000 * composite.c (find_automatic_composition): Fix previous change.
14001
14002 2011-05-20 Glenn Morris <rgm@gnu.org>
14003
14004 * lisp.mk: New file, split from Makefile.in.
14005 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14006 (shortlisp): Remove.
14007 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14008
14009 2011-05-19 Glenn Morris <rgm@gnu.org>
14010
14011 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14012 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14013 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14014 (lisp): Set the order to that of loadup.el.
14015 (shortlisp): Make it a copy of $lisp.
14016 (SOME_MACHINE_LISP): Remove.
14017 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14018 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14019
14020 2011-05-18 Kenichi Handa <handa@m17n.org>
14021
14022 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14023 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14024 (find_automatic_composition): Mostly rewrite for efficiency.
14025
14026 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14027
14028 * makefile.w32-in: Update dependencies.
14029
14030 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14031
14032 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14033 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14034
14035 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14036
14037 Fix some integer overflow issues, such as string length overflow.
14038
14039 * insdel.c (count_size_as_multibyte): Check for string overflow.
14040
14041 * character.c (lisp_string_width): Check for string overflow.
14042 Use EMACS_INT, not int, for string indexes and lengths; in
14043 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14044 the resulting string length overflows an EMACS_INT; instead,
14045 report a string overflow if no precision given. When checking for
14046 precision exhaustion, use a check that cannot possibly have
14047 integer overflow. (Bug#8675)
14048 * character.h (lisp_string_width): Adjust to new signature.
14049
14050 * alloc.c (string_overflow): New function.
14051 (Fmake_string): Use it. This doesn't change behavior, but saves
14052 a few bytes and will simplify future changes.
14053 * character.c (string_escape_byte8): Likewise.
14054 * lisp.h (string_overflow): New decl.
14055
14056 Fixups, following up to the user-interface timestamp change.
14057 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14058 for UI timestamps, instead of unsigned long.
14059 * msdos.c (mouse_get_pos): Likewise.
14060 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14061 * w32gui.h (Time): Define by including "systime.h" rather than by
14062 declaring it ourselves. (Bug#8664)
14063
14064 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14065 * image.c (clear_image_cache): Likewise.
14066
14067 * term.c (term_mouse_position): Don't assume time_t wraparound.
14068
14069 Be more systematic about user-interface timestamps.
14070 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14071 and sometimes 'EMACS_UINT', to represent these timestamps.
14072 This change causes it to use 'Time' uniformly, as that's what X uses.
14073 This makes the code easier to follow, and makes it easier to catch
14074 integer overflow bugs such as Bug#8664.
14075 * frame.c (Fmouse_position, Fmouse_pixel_position):
14076 Use Time, not unsigned long, for user-interface timestamps.
14077 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14078 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14079 * keyboard.h (last_event_timestamp): Likewise.
14080 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14081 * menu.h (xmenu_show): Likewise.
14082 * term.c (term_mouse_position): Likewise.
14083 * termhooks.h (struct input_event.timestamp): Likewise.
14084 (struct terminal.mouse_position_hook): Likewise.
14085 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14086 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14087 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14088 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14089 what it was before.
14090 * menu.h, termhooks.h: Include "systime.h", for Time.
14091
14092 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14093 Don't assume that the difference between two unsigned long values
14094 can fit into an integer. At this point, we know button_down_time
14095 <= event->timestamp, so the difference must be nonnegative, so
14096 there's no need to cast the result if double-click-time is
14097 nonnegative, as it should be; check that it's nonnegative, just in
14098 case. This bug is triggered when events are more than 2**31 ms
14099 apart (about 25 days). (Bug#8664)
14100
14101 * xselect.c (last_event_timestamp): Remove duplicate decl.
14102 (x_own_selection): Remove needless cast to unsigned long.
14103
14104 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14105 that always fit in int. Use a sentinel instead of a counter, to
14106 avoid a temp and to allay GCC's concerns about possible int overflow.
14107 * frame.h (struct frame): Use int for menu_bar_items_used
14108 instead of EMACS_INT, since it always fits in int.
14109
14110 * menu.c (grow_menu_items): Check for int overflow.
14111
14112 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14113
14114 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14115 Before, the code was not consistent. These values cannot exceed
14116 2**31 - 1 so there's no need to make them unsigned.
14117 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14118 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14119 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14120 as modifiers.
14121 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14122
14123 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14124 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14125 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14126 presumably because the widths might not match.
14127
14128 * window.c (size_window): Avoid needless test at loop start.
14129
14130 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14131
14132 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14133
14134 2011-05-12 Drew Adams <drew.adams@oracle.com>
14135
14136 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14137
14138 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14139
14140 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14141 `width' to `bar_area_x' and `bar_area_width', respectively.
14142 (x_scroll_run): Take account of fringe background extension.
14143
14144 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14145 Rename local vars `left' and `width' to `bar_area_x' and
14146 `bar_area_width', respectively.
14147 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14148 background extension.
14149
14150 2011-05-10 Jim Meyering <meyering@redhat.com>
14151
14152 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14153
14154 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14155
14156 * image.c (Finit_image_library): Return t for built-in image types,
14157 like pbm and xbm. (Bug#8640)
14158
14159 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14160
14161 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14162
14163 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14164
14165 * w32console.c (Fset_screen_color): Doc fix.
14166 (Fget_screen_color): New function.
14167 (syms_of_ntterm): Defsubr it.
14168
14169 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14170 unlink the temporary file if Fcall_process didn't create it in the
14171 first place.
14172 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14173 child process will be redirected to a file specified with `:file'.
14174 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14175 cue to call_process_cleanup not to close that handle.
14176
14177 2011-05-07 Ben Key <bkey76@gmail.com>
14178
14179 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14180 one of two shell specific rules, either bootstrap-temacs-CMD or
14181 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14182 to the previous implementation of the bootstrap-temacs rule.
14183 The bootstrap-temacs-CMD rule is similar to the previous
14184 implementation of the bootstrap-temacs rule except that it
14185 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14186 variable.
14187
14188 These changes, along with some changes to nt/configure.bat,
14189 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14190 earlier fix to add support for --cflags and --ldflags options
14191 that include quotes so that it works whether make uses cmd or
14192 sh as the shell.
14193
14194 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14195
14196 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14197 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14198 is a constant.
14199 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14200 a string. Handle both cases.
14201 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14202 (Fdbus_register_method): Use Qinvalid_function.
14203
14204 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14205
14206 * makefile.w32-in: Update dependencies.
14207 (LISP_H): Add inttypes.h and stdin.h.
14208 (PROCESS_H): Add unistd.h.
14209
14210 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14211
14212 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14213 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14214
14215 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14216
14217 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14218
14219 * term.c (vfatal): Remove stray call to va_end.
14220 It's not needed and the C Standard doesn't allow it here anyway.
14221
14222 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14223 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14224
14225 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14226 bytes.
14227
14228 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14229
14230 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14231
14232 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14233
14234 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14235
14236 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14237
14238 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14239 * charset.c (Fdefine_charset_internal): Don't initialize
14240 charset.code_space[15]. The value was garbage, on hosts with
14241 32-bit int (Bug#8600).
14242
14243 * lread.c (read_integer): Be more consistent with string-to-number.
14244 Use string_to_number to do the actual conversion; this avoids
14245 rounding errors and fixes some other screwups. Without this fix,
14246 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14247 (digit_to_number): Move earlier, for benefit of read_integer.
14248 Return -1 if the digit is out of range for the base, -2 if it is
14249 not a digit in any supported base. (Bug#8602)
14250
14251 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14252
14253 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14254 to match comment at start of function. This also removes a
14255 GCC warning about overflow in a 32+64-bit port.
14256
14257 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14258
14259 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14260 Reported by Stefan Monnier in
14261 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14262 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14263 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14264
14265 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14266 (EMACS_UINTPTR): Likewise, with uintptr_t.
14267
14268 * lisp.h: Prefer 64-bit EMACS_INT if available.
14269 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14270 on 32-bit hosts that have 64-bit int, so that they can access
14271 large files.
14272 However, temporarily disable this change unless the temporary
14273 symbol WIDE_EMACS_INT is defined.
14274
14275 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14276
14277 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14278 This removes an assumption that EMACS_INT and long are the same
14279 width as pointers. The assumption is true for Emacs porting targets
14280 now, but we want to make other targets possible.
14281 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14282 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14283 In the rest of the code, change types of integers that hold casted
14284 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14285 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14286 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14287 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14288 No need to cast type when ORing.
14289 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14290 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14291 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14292 assume EMACS_INT is the same width as char *.
14293 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14294 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14295 Remove no-longer-needed casts.
14296 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14297 (xg_tool_bar_help_callback, xg_make_tool_item):
14298 Use EMACS_INTPTR to hold an integer
14299 that will be cast to void *; this can avoid a GCC warning
14300 if EMACS_INT is not the same width as void *.
14301 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14302 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14303 (current_message_1, set_message_1):
14304 Use a local to convert to proper width without a cast.
14305 * xmenu.c (dialog_selection_callback): Likewise.
14306
14307 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14308 Also, don't assume VALBITS / RAND_BITS is less than 5,
14309 and don't rely on undefined behavior when shifting a 1 left into
14310 the sign bit.
14311 * lisp.h (get_random): Change signature to match.
14312
14313 * lread.c (hash_string): Use size_t, not int, for hash computation.
14314 Normally we prefer signed values; but hashing is special, because
14315 it's better to use unsigned division on hash table sizes so that
14316 the remainder is nonnegative. Also, size_t is the natural width
14317 for hashing into memory. The previous code used 'int', which doesn't
14318 retain enough info to hash well into very large tables.
14319 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14320
14321 * dbusbind.c: Don't possibly lose pointer info when converting.
14322 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14323 Use XPNTR rather than XHASH, so that the high-order bits of
14324 the pointer aren't lost when converting through void *.
14325
14326 * eval.c (Fautoload): Don't double-shift a pointer.
14327
14328 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14329
14330 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14331
14332 * gnutls.c (DEF_GNUTLS_FN):
14333 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14334
14335 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14336
14337 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14338 marker. (Bug#8610)
14339
14340 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14341
14342 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14343 New version that can reserve upto 2GB of heap space.
14344
14345 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14346
14347 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14348
14349 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14350
14351 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14352 `gnutls_certificate_set_x509_key_file'.
14353
14354 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14355
14356 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14357 Update dependencies.
14358
14359 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14360
14361 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14362 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14363 Remove unused parameter `fildes'.
14364 * process.c (read_process_output, send_process): Don't pass it.
14365
14366 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14367
14368 Fix previous change: the library cache is defined in w32.c.
14369 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14370 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14371
14372 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14373
14374 Implement dynamic loading of GnuTLS on Windows.
14375
14376 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14377 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14378 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14379 Declare.
14380
14381 * gnutls.c (Qgnutls_dll): Define.
14382 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14383 (gnutls_*): Declare function pointers.
14384 (init_gnutls_functions): New function to initialize function pointers.
14385 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14386 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14387 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14388 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14389 (emacs_gnutls_write, emacs_gnutls_read)
14390 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14391 (Fgnutls_available_p): New function.
14392 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14393 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14394 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14395
14396 * image.c: Include w32.h.
14397 (Vimage_type_cache): Delete.
14398 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14399 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14400 (w32_delayed_load): Move to w32.c.
14401
14402 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14403
14404 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14405 (w32_delayed_load): Move from image.c. When loading a library, record
14406 its filename in the :loaded-from property of the library id.
14407 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14408 Initialize and staticpro them.
14409 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14410
14411 * process.c: Include lisp.h before w32.h, not after.
14412 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14413 instead of gnutls_record_check_pending.
14414
14415 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14416
14417 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14418
14419 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14420 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14421 as passed in.
14422
14423 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14424
14425 * xterm.c (x_set_frame_alpha): Do not set property on anything
14426 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14427
14428 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14429
14430 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14431
14432 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14433
14434 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14435 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14436 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14437 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14438 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14439 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14440 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14441 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14442 (Qgnutls_bootprop_callbacks_verify): Make static.
14443
14444 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14445
14446 * callproc.c: Indentation fixup.
14447
14448 * sysdep.c (wait_for_termination_1): Make static.
14449 (wait_for_termination, interruptible_wait_for_termination):
14450 Move after wait_for_termination_1.
14451
14452 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14453
14454 * sysdep.c (interruptible_wait_for_termination): New function
14455 which is like wait_for_termination, but allows keyboard
14456 interruptions.
14457
14458 * callproc.c (Fcall_process): Add (:file "file") as an option for
14459 the STDOUT buffer.
14460 (Fcall_process_region): Ditto.
14461
14462 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14463
14464 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14465 rather than `XVECTOR (FOO)->size'.
14466
14467 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14468 inttypes.h, as a gnulib replacement is used if it not available in
14469 system headers.
14470
14471 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14472
14473 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14474 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14475 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14476
14477 * coding.c (coding_alloc_by_realloc): Error out if destination
14478 will grow beyond MOST_POSITIVE_FIXNUM.
14479 (decode_coding_emacs_mule): Abort if there isn't enough place in
14480 charbuf for the composition carryover bytes. Reserve an extra
14481 space for up to 2 characters produced in a loop.
14482 (decode_coding_iso_2022): Abort if there isn't enough place in
14483 charbuf for the composition carryover bytes.
14484
14485 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14486
14487 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14488 aborting when %lld or %lll format is passed.
14489 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14490 %llo or %llx format is passed. (Bug#8545)
14491
14492 * window.c (window_scroll_line_based): Use a marker instead of
14493 simple variables to record original value of point. (Bug#7952)
14494
14495 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14496 produced by %s or %c overflows available buffer space. (Bug#8545)
14497
14498 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14499
14500 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14501 (SIZE_MAX): Move defn after all includes, as they might #define it.
14502
14503 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14504
14505 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14506
14507 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14508
14509 * keyboard.c (Qdelayed_warnings_hook): Define.
14510 (command_loop_1): Run `delayed-warnings-hook'
14511 if Vdelayed_warnings_list is non-nil.
14512 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14513 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14514
14515 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14516
14517 * doprnt.c (doprnt): Don't return value smaller than the buffer
14518 size if the message was truncated. (Bug#8545).
14519
14520 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14521
14522 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14523 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14524
14525 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14526
14527 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14528
14529 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14530
14531 * makefile.w32-in: Update dependencies.
14532
14533 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14534
14535 Improve `doprnt' and its usage. (Bug#8545)
14536 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14537 `format_end'. Remove support for %l as a conversion specifier.
14538 Don't use xrealloc. Improve diagnostics when the %l size modifier
14539 is used. Update the commentary.
14540
14541 * eval.c (verror): Simplify calculation of size_t.
14542
14543 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14544 messages.
14545
14546 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14547
14548 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14549 change.
14550
14551 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14552
14553 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14554 This makes this file independent of the recent pseudovector change.
14555
14556 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14557
14558 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14559
14560 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14561 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14562 Remove unused local.
14563 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14564
14565 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14566 GCC 4.6.0 optimizes based on type-based alias analysis.
14567 For example, if b is of type struct buffer * and v of type struct
14568 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14569 != &v->size, and therefore "v->size = 1; b->size = 2; return
14570 v->size;" must therefore return 1. This assumption is incorrect
14571 for Emacs, since it type-puns struct Lisp_Vector * with many other
14572 types. To fix this problem, this patch adds a new type struct
14573 vectorlike_header that documents the constraints on layout of vectors
14574 and pseudovectors, and helps optimizing compilers not get fooled
14575 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14576 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14577 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14578 the size member.
14579 (XSETPVECTYPE): Rewrite in terms of new macro.
14580 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14581 This is a bit clearer, and further avoids the possibility of
14582 undesirable aliasing.
14583 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14584 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14585 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14586 since Lisp_Subr is a special case (no "next" field).
14587 (ASIZE): Now uses header.size rather than size.
14588 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14589 to avoid the hassle of writing XVECTOR (foo)->header.size.
14590 (struct vectorlike_header): New type.
14591 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14592 object, to help avoid aliasing.
14593 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14594 (SUBRP): Likewise, since Lisp_Subr is a special case.
14595 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14596 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14597 (struct Lisp_Hash_Table): Combine first two members into a single
14598 struct vectorlike_header member. All uses of "size" and "next" members
14599 changed to be "header.size" and "header.next".
14600 * buffer.h (struct buffer): Likewise.
14601 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14602 * frame.h (struct frame): Likewise.
14603 * process.h (struct Lisp_Process): Likewise.
14604 * termhooks.h (struct terminal): Likewise.
14605 * window.c (struct save_window_data, struct saved_window): Likewise.
14606 * window.h (struct window): Likewise.
14607 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14608 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14609 * buffer.c (init_buffer_once): Likewise.
14610 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14611 special case.
14612 * process.c (Fformat_network_address): Use local var for size,
14613 for brevity.
14614
14615 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14616
14617 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14618 * data.c (atof): Remove decl; no longer used or needed.
14619 (digit_to_number): Move to lread.c.
14620 (Fstring_to_number): Use new string_to_number function, to be
14621 consistent with how the Lisp reader treats infinities and NaNs.
14622 Do not assume that floating-point numbers represent EMACS_INT
14623 without losing information; this is not true on most 64-bit hosts.
14624 Avoid double-rounding errors, by insisting on integers when
14625 parsing non-base-10 numbers, as the documentation specifies.
14626 * lisp.h (string_to_number): New decl, replacing ...
14627 (isfloat_string): Remove.
14628 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14629 (read1): Do not accept +. and -. as integers; this
14630 appears to have been a coding error. Similarly, do not accept
14631 strings like +-1e0 as floating point numbers. Do not report
14632 overflow for integer overflows unless the base is not 10 which
14633 means we have no simple and reliable way to continue.
14634 Break out the floating-point parsing into a new
14635 function string_to_number, so that Fstring_to_number parses
14636 floating point numbers consistently with the Lisp reader.
14637 (digit_to_number): Move here from data.c. Make it static inline.
14638 (E_CHAR, EXP_INT): Remove, replacing with ...
14639 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14640 (string_to_number): New function, replacing isfloat_string.
14641 This function checks for valid syntax and produces the resulting
14642 Lisp float number too. Rework it so that string-to-number
14643 no longer mishandles examples like "1.0e+". Use strtoumax,
14644 so that overflow for non-base-10 numbers is reported only when
14645 there's no portable and simple way to convert to floating point.
14646
14647 * textprop.c (set_text_properties_1): Rewrite for clarity,
14648 and to avoid GCC warning about integer overflow.
14649
14650 * intervals.h (struct interval): Use EMACS_INT for members
14651 where EMACS_UINT might cause problems. See
14652 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14653 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14654 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14655 All uses changed.
14656 (offset_intervals): Tell GCC not to worry about length overflow
14657 when negating a negative length.
14658
14659 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14660 (overrun_check_free): Likewise.
14661
14662 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14663 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14664 word size.
14665
14666 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14667 (gnutls_make_error): Rename local to avoid shadowing.
14668 (gnutls_emacs_global_deinit): ifdef out; not used.
14669 (Fgnutls_boot): Use const for pointer to readonly storage.
14670 Comment out unused local. Fix pointer signedness problems.
14671
14672 * lread.c (openp): Don't stuff size_t into an 'int'.
14673 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14674 about possible signed overflow.
14675
14676 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14677 (GDK_KEY_g): Don't define if already defined.
14678 (xg_prepare_tooltip): Avoid pointer signedness problem.
14679 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14680
14681 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14682 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14683
14684 * xfns.c (Fx_window_property): Simplify a bit,
14685 to make a bit faster and to avoid GCC 4.6.0 warning.
14686 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14687
14688 * fns.c (internal_equal): Don't assume size_t fits in int.
14689
14690 * alloc.c (compact_small_strings): Tighten assertion a little.
14691
14692 Replace pEd with more-general pI, and fix some printf arg casts.
14693 * lisp.h (pI): New macro, generalizing old pEd macro to other
14694 conversion specifiers. For example, use "...%"pI"d..." rather
14695 than "...%"pEd"...".
14696 (pEd): Remove. All uses replaced with similar uses of pI.
14697 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14698 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14699 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14700 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14701 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14702 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14703 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14704 64-bit hosts.
14705 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14706 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14707 * print.c (safe_debug_print, print_object): Likewise.
14708 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14709 to int.
14710 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14711 avoiding the 0 flag, which is not portable.
14712 * process.c (Fmake_network_process): Use pI to avoid cast.
14713 * region-cache.c (pp_cache): Likewise.
14714 * xdisp.c (decode_mode_spec): Likewise.
14715 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14716 behavior on 64-bit hosts with printf arg.
14717 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14718 (x_stop_queuing_selection_requests): Likewise.
14719 (x_get_window_property): Don't truncate byte count to an 'int'
14720 when tracing.
14721
14722 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14723 here, since it parses constructs like leading '-' and spaces,
14724 which are not wanted; and it overflows with large numbers.
14725 Instead, simply match F[0-9]+, which is what is wanted anyway.
14726
14727 * alloc.c: Remove unportable assumptions about struct layout.
14728 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14729 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14730 (allocate_vectorlike, make_pure_vector): Use the new macros,
14731 plus offsetof, to remove unportable assumptions about struct layout.
14732 These assumptions hold on all porting targets that I know of, but
14733 they are not guaranteed, they're easy to remove, and removing them
14734 makes further changes easier.
14735
14736 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14737 This doesn't fix a bug but makes the code clearer.
14738 (string_overrun_cookie): Now const. Use initializers that
14739 don't formally overflow signed char, to avoid warnings.
14740 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14741 can cause Emacs to crash when string overrun checking is enabled.
14742 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14743 multiple of sizeof (EMACS_INT); it need not be, if
14744 alignof(EMACS_INT) < sizeof (EMACS_INT).
14745 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14746
14747 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14748
14749 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14750
14751 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14752
14753 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14754 supposed to be handshaking. (Bug#8556)
14755 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14756
14757 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14758
14759 * lisp.h (Qdebug): List symbol.
14760 * eval.c (Qdebug): Restore global linkage.
14761 * keyboard.c (debug-on-event): New variable.
14762 (handle_user_signal): Break into debugger when debug-on-event
14763 matches the current signal symbol.
14764
14765 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14766
14767 * alloc.c (check_sblock, check_string_bytes)
14768 (check_string_free_list): Convert to standard C.
14769
14770 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14771
14772 * w32.c (emacs_gnutls_push): Fix typo.
14773
14774 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14775
14776 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14777 "cast to pointer from integer of different size".
14778
14779 Improve doprnt and its use in verror. (Bug#8545)
14780 * doprnt.c (doprnt): Document the set of format control sequences
14781 supported by the function. Use SAFE_ALLOCA instead of always
14782 using `alloca'.
14783
14784 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14785 is one byte too soon. Don't use xrealloc; instead xfree and
14786 xmalloc anew.
14787
14788 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14789
14790 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14791 callbacks stage.
14792
14793 * gnutls.c: Renamed global_initialized to
14794 gnutls_global_initialized. Added internals for the
14795 :verify-hostname-error, :verify-error, and :verify-flags
14796 parameters of `gnutls-boot' and documented those parameters in the
14797 docstring. Start callback support.
14798 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14799 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14800 on error. Return error code.
14801 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14802 (emacs_gnutls_read): Likewise.
14803 (Fgnutls_boot): Return handshake error code.
14804 (emacs_gnutls_handle_error): New function.
14805 (wsaerror_to_errno): Likewise.
14806
14807 * w32.h (emacs_gnutls_pull): Add prototype.
14808 (emacs_gnutls_push): Likewise.
14809
14810 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14811 (emacs_gnutls_push): Likewise.
14812
14813 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14814
14815 * process.c (wait_reading_process_output): Check if GnuTLS
14816 buffered some data internally if no FDs are set for TLS
14817 connections.
14818
14819 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14820 (LIBS): Link to USER_LIBS.
14821 ($(BLD)/gnutls.$(0)): New target.
14822
14823 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14824
14825 * xdisp.c (handle_single_display_spec): Rename the
14826 display_replaced_before_p argument into display_replaced_p, to
14827 make it consistent with the commentary. Fix typos in the
14828 commentary.
14829
14830 * textprop.c (syms_of_textprop): Remove dead code.
14831 (copy_text_properties): Delete obsolete commentary about an
14832 interface that was deleted long ago. Fix typos in the description
14833 of arguments.
14834
14835 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14836 to changes in oldXMenu/XMenu.h from 2011-04-16.
14837 <menu_help_message, prev_menu_help_message>: Constify.
14838 (IT_menu_make_room): menu->help_text is now `const char **';
14839 adjust.
14840
14841 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14842 to changes in oldXMenu/XMenu.h from 2011-04-16.
14843 (struct XMenu): Declare `help_text' `const char **'.
14844
14845 * xfaces.c <Qunspecified>: Make extern again.
14846
14847 * syntax.c: Include sys/types.h before including regex.h, as
14848 required by POSIX.
14849
14850 * doc.c (get_doc_string): Improve the format passed to `error'.
14851
14852 * doprnt.c (doprnt): Improve commentary.
14853
14854 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14855
14856 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14857 them with etags.
14858
14859 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14860 changes in globals.h immediately force recompilation.
14861 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14862 $(CURDIR)/s/ms-w32.h.
14863 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14864
14865 * character.c (Fchar_direction): Function deleted.
14866 (syms_of_character): Don't defsubr it.
14867 <char-direction-table>: Deleted.
14868
14869 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14870
14871 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14872 * doprnt.c: Include limits.h.
14873 (SIZE_MAX): New macro.
14874 (doprnt): Return a size_t value. 2nd arg is now size_t.
14875 Many local variables are now size_t instead of int or unsigned.
14876 Improve overflow protection. Support `l' modifier for integer
14877 conversions. Support %l conversion. Don't assume an EMACS_INT
14878 argument for integer conversions and for %c.
14879
14880 * lisp.h (doprnt): Restore prototype.
14881
14882 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14883 $(SRC)/character.h.
14884
14885 * Makefile.in (base_obj): Add back doprnt.o.
14886
14887 * deps.mk (doprnt.o): Add back prerequisites.
14888 (callint.o): Depend on character.h.
14889
14890 * eval.c (internal_lisp_condition_case): Include the handler
14891 representation in the error message.
14892 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14893 when breaking from the loop.
14894
14895 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14896
14897 * callint.c (Fcall_interactively): When displaying error message
14898 about invalid control letter, pass the character's codepoint, not
14899 a pointer to its multibyte form. Improve display of the character
14900 in octal and display also its hex code.
14901
14902 * character.c (char_string): Use %x to display the (unsigned)
14903 codepoint of an invalid character, to avoid displaying a bogus
14904 negative value.
14905
14906 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14907 `error', not SYMBOL_NAME itself.
14908
14909 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14910 character arguments to `error'.
14911
14912 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14913 to `error' in error message about FINAL_CHAR argument. Make sure
14914 FINAL_CHAR is a character, and use %c when it is passed as
14915 argument to `error'.
14916
14917 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14918
14919 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14920
14921 * w32.c: Include <time.h>.
14922 (sys_localtime): New function.
14923
14924 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14925
14926 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14927
14928 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14929
14930 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14931
14932 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14933 zombies (Bug#8467).
14934
14935 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14936
14937 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14938 gl_state.e_property when gl_state.object is Qt.
14939
14940 * insdel.c (make_gap_larger): Remove limitation of buffer size
14941 to <= INT_MAX.
14942
14943 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14944
14945 * xdisp.c (lookup_glyphless_char_display)
14946 (produce_glyphless_glyph): Handle cons cell entry in
14947 glyphless-char-display.
14948 (Vglyphless_char_display): Document it.
14949
14950 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14951 glyphless-char-display.
14952
14953 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14954
14955 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14956
14957 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14958
14959 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14960 definition for no-X builds.
14961
14962 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14963
14964 Static checks with GCC 4.6.0 and non-default toolkits.
14965
14966 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14967
14968 * process.c (keyboard_bit_set): Define only if SIGIO.
14969 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14970 (send_process): Repair possible setjmp clobbering.
14971
14972 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14973
14974 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14975
14976 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14977
14978 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14979 Define only if needed.
14980
14981 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14982 by pacifying GCC about it. Maybe it's time to retire it?
14983 * xfaces.c (USG, __TIMEVAL__): Likewise.
14984
14985 * dispextern.h (struct redisplay_interface): Rename param
14986 to avoid shadowing.
14987 * termhooks.h (struct terminal): Likewise.
14988 * xterm.c (xembed_send_message): Likewise.
14989
14990 * insdel.c (make_gap_smaller): Define only if
14991 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14992
14993 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14994 it.
14995
14996 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14997 so that we aren't warned about unused symbols.
14998
14999 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15000
15001 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15002
15003 * xfns.c (x_real_positions): Mark locals as initialized.
15004
15005 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15006
15007 * xterm.c: Fix problems found by static analysis with other toolkits.
15008 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15009 (x_dispatch_event): Declare static if USE_GTK, and
15010 define if USE_GTK || USE_X_TOOLKIT.
15011 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15012 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15013 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15014 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15015
15016 * xmenu.c (menu_help_callback): Pointer type fixes.
15017 Use const pointers when pointing at readonly data. Avoid pointer
15018 signedness clashes.
15019 (FALSE): Remove unused macro.
15020 (update_frame_menubar): Remove unused decl.
15021
15022 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15023
15024 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15025 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15026 (single_menu_item): Rename local to avoid shadowing.
15027
15028 * keyboard.c (make_lispy_event): Remove unused local var.
15029
15030 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15031 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15032
15033 * bitmaps: Change bitmaps from unsigned char back to the X11
15034 compatible char. Avoid the old compiler warnings about
15035 out-of-range initializers by using, for example, '\xab' rather
15036 than 0xab.
15037
15038 * xgselect.c (xgselect_initialize): Check vs interface
15039 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15040
15041 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15042
15043 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15044 to read-only memory.
15045
15046 * fns.c (vector): Remove; this old hack is no longer needed.
15047
15048 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15049 Remove unused var.
15050 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15051
15052 * xrdb.c (x_load_resources): Omit unused local.
15053
15054 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15055 (x_window): Rename locals to avoid shadowing.
15056 (USG): Use the kludged USG macro, to pacify gcc.
15057
15058 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15059 (x_term_init): Remove local to avoid shadowing.
15060
15061 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15062
15063 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15064 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15065
15066 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15067
15068 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15069
15070 Fix regex.c, syntax.c and friends for buffers > 2GB.
15071 * syntax.h (struct gl_state_s): Declare character position members
15072 EMACS_INT.
15073
15074 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15075
15076 * textprop.c (verify_interval_modification, interval_of):
15077 Declare arguments EMACS_INT.
15078
15079 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15080 EMACS_INT.
15081
15082 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15083
15084 * indent.c (Fvertical_motion): Local variable it_start is now
15085 EMACS_INT.
15086
15087 * regex.c (re_match, re_match_2, re_match_2_internal)
15088 (bcmp_translate, regcomp, regexec, print_double_string)
15089 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15090 (re_compile_pattern, re_exec): Declare arguments and local
15091 variables `size_t' and `ssize_t' and return values `regoff_t', as
15092 appropriate.
15093 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15094 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15095 <compile_stack_type>: `size' and `avail' are now `size_t'.
15096
15097 * regex.h <regoff_t>: Use ssize_t, not int.
15098 (re_search, re_search_2, re_match, re_match_2): Arguments that
15099 specify buffer/string position and length are now ssize_t and
15100 size_t. Return type is regoff_t.
15101
15102 2011-04-16 Ben Key <bkey76@gmail.com>
15103
15104 * nsfont.m: Fixed bugs in ns_get_family and
15105 ns_descriptor_to_entity that were caused by using free to
15106 deallocate memory blocks that were allocated by xmalloc (via
15107 xstrdup). This caused Emacs to crash when compiled with
15108 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15109 --enable-checking=xmallocoverrun). xfree is now used to
15110 deallocate these memory blocks.
15111
15112 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15113
15114 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15115
15116 emacs_write: Accept and return EMACS_INT for sizes.
15117 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15118 et seq.
15119 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15120 Accept and return EMACS_INT.
15121 (emacs_gnutls_write): Return the number of bytes written on
15122 partial writes.
15123 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15124 (emacs_read, emacs_write): Remove check for negative size, as the
15125 Emacs source code has been audited now.
15126 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15127 (emacs_read, emacs_write): Use it.
15128 * process.c (send_process): Adjust to the new signatures of
15129 emacs_write and emacs_gnutls_write. Do not attempt to store
15130 a byte offset into an 'int'; it might overflow.
15131 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15132
15133 * sound.c: Don't assume sizes fit in 'int'.
15134 (struct sound_device.period_size, alsa_period_size):
15135 Return EMACS_INT, not int.
15136 (struct sound_device.write, vox_write, alsa_write):
15137 Accept EMACS_INT, not int.
15138 (wav_play, au_play): Use EMACS_INT to store sizes and to
15139 record read return values.
15140
15141 2011-04-15 Ben Key <bkey76@gmail.com>
15142
15143 * keyboard.c (Qundefined): Don't declare static since it is used
15144 in nsfns.m.
15145 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15146 static since they are used in nsfont.m.
15147
15148 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15149
15150 * process.c (Qprocessp): Don't declare static.
15151 * lisp.h (Qprocessp): Declare again.
15152
15153 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15154
15155 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15156
15157 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15158
15159 Improve C-level modularity by making more things 'static'.
15160
15161 Don't publish debugger-only interfaces to other modules.
15162 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15163 (verify_bytepos, count_markers): Move decls to the only modules
15164 that need them.
15165 * region-cache.h (pp_cache): Likewise.
15166 * window.h (check_all_windows): Likewise.
15167 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15168
15169 * sysdep.c (croak): Now static, if
15170 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15171 * syssignal.h (croak): Declare only if not static.
15172
15173 * alloc.c (refill_memory_reserve): Now static if
15174 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15175 * lisp.h (refill_memory_reserve): Declare only if not static.
15176
15177 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15178 Define only if USE_LUCID.
15179
15180 * xrdb.c (x_customization_string, x_rm_string): Now static.
15181
15182 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15183 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15184
15185 * xdisp.c (draw_row_with_mouse_face): Now static.
15186 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15187
15188 * window.h (check_all_windows): Mark externally visible.
15189
15190 * window.c (window_deletion_count): Now static.
15191
15192 * undo.c: Make symbols static if they're not exported.
15193 (last_undo_buffer, last_boundary_position, pending_boundary):
15194 Now static.
15195
15196 * textprop.c (interval_insert_behind_hooks): Now static.
15197 (interval_insert_in_front_hooks): Likewise.
15198
15199 * term.c: Make symbols static if they're not exported.
15200 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15201 (max_frame_lines, tty_set_terminal_modes):
15202 (tty_reset_terminal_modes, tty_turn_off_highlight):
15203 (get_tty_terminal): Now static.
15204 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15205 * termhooks.h (term_mouse_moveto): Do not declare if
15206 HAVE_WINDOW_SYSTEM.
15207 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15208 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15209
15210 * sysdep.c: Make symbols static if they're not exported.
15211 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15212 Now static.
15213 (sigprocmask_set, full_mask): Remove; unused.
15214 (wait_debugging): Mark as visible.
15215 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15216 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15217
15218 * syntax.c (syntax_temp): Define only if !__GNUC__.
15219
15220 * sound.c (current_sound_device, current_sound): Now static.
15221
15222 * search.c (searchbufs, searchbuf_head): Now static.
15223
15224 * scroll.c (scroll_cost): Remove; unused.
15225 * dispextern.h (scroll_cost): Remove decl.
15226
15227 * region-cache.h (pp_cache): Mark as externally visible.
15228
15229 * process.c: Make symbols static if they're not exported.
15230 (process_tick, update_tick, create_process, chan_process):
15231 (Vprocess_alist, proc_buffered_char, datagram_access):
15232 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15233 (deactivate_process): Mark defn as static, as well as decl.
15234 * lisp.h (create_process): Remove decl.
15235 * process.h (chan_process, Vprocess_alist): Remove decls.
15236
15237 * print.c: Make symbols static if they're not exported.
15238 (print_depth, new_backquote_output, being_printed, print_buffer):
15239 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15240 (print_interval, print_number_index, initial_stderr_stream):
15241 Now static.
15242 * lisp.h (Fprinc): Remove decl.
15243 (debug_output_compilation_hack): Mark as externally visible.
15244
15245 * sysdep.c (croak): Move decl from here to syssignal.h.
15246 * syssignal.h (croak): Put it here, so the API can be checked when
15247 'croak' is called from dissociate_if_controlling_tty.
15248
15249 * minibuf.c: Make symbols static if they're not exported.
15250 (minibuf_save_list, choose_minibuf_frame): Now static.
15251 * lisp.h (choose_minibuf_frame): Remove decl.
15252
15253 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15254
15255 * lread.c: Make symbols static if they're not exported.
15256 (read_objects, initial_obarray, oblookup_last_bucket_number):
15257 Now static.
15258 (make_symbol): Remove; unused.
15259 * lisp.h (initial_obarray, make_symbol): Remove decls.
15260
15261 * keyboard.c: Make symbols static if they're not exported.
15262 (single_kboard, recent_keys_index, total_keys, recent_keys):
15263 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15264 (this_single_command_key_start, echoing, last_auto_save):
15265 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15266 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15267 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15268 (Vlispy_mouse_stem, double_click_count):
15269 Now static.
15270 (force_auto_save_soon): Define only if SIGDANGER.
15271 (ignore_mouse_drag_p): Now static if
15272 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15273 (print_help): Remove; unused.
15274 (stop_character, last_timer_event): Mark as externally visible.
15275 * keyboard.h (ignore_mouse_drag_p): Declare only if
15276 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15277 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15278 * lisp.h (echoing): Remove decl.
15279 (force_auto_save_soon): Declare only if SIGDANGER.
15280 * xdisp.c (redisplay_window): Simplify code, to make it more
15281 obvious that ignore_mouse_drag_p is not accessed if !defined
15282 USE_GTK && !defined HAVE_NS.
15283
15284 * intervals.c: Make symbols static if they're not exported.
15285 (merge_properties_sticky, merge_interval_right, delete_interval):
15286 Now static.
15287 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15288
15289 * insdel.c: Make symbols static if they're not exported.
15290 However, leave prepare_to_modify_buffer alone. It's never
15291 called from outside this function, but that appears to be a bug.
15292 (combine_after_change_list, combine_after_change_buffer):
15293 (adjust_after_replace, signal_before_change): Now static.
15294 (adjust_after_replace_noundo): Remove; unused.
15295 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15296 (signal_before_change): Remove decls.
15297
15298 * indent.c (val_compute_motion, val_vmotion): Now static.
15299
15300 * image.c: Make symbols static if they're not exported.
15301 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15302 if USE_GTK.
15303 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15304 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15305
15306 * fringe.c (standard_bitmaps): Now static.
15307 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15308
15309 * frame.c: Make symbols static if they're not exported.
15310 (x_report_frame_params, make_terminal_frame): Now static.
15311 (get_frame_param): Now static, unless HAVE_NS.
15312 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15313 (x_get_resource_string): Remove; not used.
15314 * frame.h (make_terminal_frame, x_report_frame_params):
15315 (x_get_resource_string); Remove decls.
15316 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15317 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15318
15319 * font.c, fontset.c: Make symbols static if they're not exported.
15320 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15321 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15322 * font.c (font_close_object): Now static.
15323 * font.h (font_close_object): Remove.
15324 * fontset.c (FONTSET_OBJLIST): Remove.
15325 (free_realized_fontset) #if-0 the body, which does nothing.
15326 (face_suitable_for_char_p): #if-0, as it's never called.
15327 * fontset.h (face_suitable_for_char_p): Remove decl.
15328 * xfaces.c (face_at_string_position):
15329 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15330 since 0 is always ASCII.
15331
15332 * fns.c (weak_hash_tables): Now static.
15333
15334 * fileio.c: Make symbols static if they're not exported.
15335 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15336 (Vwrite_region_annotation_buffers): Now static.
15337
15338 * eval.c: Make symbols static if they're not exported.
15339 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15340 * lisp.h (backtrace_list): Remove decl.
15341
15342 * emacs.c: Make symbols static if they're not exported.
15343 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15344 (fatal_error_code, fatal_error_signal_hook, standard_args):
15345 Now static.
15346 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15347 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15348 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15349 * lisp.h (fatal_error_signal_hook): Remove decl.
15350 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15351
15352 * editfns.c: Move a (normally-unused) function to its only use.
15353 * editfns.c, lisp.h (get_operating_system_release): Remove.
15354 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15355 worth the hassle of breaking this out.
15356
15357 * xterm.c: Make symbols static if they're not exported.
15358 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15359 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15360 (x_destroy_window, x_delete_display):
15361 Now static.
15362 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15363 (x_mouse_leave): Remove; unused.
15364 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15365 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15366 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15367 Remove decls.
15368 (x_mouse_leave): Declare only if WINDOWSNT.
15369 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15370 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15371 USE_X_TOOLKIT.
15372
15373 * ftxfont.c: Make symbols static if they're not exported.
15374 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15375 HAVE_FREETYPE.
15376 * font.h (ftxfont_driver): Likewise.
15377
15378 * xfns.c: Make symbols static if they're not exported.
15379 (x_last_font_name, x_display_info_for_name):
15380 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15381 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15382 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15383 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15384 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15385 (last_show_tip_args): Now static.
15386 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15387 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15388 (x_screen_planes): Remove; unused.
15389 * dispextern.h (x_screen_planes): Remove decl.
15390
15391 * dispnew.c: Make symbols static if they're not exported.
15392 * dispextern.h (redraw_garbaged_frames, scrolling):
15393 (increment_row_positions): Remove.
15394 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15395 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15396 Now static.
15397 (redraw_garbaged_frames): Remove; unused.
15398
15399 * xfaces.c: Make symbols static if they're not exported.
15400 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15401 Remove decls.
15402 * xterm.h (defined_color): Remove decls.
15403 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15404 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15405 (menu_face_changed_default, defined_color, free_realized_face):
15406 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15407 (ascii_face_of_lisp_face): Remove; unused.
15408
15409 * xdisp.c: Make symbols static if they're not exported.
15410 * dispextern.h (scratch_glyph_row, window_box_edges):
15411 (glyph_to_pixel_coords, set_cursor_from_row):
15412 (get_next_display_element, set_iterator_to_next):
15413 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15414 (show_mouse_face): Remove decls
15415 * frame.h (message_buf_print): Likewise.
15416 * lisp.h (pop_message, set_message, check_point_in_composition):
15417 Likewise.
15418 * xterm.h (set_vertical_scroll_bar): Likewise.
15419 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15420 (message_buf_print, scratch_glyph_row, displayed_buffer):
15421 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15422 (get_next_display_element, show_mouse_face, window_box_edges):
15423 (frame_to_window_pixel_xy, check_point_in_composition):
15424 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15425 (glyph_to_pixel_coords): Remove; unused.
15426
15427 * dired.c (file_name_completion): Now static.
15428
15429 * dbusbind.c (xd_in_read_queued_messages): Now static.
15430
15431 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15432 * data.c (circular_list_error): Remove.
15433
15434 * commands.h (last_point_position, last_point_position_buffer):
15435 (last_point_position_window): Remove decls.
15436 * keyboard.c: Make these variables static.
15437
15438 * coding.h (coding, code_convert_region, encode_coding_gap):
15439 Remove decls.
15440 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15441 (iso_code_class, detect_coding, code_convert_region): Now static.
15442 (encode_coding_gap): Remove; unused.
15443
15444 * chartab.c (chartab_chars, chartab_bits): Now static.
15445
15446 * charset.h (charset_iso_8859_1): Remove decl.
15447 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15448 Now static.
15449
15450 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15451 * ccl.c (Vccl_program_table): Now static.
15452 (check_ccl_update): Remove; unused.
15453
15454 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15455 * category.h: ... from here.
15456 * category.c (check_category_table, set_category_set): Now static.
15457
15458 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15459 * lisp.h: Remove these decls.
15460
15461 * buffer.c (buffer_count): Remove unused var.
15462
15463 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15464 so that it's not optimized away.
15465 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15466 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15467 exported only to the debugger.
15468
15469 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15470 * atimer.h (run_all_atimers): Remove; not exported.
15471
15472 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15473 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15474 was inaccessible from Lisp.
15475 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15476 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15477
15478 alloc.c: Import and export fewer symbols, and remove unused items.
15479 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15480 is defined.
15481 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15482 it's not optimized away by whole-program optimization.
15483 (message_enable_multibyte, free_misc): Remove.
15484 (catchlist, handlerlist, mark_backtrace):
15485 Declare only if BYTE_MARK_STACK.
15486 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15487 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15488 (message_enable_multibyte): Remove decl.
15489 (free_misc, interval_free_list, float_block, float_block_index):
15490 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15491 (cons_free_list, last_marked_index):
15492 Now static.
15493 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15494 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15495 (mark_backtrace): Define only if BYTE_MARK_STACK.
15496 * xdisp.c (message_enable_multibyte): Now static.
15497
15498 Declare Lisp_Object Q* variables to be 'static' if not exported.
15499 This makes it easier for human readers (and static analyzers)
15500 to see whether these variables are used from other modules.
15501 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15502 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15503 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15504 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15505 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15506 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15507 * xmenu.c, xselect.c:
15508 Declare Q* vars static if they are not used in other modules.
15509 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15510 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15511 Remove decls of unexported vars.
15512 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15513
15514 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15515
15516 Make Emacs functions such as Fatom 'static' by default.
15517 This makes it easier for human readers (and static analyzers)
15518 to see whether these functions can be called from other modules.
15519 DEFUN now defines a static function. To make the function external
15520 so that it can be used in other C modules, use the new macro DEFUE.
15521 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15522 (Finit_image_library):
15523 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15524 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15525 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15526 Remove decls, since these functions are now static.
15527 (Funintern, Fget_internal_run_time): New decls, since these functions
15528 were already external.
15529
15530 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15531 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15532 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15533 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15534 * keyboard.c, keymap.c, lread.c:
15535 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15536 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15537 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15538 Mark functions with DEFUE instead of DEFUN,
15539 if they are used in other modules.
15540 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15541 decls for now-static functions.
15542 * buffer.h (Fdelete_overlay): Remove decl.
15543 * callproc.c (Fgetenv_internal): Mark as internal.
15544 * composite.c (Fremove_list_of_text_properties): Remove decl.
15545 (Fcomposition_get_gstring): New forward static decl.
15546 * composite.h (Fcomposite_get_gstring): Remove decl.
15547 * dired.c (Ffile_attributes): New forward static decl.
15548 * doc.c (Fdocumntation_property): New forward static decl.
15549 * eval.c (Ffetch_bytecode): New forward static decl.
15550 (Funintern): Remove extern decl; now in .h file where it belongs.
15551 * fileio.c (Fmake_symbolic_link): New forward static decl.
15552 * image.c (Finit_image_library): New forward static decl.
15553 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15554 * intervals.h (Fprevious_property_change):
15555 (Fremove_list_of_text_properties): Remove decls.
15556 * keyboard.c (Fthis_command_keys): Remove decl.
15557 (Fcommand_execute): New forward static decl.
15558 * keymap.c (Flookup_key): New forward static decl.
15559 (Fcopy_keymap): Now static.
15560 * keymap.h (Flookup_key): Remove decl.
15561 * process.c (Fget_process): New forward static decl.
15562 (Fprocess_datagram_address): Mark as internal.
15563 * syntax.c (Fsyntax_table_p): New forward static decl.
15564 (skip_chars): Remove duplicate decl.
15565 * textprop.c (Fprevious_property_change): New forward static decl.
15566 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15567 Now internal.
15568 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15569 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15570
15571 * editfns.c (Fformat): Remove unreachable code.
15572
15573 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15574
15575 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15576 change. (Bug#8496)
15577
15578 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15579
15580 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15581 when at ZV. (Bug#8487)
15582
15583 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15584
15585 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15586 (Bug#8437)
15587 * keyboard.c (parse_tool_bar_item): Likewise.
15588 * sound.c (sound_cleanup, alsa_close): Likewise.
15589 * termcap.c (tgetent): Likewise.
15590 * xfns.c (x_default_font_parameter): Likewise.
15591 * xsettings.c (read_and_apply_settings): Likewise.
15592
15593 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15594 (overrun_check_free): Protoize.
15595
15596 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15597
15598 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15599 since callers should never pass a negative size.
15600 Change the signature to match that of plain 'read' and 'write'; see
15601 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15602 * lisp.h: Update prototypes of emacs_write and emacs_read.
15603
15604 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15605
15606 * xdisp.c (redisplay_window): Don't try to determine the character
15607 position of the scroll margin if the window start point w->startp
15608 is outside the buffer's accessible region. (Bug#8468)
15609
15610 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15611
15612 Fix write-region and its subroutines for buffers > 2GB.
15613 * fileio.c (a_write, e_write): Modify declaration of arguments and
15614 local variables to support buffers larger than 2GB.
15615 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15616
15617 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15618 argument, local variables, and return value.
15619
15620 * lisp.h: Update prototypes of emacs_write and emacs_read.
15621
15622 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15623
15624 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15625
15626 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15627
15628 Fix more problems found by GCC 4.6.0's static checks.
15629
15630 * xdisp.c (vmessage): Use a better test for character truncation.
15631
15632 * charset.c (load_charset_map): <, not <=, for optimization,
15633 and to avoid potential problems with integer overflow.
15634 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15635 * casetab.c (set_identity, shuffle): Likewise.
15636 * editfns.c (Fformat): Likewise.
15637 * syntax.c (skip_chars): Likewise.
15638
15639 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15640 This also lets GCC 4.6.0 generate slightly better loop code.
15641
15642 * callint.c (Fcall_interactively): <, not <=, for optimization.
15643 (Fcall_interactively): Count the number of arguments produced,
15644 not the number of arguments given. This is simpler and lets GCC
15645 4.6.0 generate slightly better code.
15646
15647 * ftfont.c: Distingish more carefully between FcChar8 and char.
15648 The previous code passed unsigned char * to a functions like
15649 strlen and xstrcasecmp that expect char *, which does not
15650 conform to the C standard.
15651 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15652 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15653 char * when the C standard requires it.
15654
15655 * keyboard.c (read_char): Remove unused var.
15656
15657 * eval.c: Port to Windows vsnprintf (Bug#8435).
15658 Include <limits.h>.
15659 (SIZE_MAX): Define if the headers do not.
15660 (verror): Do not give up if vsnprintf returns a negative count.
15661 Instead, grow the buffer. This ports to Windows vsnprintf, which
15662 does not conform to C99. Problem reported by Eli Zaretskii.
15663 Also, simplify the allocation scheme, by avoiding the need for
15664 calling realloc, and removing the ALLOCATED variable.
15665
15666 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15667
15668 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15669 But keep the doprint source code for now, as we might revamp it
15670 and use it again (Bug#8435).
15671 * lisp.h (doprnt): Remove.
15672 * Makefile.in (base_obj): Remove doprnt.o.
15673 * deps.mk (doprnt.o): Remove.
15674
15675 error: Print 32- and 64-bit integers portably (Bug#8435).
15676 Without this change, on typical 64-bit hosts error ("...%d...", N)
15677 was used to print both 32- and 64-bit integers N, which relied on
15678 undefined behavior.
15679 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15680 * lisp.h (error, verror): Mark as printf-like functions.
15681 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15682 Report overflow in size calculations when allocating printf buffer.
15683 Do not truncate output string at its first null byte.
15684 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15685 Truncate the output at a character boundary, since vsnprintf does not
15686 do that.
15687 * charset.c (check_iso_charset_parameter): Convert internal
15688 character to string before calling 'error', since %c now has the
15689 printf meaning.
15690 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15691 overflow when computing char to be passed to 'error'. Do not
15692 pass Lisp_Object to 'error'; pass the integer instead.
15693 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15694 formatted with plain %d.
15695
15696 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15697
15698 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15699
15700 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15701
15702 * xterm.c (x_catch_errors): Remove duplicate declaration.
15703
15704 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15705
15706 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15707
15708 2011-04-10 Jim Meyering <meyering@redhat.com>
15709
15710 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15711 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15712 return ssize_t not "int", and use size_t as the buffer length.
15713 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15714 * gnutls.h: Update declarations.
15715 * process.c (read_process_output): Use ssize_t, to match.
15716 (send_process): Likewise.
15717
15718 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15719
15720 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15721
15722 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15723
15724 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15725 Use unsigned char, to match FcChar8 type definition.
15726
15727 * xterm.c (handle_one_xevent):
15728 * xmenu.c (create_and_show_popup_menu):
15729 * xselect.c (x_decline_selection_request)
15730 (x_reply_selection_request): Avoid type-punned deref of X events.
15731
15732 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15733
15734 Fix some uses of `int' instead of EMACS_INT.
15735 * search.c (string_match_1, fast_string_match)
15736 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15737 (scan_buffer, find_next_newline_no_quit)
15738 (find_before_next_newline, search_command, Freplace_match)
15739 (Fmatch_data): Make some `int' variables be EMACS_INT.
15740
15741 * xdisp.c (display_count_lines): 3rd argument and return value now
15742 EMACS_INT. All callers changed.
15743 (pint2hrstr): Last argument is now EMACS_INT.
15744
15745 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15746 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15747 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15748 (decode_coding_utf_16, decode_coding_emacs_mule)
15749 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15750 (decode_coding_ccl, decode_coding_charset)
15751 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15752 (decode_coding_iso_2022, decode_coding_emacs_mule)
15753 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15754 <char_offset, last_offset>: Declare EMACS_INT.
15755 (encode_coding_utf_8, encode_coding_utf_16)
15756 (encode_coding_emacs_mule, encode_invocation_designation)
15757 (encode_designation_at_bol, encode_coding_iso_2022)
15758 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15759 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15760 Declare EMACS_INT.
15761 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15762 (encode_invocation_designation): Last argument P_NCHARS is now
15763 EMACS_INT.
15764 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15765 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15766
15767 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15768 All users changed.
15769
15770 * ccl.c (Fccl_execute_on_string): Declare some variables
15771 EMACS_INT.
15772
15773 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15774
15775 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15776
15777 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15778
15779 * process.c (Fformat_network_address): Doc fix.
15780
15781 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15782
15783 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15784
15785 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15786
15787 * keyboard.c (read_char): Call Lisp function help-form-show,
15788 instead of using internal_with_output_to_temp_buffer.
15789 (Qhelp_form_show): New var.
15790 (syms_of_keyboard): Use DEFSYM macro.
15791
15792 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15793
15794 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15795
15796 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15797
15798 * process.c (Flist_processes): Remove to Lisp.
15799 (list_processes_1): Delete.
15800
15801 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15802
15803 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15804
15805 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15806
15807 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15808
15809 Fix more problems found by GCC 4.6.0's static checks.
15810
15811 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15812
15813 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15814
15815 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15816
15817 * xdisp.c (vmessage): Mark as a printf-like function.
15818
15819 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15820
15821 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15822
15823 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15824 printf-like functions.
15825 (tiff_load): Add casts to remove these marks before passing them
15826 to system-supplied API.
15827
15828 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15829
15830 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15831 This avoids several warnings with gcc -Wstrict-overflow.
15832 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15833 directly, rather than having caller test rule sign. This avoids
15834 some unnecessary tests.
15835 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15836 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15837 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15838
15839 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15840 (xfont_open): Avoid unnecessary tests.
15841
15842 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15843
15844 * composite.h, composite.c (composition_gstring_put_cache):
15845 Use EMACS_INT, not int, for length.
15846
15847 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15848 breaking out part of COMPOSITION_DECODE_RULE.
15849 (COMPOSITION_DECODE_RULE): Use it.
15850 * composite.c (get_composition_id): Remove unused local vars,
15851 by using the new macro.
15852
15853 * textprop.c (set_text_properties_1): Change while to do-while,
15854 since the condition is always true at first.
15855
15856 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15857 (interval_deletion_adjustment): Return unsigned value.
15858 All uses changed.
15859
15860 * process.c (list_processes_1, create_pty, read_process_output):
15861 (exec_sentinel): Remove vars that were set but not used.
15862 (create_pty): Remove unnecessary "volatile"s.
15863 (Fnetwork_interface_info): Avoid possibility of int overflow.
15864 (read_process_output): Do adaptive read buffering even if carryover.
15865 (read_process_output): Simplify nbytes computation if buffered.
15866
15867 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15868
15869 * syntax.c (scan_words): Remove var that was set but not used.
15870 (update_syntax_table): Use unsigned instead of int.
15871
15872 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15873 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15874 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15875
15876 * print.c (print_error_message): Avoid int overflow.
15877
15878 * font.c (font_list_entities): Redo for clarity,
15879 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15880
15881 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15882 (font_score): Avoid potential overflow in diff calculation.
15883
15884 * fns.c (substring_both): Remove var that is set but not used.
15885 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15886
15887 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15888
15889 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15890 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15891 can always succeed if overflow has undefined behavior.
15892
15893 * search.c (boyer_moore, wordify): Remove vars set but not used.
15894 (wordify): Omit three unnecessary tests.
15895
15896 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15897 All callers changed. This avoids the need for an unused var.
15898
15899 * casefiddle.c (casify_region): Remove var that is set but not used.
15900
15901 * dired.c (file_name_completion): Remove var that is set but not used.
15902
15903 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15904
15905 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15906 (Finsert_file_contents): Remove unnecessary code checking fd.
15907
15908 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15909 Check for integer overflow on size calculations.
15910
15911 * buffer.c (Fprevious_overlay_change): Remove var that is set
15912 but not used.
15913
15914 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15915 Remove vars that are set but not used.
15916 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15917 (timer_check_2): Mark vars as initialized.
15918
15919 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15920
15921 * image.c (lookup_image): Remove var that is set but not used.
15922 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15923
15924 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15925 that are set but not used.
15926
15927 * xfns.c (make_invisible_cursor): Don't return garbage
15928 if XCreateBitmapFromData fails (Bug#8410).
15929
15930 * xselect.c (x_get_local_selection, x_handle_property_notify):
15931 Remove vars that are set but not used.
15932
15933 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15934 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15935
15936 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15937 Remove var that is set but not used.
15938 (scroll_bar_windows_size): Now size_t, not int.
15939 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15940 Check for overflow.
15941
15942 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15943 (map_tty_color) [!defined MSDOS]: Likewise.
15944
15945 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15946
15947 * coding.c: Remove vars that are set but not used.
15948 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15949 All callers changed.
15950 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15951 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15952 (decode_coding_charset): Remove vars that are set but not used.
15953
15954 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15955 that is set but not used.
15956
15957 * print.c (print_object): Remove var that is set but not used.
15958
15959 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15960 The gnulib version avoids calling malloc in the usual case,
15961 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15962 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15963 * filelock.c (current_lock_owner): Likewise.
15964 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15965 * sysdep.c: Include allocator.h, careadlinkat.h.
15966 (emacs_no_realloc_allocator): New static constant.
15967 (emacs_readlink): New function.
15968 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15969 ../lib/careadlinkat.h.
15970
15971 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15972
15973 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15974 first non-nil return value).
15975
15976 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15977
15978 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15979 if not defined (Bug#8403).
15980
15981 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15982
15983 * xdisp.c (display_count_lines): Remove parameter `start',
15984 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15985 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15986 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15987 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15988 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15989 and thereabouts. All callers changed.
15990 (get_per_char_metric): Remove parameter `f', unused since
15991 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15992
15993 2011-04-02 Jim Meyering <meyering@redhat.com>
15994
15995 do not dereference NULL upon failed strdup
15996 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15997 (ns_get_family): Likewise.
15998
15999 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16000
16001 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16002
16003 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16004
16005 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16006 later (Bug#8403).
16007
16008 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16009
16010 Add lexical binding.
16011
16012 * window.c (Ftemp_output_buffer_show): New fun.
16013 (Fsave_window_excursion):
16014 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16015
16016 * lread.c (lisp_file_lexically_bound_p): New function.
16017 (Fload): Bind Qlexical_binding.
16018 (readevalloop): Remove `evalfun' arg.
16019 Bind Qinternal_interpreter_environment.
16020 (Feval_buffer): Bind Qlexical_binding.
16021 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16022 Mark as dynamic.
16023 (syms_of_lread): Declare `lexical-binding'.
16024
16025 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16026
16027 * keyboard.c (eval_dyn): New fun.
16028 (menu_item_eval_property): Use it.
16029
16030 * image.c (parse_image_spec): Use Ffunctionp.
16031
16032 * fns.c (concat, mapcar1): Accept byte-code-functions.
16033
16034 * eval.c (Fsetq): Handle lexical vars.
16035 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16036 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16037 (FletX, Flet): Obey lexical binding.
16038 (Fcommandp): Handle closures.
16039 (Feval): New `lexical' arg.
16040 (eval_sub): New function extracted from Feval. Use it almost
16041 everywhere where Feval was used. Look up vars in lexical env.
16042 Handle closures.
16043 (Ffunctionp): Move from subr.el.
16044 (Ffuncall): Handle closures.
16045 (apply_lambda): Remove `eval_flags'.
16046 (funcall_lambda): Handle closures and new byte-code-functions.
16047 (Fspecial_variable_p): New function.
16048 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16049 but without exporting it to Lisp.
16050
16051 * doc.c (Fdocumentation, store_function_docstring):
16052 * data.c (Finteractive_form): Handle closures.
16053
16054 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16055 interactive spec.
16056
16057 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16058 New byte-codes.
16059 (exec_byte_code): New function extracted from Fbyte_code to handle new
16060 calling convention for byte-code-functions. Add new byte-codes.
16061
16062 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16063
16064 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16065
16066 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16067
16068 * xdisp.c (redisplay_internal): Fix prototype.
16069
16070 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16071
16072 * xdisp.c (SCROLL_LIMIT): New macro.
16073 (try_scrolling): Use it when setting scroll_limit.
16074 Limit scrolling to 100 screen lines.
16075 (redisplay_window): Even when falling back on "recentering",
16076 position point in the window according to scroll-conservatively,
16077 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16078
16079 (try_scrolling): When point is above the window, allow searching
16080 as far as scroll_max, or one screenful, to compute vertical
16081 distance from PT to the scroll margin position. This prevents
16082 try_scrolling from unnecessarily failing when
16083 scroll-conservatively is set to a value slightly larger than the
16084 window height. Clean up the case of PT below the margin at bottom
16085 of window: scroll_max can no longer be INT_MAX. When aggressive
16086 scrolling is in use, don't let point enter the opposite scroll
16087 margin as result of the scroll.
16088 (syms_of_xdisp) <scroll-conservatively>: Document the
16089 threshold of 100 lines for never-recentering scrolling.
16090
16091 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16092
16093 * dispextern.h (move_it_by_lines):
16094 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16095 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16096 (message_log_check_duplicate): Remove parameters `prev_bol' and
16097 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16098 (redisplay_internal): Remove parameter `preserve_echo_area',
16099 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16100
16101 * indent.c (Fvertical_motion):
16102 * window.c (window_scroll_pixel_based, Frecenter):
16103 Don't pass `need_y_p' to `move_it_by_lines'.
16104
16105 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16106
16107 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16108 steal a few bits to be more compact.
16109 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16110 Remove unneeded casts.
16111
16112 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16113
16114 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16115
16116 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16117 binding" message (bug#7967).
16118
16119 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16120
16121 Fix more problems found by GCC 4.6.0's static checks.
16122
16123 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16124 Remove unused local var.
16125
16126 * editfns.c (Fmessage_box): Remove unused local var.
16127
16128 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16129 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16130 Omit unused local vars.
16131 * window.c (shrink_windows): Omit unused local var.
16132 * menu.c (digest_single_submenu): Omit unused local var.
16133 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16134 Omit unused local var.
16135
16136 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16137 Don't assume string length fits in int.
16138 (keyremap_step, read_key_sequence): Use size_t for sizes.
16139 (read_key_sequence): Don't check last_real_key_start redundantly.
16140
16141 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16142 instead of alloca (Bug#8344).
16143
16144 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16145 (Fbacktrace_frame): Don't assume nframes fits in int.
16146
16147 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16148
16149 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16150 concerns.
16151
16152 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16153
16154 * cm.c (calccost): Turn while-do into do-while, for clarity.
16155
16156 * keyboard.c (syms_of_keyboard): Use the same style as later
16157 in this function when indexing through an array. This also
16158 works around GCC bug 48267.
16159
16160 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16161
16162 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16163
16164 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16165 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16166
16167 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16168 This avoids undefined behavior on integer overflow, and is a bit
16169 more convenient anyway since it is compared to a size_t variable.
16170
16171 Variadic C functions now count arguments with size_t, not int.
16172 This avoids an unnecessary limitation on 64-bit machines, which
16173 caused (substring ...) to crash on large vectors (Bug#8344).
16174 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16175 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16176 All variadic functions and their callers changed accordingly.
16177 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16178 * data.c (arith_driver, float_arith_driver): Likewise.
16179 * editfns.c (general_insert_function): Likewise.
16180 * eval.c (struct backtrace.nargs, interactive_p)
16181 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16182 (funcall_lambda, mark_backtrace): Likewise.
16183 * fns.c (concat): Likewise.
16184 * frame.c (x_set_frame_parameters): Likewise.
16185 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16186 0 if not found, not -1. All callers changed.
16187
16188 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16189 (stack_copy_size): Now size_t, not int.
16190 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16191
16192 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16193
16194 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16195 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16196 All callers changed.
16197
16198 * lisp.h (multibyte_char_to_unibyte):
16199 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16200 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16201 * character.h (CHAR_TO_BYTE8):
16202 * cmds.c (internal_self_insert):
16203 * editfns.c (general_insert_function):
16204 * keymap.c (push_key_description):
16205 * search.c (Freplace_match):
16206 * xdisp.c (message_dolog, set_message_1): All callers changed.
16207
16208 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16209
16210 * keyboard.c (safe_run_hook_funcall): New function.
16211 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16212 don't set the hook to nil, but remove the offending function instead.
16213 (Qcommand_hook_internal): Remove, unused.
16214 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16215 Vcommand_hook_internal.
16216
16217 * eval.c (enum run_hooks_condition): Remove.
16218 (funcall_nil, funcall_not): New functions.
16219 (run_hook_with_args): Call each function through a `funcall' argument.
16220 Remove `cond' argument, now redundant.
16221 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16222 (Frun_hook_with_args_until_failure): Adjust accordingly.
16223 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16224
16225 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16226
16227 * dispextern.h (string_buffer_position): Remove declaration.
16228
16229 * print.c (strout): Remove parameter `multibyte', unused since
16230 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16231
16232 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16233 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16234 All callers changed.
16235
16236 * w32.c (_wsa_errlist): Use braces for struct initializers.
16237
16238 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16239 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16240 All callers changed.
16241 (string_buffer_position): Likewise. Also, make static (it's never
16242 used outside xdisp.c).
16243 (cursor_row_p): Remove parameter `w', unused since
16244 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16245 (decode_mode_spec): Remove parameter `precision', introduced during
16246 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16247 All callers changed.
16248
16249 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16250
16251 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16252
16253 2011-03-27 Anders Lindgren <andlind@gmail.com>
16254
16255 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16256 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16257 (ns_update_auto_hide_menu_bar): New functions.
16258 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16259 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16260 ns_constrain_all_frames.
16261 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16262 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16263
16264 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16265
16266 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16267
16268 2011-03-27 Glenn Morris <rgm@gnu.org>
16269
16270 * syssignal.h: Replace RETSIGTYPE with void.
16271 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16272 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16273 Replace SIGTYPE with void everywhere.
16274 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16275 * s/template.h (SIGTYPE): Remove commented out definition.
16276
16277 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16278
16279 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16280 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16281
16282 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16283
16284 * w32.c (read_unc_volume): Use parameter `henum', instead of
16285 global variable `wget_enum_handle'.
16286
16287 * keymap.c (describe_vector): Remove parameters `indices' and
16288 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16289 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16290
16291 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16292
16293 * keyboard.c (timer_check): Remove parameter `do_it_now',
16294 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16295 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16296 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16297
16298 * keyboard.c (read_char):
16299 * w32menu.c (w32_menu_display_help):
16300 * xmenu.c (show_help_event, menu_help_callback):
16301 Adjust calls to `show_help_echo'.
16302
16303 * gtkutil.c (xg_maybe_add_timer):
16304 * keyboard.c (readable_events):
16305 * process.c (wait_reading_process_output):
16306 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16307
16308 * insdel.c (adjust_markers_gap_motion):
16309 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16310 (gap_left, gap_right): Don't call it.
16311
16312 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16313
16314 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16315 incurred during fontification.
16316
16317 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16318
16319 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16320 (DEFVAR_PER_BUFFER): Don't pass it.
16321
16322 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16323 (scrolling_window): Don't pass it.
16324
16325 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16326
16327 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16328
16329 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16330 and `suffix'.
16331 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16332 of variables specific to SELinux and computation of `encoded_absname'.
16333
16334 * image.c (XPutPixel): Remove unused variable `height'.
16335
16336 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16337
16338 * unexw32.c (get_section_info): Remove unused variable `section'.
16339
16340 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16341 (system_process_attributes): Remove unused variable `sess'.
16342 (sys_read): Remove unused variable `err'.
16343
16344 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16345 (w32_wnd_proc): Remove unused variable `isdead'.
16346 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16347 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16348 (x_create_tip_frame): Remove unused variable `tem'.
16349
16350 * w32inevt.c (w32_console_read_socket):
16351 Remove unused variable `no_events'.
16352
16353 * w32term.c (x_draw_composite_glyph_string_foreground):
16354 Remove unused variable `width'.
16355
16356 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16357
16358 * w32term.c (x_set_glyph_string_clipping):
16359 Don't pass uninitialized region to CombineRgn.
16360
16361 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16362
16363 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16364 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16365 (Fx_close_connection): Remove unused variable `i'.
16366
16367 * w32font.c (w32font_draw): Return number of glyphs.
16368 (w32font_open_internal): Remove unused variable `i'.
16369 (w32font_driver): Add missing initializer.
16370
16371 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16372 (fill_in_menu): Remove unused variable `items_added'.
16373
16374 * w32term.c (last_mouse_press_frame): Remove static global variable.
16375 (w32_clip_to_row): Remove unused variable `f'.
16376 (x_delete_terminal): Remove unused variable `i'.
16377
16378 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16379 (NOTHING): Remove unused static global variable.
16380 (uniscribe_check_otf): Remove unused variable `table'.
16381 (uniscribe_font_driver): Add missing initializers.
16382
16383 2011-03-23 Julien Danjou <julien@danjou.info>
16384
16385 * term.c (Fsuspend_tty, Fresume_tty):
16386 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16387 * window.c (temp_output_buffer_show):
16388 * insdel.c (signal_before_change):
16389 * frame.c (Fhandle_switch_frame):
16390 * fileio.c (Fdo_auto_save):
16391 * emacs.c (Fkill_emacs):
16392 * editfns.c (save_excursion_restore):
16393 * cmds.c (internal_self_insert):
16394 * callint.c (Fcall_interactively):
16395 * buffer.c (Fkill_all_local_variables):
16396 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16397 Use Frun_hooks.
16398 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16399 unconditionally since it does the check itself.
16400
16401 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16402
16403 Fix more problems found by GCC 4.5.2's static checks.
16404
16405 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16406 the first time through the loop, since we know p0 < p1 then.
16407 This also avoids a gcc -Wstrict-overflow warning.
16408
16409 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16410 leading to a memory leak, possible in functions like
16411 load_charset_map_from_file that can allocate an unbounded number
16412 of objects (Bug#8318).
16413
16414 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16415 that could (at least in theory) be that large.
16416
16417 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16418 This is less likely to overflow, and avoids undefined behavior if
16419 overflow does occur. All callers changed. Use strtoul to scan
16420 for the unsigned long integer.
16421 (pint2hrstr): Simplify and tune code slightly.
16422 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16423
16424 * scroll.c (do_scrolling): Work around GCC bug 48228.
16425 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16426
16427 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16428 This also avoids a warning with gcc -Wstrict-overflow.
16429 (validate_x_resource_name): Simplify count usage.
16430 This also avoids a warning with gcc -Wstrict-overflow.
16431
16432 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16433 fail (Bug#8306).
16434
16435 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16436
16437 * process.c (Fmake_network_process): Use socklen_t, not int,
16438 where POSIX says socklen_t is required in portable programs.
16439 This fixes a porting bug on hosts like 64-bit HP-UX, where
16440 socklen_t is wider than int (Bug#8277).
16441 (Fmake_network_process, server_accept_connection):
16442 (wait_reading_process_output, read_process_output):
16443 Likewise.
16444
16445 * process.c: Rename or move locals to avoid shadowing.
16446 (list_processes_1, Fmake_network_process):
16447 (read_process_output_error_handler, exec_sentinel_error_handler):
16448 Rename or move locals.
16449 (Fmake_network_process): Define label "retry_connect" only if needed.
16450 (Fnetwork_interface_info): Fix pointer signedness.
16451 (process_send_signal): Add cast to avoid pointer signedness problem.
16452 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16453 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16454
16455 Make tparam.h and terminfo.c consistent.
16456 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16457 Include tparam.h instead, since it declares them.
16458 * cm.h (PC): Remove extern decl; tparam.h now does this.
16459 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16460 * terminfo.c: Include tparam.h, to check interfaces.
16461 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16462 (tparam): Adjust signature to match interface in tparam.h;
16463 this removes some undefined behavior. Check that outstring and len
16464 are zero, which they always are with Emacs.
16465 * tparam.h (PC, BC, UP): New extern decls.
16466
16467 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16468 (xftfont_open): Rename locals to avoid shadowing.
16469
16470 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16471 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16472 (OTF_TAG_SYM): Omit macro if not needed.
16473 (ftfont_list): Remove unused local.
16474 (get_adstyle_property, ftfont_pattern_entity):
16475 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16476 Rename locals to avoid shadowing.
16477
16478 * xfont.c (xfont_list_family): Mark var as initialized.
16479
16480 * xml.c (make_dom): Now static.
16481
16482 * composite.c (composition_compute_stop_pos): Rename local to
16483 avoid shadowing.
16484 (composition_reseat_it): Remove unused locals.
16485 (find_automatic_composition, composition_adjust_point): Likewise.
16486 (composition_update_it): Mark var as initialized.
16487 (find_automatic_composition): Mark vars as initialized,
16488 with a FIXME (Bug#8290).
16489
16490 character.h: Rename locals to avoid shadowing.
16491 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16492 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16493 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16494 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16495 to avoid shadowing.
16496
16497 * textprop.c (property_change_between_p): Remove; unused.
16498
16499 * intervals.c (interval_start_pos): Now static.
16500
16501 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16502
16503 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16504 Rename locals to avoid shadowing.
16505
16506 * sound.c (wav_play, au_play, Fplay_sound_internal):
16507 Fix pointer signedness.
16508 (alsa_choose_format): Remove unused local var.
16509 (wav_play): Initialize a variable to 0, to prevent undefined
16510 behavior (Bug#8278).
16511
16512 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16513
16514 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16515
16516 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16517 clobbering (Bug#8298).
16518 * sysdep.c (sys_subshell): Likewise.
16519 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16520
16521 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16522 This should get cleaned up, so that child_setup has the
16523 same signature on all platforms.
16524
16525 * callproc.c (call_process_cleanup): Now static.
16526 (relocate_fd): Rename locals to avoid shadowing.
16527
16528 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16529
16530 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16531 not to be necessary, and produces flickering.
16532
16533 2011-03-20 Glenn Morris <rgm@gnu.org>
16534
16535 * config.in: Remove file.
16536
16537 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16538
16539 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16540 are now in src/globals.h.
16541 (syms_of_minibuf): Remove spurious & from previous change.
16542
16543 2011-03-20 Leo Liu <sdl.web@gmail.com>
16544
16545 * minibuf.c (completing-read-function): New variable.
16546 (completing-read-default): Rename from completing-read.
16547 (completing-read): Call completing-read-function.
16548
16549 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16550
16551 * xfaces.c (Fx_load_color_file):
16552 Read color file from absolute filename (bug#8250).
16553
16554 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16555
16556 * makefile.w32-in: Update dependencies.
16557
16558 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16559
16560 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16561
16562 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16563
16564 Fix more problems found by GCC 4.5.2's static checks.
16565
16566 * process.c (make_serial_process_unwind, send_process_trap):
16567 (sigchld_handler): Now static.
16568
16569 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16570 That way, the code declares only the vars that it needs.
16571 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16572 * s/cygwin.h (PTY_ITERATION): Likewise.
16573 * s/darwin.h (PTY_ITERATION): Likewise.
16574 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16575
16576 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16577 * process.c (allocate_pty): Don't declare stb unless it's needed.
16578
16579 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16580 (CONSTANTLIM): Remove; unused.
16581 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16582 Define only if needed.
16583
16584 * unexelf.c (unexec): Name an expression,
16585 to avoid gcc -Wbad-function-cast warning.
16586 Use a different way to cause a compilation error if anyone uses
16587 n rather than nn, a way that does not involve shadowing.
16588 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16589
16590 * deps.mk (unexalpha.o): Remove; unused.
16591
16592 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16593 * unexec.h: New file.
16594 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16595 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16596 Depend on unexec.h.
16597 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16598 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16599 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16600 Change as necessary to match prototype in unexec.h.
16601
16602 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16603 shadowing.
16604 (back_comment, skip_chars): Mark vars as initialized.
16605
16606 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16607 Rename locals to avoid shadowing.
16608
16609 * lread.c (read1): Rewrite so as not to use empty "else".
16610 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16611
16612 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16613
16614 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16615 warning when compiling print.c.
16616
16617 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16618 instead of using an uninitialized var.
16619 (font_sort_entities): Mark var as initialized.
16620
16621 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16622
16623 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16624 pointers to constants.
16625 (font_parse_fcname): Remove unused vars.
16626 (font_delete_unmatched): Now static.
16627 (font_get_spec): Remove; unused.
16628 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16629 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16630 Rename or move locals to avoid shadowing.
16631
16632 * fns.c (require_nesting_list, require_unwind): Now static.
16633 (Ffillarray): Rename locals to avoid shadowing.
16634
16635 * floatfns.c (domain_error2): Define only if needed.
16636 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16637
16638 * alloc.c (mark_backtrace): Move decl from here ...
16639 * lisp.h: ... to here, so that it can be checked.
16640
16641 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16642 (Fdefvar): Rewrite so as not to use empty "else".
16643 (lisp_indirect_variable): Name an expression,
16644 to avoid gcc -Wbad-function-cast warning.
16645 (Fdefvar): Rename locals to avoid shadowing.
16646
16647 * callint.c (quotify_arg, quotify_args): Now static.
16648 (Fcall_interactively): Rename locals to avoid shadowing.
16649 Use const pointer when appropriate.
16650
16651 * lisp.h (get_system_name, get_operating_system_release):
16652 Move decls here, to check interfaces.
16653 * process.c (get_operating_system_release): Move decl to lisp.h.
16654 * xrdb.c (get_system_name): Likewise.
16655 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16656 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16657 some of which prompt warnings from gcc -Wbad-function-cast.
16658 (Fformat_time_string, Fencode_time, Finsert_char):
16659 (Ftranslate_region_internal, Fformat):
16660 Rename or remove local vars to avoid shadowing.
16661 (Ftranslate_region_internal): Mark var as initialized.
16662
16663 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16664 avoid shadowing.
16665
16666 * lisp.h (eassert): Check that the argument compiles, even if
16667 ENABLE_CHECKING is not defined.
16668
16669 * data.c (Findirect_variable): Name an expression, to avoid
16670 gcc -Wbad-function-cast warning.
16671 (default_value, arithcompare, arith_driver, arith_error): Now static.
16672 (store_symval_forwarding): Rename local to avoid shadowing.
16673 (Fmake_variable_buffer_local, Fmake_local_variable):
16674 Mark variables as initialized.
16675 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16676
16677 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16678 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16679 Rename locals to avoid shadowing.
16680 (mark_stack): Move local variables into the #ifdef region where
16681 they're used.
16682 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16683 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16684 needed otherwise.
16685 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16686 (GC_STRING_CHARS): Remove; not used.
16687 (Fmemory_limit): Cast sbrk's returned value to char *.
16688
16689 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16690 avoids undefined behavior in theory.
16691
16692 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16693
16694 Use functions, not macros, for up- and down-casing (Bug#8254).
16695 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16696 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16697 to use the following functions instead of these macros.
16698 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16699 EMACS_INT, since callers assume the returned value fits in int.
16700 (upcase1): Likewise, for UPCASE_TABLE.
16701 (uppercasep, lowercasep, upcase): New static inline functions.
16702 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16703 the race-condition problem in the old DOWNCASE.
16704
16705 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16706 Rename locals to avoid shadowing.
16707 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16708 (regex_compile, re_search_2, re_match_2_internal):
16709 Remove unused local vars.
16710 (FREE_VAR): Rewrite so as not to use empty "else",
16711 which gcc can warn about.
16712 (regex_compile, re_match_2_internal): Mark locals as initialized.
16713 (RETALLOC_IF): Define only if needed.
16714 (WORDCHAR_P): Likewise. This one is never needed, but is used
16715 only in a comment talking about a compiler bug, so put inside
16716 the #if 0 of that comment.
16717 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16718 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16719 Remove; unused.
16720
16721 * search.c (boyer_moore): Rename locals to avoid shadowing.
16722 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16723 (PREV_CHAR_BOUNDARY): Likewise.
16724
16725 * search.c (simple_search): Remove unused var.
16726
16727 * dired.c (compile_pattern): Move decl from here ...
16728 * lisp.h: ... to here, so that it can be checked.
16729 (struct re_registers): New forward decl.
16730
16731 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16732
16733 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16734 All uses changed.
16735 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16736 Rename locals to avoid shadowing.
16737 (Fvertical_motion): Mark locals as initialized.
16738
16739 * casefiddle.c (casify_object, casify_region): Now static.
16740 (casify_region): Mark local as initialized.
16741
16742 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16743
16744 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16745 New macros, so that the caller can use some names other than
16746 gcpro1, gcpro2, etc.
16747 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16748 of the new macros.
16749 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16750 argument, for consistency with GCPRO2_VAR, etc: it is now the
16751 prefix of the variable, not the variable itself. All uses
16752 changed.
16753 * dired.c (directory_files_internal, file_name_completion):
16754 Rename locals to avoid shadowing.
16755
16756 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16757 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16758 dired.c's scmp function, had undefined behavior.
16759 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16760 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16761 * buffer.h: ... to here, because these macros use current_buffer,
16762 and the new implementation with inline functions needs to have
16763 current_buffer in scope now, rather than later when the macros
16764 are used.
16765 (downcase, upcase1): New static inline functions.
16766 (DOWNCASE, UPCASE1): Reimplement using these functions.
16767 This avoids undefined behavior in expressions like
16768 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16769 from race conditions in accessing the global variables
16770 case_temp1 and case_temp2.
16771 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16772 * lisp.h (case_temp1, case_temp2): Remove their decls.
16773 * character.h (ASCII_CHAR_P): Move from here ...
16774 * lisp.h: ... to here, so that the inline functions mentioned
16775 above can use them.
16776
16777 * dired.c (directory_files_internal_unwind): Now static.
16778
16779 * fileio.c (file_name_as_directory, directory_file_name):
16780 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16781 Now static.
16782 (file_name_as_directory): Use const pointers when appropriate.
16783 (Fexpand_file_name): Likewise. In particular, newdir might
16784 point at constant storage, so make it a const pointer.
16785 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16786 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16787 signedness issues.
16788 (Fset_file_times, Finsert_file_contents, auto_save_error):
16789 Rename locals to avoid shadowing.
16790
16791 * minibuf.c (choose_minibuf_frame_1): Now static.
16792 (Ftry_completion, Fall_completions): Rename or remove locals
16793 to avoid shadowing.
16794
16795 * marker.c (bytepos_to_charpos): Remove; unused.
16796
16797 * lisp.h (verify_bytepos, count_markers): New decls,
16798 so that gcc does not warn that these functions aren't declared.
16799
16800 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16801 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16802 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16803 (copy_text): Remove unused local var.
16804
16805 * filelock.c (within_one_second): Now static.
16806 (lock_file_1): Rename local to avoid shadowing.
16807
16808 * buffer.c (fix_overlays_before): Mark locals as initialized.
16809 (fix_start_end_in_overlays): Likewise. This function should be
16810 simplified by using pointers-to-pointers, but that's a different
16811 matter.
16812 (switch_to_buffer_1): Now static.
16813 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16814 (report_overlay_modification): Rename locals to avoid shadowing.
16815
16816 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16817 Fix pointer signedness issue.
16818 (sys_subshell): Mark local as volatile if checking for lint,
16819 to suppress a gcc -Wclobbered warning that does not seem to be right.
16820 (MAXPATHLEN): Define only if needed.
16821
16822 * process.c (serial_open, serial_configure): Move decls from here ...
16823 * systty.h: ... to here, so that they can be checked.
16824
16825 * fns.c (get_random, seed_random): Move extern decls from here ...
16826 * lisp.h: ... to here, so that they can be checked.
16827
16828 * sysdep.c (reset_io): Now static.
16829 (wait_for_termination_signal): Remove; unused.
16830
16831 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16832 (copy_keymap_item, append_key, push_text_char_description):
16833 Now static.
16834 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16835 (DENSE_TABLE_SIZE): Remove; unused.
16836 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16837 (describe_map_tree):
16838 Rename locals to avoid shadowing.
16839
16840 * keyboard.c: Declare functions static if they are not used elsewhere.
16841 (echo_char, echo_dash, cmd_error, top_level_2):
16842 (poll_for_input, handle_async_input): Now static.
16843 (read_char, kbd_buffer_get_event, make_lispy_position):
16844 (make_lispy_event, make_lispy_movement, apply_modifiers):
16845 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16846 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16847 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16848 (read_key_sequence, read_char): Mark locals as initialized.
16849 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16850
16851 * keyboard.h (make_ctrl_char): New decl.
16852 (mark_kboards): Move decl here ...
16853 * alloc.c (mark_kboards): ... from here.
16854
16855 * lisp.h (force_auto_save_soon): New decl.
16856
16857 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16858 (DEFINE_DUMMY_FUNCTION): New macro.
16859 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16860 Use it.
16861 (main): Add casts to avoid warnings
16862 if GCC considers string literals to be constants.
16863
16864 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16865
16866 * dbusbind.c: Pointer signedness fixes.
16867 (xd_signature, xd_append_arg, xd_initialize):
16868 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16869 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16870 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16871 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16872
16873 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16874 if GCC considers string literals to be constants.
16875 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16876
16877 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16878
16879 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16880 (print_preprocess, print_object): New macro to fix last change.
16881
16882 * print.c (print_preprocess): Don't forget font objects.
16883
16884 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16885
16886 * emacs.c (USAGE3): Doc fixes.
16887
16888 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16889
16890 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16891 structure.
16892
16893 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16894
16895 * lisp.h (VWindow_system, Qfile_name_history):
16896 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16897 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16898 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16899
16900 * w32select.c: Don't #include "keyboard.h".
16901 (run_protected): Add extern declaration for waiting_for_input.
16902
16903 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16904 * w32console.c (detect_input_pending, read_input_pending)
16905 (encode_terminal_code):
16906 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16907 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16908 (w32_system_caret_y, Qfile_name_history):
16909 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16910 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16911 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16912 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16913 * w32proc.c (Qlocal, report_file_error):
16914 * w32term.c (Vwindow_system, updating_frame):
16915 * w32uniscribe.c (initialized, uniscribe_font_driver):
16916 Remove unneeded extern declarations.
16917
16918 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16919
16920 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16921
16922 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16923
16924 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16925 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16926 These macros can no longer be used for assignment.
16927
16928 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16929 Assign struct members directly, instead of using BUF_BEGV etc.
16930 (record_buffer_markers, fetch_buffer_markers): New functions for
16931 recording and fetching special buffer markers.
16932 (set_buffer_internal_1, set_buffer_temp): Use them.
16933
16934 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16935
16936 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16937
16938 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16939 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16940
16941 * xdisp.c (hscroll_window_tree):
16942 (reconsider_clip_changes): Use PT instead of BUF_PT.
16943
16944 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16945
16946 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16947 $(EMACS_ROOT)/lib/intprops.h.
16948
16949 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16950
16951 Fix more problems found by GCC 4.5.2's static checks.
16952
16953 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16954 to unsigned char * to avoid compiler diagnostic.
16955 (xg_free_frame_widgets): Make it clear that a local variable is
16956 needed only if USE_GTK_TOOLTIP.
16957 (gdk_window_get_screen): Make it clear that this macro is needed
16958 only if USE_GTK_TOOLTIP.
16959 (int_gtk_range_get_value): New function, which avoids a diagnostic
16960 from gcc -Wbad-function-cast.
16961 (xg_set_toolkit_scroll_bar_thumb): Use it.
16962 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16963 diagnostic from gcc -Wbad-function-cast.
16964 (get_utf8_string, xg_get_file_with_chooser):
16965 Rename locals to avoid shadowing.
16966 (create_dialog): Move locals to avoid shadowing.
16967
16968 * xgselect.c (xg_select): Remove unused var.
16969
16970 * image.c (four_corners_best): Mark locals as initialized.
16971 (gif_load): Initialize transparent_p to zero (Bug#8238).
16972 Mark another local as initialized.
16973 (my_png_error, my_error_exit): Mark with NO_RETURN.
16974
16975 * image.c (clear_image_cache): Now static.
16976 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16977 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16978 (x_edge_detection): Remove unnecessary cast that
16979 gcc -Wbad-function-cast diagnoses.
16980 (gif_load): Fix pointer signedness.
16981 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16982 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16983
16984 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16985
16986 Improve quality of tests for time stamp overflow.
16987 For example, without this patch (encode-time 0 0 0 1 1
16988 1152921504606846976) returns the obviously-bogus value (-948597
16989 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16990 reports time overflow. See
16991 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16992 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16993 * editfns.c: Include limits.h and intprops.h.
16994 (TIME_T_MIN, TIME_T_MAX): New macros.
16995 (time_overflow): Move earlier, to before first use.
16996 (hi_time, lo_time): New functions, for an accurate test for
16997 out-of-range times.
16998 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16999 (Fget_internal_run_time): Don't assume time_t fits in int.
17000 (make_time): Use list2 instead of Fcons twice.
17001 (Fdecode_time): More accurate test for out-of-range times.
17002 (check_tm_member): New function.
17003 (Fencode_time): Use it, to test for out-of-range times.
17004 (lisp_time_argument): Don't rely on undefined left-shift and
17005 right-shift behavior when checking for time stamp overflow.
17006
17007 * editfns.c (time_overflow): New function, refactoring common code.
17008 (Fformat_time_string, Fdecode_time, Fencode_time):
17009 (Fcurrent_time_string): Use it.
17010
17011 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17012 * dired.c (make_time): Move to ...
17013 * editfns.c (make_time): ... here.
17014 * systime.h: Note the move.
17015
17016 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17017
17018 * fringe.c (update_window_fringes): Remove unused variables.
17019
17020 * unexmacosx.c (copy_data_segment): Also copy __got section.
17021 (Bug#8223)
17022
17023 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17024
17025 * termcap.c [MSDOS]: Include "msdos.h".
17026 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17027 Constify `char *' arguments and their references according to
17028 prototypes in tparam.h.
17029
17030 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17031
17032 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17033 Adapt all references accordingly.
17034
17035 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17036
17037 2011-03-11 Tom Tromey <tromey@redhat.com>
17038
17039 * buffer.c (syms_of_buffer): Remove obsolete comment.
17040
17041 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17042
17043 * termhooks.h (encode_terminal_code): Declare prototype.
17044
17045 * msdos.c (encode_terminal_code): Don't declare prototype.
17046
17047 * term.c (encode_terminal_code): Now external again, used by
17048 w32console.c and msdos.c.
17049
17050 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17051 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17052
17053 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17054
17055 Fix some minor problems found by GCC 4.5.2's static checks.
17056
17057 * fringe.c (update_window_fringes): Mark locals as initialized
17058 (Bug#8227).
17059 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17060
17061 * alloc.c (mark_fringe_data): Move decl from here ...
17062 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17063 to check its interface.
17064 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17065
17066 * fontset.c (free_realized_fontset): Now static.
17067 (Fset_fontset_font): Rename local to avoid shadowing.
17068 (fontset_font): Mark local as initialized.
17069 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17070
17071 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17072
17073 * xselect.c (x_disown_buffer_selections): Remove; not used.
17074 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17075 (x_own_selection, Fx_disown_selection_internal): Rename locals
17076 to avoid shadowing.
17077 (x_handle_dnd_message): Remove local to avoid shadowing.
17078
17079 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17080 so that the caller can use some name other than gcpro1.
17081 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17082 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17083 (Fx_backspace_delete_keys_p):
17084 Use them to avoid shadowing, and rename vars to avoid shadowing.
17085 (x_decode_color, x_set_name, x_window): Now static.
17086 (Fx_create_frame): Add braces to silence GCC warning.
17087 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17088 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17089 Remove unused locals.
17090 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17091 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17092 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17093 macros.
17094
17095 * xterm.h (x_mouse_leave): New decl.
17096
17097 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17098 Remove unused functions.
17099 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17100 (x_calc_absolute_position): Now static.
17101 (XTread_socket): Don't define label "out" unless it's used.
17102 Don't declare local "event" unless it's used.
17103 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17104 unless they are used.
17105 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17106 (x_fatal_error_signal): Remove; not used.
17107 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17108 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17109 (x_error_catcher, x_connection_closed, x_error_handler):
17110 (x_error_quitter, xembed_send_message, x_iconify_frame):
17111 (my_log_handler): Rename locals to avoid shadowing.
17112 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17113 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17114
17115 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17116 Rename or move locals to avoid shadowing.
17117 (tty_defined_color, merge_face_heights): Now static.
17118 (free_realized_faces_for_fontset): Remove; not used.
17119 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17120 does not deduce is never used uninitialized.
17121 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17122 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17123
17124 * terminal.c (store_terminal_param): Now static.
17125
17126 * xmenu.c (menu_highlight_callback): Now static.
17127 (set_frame_menubar): Remove unused local.
17128 (xmenu_show): Rename parameter to avoid shadowing.
17129 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17130 since they might point to immutable storage.
17131 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17132 since it's unused otherwise.
17133
17134 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17135 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17136 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17137 avoids a gcc -Wuninitialized diagnostic.
17138 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17139 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17140 does not deduce are never used uninitialized.
17141
17142 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17143
17144 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17145 * window.c (window_loop, size_window):
17146 (run_window_configuration_change_hook, enlarge_window): Likewise.
17147
17148 * window.c (display_buffer): Now static.
17149 (size_window): Mark variables that gcc -Wuninitialized
17150 does not deduce are never used uninitialized.
17151 * window.h (check_all_windows): New decl, to forestall
17152 gcc -Wmissing-prototypes diagnostic.
17153 * dispextern.h (bidi_dump_cached_states): Likewise.
17154
17155 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17156 shadowing.
17157 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17158 Include <limits.h>.
17159 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17160 and to avoid gcc -Wuninitialized warning.
17161 (load_charset_map): Mark variables that gcc -Wuninitialized
17162 does not deduce are never used uninitialized.
17163 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17164
17165 * coding.c (coding_set_source, coding_set_destination):
17166 Use "else { /* comment */ }" rather than "else /* comment */;"
17167 for clarity, and to avoid gcc -Wempty-body warning.
17168 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17169 a block, when the outer 'i' will do.
17170 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17171 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17172 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17173 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17174 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17175 Rename locals to avoid shadowing.
17176 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17177 * coding.c (emacs_mule_char, encode_invocation_designation):
17178 Now static, since they're not used elsewhere.
17179 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17180 (decode_coding_object, encode_coding_object, detect_coding_system):
17181 (decode_coding_emacs_mule): Mark variables that gcc
17182 -Wuninitialized does not deduce are never used uninitialized.
17183 (detect_coding_iso_2022): Initialize a local variable that might
17184 be used uninitialized. Leave a FIXME because it's not clear that
17185 this initialization is needed. (Bug#8211)
17186 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17187 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17188 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17189 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17190 Remove unused macros.
17191
17192 * category.c (hash_get_category_set): Remove unused local var.
17193 (copy_category_table): Now static, since it's not used elsewhere.
17194 * character.c (string_count_byte8): Likewise.
17195
17196 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17197 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17198
17199 * chartab.c (copy_sub_char_table): Now static, since it's not used
17200 elsewhere.
17201 (sub_char_table_ref_and_range, char_table_ref_and_range):
17202 Rename locals to avoid shadowing.
17203 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17204
17205 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17206 (BIDI_BOB): Remove unused macro.
17207
17208 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17209 deduce are never used uninitialized.
17210 * term.c (encode_terminal_code): Likewise.
17211
17212 * term.c (encode_terminal_code): Now static. Remove unused local.
17213
17214 * tparam.h: New file.
17215 * term.c, tparam.h: Include it.
17216 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17217 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17218 Move these decls to tparam.h, and make them agree with what
17219 is actually in tparam.c. The previous trick of using incompatible
17220 decls in different modules does not conform to the C standard.
17221 All callers of tparam changed to use tparam's actual API.
17222 * tparam.c (tparam1, tparam, tgoto):
17223 Use const pointers where appropriate.
17224
17225 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17226 * cm.h (struct cm): Likewise.
17227 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17228 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17229 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17230 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17231 (turn_on_face, init_tty): Likewise.
17232 * termchar.h (struct tty_display_info): Likewise.
17233
17234 * term.c (term_mouse_position): Rename local to avoid shadowing.
17235
17236 * alloc.c (mark_ttys): Move decl from here ...
17237 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17238
17239 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17240
17241 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17242
17243 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17244
17245 * search.c (compile_pattern_1): Remove argument regp, unused since
17246 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17247 (compile_pattern): Don't pass it.
17248
17249 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17250
17251 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17252 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17253 for ! HAVE_GTK3.
17254 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17255
17256 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17257
17258 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17259 gdk_window_get_screen, gdk_window_get_geometry,
17260 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17261 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17262 (xg_get_pixbuf_from_pixmap): New function.
17263 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17264 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17265 Call xg_get_pixbuf_from_pixmap instead of
17266 gdk_pixbuf_get_from_drawable.
17267 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17268 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17269 (xg_check_special_colors): Use GtkStyleContext and its functions
17270 for HAVE_GTK3.
17271 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17272 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17273 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17274 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17275 Call gtk_widget_get_preferred_size.
17276 (xg_frame_resized): gdk_window_get_geometry only takes 5
17277 parameters.
17278 (xg_win_to_widget, xg_event_is_for_menubar):
17279 Call gdk_x11_window_lookup_for_display.
17280 (xg_set_widget_bg): New function.
17281 (delete_cb): New function.
17282 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17283 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17284 (xg_set_background_color): Call xg_set_widget_bg.
17285 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17286 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17287 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17288 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17289 if ! HAVE_GTK3.
17290 (update_frame_tool_bar): Call gtk_widget_hide.
17291 (xg_initialize): Use GDK_KEY_g.
17292
17293 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17294 if ! HAVE_GTK3
17295 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17296
17297 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17298 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17299 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17300
17301 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17302
17303 * w32xfns.c (select_palette): Check success of RealizePalette against
17304 GDI_ERROR, not zero.
17305
17306 See ChangeLog.11 for earlier changes.
17307
17308 ;; Local Variables:
17309 ;; coding: utf-8
17310 ;; End:
17311
17312 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17313
17314 This file is part of GNU Emacs.
17315
17316 GNU Emacs is free software: you can redistribute it and/or modify
17317 it under the terms of the GNU General Public License as published by
17318 the Free Software Foundation, either version 3 of the License, or
17319 (at your option) any later version.
17320
17321 GNU Emacs is distributed in the hope that it will be useful,
17322 but WITHOUT ANY WARRANTY; without even the implied warranty of
17323 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17324 GNU General Public License for more details.
17325
17326 You should have received a copy of the GNU General Public License
17327 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.