Fix MS-Windows build broken by 2012-09-15T07:06:56Z!eggert@cs.ucla.edu, completing...
[bpt/emacs.git] / src / ChangeLog
1 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2
3 * w32xfns.c:
4 * w32uniscribe.c:
5 * w32term.c:
6 * w32select.c:
7 * w32reg.c:
8 * w32proc.c:
9 * w32menu.c:
10 * w32inevt.c:
11 * w32heap.c:
12 * w32font.c:
13 * w32fns.c:
14 * w32console.c:
15 * w32.c:
16 * w16select.c: Remove inclusion of setjmp.h, as it is now included
17 by lisp.h. This completes removal of setjmp.h inclusion
18 erroneously announced in the previous commit. (Bug#12446)
19
20 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
21 more accurate.
22
23 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
24 not defined as a macro. The latter happens on MS-Windows.
25 (Bug#12446)
26
27 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
28
29 Port better to POSIX hosts lacking _setjmp (Bug#12446).
30 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
31 Some instances of '#include <setjmp.h>' removed, if the
32 only reason for the instance was because "lisp.h" was included.
33 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
34 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
35 and _longjmp with the new symbols. Emacs already uses _setjmp if
36 available, so this change affects only POSIXish hosts that have
37 sigsetjmp but not _setjmp, such as some versions of Solaris and
38 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
39 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
40 (png_load_body) [HAVE_PNG]:
41 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
42 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
43 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
44 since PNG requires jmp_buf. This is the only exception to the
45 general rule that we now use sys_setjmp and sys_longjmp.
46 This exception is OK since this code does not change the signal
47 mask or longjmp out of a signal handler.
48
49 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
50
51 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
52 Include "syssignal.h", for 'main_thread'.
53
54 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
55
56 Avoid out-of-range marker position (Bug#12426).
57 * insdel.c (replace_range, replace_range_2): Adjust
58 markers before overlays, as suggested by comments.
59 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
60 Remove redundant check before calling offset_intervals.
61
62 2012-09-14 Martin Rudalics <rudalics@gmx.at>
63
64 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
65 current buffer (Bug#12387).
66
67 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
68
69 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
70
71 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
72
73 Use a more backwards-compatible timer format (Bug#12430).
74 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
75 vector element, not from the 4th, since PSECS is now at the end.
76 (Fcurrent_idle_time): Doc fix.
77
78 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
79
80 Function to mark objects and remove killed buffers at once.
81 * alloc.c (discard_killed_buffers): Rename to ...
82 (mark_discard_killed buffers) ... new name. Add marking
83 of remaining objects. Fix comment. Adjust users.
84 (mark_object): Do not touch frame buffer lists here.
85 * frame.c (delete_frame): Reset frame buffer lists here.
86
87 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
88
89 Better workaround for GNOME bug when --enable-gcc-warnings.
90 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
91 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
92 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
93
94 Simplify SIGIO usage (Bug#12408).
95 The code that dealt with SIGIO was crufty and confusing, e.g., it
96 played tricks like "#undef SIGIO" but these tricks were not used
97 consistently. Simplify mostly by not #undeffing standard symbols,
98 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
99 or not as we please) rather than "defined SIGIO" (standard symbol
100 that we probably shouldn't #undef).
101 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
102 Modules that need it can include it.
103 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
104 * dispextern.h (ignore_sigio): New decl.
105 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
106 unconditionally, since it's now a no-op if !USABLE_SIGIO.
107 * emacs.c (shut_down_emacs):
108 * keyboard.c (kbd_buffer_store_event_hold):
109 Use ignore_sigio rather than invoking 'signal' directly.
110 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
111 for FIONREAD.
112 (FIONREAD, SIGIO): Do not #undef.
113 (tty_read_avail_input): Use #error rather than a syntax error.
114 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
115 for I_PIPE, used by SETUP_SLAVE_PTY.
116 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
117 * sysdep.c (croak): Remove; no longer needed. This bit of
118 temporary code, with Fred N. Fish's comment that it's temporary,
119 has been in Emacs since at least 1992!
120 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
121 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
122 * syssignal.h (croak): Remove decl.
123 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
124 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
125 now that we're termios-only.
126 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
127 * term.c (dissociate_if_controlling_tty): Use #error rather than
128 a run-time error.
129
130 Work around GCC and GNOME bugs when --enable-gcc-warnings.
131 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
132 to work around GNOME bug 683906.
133 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
134 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
135 This works around GCC bug 54561.
136
137 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
138
139 More fixes for 'volatile' and setjmp/longjmp.
140 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
141 * image.c (struct png_load_context) [HAVE_PNG]: New type.
142 (png_load_body) [HAVE_PNG]:
143 (jpeg_load_body) [HAVE_JPEG]:
144 New function, with most of the old parent function's body.
145 (png_load) [HAVE_PNG]:
146 (jpeg_load) [HAVE_JPEG]:
147 Invoke the new function, to avoid longjmp munging our locals.
148 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
149 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
150 longjmp is passed 2, as the C standard doesn't guarantee this.
151 Instead, store the failure code into mgr->failure_code.
152
153 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
154
155 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
156 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
157 (syms_of_keyboard): Remove support for unread-command-char.
158
159 2012-09-12 Eli Zaretskii <eliz@gnu.org>
160
161 * w32proc.c (sys_kill): If PID is our process ID and the signal is
162 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
163 violation. (Bug#12426)
164
165 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
166
167 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
168
169 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
170
171 * eval.c: Add `inhibit-debugger'.
172 (Qinhibit_debugger): New symbol.
173 (call_debugger): Bind it instead of Qdebug_on_error.
174 (maybe_call_debugger): Test Vinhibit_debugger.
175 (syms_of_eval): Define inhibit-debugger.
176 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
177 (syms_of_xdisp): Remove inhibit-debug-on-message.
178
179 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
180
181 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
182 If a nonvolatile local variable is written before a _longjmp to
183 the frame containing the variable, and is read after the _longjmp,
184 the value read is indeterminate. Some local variables of type
185 'struct handler' and 'struct catchtag' are used in this way, so
186 mark each of their slots as volatile if the slot can be set before
187 _longjmp and read afterwards.
188 * lisp.h (struct handler): var and chosen_clause are now volatile.
189 (struct catchtag): val, next, and pdlcount are now volatile.
190
191 * bidi.c (bidi_push_it, bidi_pop_it):
192 * fns.c (copy_hash_table):
193 * image.c (define_image_type):
194 * keyboard.c (kbd_buffer_store_event_hold):
195 * process.c (Fprocess_send_eof):
196 * xfaces.c (x_create_gc) [HAVE_NS]:
197 * xgselect.c (xg_select):
198 Prefer assignment to memcpy when either will do.
199
200 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
201 Use pointer-to-a-pointer to simplify and avoid a NILP check each
202 time an item is removed. No need to mark this function 'inline';
203 the compiler knows better than we do.
204
205 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
206
207 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
208 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
209 to change_frame_size (Bug#12388).
210 (windowDidResize:): Pass YES to updateFrameSize.
211
212 * nsterm.h: Add delay parameter to updateFrameSize.
213
214 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
215
216 Discard killed buffers from deleted window and frame objects.
217 This reduces an amount of references to killed buffers and
218 helps GC to reclaim them faster.
219 * alloc.c (discard_killed_buffers): New function.
220 (mark_object): Use it for deleted windows and frames.
221 (mark_object): If symbol's value is set up for a killed buffer
222 or deleted frame, restore it's global binding.
223 * data.c (swap_in_global_binding): Add GC notice.
224 (swap_in_symval_forwarding): Use convenient set_blv_where.
225 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
226 * window.h: ... to here.
227
228 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
229
230 Convenient macro to check whether the buffer is live.
231 * buffer.h (BUFFER_LIVE_P): New macro.
232 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
233 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
234
235 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
236
237 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
238 composition cases (Bug#12364).
239
240 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
241 overhang of succeeding glyphs overlapping box cursor.
242
243 * w32term.c (x_draw_glyph_string): Likewise.
244
245 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
246
247 Simplify, document, and port floating-point (Bug#12381).
248 The porting part of this patch fixes bugs on non-IEEE platforms
249 with frexp, ldexp, logb.
250 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
251 Now static.
252 * floatfns.c: Simplify discussion of functions that Emacs doesn't
253 support, by removing commented-out code and briefly listing the
254 C89 functions excluded. The commented-out stuff was confusing
255 maintenance, e.g., we thought we needed cbrt but it was commented out.
256 (logb): Remove decl; no longer needed.
257 (isfinite): New macro, if not already supplied.
258 (isnan): Don't replace any existing macro.
259 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
260 are present on all C89 platforms.
261 (Ffrexp): Do not special-case zero, as frexp does the right thing
262 for that case.
263 (Flogb): Do not use logb, as it doesn't have the desired meaning
264 on hosts that use non-base-2 floating point. Instead, stick with
265 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
266 frexp, to avoid getting an unspecified result.
267
268 * xdisp.c (Qinhibit_debug_on_message): Now static.
269
270 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
271
272 * nsterm.m (ns_update_begin): Set clip path to whole view by using
273 NSBezierPath (Bug#12131).
274
275 2012-09-10 Chong Yidong <cyd@gnu.org>
276
277 * fns.c (Fdelq, Fdelete): Doc fix.
278
279 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
280
281 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
282 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
283
284 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
285
286 * lisp.h (make_lisp_ptr): New macro to replace XSET.
287 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
288 Use it.
289
290 2012-09-09 Eli Zaretskii <eliz@gnu.org>
291
292 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
293 left fringe if the window has a left margin. This avoids leaving
294 traces of the cursor because its leftmost pixel is not drawn over.
295
296 * dispnew.c (update_window_line): When the left margin area of a
297 screen line is updated, set the redraw_fringe_bitmaps_p flag of
298 that screen line. (Bug#12277)
299
300 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
301
302 Assume C89 or later for math functions (Bug#12381).
303 This simplifies the code, and makes it a bit smaller and faster,
304 and (most important) makes it easier to clean up signal handling
305 since we can stop worring about floating-point exceptions in
306 library code. That was a problem before C89, but the problem
307 went away many years ago on all practical Emacs targets.
308 * data.c, image.c, lread.c, print.c:
309 Don't include <math.h>; no longer needed.
310 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
311 might be autoconfigured, as that never happens.
312 * data.c (fmod):
313 * doprnt.c (DBL_MAX_10_EXP):
314 * print.c (DBL_DIG):
315 Remove. C89 or later always defines these.
316 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
317 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
318 (arith_error, domain_error, domain_error2):
319 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
320 no longer needed -- we simply return what C returns. All uses removed.
321 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
322 the wrapped code.
323 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
324 Remove. All uses expanded, as these macros are no longer used
325 more than once and are now more trouble than they're worth.
326 (Ftan): Use tan, not sin / cos.
327 (Flogb): Assume C89 frexp.
328 (fmod_float): Assume C89 fmod.
329 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
330 (init_floatfns): Remove. All uses removed.
331
332 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
333
334 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
335 compositeToPoint for OSX < 10.6 (Bug#12390).
336
337 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
338
339 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
340 This produces more-accurate results.
341
342 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
343
344 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
345 changes (Bug#12088).
346
347 2012-09-08 Chong Yidong <cyd@gnu.org>
348
349 * syntax.c (Fstring_to_syntax): Doc fix.
350
351 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
352
353 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
354 in the internal border.
355 (x_set_window_size): Remove static variables and their usage.
356 (ns_redraw_scroll_bars): Fix NSTRACE arg.
357 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
358 fringe/internal border adjustment (Bug#11052).
359 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
360 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
361 (ns_fix_rect_ibw): Remove.
362 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
363 (ns_dumpglyphs_box_or_relief): Ditto.
364 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
365 adjustment.
366 (ns_dumpglyphs_image): Ditto.
367 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
368 border adjustment.
369 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
370 their usage. Add fringe_extended_p and its use as in other terms.
371 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
372 scroll bar was removed.
373 (updateFrameSize): New function.
374 (windowDidResize): Move code to updateFrameSize and call it.
375
376 * nsterm.h (EmacsView): Add updateFrameSize.
377
378 2012-09-07 Chong Yidong <cyd@gnu.org>
379
380 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
381
382 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
383
384 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
385
386 More signal-handler cleanup (Bug#12327).
387 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
388 Problem introduced when merging patches. Noted by Eli Zaretskii in
389 <http://bugs.gnu.org/12327#67>.
390 * floatfns.c: Comment fix.
391 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
392 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
393 and anyway the declaration is harmless even if SIGDANGER is not defined.
394 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
395 defined BROKEN_FIONREAD). systty.h formerly did this, but other
396 source files not surprisingly expected syssignal.h to define, or
397 not define, SIGIO, and it's cleaner to do it that way, for consistency.
398 Include <sys/ioctl.h>, for FIONREAD.
399 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
400 This eliminates a problem whereby other files mysteriously had
401 to include "syssignal.h" before including "systty.h" if they
402 wanted to use "#ifdef SIGIO".
403
404 2012-09-07 Eli Zaretskii <eliz@gnu.org>
405
406 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
407
408 * w32.c (sigemptyset): Empty the set.
409 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
410
411 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
412
413 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
414
415 * alloc.c (mark_buffer): Revert unsafe marking optimization.
416 (mark_object): Likewise for frame objects.
417
418 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
419
420 * syssignal.h (handle_on_main_thread): Always declare,
421 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
422 This ports to platforms without HAVE_PTHREAD.
423
424 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
425
426 Signal-handler cleanup (Bug#12327).
427 Emacs's signal handlers were written in the old 4.2BSD style with
428 sigblock and sigmask and so forth, and this led to some
429 inefficiencies and confusion. Rewrite these to use
430 pthread_sigmask etc. without copying signal sets around. Also,
431 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
432 'signal', and instead use functions that do not attempt to take
433 over the system name space. This patch causes Emacs's text
434 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
435 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
436 Do not include <signal.h> or "syssignal.h", as these
437 modules do not use signals.
438 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
439 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
440 Do not include <signal.h>, as "syssignal.h" does that for us now.
441 * atimer.c (sigmask_atimers): New function.
442 (block_atimers, unblock_atimers): New functions,
443 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
444 All uses replaced.
445 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
446 no longer needed here.
447 * emacs.c (main): Inspect existing signal handler with sigaction,
448 so that there's no need to block and unblock SIGHUP.
449 * sysdep.c (struct save_signal): New member 'action', replacing
450 old member 'handler'.
451 (save_signal_handlers, restore_signal_handlers):
452 Use sigaction instead of 'signal' to save and restore.
453 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
454 New function. All users of 'signal' modified to use set_sighandler
455 if they're writeonly, and to use sys_signal if they're read+write.
456 (emacs_sigaction_init, forwarded_signal): New functions.
457 (sys_signal): Remove. All uses replaced by calls to sigaction
458 and emacs_sigaction_init, or by direct calls to 'signal'.
459 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
460 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
461 all uses replaced by pthread_sigmask etc. calls.
462 * syssignal.h: Include <signal.h>.
463 (emacs_sigaction_init, forwarded_signal): New decls.
464 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
465 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
466 (sigmask, sys_sigmask): Remove; no longer needed.
467 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
468 (sigblock, sigunblock, sigfree):
469 (sigsetmask) [!defined sigsetmask]:
470 Remove. All uses replaced by pthread_sigmask.
471 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
472 no longer need to be replaced, and its typical old uses
473 are now done via emacs_sigaction_init and sigaction.
474 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
475 (sys_sigdel): Remove; unused.
476 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
477
478 2012-09-06 Eli Zaretskii <eliz@gnu.org>
479
480 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
481 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
482
483 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
484
485 Explicitly mark buffer_defaults and buffer_local_symbols.
486 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
487 mark_local_symbols here.
488 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
489 since special buffers aren't marked here any more.
490 (allocate_buffer): Chain new buffer with all_buffers here...
491 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
492 not here.
493 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
494 (syms_of_buffer): Remove staticpro of the above.
495 (init_buffer_once): Set names for buffer_defaults and
496 buffer_local_symbols.
497
498 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
499
500 Use bool for booleans in font-related modules.
501 * font.c (font_intern_prop, font_style_to_value)
502 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
503 (generate_otf_features, font_check_otf_features, font_check_otf)
504 (font_match_p, font_list_entities, font_at):
505 * fontset.c (fontset_id_valid_p, reorder_font_vector
506 (fontset_find_font, Fset_fontset_font)
507 (face_suitable_for_char_p) [0]:
508 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
509 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
510 (m17n_flt_initialized, ftfont_shape_by_flt):
511 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
512 * nsfont.m (nsfont_draw):
513 * w32font.c (w32font_draw):
514 * w32term.c (x_draw_glyphless_glyph_string_foreground):
515 Use bool for booleans.
516 * font.h: Adjust to above API changes.
517 (struct font, struct font_driver, struct font_driver_list):
518 Use bool for booleans.
519 (struct font): Remove useless member encoding_type.
520 All users removed.
521 * fontset.c, xftfont.c: Omit unnecessary static decls.
522
523 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
524
525 * alloc.c (mark_object): Revert window marking code
526 since it's unsafe for the Fset_window_configuration.
527
528 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
529
530 Fix race conditions with signal handlers and errno (Bug#12327).
531 Be more systematic about preserving errno whenever a signal
532 handler returns, even if it's not in the main thread. Do this by
533 renaming signal handlers to distinguish between signal delivery
534 and signal handling. All uses changed.
535 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
536 * data.c (deliver_arith_signal): Rename from arith_error.
537 * dispnew.c (deliver_window_change_signal): Rename from
538 window_change_signal.
539 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
540 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
541 * keyboard.c (deliver_input_available_signal): Rename from
542 input_available_signal.
543 (deliver_user_signal): Rename from handle_user_signal.
544 (deliver_interrupt_signal): Rename from interrupt_signal.
545 * process.c (deliver_pipe_signal): Rename from send_process_trap.
546 (deliver_child_signal): Rename from sigchld_handler.
547 * atimer.c (handle_alarm_signal):
548 * data.c (handle_arith_signal):
549 * dispnew.c (handle_window_change_signal):
550 * emacs.c (handle_fatal_signal, handle_danger_signal):
551 * keyboard.c (handle_input_available_signal):
552 * keyboard.c (handle_user_signal, handle_interrupt_signal):
553 * process.c (handle_pipe_signal, handle_child_signal):
554 New functions, with the actual signal-handling code taken from the
555 original respective signal handlers, sans the sporadic attempts to
556 preserve errno, since that's now done by handle_on_main_thread.
557 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
558 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
559 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
560 Move to sysdep.c.
561 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
562 Move initialization of main_thread to sysdep.c's init_signals.
563 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
564 our usage, and simplifies the mainline code.
565 (record_child_status_change): New static function, as a helper
566 for handle_child_signal, and with most of the old child handler's
567 contents.
568 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
569 (handle_child_signal): Use the above.
570 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
571 Moved here from emacs.c.
572 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
573 code moved here from emacs.c's main function.
574 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
575 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
576 lets callers save and restore errno properly.
577
578 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
579
580 Remove redundant or unused things here and there.
581 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
582 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
583 * editfns.c (Fcompare_buffer_substrings): Likewise.
584 * frame.h (struct terminal, struct font_driver_list):
585 Remove redundant declarations.
586 * window.h (Qleft, Qright): Likewise.
587
588 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
589
590 Do not mark objects from deleted buffers, windows and frames.
591 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
592 (mark_object): Likewise for windows and frames.
593
594 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
595
596 * alloc.c (valid_lisp_object_p): Treat killed buffers,
597 buffer_defaults and buffer_local_symbols as valid objects.
598 Return special value to denote them.
599
600 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
601
602 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
603 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
604 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
605 (file_name_absolute_p, Fsubstitute_in_file_name):
606 (check_executable, check_writable, Ffile_accessible_directory_p)
607 (Fset_file_selinux_context, Fdefault_file_modes)
608 (Finsert_file_contents, choose_write_coding_system)
609 (Fwrite_region, build_annotations, a_write, e_write)
610 (Fdo_auto_save):
611 * filelock.c (boot_time_initialized, get_boot_time)
612 (get_boot_time_1, lock_file_1, within_one_second):
613 * floatfns.c (in_float):
614 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
615 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
616 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
617 * lisp.h (struct Lisp_Hash_Table.cmpfn):
618 * window.c (compare_window_configurations):
619 Use bool for booleans.
620 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
621 (Fdefault_file_modes): Now mode_t, not int, for modes.
622 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
623 (internal_delete_file): Now returns void, not a (boolean) int,
624 since nobody was looking at the return value.
625 * lisp.h, window.h: Adjust to above API changes.
626
627 * xdisp.c (set_message): Simplify and reindent last change.
628
629 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
630
631 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
632
633 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
634
635 * eval.c (call_debugger): Make the function non-static so that we
636 can call it from set_message.
637
638 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
639 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
640
641 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
642
643 Give more-useful info on a fatal error (Bug#12328).
644 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
645 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
646 of doing the work ourselves.
647 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
648 do most of the work.
649 (fatal_error_backtrace): New function, taken from the guts
650 of the old fatal_error_signal, but with a new option to output
651 a backtrace.
652 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
653 info about the signal than just its number.
654 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
655 * sysdep.c: Include <execinfo.h>
656 (emacs_backtrace): New function, taken partly from the previous
657 code of the 'die' function.
658 (emacs_abort): Call fatal_error_backtrace rather than abort.
659
660 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
661
662 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
663 eager (load-time) macro-expansion.
664 * lisp.mk (lisp): Add macroexp.
665
666 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
667
668 Simplify redefinition of 'abort' (Bug#12316).
669 Do not try to redefine the 'abort' function. Instead, redo
670 the code so that it calls 'emacs_abort' rather than 'abort'.
671 This removes the need for the NO_ABORT configure-time macro
672 and makes it easier to change the abort code to do a backtrace.
673 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
674 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
675 Remove; sysdep.c's emacs_abort now takes its place.
676 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
677 'abort' changed to use 'emacs_abort'.
678 * msdos.c (dos_abort) [defined abort]: Remove; not used.
679 (abort) [!defined abort]: Rename to ...
680 (emacs_abort): ... new name.
681 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
682 the place of the old 'abort' in emacs.c.
683 * w32.c, w32fns.c (abort): Do not #undef.
684 * w32.c (emacs_abort): Rename from w32_abort.
685
686 2012-09-04 Eli Zaretskii <eliz@gnu.org>
687
688 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
689 offsets[j].dv, since the y axis of the screen coordinates points
690 down, while the y axis of the font definition coordinates points
691 up. This fixes display of Arabic diacritics such as KASRA and
692 KASRATAN. (Bug#11860)
693
694 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
695
696 Be more systematic about _setjmp vs setjmp.
697 * alloc.c (test_setjmp, mark_stack):
698 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
699 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
700 (png_load, my_error_exit, jpeg_load):
701 * process.c (send_process_trap, send_process):
702 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
703 The underscored versions are up to 30x faster on some hosts.
704 Formerly, the code used setjmp+longjmp sometimes and
705 _setjmp+_longjmp at other times, with no particular reason to
706 prefer setjmp+longjmp.
707
708 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
709
710 Fix minor problem found by static checking.
711 * buffer.c (Fdelete_all_overlays): Return nil.
712
713 2012-09-03 Martin Rudalics <rudalics@gmx.at>
714
715 * buffer.c (Fdelete_all_overlays): New function.
716
717 2012-09-03 Chong Yidong <cyd@gnu.org>
718
719 * gtkutil.c: Add extern decl for Qxft.
720
721 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
722
723 * emacs.c, eval.c: Use bool for boolean.
724 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
725 (malloc_using_checking) [DOUG_LEA_MALLOC]:
726 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
727 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
728 (main, decode_env_path, Fdaemon_initialized):
729 * eval.c (call_debugger, Finteractive_p, interactive_p):
730 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
731 (maybe_call_debugger, Fbacktrace):
732 * process.c (read_process_output, exec_sentinel):
733 Use bool for booleans.
734 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
735 All callers changed.
736 * eval.c (interactive_p): Omit always-true boolean argument
737 EXCLUDE_SUBRS_P. All callers changed.
738 * dispextern.h, lisp.h: Reflect above API changes.
739 * firstfile.c (dummy): Use the address of 'main', whose signature
740 won't change, instead of the address of 'initialize', whose
741 signature just changed from int to bool.
742 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
743 * msdos.c (fatal_error_in_progress): ... from here.
744 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
745 of incrementing it.
746 (redisplay_internal, unwind_redisplay): Simply clear
747 REDISPLAYING_P when unwinding, instead of saving its previous,
748 always-false value and then restoring it.
749
750 Clean up some extern decls.
751 Mostly, this hoists extern decls out of .c files and into .h files.
752 That way, we're more likely to catch errors if the interfaces change.
753 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
754 declare xg_mark_data.
755 * dispextern.h (x_frame_parm_handlers):
756 * font.h (Qxft):
757 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
758 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
759 (Qultra_bold, Qoblique, Qitalic):
760 Move extern decl here from .c file.
761 * alloc.c (xg_mark_data) [USE_GTK]:
762 * doc.c (Qclosure):
763 * eval.c (Qlexical_binding):
764 * fns.c (time) [!HAVE_UNISTD_H]:
765 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
766 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
767 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
768 * lread.c (Qinternal_interpreter_environment):
769 * minibuf.c (Qbuffer):
770 * process.c (QCfamily, QCfilter):
771 * widget.c (free_frame_faces):
772 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
773 * xfont.c (x_clear_errors):
774 * xterm.c (x_frame_parm_handlers):
775 Remove now-redundant extern decls.
776 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
777 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
778 Now static.
779 * xfaces.c: Remove unnecessary static decls.
780 * xterm.c (updating_frame): Remove decl of nonexistent object.
781
782 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
783 when building globals.h, as the objects that are not built on
784 this host are not needed to compile C files on this host.
785
786 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
787
788 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
789
790 * frame.h: Add missing prototype for x_wm_set_size_hint.
791
792 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
793
794 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
795 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
796 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
797 (Fsubstitute_command_keys):
798 * editfns.c (region_limit, find_field, Fconstrain_to_field)
799 (save_excursion_save, save_excursion_restore)
800 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
801 (format_time_string, general_insert_function)
802 (make_buffer_string, make_buffer_string_both)
803 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
804 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
805 (copy_text, insert_1, insert_1_both, insert_from_string)
806 (insert_from_string_before_markers, insert_from_string_1)
807 (insert_from_buffer, insert_from_buffer_1, replace_range)
808 (replace_range_2, del_range_1, del_range_byte, del_range_both)
809 (del_range_2, modify_region):
810 * intervals.c (intervals_equal, balance_possible_root_interval)
811 (adjust_intervals_for_insertion, merge_properties_sticky)
812 (graft_intervals_into_buffer, lookup_char_property)
813 (adjust_for_invis_intang, set_point_both)
814 (get_property_and_range, compare_string_intervals)
815 (set_intervals_multibyte_1, set_intervals_multibyte):
816 * keyboard.c (decode_timer):
817 Use bool for boolean.
818 * intervals.h, lisp.h, systime.h: Reflect above API changes.
819 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
820
821 2012-09-02 Chong Yidong <cyd@gnu.org>
822
823 * keymap.c (push_key_description): Print M-TAB as C-M-i
824 (Bug#11758).
825
826 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
827
828 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
829 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
830 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
831 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
832 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
833 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
834 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
835
836 2012-09-01 Eli Zaretskii <eliz@gnu.org>
837
838 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
839 more than one grapheme cluster passed to the shaper: compute the
840 offset adjustment values separately for each cluster. (Bug#11860)
841
842 * image.c: Restore mistakenly removed inclusion of w32.h. Without
843 it, GCC doesn't see prototypes of w32_delayed_load, and complains
844 about implicit conversions from integer to pointer.
845
846 2012-09-01 Daniel Colascione <dancol@dancol.org>
847
848 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
849 system used too early.
850
851 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
852
853 Better seed support for (random).
854 * emacs.c (main): Call init_random.
855 * fns.c (Frandom): Set the seed from a string argument, if given.
856 Remove long-obsolete Gentzel cruft.
857 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
858 (init_random): New function.
859
860 2012-09-01 Daniel Colascione <dancol@dancol.org>
861
862 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
863 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
864 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
865 x_wm_set_size_hint, x_query_colors, x_real_positions,
866 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
867 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
868 all of which have been moved to common code.
869
870 * xfaces.c: Include TERM_HEADER instead of listing all possible
871 window-system headers.
872
873 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
874 to match header.
875
876 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
877 directly accessing frame internals.
878
879 * w32font.h: Include font.h. Define syms_of_w32font and
880 globals_of_w32font.
881
882 * process.c: Include TERM_HEADER instead of listing all possible
883 window-system headers.
884
885 * nsterm.h: Remove declarations now in frame.h. Define
886 FRAME_X_SCREEN, FRAME_X_VISUAL.
887
888 * menu.c: Include TERM_HEADER instead of listing all possible
889 window-system headers.
890
891 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
892 window system.
893
894 * keyboard.c: Include TERM_HEADER instead of listing all possible
895 window-system headers.
896
897 * image.c: Include TERM_HEADER instead of listing all possible
898 window-system headers. Declare Vlibrary_cache when compiling for
899 Windows.
900
901 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
902 window system declarations.
903
904 * frame.h: Move common functions here: set_frame_menubar,
905 x_set_window_size, x_sync, x_get_focus_frame,
906 x_set_mouse_position, x_set_mouse_pixel_position,
907 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
908 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
909 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
910 x_activate_menubar, x_real_positions, x_bitmap_icon,
911 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
912 and x_query_colors.
913
914 * frame.c: Include TERM_HEADER instead of listing all possible
915 window-system headers.
916
917 * font.c: Include TERM_HEADER instead of listing all possible
918 window-system headers.
919
920 * emacs.c: Include TERM_HEADER.
921
922 * dispnew.c: Include TERM_HEADER instead of listing all possible
923 window-system headers.
924
925 * ccl.h: Include character.h.
926
927 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
928 the current window system; include in list of objects to link into
929 Emacs.
930
931 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
932
933 Remove mark_ttys function and fix tty_display_info initialization.
934 * lisp.h (mark_ttys): Remove prototype.
935 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
936 to mark_ttys because all possible values of 'top_frame' slot are
937 the frames which are reachable from Vframe_list.
938 * term.c (mark_ttys): Remove.
939 (init_tty): Safely initialize 'top_frame' slot with Qnil.
940
941 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
942
943 Change struct frame bitfields from unsigned char to unsigned.
944 * frame.h (struct frame): Change type of 'display_preempted',
945 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
946 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
947 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
948 bitfields from unsigned char to unsigned.
949
950 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
951
952 Remove unused member of struct x_output and struct w32_output.
953 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
954 * w32term.h (struct w32_output): Likewise.
955
956 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
957
958 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
959 does not become zero (Bug#12234).
960
961 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
962
963 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
964 for GCC 4.7.1 x86-64.
965
966 2012-08-30 Glenn Morris <rgm@gnu.org>
967
968 * lread.c (init_lread): For out-of-tree builds, only add the
969 source directory's site-lisp dir to the load-path if it exists,
970 consistent with in-tree builds. (Bug#12302)
971
972 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
973
974 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
975 button_values to NULL. Call setStykeMask so dialogs get a close button.
976 (windowShouldClose:): Set window_closed.
977 (dealloc): New member, free button_values.
978 (process_dialog:): Make member function. Remove window argument,
979 replace window with self. Count buttons and allocate and store values
980 in button_values.
981 (addButton:value:row:): value is int with the name tag. Call setTag
982 with tag. Remove return self, declare return value as void.
983 (addString:row:): Remove return self, declare return value as void.
984 (addSplit): Remove return self, declare return value as void.
985 (clicked:): Remove return self, declare return value as void.
986 Set dialog_return to button_values[seltag]. Code formatting change.
987 (initFromContents:isQuestion:): Adjust call to process_dialog.
988 Code formatting change.
989 (timeout_handler:): Set timer_fired to YES.
990 (runDialogAt:): Set timer_fired to NO.
991 Handle click on close button as quit.
992
993 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
994 Add window_closed and button_values. Add void as return value for
995 add(Button|String|Split). addButton takes int instead of Lisp_Object.
996 Add process_dialog as new member.
997
998 2012-08-28 Eli Zaretskii <eliz@gnu.org>
999
1000 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1001 is not one of the heaps we manage. (Bug#12242)
1002
1003 2012-08-28 Glenn Morris <rgm@gnu.org>
1004
1005 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1006
1007 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1008
1009 * window.c (Fset_window_configuration): Remove handling of
1010 auto-buffer-name window parameter. Install revision of reverted
1011 fix.
1012
1013 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1014
1015 Do not allow to set major mode for a dead buffer.
1016 * buffer.c (Fset_buffer_major_mode): Signal an error
1017 if the buffer is dead.
1018 (Fother_buffer, other_buffer_safely): Remove redundant
1019 nested declaration.
1020
1021 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1022
1023 Always use set_buffer_if_live to restore original buffer at unwind.
1024 * buffer.h (record_unwind_current_buffer): New function.
1025 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1026 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1027 * undo.c, window.c: Adjust users.
1028 * buffer.c (set_buffer_if_live): Fix comment.
1029
1030 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1031
1032 Fix usage of set_buffer_internal.
1033 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1034 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1035 * coding.c (decode_coding): Omit redundant test.
1036 * fileio.c (decide_coding_unwind): Likewise.
1037 * fns.c (secure_hash): Likewise.
1038 * insdel.c (modify_region): Likewise.
1039 * keyboard.c (command_loop_1): Likewise.
1040 * print.c (PRINTFINISH): Likewise.
1041 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1042
1043 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1044
1045 * dispnew.c: Use bool for boolean.
1046 (frame_garbaged, display_completed, delayed_size_change)
1047 (fonts_changed_p, add_window_display_history)
1048 (add_frame_display_history, verify_row_hash)
1049 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1050 (row_equal_p, realloc_glyph_pool)
1051 (allocate_matrices_for_frame_redisplay)
1052 (showing_window_margins_p)
1053 (adjust_frame_glyphs_for_frame_redisplay)
1054 (build_frame_matrix_from_leaf_window, make_current)
1055 (mirrored_line_dance, mirror_line_dance, update_frame)
1056 (update_window_tree, update_single_window)
1057 (check_current_matrix_flags, update_window, update_text_area)
1058 (update_window_line, set_window_update_flags, scrolling_window)
1059 (update_frame_1, scrolling, buffer_posn_from_coords)
1060 (do_pending_window_change, change_frame_size)
1061 (change_frame_size_1, sit_for):
1062 Use bool for boolean.
1063 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1064 and remove last int (actually boolean) argument, which was always 0.
1065 All callers changed.
1066 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1067 * dispextern.h (struct composition_it): Use bool for boolean.
1068 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1069 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1070 * dired.c (file_name_completion):
1071 Use bool for boolean. (This was missed in an earlier change.)
1072
1073 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1074
1075 * window.c (Fset_window_configuration): Revert first part of
1076 last change.
1077
1078 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1079
1080 * nsterm.h (NSPanel): New class variable dialog_return.
1081
1082 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1083 dialog_return.
1084 (windowShouldClose:): Use stop instead of stopModalWithCode.
1085 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1086 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1087 event.
1088 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1089 modal loop returns.
1090
1091 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1092
1093 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1094 * composite.c (find_composition, composition_gstring_p)
1095 (composition_reseat_it, find_automatic_composition):
1096 * data.c (let_shadows_buffer_binding_p)
1097 (let_shadows_global_binding_p, set_internal, make_blv)
1098 (Fmake_variable_buffer_local, Fmake_local_variable)
1099 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1100 (cons_to_signed, arith_driver):
1101 * dbusbind.c (xd_in_read_queued_messages):
1102 * dired.c (directory_files_internal, file_name_completion):
1103 Use bool for booleans.
1104 * dired.c (file_name_completion):
1105 * process.h (fd_callback):
1106 Omit int (actually boolean) argument. It wasn't being used.
1107 All uses changed.
1108 * composite.h, lisp.h: Reflect above API changes.
1109
1110 * cmds.c, coding.c: Use bool for booleans.
1111 * cmds.c (move_point, Fself_insert_command):
1112 * coding.h (struct composition status, struct coding_system):
1113 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1114 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1115 (emacs_mule_char, decode_coding_emacs_mule)
1116 (encode_coding_emacs_mule, detect_coding_iso_2022)
1117 (decode_coding_iso_2022, encode_invocation_designation)
1118 (encode_designation_at_bol, encode_coding_iso_2022)
1119 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1120 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1121 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1122 (encode_coding_raw_text, detect_coding_charset)
1123 (decode_coding_charset, encode_coding_charset, detect_eol)
1124 (detect_coding, get_translation_table, produce_chars)
1125 (consume_chars, reused_workbuf_in_use)
1126 (make_conversion_work_buffer, code_conversion_save)
1127 (decode_coding_object, encode_coding_object)
1128 (detect_coding_system, char_encodable_p)
1129 (Funencodable_char_position, code_convert_region)
1130 (code_convert_string, code_convert_string_norecord)
1131 (Fset_coding_system_priority):
1132 * fileio.c (Finsert_file_contents):
1133 Use bool for booleans.
1134 * coding.h, lisp.h: Reflect above API changes.
1135 * coding.c: Remove unnecessary static function decls.
1136 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1137 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1138 not a boolean 'int', since callers never look at the return value.
1139 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1140 * coding.h (decoding_buffer_size, encoding_buffer_size)
1141 (emacs_mule_string_char): Remove unused extern decls.
1142 (struct iso_2022_spec, struct coding_system):
1143 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1144 (struct emacs_mule_spec): Remove unused field 'full_support'.
1145 All initializations removed.
1146 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1147
1148 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1149
1150 Fix spare memory change (Bug#12286).
1151 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1152 (valid_lisp_object_p): Likewise.
1153
1154 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1155
1156 * window.c (Fset_window_configuration): Record any window's old
1157 buffer if it's replaced (see Bug#8789). If the new current
1158 buffer doesn't appear in the selected window, go to its old
1159 point (Bug#12208).
1160
1161 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1162
1163 Special MEM_TYPE_SPARE to denote reserved memory.
1164 * alloc.c (enum mem_type): New memory type.
1165 (refill_memory_reserve): Use new type for spare memory.
1166 This prevents live_cons_p and live_string_p from incorrect
1167 detection of uninitialized objects from spare memory as live.
1168
1169 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1170
1171 Spelling fixes.
1172 * Makefile.in (.PHONY): versioclean -> versionclean.
1173
1174 Remove unused external symbols.
1175 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1176 * window.c (Qwindow_valid_p, decode_valid_window):
1177 Now static, not extern.
1178 * data.c (Qinterval): Remove; unused.
1179 (syms_of_data): Do not define 'interval'.
1180 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1181 * window.h (decode_valid_window):
1182 Remove decls.
1183
1184 * character.c, charset.c, chartab.c: Use bool for booleans.
1185 * character.c (lisp_string_width, string_count_byte8)
1186 (string_escape_byte8):
1187 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1188 (load_charset_map_from_file, map_charset_chars)
1189 (Fdefine_charset_internal, define_charset_internal)
1190 (Fdeclare_equiv_charset, find_charsets_in_text)
1191 (Ffind_charset_region, char_charset, Fiso_charset):
1192 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1193 (sub_char_table_set, sub_char_table_set_range)
1194 (char_table_set_range, optimize_sub_char_table)
1195 (map_sub_char_table):
1196 Use bool for boolean.
1197 * character.c (str_to_unibyte): Omit last boolean argument; it was
1198 always 0. All callers changed.
1199 * character.h, charset.h: Adjust to match previous changes.
1200 * character.h (char_printable_p): Remove decl of nonexistent function.
1201 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1202 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1203 are all boolean, so make them single-bit bitfields.
1204
1205 * lisp.h (ASET): Remove attempt to detect side effects.
1206 It was meant to be temporary and it often doesn't work,
1207 because when IDX has side effects the behavior of IDX==IDX
1208 is undefined. See Stefan Monnier in
1209 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1210
1211 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1212
1213 * lisp.h (functionp): New function (extracted from Ffunctionp).
1214 (FUNCTIONP): Use it.
1215 * eval.c (Ffunctionp): Use it.
1216
1217 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1218
1219 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1220 as that's faster and simpler than static storage. Don't bother
1221 with the g_main_context_query overhead if g_main_context_pending
1222 says no events are pending.
1223 (gfds, gfds_size): Remove these static vars.
1224 (xgselect_initialize): Remove; no longer needed.
1225 All uses and decls removed.
1226
1227 * emacs.c (fatal_error_signal_hook): Remove.
1228 All uses removed. This leftover from old code was always 0.
1229
1230 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1231 * casefiddle.c (casify_object, casify_region):
1232 * casetab.c (set_case_table):
1233 * category.c, category.h (word_boundary_p):
1234 * category.h (CHAR_HAS_CATEGORY):
1235 Use bool for booleans, instead of int.
1236
1237 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1238
1239 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1240
1241 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1242
1243 On assertion failure, print backtrace if available.
1244 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1245 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1246 * Makefile.in (LIB_EXECINFO): New macro.
1247 (LIBES): Use it.
1248
1249 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1250 * bytecode.c (exec_byte_code):
1251 * callint.c (check_mark, Fcall_interactively):
1252 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1253 (getenv_internal, sync_process_alive, call_process_exited):
1254 * lisp.h (USE_SAFE_ALLOCA):
1255 Use bool for booleans, instead of int.
1256 * lisp.h, process.h: Adjust prototypes to match above changes.
1257 * callint.c (Fcall_interactively): Don't assume the mark's
1258 offset fits in 'int'.
1259
1260 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1261
1262 * buffer.c, buffer.h: Use bool for boolean.
1263 * buffer.c (reset_buffer_local_variables)
1264 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1265 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1266 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1267 (overlay_touches_p, overlay_strings, Foverlay_put)
1268 (report_overlay_modification, call_overlay_mod_hooks):
1269 (mmap_enlarge, mmap_set_vars):
1270 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1271 Use bool for booleans, instead of int.
1272 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1273 since the 1-or-0 return value is always ignored anyway.
1274 (mmap_initialized_p):
1275 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1276 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1277
1278 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1279
1280 * bidi.c: Use bool for boolean.
1281 This is a bit more readable, and makes the text segment of bidi.o
1282 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1283 Presumably it's faster too.
1284 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1285 Now bool.
1286 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1287 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1288 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1289 (bidi_explicit_dir_char, bidi_level_of_next_char)
1290 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1291 Use bool for booleans, instead of int.
1292 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1293 (bidi_unshelve_cache): Adjust decls to match code.
1294
1295 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1296
1297 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1298 argument.
1299
1300 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1301
1302 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1303 * atimer.h: Include <stdbool.h>.
1304
1305 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1306
1307 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1308 compile time tests instead of run time tests on systems that do
1309 not use them.
1310 (FRAME_MAC_P): Remove leftover from deleted code.
1311 * frame.c (syms_of_frame): Remove leftover from deleted code.
1312
1313 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1314
1315 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1316
1317 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1318
1319 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1320 Otherwise, the compiler complains about (A?B:C) where B is void
1321 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1322 (fontset_add): Return void, for FONTSET_ADD.
1323
1324 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1325
1326 * alloc.c: Use bool for booleans.
1327 (gc_in_progress, abort_on_gc)
1328 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1329 (dont_register_blocks) [GC_MALLOC_CHECK]:
1330 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1331 (check_string_bytes, make_specified_string, memory_full)
1332 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1333 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1334 (mark_stack, valid_pointer_p, make_pure_string)
1335 (Fgarbage_collect, survives_gc_p, gc_sweep):
1336 Use bool for booleans, instead of int.
1337 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1338 Remove unused local.
1339 * alloc.c (PURE_POINTER_P):
1340 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1341 * editfns.c (Fformat):
1342 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1343 (Fdo_auto_save):
1344 * fns.c (sweep_weak_table):
1345 * lisp.h (suppress_checking, push_message, survives_gc_p)
1346 (make_pure_string, gc_in_progress, abort_on_gc):
1347 * lread.c (readchar, read1):
1348 * print.c (Fprin1_to_string):
1349 * xdisp.c (push_message):
1350 Use bool for booleans affected directly or indirectly by
1351 alloc.c's changes.
1352
1353 Make recently-introduced setters macros.
1354 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1355 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1356 (set_fontset_default, set_fontset_fallback): Rename from their
1357 upper-case counterparts, and make them functions rather than macros.
1358 This is more consistent with the other recently-introduced setters.
1359 These don't need to be inline, since they're local.
1360
1361 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1362
1363 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1364 the loop (Bug#12247).
1365
1366 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1367
1368 * lisp.h (vcopy): Use memcpy rather than our own loop.
1369 This fixes a performance regression introduced by the recent
1370 addition of vcopy. This means 'vcopy' will need to be modified
1371 for a copying collector, but that's OK. Also, tighten the
1372 checking in the assertion.
1373
1374 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1375
1376 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1377 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1378 non-base glyph for the width of the base character, according to
1379 what x_draw_composite_glyph_string_foreground expects.
1380 Generate WADJUST value according to composition_gstring_width's
1381 expectations, to produce correct width of the composed character.
1382 Reverse the sign of the DU offset produced by ScriptPlace.
1383
1384 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1385
1386 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1387
1388 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1389
1390 Avoid direct writes to contents member of struct Lisp_Vector.
1391 * lisp.h (vcopy): New function to copy data into vector.
1392 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1393 * fns.c (Ffillarray): Use ASET.
1394 * keyboard.c (timer_check_2): Use AREF and ASET.
1395 (append_tool_bar_item, Frecent_keys): Use vcopy.
1396 * lread.c (read_vector): Use ASET.
1397 * msdos.c (Frecent_doskeys): Use vcopy.
1398 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1399 (Finternal_merge_in_global_face): Use ASET and vcopy.
1400 * xfont.c (xfont_list_pattern): Likewise.
1401
1402 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1403
1404 * window.c (Fwindow_point): For the selected window always return
1405 the position of its buffer's point.
1406 (Fset_window_point): For the selected window always go in its
1407 buffer to the specified position.
1408
1409 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1410
1411 Setter macros for fontsets.
1412 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1413 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1414 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1415 Adjust users.
1416
1417 2012-08-20 Glenn Morris <rgm@gnu.org>
1418
1419 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1420 Don't assume that `ln -f' works.
1421
1422 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1423
1424 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1425 and later about non-assignments with no effect. See discussion at
1426 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1427 details.
1428
1429 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1430
1431 Inline setter functions for Lisp_Objects slots of struct specbinding.
1432 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1433 Adjust users.
1434
1435 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1436
1437 * window.c (select_window): Always make selected window's buffer
1438 current.
1439
1440 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1441
1442 Use AREF and ASET for docstrings of category tables.
1443 * category.h (CATEGORY_DOCSTRING): Use AREF.
1444 (SET_CATEGORY_DOCSTRING): Use ASET.
1445 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1446
1447 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1448
1449 Inline setter functions for hash table members.
1450 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1451 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1452 (set_hash_key_and_value, set_hash_index, set_hash_next)
1453 (set_hash_hash): New functions.
1454 * charset.c, fns.c: Adjust users.
1455
1456 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1457
1458 Inline getter and setter functions for per-buffer values.
1459 * buffer.h (per_buffer_default, set_per_buffer_default)
1460 (per_buffer_value, set_per_buffer_value): New functions.
1461 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1462 * buffer.c, data.c: Adjust users.
1463
1464 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1465
1466 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1467
1468 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1469
1470 Rely on <config.h> + <unistd.h> to declare 'environ',
1471 as gnulib does this if the system doesn't.
1472 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1473 Remove declaration. MS-Windows declares it on stdlib.h which is
1474 included by conf_post.h.
1475 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1476 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1477 * vm-limit.c: Include <unistd.h>, for 'environ'.
1478
1479 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1480 (start_of_data): Remove decl; mem-limits.h provides it.
1481
1482 * xdisp.c (handle_invisible_prop): Make it a bit faster
1483 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1484
1485 2012-08-19 Chong Yidong <cyd@gnu.org>
1486
1487 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1488 ends (Bug#3874).
1489
1490 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1491
1492 * .gdbinit: Use call instead of set when calling a function in the
1493 inferior.
1494
1495 * data.c (set_internal): Don't use set_blv_found.
1496 (Fkill_local_variable): Likewise.
1497
1498 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1499
1500 * nsfont.m (ns_ascii_average_width): Ensure the string
1501 ascii_printable is initialized with a null-terminated character
1502 array. Otherwise, it can contain undesired extra characters.
1503
1504 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1505
1506 port new setting code to Sun C 5.8 2005/10/13
1507 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1508 Return void, not Lisp_Object. Otherwise, the compiler
1509 complains about (A?B:C) where B is void and C is Lisp_Object
1510 when compiling CHAR_TABLE_SET, due to the recent change to
1511 the API of sub_char_table_set_contents.
1512
1513 2012-08-18 Chong Yidong <cyd@gnu.org>
1514
1515 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1516 for the string case (Bug#3874).
1517
1518 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1519
1520 * buffer.h (BSET): Remove (Bug#12215).
1521 Replace all uses with calls to new setter functions.
1522 (bset_bidi_paragraph_direction, bset_case_canon_table)
1523 (bset_case_eqv_table, bset_directory, bset_display_count)
1524 (bset_display_time, bset_downcase_table)
1525 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1526 (bset_last_selected_window, bset_local_var_alist)
1527 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1528 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1529 (bset_width_table):
1530 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1531 (bset_auto_fill_function, bset_auto_save_file_format)
1532 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1533 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1534 (bset_cache_long_line_scans, bset_case_fold_search)
1535 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1536 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1537 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1538 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1539 (bset_header_line_format, bset_indicate_buffer_boundaries)
1540 (bset_indicate_empty_lines, bset_invisibility_spec)
1541 (bset_left_fringe_width, bset_major_mode, bset_mark)
1542 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1543 (bset_name, bset_overwrite_mode, bset_pt_marker)
1544 (bset_right_fringe_width, bset_save_length)
1545 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1546 (bset_scroll_up_aggressively, bset_selective_display)
1547 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1548 (bset_word_wrap, bset_zv_marker):
1549 * category.c (bset_category_table):
1550 * syntax.c (bset_syntax_table):
1551 New setter functions.
1552
1553 * process.h (PSET): Remove (Bug#12215).
1554 Replace all uses with calls to new setter functions.
1555 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1556 (PROCESS_INLINE): New macro.
1557 (pset_childp): New setter function.
1558 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1559 * process.c (PROCESS_INLINE):
1560 Define to EXTERN_INLINE, so that the corresponding functions
1561 are compiled into code.
1562 (pset_buffer, pset_command, pset_decode_coding_system)
1563 (pset_decoding_buf, pset_encode_coding_system)
1564 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1565 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1566 (pset_type, pset_write_queue): New setter functions.
1567
1568 * window.h (WSET): Remove (Bug#12215).
1569 Replace all uses with calls to new setter functions.
1570 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1571 (WINDOW_INLINE): New macro.
1572 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1573 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1574 (wset_total_lines, wset_vertical_scroll_bar)
1575 (wset_window_end_pos, wset_window_end_valid)
1576 (wset_window_end_vpos): New setter functions.
1577 * window.c (WINDOW_INLINE):
1578 Define to EXTERN_INLINE, so that the corresponding functions
1579 are compiled into code.
1580 (wset_combination_limit, wset_dedicated, wset_display_table)
1581 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1582 (wset_new_normal, wset_new_total, wset_next_buffers)
1583 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1584 (wset_prev_buffers, wset_right_fringe_width)
1585 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1586 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1587 (wset_window_parameters):
1588 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1589 (wset_column_number_displayed, wset_region_showing):
1590 New setter functions.
1591
1592 * termhooks.h (TSET): Remove (Bug#12215).
1593 Replace all uses with calls to new setter functions.
1594 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1595 (TERMHOOKS_INLINE): New macro.
1596 (tset_charset_list, tset_selection_alist): New setter functions.
1597 * terminal.c (TERMHOOKS_INLINE):
1598 Define to EXTERN_INLINE, so that the corresponding functions
1599 are compiled into code.
1600 (tset_param_alist): New setter function.
1601
1602 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1603
1604 * keyboard.h (KSET): Remove (Bug#12215).
1605 Replace all uses with calls to new setter functions.
1606 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1607 (KEYBOARD_INLINE): New macro.
1608 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1609 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1610 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1611 New setter functions.
1612 * keyboard.c (KEYBOARD_INLINE):
1613 Define to EXTERN_INLINE, so that the corresponding functions
1614 are compiled into code.
1615 (kset_echo_string, kset_kbd_queue)
1616 (kset_keyboard_translate_table, kset_last_prefix_arg)
1617 (kset_last_repeatable_command, kset_local_function_key_map)
1618 (kset_overriding_terminal_local_map, kset_real_last_command)
1619 (kset_system_key_syms): New setter functions.
1620
1621 * frame.h (FSET): Remove (Bug#12215).
1622 Replace all uses with calls to new setter functions.
1623 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1624 (FRAME_INLINE): New macro.
1625 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1626 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1627 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1628 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1629 (fset_param_alist, fset_root_window, fset_scroll_bars)
1630 (fset_selected_window, fset_title, fset_tool_bar_items)
1631 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1632 * frame.c (FRAME_INLINE):
1633 Define to EXTERN_INLINE, so that the corresponding functions
1634 are compiled into code.
1635 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1636
1637 A few more naming-convention fixes for getters and setters.
1638 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1639 and rename from buffer_overlays_set_before.
1640 (set_buffer_overlays_after): Move here from buffer.h, and rename
1641 from buffer_overlays_set_after.
1642 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1643 All uses changed.
1644 (set_buffer_intervals): Rename from buffer_set_intervals.
1645 * intervals.c (set_interval_object): Move here from intervals.h,
1646 and rename from interval_set_object.
1647 (set_interval_left): Move here from intervals.h, and rename from
1648 interval_set_left.
1649 (set_interval_right): Move here from intervals.h, and rename from
1650 interval_set_right.
1651 (copy_interval_parent): Move here from intervals.h, and rename from
1652 interval_copy_parent.
1653 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1654 (set_interval_plist): Rename from interval_set_plist.
1655 Return void, not Lisp_Object, since no caller uses the result.
1656 * lisp.h (string_intervals): Rename from string_get_intervals.
1657 (set_string_intervals): Rename from string_set_intervals.
1658
1659 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1660 (set_char_table_contents): Rename from char_table_set_contents.
1661 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1662 All uses changed. See the end of
1663 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1664
1665 * lisp.h (CSET): Remove (Bug#12215).
1666 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1667 (set_char_table_purpose): New functions,
1668 replacing CSET. All uses changed. For example, replace
1669 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1670 "set_char_table_parent (char_table, parent);".
1671 The old version was confusing because it used the same name
1672 'parent' for two different things.
1673
1674 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1675
1676 Functions to get and set Lisp_Object fields of buffer-local variables.
1677 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1678 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1679 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1680 * data.c, eval.c, frame.c: Adjust users.
1681
1682 2012-08-17 Chong Yidong <cyd@gnu.org>
1683
1684 * xfaces.c (merge_face_vectors): If the target font specfies a
1685 font spec, make the font's attributes take precedence over
1686 directly-specified attributes.
1687 (merge_face_ref): Recognize :font.
1688
1689 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1690
1691 Do not use memcpy for copying intervals.
1692 * intervals.c (reproduce_interval): New function.
1693 (reproduce_tree, reproduce_tree_obj): Use it.
1694 (reproduce_tree_obj): Remove prototype.
1695
1696 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1697
1698 * lisp.h (duration_to_sec_usec): Remove unused decl.
1699
1700 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1701
1702 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1703 to an allocated instance of NSString, not to the class itself.
1704
1705 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1706
1707 * makefile.w32-in (C_CTYPE_H): New macro.
1708 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1709 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1710 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1711
1712 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1713
1714 Use ASCII tests for character types.
1715 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1716 * xfns.c, xterm.c:
1717 Don't include <ctype.h>; was not needed.
1718 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1719 * sysdep.c, xfaces.c:
1720 Include <c-ctype.h> instead of <ctype.h>.
1721 * nsterm.m: Include <c-ctype.h>.
1722 * charset.c (read_hex):
1723 * doc.c (Fsnarf_documentation):
1724 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1725 (DRIVE_LETTER) [DOS_NT]:
1726 (Ffile_name_directory, Fexpand_file_name)
1727 (Fsubstitute_in_file_name):
1728 * font.c (font_parse_xlfd, font_parse_fcname):
1729 * frame.c (x_set_font_backend):
1730 * gtkutil.c (xg_get_font):
1731 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1732 * nsimage.m (hexchar):
1733 * nsterm.m (ns_xlfd_to_fontname):
1734 * sysdep.c (system_process_attributes):
1735 * xfaces.c (hash_string_case_insensitive):
1736 Use C-locale tests instead of locale-specific tests for character
1737 types, since we want the ASCII interpretation here, not the
1738 interpretation suitable for whatever happens to be the current locale.
1739
1740 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1741
1742 Consistently check windows for validity/liveness
1743 (Bug#11984, Bug#12025, Bug#12026).
1744 * lisp.h (CHECK_VALID_WINDOW): New macro.
1745 * window.c (decode_window): Rename to decode_live_window.
1746 (decode_valid_window, Fwindow_valid_p): New functions.
1747 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1748 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1749 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1750 (Fwindow_prev_sibling, Fwindow_combination_limit)
1751 (Fset_window_combination_limit, Fwindow_use_time)
1752 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1753 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1754 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1755 (Fwindow_hscroll, Fset_window_hscroll)
1756 (Fwindow_redisplay_end_trigger)
1757 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1758 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1759 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1760 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1761 (Fwindow_end, Fset_window_point, Fset_window_start)
1762 (Fpos_visible_in_window_p, Fwindow_line_height)
1763 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1764 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1765 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1766 (Fset_window_parameter, Fwindow_display_table)
1767 (Fset_window_display_table, Fdelete_other_windows_internal)
1768 (Fset_window_buffer, Fset_window_new_total)
1769 (Fset_window_new_normal, Fdelete_window_internal)
1770 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1771 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1772 (Fwindow_scroll_bars): Check whether argument window is a valid or
1773 live window. Update doc-strings.
1774 (syms_of_window): New symbol Qwindow_valid_p.
1775 * keyboard.c (Fposn_at_x_y): Check whether argument
1776 frame_or_window denotes a valid window.
1777
1778 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1779
1780 Fix previous char table change.
1781 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1782 * chartab.c (optimize_sub_char_table): Likewise.
1783
1784 2012-08-16 Chong Yidong <cyd@gnu.org>
1785
1786 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1787
1788 * xfont.c (xfont_open):
1789 * xftfont.c (xftfont_open): Set the font's max_width field.
1790
1791 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1792 min_width to space_width and average_width to the average over
1793 printable ASCII characters.
1794 (ns_char_width): Code cleanup.
1795 (ns_ascii_average_width): New utility function.
1796
1797 * font.h (struct font): Update comments.
1798
1799 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1800
1801 Simple interface to set Lisp_Object fields of character tables.
1802 * lisp.h (CSET): New macro.
1803 (char_table_set_extras, char_table_set_contents)
1804 (sub_char_table_set_contents): New function.
1805 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1806 * syntax.c: Adjust users.
1807
1808 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1809
1810 * eval.c (eval_sub): Bind lexical-binding.
1811 * lread.c (Qlexical_binding): Make non-static.
1812
1813 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1814
1815 * nsmenu.m (popupSession): Remove.
1816 (pop_down_menu): Remove endModalSession.
1817 (timeout_handler:): New method.
1818 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1819 Call runModalForWindow. Check timer_fired when it returns.
1820 If not set, cancel timer and break out of loop.
1821 Otherwise loop again, with a new timeout.
1822
1823 * nsterm.m: Include fcntl.h if present.
1824 (fd_entry, t_readfds, inNsSelect): Remove.
1825 (select_writefds, select_valid, select_timeout, selfds)
1826 (select_mutex, apploopnr): Add.
1827 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1828 Otherwise call kbd_buffer_store_event.
1829 (ns_send_appdefined): Remove release of fd_entry.
1830 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1831 Increment and decrement apploopnr.
1832 (ns_select): If no file descriptors, just do a NSTimer.
1833 Otherwise copy read/write masks and start select thread (fd_handler).
1834 Start main loop and wait for application defined event.
1835 Inform select thread to stop selecting after main loop is exited.
1836 (ns_term_init): Create selfds pipe and set non-blocking.
1837 Initialize select_mutex. Start the select thread (fd_handler).
1838 (fd_handler:): Loop forever, wait for info from the main thread
1839 to either start or stop selecting. When select returns, send
1840 and appdefined event.
1841 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1842 If not call kbd_buffer_store_event.
1843
1844 * nsterm.h (EmacsApp): fd_handler takes id argument.
1845 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1846
1847 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1848
1849 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1850
1851 * region-cache.c (move_cache_gap): Update gap_len using the actual
1852 growth of the boundaries array. Do not change cache_len.
1853 (Bug#12196)
1854
1855 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1856
1857 Generalize and cleanup font subsystem checks.
1858 * font.h (FONT_DEBUG, font_assert): Remove.
1859 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1860 Change font_assert to eassert. Use eassert where appropriate.
1861
1862 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1863
1864 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1865
1866 2012-08-15 Chong Yidong <cyd@gnu.org>
1867
1868 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1869 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1870 extract the font descriptor instead of just the font name.
1871 In that case, return a font spec instead of a string.
1872 (x_last_font_name): Move to this file from xfns.c.
1873
1874 * xfns.c (Fx_select_font): The return value can also be a font
1875 spec. Move x_last_font_name management to gtkutil.c.
1876
1877 * xfaces.c: Make font weight and style symbols non-static.
1878
1879 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1880
1881 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1882 (bug#12117).
1883
1884 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1885
1886 * alloc.c (Fgarbage_collect): Use plural form consistently.
1887
1888 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1889
1890 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1891 iteration through the command loop. Fixes a problem whereby mouse
1892 movements are ignored until the first mouse click.
1893
1894 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1895
1896 Use bool, not int, for Lisp booleans.
1897 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1898 makes Emacs a bit smaller and presumably a bit faster.
1899 * lisp.h: Include <stdbool.h>.
1900 (struct Lisp_Boolfwd, defvar_bool):
1901 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1902 * regex.c [!emacs]: Include <stdbool.h>.
1903 (false, true): Remove; <stdbool.h> does this for us now.
1904
1905 2012-08-14 Chong Yidong <cyd@gnu.org>
1906
1907 * character.c (Fcharacterp): Doc fix (Bug#12076).
1908
1909 * data.c (Findirect_variable): Doc fix (Bug#11040).
1910
1911 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1912
1913 * editfns.c (Fformat): Doc fix (Bug#12059).
1914 (Fsave_current_buffer): Doc fix (Bug#11542).
1915
1916 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1917
1918 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1919 (bug#12022).
1920
1921 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1922
1923 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1924 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1925 * minibuf.c (choose_minibuf_frame, read_minibuf):
1926 * w32fns.c (x_create_tip_frame):
1927 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1928 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1929
1930 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1931
1932 * intervals.c (offset_intervals): Remove obsolete comment.
1933
1934 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1935
1936 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1937
1938 2012-08-14 Gergely Risko <gergely@risko.hu>
1939
1940 * coding.c (decode_coding): Record buffer modification before
1941 disabling undo_list (Bug#11773).
1942
1943 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1944
1945 Revert and cleanup some recent overlay changes.
1946 * buffer.h (enum overlay_type): Remove.
1947 (buffer_get_overlays, buffer_set_overlays): Likewise.
1948 (buffer_set_overlays_before, buffer_set_overlays_after):
1949 New function. Adjust users.
1950 (unchain_both): Add eassert.
1951
1952 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1953
1954 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1955
1956 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1957
1958 * gtkutil.c (xg_mark_data): Don't assume C99.
1959
1960 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1961
1962 * gtkutil.c (xg_frame_tb_info): New struct.
1963 (TB_INFO_KEY): New define.
1964 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1965 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1966 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1967 if not present.
1968 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1969 is up to date. Otherwise store new data.
1970 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1971
1972 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1973
1974 Use KSET for write access to Lisp_Object members of struct kboard.
1975 * keyboard.h (KSET): New macro.
1976 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1977 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1978 * xterm.c: Adjust users.
1979
1980 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1981
1982 Use BSET for write access to Lisp_Object members of struct buffer.
1983 * buffer.h (BSET): New macro.
1984 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1985 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1986 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1987 * window.c, xdisp.c, xfns.c: Adjust users.
1988
1989 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1990
1991 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1992
1993 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1994
1995 * nsterm.m (not_in_argv): New function.
1996 (application:openFile, application:openTempFile:):
1997 (application:openFileWithoutUI:, application:openFiles:): Open file
1998 if not_in_argv returns non-zero (bug#12171).
1999
2000 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2001 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2002 Define for Gtk+ versions less than 3.2.
2003 (xg_get_font_name): Use those functions/macros here.
2004 Reported by Frans Oilinki <moilinki@gmail.com>.
2005
2006 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2007
2008 * unexmacosx.c (copy_data_segment): Copy initialized data in
2009 statically linked libraries from input file rather than memory.
2010
2011 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2012 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2013 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2014
2015 2012-08-10 Glenn Morris <rgm@gnu.org>
2016
2017 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2018 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2019
2020 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2021
2022 Fix last change to allow compilation with low optimization levels.
2023 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2024 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2025
2026 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2027
2028 Use common inline syntax in intervals.h.
2029 * intervals.h (INTERVALS_INLINE): New macro.
2030 Change all users from LISP_INLINE.
2031
2032 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2033
2034 Define Qnone once for all platforms.
2035 * frame.c (Qnone): Define here.
2036 (syms_of_frame): DEFSYM it.
2037 * lisp.h (Qnone): New declaration.
2038 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2039 * xfns.c: Remove duplication. Adjust users.
2040
2041 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2042
2043 Remove unused macros from intervals.h.
2044 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2045 * intervals.c: Adjust comment.
2046
2047 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2048
2049 * w32fns.c <w32_unicode_gui>: New static variable.
2050 (globals_of_w32fns): Initialize it according to os_subtype.
2051 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2052 testing os_subtype.
2053
2054 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2055 Eli Zaretskii <eliz@gnu.org>
2056
2057 Fix bug #10299 with Unicode characters sent by customized
2058 keyboards created by MSKLC.
2059 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2060 (w32_init_class): Use it to initialize the Emacs class with either
2061 ANSI or Unicode API calls.
2062 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2063 later.
2064 (w32_wnd_proc): If the character code sent by WM_CHAR or
2065 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2066 original message. Call DefWindowProcW on NT and later.
2067
2068 2012-08-10 Glenn Morris <rgm@gnu.org>
2069
2070 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2071
2072 * lisp.h (DIRECTORY_SEP): Let configure set it.
2073
2074 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2075
2076 Use TSET for write access to Lisp_Object slots of struct terminal.
2077 * termhooks.h (TSET): New macro.
2078 * coding.c, terminal.c, xselect.c: Adjust users.
2079
2080 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2081
2082 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2083 the failing expression, include them in the error message.
2084 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2085 * lisp.h (internal_condition_case_n): Update declaration.
2086
2087 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2088
2089 Inline functions to examine and change buffer overlays.
2090 * buffer.c (unchain_both): New function.
2091 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2092 (buffer_has_overlays): New function.
2093 (enum overlay_type): New enum.
2094 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2095 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2096
2097 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2098
2099 Inline functions to examine and change buffer intervals.
2100 * alloc.c (mark_interval_tree): Remove.
2101 (MARK_INTERVAL_TREE): Simplify.
2102 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2103 * intervals.c (buffer_balance_intervals): New function.
2104 (graft_intervals_into_buffer): Adjust indentation.
2105 (set_intervals_multibyte): Simplify.
2106 * buffer.h (BUF_INTERVALS): Remove.
2107 (buffer_get_intervals, buffer_set_intervals): New function.
2108 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2109 * intervals.c, textprop.c: Adjust users.
2110
2111 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2112
2113 Inline functions to examine and change string intervals.
2114 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2115 (string_get_intervals, string_set_intervals): New function.
2116 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2117 * lread.c, print.c, textprop.c: Adjust users.
2118
2119 2012-08-08 Glenn Morris <rgm@gnu.org>
2120
2121 * lisp.mk (lisp): Remove language/persian.elc.
2122
2123 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2124
2125 Cleanup intervals.
2126 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2127 (NULL_INTERVAL_P): Likewise. Adjust users.
2128 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2129 Adjust comment. Move under #if 0.
2130 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2131 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2132
2133 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2134
2135 Check total length of intervals with eassert.
2136 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2137 * intervals.c: Change all users to eassert.
2138
2139 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2140
2141 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2142 Rename fields to match removal of FGET and WGET and disuse of
2143 INTERNAL_FIELD in Lisp_Cons.
2144
2145 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2146
2147 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2148 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2149 name since all xname users are fixed long time ago. Do not
2150 use INTERNAL_FIELD.
2151 (set_symbol_name, set_symbol_function, set_symbol_plist):
2152 (set_symbol_next, set_overlay_plist): New function.
2153 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2154 (struct Lisp_Overlay): Likewise.
2155 (CVAR, MVAR, SVAR): Remove.
2156 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2157 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2158 * xterm.c: Adjust users.
2159 * .gdbinit: Change to use name field of struct Lisp_Symbol
2160 where appropriate.
2161
2162 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2163
2164 Basic functions to set Lisp_Object and pointer slots of intervals.
2165 * intervals.h (interval_set_parent, interval_set_object):
2166 (interval_set_left, interval_set_right, interval_set_plist):
2167 (interval_copy_parent): New function.
2168 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2169 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2170 Adjust indentation.
2171 (INTERVAL_SIZE): Remove. Adjust users.
2172 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2173
2174 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2175
2176 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2177 * process.h (PGET): Remove.
2178 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2179 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2180
2181 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2182
2183 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2184 * window.h (WGET): Remove.
2185 (struct window): Do not use INTERNAL_FIELD.
2186 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2187 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2188 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2189 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2190 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2191 Adjust users.
2192
2193 2012-08-07 Chong Yidong <cyd@gnu.org>
2194
2195 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2196 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2197 (Fdelete_window_internal): Signal an error if the window is not on
2198 a live frame (Bug#12025).
2199
2200 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2201
2202 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2203 * frame.h (FGET): Remove.
2204 (struct frame): Do not use INTERNAL_FIELD.
2205 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2206 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2207 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2208 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2209
2210 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2211
2212 * w32.c: Silence compiler warnings.
2213 (map_w32_filename): Remove unused variable `is_fat'.
2214 (chase_symlinks): Add parentheses around expression.
2215
2216 2012-08-06 Glenn Morris <rgm@gnu.org>
2217
2218 * sysdep.c: Respect BROKEN_GETWD.
2219
2220 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2221 Let configure handle it.
2222 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2223
2224 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 Use GCALIGNMENT where appropriate.
2227 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2228 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2229 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2230
2231 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2232
2233 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2234 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2235
2236 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2237
2238 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2239 that should be sufficient for everyone.
2240
2241 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2242
2243 * keyboard.c (timer_check_2): Add break so timer_check returns next
2244 timeout.
2245
2246 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2247
2248 Fix Windows build errors introduced after converting to WGET and WSET.
2249 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2250 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2251
2252 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2253
2254 * nsterm.m (ns_frame_rehighlight): Use FSET.
2255
2256 * nsmenu.m (ns_update_menubar): Use FSET.
2257
2258 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2259
2260 Separate read and write access to Lisp_Object slots of Lisp_Process.
2261 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2262 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2263
2264 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2265
2266 Separate read and write access to Lisp_Object slots of struct window.
2267 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2268 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2269 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2270 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2271 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2272 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2273 Adjust users.
2274
2275 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2276
2277 Fix Windows build errors introduced after converting to FGET and FSET.
2278 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2279 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2280 (w32_judge_scroll_bars): Change to use FSET.
2281 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2282
2283 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2284
2285 Fix replacement typo.
2286 * window.c (replace_window): Set root_window instead of
2287 selected_window. This fixes a total window subsystem
2288 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2289
2290 2012-08-06 Glenn Morris <rgm@gnu.org>
2291
2292 * lisp.mk (lisp): Add language/persian.elc.
2293
2294 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2295
2296 Separate read and write access to Lisp_Object slots of struct frame.
2297 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2298 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2299 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2300 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2301 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2302
2303 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2304
2305 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2306
2307 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2308
2309 Generalize common compile-time constants.
2310 * lisp.h (header_size, bool_header_size, word_size): Now here.
2311 (struct Lisp_Vector): Add comment.
2312 (struct Lisp_Bool_Vector): Move up to define handy constants.
2313 (VECSIZE, PSEUDOVECSIZE): Simplify.
2314 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2315 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2316 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2317 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2318 * xfont.c, xmenu.c: Use word_size where appropriate.
2319
2320 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2321
2322 * search.c (Freplace_match): Treat \? in the replacement text
2323 literally (Bug#8161).
2324
2325 2012-08-05 Chong Yidong <cyd@gnu.org>
2326
2327 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2328 * frame.c (Vdelete_frame_functions):
2329 * emacs.c (Vkill_emacs_hook): Doc fix.
2330
2331 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2332
2333 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2334 --with-x-toolkit=no builds.
2335 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2336
2337 2012-08-04 Chong Yidong <cyd@gnu.org>
2338
2339 * syntax.c (Fmodify_syntax_entry): Doc fix.
2340
2341 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2342
2343 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2344 * w32.c (init_environment): Change the default values of many
2345 environment variables in dflt_envvars[] to NULL, to avoid pushing
2346 them into environment when they were not already defined.
2347 Remove the code that deletes site-lisp subdirectories from the default
2348 value of EMACSLOADPATH, as it is no longer needed.
2349 (check_windows_init_file): Now external, not static.
2350 Use Vload_path as is, without adding anything, as this function is now
2351 called when Vload_path is already set up.
2352
2353 * w32.h (check_windows_init_file): Add prototype.
2354
2355 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2356 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2357 compatibility with Posix platforms.
2358 (main): Move the call to check_windows_init_file to here from
2359 w32.c.
2360 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2361 any, in the DEFALT argument into the root of the Emacs build or
2362 installation tree, as appropriate.
2363
2364 * callproc.c (init_callproc_1): Call decode_env_path instead of
2365 doing its equivalent by hand.
2366 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2367 the code that sets Vexec_path run on MS-Windows.
2368
2369 * lread.c (init_lread): Add comments to #ifdef's.
2370
2371 * msdos.c (dos_set_window_size, IT_update_begin)
2372 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2373 instead of direct references.
2374
2375 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2376
2377 Export DEFAULT_REHASH_* to GDB.
2378 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2379 Now constants, not macros.
2380
2381 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2382
2383 Remove unnecessary casts involving pointers.
2384 These casts are no longer needed now that we assume C89 or later,
2385 since they involve casting to or from void *.
2386 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2387 (make_pure_float, make_pure_vector):
2388 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2389 * macros.c (Fstart_kbd_macro):
2390 * menu.c (find_and_return_menu_selection):
2391 * minibuf.c (read_minibuf_noninteractive):
2392 * sysdep.c (closedir):
2393 * xdisp.c (x_produce_glyphs):
2394 * xfaces.c (compare_fonts_by_sort_order):
2395 * xfns.c (x_real_positions, select_visual):
2396 * xselect.c (x_stop_queuing_selection_requests)
2397 (x_get_window_property, x_get_window_property_as_lisp_data):
2398 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2399 Remove unnecessary pointer casts.
2400 * alloc.c (record_xmalloc): New function.
2401 * lisp.h (record_xmalloc): New decl.
2402 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2403 more like a function. This is because the pointer cast is not
2404 needed. All uses changed.
2405 * print.c (print_string, print_error_message): Avoid length recalc.
2406
2407 Improve fix for macroexp crash with debugging (Bug#12118).
2408 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2409 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2410 not supposed to be invoked from the garbage collector.
2411 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2412 (gc_aset): New function, which is like ASET but can be
2413 used in the garbage collector.
2414 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2415 (set_hash_index): Use it instead of ASET.
2416
2417 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2418
2419 Support symlinks on latest versions of MS-Windows.
2420 * w32.c: Include winioctl.h and aclapi.h.
2421 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2422 (revert_to_self): Forward declarations of static functions.
2423 <static BOOL g_b_init_get_security_info>:
2424 <g_b_init_create_symbolic_link>: New static flags.
2425 (globals_of_w32): Initialize them to zero.
2426 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2427 (map_w32_filename): Improve commentary. Simplify switch.
2428 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2429 headers (most versions of MinGW w32api don't).
2430 (get_security_info, create_symbolic_link)
2431 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2432 New functions.
2433 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2434 in the argument file name.
2435 (sys_access): Call unc_volume_file_attributes only if
2436 GetFileAttributes fails with network-related error codes.
2437 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2438 have the required privileges.
2439 (get_file_security_desc_by_name): Rename from
2440 get_file_security_desc.
2441 (stat_worker): New function, with most of the guts of 'stat', and
2442 with addition of handling of symlinks and support for 'lstat'.
2443 If possible, get file's attributes and security information by
2444 handle, not by name. Produce S_IFLNK bit for symlinks, when
2445 called from 'lstat'.
2446 (stat, lstat): New functions, call 'stat_worker'.
2447 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2448 symlinks when the underlying filesystem supports them.
2449
2450 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2451
2452 Fix macroexp crash on Windows with debugging (Bug#12118).
2453 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2454 checking subscripts; problem introduced with the recent
2455 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2456 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2457 since it's used in non-static inline functions now.
2458
2459 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2460 Don't assume buffer size fits in 'int'. Remove unused local.
2461
2462 Use C99-style 'extern inline' if available.
2463 * buffer.h (BUFFER_INLINE):
2464 * category.h (CATEGORY_INLINE):
2465 * character.h (CHARACTER_INLINE):
2466 * charset.h (CHARSET_INLINE):
2467 * composite.h (COMPOSITE_INLINE):
2468 * dispextern.h (DISPEXTERN_INLINE):
2469 * lisp.h (LISP_INLINE):
2470 * systime.h (SYSTIME_INLINE):
2471 New macro, replacing 'static inline' in this header.
2472 * buffer.h, category.h, character.h, charset.h, composite.h:
2473 * dispextern.h, lisp.h, systime.h:
2474 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2475 * alloc.c (LISP_INLINE):
2476 * buffer.c (BUFFER_INLINE):
2477 * category.c (CATEGORY_INLINE):
2478 * character.c (CHARACTER_INLINE):
2479 * charset.c (CHARSET_INLINE):
2480 * composite.c (COMPOSITE_INLINE):
2481 * dispnew.c (DISPEXTERN_INLINE):
2482 * sysdep.c (SYSTIME_INLINE):
2483 Define to EXTERN_INLINE, so that the corresponding functions
2484 are compiled into code.
2485 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2486 (INLINE_HEADER_END): New macros.
2487 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2488 since it's used in non-static inline functions now.
2489 (VALMASK) [!USE_LSB_TAG]: Likewise.
2490
2491 2012-08-02 Glenn Morris <rgm@gnu.org>
2492
2493 * s/: Remove empty directory.
2494
2495 * s/ms-w32.h: Move to ../nt/inc.
2496 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2497 Update for new ms-w32.h location.
2498
2499 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2500
2501 Port to Solaris 8.
2502 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2503
2504 2012-08-02 Glenn Morris <rgm@gnu.org>
2505
2506 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2507 hard-coding the path separator.
2508
2509 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2510
2511 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2512 This how ASET and AREF are supposed to work, and makes
2513 it easier to think about future improvements. See
2514 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2515 * charset.h (set_charset_attr): New function.
2516 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2517 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2518 (aref_addr): New function. All uses of &AREF(...) changed.
2519 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2520 (set_hash_index): New functions. All lvalue-style uses of
2521 HASH_KEY etc. changed.
2522 * keyboard.c (set_prop): New function. All lvalue-style uses
2523 of PROP changed.
2524
2525 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2526
2527 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2528 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2529 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2530 * nsfns.m (ns_set_name_as_filename): Likewise.
2531 * nsmenu.m (ns_update_menubar): Likewise.
2532 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2533
2534 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2535
2536 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2537 Adapt to latest changes in field names of the corresponding Lisp
2538 objects.
2539
2540 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2541
2542 2012-08-01 Glenn Morris <rgm@gnu.org>
2543
2544 * s/msdos.h: Remove file.
2545 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2546 * Makefile.in (S_FILE): Remove.
2547 (config_h): Remove S_FILE.
2548
2549 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2550
2551 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2552 Remove; moved to nt/config.nt.
2553
2554 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2555
2556 Use INTERNAL_FIELD for conses and overlays.
2557 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2558 Remove obsolete comment.
2559 (MVAR): New macro.
2560 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2561 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2562
2563 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2564
2565 Use INTERNAL_FIELD for symbols.
2566 * lisp.h (SVAR): New macro. Adjust users.
2567 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2568 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2569
2570 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2571
2572 Use INTERNAL_FIELD for processes.
2573 * process.h (PVAR): New macro. Adjust style.
2574 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2575 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2576
2577 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2578
2579 Use INTERNAL_FIELD for windows.
2580 * window.h (WVAR): New macro.
2581 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2582 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2583 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2584 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2585 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2586 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2587
2588 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2589
2590 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2591
2592 2012-08-01 Glenn Morris <rgm@gnu.org>
2593
2594 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2595 Move to configure.ac.
2596
2597 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2598
2599 * makefile.w32-in (CONFIG_H): Update dependencies.
2600 (CONF_POST_H): New macro.
2601
2602 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2603
2604 2012-07-31 Glenn Morris <rgm@gnu.org>
2605
2606 * Makefile.in (S_FILE): No longer set by configure.
2607
2608 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2609 is available.
2610 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2611
2612 * process.h (NULL_DEVICE):
2613 * emacs.c (SEPCHAR):
2614 * editfns.c (USER_FULL_NAME): Let configure set them.
2615
2616 * s/README, s/template.h: Remove files.
2617
2618 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2619
2620 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2621 Move to configure.ac.
2622
2623 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2624
2625 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2626 resulting renaming of 'struct frame' members.
2627
2628 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2629
2630 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2631 after introduction of FVAR.
2632
2633 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2634
2635 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2636
2637 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2638 instead of compositeToPoint.
2639 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2640
2641 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2642
2643 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2644
2645 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2646 * lisp.h (INTERNAL_FIELD): New macro.
2647 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2648 (BVAR): Change to use INTERNAL_FIELD.
2649 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2650 (KVAR): Change to use INTERNAL_FIELD.
2651 * frame.h (FVAR): New macro.
2652 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2653 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2654 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2655 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2656 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2657
2658 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2659
2660 Miscellaneous fixes for non-default X toolkits.
2661 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2662 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2663 Move under #ifdef USE_LUCID.
2664 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2665 definition and usage to avoid warnings.
2666
2667 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2668
2669 * nsterm.m (openFiles): Fix previous checkin.
2670
2671 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2672
2673 * indent.c (compute_motion): Remove unused local.
2674
2675 2012-07-31 Glenn Morris <rgm@gnu.org>
2676
2677 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2678
2679 * conf_post.h [USG5_4]:
2680 Move remaining contents of s/usg5-4-common.h here.
2681 * s/usg5-4-common.h: Remove file.
2682
2683 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2684 * s/irix6-5.h: Remove file.
2685
2686 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2687 * s/darwin.h: Remove file.
2688
2689 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2690 * s/hpux10-20.h: Remove file, which is now empty.
2691
2692 2012-07-30 Glenn Morris <rgm@gnu.org>
2693
2694 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2695 * Makefile.in (config_h): Add conf_post.h.
2696 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2697
2698 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2699
2700 * nsterm.m (ns_do_open_file): New variable.
2701 (ns_term_init): Set ns_do_open_file to YES after run returns.
2702 (openFile, openTempFile, openFileWithoutUI, openFiles):
2703 Open files only if ns_do_open_file.
2704
2705 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2706
2707 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2708 This no-op macro hasn't been needed for many years.
2709 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2710
2711 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2712 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2713 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2714 gdb_make_enums_visible.
2715 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2716 (DIRECTORY_SEP): Now a constant, not a macro.
2717
2718 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2719
2720 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2721 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2722
2723 * w32term.c <w32_keyboard_codepage>: Renamed from
2724 keyboard_codepage and now external. All users changed.
2725
2726 * w32term.h: Add declaration of w32_keyboard_codepage.
2727
2728 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2729 the codepage to translate keys to Unicode. If this argument is
2730 -1, use the value returned by GetConsoleCP. All callers changed.
2731
2732 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2733
2734 Update .PHONY listings in makefiles.
2735 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2736 bootstrap-clean, distclean, maintainer-clean, versioclean,
2737 extraclean, frc.
2738
2739 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2740 This is a bit clearer. Fix some commentary typos.
2741
2742 2012-07-30 Glenn Morris <rgm@gnu.org>
2743
2744 * s/netbsd.h: Let configure include signal.h if needed.
2745 Remove file, which is now empty.
2746
2747 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2748 Let configure set them.
2749 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2750 No more need to undefine.
2751
2752 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2753
2754 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2755 non-single-byte char when adding meta modifier. (Bug#12090)
2756
2757 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2758
2759 Convert safe_call to use variable number of arguments.
2760 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2761 (safe_call2): Fix comment.
2762 * lisp.h (safe_call): Adjust prototype.
2763 * coding.c (encode_coding_object): Change to use safe_call2.
2764 * xfaces.c (merge_face_heights): Change to use safe_call1.
2765
2766 2012-07-30 Glenn Morris <rgm@gnu.org>
2767
2768 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2769 does that unconditionally. Remove file, which is now empty.
2770
2771 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2772 Remove empty files.
2773
2774 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2775
2776 Export to GDB most of lisp.h's remaining object-like macros.
2777 * lisp.h (min, max): Move earlier, because they're used earlier now.
2778 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2779 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2780 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2781 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2782 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2783 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2784 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2785 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2786 Now constants, for GDB. They need not be macros.
2787 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2788 Now constants, for GDB, as well as macros, for static initializers.
2789 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2790 Move to after the definition of struct Lisp_Char_Table,
2791 since the former now needs that type defined.
2792 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2793 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2794 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2795 New enums, for gdb_make_enums_visible.
2796 (GLYPH_MODE_LINE_FACE): Remove; unused.
2797 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2798 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2799 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2800 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2801 enum maxargs, enum MAX_ALLOCA.
2802 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2803 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2804 no longer needed, now that they are done in lisp.h.
2805
2806 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2807
2808 Cleanup string bytes checking.
2809 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2810 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2811 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2812 (check_sblock, compact_small_strings): Simplify.
2813
2814 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2815
2816 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2817 These macros are confusing and no longer need to be defined, as
2818 the enum values now suffice. All uses replaced with definiens.
2819 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2820
2821 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2822
2823 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2824 ($(BLD)/w32console.$(O)): Update dependencies.
2825
2826 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2827
2828 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2829 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2830 time. Adjust users.
2831 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2832
2833 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2834
2835 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2836 setting sitelisp (Bug#12010).
2837
2838 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2839
2840 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2841
2842 * w32heap.c (cache_system_info):
2843 * w32.c (sys_rename):
2844 * w32proc.c (find_child_console, sys_kill): All users changed.
2845
2846 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2847
2848 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2849
2850 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2851
2852 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2853
2854 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2855
2856 Cleanup statistics calculation in Fgarbage_collect.
2857 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2858 Fix zombies percentage calculation. Simplify elapsed time calculation.
2859
2860 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2861
2862 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2863 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2864 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2865 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2866 (replace_range, replace_range_2, del_range_2): Change to eassert.
2867 * marker.c (byte_char_debug_check): Adjust style.
2868
2869 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2870
2871 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2872 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2873 long-ago-commented-out code that talks about "WIN32".
2874 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2875 All uses changed.
2876
2877 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2878
2879 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2880 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2881 Simplify by using alignof.
2882 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2883 * lisp.h: Include <stdalign.h>.
2884 (GCALIGNMENT): New macro and constant.
2885 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2886 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2887 (stdalign): New macro, if not already defined.
2888
2889 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2890
2891 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2892 * w32inevt.c: Include w32inevt.h.
2893 (w32_read_console_input): New inline function, calls either
2894 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2895 w32_console_unicode_input.
2896 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2897 (w32_kbd_patch_key, key_event): Use the codepage returned by
2898 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2899 (key_event): use uChar.UnicodeChar only if
2900 w32_console_unicode_input is non-zero.
2901
2902 * w32console.c: Include w32heap.h.
2903 <w32_console_unicode_input>: New global variable.
2904 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2905 family of Windows, zero otherwise.
2906
2907 * w32inevt.h: Declare w32_console_unicode_input.
2908
2909 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2910 --without-x. (Bug#11742)
2911
2912 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2913
2914 Adjust GDB to reflect pvec_type changes (Bug#12036).
2915 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2916 2012-07-04 changes to pseudovector representation.
2917 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2918
2919 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2920
2921 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2922 bus address.
2923 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2924
2925 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2926
2927 * alloc.c (listn): Fix the order the arguments are consed onto the
2928 list.
2929
2930 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2931 enumeration constants, as PURE and HEAP are too general, and clash
2932 with other headers and sources, such as gmalloc.c and the
2933 MS-Windows system headers. All users changed.
2934
2935 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2936
2937 Revert last save_excursion_save and save_excursion_restore changes.
2938 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2939 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2940
2941 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2942
2943 Fix recently-introduced typos in Windows port.
2944 Reported by Martin Rudalics <rudalics@gmx.at>.
2945 * w32.c (init_environment): Replace comma with semicolon.
2946 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2947
2948 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2949
2950 Improve GDB symbol export (Bug#12036).
2951 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2952 arms of an 'if', not using conditional expressions; otherwise GDB
2953 complains about the types in the unevaluated arm when the argument
2954 is an integer literal.
2955 (xgetint): Simplify expression.
2956 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2957 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2958 Zaretskii in <http://bugs.gnu.org/12036#13>.
2959 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2960 needed now that we have gdb_make_enums_visible.
2961 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2962 (enum enum_USE_LSB_TAG):
2963 New enum types, packaging up enums that need to be exported to GDB.
2964
2965 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2966
2967 Utility function to make a list from specified amount of objects.
2968 * lisp.h (enum constype): New datatype.
2969 (listn): New prototype.
2970 * alloc.c (listn): New function.
2971 (Fmemory_use_count, syms_of_alloc): Use it.
2972 * buffer.c (syms_of_buffer): Likewise.
2973 * callint.c (syms_of_callint): Likewise.
2974 * charset.c (define_charset_internal): Likewise.
2975 * coding.c (syms_of_coding): Likewise.
2976 * keymap.c (syms_of_keymap): Likewise.
2977 * search.c (syms_of_search): Likewise.
2978 * syntax.c (syms_of_syntax): Likewise.
2979 * w32.c (init_environment): Likewise.
2980 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2981 * xdisp.c (syms_of_xdisp): Likewise.
2982 * xfns.c (syms_of_xfns): Likewise.
2983
2984 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2985
2986 Fast save_excursion_save and save_excursion_restore.
2987 * lisp.h (struct Lisp_Excursion): New data type.
2988 (PVEC_EXCURSION): New pseudovector type.
2989 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2990 to deal with it. Adjust comments.
2991 (init_marker, attach_marker): New prototype.
2992 (unchain_marker): Adjust prototype.
2993 * marker.c (attach_marker): Change to global.
2994 (init_marker): New function.
2995 * alloc.c (Fmake_marker, build_marker): Use it.
2996 (build_marker): More easserts.
2997 (mark_object): Handle struct Lisp_Excursion.
2998 * editfns.c (save_excursion_save, save_excursion_restore):
2999 Reimplement to use struct Lisp_Excursion. Add comments.
3000
3001 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3002
3003 Fix export of symbols to GDB (Bug#12036).
3004 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3005 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3006 emacs.c, as this is a more-suitable home. Had this been done earlier
3007 the fix for 12036 would have avoided some of the problems noted in
3008 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3009 would have been more obvious.
3010 * emacs.c: Do not include <verify.h>; no longer needed.
3011 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3012 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3013 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3014 Remove; now done in lisp.h.
3015 * lisp.h (PUBLISH_TO_GDB): New macro.
3016 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3017 (DATA_SEG_BITS): Use it.
3018 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3019 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3020 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3021 not be usable in #if. This simplifies things.
3022
3023 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3024
3025 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3026
3027 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3028
3029 Simplify export of symbols to GDB (Bug#12036).
3030 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3031 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3032 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3033 Adjust to changes in lisp.h and emacs.c, by using
3034 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3035 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3036 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3037 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3038 instead of gdb_valbits.
3039 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3040 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3041 instead of gdb_array_mark_flag.
3042 (xboolvector): Get size from $->size, not $->header.size.
3043 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3044 (xreload, hook-run, hookpost-run): Remove.
3045 * emacs.c: Include <verify.h>.
3046 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3047 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3048 Remove.
3049 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3050 (gdb_USE_LSB_TAG): New enum constants.
3051 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3052 Also define these as enum constants, so they're visible to GDB.
3053 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3054 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3055 as constants, so they're visible to GDB.
3056 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3057 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3058 Now enum constants, not macros, so they're visible to GDB.
3059 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3060 more convenient now. All uses changed.
3061 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3062 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3063
3064 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3065
3066 Explicitly free restriction data that are not needed anymore.
3067 * editfns.c (save_restriction_restore): Free restriction data.
3068
3069 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3070
3071 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3072 add argument, tune behavior, and adjust all callers.
3073
3074 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3075
3076 Use typedef for EMACS_INT, EMACS_UINT.
3077 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3078 than macros. This simplifies debugging in the usual case, since
3079 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3080 and it allows expressions involving EMACS_INT casts.
3081 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3082
3083 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3084
3085 * nsterm.m (ns_read_socket): Return early if there is a modal
3086 window (Bug#12043).
3087
3088 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3089
3090 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3091 that FOCUS-FRAME can be omitted.
3092
3093 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3094
3095 Adjust buffer text indirection counters at the end of Fkill_buffer.
3096 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3097 buffer is definitely dead. This should really fix an issue reported
3098 by Christoph Scholtes again. (Bug#12007).
3099 (init_buffer_once): Initialize indirection counters of
3100 buffer_defaults and buffer_local_symbols (for sanity and safety).
3101
3102 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3103
3104 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3105 and continuation glyphs on tooltip frames, leave them at zero.
3106 Avoids continued lines in tooltips. (Bug#11832)
3107
3108 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3109
3110 Simplify copy_overlay.
3111 * buffer.c (copy_overlay): Simplify. Use build_marker.
3112 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3113
3114 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3115
3116 * print.c (print_object): Don't crash when a frame's name is nil
3117 or invalid. (Bug#12025)
3118
3119 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3120 it signals an error when a tooltip frame is being created.
3121
3122 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3123
3124 Cleanup miscellaneous objects allocation and initialization.
3125 * alloc.c (allocate_misc): Change to static. Add argument to
3126 specify the subtype. Adjust comment and users.
3127 (build_overlay): New function.
3128 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3129 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3130 (allocate_misc): Remove prototype.
3131 (build_overlay): Add prototype.
3132
3133 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3134
3135 Swap buffer text indirection counters in Fbuffer_swap_text.
3136 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3137 This avoids crash reported by Christoph Scholtes at
3138 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3139
3140 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3141
3142 * nsmenu.m (Popdown_data): New struct.
3143 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3144 free Popdown_data.
3145 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3146 (initWithContentRect): Make imgView and contentView non-static
3147 and autorelease them. Also autorelease img and matrix (Bug#12005).
3148 (dealloc): Remove (Bug#12005).
3149
3150 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3151
3152 Adjust consing_since_gc when objects are explicitly freed.
3153 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3154 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3155 (free_cons, free_misc): Subtract object size from consing_since_gc.
3156
3157 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3158
3159 Simplify and cleanup markers positioning code.
3160 * marker.c (attach_marker): More useful eassert.
3161 (live_buffer, set_marker_internal): New function.
3162 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3163 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3164
3165 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3166
3167 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3168 as it's limited by the amount of memory, not by INT_MAX.
3169
3170 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3171
3172 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3173 in special-event-map. See the discussion at
3174 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3175 for the reasons.
3176
3177 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3178 info.dwItemData. Fixes crashes on 64-bit Windows.
3179 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3180
3181 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3182
3183 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3184 (conversationIdentifier): Return value is NSInteger.
3185 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3186
3187 2012-07-21 Chong Yidong <cyd@gnu.org>
3188
3189 * window.c (decode_any_window): Signal an error if the window is
3190 on a dead frame (Bug#11984).
3191
3192 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3193
3194 Add indirection counting to speed up Fkill_buffer.
3195 * buffer.h (struct buffer): New member.
3196 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3197 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3198 base buffer indirection counter.
3199 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3200 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3201 through buffer list if indirection counter is 0.
3202
3203 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3204
3205 Extend the value returned by Fgarbage_collect with heap statistics.
3206 * alloc.c (Qheap): New symbol.
3207 (syms_of_alloc): DEFSYM it.
3208 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3209 (Fmemory_free): Remove.
3210 (syms_of_alloc): Don't defsubr it.
3211 * buffer.c (Fcompact_buffer): Remove.
3212 (syms_of_buffer): Don't defsubr it.
3213
3214 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3215
3216 Make maybe_gc inline.
3217 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3218 * lisp.h (consing_since_gc, gc_relative_threshold)
3219 (memory_full_cons_threshold): Revert declaration.
3220 (maybe_gc): Remove prototype, define as inline.
3221 * alloc.c: Remove old commented-out code.
3222 (consing_since_gc, gc_relative_threshold)
3223 (memory_full_cons_threshold): Revert to global.
3224 (maybe_gc): Remove.
3225
3226 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3227
3228 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3229 * lisp.h (build_unibyte_string): New function.
3230 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3231 * sysdep.c, w32fns.c, xfns.c: Use it.
3232 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3233 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3234 Adjust users accordingly.
3235 * font.h (font_open_by_name): Adjust prototype.
3236
3237 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3238
3239 Cleanup calls to Fgarbage_collect.
3240 * lisp.h (maybe_gc): New prototype.
3241 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3242 Remove declarations.
3243 * alloc.c (maybe_gc): New function.
3244 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3245 Make them static.
3246 * bytecode.c (MAYBE_GC): Use maybe_gc.
3247 * eval.c (eval_sub, Ffuncall): Likewise.
3248 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3249 to avoid dependency from auto-save feature.
3250
3251 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3252
3253 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3254 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3255 'for_each_per_buffer_object_at'.
3256 All uses changed. It's better to use upper-case for macros that
3257 cannot be implemented as functions, to give the reader a clue
3258 that they're special.
3259
3260 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3261
3262 * alloc.c (Fgarbage_collect): Tweak docstring.
3263
3264 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3265
3266 Tweak the value returned from Fgarbage_collect again.
3267 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3268 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3269 Adjust documentation.
3270 (total_vector_bytes): Rename to total_vector_slots, adjust
3271 accounting.
3272 (total_free_vector_bytes): Rename to total_free_vector_slots,
3273 adjust accounting.
3274 (Qstring_bytes, Qvector_slots): New symbols.
3275 (syms_of_alloc): DEFSYM them.
3276
3277 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3278
3279 Buffer compaction primitive which may be used from Lisp.
3280 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3281 (syms_of_buffer): Register Fcompact_buffer.
3282 * alloc.c (Fgarbage_collect): Use compact_buffer.
3283 * buffer.h (compact_buffer): New prototype.
3284 (struct buffer_text): New member.
3285
3286 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3287
3288 New macro to iterate over all buffers, miscellaneous cleanups.
3289 * lisp.h (all_buffers): Remove declaration.
3290 * buffer.h (all_buffers): Add declaration, with comment.
3291 (for_each_buffer): New macro.
3292 * alloc.c (Fgarbage_collect, mark_object): Use it.
3293 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3294 (init_buffer): Likewise.
3295 * data.c (Fset_default): Likewise.
3296 * coding.c (code_conversion_restore): Remove redundant check
3297 for dead buffer.
3298 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3299
3300 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3301
3302 Fix bug that created negative-length intervals.
3303 * intervals.c (merge_interval_right, merge_interval_left):
3304 Do not zero out this interval if it is absorbed by its children,
3305 as this interval's total length doesn't change in that case. See
3306 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3307
3308 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3311 when invoking (make-bool-vector N t) and N is a positive
3312 multiple of 8 -- the last 8 bits were mistakenly cleared.
3313
3314 Remove some struct layout assumptions in bool vectors.
3315 * alloc.c (bool_header_size): New constant.
3316 (header_size, word_size): Move earlier, as they're now used earlier.
3317 Use 'word_size' in a few more places, where it's appropriate.
3318 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3319 padding before the data member of a bool vector.
3320 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3321 than doing the check by hand with an abort ().
3322
3323 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3324
3325 * eval.c (Fdefvar): Don't check constants since we only set the var if
3326 it's not yet defined anyway (bug#11904).
3327
3328 * lisp.h (last_undo_boundary): Declare new var.
3329 * keyboard.c (command_loop_1): Set it.
3330 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3331 were auto-added by the command loop (bug#11774).
3332
3333 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3334
3335 * w32font.c (Qsymbol): Remove local definition.
3336 (syms_of_w32font): Don't DEFSYM it.
3337
3338 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3339
3340 Fix sweep_vectors to handle large bool vectors correctly.
3341 * alloc.c (sweep_vectors): Account total_vector_bytes for
3342 bool vectors larger than VBLOCK_BYTES_MAX.
3343
3344 2012-07-18 Chong Yidong <cyd@gnu.org>
3345
3346 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3347 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3348
3349 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3350
3351 Return more descriptive data from Fgarbage_collect.
3352 Suggested by Stefan Monnier in
3353 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3354 * alloc.c (bounded_number): New function.
3355 (total_buffers, total_vectors): New variable.
3356 (total_string_size): Rename to total_string_bytes, adjust users.
3357 (total_vector_size): Rename to total_vector_bytes, adjust users.
3358 (sweep_vectors): Account total_vectors and total_vector_bytes.
3359 (Fgarbage_collect): New return value. Adjust documentation.
3360 (gc_sweep): Account total_buffers.
3361 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3362 (VECTOR_SIZE): Remove.
3363 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3364 (Qinterval, Qmisc): New symbols.
3365 (syms_of_data): Initialize them.
3366 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3367 (Qcons, Qbuffer): New declarations.
3368
3369 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3370
3371 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3372 Round up, not down. Improve doc.
3373
3374 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3375
3376 Restore old code in allocate_string_data to avoid Faset breakage.
3377 Reported by Julien Danjou <julien@danjou.info> in
3378 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3379 * alloc.c (allocate_string_data): Restore old code with minor
3380 adjustments, fix comment to explain this subtle issue.
3381
3382 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3383
3384 Remove FILE_SYSTEM_CASE.
3385 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3386
3387 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3388 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3389 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3390 call-process-region passes it through expand-file-name.
3391
3392 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3393
3394 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3395
3396 Fix crash when creating indirect buffer (Bug#11917)
3397 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3398 Don't handle unbound variables specially if non-zero.
3399 (Fbuffer_local_variables): Pass zero.
3400 (clone_per_buffer_values): Pass non-zero.
3401
3402 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3403
3404 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3405 to make the loop interruptible.
3406
3407 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3408
3409 * gnutls.c (emacs_gnutls_handshake): Only retry if
3410 GNUTLS_E_INTERRUPTED.
3411
3412 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3413
3414 Cleanup and convert miscellaneous checks to eassert.
3415 * alloc.c (mark_interval): Fix comment, partially rephrase
3416 old comment from intervals.h (see below).
3417 * intervals.c (find_interval, adjust_intervals_for_insertion)
3418 (delete_interval, adjust_intervals_for_deletion)
3419 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3420 Convert to eassert.
3421 (adjust_intervals_for_insertion, make_new_interval):
3422 Remove obsolete and unused code.
3423 * intervals.h (struct interval): Remove obsolete comment.
3424 * textprotp.c (erase_properties): Remove unused code.
3425 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3426 (Fremove_list_of_text_properties): Convert to eassert.
3427
3428 2012-07-17 Chong Yidong <cyd@gnu.org>
3429
3430 * editfns.c (Finsert_char): Doc fix.
3431
3432 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3433
3434 Fix previous change to make Fmemory_free always accurate.
3435 * alloc.c (make_interval): Update total_free_intervals.
3436 (make_float): Likewise for total_free_floats.
3437 (free_cons, Fcons): Likewise for total_free_conses.
3438 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3439 Likewise for total_free_vector_bytes.
3440 (Fmake_symbol): Likewise for total_free_symbols.
3441 (bytes_free): Remove.
3442
3443 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3444
3445 Simple free memory accounting feature.
3446 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3447 (sweep_vectors): Accumulate size of free vectors.
3448 (Fgarbage_collect): Setup bytes_free.
3449 (Fmemory_free): New function.
3450 (syms_of_alloc): Register it.
3451
3452 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3453
3454 Cleanup overlays checking.
3455 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3456 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3457 eassert and OVERLAYP.
3458 (sort_overlays): Change to use OVERLAYP.
3459
3460 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3461
3462 * editfns.c (Finsert_char): Make it interactive, and make the
3463 second arg optional. Copy interactive spec and docstring from
3464 ucs-insert.
3465
3466 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3467
3468 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3469 Unlike the other wrapped functions, fabs has an unspecified
3470 effect on errno.
3471
3472 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3473
3474 * nsterm.m (keyDown): Interpret flags without left/right bits
3475 as the left key (Bug#11670).
3476
3477 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3478
3479 Remove empty and useless init functions.
3480 * lisp.h (init_character_once, init_fns, init_image)
3481 (init_filelock, init_sound): Remove prototype.
3482 * character.c (init_character_once): Remove.
3483 * filelock.c (init_filelock): Likewise.
3484 * fns.c (init_fns): Likewise.
3485 * image.c (init_image): Likewise.
3486 * sound.c (init_sound): Likewise.
3487 * emacs.c (main): Adjust accordingly.
3488
3489 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3490
3491 * gtkutil.h: Tiny cleanups.
3492 (use_old_gtk_file_dialog): Remove useless declaration.
3493 (xg_uses_old_file_dialog): Add suggested const attribute.
3494
3495 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3496
3497 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3498 (bidi_paragraph_init): Use it to limit search forward for a strong
3499 directional character in abnormally large paragraphs full of
3500 neutral or weak characters. (Bug#11943)
3501
3502 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3503
3504 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3505 the toolbar (Bug#9451).
3506 (xg_make_tool_item): Give the widget event box a transparent
3507 background.
3508
3509 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3510
3511 Cleanup basic allocation variables and functions.
3512 * alloc.c (ignore_warnings, init_intervals, init_float)
3513 (init_cons, init_symbol, init_marker): Remove.
3514 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3515 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3516 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3517 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3518 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3519 (staticidx, init_alloc_once, init_strings, free_ablock):
3520 Remove redundant initialization.
3521 * fns.c (init_weak_hash_tables): Remove.
3522 * lisp.h (init_weak_hash_tables): Remove prototype.
3523
3524 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3525
3526 Use zero_vector where appropriate.
3527 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3528 accordingly.
3529 * lisp.h (zero_vector): New declaration.
3530 * font.c (null_vector): Remove.
3531 (syms_of_font): Remove initialization and staticpro.
3532 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3533 * keymap.c (Faccessible_keymaps): Likewise.
3534
3535 2012-07-15 Leo Liu <sdl.web@gmail.com>
3536
3537 * fringe.c: Fix typo in comments.
3538
3539 2012-07-14 Leo Liu <sdl.web@gmail.com>
3540
3541 * fringe.c: Add a new bitmap exclamation-mark.
3542
3543 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3544
3545 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3546
3547 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3548 (HAVE_MENUS): Don't define, defined by editing config.in with
3549 msdos/sed2v2.inp.
3550 (GMALLOC_INHIBIT_VALLOC): Don't define.
3551 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3552
3553 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3554
3555 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3556
3557 2012-07-14 Glenn Morris <rgm@gnu.org>
3558
3559 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3560 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3561 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3562
3563 2012-07-13 Glenn Morris <rgm@gnu.org>
3564
3565 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3566
3567 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3568 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3569
3570 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3571
3572 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3573 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3574 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3575 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3576 where appropriate.
3577 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3578 as boolean expression.
3579 (x_set_window_size): Remove unused variable toolbar.
3580 (ns_get_color_default, ns_mod_to_lisp): Remove.
3581 (ns_mouse_position): Remove unused variables xchar and ychar.
3582 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3583 (ns_set_vertical_scroll_bar): Remove unused variable count.
3584 (ns_delete_terminal): Remove unused variable i.
3585 (ns_term_init): Remove unused variables r, g and b.
3586 (mouseDown): Remove unused variable window.
3587 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3588 (initFrameFromEmacs): Remove unused variable vbextra.
3589 (mouseEntered): Remove unused variables p and dpyinfo.
3590 (mouseExited): Remove unused variables p and r.
3591 (ns_define_frame_cursor, ns_clear_frame_area)
3592 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3593 (menuDown): Assign [sender tag] to variable and cast the variable.
3594
3595 * nsterm.h (menuDown): Add id as type to argument sender.
3596 (ns_display_info_for_name): Add Lisp_Object argument.
3597 (ns_term_init): Add Lisp_Object argument.
3598 (ns_map_event_to_object): Add void argument.
3599 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3600 prototype with arguments and only declare if __OBJC__.
3601 (nxatoms_of_nsselect): Add void argument.
3602 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3603 (ns_alloc_autorelease_pool): Add void argument.
3604 (ns_release_autorelease_pool): Add void* argument.
3605 (ns_get_defaults_value): Add const char* argument.
3606
3607 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3608 (initFromContents): Use SSDATA where appropriate.
3609 (ns_update_menubar): Add braces to ambigous if-else.
3610 (initWithTitle): Put () around assignment in if statement.
3611 (ns_menu_show): Remove unused variables window and keymap.
3612 (update_frame_tool_bar): Remove unused variable selected_p.
3613 (initWithContentRect): Remove unused variable this_cmd_name.
3614
3615 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3616 appropriate.
3617 (setXBMColor): Remove unused variable len.
3618 (setPixmapData): Put () around assignment in loop statement.
3619
3620 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3621 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3622 where appropriate.
3623 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3624 around assignment in loop statement.
3625 (nsfont_open): Remove unused variable i.
3626 (nsfont_open): Remove unused variable len.
3627 (nsfont_draw): Remove unused variable cs.
3628
3629 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3630 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3631 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3632 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3633 (Fns_font_name, Fns_perform_service)
3634 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3635 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3636 (ns_set_name): Remove unused variable view.
3637 (x_set_menu_bar_lines): Remove unused variable olines.
3638 (x_set_tool_bar_lines): Remove unused variable root_window.
3639 (Fns_list_colors): Put () around assignment in while statement.
3640 (Fns_perform_service): Remove unused variable len.
3641 (Fns_display_usable_bounds): Remove unused variable top.
3642 (syms_of_nsfns): Remove unused variable i.
3643
3644 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3645 memcpy (Bug#11907).
3646
3647 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3648
3649 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3650 and free it with DestroyExceptionInfo (Bug#11558).
3651
3652 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3653
3654 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3655 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3656 Set here, not in nt/config.nt.
3657
3658 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3659
3660 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3661 cursor overflow into the last glyph on display line when the right
3662 fringe is off. (Bug#11832)
3663
3664 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3665
3666 * xdisp.c (produce_special_glyphs): Now static.
3667 * dispextern.h (produce_special_glyphs): Remove decl.
3668
3669 2012-07-13 Glenn Morris <rgm@gnu.org>
3670
3671 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3672 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3673
3674 * s/usg5-4-common.h (USG, USG5):
3675 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3676 * s/sol2-6.h (SOLARIS2):
3677 * s/irix6-5.h (IRIX6_5):
3678 * s/hpux10-20.h (USG, USG5, HPUX):
3679 * s/gnu-linux.h (USG, GNU_LINUX):
3680 * s/freebsd.h (BSD_SYSTEM):
3681 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3682 * s/cygwin.h (CYGWIN):
3683 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3684 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3685
3686 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3687
3688 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3689
3690 2012-07-13 Glenn Morris <rgm@gnu.org>
3691
3692 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3693
3694 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3695
3696 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3697 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3698
3699 2012-07-12 Glenn Morris <rgm@gnu.org>
3700
3701 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3702
3703 * process.c (init_process_emacs): Rename from init_process.
3704 The old name is also the name of a Mach system call.
3705 * lisp.h, emacs.c: Update for this name change.
3706 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3707 longer needed.
3708
3709 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3710
3711 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3712 memmove call that removes glyphs covered by the left truncation
3713 glyph. Improve commentary.
3714 (display_line): Fix display of continuation glyphs on GUI frames
3715 when the right fringe is turned off and variable-size fonts are
3716 used in the window. Move the code that appends a stretch glyph to
3717 produce_special_glyphs, so that it could be used for truncation
3718 and continuation glyphs alike.
3719 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3720 glyph of a suitably computed width, to align the special glyphs at
3721 the window margin. Code moved from display_line. (Bug#11832)
3722
3723 2012-07-12 Glenn Morris <rgm@gnu.org>
3724
3725 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3726
3727 * s/gnu-linux.h, s/hpux10-20.h:
3728 Do not unconditionally define HAVE_XRMSETDATABASE.
3729
3730 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3731
3732 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3733
3734 Fix typos that broke OS X build.
3735 Reported by Randal L. Schwartz in
3736 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3737 * nsterm.m (ns_timeout): Add missing local decl.
3738 (ns_get_color): snprintf -> sprintf, to fix typo.
3739
3740 2012-07-12 Glenn Morris <rgm@gnu.org>
3741
3742 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3743 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3744 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3745 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3746
3747 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3748 Move PTY_OPEN to configure.
3749
3750 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3751 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3752 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3753
3754 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3755
3756 Use empty_unibyte_string where applicable.
3757 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3758 * lread.c (read1): Likewise.
3759 * xsettings.c (syms_of_xsettings): Likewise.
3760
3761 2012-07-12 Glenn Morris <rgm@gnu.org>
3762
3763 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3764 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3765 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3766 * s/hpux10-20.h (RUN_TIME_REMAP):
3767 * s/bsd-common.h (TABDLY): Move to configure.
3768
3769 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3770
3771 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3772
3773 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3774 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3775
3776 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3777
3778 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3779 * s/template.h: Move NARROWPROTO to configure.
3780
3781 2012-07-11 Glenn Morris <rgm@gnu.org>
3782
3783 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3784 unused since 2011-01-17 change to systty.h.
3785
3786 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3787 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3788 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3789
3790 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3791
3792 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3793
3794 2012-07-11 Glenn Morris <rgm@gnu.org>
3795
3796 * s/darwin.h, s/gnu-linux.h, s/template.h:
3797 Move INTERRUPT_INPUT to configure.
3798
3799 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3800
3801 Minor adjustments to interning code.
3802 * lisp.h (intern, intern_c_string): Redefine as static inline
3803 wrappers for intern_1 and intern_c_string_1, respectively.
3804 (intern_1, intern_c_string_1): Rename prototypes.
3805 * lread.c (intern_1, intern_c_string_1, oblookup):
3806 Simplify Vobarray checking.
3807 * font.c (font_intern_prop): Likewise. Adjust comment.
3808 * w32font.c (intern_font_name): Likewise.
3809
3810 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3811
3812 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3813
3814 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3815 of Fcar/Fcdr if possible.
3816 * font.c (check_otf_features): Likewise.
3817 * fontset.c (Fnew_fontset): Likewise.
3818 * gnutls.c (Fgnutls_boot): Likewise.
3819 * minibuf.c (read_minibuf): Likewise.
3820 * msdos.c (IT_set_frame_parameters): Likewise.
3821 * xmenu.c (Fx_popup_dialog): Likewise.
3822 * w32menu.c (Fx_popup_dialog): Likewise.
3823
3824 2012-07-11 Glenn Morris <rgm@gnu.org>
3825
3826 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3827 since nothing has defined it on these platforms.
3828
3829 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3830 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3831
3832 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3833 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3834 Move CLASH_DETECTION to configure.
3835
3836 * s/gnu.h: Remove file, which is now empty.
3837
3838 * s/gnu.h, s/gnu-linux.h:
3839 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3840
3841 2012-07-11 John Wiegley <johnw@newartisans.com>
3842
3843 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3844 function attribute, so we only use it if it exists in the
3845 compiler.
3846
3847 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 Avoid call to strlen in fast_c_string_match_ignore_case.
3850 * search.c (fast_c_string_match_ignore_case): Change to use
3851 length argument. Adjust users accordingly.
3852 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3853
3854 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3855
3856 Assume mkdir, rmdir.
3857 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3858 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3859
3860 Assume rename.
3861 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3862
3863 Assume perror.
3864 * s/hpux10-20.h (HAVE_PERROR): Remove.
3865 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3866 Remove dummy definition, as this problem was obsolete long ago.
3867
3868 Assume strerror.
3869 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3870
3871 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3872
3873 Avoid calls to strlen in font processing functions.
3874 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3875 (font_open_by_name): Change to use length argument.
3876 Adjust users accordingly.
3877 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3878 Adjust prototypes.
3879 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3880 Change to return ptrdiff_t.
3881 (xfont_list_pattern, xfont_match): Use length returned by
3882 xfont_decode_coding_xlfd.
3883 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3884
3885 2012-07-11 Glenn Morris <rgm@gnu.org>
3886
3887 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3888 Move DONT_REOPEN_PTY to configure.
3889
3890 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3891 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3892
3893 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3894
3895 Remove "#define unix" that is no longer needed (Bug#11905).
3896 * s/aix4-2.h (unix): Remove; no longer needed.
3897
3898 EMACS_TIME simplification (Bug#11875).
3899 This replaces macros (which typically do not work in GDB)
3900 with functions, typedefs and enums, making the code easier to debug.
3901 The functional style also makes code easier to read and maintain.
3902 * systime.h: Include <sys/time.h> on all hosts, not just if
3903 WINDOWSNT, since 'struct timeval' is needed in general.
3904 (EMACS_TIME): Now a typedef, not a macro.
3905 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3906 not macros.
3907 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3908 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3909 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3910 (EMACS_TIME_LE): Now functions, not macros.
3911 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3912 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3913 which are not functions. All uses rewritten to use:
3914 (make_emacs_time): New function.
3915 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3916 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3917 not functions. All uses rewritten to use the following, respectively:
3918 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3919 (add_emacs_time, sub_emacs_time): New functions.
3920 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3921 * fileio.c (Fcopy_file):
3922 * xterm.c (XTflash): Get the current time closer to when it's used.
3923 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3924
3925 * bytecode.c (targets): Suppress -Woverride-init warnings.
3926
3927 Simplify by avoiding confusing use of strncpy etc.
3928 * doc.c (Fsnarf_documentation):
3929 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3930 * frame.c (Fmake_terminal_frame):
3931 * gtkutil.c (get_utf8_string):
3932 * lread.c (openp):
3933 * nsmenu.m (ns_update_menubar):
3934 * regex.c (regerror):
3935 Prefer memcpy to strncpy and strncat when either will do.
3936 * fileio.c (Fsubstitute_in_file_name):
3937 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3938 (menu_separator_name_p):
3939 * nsmenu.m (ns_update_menubar):
3940 Prefer memcmp to strncmp when either will do.
3941 * nsterm.m: Include <ftoastr.h>.
3942 (ns_get_color):
3943 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3944 Prefer snprintf to strncpy.
3945 * nsterm.m (ns_term_init):
3946 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3947 * nsterm.m (ns_term_init):
3948 Avoid the need for strncpy, by using build_string or
3949 make_unibyte_string directly. Use dtoastr, not snprintf.
3950 * process.c (Fmake_network_process): Diagnose service names that
3951 are too long, rather than silently truncating them or creating
3952 non-null-terminated names.
3953 (Fnetwork_interface_info): Likewise, for interface names.
3954 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3955 Prefer sprintf to strncat.
3956 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3957 Prefer vsnprintf to vsprintf + strncpy.
3958
3959 2012-07-10 Glenn Morris <rgm@gnu.org>
3960
3961 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3962 Clarify fallback case.
3963
3964 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3965
3966 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3967 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3968 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3969 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3970 where argument type is known to be a Lisp_Cons.
3971
3972 2012-07-10 Tom Tromey <tromey@redhat.com>
3973
3974 * bytecode.c (BYTE_CODE_THREADED): New macro.
3975 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3976 (enum byte_code_op): New type.
3977 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3978 (exec_byte_code): Use them. Use token threading when applicable.
3979
3980 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3981
3982 Optimize pure C strings initialization.
3983 * lisp.h (make_pure_string): Fix prototype.
3984 (build_pure_c_string): New function, defined as static inline. This
3985 provides a better opportunity to optimize away calls to strlen when
3986 the function is called with compile-time constant argument.
3987 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3988 argument, adjust users accordingly. Use build_pure_c_string where
3989 appropriate.
3990 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3991 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3992 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3993
3994 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3995
3996 Avoid calls to strlen in miscellaneous functions.
3997 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3998 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3999 * lread.c (openp): Likewise.
4000
4001 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4002
4003 Avoid calls to strlen in path processing functions.
4004 * fileio.c (file_name_as_directory): Add comment. Change to add
4005 srclen argument and return the length of result. Adjust users
4006 accordingly.
4007 (directory_file_name): Fix comment. Change to add srclen argument,
4008 swap 1st and 2nd arguments to obey the common convention.
4009 Adjust users accordingly.
4010 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4011
4012 2012-07-10 Glenn Morris <rgm@gnu.org>
4013
4014 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4015 Move PENDING_OUTPUT_COUNT definition to configure.
4016
4017 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4018 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4019 * s/gnu.h (DATA_START): Move definitions to configure.
4020
4021 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4022 We include usg5-4-common.h, which defines them both.
4023
4024 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4025 O_RDONLY already includes it).
4026
4027 Stop ns builds setting the EMACSLOADPATH environment variable.
4028 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4029 Now it does not set EMACSLOADPATH, just returns the load-path string.
4030 * nsterm.h: Update accordingly.
4031 * lread.c [HAVE_NS]: Include nsterm.h.
4032 (init_lread) [HAVE_NS]: Use ns_load_path.
4033 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4034
4035 2012-07-09 Glenn Morris <rgm@gnu.org>
4036
4037 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4038 since the included bsd-common.h does so.
4039
4040 Stop ns builds setting the EMACSPATH environment variable.
4041 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4042 (ns_init_paths): Do not set EMACSPATH.
4043 * nsterm.h (ns_exec_path): Add it.
4044 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4045 Use ns_exec_path.
4046
4047 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4048
4049 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4050
4051 * process.c (wait_reading_process_output): 'waitchannels' was unset
4052 when read_kbd || !NILP (wait_for_cell); fix this.
4053
4054 Add GCC-style 'const' attribute to functions that can use it.
4055 * character.h (char_resolve_modifier_mask):
4056 * keyboard.h (make_ctrl_char):
4057 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4058 (init_character_once, next_almost_prime, init_fns, init_image)
4059 (flush_pending_output, init_sound):
4060 * mem-limits.h (start_of_data):
4061 * menu.h (finish_menu_items):
4062 Add ATTRIBUTE_CONST.
4063 * emacs.c (DEFINE_DUMMY_FUNCTION):
4064 Declare the dummy function with ATTRIBUTE_CONST.
4065 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4066 Add decls with ATTRIBUTE_CONST.
4067
4068 Minor improvements to make_formatted_string.
4069 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4070 where int is good enough, as vsprintf returns an int.
4071 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4072
4073 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4074
4075 Use make_formatted_string to avoid double length calculation.
4076 * lisp.h (make_formatted_string): New prototype.
4077 * alloc.c (make_formatted_string): New function.
4078 * buffer.c (Fgenerate_new_buffer_name): Use it.
4079 * dbus.c (syms_of_dbusbind): Likewise.
4080 * editfns.c (Fcurrent_time_zone): Likewise.
4081 * filelock.c (get_boot_time): Likewise.
4082 * frame.c (make_terminal_frame, set_term_frame_name)
4083 (x_report_frame_params): Likewise.
4084 * image.c (gs_load): Likewise.
4085 * minibuf.c (get_minibuffer): Likewise.
4086 * msdos.c (dos_set_window_size): Likewise.
4087 * process.c (make_process): Likewise.
4088 * xdisp.c (ensure_echo_area_buffers): Likewise.
4089 * xsettings.c (apply_xft_settings): Likewise.
4090
4091 2012-07-09 Glenn Morris <rgm@gnu.org>
4092
4093 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4094 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4095 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4096 * nsterm.h (ns_etc_directory): Add it.
4097 * callproc.c [HAVE_NS]: Include nsterm.h.
4098 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4099
4100 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4101
4102 Move marker debugging code under MARKER_DEBUG.
4103 * marker.c (MARKER_DEBUG): Move marker debugging code under
4104 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4105 for bootstrap with --enable-checking (~3x slowdown reported
4106 by Juanma Barranquero <lekktu@gmail.com>).
4107 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4108
4109 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4110
4111 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4112 See <http://bugs.gnu.org/11825#29>.
4113
4114 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4115
4116 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4117 has no font, use the frame's font. (Bug#11813)
4118 (display_line): Add commentary about displaying truncation glyphs
4119 on GUI frames.
4120 (produce_special_glyphs): Move here from term.c.
4121
4122 * term.c (produce_special_glyphs): Move to xdisp.c.
4123
4124 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4125 section.
4126
4127 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4128
4129 * xdisp.c (display_line): Avoid warning about implicit declaration
4130 of FRAME_FONT.
4131
4132 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4133
4134 * lisp.h: Remove empty conditional.
4135
4136 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4137
4138 * lread.c (load_path_check): Now static.
4139
4140 Fix some minor --with-ns problems found by static checking.
4141 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4142 (x_set_font) [!HAVE_X_WINDOWS]:
4143 * image.c (xpm_load_image) [HAVE_NS]:
4144 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4145 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4146 Remove unused local.
4147 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4148 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4149 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4150 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4151 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4152 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4153 Fix pointer signedness problem.
4154 * xfaces.c (FRAME_X_FONT_TABLE):
4155 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4156
4157 2012-07-07 Glenn Morris <rgm@gnu.org>
4158
4159 * lread.c (load_path_check): New function, split from init_lread.
4160 (init_lread): Reorganize. Motivation:
4161 If EMACSLOADPATH is set, check/warn about that rather than the
4162 defaults, which we are not going to use. Hence we can remove
4163 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4164 Don't warn if site-lisp directories are missing.
4165 If not installed, start from a blank load-path, since
4166 PATH_LOADSEARCH refers to the eventual installation directories.
4167
4168 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4169
4170 Support truncation and continuation glyphs on GUI frames, when
4171 fringes are disabled. (Bug#11832)
4172 * xdisp.c (init_iterator): Get dimensions of truncation and
4173 continuation glyphs even if on GUI frames.
4174 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4175 or both, are absent.
4176 (start_display, move_it_in_display_line_to): Handle the case of a
4177 GUI frame without a fringe to display continuation or truncation
4178 glyphs.
4179 (insert_left_trunc_glyphs): Support GUI frames: make sure
4180 truncation glyphs overwrite enough glyphs from the current line to
4181 have sufficient space in pixels.
4182 (display_line): Support truncation and continuation glyphs on GUI
4183 frames. If some spare pixels are left on the line after inserting
4184 the truncation glyphs, fill that space with a stretch glyph of a
4185 suitably computed width.
4186
4187 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4188 produce_glyphs, to support GUI sessions.
4189
4190 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4191
4192 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4193
4194 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4195
4196 Do not require float-time's arg to fit in time_t (Bug#11825).
4197 This works better on hosts where time_t is unsigned, and where
4198 float-time is applied to the (negative) difference between two times.
4199 * editfns.c (decode_time_components): Last arg is now double *,
4200 not int *, and means to store all the result as a double, without
4201 worrying about whether the seconds part fits in time_t.
4202 All callers changed.
4203 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4204 All callers changed.
4205 (Ffloat_time): Do not fail merely because the specified time falls
4206 outside of time_t range.
4207
4208 2012-07-07 Glenn Morris <rgm@gnu.org>
4209
4210 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4211 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4212 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4213
4214 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4215
4216 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4217 Update dependencies.
4218
4219 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4220
4221 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4222
4223 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4224 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4225 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4226 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4227 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4228 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4229
4230 * xfont.c (compare_font_names): Redo to omit the need for casts.
4231
4232 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4233
4234 * xfns.c (Fx_change_window_property): Doc fix.
4235 * w32fns.c (Fx_change_window_property): Doc fix.
4236
4237 * w32fns.c (Fx_window_property): Accept the same arguments as the
4238 X Windows version. Doc fix.
4239 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4240
4241 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4242 Eli Zaretskii <eliz@gnu.org>
4243
4244 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4245 Windows-specific code from nt/config.nt moved here.
4246 Obsolete settings removed.
4247
4248 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4249
4250 * process.c: Avoid unnecessary calls to gettime.
4251 (wait_reading_process_output): Don't get the time of day
4252 when gobbling data immediately and not waiting, as there's no need
4253 for it in that case. This removes a FIXME.
4254
4255 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4256
4257 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4258 is defined (Bug#11768).
4259
4260 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4261
4262 Fix marker debugging code.
4263 * marker.c (byte_char_debug_check): Do not perform the check
4264 if buffer is not multibyte.
4265 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4266 Call byte_char_debug_check with correct arguments.
4267
4268 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4269
4270 Compile marker debugging code only if ENABLE_CHECKING is defined.
4271 * marker.c (byte_char_debug_check, count_markers):
4272 Use only if ENABLE_CHECKING is defined.
4273 (byte_debug_flag): Remove.
4274 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4275 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4276
4277 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4278
4279 Avoid code repetition in marker-related functions.
4280 * marker.c (attach_marker): New function.
4281 (Fset_marker, set_marker_restricted, set_marker_both)
4282 (set_marker_restricted_both): Use it.
4283 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4284 Consistently rename charno to charpos.
4285 (marker_position): Add eassert.
4286 (marker_byte_position): Convert to eassert.
4287
4288 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4289
4290 Simplify list operations in unchain_overlay and unchain_marker.
4291 * buffer.c (unchain_overlay): Simplify. Add comment.
4292 * marker.c (unchain_marker): Simplify. Fix comments.
4293
4294 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4295
4296 Introduce fast path for the widely used marker operation.
4297 * alloc.c (build_marker): New function.
4298 * lisp.h (build_marker): New prototype.
4299 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4300 * composite.c (autocmp_chars): Likewise.
4301 * editfns.c (buildmark): Remove.
4302 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4303 (save_restriction_save): Use build_marker.
4304 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4305 * window.c (save_window_save): Likewise.
4306
4307 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4308
4309 Do not use Fdelete_overlay in delete_all_overlays
4310 to avoid redundant calls to unchain_overlay.
4311 * buffer.c (drop_overlay): New function.
4312 (delete_all_overlays, Fdelete_overlay): Use it.
4313 * minibuf.c (get_minibuffer): Fix comment.
4314
4315 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4316
4317 Port to OpenBSD 5.1 amd64.
4318 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4319 This is needed for OpenBSD, and should be harmless on all BSD systems.
4320 Also, include <sys/sysctl.h>, as it should be available on all
4321 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4322 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4323 use p_pid member, not kp_proc.pid.
4324
4325 2012-07-06 Glenn Morris <rgm@gnu.org>
4326
4327 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4328
4329 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4330
4331 More xmalloc and related cleanup.
4332 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4333 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4334 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4335 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4336 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4337 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4338 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4339 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4340 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4341 * xterm.c:
4342 Omit needless casts involving void * pointers and allocation.
4343 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4344 as the former is more robust if P's type is changed.
4345 Prefer xzalloc to xmalloc + memset 0.
4346 Simplify malloc-or-realloc to realloc.
4347 Don't worry about xmalloc returning a null pointer.
4348 Prefer xstrdup to xmalloc + strcpy.
4349 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4350 growing it.
4351 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4352 alloca of a constant.
4353
4354 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4355
4356 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4357 hscroll is larger than the line width. Fixes long and futile
4358 looping inside extend_face_to_end_of_line (on a TTY) producing
4359 glyphs that are not needed and thrown away.
4360
4361 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4362
4363 * marker.c (set_marker_restricted_both): Simplify by using
4364 clip_to_bounds.
4365
4366 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4367
4368 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4369
4370 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4371
4372 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4373 not defined (Bug#11768).
4374 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4375 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4376 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4377 followed by gtk_box_set_homogeneous (Bug#11768).
4378 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4379 (update_theme_scrollbar_width, xg_create_scroll_bar):
4380 Use gtk_scrollbar_new (Bug#11768).
4381 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4382 (is_box_type): New function (Bug#11768).
4383 (xg_tool_item_stale_p): Call is_box_type.
4384 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4385 with default display (Bug#11768).
4386
4387 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4388
4389 * xdisp.c (window_hscroll_limited): New function.
4390 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4391 coordinates when window's hscroll is set to insanely large
4392 values. (Bug#11857)
4393
4394 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4395
4396 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4397 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4398
4399 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4400
4401 Cleanup xmalloc.
4402 * lisp.h (xzalloc): New prototype. Omit needless casts.
4403 * alloc.c (xzalloc): New function. Omit needless casts.
4404 * charset.c: Omit needless casts. Convert all calls to
4405 xmalloc with following memset to xzalloc.
4406 * dispnew.c: Likewise.
4407 * fringe.c: Likewise.
4408 * image.c: Likewise.
4409 * sound.c: Likewise.
4410 * term.c: Likewise.
4411 * w32fns.c: Likewise.
4412 * w32font.c: Likewise.
4413 * w32term.c: Likewise.
4414 * xfaces.c: Likewise.
4415 * xfns.c: Likewise.
4416 * xterm.c: Likewise.
4417 * atimer.c: Omit needless casts.
4418 * buffer.c: Likewise.
4419 * callproc.c: Likewise.
4420 * ccl.c: Likewise.
4421 * coding.c: Likewise.
4422 * composite.c: Likewise.
4423 * doc.c: Likewise.
4424 * doprnt.c: Likewise.
4425 * editfns.c: Likewise.
4426 * emacs.c: Likewise.
4427 * eval.c: Likewise.
4428 * filelock.c: Likewise.
4429 * fns.c: Likewise.
4430 * gtkutil.c: Likewise.
4431 * keyboard.c: Likewise.
4432 * lisp.h: Likewise.
4433 * lread.c: Likewise.
4434 * minibuf.c: Likewise.
4435 * msdos.c: Likewise.
4436 * print.c: Likewise.
4437 * process.c: Likewise.
4438 * region-cache.c: Likewise.
4439 * search.c: Likewise.
4440 * sysdep.c: Likewise.
4441 * termcap.c: Likewise.
4442 * terminal.c: Likewise.
4443 * tparam.c: Likewise.
4444 * w16select.c: Likewise.
4445 * w32.c: Likewise.
4446 * w32reg.c: Likewise.
4447 * w32select.c: Likewise.
4448 * w32uniscribe.c: Likewise.
4449 * widget.c: Likewise.
4450 * xdisp.c: Likewise.
4451 * xmenu.c: Likewise.
4452 * xrdb.c: Likewise.
4453 * xselect.c: Likewise.
4454
4455 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4456
4457 * fileio.c (time_error_value): Check the right error number.
4458 Problem reported by Troels Nielsen in
4459 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4460
4461 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4462
4463 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4464 This should be fixed in a better way; see Eli Zaretskii in
4465 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4466 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4467
4468 * fileio.c (time_error_value): Rename from special_mtime.
4469 The old name's problems were noted by Eli Zaretskii in
4470 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4471
4472 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4473 This variable's comment says Emacs needs at least one GDB-visible
4474 symbol of type enum pvec_type, to work around GDB problems.
4475 The symbol's value doesn't matter.
4476
4477 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4478 that causes compilation to fail on pre-C99 compilers.
4479
4480 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4481
4482 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4483 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4484
4485 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4486
4487 * buffer.c (init_buffer_once): Fix initialization of
4488 headers for buffer_defaults and buffer_local_symbols.
4489 Reported by Juanma Barranquero <lekktu@gmail.com>.
4490
4491 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4492
4493 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4494 * lisp.h (enum pvec_type): Use fewer bits.
4495 (PSEUDOVECTOR_SIZE_BITS): New constant.
4496 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4497 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4498 change in pvec_type.
4499 (PSEUDOVECTOR_TYPEP): New macro.
4500 (TYPED_PSEUDOVECTORP): Use it.
4501 * fns.c (internal_equal): Adapt code to extract pvectype.
4502 * emacs.c (gdb_pvec_type): Update type.
4503 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4504 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4505 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4506 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4507 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4508 abusing vector->header.next.nbytes.
4509 (live_vector_p): Use PVEC_TYPE.
4510 (mark_object): Adapt code to extract pvectype. Use switch.
4511
4512 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4513
4514 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4515 Tighten new eassert a bit.
4516
4517 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4518
4519 Fix compilation with --enable-gcc-warnings and -O1
4520 optimization level.
4521 * doprnt.c (doprnt): Change type of tem to int, initialize
4522 to avoid compiler warning. Add eassert.
4523 * search.c (simple_search): Initialize match_byte to avoid
4524 compiler warning. Add eassert.
4525
4526 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 Avoid weird behavior with large horizontal scrolls.
4529 Without this change, for example, large hscroll values would
4530 mess up Emacs's display on Fedora 15 x86, presumably due to
4531 overflows in int calculations in the display code.
4532 Also, if buffers had long lines, Emacs would freeze.
4533 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4534 (set_window_hscroll): New function, containing the old guts of
4535 Fset_window_hscroll. Return the clipped value.
4536 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4537 This avoids the need to check against PTRDIFF_MAX.
4538
4539 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4540
4541 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4542
4543 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4544
4545 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4546
4547 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4548 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4549 since GCC 4.4.6 issues a bogus warning for them.
4550
4551 Fix bugs in file timestamp newness comparisons.
4552 * fileio.c (Ffile_newer_than_file_p):
4553 * lread.c (Fload): Use full timestamp resolution of files,
4554 not just the 1-second resolution, so that files that are only
4555 slightly newer still count as newer.
4556 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4557 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4558
4559 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4560
4561 * fileio.c: Improve handling of file time marker. (Bug#11852)
4562 (special_mtime): New function.
4563 (Finsert_file_contents, Fverify_visited_file_modtime):
4564 Use it to set special mtime values consistently.
4565
4566 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4567
4568 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4569 marker for non-existing file. (Bug#11852)
4570
4571 2012-07-03 Glenn Morris <rgm@gnu.org>
4572
4573 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4574 and did not make it into globals.h).
4575
4576 2012-07-03 Tom Tromey <tromey@redhat.com>
4577
4578 * window.c (Fset_window_margins, Fset_window_fringes)
4579 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4580 * textprop.c (Fprevious_property_change): No longer static.
4581 * syntax.c (Fsyntax_table_p): No longer static.
4582 * process.c (Fget_process, Fprocess_datagram_address): No longer
4583 static.
4584 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4585 * keyboard.c (Fcommand_execute): No longer static.
4586 Remove EXFUN.
4587 * insdel.c (Fcombine_after_change_execute): No longer static.
4588 * image.c (Finit_image_library): No longer static.
4589 * fileio.c (Fmake_symbolic_link): No longer static.
4590 * eval.c (Ffetch_bytecode): No longer static.
4591 * editfns.c (Fuser_full_name): No longer static.
4592 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4593 No longer static.
4594 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4595 static.
4596 * dired.c (Ffile_attributes): No longer static.
4597 * composite.c (Fcomposition_get_gstring): No longer static.
4598 * callproc.c (Fgetenv_internal): No longer static.
4599
4600 * ccl.h: Remove EXFUNs.
4601 * buffer.h: Remove EXFUNs.
4602 * dispextern.h: Remove EXFUNs.
4603 * intervals.h: Remove EXFUNs.
4604 * fontset.h: Remove EXFUN.
4605 * font.h: Remove EXFUNs.
4606 * dosfns.c (system_process_attributes): Remove EXFUN.
4607 * keymap.h: Remove EXFUNs.
4608 * lisp.h: Remove EXFUNs.
4609 * w32term.h: Remove EXFUNs.
4610 * window.h: Remove EXFUNs.
4611 * xsettings.h: Remove EXFUN.
4612 * xterm.h: Remove EXFUN.
4613
4614 2012-07-03 Glenn Morris <rgm@gnu.org>
4615
4616 * lisp.h (Frandom): Make it visible to C.
4617 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4618 buffer for invisible buffers. (Bug#1229)
4619
4620 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4621
4622 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4623 values which aren't power of 2.
4624 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4625 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4626 accordingly.
4627
4628 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4629
4630 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4631
4632 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4633
4634 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4635
4636 * alloc.c (allocate_vector_block): Remove redundant
4637 calls to mallopt if DOUG_LEA_MALLOC is defined.
4638 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4639 avoid calls to mallopt if zero_vector is returned.
4640
4641 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4642
4643 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4644 is enabled, avoid dereferencing NULL current_sblock if
4645 running undumped.
4646
4647 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4648
4649 Cleanup basic buffer management.
4650 * buffer.h (struct buffer): Change layout to use generic vector
4651 marking code. Fix some comments. Change type of 'clip_changed'
4652 to bitfield. Remove unused #ifndef old.
4653 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4654 (GET_OVERLAYS_AT): Fix indentation.
4655 (for_each_per_buffer_object_at): New macro.
4656 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4657 (Fbuffer_local_variables): Use it.
4658 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4659 * alloc.c (allocate_buffer): Adjust to match new layout of
4660 struct buffer. Fix comment.
4661 (mark_overlay): New function.
4662 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4663 Lisp area of struct buffer.
4664 (mark_object): Use it. Adjust marking of misc objects
4665 and related comments.
4666
4667 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4668
4669 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4670 wrapper that is not needed because the wrapped code is a no-op (zero
4671 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4672 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4673
4674 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4675
4676 * alloc.c (mark_buffer): Simplify. Remove prototype.
4677 (mark_object): Add comment. Reorganize marking of vector-like
4678 objects. Use CHECK_LIVE for all vector-like objects except buffers
4679 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4680 Avoid redundant calls to mark_vectorlike for bool vectors.
4681
4682 2012-06-30 Glenn Morris <rgm@gnu.org>
4683
4684 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4685
4686 * epaths.in (PATH_SITELOADSEARCH): New.
4687 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4688 This is rather than relying on --enable-locallisppath elements
4689 having "site-lisp" in their names. (Bug#10208#25, 11658)
4690
4691 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4692
4693 * w32proc.c (sys_select): Accept and ignore one more argument.
4694
4695 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4696
4697 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4698 (pselect) [!MS_DOS]: Redirect to sys_select.
4699
4700 * sysdep.c: Don't include dos.h and dosfns.h.
4701
4702 * process.c (sys_select):
4703 * msdos.c (sys_select): Accept one more argument and ignore it.
4704
4705 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4706 adapt data types and code to that.
4707
4708 * dosfns.c:
4709 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4710 which clashes with the gnulib function of the same name.
4711
4712 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4713
4714 * font.c (font_style_to_value, font_style_symbolic)
4715 (font_prop_validate_style): Add type checks for values in
4716 font_style_table.
4717
4718 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4719 argument.
4720 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4721 uses.
4722
4723 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4724
4725 * xdisp.c (try_window_id): Undo last change.
4726
4727 * w32.c (getwd): Adjust commentary about startup_dir.
4728 (init_environment): Always call sys_access, even in non-MSVC
4729 builds. Don't chdir to the directory of the Emacs executable.
4730 This undoes code from 1997 which was justified by the need to
4731 "avoid conflicts when removing and renaming directories". But its
4732 downside was that every relative file name was being interpreted
4733 relative to the directory of the Emacs executable, which can never
4734 be TRT. In particular, it broke sys_access when called with
4735 relative file names.
4736 (sys_access): Map GetLastError to errno.
4737
4738 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4739
4740 * window.h (struct window): Change type of 'fringes_outside_margins'
4741 to bitfield. Fix comment. Adjust users accordingly.
4742 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4743 Adjust comment.
4744 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4745 to ptrdiff_t.
4746
4747 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4748
4749 * gnutls.c (emacs_gnutls_handshake):
4750 Add QUIT to make the loop interruptible.
4751
4752 2012-06-29 Glenn Morris <rgm@gnu.org>
4753
4754 * charset.c (init_charset): Make lack of etc/charsets fatal.
4755
4756 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4757
4758 * editfns.c (region_limit): Fix type mismatch.
4759
4760 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4761
4762 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4763 undefined. Convert from xassert to eassert.
4764 * nsmenu.m: Convert from xassert to eassert.
4765 * nsterm.m: Likewise.
4766
4767 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4768
4769 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4770
4771 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4772
4773 Avoid integer overflow on scroll-left and scroll-right.
4774 * window.c (HSCROLL_MAX): New macro.
4775 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4776 overflow when requested scroll falls outside ptrdiff_t range.
4777
4778 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4779
4780 * window.h (struct window): Change type of 'hscroll',
4781 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4782 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4783 Adjust users accordingly.
4784 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4785 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4786 from EMACS_INT to ptrdiff_t.
4787 (make_window): Omit redundant initialization.
4788
4789 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4790
4791 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4792
4793 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4794
4795 * window.h (struct window): Change type of 'use_time' and
4796 'sequence_number' from Lisp_Object to int.
4797 * frame.c (make_frame): Adjust users accordingly.
4798 * print.c (print_object): Likewise.
4799 * window.c (select_window, Fwindow_use_time, make_parent_window)
4800 (make_window): Likewise.
4801
4802 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4803
4804 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4805 enabled with --enable-checking=[all,glyphs] configure option.
4806 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4807 adjust comments accordingly.
4808 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4809 undefined, adjust comments accordingly.
4810 * image.c: Likewise.
4811 * scroll.c: Likewise.
4812 * w32fns.c: Likewise.
4813 * w32term.c: Likewise.
4814 * xdisp.c: Likewise.
4815 * xfaces.c: Likewise.
4816 * xfns.c: Likewise.
4817 * xterm.c: Likewise.
4818
4819 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4820
4821 Generalize run-time debugging checks.
4822 * dispextern.h (XASSERTS): Remove.
4823 * fontset.c (xassert): Remove.
4824 Convert from xassert to eassert.
4825 * alloc.c: Convert from xassert to eassert.
4826 * bidi.c: Likewise.
4827 * dispnew.c: Likewise.
4828 * fns.c: Likewise.
4829 * fringe.c: Likewise.
4830 * ftfont.c: Likewise.
4831 * gtkutil.c: Likewise.
4832 * image.c: Likewise.
4833 * keyboard.c: Likewise.
4834 * menu.c: Likewise.
4835 * process.c: Likewise.
4836 * scroll.c: Likewise.
4837 * sound.c: Likewise.
4838 * term.c: Likewise.
4839 * w32console.c: Likewise.
4840 * w32fns.c: Likewise.
4841 * w32term.c: Likewise.
4842 * window.c: Likewise.
4843 * xdisp.c: Likewise.
4844 * xfaces.c: Likewise.
4845 * xfns.c: Likewise.
4846 * xselect.c: Likewise.
4847 * xterm.c: Likewise.
4848
4849 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4850
4851 * fns.c (maybe_resize_hash_table): Output message when growing the
4852 purify-hashtable.
4853
4854 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4855
4856 * alloc.c (allocate_string_data): Remove dead code.
4857 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4858 avoid GCC warning about unused macro.
4859
4860 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4861
4862 * alloc.c (allocate_string): Omit intervals initialization.
4863 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4864 as in make_pure_string and make_pure_c_string.
4865
4866 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4867
4868 * alloc.c (allocate_string): Fix last change.
4869
4870 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4871
4872 * alloc.c (allocate_string): Remove two redundant calls
4873 to memset, add explicit initialization where appropriate.
4874
4875 2012-06-27 Glenn Morris <rgm@gnu.org>
4876
4877 * lisp.mk (lisp): Remove paths.elc.
4878
4879 2012-06-27 Chong Yidong <cyd@gnu.org>
4880
4881 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4882
4883 2012-06-26 John Wiegley <johnw@newartisans.com>
4884
4885 * unexmacosx.c (copy_data_segment): Add two section names used
4886 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4887
4888 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4889 when building with Clang.
4890
4891 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4892
4893 * eval.c (Fapply): Allow calling it with a single argument.
4894
4895 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4896
4897 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4898 _stricmp and _strnicmp.
4899 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4900
4901 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4902
4903 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4904 allocated window.
4905 (allocate_process): Likewise for new process.
4906 (allocate_terminal): Change to use offsetof.
4907 (allocate_frame): Likewise.
4908 * frame.c (make_frame): Omit redundant initialization.
4909 * window.c (make_parent_window): Use memset.
4910 (make_window): Omit redundant initialization.
4911 * process.c (make_process): Omit redundant initialization.
4912 * terminal.c (create_terminal): Likewise.
4913
4914 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4915
4916 * term.c (delete_tty): Remove redundant call to memset.
4917
4918 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4919
4920 * alloc.c: Remove build_string.
4921 * lisp.h: Define build_string as static inline. This provides
4922 a better opportunity to optimize away calls to strlen when the
4923 function is called with compile-time constant argument.
4924 * image.c (imagemagick_error): Convert to build_string.
4925 * w32proc.c (sys_spawnve): Likewise.
4926 * xterm.c (x_term_init): Likewise.
4927
4928 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4929
4930 Use sprintf return value instead of invoking strlen on result.
4931 In the old days this wasn't portable, since some sprintf
4932 implementations returned char *. But they died out years ago and
4933 Emacs already assumes sprintf returns int.
4934 Similarly for float_to_string.
4935 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4936 * ccl.c (ccl_driver):
4937 * character.c (string_escape_byte8):
4938 * data.c (Fnumber_to_string):
4939 * doprnt.c (doprnt):
4940 * print.c (print_object):
4941 * xdisp.c (message_dolog):
4942 * xfns.c (syms_of_xfns):
4943 Use sprintf or float_to_string result to avoid need to call strlen.
4944 * data.c (Fnumber_to_string):
4945 Use make_unibyte_string, since the string must be ASCII.
4946 * lisp.h, print.c (float_to_string): Now returns int length.
4947 * term.c (produce_glyphless_glyph):
4948 Use sprintf result rather than recomputing it.
4949
4950 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4951 * Makefile.in (ALL_CFLAGS):
4952 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4953 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4954
4955 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4956
4957 * dispextern.h (xstrcasecmp): Define to library function
4958 strcasecmp if available.
4959 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4960
4961 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4962
4963 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4964 Avoid comma operator.
4965 * menu.c (push_submenu_start, push_submenu_end)
4966 (push_left_right_boundary, push_menu_pane): Likewise.
4967 * msdos.c (dos_rawgetc): Likewise.
4968
4969 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4970
4971 * xfns.c (xic_create_fontsetname): Remove redundant calls
4972 to memset.
4973
4974 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4975
4976 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4977 sprintf already null-terminates its output.
4978
4979 * xfns.c (x_window): Remove redundant cast.
4980
4981 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4982
4983 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4984 `const char *' to `char *' to avoid compiler warning.
4985
4986 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4987
4988 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4989 instead of truncating it to 63 (admittedly a generous limit).
4990
4991 * process.c: Fix spelling and caps in comments.
4992
4993 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4994
4995 * emacs.c (setpgrp): Remove definition, unused.
4996 * sysdep.c (setpgrp): Remove definition, not used in this file.
4997
4998 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
4999
5000 * makefile.w32-in: Update dependencies.
5001
5002 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5003
5004 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5005 (SYSTIME_H): Add nt/inc/sys/time.h.
5006
5007 * systime.h [WINDOWSNT]: Include sys/time.h.
5008
5009 * s/ms-w32.h (struct timespec): Definition moved from
5010 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5011
5012 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5013
5014 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5015 * buffer.h (buffer_slot_type_mismatch):
5016 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5017 * eval.c (unwind_to_catch):
5018 * image.c (my_png_error, my_error_exit):
5019 * keyboard.c (quit_throw_to_read_char, user_error)
5020 (Fexit_recursive_edit, Fabort_recursive_edit):
5021 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5022 (wrong_type_argument, buffer_overflow, __executable_start)
5023 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5024 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5025 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5026 (fatal):
5027 (child_setup) [!DOS_NT]:
5028 * lread.c (end_of_file_error, invalid_syntax):
5029 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5030 * puresize.h (pure_write_error):
5031 * search.c (matcher_overflow):
5032 * sound.c (sound_perror, alsa_sound_perror):
5033 * sysdep.c, syssignal.h (croak):
5034 * term.c (maybe_fatal, vfatal):
5035 * textprop.c (text_read_only):
5036 * undo.c (user_error):
5037 * unexmacosx.c (unexec_error):
5038 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5039 Use _Noreturn rather than NO_RETURN.
5040 No need for separate decl merely because of _Noreturn.
5041 * sound.c (sound_warning, parse_sound):
5042 Remove unnecessary forward decls.
5043
5044 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5045
5046 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5047 * lisp.h (WAIT_READING_MAX): New macro.
5048 * dispnew.c (Fsleep_for, sit_for):
5049 * keyboard.c (kbd_buffer_get_event):
5050 * process.c (Faccept_process_output):
5051 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5052 This improves on the previous patch, which introduced a bug
5053 when time_t is unsigned and as wide as intmax_t.
5054 See <http://bugs.gnu.org/9000#51>.
5055
5056 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5057
5058 * dispnew.c (sit_for, Fsleep_for):
5059 * keyboard.c (kbd_buffer_get_event):
5060 * process.c (Faccept_process_output): Avoid compiler warnings when
5061 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5062
5063 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5064
5065 * makefile.w32-in: Update dependencies.
5066
5067 * w32.c (ltime): Add return type and declare static.
5068 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5069
5070 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5071
5072 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5073 Privately reported by Herbert J. Skuhra.
5074 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5075 All uses changed.
5076 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5077 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5078
5079 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5080
5081 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5082 last argument of make_unibyte_string.
5083
5084 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5085 language ID in the event parameters.
5086
5087 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5088 event.code, not the obscure "character set ID".
5089
5090 2012-06-23 Chong Yidong <cyd@gnu.org>
5091
5092 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5093
5094 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5095
5096 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5097 * w32.c (fdutimens): New function.
5098
5099 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5100
5101 * s/ms-w32.h (pselect): Redirect to sys_select.
5102
5103 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5104
5105 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5106 in the logic of incrementing and decrementing the value of
5107 use_relocatable_buffers.
5108
5109 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5110
5111 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5112 Privately reported by Herbert J. Skuhra.
5113 [__FreeBSD__]: Remove "*/" typo after "#include".
5114 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5115 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5116 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5117 Don't assume EMACS_TIME and struct timeval are the same type.
5118
5119 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5120
5121 Support higher-resolution time stamps (Bug#9000).
5122 The time stamps are only nanosecond-resolution at the C level,
5123 since that's the best that any real-world system supports now.
5124 But they are picosecond-resolution at the Lisp level, as that's
5125 easy, and leaves room for future OS improvements.
5126
5127 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5128 (LIBES): Use it.
5129
5130 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5131 Don't get current time unless it's needed.
5132
5133 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5134 now provides it if it's absent.
5135 (start_atimer): Port to higher-res time stamps.
5136 Check for time stamp overflow. Don't get current time more
5137 often than is needed.
5138
5139 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5140 Include systime.h, not time.h.
5141 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5142
5143 * dired.c: Include stat-time.h.
5144 (Ffile-attributes): File times now have higher resolution.
5145
5146 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5147 (struct image): Timestamp now has higher resolution.
5148
5149 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5150 has at least microseconds now. All uses removed.
5151 (update_frame, update_single_window, update_window, update_frame_1)
5152 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5153 (duration_to_sec_usec): Remove; no longer needed.
5154
5155 * editfns.c (time_overflow): Now extern.
5156 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5157 (float-time, Fformat_time_string, Fcurrent_time_string)
5158 (Fcurrent_time_zone): Accept and generate higher-resolution
5159 time stamps.
5160 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5161 (decode_time_components, lisp_seconds_argument): New functions.
5162 (make_time): Now static.
5163 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5164 Report an error if the time is invalid, rather than having the caller
5165 do that.
5166
5167 * fileio.c: Include <stat-time.h>
5168 (Fcopy_file): Copy higher-resolution time stamps.
5169 Prefer to set the time stamp via a file descriptor if that works.
5170 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5171 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5172 (Fvisited_file_modtime, Fset_visited_file_modtime):
5173 Support higher-resolution time stamps.
5174
5175 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5176
5177 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5178
5179 * image.c (prepare_image_for_display, clear_image_cache)
5180 (lookup_image): Port to higer-resolution time stamps.
5181
5182 * keyboard.c (start_polling, bind_polling_period):
5183 Check for time stamp overflow.
5184 (read_char, kbd_buffer_get_event, timer_start_idle)
5185 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5186 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5187 Port to higher-resolution time stamps. Do not assume time_t is signed.
5188 (decode_timer): New function. Timers are now vectors of length 9,
5189 not 8, to accommodate the picosecond component.
5190 (timer_check_2): Use it.
5191
5192 * nsterm.m (select_timeout, timeval_subtract): Remove.
5193 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5194 as they're a bit more accurate and handle overflow better.
5195 (ns_select): Change prototype to be compatible with pselect.
5196 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5197 * nsterm.h (ns_select): Adjust prototype.
5198
5199 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5200 us-resolution time stamps.
5201 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5202
5203 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5204
5205 * lisp.h (time_overflow): New decl.
5206 (wait_reading_process_output): First arg is now intmax_t, not int,
5207 to accommodate larger waits.
5208
5209 * process.h (struct Lisp_Process.read_output_delay):
5210 Now counts nanoseconds, not microseconds.
5211 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5212 EMACS_HAS_USECS.
5213 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5214 (wait_reading_process_output):
5215 Port to ns-resolution time stamps.
5216 (Faccept_process_output, wait_reading_process_output):
5217 Check for time stamp overflow. Do not assume time_t is signed.
5218 (select_wrapper): Remove; we now use pselect.
5219 (Fprocess_attributes): Now generates ns-resolution time stamps.
5220
5221 * sysdep.c: Include utimens.h. Don't include utime.h
5222 or worry about struct utimbuf; gnulib does that for us now.
5223 (gettimeofday): Remove; gnulib provides a substitute.
5224 (make_timeval): New function.
5225 (set_file_times): Now sets ns-resolution time stamps.
5226 New arg FD; all uses changed.
5227 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5228 (system_process_attributes):
5229 Now returns ns-resolution time stamp. All uses changed.
5230 Check for time stamp overflow.
5231
5232 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5233 provides a substitute now.
5234
5235 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5236 since it guarantees struct timespec.
5237 (EMACS_TIME): Now struct timespec, so that we can support
5238 ns-resolution time stamps.
5239 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5240 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5241 (EMACS_USECS): Remove.
5242 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5243 so multiply the arg by 1000 before storing it.
5244 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5245 New macros.
5246 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5247 Port to ns-resolution time stamps.
5248 (EMACS_TIME_NEG_P): Remove; replaced by....
5249 (EMACS_TIME_SIGN): New macro.
5250 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5251 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5252 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5253 (make_timeval, make_lisp_time, decode_time_components): New decls.
5254 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5255 that it mishandled time_t overflow. You can't compare by subtracting!
5256 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5257 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5258
5259 * term.c: Include <sys/time.h>.
5260 (timeval_to_Time): New function, for proper overflow wraparound.
5261 (term_mouse_position, term_mouse_click): Use it.
5262
5263 * undo.c (record_first_change): Support higher-resolution time stamps
5264 in the undo buffer.
5265 (Fprimitive_undo): Use them when restoring time stamps.
5266
5267 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5268 (w32_get_internal_run_time):
5269 Port to higher-resolution Emacs time stamps.
5270 (ltime): Now accepts single 64-bit integer, as that's more convenient
5271 for callers.
5272
5273 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5274
5275 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5276 for compatibility with pselect. Support ns-resolution time stamps.
5277
5278 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5279
5280 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5281 Check for time stamp overflow, and support ns-resolution time stamps.
5282
5283 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5284 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5285 (timeval_subtract): Remove; no longer needed.
5286 (XTflash, XTring_bell, x_wait_for_event):
5287 Port to ns-resolution time stamps. Don't assume time_t is signed.
5288
5289 2012-06-22 Chong Yidong <cyd@gnu.org>
5290
5291 * xdisp.c (x_consider_frame_title): Revert last change.
5292
5293 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5294
5295 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5296 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5297 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5298 staticidx goes up to 1597 out of 1600 = 0x640.)
5299
5300 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5301
5302 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5303 Otherwise, the umask might be mistakenly 0 while handling input signals.
5304
5305 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5306
5307 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5308
5309 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5310
5311 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5312 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5313 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5314 access to `contents' member of Lisp_Vector objects with AREF and ASET
5315 where appropriate.
5316
5317 2012-06-19 Chong Yidong <cyd@gnu.org>
5318
5319 * frame.c (delete_frame): When selecting a frame on a different
5320 text terminal, do not alter the terminal's top-frame.
5321
5322 * xdisp.c (format_mode_line_unwind_data): Record the target
5323 frame's selected window and its terminal's top-frame.
5324 (unwind_format_mode_line): Restore them.
5325 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5326 Callers changed.
5327 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5328 since tty frames can be explicitly named.
5329 (prepare_menu_bars): Likewise.
5330
5331 * term.c (Ftty_top_frame): New function.
5332
5333 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5334
5335 Port byte-code-meter to modern targets.
5336 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5337 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5338 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5339 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5340 (METER_1, METER_2): Simplify.
5341
5342 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5343
5344 * data.c (Fdefalias): Return `symbol' (bug#11686).
5345
5346 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5347
5348 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5349 gets killed during executing of this function (Bug#11665).
5350 Try to always return Qt when the buffer has been actually killed.
5351 (Vkill_buffer_query_functions): In doc-string say that functions
5352 run by this hook should not change the current buffer.
5353
5354 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5355
5356 Fix recently-introduced process.c problems found by static checking.
5357 * process.c (write_queue_push, write_queue_pop, send_process):
5358 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5359 (write_queue_pop): Fix pointer signedness problem.
5360 (send_process): Remove unused local.
5361
5362 2012-06-17 Chong Yidong <cyd@gnu.org>
5363
5364 * xdisp.c (redisplay_internal): No need to redisplay terminal
5365 frames that are not on top.
5366
5367 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5368
5369 * process.c (make_process): Initialize write_queue.
5370 (write_queue_push, write_queue_pop): New functions.
5371 (send_process): Use them to maintain correct ordering of process
5372 writes (Bug#10815).
5373
5374 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5375
5376 * lisp.h (eassert): Assume C89 or later.
5377 This removes the need for CHECK.
5378 (CHECK): Remove. Its comments about always evaluating its
5379 argument were confusing, as 'eassert' typically does not evaluate
5380 its argument.
5381
5382 * coding.c (produce_chars): Use ptrdiff_t, not int.
5383
5384 * xterm.c (x_draw_underwave): Check for integer overflow.
5385 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5386
5387 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5388
5389 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5390 referenced (Bug#11583).
5391
5392 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5393
5394 Implement wave-style variant of underlining.
5395 * dispextern.h (face_underline_type): New enum.
5396 (face): Add field for underline type.
5397 * nsterm.m (ns_draw_underwave): New function.
5398 (ns_draw_text_decoration): Use it.
5399 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5400 New functions.
5401 (x_draw_glyph_string): Use them.
5402 * xfaces.c (Qline, Qwave): New Lisp objects.
5403 (check_lface_attrs, merge_face_ref)
5404 (Finternal_set_lisp_face_attribute, realize_x_face):
5405 Handle wave-style underline face attributes.
5406 * xterm.c (x_draw_underwave): New function.
5407 (x_draw_glyph_string): Use it.
5408
5409 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5410
5411 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5412 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5413 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5414 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5415 ($(BLD)/w32select.$(O)): Update dependencies.
5416
5417 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5418
5419 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5420 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5421 * character.c (_fetch_multibyte_char_p): Remove.
5422 * alloc.c: Include "character.h" before "buffer.h".
5423 * bidi.c: Likewise.
5424 * buffer.c: Likewise.
5425 * bytecode.c: Likewise.
5426 * callint.c: Likewise.
5427 * callproc.c: Likewise.
5428 * casefiddle.c: Likewise.
5429 * casetab.c: Likewise.
5430 * category.c: Likewise.
5431 * cmds.c: Likewise.
5432 * coding.c: Likewise.
5433 * composite.c: Likewise.
5434 * dired.c: Likewise.
5435 * dispnew.c: Likewise.
5436 * doc.c: Likewise.
5437 * dosfns.c: Likewise.
5438 * editfns.c: Likewise.
5439 * emacs.c: Likewise.
5440 * fileio.c: Likewise.
5441 * filelock.c: Likewise.
5442 * font.c: Likewise.
5443 * fontset.c: Likewise.
5444 * fringe.c: Likewise.
5445 * indent.c: Likewise.
5446 * insdel.c: Likewise.
5447 * intervals.c: Likewise.
5448 * keyboard.c: Likewise.
5449 * keymap.c: Likewise.
5450 * lread.c: Likewise.
5451 * macros.c: Likewise.
5452 * marker.c: Likewise.
5453 * minibuf.c: Likewise.
5454 * nsfns.m: Likewise.
5455 * nsmenu.m: Likewise.
5456 * print.c: Likewise.
5457 * process.c: Likewise.
5458 * regex.c: Likewise.
5459 * region-cache.c: Likewise.
5460 * search.c: Likewise.
5461 * syntax.c: Likewise.
5462 * term.c: Likewise.
5463 * textprop.c: Likewise.
5464 * undo.c: Likewise.
5465 * unexsol.c: Likewise.
5466 * w16select.c: Likewise.
5467 * w32fns.c: Likewise.
5468 * w32menu.c: Likewise.
5469 * window.c: Likewise.
5470 * xdisp.c: Likewise.
5471 * xfns.c: Likewise.
5472 * xmenu.c: Likewise.
5473 * xml.c: Likewise.
5474 * xselect.c: Likewise.
5475
5476 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5477
5478 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5479 If all the glyphs of the glyph row came from strings, and we have no
5480 cursor positioning clues, put the cursor on the first glyph of the
5481 row.
5482 (handle_face_prop): Use chunk-relative overlay string index when
5483 indexing into it->string_overlays array. (Bug#11653)
5484 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5485 the rightmost. (Bug#11720)
5486
5487 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5488
5489 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5490 (CATEGORY_MEMBER): Enforce 1/0 value.
5491 * category.c (_temp_category_set): Remove.
5492
5493 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5494
5495 * window.c (Fdelete_other_windows_internal)
5496 (Fdelete_window_internal): Don't access frame's mouse highlight
5497 info of the initial frame. (Bug#11677)
5498
5499 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5500
5501 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5502 Assume USE_2_TAGS_FOR_INTS.
5503 (xreload): Adjust $tagmask width to match recent lisp.h change.
5504
5505 Simplify lisp.h in minor ways that should not affect code.
5506 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5507 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5508 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5509 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5510 (INTTYPEBITS): New macro, for clarity.
5511 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5512 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5513 Simplify now that USE_LSB_TAG is always defined.
5514 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5515 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5516
5517 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5518
5519 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5520
5521 2012-06-13 Glenn Morris <rgm@gnu.org>
5522
5523 * s/bsd-common.h (BSD4_3):
5524 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5525
5526 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5527
5528 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5529 instead of union.
5530 (XLI, XIL): Define.
5531 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5532 Use them.
5533 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5534 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5535 * alloc.c (widen_to_Lisp_Object): Remove.
5536 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5537 * frame.c (delete_frame): Remove outdated comment.
5538 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5539 USE_LISP_UNION_TYPE.
5540 (Fw32_unregister_hot_key): Likewise.
5541 (Fw32_toggle_lock_key): Likewise.
5542 * w32menu.c (add_menu_item): Likewise.
5543 (w32_menu_display_help): Use XIL instead of checking
5544 USE_LISP_UNION_TYPE.
5545 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5546 (init_heap): Likewise.
5547 * w32term.c (w32_read_socket): Update comment.
5548
5549 2012-06-13 Glenn Morris <rgm@gnu.org>
5550
5551 * s/usg5-4-common.h, src/s/unixware.h:
5552 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5553
5554 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5555
5556 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5557
5558 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5559 * alloc.c (make_number) [!defined make_number]:
5560 Remove, as lisp.h always defines this now.
5561 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5562 (roundup_size): Verify that it is a power of 2.
5563 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5564 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5565 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5566 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5567 USE_LSB_TAG now is always defined to be either 0 or 1.
5568 All uses changed.
5569 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5570 code works fine either way, and efficiency is not a concern here,
5571 as the union type is for debugging, not for production.
5572 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5573 Use an inline function on all platforms when using the union type,
5574 since this is simpler and 'static inline' can be used portably
5575 within Emacs now.
5576 (LISP_INITIALLY_ZERO): New macro.
5577 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5578 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5579
5580 2012-06-12 Glenn Morris <rgm@gnu.org>
5581
5582 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5583
5584 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5585
5586 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5587 Move BROKEN_SIGIO to configure.
5588
5589 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5590 Move NO_TERMIO to configure.
5591
5592 2012-06-12 Chong Yidong <cyd@gnu.org>
5593
5594 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5595 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5596 MagickExportImagePixels is undefined.
5597
5598 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5599
5600 * image.c (imagemagick_load_image): Remove unused label.
5601
5602 2012-06-11 Glenn Morris <rgm@gnu.org>
5603
5604 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5605 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5606 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5607 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5608
5609 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5610
5611 * alloc.c (make_byte_code): New function.
5612 (Fmake_byte_code): Use it. Don't purify here.
5613 * lread.c (read1): Use it as well to avoid extra allocation.
5614
5615 2012-06-11 Chong Yidong <cyd@gnu.org>
5616
5617 * image.c (imagemagick_load_image): Implement transparency.
5618
5619 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5620
5621 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5622 account for preceding backslashes. (Bug#11663)
5623
5624 2012-06-09 Chong Yidong <cyd@gnu.org>
5625
5626 * term.c: Support italics in capable terminals (Bug#9652).
5627 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5628 (turn_on_face): Output using TS_enter_italic_mode if available.
5629 Don't handle unused blinking and alt-charset cases.
5630 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5631 and tty_alt_charset_p cases.
5632 (tty_capable_p, init_tty): Support italics.
5633
5634 * termchar.h (struct tty_display_info): Add field for italics.
5635 Remove unused blink field.
5636
5637 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5638 Handle slant.
5639
5640 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5641 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5642 tty_alt_charset_p. Add tty_italic_p.
5643
5644 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5645
5646 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5647 dbus_type_is_basic if available.
5648 (xd_extract_signed, xd_extract_unsigned): Rename from
5649 extract_signed and extract_unsigned, respectively. Adapt callers.
5650
5651 2012-06-09 Chong Yidong <cyd@gnu.org>
5652
5653 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5654
5655 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5656 case (Bug#9752).
5657
5658 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5659
5660 * xdisp.c (vmessage): Treat frame message as multibyte.
5661 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5662 would generate the diagnostic "Making \302\247 buffer-local while
5663 let-bound!".
5664
5665 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5666
5667 * dispnew.c (showing_window_margins_p): Undo last change, which
5668 was done due to an inadvertent commit.
5669 (adjust_frame_glyphs_for_frame_redisplay): Do call
5670 showing_window_margins_p.
5671
5672 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5673
5674 * eval.c (Fmake_var_non_special): New primitive.
5675 (syms_of_eval): Defsubr it.
5676 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5677
5678 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5679
5680 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5681 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5682
5683 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5684
5685 * alloc.c (allocate_vectorlike): Fix last change.
5686
5687 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5688
5689 Block-based vector allocation of small vectors.
5690 * lisp.h (struct vectorlike_header): New field `nbytes',
5691 adjust comment accordingly.
5692 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5693 to denote vector blocks. Adjust users (live_vector_p,
5694 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5695 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5696 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5697 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5698 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5699 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5700 (roundup_size): New constant.
5701 (struct vector_block): New data type.
5702 (vector_blocks, vector_free_lists, zero_vector): New variables.
5703 (all_vectors): Rename to `large_vectors'.
5704 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5705 (sweep_vectors): New functions.
5706 (allocate_vectorlike): Return `zero_vector' as the only vector of
5707 0 items. Allocate new vector from block if vector size is less than
5708 or equal to VBLOCK_BYTES_MAX.
5709 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5710 (init_alloc_once): Add call to init_vectors.
5711
5712 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5713
5714 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5715
5716 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5717
5718 * doprnt.c (doprnt): Truncate multibyte char correctly.
5719 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5720 would mishandle a string argument "Xc" if X was a multibyte
5721 character of length 2: it would truncate after X's first byte
5722 rather than including all of X.
5723
5724 2012-06-06 Chong Yidong <cyd@gnu.org>
5725
5726 * buffer.c (word_wrap): Doc fix.
5727
5728 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5729
5730 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5731
5732 2012-06-03 Glenn Morris <rgm@gnu.org>
5733
5734 * xdisp.c (tool-bar-style): Doc fix.
5735
5736 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5737
5738 * Makefile.in (PAXCTL): Define.
5739 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5740 binary via PaX flags if the paxctl utility is available.
5741 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5742 Restore PaX flags to their default. (Bug#11398)
5743
5744 2012-06-03 Chong Yidong <cyd@gnu.org>
5745
5746 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5747 buffer (Bug#11226).
5748
5749 2012-06-03 Chong Yidong <cyd@gnu.org>
5750
5751 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5752 (note_mode_line_or_margin_highlight): If there is no help echo,
5753 use mode-line-default-help-echo. Handle the case where the mouse
5754 position is past the end of the mode line string.
5755
5756 * buffer.c (buffer_local_value_1): New function, split from
5757 Fbuffer_local_value; can return Qunbound.
5758 (Fbuffer_local_value): Use it.
5759 (Vmode_line_format): Docstring tweaks.
5760
5761 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5762
5763 * sysdep.c (system_process_attributes): Improve comment.
5764
5765 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5766
5767 * keyboard.c: Export real-this-command to Elisp.
5768 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5769 and DEFVAR it. Update all users.
5770
5771 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5772
5773 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5774
5775 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5776 Convert pctcpu and pctmem to Lisp float properly.
5777 Let the compiler fold better, as 100.0/0x8000 is exact.
5778
5779 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5780
5781 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5782 cons_block.
5783
5784 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5785
5786 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5787
5788 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5789
5790 For a 'struct window', replace some Lisp_Object fields to
5791 bitfields where appropriate, remove unused fields.
5792 * window.h (struct window): Remove unused 'last_mark_x' and
5793 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5794 change it's type from Lisp_Object to bitfield.
5795 Change type of 'force_start', 'optional_new_start',
5796 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5797 fields from Lisp_Object to bitfield. Adjust users accordingly.
5798
5799 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5800
5801 Pacify gcc -Wdouble-precision when using Xaw.
5802 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5803 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5804 Use 'float' consistently, rather than 'float' in most places
5805 and 'double' in a couple of places.
5806
5807 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5808
5809 * xdisp.c (handle_stop): Detect whether we have overlay strings
5810 loaded by testing it->current.overlay_string_index to be
5811 non-negative, instead of checking whether n_overlay_strings is
5812 positive. (Bug#11587)
5813
5814 2012-05-31 Chong Yidong <cyd@gnu.org>
5815
5816 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5817
5818 * doc.c (Fsubstitute_command_keys): Doc fix.
5819
5820 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5821
5822 * search.c (search_buffer): Remove calls to
5823 r_alloc_inhibit_buffer_relocation, as it is now called by
5824 maybe_unify_char, which was the cause of relocation of buffer text
5825 in bug#11519.
5826
5827 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5828
5829 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5830 for the duration of call to load_charset, to avoid problems with
5831 callers of maybe_unify_char that access buffer text through C
5832 pointers.
5833
5834 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5835 decrement the inhibition flag, instead of just setting or
5836 resetting it.
5837
5838 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5839
5840 Remove obsolete '#define static' cruft.
5841 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5842 This #undef was "temporary" in 2000; it is no longer needed
5843 now that '#define static' has gone away.
5844 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5845 (gray_bitmap_bits): Remove; no longer needed.
5846 All uses replaced with definiens.
5847 * xterm.c: Include "bitmaps/gray.xbm".
5848
5849 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5850
5851 Clean up __executable_start, monstartup when --enable-profiling.
5852 The following changes affect the code only when profiling.
5853 * dispnew.c (__executable_start): Rename from safe_bcopy.
5854 Define only on platforms that need it.
5855 * emacs.c: Include <sys/gmon.h> when profiling.
5856 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5857 (__executable_start): Remove decl, since lisp.h does it now.
5858 (safe_bcopy): Remove decl; no longer has that name.
5859 (main): Coalesce #if into single bit of code, for simplicity.
5860 Cast pointers to uintptr_t, since standard libraries want integers
5861 and not pointers.
5862 * lisp.h (__executable_start): New decl.
5863
5864 2012-05-31 Glenn Morris <rgm@gnu.org>
5865
5866 * image.c (Fimagemagick_types): Doc fix.
5867
5868 2012-05-30 Jim Meyering <meyering@redhat.com>
5869
5870 * callproc.c (Fcall_process_region): Include directory component
5871 in mkstemp error message (Bug#11586).
5872
5873 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5874
5875 * alloc.c, lisp.h (make_pure_vector): Now static.
5876
5877 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5878
5879 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5880 Move to byte-run.el.
5881 (Fautoload): Do the hash-doc more carefully.
5882 * data.c (Fdefalias): Purify definition, except for keymaps.
5883 (Qdefun): Move from eval.c.
5884 * lisp.h (Qdefun): Remove.
5885 * lread.c (read1): Tiny simplification.
5886
5887 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5888
5889 Do not create empty overlays with the evaporate property (Bug#9642).
5890 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5891 Bug#9642, but explicitly check that the buffer the overlay would
5892 be moved to is live and rearrange lines to make sure that errors
5893 will not put the overlay in an inconsistent state.
5894 (Fdelete_overlay): Cosmetics.
5895
5896 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5897
5898 * w32term.c (my_bring_window_to_top): New function.
5899 (x_raise_frame): Use handle returned by DeferWindowPos, which
5900 could be different from the original one.
5901 Call my_bring_window_to_top instead of my_set_foreground_window.
5902 (Bug#11513)
5903
5904 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5905 by calling BringWindowToTop.
5906
5907 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5908 (WM_EMACS_END): Increase by one.
5909
5910 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5911
5912 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5913 This avoids undefined behavior that might cause the eassert
5914 to not catch an out-of-range value.
5915
5916 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5917
5918 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5919 Update dependencies.
5920
5921 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5922
5923 * bidi.c (bidi_mirror_char): Fix last change.
5924
5925 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5926
5927 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5928 when referring to sectname field in printf format.
5929
5930 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5931
5932 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5933 Only r_alloc_inhibit_buffer_relocation needed to be added;
5934 the others were already declared.
5935
5936 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5937 before checking whether it's out of range. Put the check inside
5938 eassert. See
5939 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5940
5941 2012-05-27 Ken Brown <kbrown@cornell.edu>
5942
5943 * callproc.c (Fcall_process): Restore a line that was accidentally
5944 commented out in the 2011-02-13 change (bug#11547).
5945
5946 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5947
5948 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5949 defined on ralloc.c.
5950
5951 * buffer.c [REL_ALLOC]: Remove prototypes of
5952 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5953 they are now on lisp.h.
5954
5955 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5956
5957 * search.c (search_buffer): Use it to inhibit relocation of buffer
5958 text while re_search_2 is doing its job, because re_search_2 is
5959 passed C pointers to buffer text. (Bug#11519)
5960
5961 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5962 Update value to 24.
5963
5964 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5965 state after an additional call to move_it_in_display_line_to, keep
5966 the values of it->max_ascent and it->max_descent found for the
5967 entire line.
5968 (pos_visible_p): Revert the comparison against bottom_y to what it
5969 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5970 (Bug#11464)
5971
5972 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5973
5974 Fix coding-related core dumps with gcc -ftrapv.
5975 The code was computing A - B, where A and B are pointers, and B is
5976 random garbage. This can lead to core dumps on platforms that
5977 have special pointer registers, and it also leads to core dumps on
5978 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5979 A - B only when B is initialized properly.
5980 * coding.c (coding_set_source, coding_set_destination): Return void.
5981 (coding_change_source, coding_change_destinations): New functions,
5982 with the old behaviors of coding_set_source and coding_set_destination.
5983 All callers that need an offset changed to use these new functions.
5984
5985 2012-05-26 Glenn Morris <rgm@gnu.org>
5986
5987 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5988
5989 2012-05-26 Eli Zaretskii <eliz@gnu.org>
5990
5991 Extend mouse support on W32 text-mode console.
5992 * xdisp.c (draw_row_with_mouse_face):
5993 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
5994
5995 * w32console.c: Include window.h.
5996 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5997 New functions.
5998 (initialize_w32_display): Initialize mouse-highlight data.
5999
6000 * w32inevt.c: Include termchar.h and window.h.
6001 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6002 moves, call note_mouse_highlight. If help_echo changed, call
6003 gen_help_event to produce help-echo message in the echo area.
6004 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6005 highlight info.
6006
6007 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6008
6009 * lread.c (read1): Simplify slightly to avoid an overflow warning
6010 with GCC 4.7.0 on x86-64.
6011
6012 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6013
6014 * bidi.c (bidi_mirror_char): Revert last change: an int is
6015 definitely wide enough here.
6016
6017 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6018
6019 Fix integer width and related bugs (Bug#9874).
6020 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6021 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6022 (string_bytes, check_sblock, allocate_string_data):
6023 (compact_small_strings, Fmake_bool_vector, make_string)
6024 (make_unibyte_string, make_multibyte_string)
6025 (make_string_from_bytes, make_specified_string)
6026 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6027 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6028 (mark_vectorlike):
6029 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6030 (allocate_pseudovector):
6031 Use int, not EMACS_INT, where int is wide enough.
6032 (inhibit_garbage_collection, Fgarbage_collect):
6033 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6034 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6035 int might not be wide enough.
6036 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6037 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6038 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6039 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6040 (bidi_level_of_next_char, bidi_move_to_visually_next):
6041 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6042 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6043 (Fkill_buffer, Fset_buffer_major_mode)
6044 (advance_to_char_boundary, Fbuffer_swap_text)
6045 (Fset_buffer_multibyte, overlays_at, overlays_in)
6046 (overlay_touches_p, struct sortvec, record_overlay_string)
6047 (overlay_strings, recenter_overlay_lists)
6048 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6049 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6050 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6051 (Foverlay_recenter, last_overlay_modification_hooks_used)
6052 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6053 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6054 (validate_region): Omit unnecessary test for b <= e,
6055 since that's guaranteed by the previous test.
6056 (adjust_overlays_for_delete): Avoid pos + length overflow.
6057 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6058 (report_overlay_modification):
6059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6060 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6061 Omit pointer cast, which isn't needed anyway, and doesn't work
6062 after the EMACS_INT -> ptrdiff_t change.
6063 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6064 * buffer.h: Adjust decls to match defn changes elsewhere.
6065 (struct buffer_text, struct buffer):
6066 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6067 Use EMACS_INT, not int, where int might not be wide enough.
6068 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6069 not int, to avoid needless 32-bit limit on 64-bit hosts.
6070 (exec_byte_code): Use tighter memory-full test, one that checks
6071 for alloca overflow. Don't compute the address of the object just
6072 before an array, as that's not portable. Use EMACS_INT, not
6073 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6074 * callint.c (Fcall_interactively):
6075 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6076 * callproc.c (call_process_kill, Fcall_process):
6077 Don't assume pid_t fits into an Emacs fixnum.
6078 (call_process_cleanup, Fcall_process, child_setup):
6079 Don't assume pid_t fits into int.
6080 (call_process_cleanup, Fcall_process, delete_temp_file)
6081 (Fcall_process_region):
6082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6083 (Fcall_process): Simplify handling of volatile integers.
6084 Use int, not EMACS_INT, where int will do.
6085 * casefiddle.c (casify_object, casify_region, operate_on_word)
6086 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6087 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6088 (casify_object): Avoid integer overflow when overallocating buffer.
6089 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6090 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6091 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6092 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6093 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6094 integers are now checked earlier. All uses replaced with XINT.
6095 (ccl_driver):
6096 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6097 For CCL_MapSingle, check that content and value are in int range.
6098 (ccl_driver, Fregister_code_conversion_map):
6099 Check that Vcode_version_map_vector is a vector.
6100 (resolve_symbol_ccl_program): Check that vector header is in range.
6101 Always copy the vector, so that we can check its contents reliably
6102 now rather than having to recheck each instruction as it's being
6103 executed. Check that vector words fit in 'int'.
6104 (ccl_get_compiled_code, Fregister_ccl_program)
6105 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6106 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6107 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6108 contents are in range.
6109 (Fccl_execute_on_string): Check that status is in range.
6110 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6111 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6112 Accept and return EMACS_INT, not int, because callers can pass values
6113 out of 'int' range.
6114 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6115 (multibyte_chars_in_text, parse_str_as_multibyte)
6116 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6117 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6118 (string_escape_byte8, Fget_byte):
6119 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6120 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6121 avoid mishandling large integers.
6122 * character.h: Adjust decls to match defn changes elsewhere.
6123 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6124 (Ffind_charset_region):
6125 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6126 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6127 (load_charset_map_from_vector, Fdefine_charset_internal):
6128 Don't assume fixnum fits in int.
6129 (load_charset_map_from_vector, Fmap_charset_chars):
6130 Remove now-unnecessary CHECK_NATNUMs.
6131 (Fdefine_charset_internal): Check ranges here, more carefully.
6132 Don't rely on undefined behavior with signed left shift overflow.
6133 Don't assume unsigned int fits into fixnum, or that fixnum fits
6134 into unsigned int. Don't require max_code to be a valid fixnum;
6135 that's not true for gb10830 4-byte on a 32-bit host. Allow
6136 invalid_code to be a cons, for the same reason. Require code_offset
6137 to be a character. Avoid int overflow if max_char is close
6138 to INT_MAX.
6139 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6140 this is intended anyway and avoids some undefined behavior.
6141 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6142 INDEX_TO_CODE_POINT, as that's what it expects.
6143 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6144 * charset.h (DECODE_CHAR): Return int, not unsigned;
6145 this is what was intended anyway, and it avoids undefined behavior.
6146 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6147 integer-overflow issues.
6148 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6149 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6150 where the argument is EMACS_INT, and this behavior is not intended.
6151 * chartab.c (Fmake_char_table, Fset_char_table_range)
6152 (uniprop_get_decoder, uniprop_get_encoder):
6153 Don't assume fixnum fits in int.
6154 * cmds.c (move_point): New function, that does the gist of
6155 Fforward_char and Fbackward_char, but does so while checking
6156 for integer overflow more accurately.
6157 (Fforward_char, Fbackward_char): Use it.
6158 (Fforward_line, Fend_of_line, internal_self_insert)
6159 (internal_self_insert):
6160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6161 Fix a FIXME, by checking for integer overflow when calculating
6162 target_clm and actual_clm.
6163 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6164 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6165 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6166 (coding_alloc_by_making_gap, alloc_destination)
6167 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6168 (encode_coding_utf_16, detect_coding_emacs_mule)
6169 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6170 (detect_coding_iso_2022, decode_coding_iso_2022)
6171 (encode_invocation_designation, encode_designation_at_bol)
6172 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6173 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6174 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6175 (encode_coding_ccl, encode_coding_raw_text)
6176 (detect_coding_charset, decode_coding_charset)
6177 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6178 (produce_composition, produce_charset, produce_annotation)
6179 (decode_coding, handle_composition_annotation)
6180 (handle_charset_annotation, consume_chars, decode_coding_gap)
6181 (decode_coding_object, encode_coding_object, detect_coding_system)
6182 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6183 (code_convert_region, code_convert_string)
6184 (Fdefine_coding_system_internal)
6185 (coding_set_source, coding_set_destination):
6186 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6187 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6188 (Fdefine_coding_system_internal):
6189 Don't assume fixnums fit in int.
6190 (decode_coding_gap, decode_coding_object, encode_coding_object)
6191 (Fread_coding_system, Fdetect_coding_region)
6192 (Funencodable_char_position, Fcheck_coding_systems_region)
6193 (get_translation, handle_composition_annotation, consume_chars):
6194 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6195 (consume_chars): Rewrite to not calculate an address outside buffer.
6196 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6197 Don't access memory outside of the args array.
6198 (Fdefine_coding_system_internal): Check for charset-id overflow.
6199 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6200 result of ENCODE_CHAR.
6201 * coding.h: Adjust decls to match defn changes elsewhere.
6202 (struct coding_system):
6203 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6204 * composite.c (get_composition_id, find_composition)
6205 (run_composition_function, update_compositions)
6206 (compose_text, composition_gstring_put_cache)
6207 (composition_gstring_p, composition_gstring_width)
6208 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6209 (composition_compute_stop_pos, composition_reseat_it)
6210 (composition_update_it, struct position_record)
6211 (find_automatic_composition, composition_adjust_point)
6212 (Fcomposition_get_gstring, Ffind_composition_internal):
6213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6214 (update_compositions):
6215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6216 * composite.h: Adjust decls to match defn changes elsewhere.
6217 (struct composition):
6218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6219 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6220 Do not attempt to compute the address of the object just before a
6221 buffer; this is not portable.
6222 (Faref, Faset):
6223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6224 (Faset): Use int, not EMACS_INT, where int is wide enough.
6225 (Fstring_to_number): Don't assume fixnums fit in int.
6226 (Frem): Don't assume arg is nonnegative.
6227 * dbusbind.c (xd_append_arg): Check for integers out of range.
6228 (Fdbus_call_method): Don't overflow the timeout int.
6229 (extract_signed, extract_unsigned): New functions.
6230 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6231 (xd_get_connection_references): Return ptrdiff_t, not int.
6232 All uses changed.
6233 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6234 (xd_read_message_1):
6235 Use int, not unsigned, where the dbus API uses int.
6236 (Fdbus_message_internal): Don't overflow mtype.
6237 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6238 * dired.c (directory_files_internal, file_name_completion, scmp)
6239 (file_name_completion_stat):
6240 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6241 (file_name_completion): Don't overflow matchcount.
6242 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6243 * dispextern.h: Adjust decls to match defn changes elsewhere.
6244 (struct text_pos, struct glyph, struct bidi_saved_info)
6245 (struct bidi_string_data, struct bidi_it, struct composition_it)
6246 (struct it):
6247 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6248 (struct display_pos, struct composition_it, struct it):
6249 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6250 * dispnew.c (increment_matrix_positions)
6251 (increment_row_positions, mode_line_string)
6252 (marginal_area_string):
6253 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6254 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6255 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6256 (duration_to_sec_usec): New function, to check for overflow better.
6257 (Fsleep_for, sit_for): Use it.
6258 * doc.c (get_doc_string, store_function_docstring):
6259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6260 (get_doc_string, Fsnarf_documentation):
6261 Use int, not EMACS_INT, where int is wide enough.
6262 (get_doc_string):
6263 Use SAFE_ALLOCA, not alloca.
6264 Check for overflow when converting EMACS_INT to off_t.
6265 * doprnt.c (doprnt):
6266 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6267 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6268 Don't assume uid_t fits into fixnum.
6269 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6270 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6271 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6272 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6273 (general_insert_function)
6274 (Finsert_char, make_buffer_string, make_buffer_string_both)
6275 (update_buffer_properties, Fbuffer_substring)
6276 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6277 (Fsubst_char_in_region, check_translation)
6278 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6279 (transpose_markers, Ftranspose_regions):
6280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6281 (clip_to_bounds): Move to lisp.h as an inline function).
6282 (Fconstrain_to_field): Don't assume integers are nonnegative.
6283 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6284 (Fsubst_char_in_region, Fsave_restriction):
6285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6286 (Femacs_pid): Don't assume pid_t fits into fixnum.
6287 (lo_time): Use int, not EMACS_INT, when int suffices.
6288 (lisp_time_argument): Check for usec out of range.
6289 (Fencode_time): Don't assume fixnum fits in int.
6290 (Fuser_login_name, Fuser_full_name): Signal an error
6291 if a uid argument is out of range, rather than relying on
6292 undefined behavior.
6293 (Fformat_time_string): Remove now-unnecessary check.
6294 lisp_time_argument checks for out-of-range usec now.
6295 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6296 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6297 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6298 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6299 (init_cmdargs, Fdump_emacs):
6300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6301 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6302 the bottom (typically) 32 bits of the fixnum.
6303 * eval.c (specpdl_size, call_debugger):
6304 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6305 (when_entered_debugger, Fbacktrace_debug):
6306 Don't assume fixnum can fit in int.
6307 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6308 the object just before a buffer; this is not portable.
6309 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6310 (grow_specpdl, unbind_to):
6311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6312 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6313 (grow_specpdl): Simplify allocation by using xpalloc.
6314 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6315 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6316 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6317 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6318 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6319 (a_write, e_write):
6320 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6321 (Fcopy_file, non_regular_nbytes, read_non_regular)
6322 (Finsert_file_contents):
6323 Use int, not EMACS_INT, where int is wide enough.
6324 (READ_BUF_SIZE): Verify that it fits in int.
6325 (Finsert_file_contents): Check that counts are in proper range,
6326 rather than assuming fixnums fit into ptrdiff_t etc.
6327 Don't assume fixnums fit into int.
6328 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6329 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6330 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6331 (string_char_to_byte, string_byte_to_char)
6332 (string_make_multibyte, string_to_multibyte)
6333 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6334 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6335 (substring_both, Fdelete, internal_equal, Ffillarray)
6336 (Fclear_string, mapcar1)
6337 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6338 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6339 (larger_vector, make_hash_table, maybe_resize_hash_table)
6340 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6341 (Fmaphash, secure_hash):
6342 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6343 (concat): Check for string index and length overflow.
6344 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6345 (Frequire):
6346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6347 (larger_vector): New API (vec, incr_min, size_max) replaces old
6348 one (vec, new_size, init). This catches size overflow.
6349 INIT was removed because it was always Qnil.
6350 All callers changed.
6351 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6352 the upper bound on a hash table index size.
6353 (make_hash_table, maybe_resize_hash_table): Use it.
6354 (secure_hash): Computer start_byte and end_byte only after
6355 they're known to be in ptrdiff_t range.
6356 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6357 (Ffont_get_glyphs, Ffont_at):
6358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6359 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6360 (Flist_fonts, Fopen_font):
6361 Don't assume fixnum can fit in int.
6362 (check_gstring): Don't assume index can fit in int.
6363 (font_match_p): Check that fixnum is a character, not a nonnegative
6364 fixnum, since the later code needs to stuff it into an int.
6365 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6366 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6367 conversion overflow issues.
6368 (Fopen_font): Check for integer out of range.
6369 (Ffont_get_glyphs): Don't assume index can fit in int.
6370 * font.h: Adjust decls to match defn changes elsewhere.
6371 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6372 integer overflow.
6373 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6374 printmax_t, where ptrdiff_t is wide enough.
6375 (Finternal_char_font):
6376 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6377 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6378 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6379 (Fset_frame_position, x_set_frame_parameters)
6380 (x_set_line_spacing, x_set_border_width)
6381 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6382 Check that fixnums are in proper range for system types.
6383 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6385 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6386 Use SAFE_ALLOCA_LISP, not alloca.
6387 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6388 intptr_t is wide enough.
6389 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6390 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6391 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6392 Check for fixnum out of range.
6393 * ftfont.c (ftfont_list): Don't assume index fits in int.
6394 Check that fixnums are in proper range for system types.
6395 (ftfont_shape_by_flt):
6396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6397 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6399 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6400 Check that fixnums are in proper range for system types.
6401 * gnutls.h: Adjust decls to match defn changes elsewhere.
6402 * gtkutil.c (xg_dialog_run):
6403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6404 (update_frame_tool_bar):
6405 Check that fixnums are in proper range for system types.
6406 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6407 (lookup_image): Check that fixnums are in range for system types.
6408 * indent.c (last_known_column, last_known_column_point):
6409 (current_column_bol_cache):
6410 (skip_invisible, current_column, check_display_width):
6411 (check_display_width, scan_for_column, current_column_1)
6412 (Findent_to, Fcurrent_indentation, position_indentation)
6413 (indented_beyond_p, Fmove_to_column, compute_motion):
6414 (Fcompute_motion, Fvertical_motion):
6415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6416 (last_known_column_modified): Use EMACS_INT, not int.
6417 (check_display_width):
6418 (Fcompute_motion):
6419 Check that fixnums and floats are in proper range for system types.
6420 (compute_motion): Don't assume index or fixnum fits in int.
6421 (compute_motion, Fcompute_motion):
6422 Use int, not EMACS_INT, when it is wide enough.
6423 (vmotion): Omit local var start_hpos that is always 0; that way
6424 we don't need to worry about overflow in expressions involving it.
6425 * indent.h: Adjust decls to match defn changes elsewhere.
6426 (struct position):
6427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6428 Use int, not EMACS_INT, where int is wide enough.
6429 Remove unused members ovstring_chars_done and tab_offset;
6430 all uses removed.
6431 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6432 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6433 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6434 (make_gap, copy_text, insert, insert_and_inherit)
6435 (insert_before_markers, insert_before_markers_and_inherit)
6436 (insert_1, count_combining_before, count_combining_after)
6437 (insert_1_both, insert_from_string)
6438 (insert_from_string_before_markers, insert_from_string_1)
6439 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6440 (adjust_after_replace, adjust_after_insert, replace_range)
6441 (replace_range_2, del_range, del_range_1, del_range_byte)
6442 (del_range_both, del_range_2, modify_region)
6443 (prepare_to_modify_buffer, signal_before_change)
6444 (signal_after_change, Fcombine_after_change_execute):
6445 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6446 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6447 (balance_an_interval, split_interval_right, split_interval_left)
6448 (find_interval, next_interval, update_interval)
6449 (adjust_intervals_for_insertion, delete_node, delete_interval)
6450 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6451 (static_offset_intervals, offset_intervals)
6452 (merge_interval_right, merge_interval_left, make_new_interval)
6453 (graft_intervals_into_buffer, temp_set_point_both)
6454 (temp_set_point, set_point, adjust_for_invis_intang)
6455 (set_point_both, move_if_not_intangible, get_property_and_range)
6456 (get_local_map, copy_intervals, copy_intervals_to_string)
6457 (compare_string_intervals, set_intervals_multibyte_1):
6458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6459 * intervals.h: Adjust decls to match defn changes elsewhere.
6460 (struct interval):
6461 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6462 * keyboard.c (this_command_key_count, this_single_command_key_start)
6463 (before_command_key_count, before_command_echo_length, echo_now)
6464 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6465 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6466 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6467 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6469 (last_non_minibuf_size, last_point_position, echo_truncate)
6470 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6471 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6472 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6473 (stuff_buffered_input):
6474 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6475 (last_auto_save, command_loop_1, read_char):
6476 Use EMACS_INT, not int, to avoid integer overflow.
6477 (record_char): Avoid overflow in total_keys computation.
6478 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6479 * keyboard.h: Adjust decls to match defn changes elsewhere.
6480 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6481 (Fkey_description, Fdescribe_vector, Flookup_key):
6482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6483 (click_position): New function, to check that positions are in range.
6484 (Fcurrent_active_maps):
6485 (describe_command):
6486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6487 (Faccessible_keymaps, Fkey_description):
6488 (preferred_sequence_p):
6489 Don't assume fixnum can fit into int.
6490 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6491 Check for integer overflow in size calculations.
6492 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6493 avoid mishandling large integers.
6494 * lisp.h: Adjust decls to match defn changes elsewhere.
6495 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6496 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6497 (struct Lisp_Marker):
6498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6499 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6500 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6501 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6502 All callers changed.
6503 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6504 Assume the arg has valid form, since it always does.
6505 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6506 unsigned integer system type.
6507 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6508 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6509 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6510 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6511 (duration_to_sec_usec): New decl.
6512 * lread.c (read_from_string_index, read_from_string_index_byte)
6513 (read_from_string_limit, readchar, unreadchar, openp)
6514 (read_internal_start, read1, oblookup):
6515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6516 (Fload, readevalloop, Feval_buffer, Feval_region):
6517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6518 (openp): Check for out-of-range argument to 'access'.
6519 (read1): Use int, not EMACS_INT, where int is wide enough.
6520 Don't assume fixnum fits into int.
6521 Fix off-by-one error that can read outside a buffer.
6522 (read_filtered_event): Use duration_to_sec_usec
6523 to do proper overflow checking on durations.
6524 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6525 in size calculation.
6526 (Fexecute_kbd_macro):
6527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6528 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6529 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6530 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6531 (set_marker_both, set_marker_restricted_both, marker_position)
6532 (marker_byte_position, Fbuffer_has_markers_at):
6533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6534 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6535 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6536 It now merely ensures that the menu is large enough, without
6537 necessarily growing it, as this avoids some integer overflow issues.
6538 All callers changed.
6539 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6541 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6542 Use SAFE_ALLOCA_LISP, not alloca.
6543 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6544 to EMACS_INT. Check that fixnums are in proper range for system types.
6545 * minibuf.c (minibuf_prompt_width, string_to_object)
6546 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6547 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6548 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6549 (get_minibuffer, read_minibuf_unwind):
6550 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6551 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6552 this simplifies overflow checking. All callers changed.
6553 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6554 (Ftest_completion):
6555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6556 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6557 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6558 Check that fixnums are in proper range for system types.
6559 (Fx_create_frame, Fx_show_tip):
6560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6561 * nsfont.m (ns_findfonts, nsfont_list_family):
6562 Don't assume fixnum fits in long.
6563 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6564 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6565 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6566 wide enough.
6567 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6568 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6569 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6570 (PRINTDECLARE, PRINTPREPARE):
6571 (strout, print_string):
6572 (print, print_preprocess, print_check_string_charset_prop)
6573 (print_object):
6574 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6575 (PRINTDECLARE):
6576 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6578 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6579 (printchar, strout): Use xpalloc to catch size calculation overflow.
6580 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6581 (print_error_message): Use SAFE_ALLOCA, not alloca.
6582 (print_object): Use int, not EMACS_INT, where int is wide enough.
6583 (print_depth, new_backquote_output, print_number_index):
6584 Use ptrdiff_t, not int, where int might not be wide enough.
6585 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6586 (Fset_process_window_size, Fformat_network_address)
6587 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6588 (sigchld_handler):
6589 Check that fixnums are in proper range for system types.
6590 (Fsignal_process): Simplify by avoiding a goto.
6591 Check for process-ids out of pid_t range rather than relying on
6592 undefined behavior.
6593 (process_tick, update_tick): Use EMACS_INT, not int.
6594 (Fformat_network_address, read_process_output, send_process)
6595 (Fprocess_send_region, status_notify):
6596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6597 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6598 (wait_reading_process_output, read_process_output, exec_sentinel):
6599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6600 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6601 (Faccept_process_output): Use duration_to_sec_usec to do proper
6602 overflow checking on durations.
6603 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6604 Don't assume pid_t fits in int.
6605 * process.h (struct Lisp_Process): Members tick and update_tick
6606 are now of type EMACS_INT, not int.
6607 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6608 configured --with-wide-int.
6609 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6610 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6611 * search.c (looking_at_1, string_match_1):
6612 (fast_string_match, fast_c_string_match_ignore_case)
6613 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6614 (scan_newline, find_before_next_newline, search_command)
6615 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6616 (set_search_regs, wordify):
6617 (Freplace_match):
6618 (Fmatch_data):
6619 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6620 (string_match_1, search_buffer, set_search_regs):
6621 (Fmatch_data):
6622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6623 (wordify): Check for overflow in size calculation.
6624 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6625 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6626 Check that fixnums are in proper range for system types.
6627 * sound.c (struct sound_device)
6628 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6630 (Fplay_sound_internal):
6631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6632 * syntax.c (struct lisp_parse_state, find_start_modiff)
6633 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6634 (Fparse_partial_sexp):
6635 Don't assume fixnums can fit in int.
6636 (struct lisp_parse_state, find_start_pos, find_start_value)
6637 (find_start_value_byte, find_start_begv)
6638 (update_syntax_table, char_quoted, dec_bytepos)
6639 (find_defun_start, prev_char_comend_first, back_comment):
6640 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6641 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6642 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6643 (Finternal_describe_syntax_value): Check that match_lisp is a
6644 character, not an integer, since the code stuffs it into int.
6645 (scan_words, scan_sexps_forward):
6646 Check that fixnums are in proper range for system types.
6647 (Fforward_word):
6648 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6649 (scan_sexps_forward):
6650 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6651 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6652 * syntax.h: Adjust decls to match defn changes elsewhere.
6653 (struct gl_state_s):
6654 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6655 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6656 MOST_POSITIVE_FIXNUM.
6657 * sysdep.c (wait_for_termination_1, wait_for_termination)
6658 (interruptible_wait_for_termination, mkdir):
6659 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6660 (emacs_read, emacs_write):
6661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6662 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6663 and double all fit in int.
6664 * term.c (set_tty_color_mode):
6665 Check that fixnums are in proper range for system types.
6666 * termhooks.h (struct input_event):
6667 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6668 * textprop.c (validate_interval_range, interval_of)
6669 (Fadd_text_properties, set_text_properties_1)
6670 (Fremove_text_properties, Fremove_list_of_text_properties)
6671 (Ftext_property_any, Ftext_property_not_all)
6672 (copy_text_properties, text_property_list, extend_property_ranges)
6673 (verify_interval_modification):
6674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6675 (Fnext_single_char_property_change)
6676 (Fprevious_single_char_property_change):
6677 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6678 (copy_text_properties):
6679 Check for integer overflow in index calculation.
6680 * undo.c (last_boundary_position, record_point, record_insert)
6681 (record_delete, record_marker_adjustment, record_change)
6682 (record_property_change):
6683 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6684 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6685 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6686 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6687 (Fx_hide_tip, Fx_file_dialog):
6688 * w32menu.c (set_frame_menubar):
6689 Use ptrdiff_t, not int, for consistency with rest of code.
6690 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6691 (select_window, Fdelete_other_windows_internal)
6692 (window_scroll_pixel_based, window_scroll_line_based)
6693 (Frecenter, Fset_window_configuration):
6694 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6695 (Fset_window_hscroll, run_window_configuration_change_hook)
6696 (set_window_buffer, temp_output_buffer_show, scroll_command)
6697 (Fscroll_other_window, Frecenter):
6698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6699 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6700 Don't assume fixnum fits in int.
6701 (Fset_window_scroll_bars):
6702 Check that fixnums are in proper range for system types.
6703 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6704 (string_pos, c_string_pos, number_of_chars, init_iterator)
6705 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6706 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6707 (compute_display_string_end, handle_face_prop)
6708 (face_before_or_after_it_pos, handle_invisible_prop)
6709 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6710 (display_prop_intangible_p, string_buffer_position_lim)
6711 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6712 (get_overlay_strings_1, get_overlay_strings)
6713 (iterate_out_of_display_property, forward_to_next_line_start)
6714 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6715 (get_next_display_element, set_iterator_to_next)
6716 (get_visually_first_element, compute_stop_pos_backwards)
6717 (handle_stop_backwards, next_element_from_buffer)
6718 (move_it_in_display_line_to, move_it_in_display_line)
6719 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6720 (add_to_log, message_dolog, message_log_check_duplicate)
6721 (message2, message2_nolog, message3, message3_nolog
6722 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6723 (current_message_1, truncate_echo_area, truncate_message_1)
6724 (set_message, set_message_1, store_mode_line_noprop)
6725 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6726 (text_outside_line_unchanged_p, check_point_in_composition)
6727 (reconsider_clip_changes)
6728 (redisplay_internal, set_cursor_from_row, try_scrolling)
6729 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6730 (redisplay_window, find_last_unchanged_at_beg_row)
6731 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6732 (trailing_whitespace_p, find_row_edges, display_line)
6733 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6734 (display_mode_element, store_mode_line_string)
6735 (pint2str, pint2hrstr, decode_mode_spec)
6736 (display_count_lines, display_string, draw_glyphs)
6737 (x_produce_glyphs, x_insert_glyphs)
6738 (rows_from_pos_range, mouse_face_from_buffer_pos)
6739 (fast_find_string_pos, mouse_face_from_string_pos)
6740 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6742 (safe_call, init_from_display_pos, handle_fontified_prop)
6743 (handle_single_display_spec, load_overlay_strings)
6744 (with_echo_area_buffer, setup_echo_area_for_printing)
6745 (display_echo_area, echo_area_display)
6746 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6747 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6748 (redisplay_window, dump_glyph_row, display_mode_line)
6749 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6750 (handle_display_spec, display_prop_string_p):
6751 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6752 (handle_single_display_spec, build_desired_tool_bar_string)
6753 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6754 (get_specified_cursor_type):
6755 Check that fixnums are in proper range for system types.
6756 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6757 (Flookup_image_map):
6758 Don't assume fixnums fit in int.
6759 (compare_overlay_entries):
6760 Avoid mishandling comparisons due to subtraction overflow.
6761 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6762 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6763 (handle_tool_bar_click):
6764 Use int, not unsigned, since we prefer signed and the signedness
6765 doesn't matter here.
6766 (get_next_display_element, next_element_from_display_vector):
6767 Use int, not EMACS_INT, when int is wide enough.
6768 (start_hourglass): Use duration_to_sec_usec to do proper
6769 overflow checking on durations.
6770 * xfaces.c (Fbitmap_spec_p):
6771 Check that fixnums are in proper range for system types.
6772 (compare_fonts_by_sort_order):
6773 Avoid mishandling comparisons due to subtraction overflow.
6774 (Fx_family_fonts, realize_basic_faces):
6775 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6776 (Fx_family_fonts):
6777 Don't assume fixnum fits in int.
6778 Use SAFE_ALLOCA_LISP, not alloca.
6779 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6780 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6781 (face_at_buffer_position, face_for_overlay_string)
6782 (face_at_string_position):
6783 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6784 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6785 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6786 (Fx_show_tip):
6787 Check that fixnums are in proper range for system types.
6788 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6789 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6791 (Fx_change_window_property): Don't assume fixnums fit in int.
6792 * xfont.c (xfont_chars_supported):
6793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6794 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6795 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6796 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6797 * xml.c (parse_region):
6798 * xrdb.c (magic_file_p):
6799 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6800 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6801 (x_get_local_selection, x_reply_selection_request)
6802 (x_handle_selection_request, wait_for_property_change):
6803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6804 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6805 short is wide enough.
6806 (x_send_client_event): Don't assume fixnum fits in int.
6807 * xterm.c (x_x_to_emacs_modifiers):
6808 Don't assume EMACS_INT overflows nicely into int.
6809 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6810 may come from Lisp.
6811 (handle_one_xevent): NATNUMP can eval its arg twice.
6812 (x_connection_closed):
6813 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6814 * xterm.h: Adjust decls to match defn changes elsewhere.
6815 (struct scroll_bar): Use struct vectorlike_header
6816 rather than rolling our own approximation.
6817 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6818
6819 2012-05-25 Glenn Morris <rgm@gnu.org>
6820
6821 * lisp.mk (lisp): Update for more files being compiled now.
6822
6823 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6824
6825 * lread.c: Remove `read_pure' which makes no difference.
6826 (read_pure): Remove var.
6827 (unreadpure): Remove function.
6828 (readevalloop): Don't call read_list with -1 flag.
6829 (read1, read_vector): Don't test read_pure any more.
6830 (read_list): Simplify.
6831
6832 * fileio.c, character.h: Minor style tweaks.
6833
6834 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6835
6836 * window.h (clip_changed): Remove useless declaration.
6837
6838 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6839
6840 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6841 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6842
6843 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6844
6845 Remove src/m/*.
6846 This directory predates autoconf and is no longer needed nowadays.
6847 Move its few remaining bits of functionality to where they're needed.
6848 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6849 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6850 * m/template.h: Remove.
6851 * Makefile.in (M_FILE): Remove. All uses removed.
6852 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6853 * lisp.h (USE_LSB_TAG):
6854 * mem-limits.h (EXCEEDS_LISP_PTR):
6855 Use VAL_MAX, not VALBITS, in #if.
6856 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6857 (EMACS_UINT): Define unconditionally now.
6858 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6859 (BITS_PER_EMACS_INT): New constants, replacing
6860 what used to be in config.h, but not useful in #if.
6861 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6862 define them any more.
6863 (VAL_MAX): New macro.
6864 (VALMASK): Use it.
6865 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6866 BITS_PER_EMACS_INT, in #if.
6867 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6868 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6869 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6870 * s/ms-w32.h (DATA_START):
6871 Move here from removed file m/intel386.h.
6872 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6873 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6874
6875 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6876
6877 Assume C89 or later.
6878 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6879 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6880 (xrealloc):
6881 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6882 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6883 * textprop.c, tparam.c (NULL): Remove.
6884 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6885 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6886 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6887 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6888 * xterm.c (input_signal_count): Assume volatile works.
6889
6890 2012-05-21 Ken Brown <kbrown@cornell.edu>
6891
6892 * xgselect.c (xg_select): Fix first argument in call to 'select'
6893 (bug#11508).
6894
6895 2012-05-20 Ken Brown <kbrown@cornell.edu>
6896
6897 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6898 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6899
6900 2012-05-19 Ken Brown <kbrown@cornell.edu>
6901
6902 * xfns.c (x_in_use): Remove `static' qualifier.
6903 * xterm.h (x_in_use): Declare.
6904 * xgselect.c: Include xterm.h.
6905 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6906 and `display_arg' (bug#9754).
6907
6908 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6909
6910 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6911
6912 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6913 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6914
6915 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6916
6917 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6918
6919 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6920 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6921
6922 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6923 reference to image_cache->refcount.
6924 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6925
6926 2012-05-17 Juri Linkov <juri@jurta.org>
6927
6928 * search.c (Fword_search_regexp, Fword_search_backward)
6929 (Fword_search_forward, Fword_search_backward_lax)
6930 (Fword_search_forward_lax): Move functions to isearch.el
6931 (bug#10145, bug#11381).
6932
6933 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6934
6935 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6936
6937 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6938
6939 * lread.c (init_obarray): Declare Qt and Qnil as special.
6940
6941 2012-05-14 Glenn Morris <rgm@gnu.org>
6942
6943 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6944 Put "libexec" before "bin", for the sake of init_callproc_1.
6945
6946 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6947
6948 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6949
6950 * unexaix.c: Port to more-recent AIX compilers.
6951 (report_error, report_error_1, make_hdr, copy_sym)
6952 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6953 Make arguments const char *, not char *, to avoid violations of C
6954 standard and to fix some AIX warnings reported by Gilles Pion.
6955
6956 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6957
6958 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6959 already have overlays loaded.
6960 (handle_single_display_spec): Before returning without displaying
6961 fringe bitmap, synchronize the bidi iterator with the main display
6962 iterator, by calling iterate_out_of_display_property.
6963 (iterate_out_of_display_property): Detect buffer iteration by
6964 testing that it->string is a Lisp string.
6965 (get_next_display_element): When the current object is exhausted,
6966 and there's something on it->stack, call set_iterator_to_next to
6967 proceed with what's on the stack, instead of returning zero.
6968 (set_iterator_to_next): If called at the end of a Lisp string,
6969 proceed to consider_string_end without incrementing string
6970 position. Don't increment display vector index past the end of
6971 the display vector. (Bug#11417)
6972 (pos_visible_p): Don't report a position visible when move_it_to
6973 stopped at the last line of window, which happens to be scanned
6974 backwards by the bidi iteration. (Bug#11464)
6975
6976 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6977
6978 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6979 and right-margin display specs even if the spec is invalid or we
6980 are on a TTY, and thus unable to display on the fringes.
6981 That's because the text with the property will not be displayed anyway,
6982 so we need to signal to the caller that this is a "replacing"
6983 display spec. This fixes display when the spec is invalid or we
6984 are on a TTY.
6985
6986 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6987
6988 * unexaix.c (make_hdr): Fix typo in prototype.
6989 This bug broke the build on AIX. Problem reported by Gilles Pion.
6990
6991 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
6992
6993 * keyboard.c (kbd_buffer_get_event): Read special events also in
6994 batch mode. (Bug#11415)
6995
6996 2012-05-12 Glenn Morris <rgm@gnu.org>
6997
6998 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6999
7000 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7001
7002 * lisp.mk (lisp): Add newcomment.elc.
7003
7004 2012-05-12 Glenn Morris <rgm@gnu.org>
7005
7006 * Makefile.in (MKDIR_P): New, set by configure.
7007 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7008
7009 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7010
7011 Remove unused function hourglass_started.
7012 * dispextern.h (hourglass_started):
7013 * w32fns.c (hourglass_started):
7014 * xdisp.c (hourglass_started): Remove.
7015
7016 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7017
7018 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7019 Update dependencies.
7020
7021 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7022
7023 * xgselect.c (xg_select): Put maxfds+1 into a var.
7024 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7025
7026 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7027
7028 2012-05-10 Dave Abrahams <dave@boostpro.com>
7029
7030 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7031 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7032
7033 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7034
7035 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7036 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7037 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7038 Initialize xd_registered_buses.
7039
7040 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7041
7042 Untag more efficiently if USE_LSB_TAG.
7043 This is based on a proposal by YAMAMOTO Mitsuharu in
7044 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7045 For an admittedly artificial (nth 8000 longlist) benchmark on
7046 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7047 Emacs's overall text size by 1%.
7048 * lisp.h (XUNTAG): New macro.
7049 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7050 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7051 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7052 * eval.c (Fautoload):
7053 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7054 * frame.h (XFRAME): Use XUNTAG.
7055
7056 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7057 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7058 Remove unportable assumptions about print widths of types like
7059 dbus_uint32_t.
7060 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7061 intptr_t when converting between pointer and integer, to avoid GCC
7062 warnings about wrong width.
7063
7064 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7065
7066 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7067 stack for each reader_thread, instead of defaulting to 8MB
7068 determined by the linker. This avoids failures in creating
7069 subprocesses on Windows 7, see the discussion in this thread:
7070 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7071
7072 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7073
7074 Fix up display of the *Minibuf-0* buffer in the mini window.
7075 * keyboard.c (read_char): Don't clear the echo area if there's no
7076 message to clear.
7077 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7078 contents of *Minibuf-0*) if there's no message displayed in its stead.
7079
7080 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7081
7082 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7083 batch mode.
7084
7085 2012-05-06 Chong Yidong <cyd@gnu.org>
7086
7087 * lisp.mk (lisp): Update.
7088
7089 2012-05-05 Jim Meyering <meyering@redhat.com>
7090
7091 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7092
7093 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7094
7095 * data.c (PUT_ERROR): New macro.
7096 (syms_of_data): Use it. Add new error type `user-error'.
7097 * undo.c (user_error): New function.
7098 (Fprimitive_undo): Use it.
7099 * print.c (print_error_message): Adjust print style for `user-error'.
7100 * keyboard.c (user_error): New function.
7101 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7102
7103 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 Do not limit current-time-string to years 1000..9999.
7106 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7107 (Fcurrent_time_string): Support any year that is supported by the
7108 underlying localtime representation. Don't use asctime, as it
7109 has undefined behavior for years outside the range -999..9999.
7110
7111 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7112
7113 Fix race conditions involving setenv, gmtime, localtime, asctime.
7114 Without this fix, interrupts could mess up code that uses these
7115 nonreentrant functions, since setting TZ invalidates existing
7116 tm_zone or tzname values, and since most of these functions return
7117 pointers to static storage.
7118 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7119 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7120 Grow the critical sections to include not just invoking
7121 localtime/gmtime, but also accessing these functions' results
7122 including their tm_zone values if any, and any related TZ setting.
7123 (format_time_string): Last arg is now struct tm *, not struct tm **,
7124 so that the struct tm is saved in the critical section.
7125 All callers changed. Simplify allocation of initial buffer, partly
7126 motivated by the fact that memory allocation needs to be outside
7127 the critical section.
7128
7129 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7130
7131 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7132 with RESET_INTERVAL.
7133
7134 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7135 Remove duplicated buffer name initialization.
7136
7137 2012-05-02 Jim Meyering <jim@meyering.net>
7138
7139 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7140
7141 * xfns.c (x_window): Use xstrdup (Bug#11375).
7142
7143 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7144
7145 * xdisp.c (pos_visible_p): If already at a newline from the
7146 display string before the 'while' loop, don't walk back the glyphs
7147 from it3.glyph_row. Solves assertion violation when the display
7148 string begins with a newline (egg.el). (Bug#11367)
7149
7150 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7151
7152 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7153 Move to simple.el.
7154
7155 2012-05-01 Glenn Morris <rgm@gnu.org>
7156
7157 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7158 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7159 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7160 All were removed before 23.1.
7161
7162 * dispnew.c: Remove HAVE_LIBNCURSES test;
7163 it is always true on relevant platforms.
7164
7165 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7166 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7167
7168 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7169
7170 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7171
7172 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7173 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7174 Remove.
7175
7176 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7177
7178 Do not avoid creating empty evaporating overlays (Bug#9642).
7179 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7180 That is, do not delete an evaporating overlay if it becomes
7181 empty after its bounds are adjusted to fit within its buffer.
7182 This fix caused other problems, and I'm reverting it until we get
7183 to the bottom of them.
7184
7185 2012-04-27 Chong Yidong <cyd@gnu.org>
7186
7187 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7188
7189 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7190
7191 * xdisp.c (pos_visible_p): If the window start position is beyond
7192 ZV, start the display from buffer beginning. Prevents assertion
7193 violation in init_iterator when the minibuffer window is scrolled
7194 via the scroll bar.
7195
7196 * window.c (window_scroll_pixel_based): Likewise.
7197
7198 2012-04-27 Chong Yidong <cyd@gnu.org>
7199
7200 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7201
7202 2012-04-27 Glenn Morris <rgm@gnu.org>
7203
7204 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7205 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7206
7207 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7208
7209 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7210 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7211
7212 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7213
7214 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7215 display element, check also the underlying string or buffer
7216 character. (Bug#11341)
7217
7218 * w32menu.c: Include w32heap.h.
7219 (add_menu_item): If the call to AppendMenuW (via
7220 unicode_append_menu) fails, disable Unicode menus only if we are
7221 running on Windows 9X/Me.
7222
7223 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7224
7225 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7226 (xgetint): Add missing shift for LSB tags.
7227
7228 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7229
7230 * keyboard.c (read_char): Don't wipe echo area for select window
7231 events: These might get delayed via `mouse-autoselect-window'
7232 (Bug#11304).
7233
7234 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7235
7236 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7237 manipulation of :loaded-from data.
7238
7239 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7240
7241 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7242 now a cons (bug#11311).
7243
7244 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7245
7246 Do not create empty overlays with the evaporate property (Bug#9642).
7247 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7248 if it becomes empty after its bounds are adjusted to fit within
7249 its buffer. Without this fix, in a nonempty buffer (let ((o
7250 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7251 yields an empty overlay that has the evaporate property, which is
7252 not supposed to happen.
7253
7254 Fix minor GTK3 problems found by static checking.
7255 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7256 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7257 (struct _EmacsFixedClass, emacs_fixed_get_type):
7258 Move decls here from emacsgtkfixed.h, since they needn't be public.
7259 (emacs_fixed_get_type): Now static.
7260 (emacs_fixed_class_init): Omit unused local.
7261 (emacs_fixed_child_type): Remove; unused.
7262 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7263 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7264 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7265 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7266 (EMACS_FIXED_GET_CLASS): Remove; unused.
7267 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7268
7269 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7270 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7271
7272 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7273
7274 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7275 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7276 (__malloc_size_t, __malloc_ptrdiff_t):
7277 Remove. All uses removed, replaced by the definiens if needed,
7278 since we can assume C89 or better now.
7279 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7280 (protect_malloc_state, align, get_contiguous_space)
7281 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7282 (malloc_atfork_handler_child, malloc_enable_thread)
7283 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7284 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7285 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7286 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7287 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7288 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7289 Define using prototypes, not old style.
7290 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7291 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7292 (align): Don't assume that signed integer overflow wraps around.
7293 Omit unused local var.
7294 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7295 (_free_internal_nolock, memalign, mallochook, reallochook):
7296 Omit no-longer-needed casts.
7297 (valloc): Use getpagesize, not __getpagesize.
7298 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7299 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7300
7301 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7302
7303 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7304
7305 Move functions from C to Lisp. Make non-blocking method calls
7306 the default. Implement further D-Bus standard interfaces.
7307
7308 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7309 (QCdbus_request_name_allow_replacement)
7310 (QCdbus_request_name_replace_existing)
7311 (QCdbus_request_name_do_not_queue)
7312 (QCdbus_request_name_reply_primary_owner)
7313 (QCdbus_request_name_reply_in_queue)
7314 (QCdbus_request_name_reply_exists)
7315 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7316 (QCdbus_registered_serial, QCdbus_registered_method)
7317 (QCdbus_registered_signal): New Lisp objects.
7318 (XD_DEBUG_MESSAGE): Use sizeof.
7319 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7320 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7321 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7322 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7323 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7324 (xd_signature, xd_append_arg): Allow float for integer types.
7325 (xd_get_connection_references): New function.
7326 (xd_get_connection_address): Rename from xd_initialize.
7327 Return cached address.
7328 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7329 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7330 level.
7331 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7332 Return number of refcounts.
7333 (Fdbus_get_unique_name): Make stronger parameter check.
7334 (Fdbus_message_internal): New defun.
7335 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7336 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7337 (Fdbus_send_signal, Fdbus_register_service)
7338 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7339 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7340 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7341 (Vdbus_compiled_version, Vdbus_runtime_version)
7342 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7343 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7344 (Vdbus_message_type_signal): New defvars.
7345 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7346 Adapt docstring.
7347
7348 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7349
7350 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7351 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7352 Do not assume ptrdiff_t is the same width as 'int'.
7353
7354 * alloc.c: Handle unusual debugging option combinations.
7355 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7356 since the two debugging options are incompatible.
7357 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7358 is defined.
7359 (mem_init, mem_insert, mem_insert_fixup):
7360 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7361 (NEED_MEM_INSERT): Remove; no longer needed.
7362
7363 2012-04-22 Leo Liu <sdl.web@gmail.com>
7364
7365 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7366
7367 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7368
7369 * sysdep.c [__FreeBSD__]: Minor cleanups.
7370 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7371 Use Emacs indenting style more consistently. Avoid some casts.
7372 Use 'double' consistently rather than mixing 'float' and 'double'.
7373
7374 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7375
7376 * sysdep.c (list_system_processes, system_process_attributes):
7377 Add implementation for FreeBSD (Bug#5243).
7378
7379 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7380
7381 * lisp.mk (lisp): Update.
7382
7383 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7384
7385 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7386 It is never used otherwise.
7387
7388 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7389
7390 * print.c (print_preprocess): Only check print_depth if print-circle
7391 is nil.
7392 (print_object): Check for cycles even when print-circle is nil and
7393 print-gensym is t, but only check print_depth if print-circle is nil.
7394
7395 2012-04-20 Chong Yidong <cyd@gnu.org>
7396
7397 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7398 set the status to "failed" and ensure that sentinel is run.
7399
7400 2012-04-20 Glenn Morris <rgm@gnu.org>
7401
7402 * process.c (Fset_process_inherit_coding_system_flag)
7403 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7404 (Fmake_network_process, Fmake_serial_process): Doc fix.
7405
7406 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7407
7408 * xdisp.c (string_buffer_position_lim): Limit starting position to
7409 BEGV.
7410 (set_cursor_from_row): If called for a mode-line or header-line
7411 row, return zero immediately.
7412 (try_cursor_movement): If inside continuation line, don't back up
7413 farther than the first row after the header line, if any.
7414 Don't consider the header-line row as "partially visible", even if
7415 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7416
7417 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7418
7419 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7420 (bug#11238).
7421
7422 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7423 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7424
7425 configure: new option --enable-gcc-warnings (Bug#11207)
7426 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7427 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7428 (ALL_CFLAGS): Use new macros rather than old.
7429 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7430 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7431 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7432 -Wunused-result, -Wunused-variable. This should go away once
7433 the Emacs and Gnulib regex code is merged.
7434 (xmalloc, xrealloc): Now static.
7435
7436 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7437
7438 * dired.c (Fsystem_groups): Remove unused local.
7439
7440 2012-04-17 Glenn Morris <rgm@gnu.org>
7441
7442 * dired.c (Fsystem_users): Doc fix.
7443
7444 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7445
7446 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7447 (syms_of_dired): Add them.
7448
7449 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7450
7451 Fix minor alloc.c problems found by static checking.
7452 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7453 New extern decls, to avoid calling undeclared functions.
7454 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7455 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7456 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7457 (NEED_MEM_INSERT): New macro.
7458 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7459 Remove one incorrect comment and fix another.
7460
7461 Fix minor ralloc.c problems found by static checking.
7462 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7463 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7464 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7465 (r_alloc_sbrk): Now static.
7466
7467 Improve ralloc.c interface checking.
7468 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7469 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7470 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7471 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7472 [REL_ALLOC]: ... to here, to check interface.
7473 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7474 Remove decls. This fixes an "It stinks!".
7475
7476 * alloc.c (which_symbols): Fix alignment issue / type clash.
7477
7478 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7479
7480 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7481 (struct Lisp_Misc_Any): Likewise.
7482 (struct Lisp_Free): Likewise.
7483 * alloc.c (union aligned_Lisp_Symbol): Define.
7484 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7485 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7486 (union aligned_Lisp_Misc): Define.
7487 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7488 aligned_Lisp_Misc instead of union Lisp_Misc.
7489 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7490
7491 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7492
7493 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7494 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7495 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7496 * s/netbsd.h, s/sol2-6.h:
7497 Remove definition of GC_MARK_STACK, since the default now works.
7498 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7499 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7500 no longer the default.
7501 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7502
7503 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7504
7505 * lread.c (lisp_file_lexically_bound_p):
7506 Fix hang at ";-*-\n" (bug#11238).
7507
7508 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7509
7510 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7511 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7512
7513 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7514
7515 * nsterm.m (constrainFrameRect): Always constrain when there is only
7516 one screen (Bug#10962).
7517
7518 2012-04-13 Ken Brown <kbrown@cornell.edu>
7519
7520 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7521
7522 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7523
7524 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7525
7526 2012-04-11 Daniel Colascione <dancol@dancol.org>
7527
7528 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7529 against is gone. It's better to use vfork now so that when Cygwin
7530 gains a new, working vfork, we use it automatically (bug#10398).
7531
7532 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7533
7534 * window.c (save_window_save): Obey window-point-insertion-type.
7535
7536 2012-04-11 Glenn Morris <rgm@gnu.org>
7537
7538 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7539
7540 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7541
7542 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7543
7544 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7545
7546 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7547 (force_quit_count): New var.
7548 (handle_interrupt): Use it.
7549
7550 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7551
7552 * w32.c (w32_delayed_load): Record the full path of the library
7553 being loaded (bug#10424).
7554
7555 2012-04-09 Glenn Morris <rgm@gnu.org>
7556
7557 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7558 not just in the obarray, before snarfing them. (Bug#11036)
7559
7560 * Makefile.in ($(leimdir)/leim-list.el):
7561 Pass EMACS rather than BUILT_EMACS.
7562
7563 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7564
7565 * process.c (make_process):
7566 * process.h: Add integer `gnutls_handshakes_tried' member to
7567 process struct.
7568
7569 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7570 Add convenience `GNUTLS_LOG2i' macro.
7571
7572 * gnutls.c (gnutls_log_function2i): Convenience log function.
7573 (emacs_gnutls_read): Use new log functions,
7574 `gnutls_handshakes_tried' process member, and
7575 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7576 attempts per process (connection).
7577
7578 2012-04-09 Chong Yidong <cyd@gnu.org>
7579
7580 * eval.c (Fuser_variable_p, user_variable_p_eh)
7581 (lisp_indirect_variable): Functions deleted.
7582 (Fdefvar): Caller changed.
7583
7584 * callint.c (Finteractive, Fcall_interactively):
7585 * minibuf.c (Fread_variable): Callers changed.
7586
7587 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7588
7589 * xdisp.c (set_cursor_from_row): If the display string appears in
7590 the buffer at position that is closer to point than the position
7591 after the display string, display the cursor on the first glyph of
7592 the display string. Fixes cursor display when a 'display' text
7593 property immediately follows invisible text. (Bug#11094)
7594
7595 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7596
7597 composite.c: use 'double' consistently
7598 * composite.c (get_composition_id): Use 'double' consistently
7599 instead of converting 'float' to 'double' and vice versa; this is
7600 easier to understand and avoids a GCC warning.
7601
7602 2012-04-09 Glenn Morris <rgm@gnu.org>
7603
7604 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7605 preparation for dumping it with emacs. (Bug#4789)
7606 (leimdir): New variable.
7607 ($(leimdir)/leim-list.el): New rule.
7608 (emacs$(EXEEXT)): Depend on leim-list.el.
7609
7610 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7611 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7612 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7613
7614 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7615
7616 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7617 proper alignment.
7618
7619 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7620
7621 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7622 Remove unused local variable.
7623
7624 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7625
7626 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7627 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7628 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7629 objects, as mark_maybe_pointer will catch them otherwise.
7630 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7631 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7632
7633 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 Fix typo that broke non-Windows builds.
7636 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7637
7638 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7639
7640 Support building on MS-Windows with libxml2.
7641
7642 * makefile.w32-in (OBJ2): Add xml.$(O).
7643 (GLOBAL_SOURCES): Add xml.c.
7644 ($(BLD)/xml.$(O)): New dependency list.
7645
7646 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7647 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7648 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7649 [!WINDOWSNT]: New macros.
7650 (init_libxml2_functions, libxml2_loaded_p): New functions.
7651 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7652 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7653 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7654 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7655 linked in).
7656 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7657 Call init_libxml2_functions before calling libxml2 functions.
7658 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7659
7660 * emacs.c: Don't include libxml/parser.h.
7661 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7662 xmlCleanupParser directly.
7663
7664 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7665
7666 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7667
7668 * indent.c (Fvertical_motion): If there is a display string at
7669 point, use it.vpos to compute how many lines to backtrack after
7670 move_it_to point. (Bug#11133)
7671
7672 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7673
7674 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7675 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7676 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7677 macros related to unification of CJK characters. For the details,
7678 see the discussion following the message here:
7679 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7680
7681 2012-04-04 Chong Yidong <cyd@gnu.org>
7682
7683 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7684
7685 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7686
7687 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7688 instead of alloca. (Bug#11138)
7689
7690 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7691
7692 * w32menu.c (is_simple_dialog): Properly check lisp types.
7693 (Bug#11141)
7694
7695 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7696
7697 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7698 position we get to after a call to move_it_to fails the
7699 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7700 only if we wind up in a string from display property. (Bug#11063)
7701
7702 * window.c (Fdelete_other_windows_internal): Invalidate the row
7703 and column information about mouse highlight, so that redisplay
7704 restores it after reallocating the glyph matrices. (Bug#7464)
7705
7706 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7707 string comes from a `display' text property, use the buffer
7708 position of that property as if we actually saw that position in
7709 the row's glyphs.
7710 (move_it_by_lines): Remove the assertion that
7711 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7712 violated when there's a before-string at the beginning of a line.
7713 (Bug#11063)
7714
7715 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7716
7717 * xdisp.c (append_space_for_newline): If the default face was
7718 remapped, use the remapped face for the appended newline.
7719 (extend_face_to_end_of_line): Use the remapped default face for
7720 extending the face to the end of the line.
7721 (display_line): Call extend_face_to_end_of_line when the default
7722 face was remapped. (Bug#11068)
7723
7724 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7725
7726 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7727
7728 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7729
7730 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7731
7732 2012-03-27 Glenn Morris <rgm@gnu.org>
7733
7734 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7735 Doc fixes.
7736
7737 2012-03-26 Kenichi Handa <handa@m17n.org>
7738
7739 * dispextern.h (struct glyph): Fix previous change. Change the
7740 bit length of glyphless.ch to 25 (Bug#11082).
7741
7742 2012-03-26 Chong Yidong <cyd@gnu.org>
7743
7744 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7745 (command_loop_1): Use it; inhibit selection update for
7746 handle-select-window too (Bug#8996).
7747
7748 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7749
7750 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7751
7752 2012-03-25 Kenichi Handa <handa@m17n.org>
7753
7754 * dispextern.h (struct glyph): Change the bit length of
7755 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7756
7757 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7758
7759 * s/ms-w32.h (tzname): Include time.h before redirecting to
7760 _tzname. Fixes the MSVC build. (Bug#9960)
7761
7762 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7763
7764 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7765 characters.
7766
7767 * xterm.c (XTread_socket): Only modify handling_signal if
7768 !SYNC_INPUT. (Bug#11080)
7769
7770 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7771
7772 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7773 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7774 when fetching a multibyte character consumes more bytes than
7775 CHAR_BYTES returns, due to unification of CJK characters in
7776 string_char. (Bug#11073)
7777
7778 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7779
7780 * process.c (wait_reading_process_output): Handle pty disconnect
7781 by refraining from sending oneself a SIGCHLD (bug#10933).
7782
7783 2012-03-22 Chong Yidong <cyd@gnu.org>
7784
7785 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7786
7787 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7788 Mark string as coming from a prefix property.
7789 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7790 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7791
7792 2012-03-21 Chong Yidong <cyd@gnu.org>
7793
7794 * xfaces.c (Vface_remapping_alist): Doc fix.
7795
7796 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7797
7798 * w32proc.c (Fw32_set_console_codepage)
7799 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7800 Doc fixes.
7801
7802 2012-03-20 Chong Yidong <cyd@gnu.org>
7803
7804 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7805 to reflect default non-nil value of redisplay-dont-pause.
7806
7807 2012-03-19 Kenichi Handa <handa@m17n.org>
7808
7809 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7810 it fit in a valid range (Bug#11003).
7811
7812 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7813
7814 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7815 that is not from display property, accept the row as a "cursor
7816 row" if one of the string's character has a non-nil `cursor'
7817 property. Fixes cursor positioning when there are newlines in
7818 overlay strings, e.g. in icomplete.el. (Bug#11035)
7819
7820 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7821
7822 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7823
7824 2012-03-12 Chong Yidong <cyd@gnu.org>
7825
7826 * eval.c (inhibit_lisp_code): Rename from
7827 inhibit_window_configuration_change_hook; move from window.c.
7828
7829 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7830 * window.c (run_window_configuration_change_hook)
7831 (syms_of_window): Callers changed.
7832
7833 2012-03-11 Chong Yidong <cyd@gnu.org>
7834
7835 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7836
7837 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7838
7839 2012-03-10 Chong Yidong <cyd@gnu.org>
7840
7841 * frame.c (other_visible_frames): Don't assume the selected frame
7842 is visible (Bug#10955).
7843
7844 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7845
7846 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7847
7848 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7849
7850 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7851 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7852 zero (Bug#10954).
7853
7854 2012-03-03 Glenn Morris <rgm@gnu.org>
7855
7856 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7857
7858 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7859
7860 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7861 position past the first glyph_row that ends at ZV. (Bug#10902)
7862 (redisplay_window, next_element_from_string): Fix typos in
7863 comments.
7864 (redisplay_window): Pass to move_it_vertically the margin in
7865 pixels, not in screen lines.
7866
7867 2012-03-02 Glenn Morris <rgm@gnu.org>
7868
7869 * buffer.c (buffer-list-update-hook): Doc fix.
7870
7871 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7872
7873 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7874 push_it before setting up the iterator for the first overlay
7875 string, even if we have an empty string loaded.
7876 (next_overlay_string): If there's an empty string on the iterator
7877 stack, pop the stack. (Bug#10903)
7878
7879 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7880
7881 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7882 Suggested by Stefan Monnier in
7883 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7884 * alloc.c (widen_to_Lisp_Object): New static function.
7885 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7886 and widening them to Lisp_Objects. This would work even if
7887 USE_LSB_TAG is defined and wide integers are used, which might
7888 happen in a future version of Emacs.
7889
7890 2012-02-25 Chong Yidong <cyd@gnu.org>
7891
7892 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7893 Doc fix.
7894
7895 * xselect.c (Fx_selection_exists_p): Doc fix.
7896 (x_clipboard_manager_save_all): Print an informative message
7897 before saving to clipboard manager.
7898
7899 2012-02-24 Chong Yidong <cyd@gnu.org>
7900
7901 * keyboard.c (process_special_events): Handle all X selection
7902 requests in kbd_buffer, not just the next one (Bug#8869).
7903
7904 2012-02-23 Chong Yidong <cyd@gnu.org>
7905
7906 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7907 call when setting menu-bar-lines and tool-bar-lines parameters.
7908 (unwind_create_frame_1): New helper function.
7909
7910 * window.c (inhibit_window_configuration_change_hook): New var.
7911 (run_window_configuration_change_hook): Obey it.
7912 (syms_of_window): Initialize it.
7913
7914 2012-02-22 Chong Yidong <cyd@gnu.org>
7915
7916 * xterm.c (x_draw_image_relief): Add missing type check for
7917 Vtool_bar_button_margin (Bug#10743).
7918
7919 2012-02-21 Chong Yidong <cyd@gnu.org>
7920
7921 * fileio.c (Vfile_name_handler_alist): Doc fix.
7922
7923 * buffer.c (Fget_file_buffer): Protect against invalid file
7924 handler return value.
7925
7926 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7927
7928 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7929 when computing $valmask.
7930
7931 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7932 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7933 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7934 It's useless in that case, and it can cause problems on hosts
7935 that allocate halves of EMACS_INT values separately.
7936 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7937 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7938 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7939 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7940 it avoids undefined behavior on hosts where shifting right by more
7941 than the word width has undefined behavior.
7942
7943 2012-02-19 Chong Yidong <cyd@gnu.org>
7944
7945 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7946 (Funhandled_file_name_directory, Ffile_name_as_directory)
7947 (Fdirectory_file_name, Fexpand_file_name)
7948 (Fsubstitute_in_file_name): Protect against invalid file handler
7949 return values (Bug#10845).
7950
7951 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7952
7953 * .gdbinit (pitx): Fix incorrect references to fields of the
7954 iterator stack.
7955
7956 2012-02-17 Chong Yidong <cyd@gnu.org>
7957
7958 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7959
7960 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7961
7962 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7963 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7964
7965 2012-02-15 Chong Yidong <cyd@gnu.org>
7966
7967 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7968 marked as special. Also, starting docstrings with * is obsolete.
7969
7970 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7971
7972 * gnutls.c (emacs_gnutls_write): Fix last change.
7973
7974 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7975
7976 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7977 send_process.
7978
7979 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7980
7981 * keymap.c (Fsingle_key_description): Handle char ranges.
7982
7983 2012-02-12 Chong Yidong <cyd@gnu.org>
7984
7985 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7986 as that creates a dangerous corner case.
7987
7988 * window.c (Fdelete_window_internal): Invalidate the mouse
7989 highlight (Bug#9904).
7990
7991 2012-02-12 Glenn Morris <rgm@gnu.org>
7992
7993 * xselect.c (Fx_own_selection_internal)
7994 (Fx_get_selection_internal, Fx_disown_selection_internal)
7995 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7996 * nsselect.m (Fx_own_selection_internal)
7997 (Fx_disown_selection_internal, Fx_selection_exists_p)
7998 (Fx_selection_owner_p, Fx_get_selection_internal):
7999 Sync docs and argument specs with the xselect.c versions.
8000
8001 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8002
8003 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8004
8005 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8006
8007 * w32select.c (Fx_selection_exists_p): Sync doc string and
8008 argument list with xselect.c. (Bug#10783)
8009
8010 * w16select.c (Fx_selection_exists_p): Sync doc string and
8011 argument list with xselect.c. (Bug#10783)
8012
8013 2012-02-10 Glenn Morris <rgm@gnu.org>
8014
8015 * fns.c (Fsecure_hash): Doc fix.
8016
8017 2012-02-09 Kenichi Handa <handa@m17n.org>
8018
8019 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8020
8021 2012-02-07 Chong Yidong <cyd@gnu.org>
8022
8023 * buffer.c (Fbuffer_local_variables)
8024 (buffer_lisp_local_variables): Handle unbound vars correctly;
8025 don't let Qunbound leak into Lisp.
8026
8027 2012-02-07 Glenn Morris <rgm@gnu.org>
8028
8029 * image.c (Fimagemagick_types): Doc fix.
8030
8031 * image.c (imagemagick-render-type): Change it from a lisp object
8032 to an integer. Move the doc here from the lisp manual.
8033 Treat all values not equal to 0 the same.
8034
8035 2012-02-06 Chong Yidong <cyd@gnu.org>
8036
8037 * doc.c (store_function_docstring): Avoid applying docstring of
8038 alias to base function (Bug#2603).
8039
8040 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8041
8042 * .gdbinit (pp1, pv1): Remove redundant defines.
8043 (pr): Use pp.
8044
8045 2012-02-04 Chong Yidong <cyd@gnu.org>
8046
8047 * nsterm.m: Declare a global (Bug#10694).
8048
8049 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8050
8051 * w32.c (get_emacs_configuration_options):
8052 Include --enable-checking, if specified, in the return value.
8053
8054 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8055
8056 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8057 after rounding frame sizes. (Bug#9723)
8058
8059 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8060
8061 * keyboard.c (adjust_point_for_property): Don't position point
8062 before BEGV. (Bug#10696)
8063
8064 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8065
8066 Handle overflow when computing char display width (Bug#9496).
8067 * character.c (char_width): Return EMACS_INT, not int.
8068 (char_width, c_string_width): Check for overflow when
8069 computing the width; this is possible now that individual
8070 characters can have unbounded width. Problem introduced
8071 by merge from Emacs 23 on 2012-01-19.
8072
8073 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8074
8075 * dbusbind.c (Fdbus_register_method): Mention the return value
8076 :ignore in the docstring.
8077
8078 2012-02-02 Glenn Morris <rgm@gnu.org>
8079
8080 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8081
8082 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8083 Unconditionally set to t. (Bug#10673)
8084 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8085 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8086 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8087
8088 2012-02-02 Kenichi Handa <handa@m17n.org>
8089
8090 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8091 0, do not call append_composite_glyph.
8092
8093 2012-02-02 Kenichi Handa <handa@m17n.org>
8094
8095 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8096 NULL (Bug#6988).
8097 (x_produce_glyphs): If the component of a composition is a null
8098 string, set it->pixel_width to 1 to avoid zero-width glyph.
8099
8100 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8101
8102 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8103 first 2 arguments are identical. This makes inserting large
8104 output from a subprocess an order of magnitude faster on
8105 MS-Windows, where all sbrk'ed memory is always contiguous.
8106
8107 2012-01-31 Glenn Morris <rgm@gnu.org>
8108
8109 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8110 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8111 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8112
8113 2012-01-29 Glenn Morris <rgm@gnu.org>
8114
8115 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8116
8117 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8118
8119 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8120
8121 2012-01-28 Chong Yidong <cyd@gnu.org>
8122
8123 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8124
8125 2012-01-26 Chong Yidong <cyd@gnu.org>
8126
8127 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8128
8129 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8130 repeat counts (Bug#10507).
8131
8132 2012-01-26 Glenn Morris <rgm@gnu.org>
8133
8134 * lread.c (syms_of_lread): Doc fix.
8135
8136 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8137
8138 * coding.c (encode_designation_at_bol): Change return value to
8139 EMACS_INT.
8140
8141 2012-01-25 Chong Yidong <cyd@gnu.org>
8142
8143 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8144
8145 2012-01-21 Chong Yidong <cyd@gnu.org>
8146
8147 * floatfns.c (Fcopysign): Make the second argument non-optional,
8148 since nil is not allowed anyway.
8149
8150 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8151
8152 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8153 (send_process): Likewise.
8154
8155 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8156
8157 * window.c (save_window_save, Fcurrent_window_configuration)
8158 (Vwindow_persistent_parameters): Do not use Qstate.
8159 Rewrite doc-strings.
8160
8161 2012-01-19 Kenichi Handa <handa@m17n.org>
8162
8163 * character.c (char_width): New function.
8164 (Fchar_width, c_string_width, lisp_string_width):
8165 Use char_width (Bug#9496).
8166
8167 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8168
8169 * window.c (Vwindow_persistent_parameters): New variable.
8170 (Fset_window_configuration, save_window_save): Handle persistent
8171 window parameters.
8172
8173 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8174
8175 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8176 thrashing the stack of the thread. (Bug#9087)
8177
8178 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8179
8180 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8181
8182 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8183
8184 * xdisp.c (rows_from_pos_range): Handle the case where the
8185 highlight ends on a newline. (Bug#10464)
8186 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8187 he end column for display of highlight that ends on a newline
8188 before a R2L line.
8189
8190 2012-01-11 Glenn Morris <rgm@gnu.org>
8191
8192 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8193 from load-path also when installation-directory is nil. (Bug#10208)
8194
8195 2012-01-10 Glenn Morris <rgm@gnu.org>
8196
8197 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8198
8199 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8200 Update template values to be closer to their typical values these days.
8201
8202 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8203
8204 * xdisp.c (rows_from_pos_range): Accept additional argument
8205 DISP_STRING, and accept any glyph in a row whose object is that
8206 string as eligible for mouse highlight. Fixes mouse highlight of
8207 display strings from overlays. (Bug#10464)
8208
8209 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8210
8211 emacs: fix an auto-save permissions race condition (Bug#10400)
8212 * fileio.c (auto_saving_dir_umask): New static var.
8213 (Fmake_directory_internal): Use it.
8214 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8215 creating the directory. The old code temporarily assigns
8216 too-generous permissions to the directory.
8217 (do_auto_save_eh): Clear it.
8218 (Fdo_auto_save): Catch all errors, not just file errors, so
8219 that the var is always cleared.
8220
8221 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8222
8223 * search.c (scan_buffer): Pass character positions to
8224 know_region_cache, not byte positions. (Bug#6540)
8225
8226 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8227
8228 * w32.c (sys_rename): Report EXDEV when rename of a directory
8229 fails because the target is on another logical disk. (Bug#10284)
8230
8231 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8232
8233 * xterm.c (x_embed_request_focus): New function.
8234
8235 * xterm.h: Add prototype.
8236
8237 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8238
8239 2012-01-05 Glenn Morris <rgm@gnu.org>
8240
8241 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8242
8243 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8244
8245 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8246 Load gnutls_transport_set_lowat only if GnuTLS version is below
8247 2.11.1.
8248 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8249 GnuTLS versions below 2.11.1.
8250
8251 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8252
8253 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8254 to the doc string advising against its use for altering the way
8255 windows are scrolled.
8256
8257 2011-12-28 Kenichi Handa <handa@m17n.org>
8258
8259 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8260 coding-system ASCII compatible only when it does not produce BOM
8261 on encoding (Bug#10383).
8262
8263 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8264
8265 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8266 can scroll.
8267 (create_and_show_popup_menu): Always use menu_position_func for
8268 Gtk3 (Bug#10361).
8269
8270 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8271
8272 * callint.c (Fcall_interactively): Don't truncate prompt string.
8273
8274 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8275
8276 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8277 property that ends at ZV, so that the bidi iteration could be
8278 resumed from there (after widening). (Bug#10360)
8279
8280 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8281
8282 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8283
8284 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8285
8286 * nsterm.m (x_free_frame_resources):
8287 Release f->output_data.ns->miniimage.
8288 (ns_index_color): Fix indentation. Do not retain
8289 color_table->colors[i].
8290
8291 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8292 before returning.
8293
8294 * nsfns.m (x_set_background_color): Assign return value from
8295 ns_index_color to face-background instead of NSColor*.
8296 (ns_implicitly_set_icon_type): Fix indentation.
8297 Change assignment in for loop to comparison.
8298
8299 * emacs.c (ns_pool): New variable.
8300 (main): Assign ns_pool.
8301 (Fkill_emacs): Call ns_release_autorelease_pool.
8302
8303 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8304 autorelease fdesc, release fdAttrs and tdict.
8305 (ns_get_covering_families): Release charset.
8306 (ns_findfonts): Release NSFontDescriptor created with new.
8307 (ns_uni_to_glyphs): Fix indentation.
8308 (setString): Release attrStr before assigning new value.
8309
8310 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8311
8312 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8313 and NS_IMPL_COCOA.
8314 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8315 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8316
8317 2011-12-18 David Reitter <reitter@cmu.edu>
8318
8319 * nsterm.m (ns_term_init): Subscribe for notifications
8320 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8321 to method trackingNotification in EmacsMenu.
8322
8323 * nsmenu.m (trackingMenu): New variable.
8324 (trackingNotification): New method (from Aquamacs).
8325 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8326 from Aquamacs (Bug#7030).
8327
8328 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8329
8330 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8331 (symbol_to_nsstring): Fix indentation.
8332 (ns_symbol_to_pb): New function.
8333 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8334 (Fns_rotate_cut_buffers_internal): Remove.
8335 (Fns_store_selection_internal): Rename from
8336 Fns_store_cut_buffer_internal.
8337 (ns_get_foreign_selection, Fx_own_selection_internal)
8338 (Fx_disown_selection_internal, Fx_selection_exists_p)
8339 (Fns_get_selection_internal, Fns_store_selection_internal):
8340 Use ns_symbol_to_pb and check if return value is nil.
8341 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8342 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8343 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8344 renamed to Sns_store_selection_internal.
8345 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8346 and remove this function.
8347 (ns_handle_selection_clear): Remove, never used.
8348 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8349 here.
8350
8351 2011-12-17 Ken Brown <kbrown@cornell.edu>
8352
8353 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8354 GID is unknown (Bug#10257).
8355
8356 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8357
8358 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8359 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8360 which caused a build failure on GNU/Linux IA-64. This problem was
8361 introduced by my 2011-10-07 patch.
8362
8363 2011-12-15 Juri Linkov <juri@jurta.org>
8364
8365 * image.c (imagemagick_error): New function. (Bug#10112)
8366 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8367 Use `imagemagick_error' where ImageMagick functions return
8368 `MagickFalse'.
8369 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8370 proper order.
8371
8372 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8373
8374 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8375 fill background (Bug#8992).
8376
8377 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8378
8379 * window.c (Vwindow_combination_resize)
8380 (Vwindow_combination_limit): Use t instead of non-nil in
8381 doc-strings.
8382 (Vrecenter_redisplay): Add first sentence of doc-string on
8383 separate line.
8384 (Frecenter): Fix doc-string typo.
8385
8386 2011-12-11 Kenichi Handa <handa@m17n.org>
8387
8388 * coding.c (Funencodable_char_position): Pay attention to the
8389 buffer text relocation (Bug#9389).
8390
8391 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8392
8393 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8394 gtk_init (Bug#10100).
8395
8396 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8397
8398 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8399 IT->string is nil. (Bug#10263)
8400
8401 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8402
8403 * nsterm.h (x_free_frame_resources): Declare.
8404
8405 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8406 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8407
8408 * nsterm.h (ns_get_defaults_value): Declare.
8409
8410 * nsterm.m (ns_default): Call ns_get_defaults_value.
8411
8412 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8413
8414 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8415 (Bug#10170)
8416
8417 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8418
8419 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8420 that where the value of an _OBJC_* symbol points to is in the .bss
8421 section (Bug#10240).
8422
8423 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8424
8425 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8426 after the loop to call ccl_driver at least once (Bug#8619).
8427
8428 2011-12-08 Kenichi Handa <handa@m17n.org>
8429
8430 * ftfont.c (get_adstyle_property): Fix previous change
8431 (Bug#10233).
8432
8433 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8434
8435 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8436 dirs from the default value of EMACSLOADPATH (bug#10208).
8437
8438 2011-12-07 Glenn Morris <rgm@gnu.org>
8439
8440 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8441 installation and source directories as well. (Bug#10208)
8442
8443 2011-12-06 Chong Yidong <cyd@gnu.org>
8444
8445 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8446
8447 2011-12-06 Glenn Morris <rgm@gnu.org>
8448
8449 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8450 as an error, not just -1. (Bug#10217)
8451
8452 2011-12-05 Chong Yidong <cyd@gnu.org>
8453
8454 * keyboard.c (process_special_events): New function.
8455 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8456
8457 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8458
8459 * coding.c (encode_designation_at_bol): Don't use uninitialized
8460 local variable (Bug#9318).
8461
8462 2011-12-05 Kenichi Handa <handa@m17n.org>
8463
8464 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8465 return Qnil (Bug#8046, Bug#10193).
8466
8467 2011-12-05 Kenichi Handa <handa@m17n.org>
8468
8469 * coding.c (encode_designation_at_bol): New args charbuf_end and
8470 dst. Return the number of produced bytes. Callers changed.
8471 (coding_set_source): Return how many bytes coding->source was
8472 relocated.
8473 (coding_set_destination): Return how many bytes
8474 coding->destination was relocated.
8475 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8476 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8477
8478 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8479
8480 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8481 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8482 macro (Bug#9318).
8483
8484 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8485
8486 The following changes are to fix Bug#9318.
8487
8488 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8489 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8490 (encode_coding_iso_2022, encode_coding_sjis)
8491 (encode_coding_big5, encode_coding_charset): Use the above macros.
8492
8493 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8494
8495 * lisp.h (process_quit_flag): Fix external declaration.
8496
8497 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8498
8499 Don't macro-inline non-performance-critical code.
8500 * eval.c (process_quit_flag): New function.
8501 * lisp.h (QUIT): Use it.
8502
8503 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8504
8505 * nsfns.m (get_geometry_from_preferences): New function.
8506 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8507
8508 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8509
8510 * emacs.c (Qkill_emacs): Define.
8511 (syms_of_emacs): Initialize it.
8512 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8513 Qquit_flag to `kill-emacs' instead.
8514 (quit_throw_to_read_char): Add parameter `from_signal'.
8515 All callers changed. Call Fkill_emacs if requested and safe.
8516 * lisp.h (QUIT): Call Fkill_emacs if requested.
8517
8518 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8519
8520 * widget.c (update_wm_hints): Return if wmshell is null.
8521 (widget_update_wm_size_hints): New function.
8522
8523 * widget.h (widget_update_wm_size_hints): Declare.
8524
8525 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8526 widget_update_wm_size_hints (Bug#10104).
8527
8528 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8529
8530 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8531 before a newline, prepare the bidi iterator for consuming the
8532 newline, and keep the current paragraph direction. (Bug#10183)
8533 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8534
8535 2011-12-02 Juri Linkov <juri@jurta.org>
8536
8537 * search.c (Fword_search_regexp): New Lisp function created from
8538 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8539 (Fword_search_backward, Fword_search_forward)
8540 (Fword_search_backward_lax, Fword_search_forward_lax):
8541 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8542 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8543
8544 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8545
8546 * fileio.c (Finsert_file_contents): Move after-change-function call
8547 to before the "handled:" label, since all "goto handled" appear in
8548 cases where the *-change-functions have already been properly called
8549 (bug#10117).
8550
8551 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8552
8553 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8554 waiting for input. (Bug#10169)
8555
8556 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8557
8558 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8559 verifies glyph row's hash code--we have just reallocated the
8560 glyphs, so their contents can be complete garbage. (Bug#10164)
8561
8562 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8563
8564 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8565
8566 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8567
8568 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8569 attributes are tested _before_ calling verify_row_hash, to protect
8570 against GCC re-ordering of the tests. (Bug#10164)
8571
8572 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8573
8574 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8575
8576 * xterm.c (handle_one_xevent): Only set async_visible and friends
8577 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8578 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8579 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8580
8581 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8582
8583 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8584 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8585 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8586 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8587 All uses changed to use GCPRO1 etc.
8588 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8589 Revert to old implementation (i.e., before 2011-03-11).
8590
8591 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8592
8593 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8594 of scroll runs so as to avoid assigning disabled bogus rows and
8595 unnecessary graphics copy operations.
8596
8597 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8598
8599 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8600 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8601 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8602 (malloc, free, realloc, calloc): Redirect to e_* only when
8603 compiling Emacs.
8604
8605 * lisp.h (GCTYPEBITS): Move before first use.
8606 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8607 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8608 this macro definition.
8609
8610 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8611 _MSC_VER.
8612
8613 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8614
8615 * gtkutil.c (xg_create_frame_widgets):
8616 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8617 present with Gtk+ 2.0.
8618
8619 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8620
8621 * fileio.c (Finsert_file_contents): Undo previous change; see
8622 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8623
8624 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8625
8626 Rename locals to avoid shadowing.
8627 * fileio.c (Finsert_file_contents):
8628 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8629 * process.c (wait_reading_process_output):
8630 Rename inner 'proc' to 'p' to avoid shadowing.
8631 Indent for consistency with usual Emacs style.
8632
8633 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8634
8635 * xdisp.c (redisplay_window): If cursor row is not fully visible
8636 after recentering, and scroll-conservatively is set to a large
8637 number, scroll window by a few more lines to make the cursor fully
8638 visible and out of scroll-margin. (Bug#10105)
8639 (start_display): Don't move to the next line if the display should
8640 start at a newline that is part of a display vector or an overlay
8641 string. (Bug#10119)
8642
8643 2011-11-24 Juri Linkov <juri@jurta.org>
8644
8645 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8646 after the `MagickPingImage' call. (Bug#10112)
8647
8648 2011-11-23 Chong Yidong <cyd@gnu.org>
8649
8650 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8651
8652 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8653
8654 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8655 making another buffer current. (Bug#10114)
8656
8657 2011-11-23 Glenn Morris <rgm@gnu.org>
8658
8659 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8660
8661 2011-11-23 Chong Yidong <cyd@gnu.org>
8662
8663 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8664 using it (Bug#5984).
8665
8666 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8667
8668 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8669 and header-lines, as they don't have one computed for them.
8670 (Bug#10098)
8671
8672 * .gdbinit (prow): Make displayed values more self-explaining.
8673 Add row's hash code.
8674
8675 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8676
8677 * process.c (wait_reading_process_output): Fix asynchrounous
8678 GnuTLS socket handling on some versions of the GnuTLS library.
8679 (wait_reading_process_output): Add comment and URL.
8680
8681 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8682
8683 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8684
8685 2011-11-21 Chong Yidong <cyd@gnu.org>
8686
8687 * window.c (Fnext_window, Fprevious_window): Doc fix.
8688
8689 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8690
8691 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8692
8693 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8694
8695 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8696
8697 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8698
8699 * window.c (Fset_window_combination_limit): Rename argument
8700 STATUS to LIMIT.
8701 (Vwindow_combination_limit): Remove "status" from doc-string.
8702
8703 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8704
8705 * m/ibms390.h: Remove.
8706 * m/ibms390x.h: Don't include "ibms390.h".
8707
8708 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8709
8710 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8711 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8712
8713 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8714
8715 * casetab.c (Fset_case_table):
8716 * charset.c (Fcharset_after): Fix typos.
8717
8718 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8719
8720 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8721 Otherwise, valgrind does not work on some platforms.
8722 Problem reported by Andreas Schwab in
8723 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8724 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8725 is set, removing the need for VIRT_ADDRESS_VARIES.
8726 (PURE_P): Use a more-efficient implementation that needs just one
8727 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8728 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8729 to 4 (xorl, subq, cmpq, setbe).
8730 * alloc.c (pure): Always extern now, since that's the
8731 VIRT_ADDR_VARIES behavior.
8732 (PURE_POINTER_P): Use a single comparison, not two, for
8733 consistency with the new puresize.h.
8734 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8735 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8736 Remove VIRT_ADDR_VARIES no longer needed.
8737
8738 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8739
8740 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8741 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8742 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8743 behave as if the cursor position were at the window margin.
8744
8745 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8746 and the cursor position is out of bounds, behave as if the cursor
8747 position were at the window margin. (Bug#10075)
8748
8749 2011-11-18 Chong Yidong <cyd@gnu.org>
8750
8751 * window.c (Fwindow_combination_limit): Make first argument
8752 non-optional, since it is meaningless for live windows like the
8753 selected window.
8754
8755 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8756
8757 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8758
8759 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8760
8761 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8762 (graft_intervals_into_buffer): Simplify.
8763
8764 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8765
8766 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8767 hash values of the two rows.
8768 (copy_row_except_pointers): Preserve the used[] arrays and the
8769 hash values of the two rows. (Bug#10035)
8770 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8771
8772 * xdisp.c (row_hash): New function, body extracted from
8773 compute_line_metrics.
8774 (compute_line_metrics): Call row_hash, instead of computing the
8775 hash code inline.
8776
8777 * dispnew.c (verify_row_hash): Call row_hash for computing the
8778 hash code of a row, instead of duplicating code from xdisp.c.
8779
8780 * dispextern.h (row_hash): Add prototype.
8781
8782 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8783
8784 * frame.c (delete_frame): Don't delete the terminal when the last
8785 X frame is closed if emacs is built with GTK toolkit.
8786
8787 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8788
8789 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8790
8791 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8792
8793 * window.c (Vwindow_splits): Rename to
8794 Vwindow_combination_resize. Suggested by Juri Linkov.
8795 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8796 of Vwindow_splits.
8797
8798 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8799
8800 * nsfns.m (Fns_font_name):
8801 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8802
8803 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8804
8805 * window.h (window): Rename slot "nest" to "combination_limit".
8806 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8807 (Fset_window_nest): Rename to Fset_window_combination_limit.
8808 (Vwindow_nest): Rename to Vwindow_combination_limit.
8809 (recombine_windows, make_parent_window, make_window)
8810 (Fsplit_window_internal, saved_window)
8811 (Fset_window_configuration, save_window_save): Rename all
8812 occurrences of window_nest to window_combination_limit.
8813
8814 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8815
8816 * image.c (imagemagick_load_image): Fix typo.
8817
8818 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8819
8820 * xdisp.c (display_line): Move the call to
8821 highlight_trailing_whitespace before the call to
8822 compute_line_metrics, since the latter needs to see the final
8823 faces of all the glyphs to compute ROW's hash value.
8824 Fixes assertion violations in row_equal_p. (Bug#10035)
8825
8826 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8827
8828 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8829 just return (bug#10044).
8830
8831 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8832
8833 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8834 with user-defined heap size. Bump the default size of the temacs
8835 heap to 27MB, to avoid memory warning when running temacs.
8836 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8837
8838 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8839 current_matrix and desired_matrix. (Bug#9990)
8840 (verify_row_hash) [XASSERTS]: New function.
8841 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8842 that the hash value of glyph rows is correct.
8843
8844 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8845
8846 * window.h (window): Remove splits slot.
8847 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8848 (Fdelete_other_windows_internal, make_parent_window)
8849 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8850 (Fset_window_configuration, save_window_save): Don't deal with
8851 split status of windows.
8852 (saved_window): Remove splits slot.
8853 (Vwindow_splits): Rewrite doc-string.
8854
8855 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8856
8857 * xfns.c (unwind_create_frame):
8858 * nsfns.m (unwind_create_frame):
8859 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8860 Vframe_list (Bug#9999).
8861
8862 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8863
8864 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8865
8866 2011-11-11 Kenichi Handa <handa@m17n.org>
8867
8868 * callproc.c (Fcall_process): Set the member dst_multibyte of
8869 process_coding.
8870
8871 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8872
8873 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8874 avoid a crash (bug#9496).
8875
8876 2011-11-09 Chong Yidong <cyd@gnu.org>
8877
8878 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8879 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8880
8881 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8882
8883 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8884
8885 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8886
8887 Avoid some portability problems by eschewing 'extern inline' functions.
8888 The trivial performance wins aren't worth the portability hassles; see
8889 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8890 et seq.
8891 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8892 (window_box_width, window_box_left, window_box_left_offset)
8893 (window_box_right, window_box_right_offset): Undo previous change,
8894 by removing the "extern"s.
8895 * intervals.c (adjust_intervals_for_insertion)
8896 (adjust_intervals_for_deletion): Undo previous change,
8897 making these static again.
8898 (offset_intervals, temp_set_point_both, temp_set_point)
8899 (copy_intervals_to_string): No longer inline.
8900 * xdisp.c (window_text_bottom_y, window_box_width)
8901 (window_box_height, window_box_left_offset)
8902 (window_box_right_offset, window_box_left, window_box_right)
8903 (window_box): No longer inline.
8904
8905 2011-11-08 Chong Yidong <cyd@gnu.org>
8906
8907 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8908 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8909 Signal an error if not a live window.
8910 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8911 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8912
8913 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8914
8915 * lisp.h (syms_of_abbrev): Remove declaration.
8916 Reported by CHENG Gao <chenggao@royau.me>.
8917
8918 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8919
8920 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8921 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8922 of temacs in GUI mode.
8923
8924 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8925
8926 * window.h: Declare delete_all_child_windows instead of
8927 delete_all_subwindows.
8928 * window.c (Fwindow_nest, Fset_window_nest)
8929 (Fset_window_new_total, Fset_window_new_normal)
8930 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8931 (delete_all_subwindows): Rename to delete_all_child_windows.
8932 (Fdelete_other_windows_internal, Fset_window_configuration):
8933 Call delete_all_child_windows instead of delete_all_subwindows.
8934 * frame.c (delete_frame): Call delete_all_child_windows instead
8935 of delete_all_subwindows.
8936
8937 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8938
8939 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8940 This is also needed for porting to any host where GC_MARK_STACK is
8941 not GC_MAKE_GCPROS_NOOPS.
8942 (which_symbols): Use it.
8943
8944 2011-11-07 Kenichi Handa <handa@m17n.org>
8945
8946 * coding.c (coding_set_destination): Check coding->src_pos only
8947 when coding->src_object is a buffer (bug#9910).
8948
8949 * process.c (send_process): Set the member src_multibyte of coding
8950 to 0 (bug#9911) when sending a unibyte text.
8951
8952 * callproc.c (Fcall_process): Set the member src_multibyte of
8953 process_coding to 0 (bug#9912).
8954
8955 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8956
8957 * xmenu.c (cleanup_widget_value_tree): New function.
8958 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8959 calling free_menubar_widget_value_tree directly (Bug#9830).
8960
8961 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8962
8963 Fix some portability problems with 'inline'.
8964 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8965 (window_box_width, window_box_left, window_box_left_offset)
8966 (window_box_right, window_box_right_offset): Declare extern.
8967 Otherwise, these inline functions do not conform to C99 and
8968 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8969 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8970 * intervals.c (adjust_intervals_for_insertion)
8971 (adjust_intervals_for_deletion): Now extern, because otherwise the
8972 extern inline functions 'offset_intervals' couldn't refer to it.
8973 (static_offset_intervals): Remove.
8974 (offset_intervals): Rewrite using the old contents of
8975 static_offset_intervals. The old version didn't conform to C99
8976 because an extern inline function contained a reference to an
8977 identifier with static linkage.
8978
8979 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8980
8981 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8982 GC.
8983
8984 2011-11-06 Eli Zaretskii <eliz@gnu.org>
8985
8986 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8987 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8988 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8989 return Qleft_to_right.
8990
8991 2011-11-06 Chong Yidong <cyd@gnu.org>
8992
8993 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8994 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8995 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8996 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8997 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8998 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8999 (Fwindow_vscroll): Doc fix.
9000 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9001 argument, since it makes no sense to pass a live window and for
9002 consistency with window-child.
9003
9004 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9005
9006 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9007 support MSVC.
9008
9009 2011-11-05 Jason Rumney <jasonr@gnu.org>
9010
9011 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9012 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9013 fonts (Bug#6029).
9014 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9015 bitwise arithmetic preventing use of unicode-sip and non-truetype
9016 opentype fonts.
9017
9018 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9019
9020 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9021 "emacs"-only part.
9022
9023 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9024 initialization code to keep similarity to xfns.c after changes
9025 from 2011-11-05.
9026
9027 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9028
9029 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9030 (unwind_create_frame): New function (Bug#9943).
9031 (Fx_create_frame): Restructure code to be more similar to the one in
9032 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9033 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9034 Move terminal->reference_count++ just before making the frame official
9035 (Bug#9943).
9036
9037 * nsterm.m (x_free_frame_resources): New function.
9038 (x_destroy_window): Move code to x_free_frame_resources.
9039
9040 * xfns.c (unwind_create_frame): Fix comment.
9041 (Fx_create_frame, x_create_tip_frame):
9042 Move terminal->reference_count++ just before making the frame
9043 official. Move initialization of image_cache_refcount and
9044 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9045
9046 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9047
9048 Support MSVC build with newer versions of Visual Studio.
9049 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9050 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9051 nt/gmake.defs.
9052
9053 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9054 which are not supported by MSVC.
9055 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9056 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9057 bitfields.
9058 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9059 types in bitfields.
9060 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9061
9062 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9063
9064 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9065
9066 Support MSVC build with newer versions of Visual Studio.
9067 * w32.c: Don't include w32api.h for MSVC.
9068 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9069
9070 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9071 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9072 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9073 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9074 e_* cousins.
9075 (alloca) [_MSC_VER]: Define to _alloca.
9076
9077 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9078
9079 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9080
9081 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9082
9083 * xdisp.c (note_mouse_highlight): If either of
9084 previous/next-single-property-change returns nil, treat that as
9085 the beginning or the end of the buffer. (Bug#9955)
9086
9087 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9088
9089 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9090 label is not null (Bug#9951).
9091 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9092 may be NULL.
9093
9094 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9095
9096 * window.c (Fwindow_body_size): Mention in the doc string that the
9097 return value is in frame's canonical units. (Bug#9949)
9098
9099 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9100
9101 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9102
9103 * w32fns.c (unwind_create_frame): If needed, free the glyph
9104 matrices of the partially constructed frame. (Bug#9943)
9105 * xfns.c (unwind_create_frame): Likewise.
9106
9107 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9108
9109 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9110 Don't stop backward scan on the continuation glyph, even though
9111 its CHARPOS is positive.
9112 (mouse_face_from_buffer_pos, note_mouse_highlight):
9113 Rename cover_string to disp_string.
9114
9115 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9116
9117 * window.c (temp_output_buffer_show): Don't use
9118 Vtemp_buffer_show_specifiers.
9119 (Vtemp_buffer_show_specifiers): Remove unused variable.
9120
9121 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9122
9123 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9124 past the beginning of the current glyph matrix.
9125
9126 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9127
9128 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9129 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9130 HAVE_GTK3 (Bug#9869).
9131
9132 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9133 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9134
9135 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9136
9137 * xterm.c: Declare x_handle_net_wm_state to return int.
9138 (handle_one_xevent): Check if we are iconified but don't have
9139 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9140 (get_current_wm_state): Return non-zero if not hidden,
9141 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9142 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9143 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9144 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9145
9146 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9147
9148 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9149 so that this new function doesn't get optimized away by a
9150 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9151
9152 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9153
9154 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9155
9156 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9157
9158 Fix the `xbytecode' command.
9159 * .gdbinit (xprintbytestr): New command.
9160 (xwhichsymbols): Rename from `which'; all callers changed.
9161 (xbytecode): Print the byte-code string as well.
9162
9163 2011-10-29 Kim Storm <storm@cua.dk>
9164
9165 * alloc.c (which_symbols): New function.
9166
9167 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9168
9169 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9170 line. (Bug#9903)
9171
9172 2011-10-29 Glenn Morris <rgm@gnu.org>
9173
9174 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9175 Not clear what it was for, and it causes various bugs. (Bug#9839)
9176
9177 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9178
9179 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9180 possible random value that matches one of those tested as
9181 condition to clear the mouse face.
9182
9183 2011-10-28 Chong Yidong <cyd@gnu.org>
9184
9185 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9186
9187 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9188
9189 * window.c (make_window): Initialize phys_cursor_on_p.
9190
9191 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9192
9193 * lisp.h (struct Lisp_Symbol): Update comments.
9194
9195 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9196
9197 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9198
9199 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9200
9201 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9202 <oslsachem@gmail.com> for helping to debug this.
9203
9204 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9205 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9206 (g_b_init_get_glyph_outline_w): New static variables.
9207 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9208 (GetGlyphOutlineW_Proc): New typedefs.
9209 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9210 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9211 New functions.
9212 (w32font_open_internal, compute_metrics):
9213 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9214 instead of calling the "wide" APIs directly.
9215
9216 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9217
9218 * w32.h (syms_of_w32font): Add prototype.
9219
9220 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9221
9222 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9223 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9224 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9225 (Fmove_to_window_line): Doc fix.
9226
9227 2011-10-27 Chong Yidong <cyd@gnu.org>
9228
9229 * process.c (make_process): Set gnutls_state to NULL.
9230
9231 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9232 non-NULL, regardless of GNUTLS_INITSTAGE.
9233 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9234 an error. Set process slots as soon as we allocate them.
9235
9236 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9237
9238 2011-10-27 Chong Yidong <cyd@gnu.org>
9239
9240 * gnutls.c (emacs_gnutls_deinit): New function.
9241 Deallocate credentials structures as well as calling gnutls_deinit.
9242 (Fgnutls_deinit, Fgnutls_boot): Use it.
9243
9244 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9245 (deactivate_process): Call emacs_gnutls_deinit.
9246
9247 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9248
9249 * image.c (x_create_x_image_and_pixmap):
9250 * w32.c (sys_rename, w32_delayed_load):
9251 * w32font.c (fill_in_logfont):
9252 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9253
9254 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9255
9256 * w32fns.c (w32_default_color_map): New function,
9257 extracted from Fw32_default_color_map.
9258 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9259
9260 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9261
9262 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9263
9264 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9265
9266 * keyboard.c (test_undefined): New function (bug#9751).
9267 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9268
9269 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9270
9271 * sysdep.c (init_sys_modes): Fix the check for the controlling
9272 terminal (Bug#6649).
9273
9274 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9275
9276 * dispextern.h (struct bidi_it): New member next_en_type.
9277
9278 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9279 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9280 current character, check also for next_en_type being WEAK_EN.
9281 (bidi_resolve_weak): Don't enter the expensive loop if the current
9282 position is before next_en_pos. Record the bidi type of the first
9283 non-ET, non-BN character we find, in addition to its position.
9284 (bidi_level_of_next_char): Invalidate next_en_type when
9285 next_en_pos is over-stepped.
9286
9287 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9288
9289 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9290 * editfns.c: Rewrite current-time-zone so that it invokes
9291 the equivalent of (format-time-string "%Z") to get the time zone name.
9292 This fixes a bug when the time zone name contains characters that
9293 need converting from the system time locale to Emacs internal format.
9294 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9295 that patch fixed format-time-string to do the conversion, but
9296 I forgot to fix current-time-zone.
9297 (format_time_string): New function, containing most of
9298 what Fformat_time_string used to contain.
9299 (Fformat_time_string): Rewrite in terms of format_time_string.
9300 This doesn't change this function's behavior.
9301 (current-time-zone): Rewrite to use format_time_string.
9302 This fixes the bug reported by Michael Schierl in
9303 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9304 Jason Rumney's 2007-06-07 change worked around this bug, but
9305 didn't fix it.
9306 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9307
9308 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9309
9310 * xdisp.c (start_display): If the character at POS is displayed
9311 via a display vector, reset IT->current.dpvec_index to zero.
9312 (try_window_reusing_current_matrix): If a line ends in a display
9313 vector or the next line starts in a display vector, continue
9314 redrawing the window even though the character position of
9315 start_row was reached.
9316 (Bug#9771, part 2)
9317
9318 2011-10-18 Chong Yidong <cyd@gnu.org>
9319
9320 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9321 with nobreak-char-display too.
9322
9323 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9324
9325 Fix part 3 of bug#9771.
9326 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9327 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9328 non-neutral characters if the current character is a paragraph
9329 separator (a.k.a. Newline). This avoids running the same
9330 expensive loop twice, once when we consume the preceding newline
9331 and the other time when the line actually needs to be displayed.
9332 Avoid the loop when we see neutrals on the base embedding level
9333 following a character whose directionality is the same as the
9334 paragraph's. This avoids running the expensive loop when a line
9335 ends in a long sequence of neutrals, like control characters.
9336 Add assertion against STRONG_AL type. Slightly rearrange code
9337 that determines the type of a neutral given the first non-neutral
9338 that follows it.
9339 (bidi_level_of_next_char): Set next_en_pos to zero when
9340 invalidating its info.
9341
9342 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9343
9344 * xdisp.c (push_display_prop): Determine whether to record string
9345 or buffer position by IT->string, not by IT->method. Allow
9346 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9347 (move_it_vertically_backward): Don't look for character position
9348 immediately after the newline when in a continuation line.
9349 (Bug#9771, part 1)
9350
9351 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9352
9353 * window.c (coordinates_in_window): Rewrite and delabelize
9354 vertical border check. (Bug#5357) (Bug#9618)
9355
9356 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9357
9358 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9359 errors in XSetWindowBorder (bug#9310).
9360
9361 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9362
9363 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9364 avoid crash when xmalloc overrun checking is enabled.
9365
9366 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9367
9368 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9369 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9370 cursor motion with <left> and <right> arrow keys.
9371
9372 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9373 some callers set that themselves.
9374
9375 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9376
9377 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9378 display string and the previous row comes from the same string and
9379 is empty. (Bug#9739) (Bug#9738)
9380
9381 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9382
9383 * doc.c (get_doc_string): Encode file name (bug#9735).
9384
9385 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9386
9387 * bidi.c (bidi_level_of_next_char):
9388 * xdisp.c (get_visually_first_element): Remove old incorrect
9389 comments regarding the Unicode Line Separator character.
9390
9391 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9392
9393 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9394
9395 * alloc.c (Fgc_status): Do not access beyond zombies array
9396 boundary if nzombies > MAX_ZOMBIES.
9397 * alloc.c (dump_zombies): Add missing format specifier.
9398
9399 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9400
9401 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9402 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9403
9404 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9405 Some packages use them to denote characters with modifiers.
9406
9407 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9408
9409 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9410 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9411 matching a pp-number. Rename parameter var to var1.
9412
9413 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9414
9415 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9416
9417 2011-10-08 Glenn Morris <rgm@gnu.org>
9418
9419 * callint.c (Fcall_interactively): Give a more explicit error for the
9420 'c' case with a non-character input. (Bug#8479)
9421
9422 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9423
9424 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9425 lines.
9426 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9427 lines that are hscrolled on the left.
9428
9429 * dispnew.c (buffer_posn_from_coords): Account for a possible
9430 presence of header-line. (Bug#4426)
9431
9432 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9433
9434 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9435 Don't advertise functionality which we discourage or doesn't work.
9436
9437 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9438
9439 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9440 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9441 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9442 this makes Emacs dump core during garbage collection on rare
9443 occasions. sizeof is obviously inferior to offsetof here, so
9444 stick with offsetof.
9445 (GC_POINTER_ALIGNMENT): New macro.
9446 (mark_memory): Omit 3rd (offset) arg; caller changed.
9447 Don't assume EMACS_INT alignment is the same as pointer alignment.
9448
9449 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9450
9451 * keyboard.c (read_key_sequence_remapped): New var.
9452 (read_key_sequence): Compute remapping in the right buffer.
9453 (command_loop_1): Use read_key_sequence's remapping directly.
9454
9455 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9456
9457 * dired.c (file_name_completion): Don't expand file name.
9458 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9459 before checking file name handler.
9460
9461 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9462 they've been requested explicitly (bug#9591).
9463
9464 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9465
9466 * keymap.c (Fsingle_key_description): Use make_specified_string
9467 instead of build_string to build string from push_key_description.
9468 (Bug#5193)
9469
9470 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9471
9472 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9473 This fixes a Y2038 bug on 64-bit hosts.
9474 * buffer.c (reset_buffer):
9475 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9476 (Fclear_buffer_auto_save_failure):
9477 Use 0, not -1, to represent an unset failure time, since time_t
9478 might not be signed.
9479
9480 Remove dependency on glibc malloc internals.
9481 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9482 Move back here from lisp.h, but with their new implementations.
9483 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9484 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9485 * charset.c (charset_table_init): New static var.
9486 (syms_of_charset): Use it instead of xmalloc. This removes a
9487 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9488 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9489 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9490 Move back to alloc.c.
9491 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9492 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9493
9494 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9495
9496 * nsterm.m (windowDidResize): Call x_set_window_size only when
9497 ns_in_resize is true. Otherwise set pixelwidth/height and
9498 call change_frame_size (Bug#9628).
9499
9500 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9501
9502 Port --enable-checking=all to Fedora 14 x86-64.
9503 * charset.c (syms_of_charset): Also account for glibc malloc's
9504 internal overhead when calculating the initial malloc maximum.
9505
9506 Port --enable-checking=all to Fedora 14 x86.
9507 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9508 Move to lisp.h.
9509 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9510 (overrun_check_realloc, overrun_check_free):
9511 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9512 That way, xmalloc returns a properly-aligned pointer even if
9513 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9514 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9515 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9516 into account when calculating the initial malloc maximum.
9517 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9518 Move here from alloc.c, so that charset.c can use it too.
9519 Properly align; the old code wasn't right for common 32-bit hosts
9520 when configured with --enable-checking=all.
9521 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9522 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9523
9524 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9525
9526 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9527 use EDOM.
9528
9529 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9530
9531 * xdisp.c (compute_display_string_end): If there's no display
9532 string at CHARPOS, return -1.
9533
9534 * bidi.c (bidi_fetch_char): When compute_display_string_end
9535 returns a negative value, treat the character as a normal
9536 character not covered by a display string. (Bug#9624)
9537
9538 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9539
9540 * lread.c (Fread_from_string): Fix typo in docstring.
9541
9542 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9543
9544 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9545 newline, reseat the iterator instead of bidi-iterating there one
9546 character at a time. (Bug#9610)
9547 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9548 TO_CHARPOS if the bidi iterator is at base embedding level.
9549
9550 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9551
9552 * lread.c (readevalloop): Use correct code for NBSP.
9553 (read1): Likewise. (Bug#9608)
9554
9555 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9556
9557 * dbusbind.c (Fdbus_register_signal): When service is not
9558 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9559
9560 2011-09-25 Glenn Morris <rgm@gnu.org>
9561
9562 * buffer.c (truncate-lines): Doc fix.
9563
9564 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9565
9566 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9567 (Fset_window_next_buffers): Doc fix.
9568
9569 2011-09-24 Glenn Morris <rgm@gnu.org>
9570
9571 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9572
9573 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9574
9575 Fix minor problems found by static checking.
9576 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9577 * indent.c (Fvertical_motion): Fix == vs = typo.
9578
9579 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9580
9581 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9582 Default value is now t. Doc fix.
9583
9584 * indent.c (Fvertical_motion): Compute and apply the overshoot
9585 logic when moving up, not only when moving down. Fix the
9586 confusing name and values of the it_overshoot_expected variable;
9587 logic changes accordingly. (Bug#9254) (Bug#9549)
9588
9589 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9590 CHARPOS is covered by a display string which includes newlines.
9591 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9592 is covered by a display string with embedded newlines.
9593
9594 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9595
9596 * dbusbind.c (Fdbus_register_signal): Add match rule to
9597 Vdbus_registered_objects_table. (Bug#9581)
9598 (Fdbus_register_method, Vdbus_registered_objects_table):
9599 Fix docstring.
9600
9601 2011-09-24 Jim Meyering <meyering@redhat.com>
9602
9603 do not ignore write error for any output size
9604 The previous change was incomplete.
9605 While it makes emacs --batch detect the vast majority of stdout
9606 write failures, errors were still ignored whenever the output size is
9607 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9608 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9609 && echo FAIL: ignored write error
9610 FAIL: ignored write error
9611 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9612 && echo FAIL: ignored write error
9613 FAIL: ignored write error
9614 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9615
9616 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9617
9618 * emacs.c (Fkill_emacs): In noninteractive mode exit
9619 non-successfully if a write error occurred on stdout. (Bug#9574)
9620
9621 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9622
9623 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9624 the xassert test.
9625
9626 * dispextern.h (struct it): Update the comment documenting what
9627 can it->OBJECT be.
9628
9629 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9630
9631 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9632 a display string, extend search for cursor position to end of row.
9633 (find_row_edges): If the row ends in a newline from a display
9634 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9635 Handle the case of a display string with multiple newlines.
9636 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9637 non-empty line. Fixes confusing cursor motion with arrow keys at
9638 the beginning of a line that starts with whitespace.
9639
9640 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9641
9642 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9643 (bug#9493).
9644
9645 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9646
9647 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9648 boolean (Bug#9154).
9649
9650 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9651
9652 * xdisp.c (display_line): Record maximum and minimum buffer
9653 positions even if no glyphs were produced (e.g., by a zero-width
9654 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9655 buffer positions that will be removed from the glyph row because
9656 they don't fit.
9657 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9658 column is beyond frame width: don't subtract 1 "pixel" when
9659 computing width of the stretch.
9660 (reseat_at_next_visible_line_start): Undo the change made on
9661 2011-09-17 that saved paragraph information and restored it after
9662 the call to `reseat'. (Bug#9545)
9663
9664 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9665
9666 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9667 and turn window cursor on if cleared (Bug#9415).
9668
9669 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9670
9671 * search.c (boyer_moore): Take unibyte characters from pattern
9672 literally. (Bug#9458)
9673
9674 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9675
9676 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9677
9678 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9679
9680 Fix minor problem found by static checking.
9681 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9682 initialized, to pacify gcc -Wuninitialized.
9683
9684 * fileio.c: Report proper errno when syscall falls.
9685 (Finsert_file_contents): Save and restore errno,
9686 so that report_file_error outputs the correct diagnostic.
9687 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9688
9689 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9690
9691 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9692
9693 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9694
9695 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9696 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9697
9698 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9699
9700 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9701 about the current paragraph and restore it after the call to reseat.
9702
9703 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9704 (bidi_find_paragraph_start): Search back for paragraph beginning
9705 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9706 (bidi_move_to_visually_next): Only trigger paragraph-related
9707 computations when the last character is a newline or at EOB, not
9708 just any NEUTRAL_B. (Bug#9470)
9709
9710 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9711 truncated lines if point is covered by a display string. (Bug#9524)
9712
9713 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9716 (cons_to_x_long): New function.
9717 (lisp_data_to_selection_data): Use it. Correct the test for
9718 short-versus-long data; it was negated. Break out of vector
9719 loop, for efficiency, when a long datum is discovered.
9720
9721 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9722
9723 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9724
9725 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9726
9727 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9728 GCC PR/17406) by declaring this function with external scope.
9729
9730 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9731
9732 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9733 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9734
9735 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9736
9737 * editfns.c (Fformat): Correctly handle text properties on "%%".
9738
9739 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9740
9741 * xterm.c (x_draw_composite_glyph_string_foreground):
9742 * w32term.c (x_draw_composite_glyph_string_foreground):
9743 * term.c (encode_terminal_code):
9744 * composite.c (composition_update_it, get_composition_id):
9745 * xdisp.c (get_next_display_element)
9746 (fill_composite_glyph_string): Add comments about special meaning
9747 of TAB characters in a composition.
9748
9749 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9750
9751 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9752 This occurs when processing a multibyte format.
9753 Problem reported by Wolfgang Jenker.
9754
9755 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9756
9757 * xdisp.c (try_cursor_movement): Only check for exact match if
9758 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9759
9760 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9761
9762 Remove unused external symbols.
9763 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9764 * xdisp.c (calc_pixel_width_or_height): Now static.
9765 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9766 * indent.c (check_display_width):
9767 * w32term.c: Fix comment to match code.
9768 * xterm.c, xterm.h (x_catching_errors): Remove.
9769
9770 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9771
9772 * xselect.c: Use signed conversions more consistently (Bug#9498).
9773 (selection_data_to_lisp_data): Assume incoming selection data are
9774 signed integers, not unsigned. This is to be consistent with
9775 outgoing selection data, which was modified to use signed integers
9776 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9777 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9778 expects long, not unsigned long.
9779
9780 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9781
9782 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9783 computation of loop end. Reported by Johan Bockgård
9784 <bojohan@gnu.org>.
9785
9786 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9787
9788 * frame.c (Fother_visible_frames_p): Function deleted.
9789
9790 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9791
9792 * indent.c (compute_motion): Process display vector front to back
9793 rather than the other way around. (Bug#2496)
9794
9795 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9796
9797 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9798
9799 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9800
9801 * minibuf.c (Fread_from_minibuffer): Doc fix.
9802
9803 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9804
9805 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9806 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9807
9808 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9809
9810 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9811 value for non-existent files.
9812
9813 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9814
9815 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9816 set its "size" to -1. This will set the modtime_size field of
9817 the corresponding buffer to -1, which is what
9818 verify-visited-file-modtime expects for files that do not exist.
9819 (Bug#9139)
9820
9821 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9822
9823 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9824 here ...
9825 * lisp.h: ... from here. push_key_description is no longer
9826 defined in keyboard.c, so its declaration should not be in
9827 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9828 logically belongs with push_key_description.
9829
9830 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9831
9832 * buffer.h: Include <sys/types.h> instead of <time.h>.
9833 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9834 Problem reported by Herbert J. Skuhra.
9835
9836 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9837
9838 * xml.c (parse_region): Make the parsing work for
9839 non-comment-starting XML files again (bug#9144).
9840
9841 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9842
9843 * image.c (gif_load): Fix calculation of bottom and right corner.
9844 (Bug#9468)
9845
9846 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9847
9848 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9849 redisplay in small windows.
9850
9851 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9852
9853 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9854
9855 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9856
9857 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9858 Operate on live windows only.
9859
9860 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9861
9862 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9863
9864 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9865
9866 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9867 only under bidi iteration.
9868
9869 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9870
9871 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9872
9873 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9874
9875 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9876 Without this fix, the command to link temacs failed due to an
9877 undefined symbol __builtin_isnan. This is because
9878 /usr/include/iso/math_c99.h #defines isnan(x) to
9879 __builtin_isnan(x), but the bundled gcc, which identifies itself
9880 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9881 a __builtin_isnan.
9882 * floatfns.c (isnan): #undef, and then #define to a clone of
9883 what's in data.c.
9884 (Fisnan): Always define, since it's always available now.
9885 (syms_of_floatfns): Always define isnan at the Lisp level.
9886
9887 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9888
9889 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9890
9891 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9892
9893 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9894 The previous code assumed that file offsets (off_t values) fit in
9895 EMACS_INT variables, which is not true on typical 32-bit hosts.
9896 The code messed up by falsely reporting buffer overflow in cases
9897 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9898 when "big" contains more than 2**29 bytes, even though this
9899 inserts just one byte and does not overflow the buffer.
9900 (Finsert_file_contents): Store file offsets as off_t
9901 values, not as EMACS_INT values. Check for overflow when
9902 converting between EMACS_INT and off_t. When checking for
9903 buffer overflow or for overlap, take the offsets into account.
9904 Don't use EMACS_INT for small values where int suffices.
9905 When checking for overlap, fix a typo: ZV was used where
9906 ZV_BYTE was intended.
9907 (Fwrite_region): Don't assume off_t fits into 'long'.
9908 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9909
9910 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9911
9912 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9913
9914 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9915
9916 sprintf-related integer and memory overflow issues (Bug#9412).
9917
9918 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9919 (esprintf, exprintf, evxprintf): New functions.
9920 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9921 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9922 (modify_event_symbol): Do not assume that the length of
9923 name_alist_or_stem is safe to alloca and fits in int.
9924 (Fexecute_extended_command): Likewise for function name and binding.
9925 (Frecursion_depth): Wrap around reliably on integer overflow.
9926 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9927 since some callers pass EMACS_INT values.
9928 (Fsingle_key_description): Don't crash if symbol name contains more
9929 than MAX_ALLOCA bytes.
9930 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9931 (get_minibuffer): Arg is now EMACS_INT, not int.
9932 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9933 (esprintf, exprintf, evxprintf): New decls.
9934 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9935
9936 * dbusbind.c (signature_cat): New function.
9937 (xd_signature, Fdbus_register_signal):
9938 Do not overrun buffer; instead, report string overflow.
9939
9940 * dispnew.c (add_window_display_history): Don't overrun buffer.
9941 Truncate instead; this is OK since it's just a log.
9942
9943 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9944 even if the time zone offset is outlandishly large.
9945 Don't mishandle offset == INT_MIN.
9946
9947 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9948 when creating daemon; the previous buffer-overflow check was incorrect.
9949
9950 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9951 which has the guts of the old verror function.
9952
9953 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9954 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9955
9956 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9957 (font_unparse_xlfd): Don't blindly alloca long strings.
9958 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9959 fits in int, when using sprintf. Use single snprintf to count
9960 length of string rather than counting it via multiple sprintfs;
9961 that's simpler and more reliable.
9962 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9963 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9964 sprintf, in case result does not fit in int.
9965
9966 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9967 (fontset_from_font): Print it.
9968
9969 * frame.c (tty_frame_count): Now printmax_t, not int.
9970 (make_terminal_frame, set_term_frame_name): Print it.
9971 (x_report_frame_params): In X, window IDs are unsigned long,
9972 not signed long, so print them as unsigned.
9973 (validate_x_resource_name): Check for implausibly long names,
9974 and don't assume name length fits in 'int'.
9975 (x_get_resource_string): Don't blindly alloca invocation name;
9976 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9977 not fit in int.
9978
9979 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9980 (xg_check_special_colors, xg_set_geometry):
9981 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9982
9983 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9984 Use esprintf, not sprintf, in case result does not fit in int.
9985
9986 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9987 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9988 it as a large positive number.
9989 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9990 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9991
9992 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9993 in case result does not fit in int.
9994
9995 * print.c (float_to_string): Detect width overflow more reliably.
9996 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9997 buffer overrun. Don't assume list length fits in 'int'. Treat
9998 print length of 0 as 0, not as infinity; to be consistent with other
9999 uses of print length in this function. Don't overflow print length
10000 index. Don't assume hash table size fits in 'long', or that
10001 vectorlike size fits in 'unsigned long'.
10002
10003 * process.c (make_process): Use printmax_t, not int, to format
10004 process-name gensyms.
10005
10006 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10007
10008 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10009 to avoid potential buffer overrun.
10010
10011 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10012 if X resource line is longer than 512 bytes.
10013
10014 * xfns.c (x_window): Make sprintf buffer a bit bigger
10015 to avoid potential buffer overrun.
10016
10017 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10018
10019 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10020
10021 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10022
10023 Integer overflow fixes for scrolling, etc.
10024 Without these, Emacs silently mishandles large integers sometimes.
10025 For example, "C-u 4294967297 M-x recenter" was treated as if
10026 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10027
10028 * xdisp.c (try_window_id): Check Emacs fixnum range before
10029 converting to 'int'.
10030
10031 * window.c (window_scroll_line_based, Frecenter):
10032 Check that an Emacs fixnum is in range before assigning it to 'int'.
10033 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10034 values converted from Emacs fixnums.
10035 (Frecenter): Don't wrap around a line count if it is out of 'int'
10036 range; instead, treat it as an extreme value.
10037 (Fset_window_configuration, compare_window_configurations):
10038 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10039
10040 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10041 that can exceed INT_MAX. Check that EMACS_INT value is in range
10042 before assigning it to the (possibly-narrower) index.
10043 (match_limit): Don't assume that a fixnum can fit in 'int'.
10044
10045 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10046 exceed INT_MAX.
10047
10048 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10049 (Fvertical_motion): Don't wrap around LINES values that don't fit
10050 in 'int'. Instead, treat them as extreme values. This is good
10051 enough for windows, which can't have more than INT_MAX lines anyway.
10052
10053 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10054
10055 * Require libxml/parser.h to avoid compilation warning.
10056
10057 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10058
10059 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10060 since this reportedly can destroy thread storage.
10061
10062 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10063
10064 * syntax.c (find_defun_start): Update all cache variables if
10065 exiting early (Bug#9401).
10066
10067 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10068
10069 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10070
10071 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10072 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10073 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10074
10075 * term.c (tty_append_glyph): New function.
10076 (produce_stretch_glyph): Static function and its prototype deleted.
10077
10078 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10079 Add prototypes.
10080
10081 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10082
10083 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10084 when checking :margin (Bug#9390).
10085 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10086 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10087 so that the name doesn't mislead. All uses changed.
10088
10089 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10090
10091 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10092 set_tty_hooks.
10093
10094 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10095
10096 * xdisp.c (move_it_to): Don't bail out early when reaching
10097 position beyond to_charpos, if we are scanning backwards.
10098 (move_it_vertically_backward): When DY == 0, make sure we get to
10099 the first character in the line after the newline.
10100
10101 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10102
10103 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10104 (ccl_driver): Do not generate an out-of-range pointer.
10105 (Fccl_execute_on_string): Remove unnecessary check for
10106 integer overflow, noted by Stefan Monnier in
10107 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10108 Remove a FIXME that didn't need fixing.
10109 Simplify the newly-introduced buffer reallocation code.
10110
10111 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10112
10113 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10114
10115 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10116
10117 Integer and memory overflow issues (Bug#9196).
10118
10119 * doc.c (get_doc_string): Rework so that
10120 get_doc_string_buffer_size is the actual buffer size, rather than
10121 being 1 less than the actual buffer size; this makes xpalloc more
10122 convenient.
10123
10124 * image.c (x_allocate_bitmap_record, cache_image):
10125 * xselect.c (Fx_register_dnd_atom):
10126 Simplify previous changes by using xpalloc.
10127
10128 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10129 since either will do and ptrdiff_t is convenient with xpalloc.
10130
10131 * charset.c (charset_table_size)
10132 (struct charset_sort_data.priority): Now ptrdiff_t.
10133 (charset_compare): Don't overflow if priorities differ greatly.
10134 (Fsort_charsets): Don't assume list length fits in int.
10135 Check for size-calculation overflow when allocating sort data.
10136 (syms_of_charset): Allocate an initial charset table that is
10137 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10138
10139 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10140
10141 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10142 The actual value is always <= INT_MAX, and leaving it unsigned made
10143 overflow checking harder.
10144
10145 * dispextern.h (struct glyph_matrix.rows_allocated)
10146 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10147 with xpalloc. The values are still always <= INT_MAX.
10148
10149 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10150
10151 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10152 (SAFE_NALLOCA): New macro.
10153
10154 * region-cache.c (struct boundary.pos, find_cache_boundary)
10155 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10156 (set_cache_region, invalidate_region_cache)
10157 (revalidate_region_cache, know_region_cache, region_cache_forward)
10158 (region_cache_backward, pp_cache):
10159 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10160 so that ptrdiff_t * can be passed to xpalloc.
10161 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10162 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10163 (pp_cache): Don't assume cache_len fits in int.
10164 * region-cache.h: Adjust extern decls to match.
10165
10166 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10167 EMACS_INT, since either will do, for xpalloc.
10168
10169 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10170 (xnmalloc, xnrealloc, xpalloc): New functions.
10171
10172 * bidi.c (bidi_shelve_header_size): New constant.
10173 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10174 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10175
10176 * bidi.c (bidi_cache_shrink):
10177 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10178 (overlay_strings):
10179 Don't update size of array until after memory allocation succeeds,
10180 because xmalloc/xrealloc may not return.
10181 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10182 now that we have proper integer overflow checking.
10183 (record_overlay_string, overlay_strings): Catch overflows when
10184 calculating size of overlay_str_buf.
10185
10186 * callproc.c (Fcall_process): Check for size overflow when
10187 calculating size of args2.
10188 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10189 Normally we prefer signed values, but sticking with ptrdiff_t would
10190 require adding more-complicated checks.
10191
10192 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10193 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10194 Redo buffer-overflow calculations to avoid integer overflow.
10195 Add a FIXME comment where memory seems to be over-allocated.
10196
10197 * character.c (Fstring): Check for size-calculation overflow.
10198
10199 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10200 unnecessary integer overflow. Check for size overflow.
10201 (encode_coding_object): Don't update size until xmalloc succeeds.
10202
10203 * composite.c (get_composition_id): Check for overflow in glyph
10204 length calculations.
10205
10206 Integer and memory overflow fixes for display code.
10207 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10208 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10209 (scrolling_window): Check for overflow in size calculations.
10210 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10211 Don't assume glyph table len fits in int.
10212 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10213 (row_table_size): Now ptrdiff_t, not int.
10214 (scrolling_window): Avoid overflow in size calculations.
10215 Don't update size until allocation succeeds.
10216 * fns.c (concat): Check for overflow in size calculations.
10217 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10218 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10219 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10220
10221 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10222 (get_doc_string): Check for size calculation overflow.
10223 Don't update size until allocation succeeds.
10224 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10225 EMACS_INT, where ptrdiff_t will do.
10226 (Fsubstitute_command_keys): Check for string overflow.
10227
10228 * editfns.c (set_time_zone_rule): Don't assume environment length
10229 fits in int.
10230 (message_length): Now ptrdiff_t, not int.
10231 (Fmessage_box): Don't update size until allocation succeeds.
10232 Don't assume message length fits in int.
10233 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10234
10235 * emacs.c (main): Do not reallocate argv, since there is a null at
10236 the end that can be overwritten, and this way there's no need to
10237 worry about size-calculation overflow.
10238 (sort_args): Check for size-calculation overflow.
10239
10240 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10241 alloc succeeds.
10242 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10243
10244 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10245 (x_set_scroll_bar_width, x_figure_window_size):
10246 Check for integer overflow.
10247 (x_set_alpha): Do not assume XINT fits in int.
10248
10249 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10250 This is for the members text_lines, text_cols, total_lines, total_cols,
10251 where the system imposes an 'int' limit.
10252
10253 * fringe.c (Fdefine_fringe_bitmap):
10254 Don't update size until alloc works.
10255
10256 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10257 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10258
10259 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10260 Check for size-calculation overflow.
10261 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10262 do, as we prefer signed integers.
10263 (id_to_widget.max_size, id_to_widget.used)
10264 (xg_store_widget_in_map, xg_remove_widget_from_map)
10265 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10266 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10267 Use and return ptrdiff_t, not int.
10268 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10269 * gtkutil.h: Change prototypes to match the above.
10270
10271 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10272 are duplicate now that they've been promoted to lisp.h.
10273 (x_allocate_bitmap_record, x_alloc_image_color)
10274 (make_image_cache, cache_image, xpm_load):
10275 Don't update size until alloc is done.
10276 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10277 (x_detect_edges):
10278 Check for size calculation overflow.
10279 (ct_colors_allocated_max): New constant.
10280 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10281 overflow.
10282
10283 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10284 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10285 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10286 Use ptrdiff_t, not int, to count maps.
10287 (read_char_minibuf_menu_prompt): Check for overflow in size
10288 calculations. Don't update size until allocation succeeds.
10289 Redo calculations to avoid overflow.
10290 * keyboard.h: Change prototypes to match the above.
10291
10292 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10293 to count maps.
10294 (current_minor_maps): Check for size calculation overflow.
10295 * keymap.h: Change prototypes to match the above.
10296
10297 * lread.c (read1, init_obarray): Don't update size until alloc done.
10298
10299 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10300 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10301
10302 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10303 Now ptrdiff_t, not int.
10304 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10305 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10306
10307 * process.c (Fnetwork_interface_list): Check for overflow
10308 in size calculation.
10309
10310 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10311
10312 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10313 overflow. Don't bother calling xmalloc when xrealloc will do.
10314
10315 * search.c (Freplace_match): Check for size calculation overflow.
10316 (Fset_match_data): Don't assume list lengths fit in 'int'.
10317
10318 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10319 for command line length. Do not attempt to address one before the
10320 beginning of an array, as that's not portable.
10321
10322 * term.c (max_frame_lines): Remove; unused.
10323 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10324 not int.
10325 (encode_terminal_code, calculate_costs): Check for size
10326 calculation overflow.
10327 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10328 table lengths and related sizes. Don't update size until alloc
10329 done. Redo calculations to avoid overflow.
10330 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10331
10332 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10333 subtracting pointers.
10334 (gobble_line): Check for overflow more carefully. Don't update size
10335 until alloc done.
10336
10337 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10338 Don't update size until alloc done.
10339 Redo size calculations to avoid overflow.
10340 Check for size calculation overflow.
10341 (main) [DEBUG]: Fix typo in invoking tparam1.
10342
10343 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10344 Use ptrdiff_t, not int, for sizes.
10345 (store_mode_line_noprop_char): Don't update size until alloc done.
10346
10347 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10348 Use ptrdiff_t, not int, for sizes.
10349 (Finternal_make_lisp_face, cache_face):
10350 Check for size calculation overflow.
10351 (cache_face): Treat size calculation overflows as if they were
10352 memory exhaustion (the usual treatment), rather than aborting.
10353
10354 * xfns.c (x_encode_text, x_set_name_internal)
10355 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10356 sizes, since they can exceed INT_MAX in size. Check for size
10357 calculation overflow.
10358
10359 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10360 (xg_select): Check for size calculation overflow.
10361 Don't update size until alloc done.
10362
10363 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10364 as sprintf is limited to int lengths.
10365
10366 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10367 (X_LONG_MIN): New macros.
10368 Use them to make the following changes clearer.
10369 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10370 This change doesn't affect the value now, but it may help remind
10371 future maintainers not to raise the value too much later.
10372 (SELECTION_QUANTUM): Remove, replacing with ...
10373 (selection_quantum): ... new function, which avoids overflow.
10374 All uses changed.
10375 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10376 assumption that selection length fits in 'int'.
10377 (x_reply_selection_request, x_handle_selection_request)
10378 (x_get_window_property, receive_incremental_selection)
10379 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10380 (lisp_data_to_selection_data, clean_local_selection_data):
10381 Use ptrdiff_t, not int, to record length of selection.
10382 (x_reply_selection_request, x_get_window_property)
10383 (receive_incremental_selection, x_property_data_to_lisp):
10384 Redo calculations to avoid overflow.
10385 (x_reply_selection_request): When sending hint, ceiling it at
10386 X_LONG_MAX rather than relying on wraparound overflow to send
10387 something.
10388 (x_get_window_property, receive_incremental_selection)
10389 (lisp_data_to_selection_data, x_property_data_to_lisp):
10390 Check for size-calculation overflow.
10391 (x_get_window_property, receive_incremental_selection)
10392 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10393 Don't store size until memory allocation succeeds.
10394 (x_get_window_property): Plug memory leak on memory exhaustion.
10395 Don't double-block input; malloc is safe here. Don't assume 2**34
10396 - 4 fits in unsigned long. Add an xassert to check
10397 XGetWindowProperty overflow. Be more careful about overflow
10398 calculations, and distinguish size from memory overflow better.
10399 (receive_incremental_selection): When tracing, don't assume
10400 unsigned int is less than INT_MAX.
10401 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10402 harmful) conversions of unsigned short to int.
10403 (lisp_data_to_selection_data): Don't assume that integers
10404 in the range -65535 through -1 fit in an X unsigned short.
10405 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10406 result parameters unless successful. Rely on cons_to_unsigned
10407 to report problems with elements; the old code wasn't right anyway.
10408 (x_check_property_data): Check for int overflow; we cannot use
10409 a wider type due to X limits.
10410 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10411
10412 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10413
10414 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10415 (x_term_init): Check for size calculation overflow.
10416 (x_color_cells): Don't store size until memory allocation succeeds.
10417 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10418 Don't assume alloca size is less than MAX_ALLOCA.
10419 (x_term_init): Don't assume length fits in int (sprintf is limited
10420 to int size).
10421
10422 Use ptrdiff_t for composition IDs.
10423 * character.c (lisp_string_width):
10424 * composite.c (composition_table_size, n_compositions)
10425 (get_composition_id, composition_gstring_from_id):
10426 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10427 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10428 * window.c (Frecenter):
10429 Use ptrdiff_t, not int, for composition IDs.
10430 * composite.c (get_composition_id): Check for integer overflow.
10431 * composite.h: Adjust prototypes to match the above changes.
10432
10433 Use ptrdiff_t for hash table indexes.
10434 * category.c (hash_get_category_set):
10435 * ccl.c (ccl_driver):
10436 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10437 * coding.c (coding_system_charset_list, detect_coding_system):
10438 * coding.h (struct coding_system.id):
10439 * composite.c (get_composition_id, gstring_lookup_cache):
10440 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10441 * image.c (xpm_get_color_table_h):
10442 * lisp.h (hash_lookup, hash_put):
10443 * minibuf.c (Ftest_completion):
10444 Use ptrdiff_t for hash table indexes, not int (which is too
10445 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10446 32-bit --with-wide-int hosts).
10447
10448 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10449 Add a FIXME comment about memory leaks.
10450 (syms_of_charset): Don't assume xmalloc returns.
10451
10452 Don't assume that stated character widths fit in int.
10453 * character.c (Fchar_width, c_string_width, lisp_string_width):
10454 * character.h (CHAR_WIDTH):
10455 * indent.c (MULTIBYTE_BYTES_WIDTH):
10456 Use sanitize_char_width to avoid undefined and/or bad behavior
10457 with outlandish widths.
10458 * character.h (sanitize_tab_width): Rename from sanitize_width,
10459 now that we have two such functions. All uses changed.
10460 (sanitize_char_width): New inline function.
10461
10462 Don't assume that tab-width fits in int.
10463 * character.h (sanitize_width): New inline function.
10464 (SANE_TAB_WIDTH): New macro.
10465 (ASCII_CHAR_WIDTH): Use it.
10466 * indent.c (sane_tab_width): Remove. All uses replaced by
10467 SANE_TAB_WIDTH (current_buffer).
10468 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10469
10470 * fileio.c: Integer overflow issues with file modes.
10471 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10472
10473 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10474 Remove unreachable code.
10475 (read_hex, load_charset_map_from_file): Check for integer overflow.
10476
10477 * xterm.c: Don't go over XClientMessageEvent limit.
10478 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10479 (x_send_scroll_bar_event): Likewise. Check that the size does not
10480 exceed limits imposed by XClientMessageEvent, as well as the usual
10481 ptrdiff_t and size_t limits.
10482
10483 * keyboard.c: Overflow, signedness and related fixes.
10484 (make_lispy_movement): Use same integer type in forward decl
10485 that is used in the definition.
10486 (read_key_sequence, keyremap_step):
10487 Change bufsize argument back to int, undoing my 2011-03-30 change.
10488 We prefer signed types, and int is wide enough here.
10489 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10490 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10491 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10492 length, not size_t. Use ptrdiff_t for index, not int.
10493 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10494 possibility of integer overflow.
10495
10496 Overflow, signedness and related fixes for images.
10497
10498 * dispextern.h (struct it.stack[0].u.image.image_id)
10499 (struct_it.image_id, struct image.id, struct image_cache.size)
10500 (struct image_cache.used, struct image_cache.ref_count):
10501 * gtkutil.c (update_frame_tool_bar):
10502 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10503 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10504 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10505 * nsmenu.m (update_frame_tool_bar):
10506 * xdisp.c (calc_pixel_width_or_height):
10507 * xfns.c (image_cache_refcount):
10508 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10509 on typical 64-bit hosts.
10510
10511 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10512 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10513 Omit unnecessary casts to int.
10514 (parse_image_spec): Check that integers fall into 'int' range
10515 when the callers expect that.
10516 (image_ascent): Redo ascent calculation to avoid int overflow.
10517 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10518 (lookup_image): Remove unnecessary tests.
10519 (xbm_image_p): Locals are now of int, not EMACS_INT,
10520 since parse_image_check makes sure they fit into int.
10521 (png_load, gif_load, svg_load_image):
10522 Prefer int to unsigned where either will do.
10523 (tiff_handler): New function, combining the cores of the
10524 old tiff_error_handler and tiff_warning_handler.
10525 This function is rewritten to use vsnprintf and thereby avoid
10526 stack buffer overflows. It uses only the features of vsnprintf
10527 that are common to both POSIX and native Microsoft.
10528 (tiff_error_handler, tiff_warning_handler): Use it.
10529 (tiff_load, gif_load, imagemagick_load_image):
10530 Don't assume :index value fits in 'int'.
10531 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10532 (imagemagick_load_image): Check that crop parameters fit into
10533 the integer types that MagickCropImage accepts. Don't assume
10534 Vimagemagick_render_type has a nonnegative value. Don't assume
10535 size_t fits in 'long'.
10536 (gs_load): Use printmax_t to print the widest integers possible.
10537 Check for integer overflow when computing image height and width.
10538
10539 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10540
10541 * xdisp.c (redisplay_window): Don't force window start if point
10542 will be invisible in the resulting window. (Bug#9324)
10543
10544 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10545
10546 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10547 the display spec is of the form `(space ...)'.
10548 (handle_display_spec): Return the value returned by
10549 handle_single_display_spec, not just 1 or zero.
10550 (handle_single_display_spec): If the display spec is of the form
10551 `(space ...)', and specifies display in the text area, return 2
10552 rather than 1.
10553 (try_cursor_movement): Check for the need to scroll more
10554 accurately, and prefer exact match for point under bidi.
10555 Don't advance `row' beyond the last row of the window.
10556
10557 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10558 into disp_prop; all users changed.
10559
10560 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10561 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10562 for the text covered by the display property.
10563
10564 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10565
10566 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10567 Change return value to nil.
10568 (Frecord_buffer): Delete unused function.
10569
10570 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10571
10572 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10573 buffers, return left-to-right.
10574 (set_cursor_from_row): Consider candidate row a win if its glyph
10575 represents a newline and point is on that newline. Fixes cursor
10576 positioning on the newline at EOL of R2L text within L2R
10577 paragraph, and vice versa.
10578 (try_cursor_movement): Check continued rows, in addition to
10579 continuation rows. Fixes unwarranted scroll when point enters a
10580 continued line of R2L text within an L2R paragraph, or vice versa.
10581 (cursor_row_p): Consider the case of point being equal to
10582 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10583 from the end of a short line to the beginning of a continued line
10584 of R2L text within L2R paragraph.
10585 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10586 composed characters.
10587
10588 * bidi.c (bidi_check_type): Use xassert.
10589 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10590 members.
10591
10592 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10593
10594 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10595 a character.
10596
10597 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10598
10599 * nsfont.m (ns_otf_to_script): Fix typo.
10600
10601 2011-08-22 Kenichi Handa <handa@m17n.org>
10602
10603 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10604 extra slot even if the purpose is char-code-property-table.
10605
10606 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10607
10608 * xdisp.c (redisplay_window): When computing centering_position,
10609 account for the height of the header line. (Bug#8874)
10610
10611 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10612 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10613 candidate is selected by the mouse, and that candidate has a
10614 composed character under the mouse.
10615
10616 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10617 coordinates reported by pos-visible-in-window-p for a composed
10618 character in column zero.
10619
10620 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10621
10622 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10623
10624 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10625
10626 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10627 consider it a hit if to_charpos is anywhere in the range of the
10628 composed buffer positions.
10629
10630 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10631
10632 * image.c (gif_load): Don't assume that each subimage has the same
10633 dimensions as the base image. Handle disposal method that is
10634 "undefined" by the gif spec (Bug#9335).
10635
10636 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10637
10638 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10639 (Fcondition_case): Document `debug' symbol in error handler.
10640
10641 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10642
10643 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10644 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10645 from an Org mode buffer to a Speedbar frame.
10646
10647 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10648 a composition, take its buffer position from IT->cmp_it.charpos.
10649 Fixes cursor positioning at the beginning of a line that begins
10650 with a composed character.
10651
10652 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10653
10654 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10655 character bidirectional type, use STRONG_L instead. Fixes crashes
10656 in a buffer produced by `describe-categories'.
10657
10658 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10659 members before the level stack, so they would be saved and
10660 restored when copying iterator state. Fixes incorrect reordering
10661 around TABs covered by display properties.
10662
10663 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10664
10665 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10666
10667 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10668
10669 * eval.c (internal_condition_case, internal_condition_case_1)
10670 (internal_condition_case_2, internal_condition_case_n):
10671 Remove unnecessary aborts (Bug#9081).
10672
10673 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10674
10675 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10676 has no `load' handler, try opening the file locally. (Bug#9311)
10677
10678 2011-08-16 Ken Brown <kbrown@cornell.edu>
10679
10680 * gmalloc.c: Expand comment.
10681
10682 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10683
10684 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10685 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10686
10687 2011-08-16 Ken Brown <kbrown@cornell.edu>
10688
10689 Fix memory allocation problems in Cygwin build (Bug#9273).
10690
10691 * unexcw.c ( __malloc_initialized): Declare external variable.
10692 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10693
10694 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10695 New variables.
10696 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10697 dumped emacs.
10698 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10699 in the static heap.
10700 [CYGWIN] (special_realloc): New function.
10701 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10702 requests to realloc storage in the static heap.
10703
10704 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10705
10706 * bidi.c (bidi_initialize): Remove unused local.
10707
10708 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10709
10710 * bidimirror.h:
10711 * biditype.h: Remove file.
10712 * makefile.w32-in ($(BLD)/bidi.$(O)):
10713 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10714
10715 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10716
10717 * chartab.c: Improve commentary for the uniprop_table API.
10718
10719 * bidi.c (bidi_paragraph_init): Support zero value of
10720 bidi_ignore_explicit_marks_for_paragraph_level.
10721 (bidi_initialize): Use uniprop_table instead of including
10722 biditype.h and bidimirror.h.
10723
10724 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10725 coordinates of the iterator when restoring from ppos_it.
10726 (Bug#9296)
10727
10728 2011-08-14 Kenichi Handa <handa@m17n.org>
10729
10730 * process.c (create_process): Call setup_process_coding_systems
10731 after the pid of the process is set to -1 (Bug#8162).
10732
10733 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10734
10735 * xdisp.c (move_it_in_display_line_to): Don't invoke
10736 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10737 ppos_it. Fixes vertical cursor motion when line beginning is
10738 covered by an image. (Bug#9296)
10739
10740 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10741
10742 * nsterm.h (ns_run_ascript): Declare.
10743 (NSAPP_DATA2_RUNASSCRIPT): Define.
10744
10745 * nsfns.m (as_script, as_result, as_status): New static variables.
10746 (ns_run_ascript): New function.
10747 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10748 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10749 the event loop. Get status from as_status (Bug#7276).
10750
10751 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10752 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10753 the event loop (Bug#7276).
10754
10755 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10756
10757 * gnutls.c (QCgnutls_bootprop_priority)
10758 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10759 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10760 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10761 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10762 (QCgnutls_bootprop_verify_hostname_error)
10763 (QCgnutls_bootprop_callbacks_verify): Rename from
10764 Qgnutls_bootprop_..., all uses changed.
10765
10766 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10767 uses changed.
10768
10769 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10770
10771 * xfaces.c (Qframe_set_background_mode): Now static.
10772 * dispextern.h (Qframe_set_background_mode): Remove decl.
10773
10774 * process.c (Fnetwork_interface_info): Declare local only if needed.
10775
10776 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10777
10778 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10779 (Fnetwork_interface_list): Allocate in increments of bytes instead
10780 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10781 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10782 sockaddr.
10783 (struct ifflag_def): notrailers is smart on OSX.
10784 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10785 Get hardware address with getifaddrs if available.
10786
10787 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10788
10789 * xdisp.c (iterate_out_of_display_property): xassert that
10790 IT->position is set to within IT->object's boundaries. Break from
10791 the loop as soon as EOB is reached; avoids infloops in redisplay
10792 when IT->position is set up wrongly due to some bug.
10793 Set IT->current to match the bidi iterator unconditionally.
10794 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10795 entry. Force push_it to save on the stack the current
10796 buffer/string position, to be restored by pop_it. Fix flags in
10797 the iterator structure wrt the object coming from a display
10798 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10799 properties. (Bug#9284)
10800
10801 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10802
10803 * fontset.c (fontset_get_font_group): Add proper type checks.
10804 (Bug#9172)
10805
10806 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10807
10808 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10809 and LC_VERSION_MIN_MACOSX.
10810 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10811 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10812
10813 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10814
10815 * xdisp.c (forward_to_next_line_start): Allow to use the
10816 no-display-properties-and-no-overlays under bidi display.
10817 Set disp_pos in the bidi iterator to avoid searches for display
10818 properties and overlays.
10819
10820 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10821
10822 * editfns.c (Fset_time_zone_rule): Document relationship with the
10823 setenv function.
10824
10825 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10826 the font entity extracted from the cache (Bug#8109).
10827
10828 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10829
10830 * composite.c (autocmp_chars): Don't reset point. That is done by
10831 restore_point_unwind (Bug#5984).
10832
10833 2011-08-07 Juri Linkov <juri@jurta.org>
10834
10835 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10836 to show the arg `TIME' instead of `TIMEVAL'.
10837
10838 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10839
10840 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10841 display property strides EOL and includes a newline, as in
10842 longlines-mode. (Bug#9254)
10843 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10844 word-wrap under bidirectional display. (Bug#9224)
10845
10846 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10847 is non-zero, even if the data buffer is NULL. Fixes a crash in
10848 vertical-motion with longlines-mode. (Bug#9254)
10849
10850 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10851
10852 * bidi.c <bidi_cache_total_alloc>: Now static.
10853 (bidi_initialize): Initialize bidi_cache_total_alloc.
10854
10855 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10856 cache. (Bug#9221)
10857
10858 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10859 amount allocated this far in `bidi_cache_total_alloc'.
10860 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10861 non-zero, only free the data buffer without restoring the cache
10862 contents. All callers changed.
10863
10864 * dispextern.h (bidi_unshelve_cache): Update prototype.
10865
10866 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10867 (move_it_in_display_line, move_it_to)
10868 (move_it_vertically_backward, move_it_by_lines): Replace the call
10869 to xfree to an equivalent call to bidi_unshelve_cache.
10870 (move_it_in_display_line_to): Fix logic of returning
10871 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10872
10873 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10874
10875 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10876 came from a string character with a `cursor' property. (Bug#9229)
10877
10878 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10879
10880 * Makefile.in (LIB_PTHREAD): New variable.
10881 (LIBES): Add LIB_PTHREAD (Bug#9216).
10882
10883 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10884 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10885
10886 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10887
10888 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10889
10890 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10891
10892 * xterm.c (x_find_topmost_parent): New function.
10893 (x_set_frame_alpha): Find topmost parent window with
10894 x_find_topmost_parent and set the property there also (bug#9181).
10895 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10896
10897 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10898
10899 * callproc.c (Fcall_process): Avoid vfork clobbering
10900 the local vars buffer, coding_systems, current_dir.
10901
10902 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10903
10904 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10905
10906 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10907
10908 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10909 so that it is not optimized away.
10910
10911 * xdisp.c (compute_display_string_pos): Remove unused local.
10912
10913 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10914
10915 Fix slow cursor motion and scrolling in large buffers with
10916 selective display, like Org Mode buffers. (Bug#9218)
10917
10918 * dispextern.h (struct bidi_it): New member disp_prop_p.
10919
10920 * xdisp.c: Remove one-slot cache of display string positions.
10921 (compute_display_string_pos): Accept an additional argument
10922 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10923 for a display string or property. If found, set DISP_PROP_P
10924 non-zero.
10925
10926 * bidi.c (bidi_fetch_char): Accept an additional argument
10927 DISP_PROP_P, and pass it to compute_display_string_pos.
10928 Only handle text covered by a display string if DISP_PROP_P is returned
10929 non-zero. All callers of bidi_fetch_char changed.
10930
10931 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10932
10933 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10934
10935 2010-12-03 Don March <don@ohspite.net>
10936
10937 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10938 last character M-[char] is translated to ESC [char] (bug#7541).
10939
10940 2011-08-02 Kenichi Handa <handa@m17n.org>
10941
10942 * lisp.h (uniprop_table): Extern it.
10943
10944 * chartab.c (uniprop_table): Make it non-static.
10945
10946 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10947
10948 * xdisp.c (forward_to_next_line_start): Accept additional argument
10949 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10950 on the newline.
10951 (reseat_at_next_visible_line_start): Use the bidi iterator state
10952 returned by forward_to_next_line_start to restore the state of
10953 it->bidi_it after backing up to previous newline. (Bug#9212)
10954
10955 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10956
10957 * regex.c (re_comp): Protoize.
10958 (re_exec): Fix return type.
10959 (regexec): Fix type of `ret'. (Bug#9203)
10960
10961 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10962
10963 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10964 This is needed if max-image-size is a floating-point number.
10965
10966 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10967
10968 * print.c (print_object): Print empty symbol as ##.
10969
10970 * lread.c (read1): Read ## as empty symbol.
10971
10972 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10973
10974 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10975 setting frame foreground color (Bug#9175).
10976 (x_set_background_color): Likewise.
10977
10978 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10979 contents (Bug#9176).
10980 (EmacsTooltip -init): Remove bezels and add shadows to
10981 tooltip windows.
10982
10983 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10984 or scroll bar (Bug#8470).
10985
10986 * nsfont.m (nsfont_open): Remove assignment to voffset and
10987 unnecessary vars hshink, expand, hd, full_height, min_height.
10988 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10989
10990 * nsterm.h (nsfont_info): Remove voffset field.
10991
10992 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10993
10994 Implement strike-through and overline on NextStep (Bug#8863).
10995
10996 * nsfont.m (nsfont_open): Use underline position provided by font,
10997 instead of hard-coded value of 2.
10998 (nsfont_draw): Call ns_draw_text_decoration instead.
10999
11000 * nsterm.h: Add declaration for ns_draw_text_decoration.
11001
11002 * nsterm.m (ns_draw_text_decoration): New function for drawing
11003 underline, overline, and strike-through.
11004 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11005 ns_draw_text_decoration. Change treatment of cursor drawing to
11006 accommodate underlining, etc.
11007
11008 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11009
11010 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11011 default.
11012
11013 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11014
11015 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11016 Without this fix, if a signal arrives just after memory fills up,
11017 'malloc' might be invoked reentrantly.
11018
11019 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11020 In other words, assume that every image size is allowed, on non-X
11021 hosts. This assumption is probably wrong, but it lets Emacs compile.
11022
11023 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11024
11025 * regex.c (re_iswctype): Convert return values to boolean.
11026
11027 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11028
11029 * xdisp.c (compute_display_string_pos): Don't use cached display
11030 string position if the buffer had its restriction changed.
11031 (Bug#9184)
11032
11033 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11034
11035 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11036
11037 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11038
11039 Integer signedness and overflow and related fixes. (Bug#9079)
11040
11041 * bidi.c: Integer size and overflow fixes.
11042 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11043 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11044 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11045 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11046 (bidi_find_other_level_edge):
11047 Use ptrdiff_t instead of EMACS_INT where either will do.
11048 This works better on 32-bit hosts configured --with-wide-int.
11049 (bidi_cache_ensure_space): Check for size-calculation overflow.
11050 Use % rather than repeated addition, for better worst-case speed.
11051 Don't set bidi_cache_size until after xrealloc returns, because it
11052 might not return.
11053 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11054 (bidi_cache_ensure_space): Also check that the bidi cache size
11055 does not exceed that of the largest Lisp string or buffer. See Eli
11056 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11057
11058 * alloc.c (__malloc_size_t): Remove.
11059 All uses replaced by size_t. See Andreas Schwab's note
11060 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11061
11062 * image.c: Improve checking for integer overflow.
11063 (check_image_size): Assume that f is nonnull, since
11064 it is always nonnull in practice. This is one less thing to
11065 worry about when checking for integer overflow later.
11066 (x_check_image_size): New function, which checks for integer
11067 overflow issues inside X.
11068 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11069 This removes the need for a memory_full check.
11070 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11071 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11072 (xbm_read_bitmap_data): Change locals back to 'int', since
11073 their values must fit in 'int'.
11074 (xpm_load_image, png_load, tiff_load):
11075 Invoke x_create_x_image_and_pixmap earlier,
11076 to avoid much needless work if the image is too large.
11077 (tiff_load): Treat overly large images as if
11078 x_create_x_image_and_pixmap failed, not as malloc failures.
11079 (gs_load): Use x_check_image_size.
11080
11081 * gtkutil.c: Omit integer casts.
11082 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11083 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11084
11085 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11086
11087 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11088 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11089 would wrongly return t on a 64-bit host.
11090
11091 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11092 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11093 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11094 and therefore cause GCC to emit a bogus diagnostic in some cases.
11095
11096 * image.c: Integer signedness and overflow and related fixes.
11097 This is not an exhaustive set of fixes, but it's time to
11098 record what I've got.
11099 (lookup_pixel_color, check_image_size): Remove redundant decls.
11100 (check_image_size): Don't assume that arbitrary EMACS_INT values
11101 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11102 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11103 (tiff_load, imagemagick_load_image):
11104 Check for overflow in size calculations.
11105 (x_create_x_image_and_pixmap): Remove unnecessary test for
11106 xmalloc returning NULL; that can't happen.
11107 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11108 (xpm_color_bucket): Use better integer hashing function.
11109 (xpm_cache_color): Don't possibly over-allocate memory.
11110 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11111 (gif_memory_source):
11112 Use ptrdiff_t, not int or size_t, to record sizes.
11113 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11114 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11115 either works, as we prefer signed integers.
11116 (tiff_read_from_memory, tiff_write_from_memory):
11117 Return tsize_t, not size_t, since that's what the TIFF API wants.
11118 (tiff_read_from_memory): Don't fail simply because the read would
11119 go past EOF; instead, return a short read.
11120 (tiff_load): Omit no-longer-needed casts.
11121 (Fimagemagick_types): Don't assume size fits into 'int'.
11122
11123 Improve hashing quality when configured --with-wide-int.
11124 * fns.c (hash_string): New function, taken from sxhash_string.
11125 Do not discard information about ASCII character case; this
11126 discarding is no longer needed.
11127 (sxhash-string): Use it. Change sig to match it. Caller changed.
11128 * lisp.h: Declare it.
11129 * lread.c (hash_string): Remove, since we now use fns.c's version.
11130 The fns.c version returns a wider integer if --with-wide-int is
11131 specified, so this should help the quality of the hashing a bit.
11132
11133 * emacs.c: Integer overflow minor fix.
11134 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11135 Define only if GNU_LINUX.
11136 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11137
11138 * dispnew.c: Integer signedness and overflow fixes.
11139 Remove unnecessary forward decls, that were a maintenance hassle.
11140 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11141 All uses changed.
11142 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11143 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11144 (prepare_desired_row, line_draw_cost):
11145 Use int, not unsigned, where either works.
11146 (save_current_matrix, restore_current_matrix):
11147 Use ptrdiff_t, not size_t, where either works.
11148 (init_display): Check for overflow more accurately, and without
11149 relying on undefined behavior.
11150
11151 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11152 Remove, replacing with the new symbols in lisp.h. All uses changed.
11153 * fileio.c (make_temp_name):
11154 * filelock.c (lock_file_1, lock_file):
11155 * xdisp.c (message_dolog):
11156 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11157 Use pMd etc. instead.
11158 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11159 replacing the pWIDE etc. symbols removed from editfns.c.
11160
11161 * keyboard.h (num_input_events): Now uintmax_t.
11162 This is (very slightly) less likely to mess up due to wraparound.
11163 All uses changed.
11164
11165 * buffer.c: Integer signedness fixes.
11166 (alloc_buffer_text, enlarge_buffer_text):
11167 Use ptrdiff_t rather than size_t when either will do, as we prefer
11168 signed integers.
11169
11170 * alloc.c: Integer signedness and overflow fixes.
11171 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11172 (__malloc_size_t): Default to size_t, not to int.
11173 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11174 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11175 Prefer ptrdiff_t to size_t when either would do, as we prefer
11176 signed integers.
11177 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11178 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11179 Now const. Initialize with values that are in range even if char
11180 is signed.
11181 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11182 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11183 These functions do the right thing with sizes > 2**32.
11184 (check_depth): Now ptrdiff_t, not int.
11185 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11186 Adjust to new way of storing sizes. Check for size overflow bugs
11187 in rest of code.
11188 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11189 slightly wrong anyway, as it missed one instance of
11190 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11191 (refill_memory_reserve): Omit needless cast to size_t.
11192 (mark_object_loop_halt): Mark as externally visible.
11193
11194 * xselect.c: Integer signedness and overflow fixes.
11195 (Fx_register_dnd_atom, x_handle_dnd_message):
11196 Use ptrdiff_t, not size_t, since we prefer signed.
11197 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11198 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11199 x_dnd_atoms_size and x_dnd_atoms_length.
11200
11201 * doprnt.c: Prefer signed to unsigned when either works.
11202 * eval.c (verror):
11203 * doprnt.c (doprnt):
11204 * lisp.h (doprnt):
11205 * xdisp.c (vmessage):
11206 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11207 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11208 prefer signed arithmetic to avoid comparison confusion.
11209 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11210 but is a bit tricky.
11211
11212 Assume freestanding C89 headers, string.h, stdlib.h.
11213 * data.c, doprnt.c, floatfns.c, print.c:
11214 Include float.h unconditionally.
11215 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11216 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11217 * regex.c: Likewise for stddef.h, string.h.
11218 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11219 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11220 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11221 (STDC_HEADERS): Remove obsolete defines.
11222 * sysdep.c: Include limits.h unconditionally.
11223
11224 Assume support for memcmp, memcpy, memmove, memset.
11225 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11226 * regex.c (memcmp, memcpy):
11227 Remove; we assume C89 now.
11228
11229 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11230 (__malloc_safe_bcopy): Remove; no longer needed.
11231
11232 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11233 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11234 well either way, and we prefer signed to unsigned.
11235
11236 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11237
11238 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11239 closes the connection while we're reading (bug#9182).
11240
11241 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11242
11243 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11244 are specified (Bug#9168).
11245
11246 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11247
11248 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11249 Found by GCC static checking and --with-wide-int on a 32-bit host.
11250
11251 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11252
11253 * xdisp.c (compute_display_string_pos): Fix logic of caching
11254 previous display string position. Initialize cached_prev_pos to
11255 -1. Fixes slow-down at the beginning of a buffer.
11256
11257 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11258
11259 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11260 for attrs[LFACE_FONTSET_INDEX].
11261
11262 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11263
11264 * xml.c (parse_region): Remove unused local
11265 that was recently introduced.
11266
11267 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11268
11269 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11270 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11271
11272 * xdisp.c (move_it_in_display_line_to): Record the best matching
11273 position for TO_CHARPOS while scanning the line, and restore it on
11274 exit if none of the characters scanned was an exact match.
11275 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11276 when exact match is impossible due to invisible text, and the
11277 lines are truncated.
11278
11279 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11280
11281 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11282 for OSX >= 10.7.
11283
11284 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11285
11286 Fix a significant slow-down of cursor motion with C-n, C-p,
11287 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11288 auto-repeat under bidi redisplay in fontified buffers.
11289 * xdisp.c (compute_stop_pos_backwards): New function.
11290 (next_element_from_buffer): Call compute_stop_pos_backwards to
11291 find a suitable prev_stop when we find ourselves before
11292 base_level_stop.
11293 (reseat): Don't look for prev_stop, as that could mean a very long
11294 run.
11295 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11296 <cached_disp_overlay_modiff>: Cache for last found display string
11297 position.
11298 (compute_display_string_pos): Return the cached position if asked
11299 about the same buffer in the same area of character positions, and
11300 the buffer wasn't changed since the time the display string
11301 position was cached.
11302
11303 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11304
11305 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11306 is an integer, which is important for empty lines. (Bug#9149)
11307
11308 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11309
11310 * frame.c (Fmodify_frame_parameters): In tty case, update the
11311 default face if necessary (Bug#4238).
11312
11313 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11314
11315 * editfns.c (Fstring_to_char): No need to explain what a character
11316 is in the docstring (Bug#6576).
11317
11318 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11319
11320 * xml.c (parse_region): Make sure we always return a tree.
11321
11322 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11323
11324 * xml.c (parse_region): If a document contains only comments,
11325 return that, too.
11326
11327 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11328
11329 * xml.c (make_dom): Return comments, too.
11330
11331 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11332
11333 Port to OpenBSD.
11334 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11335 and the surrounding thread.
11336 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11337 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11338 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11339 timer goes off.
11340 * s/openbsd.h (BROKEN_SIGIO): Define.
11341 * unexelf.c (unexec) [__OpenBSD__]:
11342 Don't update the .mdebug section of the Alpha COFF symbol table.
11343
11344 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11345
11346 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11347 (bug#8460).
11348
11349 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11350
11351 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11352 This fixes some race conditions on the permissions of any newly
11353 created file.
11354
11355 * alloc.c (valid_pointer_p): Use pipe, not open.
11356 This fixes some permissions issues when debugging.
11357
11358 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11359 If fchown fails to set both uid and gid, try to set just gid,
11360 as that is sometimes allowed. Adjust the file's mode to eliminate
11361 setuid or setgid bits that are inappropriate if fchown fails.
11362
11363 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11364
11365 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11366 to compare Lisp_Objects.
11367 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11368 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11369 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11370
11371 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11372
11373 * lread.c (read_integer): Unread even EOF character.
11374 (read1): Likewise. Properly record start position of symbol.
11375
11376 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11377 symbol character follows.
11378
11379 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11380
11381 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11382 This works around a problem with the previous change to Fcopy_file.
11383 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11384 and without this change, GCC might complain about discarding
11385 fchown's return value.
11386
11387 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11388
11389 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11390
11391 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11392
11393 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11394
11395 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11396
11397 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11398 it's used from the C level.
11399
11400 * process.c: Use the same condition for POLL_FOR_INPUT in both
11401 keyboard.c and process.c (bug#1858).
11402
11403 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11404
11405 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11406 (Fgnutls_boot): Use it.
11407
11408 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11409
11410 * doc.c (Fsubstitute_command_keys): Revert last change.
11411
11412 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11413
11414 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11415 quotes the next character, and doesn't affect other longer
11416 sequences (bug#8935).
11417
11418 * lread.c (syms_of_lread): Clarify that is isn't only
11419 `eval-buffer' and `eval-defun' that's affected by
11420 `lexical-binding' (bug#8460).
11421
11422 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11423
11424 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11425 bidi redisplay when a line includes both an image and is truncated.
11426
11427 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11428
11429 Fix minor problems found by static checking.
11430 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11431 (elsz): Now a signed constant, not a size_t var. We prefer signed
11432 types to unsigned, to avoid integer comparison confusion. Without
11433 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11434 "cannot optimize loop, the loop counter may overflow", a symptom
11435 of the confusion.
11436 * indent.c (Fvertical_motion): Mark locals as initialized.
11437 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11438
11439 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11440
11441 * search.c (Fre_search_backward): Mention `case-fold-search' in
11442 all the re_search_* functions (bug#8138).
11443
11444 * keyboard.c (Fopen_dribble_file): Document when the file is
11445 closed (bug#8056).
11446
11447 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11448
11449 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11450 bidi_cache_idx.
11451
11452 Support bidi reordering of display and overlay strings.
11453 * xdisp.c (compute_display_string_pos)
11454 (compute_display_string_end): Accept additional argument STRING.
11455 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11456 (reseat_to_string): Initialize bidi_it->string.s and
11457 bidi_it->string.schars.
11458 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11459 NULL (avoids a crash in bidi_paragraph_init).
11460 Initialize itb.string.lstring.
11461 (init_iterator): Call bidi_init_it only of a valid
11462 buffer position was specified. Initialize paragraph_embedding to
11463 L2R.
11464 (reseat_to_string): Initialize the bidi iterator.
11465 (display_string): If we need to ignore text properties of
11466 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11467 original value of -1 will not work with bidi.)
11468 (compute_display_string_pos): First arg is now struct
11469 `text_pos *'; all callers changed. Support display properties on
11470 Lisp strings.
11471 (compute_display_string_end): Support display properties on Lisp
11472 strings.
11473 (init_iterator, reseat_1, reseat_to_string): Initialize the
11474 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11475 when iterating on a string not from display properties).
11476 (compute_display_string_pos, compute_display_string_end):
11477 Fix calculation of the object to scan. Fixes an error when using
11478 arrow keys.
11479 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11480 base_level_stop; instead, set base_level_stop to BEGV.
11481 Fixes crashes in vertical-motion.
11482 (next_element_from_buffer): Improve commentary for when
11483 the iterator is before prev_stop.
11484 (init_iterator): Initialize bidi_p from the default value of
11485 bidi-display-reordering, not from buffer-local value. Use the
11486 buffer-local value only if initializing for buffer iteration.
11487 (handle_invisible_prop): Support invisible properties on strings
11488 that are being bidi-reordered.
11489 (set_iterator_to_next): Support bidi reordering of C strings and
11490 Lisp strings.
11491 (next_element_from_string): Support bidi reordering of Lisp
11492 strings.
11493 (handle_stop_backwards): Support Lisp strings as well.
11494 (display_string): Support display of R2L glyph rows.
11495 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11496 (init_iterator): Don't initialize it->bidi_p for strings
11497 here.
11498 (reseat_to_string): Initialize it->bidi_p for strings here.
11499 (next_element_from_string, next_element_from_c_string)
11500 (next_element_from_buffer): Add xassert's for correspondence
11501 between IT's object being iterated and it->bidi_it.string
11502 structure.
11503 (face_before_or_after_it_pos): Support bidi iteration.
11504 (next_element_from_c_string): Handle the case of the first string
11505 character that is not the first one in the visual order.
11506 (get_visually_first_element): New function, refactored from common
11507 parts of next_element_from_buffer, next_element_from_string, and
11508 next_element_from_c_string.
11509 (tool_bar_lines_needed, redisplay_tool_bar)
11510 (display_menu_bar): Force left-to-right direction. Add a FIXME
11511 comment for making that be controlled by a user option.
11512 (push_it, pop_it): Save and restore the state of the
11513 bidi iterator. Save and restore the bidi_p flag.
11514 (pop_it): Iterate out of display property for string iteration as
11515 well.
11516 (iterate_out_of_display_property): Support iteration over strings.
11517 (handle_single_display_spec): Set up it->bidi_it for iteration
11518 over a display string, and call bidi_init_it.
11519 (handle_single_display_spec, next_overlay_string)
11520 (get_overlay_strings_1, push_display_prop): Set up the bidi
11521 iterator for displaying display or overlay strings.
11522 (forward_to_next_line_start): Don't use the shortcut if
11523 bidi-iterating.
11524 (back_to_previous_visible_line_start): If handle_display_prop
11525 pushed the iterator stack, restore the internal state of the bidi
11526 iterator by calling bidi_pop_it same number of times.
11527 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11528 and we are bidi-iterating, don't decrement the iterator position;
11529 instead, set the first_elt flag in the bidi iterator, to produce
11530 the same effect.
11531 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11532 (push_display_prop): xassert that we are iterating a buffer.
11533 (push_it, pop_it): Save and restore paragraph_embedding member.
11534 (handle_single_display_spec, next_overlay_string)
11535 (get_overlay_strings_1, reseat_1, reseat_to_string)
11536 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11537 correctly. Don't assume unibyte strings are not bidi-reordered.
11538 (compute_display_string_pos)
11539 (compute_display_string_end): Fix handling the case of C string.
11540 (push_it, pop_it): Save and restore from_disp_prop_p.
11541 (handle_single_display_spec, push_display_prop): Set the
11542 from_disp_prop_p flag.
11543 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11544 (pop_it): Call iterate_out_of_display_property only if we are
11545 popping after iteration over a string that came from a display
11546 property. Fix a typo in popping stretch info. Add an assertion
11547 for verifying that the iterator position is in sync with the bidi
11548 iterator.
11549 (handle_single_display_spec, get_overlay_strings_1)
11550 (push_display_prop): Fix initialization of paragraph direction for
11551 string when that of the parent object is not yet determined.
11552 (reseat_1): Call bidi_init_it to resync the bidi
11553 iterator with IT's position. (Bug#7616)
11554 (find_row_edges): If ROW->start.pos gives position
11555 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11556 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11557 Reset the from_disp_prop_p flag.
11558 (SAVE_IT, RESTORE_IT): New macros.
11559 (pos_visible_p, face_before_or_after_it_pos)
11560 (back_to_previous_visible_line_start)
11561 (move_it_in_display_line_to, move_it_in_display_line)
11562 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11563 (try_scrolling, redisplay_window, display_line): Use them when
11564 saving a temporary copy of the iterator and restoring it back.
11565 (back_to_previous_visible_line_start, reseat_1)
11566 (init_iterator): Empty the bidi cache "stack".
11567 (move_it_in_display_line_to): If iterator ended up at
11568 EOL, but we never saw any buffer positions smaller than
11569 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11570 motion in bidi-reordered lines.
11571 (move_it_in_display_line_to): Record prev_method and prev_pos
11572 immediately before the call to set_iterator_to_next. Fixes cursor
11573 motion in bidi-reordered lines with stretch glyphs and strings
11574 displayed in margins. (Bug#8133) (Bug#8867)
11575 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11576 TO_CHARPOS.
11577 (pos_visible_p): Support positions in bidi-reordered lines.
11578 Save and restore bidi cache.
11579
11580 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11581 (bidi_paragraph_info): Delete unused struct.
11582 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11583 (bidi_cache_start): New variable.
11584 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11585 to zero.
11586 (bidi_cache_fetch_state, bidi_cache_search)
11587 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11588 (bidi_cache_find, bidi_peek_at_next_level)
11589 (bidi_level_of_next_char, bidi_find_other_level_edge)
11590 (bidi_move_to_visually_next): Compare cache index with
11591 bidi_cache_start rather than with zero.
11592 (bidi_fetch_char): Accept new argument STRING; all callers
11593 changed. Support iteration over a string. Support strings with
11594 display properties. Support unibyte strings. Fix the type of
11595 `len' according to what STRING_CHAR_AND_LENGTH expects.
11596 (bidi_paragraph_init, bidi_resolve_explicit_1)
11597 (bidi_resolve_explicit, bidi_resolve_weak)
11598 (bidi_level_of_next_char, bidi_move_to_visually_next):
11599 Support iteration over a string.
11600 (bidi_set_sor_type, bidi_resolve_explicit_1)
11601 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11602 can now be zero (for strings); special values 0 and -1 were
11603 changed to -1 and -2, respectively.
11604 (bidi_char_at_pos): New function.
11605 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11606 Call it instead of FETCH_MULTIBYTE_CHAR.
11607 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11608 initialized to valid values.
11609 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11610 values.
11611 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11612 the test for valid cached positions. Fix the logic for looking up
11613 the sentinel state in the cache. GCPRO the Lisp string we are
11614 iterating.
11615 (bidi_push_it, bidi_pop_it): New functions.
11616 (bidi_initialize): Initialize the bidi cache start stack pointer.
11617 (bidi_cache_ensure_space): New function, refactored from part of
11618 bidi_cache_iterator_state. Don't assume the required size is just
11619 one BIDI_CACHE_CHUNK away.
11620 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11621 (bidi_count_bytes, bidi_char_at_pos): New functions.
11622 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11623 always valid if bidi_cache_idx is valid.
11624 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11625 is valid if it's going to be used.
11626 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11627 (bidi_cache_fetch_state, bidi_cache_search)
11628 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11629 (bidi_cache_iterator_state, bidi_cache_find)
11630 (bidi_find_other_level_edge, bidi_cache_start_stack):
11631 All variables related to cache indices are now EMACS_INT.
11632
11633 * dispextern.h (struct bidi_string_data): New structure.
11634 (struct bidi_it): New member `string'. Make flag members be 1-bit
11635 fields, and put them last in the struct.
11636 (compute_display_string_pos, compute_display_string_end):
11637 Update prototypes.
11638 (bidi_push_it, bidi_pop_it): Add prototypes.
11639 (struct iterator_stack_entry): New members bidi_p,
11640 paragraph_embedding, and from_disp_prop_p.
11641 (struct it): Member bidi_p is now a bit field 1 bit wide.
11642 (bidi_shelve_cache, bidi_unshelve_cache):
11643 Declare prototypes.
11644
11645 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11646 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11647 and vector-like objects.
11648
11649 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11650 cache around display iteration.
11651
11652 * window.c (Fwindow_end, window_scroll_pixel_based)
11653 (displayed_window_lines, Frecenter): Save and restore the bidi
11654 cache around display iteration.
11655
11656 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11657
11658 * editfns.c (Fdelete_region): Clarify the use of the named
11659 parameters (bug#6788).
11660
11661 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11662
11663 * indent.c (Fvertical_motion): Set and restore w->pointm when
11664 saving and restoring the window's buffer (Bug#9006).
11665
11666 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11667
11668 * editfns.c (Fstring_to_char): Clarify just what is returned
11669 (bug#6576). Text by Eli Zaretskii.
11670
11671 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11672
11673 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11674
11675 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11676
11677 * buffer.c (mmap_find): Fix a typo.
11678
11679 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11680
11681 Fix execution of x selection hooks.
11682 * xselect.c (Qx_lost_selection_functions)
11683 (Qx_sent_selection_functions): New vars.
11684 (syms_of_xselect): DEFSYM them.
11685 (x_handle_selection_request): Pass Qx_sent_selection_functions
11686 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11687 (x_handle_selection_clear,x_clear_frame_selections):
11688 Pass Qx_lost_selection_functions rather than
11689 Vx_lost_selection_functions to Frun_hook_with_args.
11690
11691 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11692
11693 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11694 The old code sometimes used this field without initializing it.
11695
11696 * alloc.c (gc_sweep): Don't read past end of array.
11697 In theory, the old code could also have corrupted Emacs internals,
11698 though it'd be very unlikely.
11699
11700 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11701
11702 * character.c (Fcharacterp): Don't advertise optional ignored
11703 argument. (Bug#4026)
11704
11705 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11706
11707 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11708 key" (bug#4257).
11709
11710 * window.c (Fset_window_start): Doc fix (bug#4199).
11711 (Fset_window_hscroll): Ditto.
11712
11713 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 Fix minor new problems caught by GCC 4.6.1.
11716 * term.c (init_tty): Remove unused local.
11717 * xsettings.c (store_monospaced_changed): Define this function only
11718 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11719 not used otherwise.
11720
11721 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11722
11723 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11724
11725 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11726
11727 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11728 are the mini-buffer and the echo area (bug#3320).
11729
11730 * term.c (init_tty): Remove support for supdup, c10 and perq
11731 terminals, which are no longer supported (bug#1482).
11732
11733 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11734
11735 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11736
11737 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11738
11739 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11740 for non-popups (Bug#3642).
11741
11742 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11743
11744 * alloc.c (reset_malloc_hooks): Protoize.
11745 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11746 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11747 * cm.c (losecursor): Likewise.
11748 * data.c (fmod): Likewise.
11749 * dispnew.c (swap_glyphs_in_rows): Likewise.
11750 * emacs.c (memory_warning_signal): Likewise.
11751 * floatfns.c (float_error): Likewise.
11752 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11753 (otf_open, font_otf_capability, generate_otf_features)
11754 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11755 Likewise.
11756 * image.c (pbm_read_file): Likewise.
11757 * indent.c (string_display_width): Likewise.
11758 * intervals.c (check_for_interval, search_for_interval)
11759 (inc_interval_count, count_intervals, root_interval)
11760 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11761 * lread.c (defalias): Likewise.
11762 * ralloc.c (r_alloc_check): Likewise.
11763 * regex.c (set_image_of_range_1, set_image_of_range)
11764 (regex_grow_registers): Likewise.
11765 * sysdep.c (strerror): Likewise.
11766 * termcap.c (valid_filename_p, tprint, main): Likewise.
11767 * tparam.c (main): Likewise.
11768 * unexhp9k800.c (run_time_remap, save_data_space)
11769 (update_file_ptrs, read_header, write_header, calculate_checksum)
11770 (copy_file, copy_rest, display_header): Likewise.
11771 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11772 Likewise.
11773 * xdisp.c (check_it): Likewise.
11774 * xfaces.c (register_color, unregister_color, unregister_colors):
11775 Likewise.
11776 * xfns.c (print_fontset_result): Likewise.
11777 * xrdb.c (member, fatal, main): Likewise.
11778
11779 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11780
11781 Fix minor problems found by static checking (Bug#9031).
11782 * chartab.c (char_table_set_range, map_sub_char_table):
11783 Remove unused locals.
11784 (uniprop_table): Now static.
11785 * composite.c (_work_char): Remove unused static var.
11786
11787 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11788
11789 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11790
11791 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11792
11793 * gtkutil.c (qttip_cb): Remove code without function.
11794
11795 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11796
11797 * w32.c (pthread_sigmask): New stub.
11798
11799 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11800
11801 Use pthread_sigmask, not sigprocmask (Bug#9010).
11802 sigprocmask is portable only for single-threaded applications, and
11803 Emacs can be multi-threaded when it uses GTK.
11804 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11805 (LIBES): Use it.
11806 * callproc.c (Fcall_process):
11807 * process.c (create_process):
11808 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11809 Use pthread_sigmask, not sigprocmask.
11810
11811 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11812
11813 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11814 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11815 wrong (Bug#8591).
11816
11817 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11818
11819 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11820 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11821 (xg_hide_tooltip): Fix comment.
11822
11823 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11824 in registerServicesMenuSendTypes.
11825 (validRequestorForSendType): Don't check ns_return_types.
11826
11827 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11828 ns_return_type.
11829
11830 2011-07-08 Jason Rumney <jasonr@gnu.org>
11831
11832 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11833 SH_SHOW for hidden windows (Bug#5482).
11834
11835 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11836 frame struct members of non-existent frames (Bug#6284).
11837
11838 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11839
11840 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11841 variable firstTime not needed on OSX >= 10.6.
11842 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11843 >= 10.5. Use setKnobProportion, setDoubleValue.
11844
11845 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11846 (MAC_OS_X_VERSION_10_5): Define if not defined.
11847 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11848 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11849 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11850
11851 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11852 cString and lossyCString on OSX >= 10.4.
11853
11854 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11855 sizeToFit on OSX >= 10.2.
11856
11857 * nsimage.m (allocInitFromFile): Don't use deprecated method
11858 bestRepresentationForDevice on OSX >= 10.6.
11859
11860 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11861 to avoid warning.
11862
11863 * emacs.c: Declare unexec_init_emacs_zone.
11864
11865 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11866
11867 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11868
11869 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11870 on svcsMenu (Bug#8842).
11871
11872 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11873 ns_return_types.
11874 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11875
11876 * nsterm.m (QUTF8_STRING): Declare.
11877 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11878 (validRequestorForSendType): Return type is (id).
11879 Change indexOfObjectIdenticalTo to indexOfObject.
11880 Check if we have local selection before returning self (Bug#8842).
11881 (writeSelectionToPasteboard): Put local selection into paste board
11882 if we have a local selection (Bug#8842).
11883 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11884
11885 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11886 (ns_get_local_selection): Declare.
11887
11888 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11889
11890 * keymap.c (describe_map_tree): Don't insert a double newline at
11891 the end of the buffer (bug#1169) and return whether we inserted
11892 something.
11893
11894 * callint.c (Fcall_interactively): Change "reading args" to
11895 "providing args" to try to clarify what it does (bug#1010).
11896
11897 2011-07-07 Kenichi Handa <handa@m17n.org>
11898
11899 * composite.c (composition_compute_stop_pos): Ignore a static
11900 composition starting before CHARPOS (Bug#8915).
11901
11902 * xdisp.c (handle_composition_prop): Likewise.
11903
11904 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11905
11906 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11907 (Bug#9015)
11908
11909 2011-07-07 Kenichi Handa <handa@m17n.org>
11910
11911 * character.h (unicode_category_t): New enum type.
11912
11913 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11914 (Qchar_code_property_table): New variable.
11915 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11916 (UNIPROP_COMPRESSED_FORM_P): New macros.
11917 (char_table_ascii): Uncompress the compressed values.
11918 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11919 Uncompress the compressed values.
11920 (sub_char_table_ref_and_range): Likewise.
11921 (char_table_ref_and_range): Uncompress the compressed values.
11922 (sub_char_table_set): New arg is_uniprop. Callers changed.
11923 Uncompress the compressed values.
11924 (sub_char_table_set_range): Args changed. Callers changed.
11925 (char_table_set_range): Adjuted for the above change.
11926 (map_sub_char_table): Delete args default_val and parent. Add arg
11927 top. Give decoded values to a Lisp function.
11928 (map_char_table): Adjust for the above change. Give decoded
11929 values to a Lisp function. Gcpro more variables.
11930 (uniprop_table_uncompress)
11931 (uniprop_decode_value_run_length): New functions.
11932 (uniprop_decoder, uniprop_decoder_count): New variables.
11933 (uniprop_get_decoder, uniprop_encode_value_character)
11934 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11935 New functions.
11936 (uniprop_encoder, uniprop_encoder_count): New variables.
11937 (uniprop_get_encoder, uniprop_table)
11938 (Funicode_property_table_internal, Fget_unicode_property_internal)
11939 (Fput_unicode_property_internal): New functions.
11940 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11941 Sunicode_property_table_internal, Sget_unicode_property_internal,
11942 and Sput_unicode_property_internal. Defvar_lisp
11943 char-code-property-alist.
11944
11945 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11946 Vunicode_category_table.
11947
11948 * font.c (font_range): Adjust for the change of
11949 Vunicode_category_table.
11950
11951 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11952
11953 * m/iris4d.h: Remove file, move contents ...
11954 * s/irix6-5.h: ... here.
11955
11956 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11957
11958 Remove unportable assumption about struct layout (Bug#8884).
11959 * alloc.c (mark_buffer):
11960 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11961 (clone_per_buffer_values): Don't assume that
11962 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11963 This isn't true in general, and it's particularly not true
11964 if Emacs is configured with --with-wide-int.
11965 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11966 New macros, used in the buffer.c change.
11967
11968 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11969
11970 * xsettings.c: Use both GConf and GSettings if both are available.
11971 (store_config_changed_event): Add comment.
11972 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11973 (store_tool_bar_style_changed): New functions.
11974 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11975 (struct xsettings): Move font inside HAVE_XFT.
11976 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11977 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
11978 Move inside HAVE_XFT.
11979 (something_changed_gsettingsCB): Rename from something_changedCB.
11980 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11981 also.
11982 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
11983 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
11984 (something_changed_gconfCB): Rename from something_changedCB.
11985 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11986 (parse_settings): Move check for font inside HAVE_XFT.
11987 (read_settings, apply_xft_settings): Add comment.
11988 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11989 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11990 call store_font_name_changed.
11991 (xft_settings_event): Add comment.
11992 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11993 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11994 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11995 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11996 (xsettings_initialize): Call init_gsettings last.
11997 (xsettings_get_system_font, xsettings_get_system_normal_font):
11998 Add comment.
11999
12000 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12001
12002 Random fixes. E.g., (random) never returned negative values.
12003 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12004 subseconds part to the entropy, as that's a bit more random.
12005 Prefer signed to unsigned, since the signedness doesn't matter and
12006 in general we prefer signed. When given a limit, use a
12007 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12008 latter isn't right if USE_2_TAGS_FOR_INTS.
12009 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12010 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12011
12012 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12013
12014 * textprop.c (text_property_stickiness):
12015 Obey Vtext_property_default_nonsticky.
12016 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12017 * w32fns.c (syms_of_w32fns):
12018 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12019
12020 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12021
12022 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12023 This is more efficient than Ffile_directory_p and avoids a minor race.
12024
12025 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12026
12027 * buffer.c (Foverlay_put): Say what the return value is
12028 (bug#7835).
12029
12030 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12031 is a directory before asking whether to use the file name
12032 (bug#7564).
12033 (barf_or_query_if_file_exists): Make the "File is a directory"
12034 error be more correct.
12035
12036 * fns.c (Frequire): Remove the mention of the .gz files, since
12037 that's installation-specific, but keep the mention of
12038 `get-load-suffixes'.
12039
12040 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12041
12042 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12043 Report string overflow if the output is too long.
12044
12045 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12046
12047 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12048 (syms_of_gnutls): Remove duplicate DEFSYM for
12049 Qgnutls_bootprop_verify_hostname_error, an error for
12050 Qgnutls_bootprop_verify_error (which is no longer used).
12051
12052 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12053 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12054 Also (re)move comments that are misplaced or no longer relevant.
12055
12056 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12057
12058 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12059
12060 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12061
12062 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12063 and background color parameters if they have been changed.
12064
12065 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12066
12067 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12068
12069 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12070
12071 * xsettings.c (SYSTEM_FONT): Define only when used.
12072 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12073
12074 * keymap.c (access_keymap_1): Now static.
12075
12076 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12077
12078 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12079 leave any prefix arg for the up event (Bug#1586).
12080
12081 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12082
12083 * lread.c (syms_of_lread): Mention single symbols defined by
12084 `defvar' or `defconst' (bug#7154).
12085
12086 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12087 (Frequire): Mention get-load-suffixes.
12088
12089 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12090
12091 * window.h (window): Remove clone_number slot.
12092 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12093 Remove.
12094 (make_parent_window, make_window, saved_window)
12095 (Fset_window_configuration, save_window_save): Don't deal with
12096 clone numbers.
12097 * buffer.c (Qclone_number): Remove declaration.
12098 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12099
12100 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12101
12102 Add multiple inheritance to keymaps.
12103 * keymap.c (Fmake_composed_keymap): New function.
12104 (Fset_keymap_parent): Simplify.
12105 (fix_submap_inheritance): Remove.
12106 (access_keymap_1): New function extracted from access_keymap to handle
12107 embedded parents and handle lists of maps.
12108 (access_keymap): Use it.
12109 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12110 (Fcopy_keymap): Handle embedded parents.
12111 (Fcommand_remapping, define_as_prefix): Simplify.
12112 (Fkey_binding): Simplify.
12113 (syms_of_keymap): Move minibuffer-local-completion-map,
12114 minibuffer-local-filename-completion-map,
12115 minibuffer-local-must-match-map, and
12116 minibuffer-local-filename-must-match-map to Elisp.
12117 (syms_of_keymap): Defsubr make-composed-keymap.
12118 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12119 (parse_menu_item): Trivial simplification.
12120
12121 2011-07-01 Glenn Morris <rgm@gnu.org>
12122
12123 * Makefile.in (SETTINGS_LIBS): Fix typo.
12124
12125 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12126
12127 * coding.c (Fencode_coding_string): Record the last coding system
12128 used, as the function doc string says (bug#8738).
12129
12130 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12131
12132 * xsettings.c (store_monospaced_changed): Take new font as arg and
12133 check for change against current_mono_font.
12134 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12135 (emacs_settings_constructor, emacs_settings_get_property)
12136 (emacs_settings_set_property, emacs_settings_class_init)
12137 (emacs_settings_init, gsettings_obj): Remove.
12138 (something_changedCB): New function for HAVE_GSETTINGS.
12139 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12140 with value as argument.
12141 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12142 g_settings_new (Bug#8967). Do not create gsettings_obj.
12143 Remove calls to g_settings_bind. Connect something_changedCB to
12144 "changed".
12145
12146 * xgselect.c: Add defined (HAVE_GSETTINGS).
12147 (xgselect_initialize): Ditto.
12148
12149 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12150 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12151 xg_select.
12152
12153 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12154
12155 * eval.c (struct backtrace): Simplify and port the data structure.
12156 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12157 signed bit field, as this assumption is not portable and it makes
12158 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12159 "char debug_on_exit : 1" as this is not portable either; instead,
12160 use the portable "unsigned int debug_on_exit : 1". Remove unused
12161 member evalargs. Remove obsolete comments about cc bombing out.
12162
12163 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12164
12165 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12166 Let HAVE_GSETTINGS override HAVE_GCONF.
12167 (store_monospaced_changed): New function.
12168 (EMACS_SETTINGS): A new type derived from GObject to handle
12169 GSettings notifications.
12170 (emacs_settings_constructor, emacs_settings_get_property)
12171 (emacs_settings_set_property, emacs_settings_class_init):
12172 New functions.
12173 (gsettings_client, gsettings_obj): New variables.
12174 (GSETTINGS_SCHEMA): New define.
12175 (something_changedCB): Call store_monospaced_changed.
12176 (init_gsettings): New function.
12177 (xsettings_initialize): Call init_gsettings.
12178 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12179 to NULL.
12180
12181 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12182 GCONF_CFLAGS/LIBS.
12183
12184 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12185
12186 * window.c (resize_root_window, grow_mini_window)
12187 (shrink_mini_window): Rename Qresize_root_window to
12188 Qwindow_resize_root_window and Qresize_root_window_vertically to
12189 Qwindow_resize_root_window_vertically.
12190
12191 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12192
12193 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12194
12195 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12196
12197 * makefile.w32-in: Redesign dependencies so they reflect more
12198 clearly which files are directly included by each source file,
12199 and not through other includes.
12200
12201 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12202
12203 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12204 (sort_overlays, overlay_strings): When an overlay's clone number
12205 matches the window's clone number process the overlay even if
12206 the overlay's window property doesn't match the current window.
12207
12208 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12209 (Fwindow_hchild): Rename to Fwindow_left_child.
12210 (Fwindow_next): Rename to Fwindow_next_sibling.
12211 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12212 (resize_window_check): Rename to window_resize_check.
12213 (resize_window_apply): Rename to window_resize_apply.
12214 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12215 (Fdelete_other_windows_internal, resize_frame_windows)
12216 (Fsplit_window_internal, Fdelete_window_internal)
12217 (grow_mini_window, shrink_mini_window)
12218 (Fresize_mini_window_internal): Fix callers accordingly.
12219
12220 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12221
12222 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12223 (emacs_fixed_set_min_size): Remove.
12224 (emacs_fixed_new): Take frame as argument.
12225
12226 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12227 (_EmacsFixedPrivate): Remove minwidth/height.
12228 Add struct frame *f.
12229 (emacs_fixed_init): Initialize priv->f.
12230 (get_parent_class, emacs_fixed_set_min_size): Remove.
12231 (emacs_fixed_new): Set priv->f to argument.
12232 (emacs_fixed_get_preferred_width)
12233 (emacs_fixed_get_preferred_height): Use min_width/height from
12234 frames size_hint to set minimum and natural (Bug#8919).
12235 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12236 and use min_width/height from frames size_hint to set
12237 min_width/height (Bug#8919).
12238
12239 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12240 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12241 Fix indentation.
12242
12243 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12244
12245 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12246 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12247 called at ZV.
12248
12249 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12250
12251 * process.c (wait_reading_process_output): Bypass select if
12252 waiting for a cell while ignoring keyboard input, and input is
12253 pending. Suggested by Jan Djärv (Bug#8869).
12254
12255 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12256
12257 Use gnulib's dup2 module instead of rolling our own.
12258 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12259
12260 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12261
12262 * dispnew.c (scrolling_window): Before scrolling, turn off a
12263 mouse-highlight in the window being scrolled.
12264
12265 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12266
12267 Move DEFSYM to lisp.h and use everywhere.
12268
12269 * character.h (DEFSYM): Move declaration...
12270 * lisp.h (DEFSYM): ...here.
12271
12272 * gnutls.c:
12273 * minibuf.c:
12274 * w32menu.c:
12275 * w32proc.c:
12276 * w32select.c: Don't include character.h.
12277
12278 * alloc.c (syms_of_alloc):
12279 * buffer.c (syms_of_buffer):
12280 * bytecode.c (syms_of_bytecode):
12281 * callint.c (syms_of_callint):
12282 * casefiddle.c (syms_of_casefiddle):
12283 * casetab.c (init_casetab_once):
12284 * category.c (init_category_once, syms_of_category):
12285 * ccl.c (syms_of_ccl):
12286 * cmds.c (syms_of_cmds):
12287 * composite.c (syms_of_composite):
12288 * dbusbind.c (syms_of_dbusbind):
12289 * dired.c (syms_of_dired):
12290 * dispnew.c (syms_of_display):
12291 * doc.c (syms_of_doc):
12292 * editfns.c (syms_of_editfns):
12293 * emacs.c (syms_of_emacs):
12294 * eval.c (syms_of_eval):
12295 * fileio.c (syms_of_fileio):
12296 * fns.c (syms_of_fns):
12297 * frame.c (syms_of_frame):
12298 * fringe.c (syms_of_fringe):
12299 * insdel.c (syms_of_insdel):
12300 * keymap.c (syms_of_keymap):
12301 * lread.c (init_obarray, syms_of_lread):
12302 * macros.c (syms_of_macros):
12303 * msdos.c (syms_of_msdos):
12304 * print.c (syms_of_print):
12305 * process.c (syms_of_process):
12306 * search.c (syms_of_search):
12307 * sound.c (syms_of_sound):
12308 * syntax.c (init_syntax_once, syms_of_syntax):
12309 * terminal.c (syms_of_terminal):
12310 * textprop.c (syms_of_textprop):
12311 * undo.c (syms_of_undo):
12312 * w32.c (globals_of_w32):
12313 * window.c (syms_of_window):
12314 * xdisp.c (syms_of_xdisp):
12315 * xfaces.c (syms_of_xfaces):
12316 * xfns.c (syms_of_xfns):
12317 * xmenu.c (syms_of_xmenu):
12318 * xsettings.c (syms_of_xsettings):
12319 * xterm.c (syms_of_xterm): Use DEFSYM.
12320
12321 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12322
12323 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12324
12325 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12326
12327 Integer and buffer overflow fixes (Bug#8873).
12328
12329 * print.c (printchar, strout): Check for string overflow.
12330 (PRINTPREPARE, printchar, strout):
12331 Don't set size unless allocation succeeds.
12332
12333 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12334 for sizes. Check for string overflow more accurately.
12335 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12336
12337 * macros.c: Integer and buffer overflow fixes.
12338 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12339 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12340 Use ptrdiff_t, not int, for sizes.
12341 Don't increment bufsize until after realloc succeeds.
12342 Check for size-calculation overflow.
12343 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12344
12345 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12346
12347 * lread.c: Integer overflow fixes.
12348 (read_integer): Radix is now EMACS_INT, not int,
12349 to improve quality of diagnostics for out-of-range radices.
12350 Calculate buffer size correctly for out-of-range radices.
12351 (read1): Check for integer overflow in radices, and in
12352 read-circle numbers.
12353 (read_escape): Avoid int overflow.
12354 (Fload, openp, read_buffer_size, read1)
12355 (substitute_object_recurse, read_vector, read_list, map_obarray):
12356 Use ptrdiff_t, not int, for sizes.
12357 (read1): Use EMACS_INT, not int, for sizes.
12358 Check for size overflow.
12359
12360 * image.c (cache_image): Check for size arithmetic overflow.
12361
12362 * lread.c: Integer overflow issues.
12363 (saved_doc_string_size, saved_doc_string_length)
12364 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12365 Now ptrdiff_t, not int.
12366 (read1): Don't assume doc string length fits in int. Check for
12367 out-of-range doc string lengths.
12368 (read_list): Don't assume file position fits in int.
12369 (read_escape): Check for hex character overflow.
12370
12371 2011-06-22 Leo Liu <sdl.web@gmail.com>
12372
12373 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12374 Move to minibuffer.el.
12375
12376 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12377
12378 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12379 The following patches are for when GLYPH_DEBUG && !XASSERT.
12380 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12381 * dispnew.c (flush_stdout):
12382 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12383 Mark as externally visible.
12384 * dispnew.c (check_window_matrix_pointers): Now static.
12385 * dispnew.c (window_to_frame_vpos):
12386 * xfns.c (unwind_create_frame):
12387 * xterm.c (x_check_font): Remove unused local.
12388 * scroll.c (CHECK_BOUNDS):
12389 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12390 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12391 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12392 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12393 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12394 Now static.
12395 (debug_method_add): Use va_list and vsprintf rather than relying
12396 on undefined behavior with wrong number of arguments.
12397 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12398 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12399 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12400 since we're not interested in debugging glyphs with old libraries.
12401 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12402 GCC 4.6.0's static checking.
12403
12404 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12405
12406 Integer overflow and signedness fixes (Bug#8873).
12407 A few related buffer overrun fixes, too.
12408
12409 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12410
12411 * dispextern.h (struct face.stipple):
12412 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12413 (x_bitmap_mask, x_allocate_bitmap_record)
12414 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12415 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12416 (x_create_bitmap_from_xpm_data):
12417 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12418 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12419 (.bitmaps_last):
12420 * xfaces.c (load_pixmap):
12421 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12422 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12423 (.bitmaps_last, struct x_output.icon_bitmap):
12424 Use ptrdiff_t, not int, for bitmap indexes.
12425 (x_allocate_bitmap_record): Check for size overflow.
12426 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12427
12428 Use ptrdiff_t, not int, for overlay counts.
12429 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12430 * editfns.c (overlays_around, get_pos_property):
12431 * textprop.c (get_char_property_and_overlay):
12432 * xdisp.c (next_overlay_change, note_mouse_highlight):
12433 * xfaces.c (face_at_buffer_position):
12434 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12435 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12436 (Fnext_overlay_change, Fprevious_overlay_change)
12437 (mouse_face_overlay_overlaps, Foverlays_in):
12438 Use ptrdiff_t, not int, for sizes.
12439 (overlays_at, overlays_in): Check for size-calculation overflow.
12440
12441 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12442
12443 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12444 (x_session_initialize): Do not assume string length fits in int.
12445
12446 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12447 This is unlikely, but can occur if DPI is outlandish.
12448
12449 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12450 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12451
12452 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12453 * xrdb.c (magic_file_p, search_magic_path):
12454 Omit last arg SUFFIX; it was always 0. All callers changed.
12455 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12456
12457 * xfont.c (xfont_match): Avoid need for strlen.
12458
12459 * xfns.c: Don't assume strlen fits in int.
12460 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12461
12462 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12463 not unsigned long, as we prefer signed integers. All callers changed.
12464 Detect integer overflow in repeat count.
12465 (message_dolog): Don't assume print length fits in 39 bytes.
12466 (display_mode_element): Don't assume strlen fits in int.
12467
12468 * termcap.c: Don't assume sizes fit in int and never overflow.
12469 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12470 (gobble_line): Check for size-calculation overflow.
12471
12472 * minibuf.c (Fread_buffer):
12473 * lread.c (intern, intern_c_string):
12474 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12475 Don't assume string length fits in int.
12476
12477 * keyboard.c (parse_tool_bar_item):
12478 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12479
12480 * font.c: Don't assume string length fits in int.
12481 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12482 Use ptrdiff_t, not int.
12483 (font_intern_prop): Don't assume string length fits in int.
12484 Don't assume integer property fits in fixnum.
12485 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12486
12487 * filelock.c: Fix some buffer overrun and integer overflow issues.
12488 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12489 Reformulate so as not to need the command string.
12490 Invoke gzip -cd rather than gunzip, as it's more portable.
12491 (lock_info_type, lock_file_1, lock_file):
12492 Don't assume pid_t and time_t fit in unsigned long.
12493 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12494 (current_lock_owner): Prefer signed type for sizes.
12495 Use memcpy, not strncpy, where memcpy is what is really wanted.
12496 Don't assume (via atoi) that time_t and pid_t fit in int.
12497 Check for time_t and/or pid_t out of range, e.g., via a network share.
12498 Don't alloca where an auto var works fine.
12499
12500 * fileio.c: Fix some integer overflow issues.
12501 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12502 Don't assume string length fits in int.
12503 (directory_file_name): Don't assume string length fits in long.
12504 (make_temp_name): Don't assume pid fits in int, or that its print
12505 length is less than 20.
12506
12507 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12508
12509 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12510
12511 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12512
12513 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12514 We prefer signed integers, even for size calculations.
12515
12516 * emacs.c: Don't assume string length fits in 'int'.
12517 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12518 (main): Don't invoke strlen when not needed.
12519
12520 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12521 (XD_DEBUG_MESSAGE): Don't waste a byte.
12522
12523 * callproc.c (getenv_internal_1, getenv_internal)
12524 (Fgetenv_internal):
12525 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12526
12527 * lread.c (invalid_syntax): Omit length argument.
12528 All uses changed. This doesn't fix a bug, but it simplifies the
12529 code away from its former Hollerith-constant appearance, and it's
12530 one less 'int' to worry about when looking at integer-overflow issues.
12531 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12532
12533 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12534 This didn't break anything, but it didn't help either.
12535 It's confusing to put a bogus integer in a place where the actual
12536 value does not matter.
12537 (LIST_END_P): Remove unused macro and its bogus comment.
12538 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12539
12540 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12541 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12542 implementation.
12543 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12544 We prefer signed types, and the value cannot exceed the EMACS_INT
12545 range anyway (because otherwise the length would not be representable).
12546 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12547 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12548 This avoids a GCC warning when WIDE_EMACS_INT.
12549
12550 * indent.c (sane_tab_width): New function.
12551 (current_column, scan_for_column, Findent_to, position_indentation)
12552 (compute_motion): Use it. This is just for clarity.
12553 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12554
12555 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12556
12557 * lisp.h (lint_assume): New macro.
12558 * composite.c (composition_gstring_put_cache):
12559 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12560
12561 * editfns.c, insdel.c:
12562 Omit unnecessary forward decls, to simplify future changes.
12563
12564 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12565
12566 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12567
12568 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12569 Use much-faster test for byte-length change.
12570 Don't assume string byte-length fits in 'int'.
12571 Check that character arg fits in 'int'.
12572 (mapcar1): Declare byte as byte, for clarity.
12573
12574 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12575
12576 * fns.c (concat): Catch string overflow earlier.
12577 Do not rely on integer wraparound.
12578
12579 * dispextern.h (struct it.overlay_strings_charpos)
12580 (struct it.selective): Now EMACS_INT, not int.
12581 * xdisp.c (forward_to_next_line_start)
12582 (back_to_previous_visible_line_start)
12583 (reseat_at_next_visible_line_start, next_element_from_buffer):
12584 Don't arbitrarily truncate the value of 'selective' to int.
12585
12586 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12587
12588 * composite.c: Don't truncate sizes to 'int'.
12589 (composition_gstring_p, composition_reseat_it)
12590 (composition_adjust_point): Use EMACS_INT, not int.
12591 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12592 not EMACS_UINT, for indexes.
12593
12594 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12595
12596 * buffer.c: Include <verify.h>.
12597 (struct sortvec.priority, struct sortstr.priority):
12598 Now EMACS_INT, not int.
12599 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12600 (struct sortstr.size, record_overlay_string)
12601 (struct sortstrlist.size, struct sortlist.used):
12602 Don't truncate size to int.
12603 (record_overlay_string): Check for size-calculation overflow.
12604 (init_buffer_once): Check at compile-time, not run-time.
12605
12606 2011-06-22 Jim Meyering <meyering@redhat.com>
12607
12608 Don't leak an XBM-image-sized buffer
12609 * image.c (xbm_load): Free the image buffer after using it.
12610
12611 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12612
12613 Port to Sun C.
12614 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12615 that Sun C diagnosed.
12616 * fns.c (secure_hash): Fix pointer signedness issue.
12617 * intervals.c (static_offset_intervals): New function.
12618 (offset_intervals): Use it.
12619
12620 2011-06-21 Leo Liu <sdl.web@gmail.com>
12621
12622 * deps.mk (fns.o):
12623 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12624 sha512.h.
12625
12626 * fns.c (secure_hash): Rename from crypto_hash_function and change
12627 the first arg to accept symbols.
12628 (Fsecure_hash): New primitive.
12629 (syms_of_fns): New symbols.
12630
12631 2011-06-20 Deniz Dogan <deniz@dogan.se>
12632
12633 * process.c (Fset_process_buffer): Clarify return value in
12634 docstring.
12635
12636 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12637
12638 * dispnew.c (add_window_display_history): Use BVAR.
12639
12640 * xdisp.c (debug_method_add): Use BVAR.
12641 (check_window_end, dump_glyph_matrix, dump_glyph)
12642 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12643
12644 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12645 Likewise.
12646
12647 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12648 check till after the cache is created in init_frame_faces.
12649
12650 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12651
12652 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12653
12654 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12655
12656 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12657 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12658 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12659
12660 Improve buffer-overflow checking (Bug#8873).
12661 * fileio.c (Finsert_file_contents):
12662 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12663 Remove the old (too-loose) buffer overflow checks.
12664 They weren't needed, since make_gap checks for buffer overflow.
12665 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12666 The old code merely checked for Emacs fixnum overflow, and relied
12667 on undefined (wraparound) behavior. The new code avoids undefined
12668 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12669
12670 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12671 Tune. Don't use wider integers than needed. Don't use alloca.
12672 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12673
12674 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12675
12676 * insdel.c, lisp.h (buffer_overflow): New function.
12677 (insert_from_buffer_1, replace_range, replace_range_2):
12678 * insdel.c (make_gap_larger):
12679 * editfns.c (Finsert_char):
12680 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12681
12682 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12683
12684 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12685
12686 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12687
12688 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12689 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12690
12691 * fileio.c: Don't assume EMACS_INT fits in off_t.
12692 (emacs_lseek): New static function.
12693 (Finsert_file_contents, Fwrite_region): Use it.
12694 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12695
12696 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12697
12698 * fns.c: Don't overflow int when computing a list length.
12699 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12700 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12701 truncation on 64-bit hosts. Check for QUIT every
12702 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12703 faster and is responsive enough.
12704 (Flength): Report an error instead of overflowing an integer.
12705 (Fsafe_length): Return a float if the value is not representable
12706 as a fixnum. This shouldn't happen except in contrived situations.
12707 (Fnthcdr, Fsort): Don't assume list length fits in int.
12708 (Fcopy_sequence): Don't assume vector length fits in int.
12709
12710 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12711 (header_size, word_size): New constants.
12712 (allocate_vectorlike): Don't check size overflow here.
12713 (allocate_vector): Check it here instead, since this is the only
12714 caller of allocate_vectorlike that could cause overflow.
12715 Check that the new vector's length is representable as a fixnum.
12716
12717 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12718 The previous code was bogus. For example, next_almost_prime (32)
12719 returned 39, which is undesirable as it is a multiple of 3; and
12720 next_almost_prime (24) returned 25, which is a multiple of 5 so
12721 why was the code bothering to check for multiples of 7?
12722
12723 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12724
12725 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12726
12727 Variadic C functions now count arguments with ptrdiff_t.
12728 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12729 Back then I didn't know that the Emacs coding style prefers signed int.
12730 Also, in the meantime I found a few more instances where arguments
12731 were being counted with int, which may truncate counts on 64-bit
12732 machines, or EMACS_INT, which may be unnecessarily wide.
12733 * lisp.h (struct Lisp_Subr.function.aMANY)
12734 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12735 Arg counts are now ptrdiff_t, not size_t.
12736 All variadic functions and their callers changed accordingly.
12737 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12738 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12739 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12740 * callint.c (Fcall_interactively): Check arg count for overflow,
12741 to avoid potential buffer overrun. Use signed char, not 'int',
12742 for 'varies' array, so that we needn't bother to check its size
12743 calculation for overflow.
12744 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12745 * eval.c (apply_lambda):
12746 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12747 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12748 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12749
12750 * callint.c (Fcall_interactively): Don't use index var as event count.
12751
12752 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12753 * mem-limits.h (SIZE): Remove; no longer used.
12754
12755 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12756
12757 Remove unnecessary casts.
12758 * xterm.c (x_term_init):
12759 * xfns.c (x_set_border_pixel):
12760 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12761 These aren't needed now that we assume ANSI C.
12762
12763 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12764 It's more likely to cause problems (due to unsigned overflow)
12765 than to cure them.
12766
12767 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12768
12769 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12770
12771 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12772
12773 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12774
12775 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12776
12777 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12778
12779 GLYPH_CODE_FACE returns EMACS_INT, not int.
12780 * dispextern.h (merge_faces):
12781 * xfaces.c (merge_faces):
12782 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12783 Don't assume EMACS_INT fits in int.
12784
12785 * character.h (CHAR_VALID_P): Remove unused parameter.
12786 * fontset.c, lisp.h, xdisp.c: All uses changed.
12787
12788 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12789
12790 * fns.c (concat): Minor tuning based on overflow analysis.
12791 This doesn't fix any bugs. Use int to hold character, instead
12792 of constantly refetching from Emacs object. Use XFASTINT, not
12793 XINT, for value known to be a character. Don't bother comparing
12794 a single byte to 0400, as it's always less.
12795
12796 * floatfns.c (Fexpt):
12797 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12798
12799 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12800 for characters.
12801
12802 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12803
12804 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12805 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12806 incorrectly succeed when S was a string, because 4294967386 was
12807 truncated before it was used.
12808
12809 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12810 Otherwise, an out-of-range integer could cause undefined behavior
12811 on a 64-bit host.
12812
12813 * composite.c: Use int, not EMACS_INT, for characters.
12814 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12815 EMACS_INT, for values that are known to be in character range.
12816 This doesn't fix any bugs but is the usual style inside Emacs and
12817 may generate better code on 32-bit machines.
12818
12819 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12820 This is for reasons similar to the recent CHAR_STRING fix.
12821 * charset.c (Fencode_char): Check that character arg is actually
12822 a character. Pass an int to ENCODE_CHAR.
12823 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12824 wider than 'int', as a compile-time check to prevent future regressions
12825 in this area.
12826
12827 * character.c (char_string): Remove unnecessary casts.
12828
12829 Make sure a 64-bit char is never passed to CHAR_STRING.
12830 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12831 by silently ignoring the top 32 bits, allowing some values
12832 that were far too large to be valid characters.
12833 * character.h: Include <verify.h>.
12834 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12835 arguments are no wider than unsigned, as a compile-time check
12836 to prevent future regressions in this area.
12837 * data.c (Faset):
12838 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12839 (Fsubst_char_in_region):
12840 * fns.c (concat):
12841 * xdisp.c (decode_mode_spec_coding):
12842 Adjust to CHAR_STRING's new requirement.
12843 * editfns.c (Finsert_char, Fsubst_char_in_region):
12844 * fns.c (concat): Check that character args are actually
12845 characters. Without this test, these functions did the wrong
12846 thing with wildly out-of-range values on 64-bit hosts.
12847
12848 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12849 These casts should not be needed on 32-bit hosts, either.
12850 * keyboard.c (read_char):
12851 * lread.c (Fload): Remove casts to unsigned.
12852
12853 * lisp.h (UNSIGNED_CMP): New macro.
12854 This fixes comparison bugs on 64-bit hosts.
12855 (ASCII_CHAR_P): Use it.
12856 * casefiddle.c (casify_object):
12857 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12858 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12859 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12860 * dispextern.h (FACE_FROM_ID):
12861 * keyboard.c (read_char): Use UNSIGNED_CMP.
12862
12863 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12864 not to EMACS_INT, to avoid GCC warning.
12865
12866 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12867
12868 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12869 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12870 isn't needed on 32-bit machines.
12871
12872 * buffer.c (Fgenerate_new_buffer_name):
12873 Use EMACS_INT for count, not int.
12874 (advance_to_char_boundary): Return EMACS_INT, not int.
12875
12876 * data.c (Qcompiled_function): Now static.
12877
12878 * window.c (window_body_lines): Now static.
12879
12880 * image.c (gif_load): Rename local to avoid shadowing.
12881
12882 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12883 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12884 * alloc.c (make_save_value): Integer argument is now of type
12885 ptrdiff_t, not int.
12886 (mark_object): Use ptrdiff_t, not int.
12887 * lisp.h (pD): New macro.
12888 * print.c (print_object): Use it.
12889
12890 * alloc.c: Use EMACS_INT, not int, to count objects.
12891 (total_conses, total_markers, total_symbols, total_vector_size)
12892 (total_free_conses, total_free_markers, total_free_symbols)
12893 (total_free_floats, total_floats, total_free_intervals)
12894 (total_intervals, total_strings, total_free_strings):
12895 Now EMACS_INT, not int. All uses changed.
12896 (Fgarbage_collect): Compute overall total using a double, so that
12897 integer overflow is less likely to be a problem. Check for overflow
12898 when converting back to an integer.
12899 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12900 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12901 These were 'int' variables that could overflow on 64-bit hosts;
12902 they were never used, so remove them instead of repairing them.
12903 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12904 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12905 Previously, this ceilinged at INT_MAX, but that doesn't work on
12906 64-bit machines.
12907 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12908
12909 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12910 (allocate_vectorlike): Check for ptrdiff_t overflow.
12911 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12912 when a (possibly-narrower) signed value would do just as well.
12913 We prefer using signed arithmetic, to avoid comparison confusion.
12914
12915 * alloc.c: Catch some string size overflows that we were missing.
12916 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12917 for convenience in STRING_BYTES_MAX.
12918 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12919 The definition here is exact; the one in lisp.h was approximate.
12920 (allocate_string_data): Check for string overflow. This catches
12921 some instances we weren't catching before. Also, it catches
12922 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12923 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12924 and ptrdiff_t and EMACS_INT are both 64 bits.
12925
12926 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12927 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12928 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12929
12930 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12931
12932 * alloc.c (Fmake_string): Check for out-of-range init.
12933
12934 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12935
12936 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12937
12938 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12939
12940 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12941 xg_get_default_scrollbar_width.
12942
12943 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12944 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12945 (style_changed_cb): Call update_theme_scrollbar_width and call
12946 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12947 all frames (Bug#8505).
12948 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12949 Call gtk_window_set_resizable if HAVE_GTK3.
12950 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12951 and height if HAVE_GTK3 (Bug#8505).
12952 (scroll_bar_width_for_theme): New variable.
12953 (update_theme_scrollbar_width): New function.
12954 (xg_get_default_scrollbar_width): Move code to
12955 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12956 (xg_initialize): Call update_theme_scrollbar_width.
12957
12958 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12959
12960 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12961
12962 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12963
12964 * frame.c (make_frame): Call other_buffer_safely instead of
12965 other_buffer.
12966
12967 * window.c (temp_output_buffer_show): Call display_buffer with
12968 second argument Vtemp_buffer_show_specifiers and reset latter
12969 immediately after the call.
12970 (Vtemp_buffer_show_specifiers): New variable.
12971 (auto_window_vscroll_p, next_screen_context_lines)
12972 (Vscroll_preserve_screen_position): Remove leading asterisks from
12973 doc-strings.
12974
12975 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12976
12977 Fix minor problems found by GCC 4.6.0 static checking.
12978 * buffer.c (Qclone_number): Remove for now, as it's unused.
12979 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12980 (record_buffer): Remove unused local.
12981 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12982 (set_frame_buffer_list): Remove; unused.
12983 * frame.h (other_visible_frames): Remove decl.
12984 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12985 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12986 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12987 if HAVE_GPM.
12988 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12989 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12990 Define only if HAVE_GPM.
12991 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12992 (update_hints_inhibit): Remove; never set. All uses removed.
12993 * widgetprv.h (emacsFrameClassRec): Remove decl.
12994 * window.c (delete_deletable_window): Now returns void, since it
12995 wasn't returning anything.
12996 (compare_window_configurations): Remove unused locals.
12997 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12998 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
12999 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13000 the same widths as pointers. This follows up on the 2011-05-06 patch.
13001 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13002 * xterm.h: Likewise.
13003 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13004
13005 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13006
13007 * makefile.w32-in: Update dependencies.
13008 (LISP_H): Add lib/intprops.h.
13009
13010 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13011
13012 * image.c (gif_load): Add animation frame delay to the metadata.
13013 (syms_of_image): Use DEFSYM. New symbol `delay'.
13014
13015 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13016
13017 * window.c (delete_deletable_window): Re-add.
13018 (Fset_window_configuration): Rewrite to handle dead buffers and
13019 consequently deletable windows.
13020 (window_tree, Fwindow_tree): Remove. Supply functionality in
13021 window.el.
13022 (compare_window_configurations): Simplify code.
13023
13024 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13025
13026 * image.c (imagemagick_load_image): Fix type mismatch.
13027 (Fimagemagick_types): Likewise.
13028
13029 * window.h (replace_buffer_in_windows): Declare.
13030
13031 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13032
13033 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13034 Qclone_number. Remove external declaration of Qdelete_window.
13035 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13036 code.
13037 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13038 Run Qbuffer_list_update_hook if allowed.
13039 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13040 buffer list implementation.
13041 (other_buffer_safely): New function.
13042 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13043 calls to replace_buffer_in_windows and
13044 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13045 if allowed.
13046 (record_buffer): Inhibit quitting and rewrite using quittable
13047 functions. Run Qbuffer_list_update_hook if allowed.
13048 (Frecord_buffer, Funrecord_buffer): New functions.
13049 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13050 Move switch-to-buffer to window.el.
13051 (bury-buffer): Move to window.el.
13052 (Vbuffer_list_update_hook): New variable.
13053
13054 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13055 section.
13056
13057 * window.h (resize_frame_windows): Move up in code.
13058 (Fwindow_frame): Remove EXFUN.
13059 (replace_buffer_in_all_windows): Remove prototype.
13060 (replace_buffer_in_windows_safely): Add prototype.
13061
13062 * window.c: Declare Qdelete_window static again. Move down
13063 declaration of select_count.
13064 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13065 (Fother_window): Move to window.el.
13066 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13067 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13068 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13069 window.el.
13070 (replace_buffer_in_windows): Implement by calling
13071 Qreplace_buffer_in_windows.
13072 (replace_buffer_in_all_windows): Remove with some functionality
13073 moved into replace_buffer_in_windows_safely.
13074 (replace_buffer_in_windows_safely): New function.
13075 (select_window_norecord, select_frame_norecord): Move in front
13076 of run_window_configuration_change_hook. Remove now obsolete
13077 declarations.
13078 (Fset_window_buffer): Rewrite doc-string.
13079 Call Qrecord_window_buffer.
13080 (keys_of_window): Move binding for other-window to window.el.
13081
13082 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13083
13084 * dispextern.h (struct image): Replace data member, whose int_val
13085 and ptr_val fields were not used by anything, with a single
13086 lisp_val object.
13087
13088 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13089 (gif_clear_image, gif_load, imagemagick_load_image)
13090 (gs_clear_image, gs_load): Callers changed.
13091
13092 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13093
13094 * buffer.h: Include <time.h>, for time_t.
13095 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13096
13097 Fix minor problems found by static checking.
13098
13099 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13100
13101 Make identifiers static if they are not used in other modules.
13102 * data.c (Qcompiled_function, Qframe, Qvector):
13103 * image.c (QimageMagick, Qsvg):
13104 * minibuf.c (Qmetadata):
13105 * window.c (resize_window_check, resize_root_window): Now static.
13106 * window.h (resize_window_check, resize_root_window): Remove decls.
13107
13108 * window.c (window_deletion_count, delete_deletable_window):
13109 Remove; unused.
13110 (window_body_lines): Now static.
13111 (Fdelete_other_windows_internal): Mark vars as initialized.
13112 Make sure 'resize_failed' is initialized.
13113 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13114 (resize_window_apply): Remove unused local.
13115 * window.h (delete_deletable_window): Remove decl.
13116
13117 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13118 (imagemagick_load_image): Fix pointer signedness problem by changing
13119 last arg from unsigned char * to char *. All uses changed.
13120 Also, fix a local for similar reasons.
13121 Remove unused locals. Remove locals to avoid shadowing.
13122 (fn_rsvg_handle_free): Remove; unused.
13123 (svg_load, svg_load_image): Fix pointer signedness problem.
13124 (imagemagick_load_image): Don't use garbage pointer image_wand.
13125
13126 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13127
13128 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13129
13130 * image.c (gif_load): Fix omitted cast error introduced by
13131 2011-06-06 change.
13132
13133 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13134
13135 * window.h (resize_proportionally, orig_total_lines)
13136 (orig_top_line): Remove from window structure.
13137 (set_window_height, set_window_width, change_window_heights)
13138 (Fdelete_window): Remove prototypes.
13139 (resize_frame_windows): Remove duplicate declaration.
13140
13141 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13142
13143 * window.h (resize_frame_windows, resize_window_check)
13144 (delete_deletable_window, resize_root_window)
13145 (resize_frame_windows): Declare prototypes.
13146
13147 * window.c (resize_window_apply): Make definition be "static" to
13148 match the prototype.
13149
13150 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13151
13152 * window.c: Remove declarations of Qwindow_size_fixed,
13153 window_min_size_1, window_min_size_2, window_min_size,
13154 size_window, window_fixed_size_p, enlarge_window, delete_window.
13155 Remove static from declaration of Qdelete_window, it's
13156 temporarily needed by Fbury_buffer.
13157 (replace_window): Don't assign orig_top_line and
13158 orig_total_lines.
13159 (Fdelete_window, delete_window): Remove. Window deletion is
13160 handled by window.el.
13161 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13162 Replace Fdelete_window calls with calls to Qdelete_window.
13163 (Fdelete_other_windows): Remove. Deleting other windows is
13164 handled by window.el.
13165 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13166 handled in window.el.
13167 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13168 Window minimum sizes are handled in window.el.
13169 (shrink_windows, size_window, set_window_height)
13170 (set_window_width, change_window_heights, window_height)
13171 (window_width, CURBEG, CURSIZE, enlarge_window)
13172 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13173 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13174 handled in window.el.
13175 (make_dummy_parent): Rename to make_parent_window and give it a
13176 second argument horflag.
13177 (make_window): Don't set resize_proportionally any more.
13178 (Fsplit_window): Remove. Windows are split in window.el.
13179 (save_restore_action, save_restore_orig_size)
13180 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13181 Resize mini windows in window.el.
13182 (grow_mini_window, shrink_mini_window): Implement by calling
13183 Qresize_root_window_vertically, resize_window_check and
13184 resize_window_apply.
13185 (saved_window, Fset_window_configuration, save_window_save):
13186 Do not handle orig_top_line, orig_total_lines, and
13187 resize_proportionally.
13188 (window_min_height, window_min_width): Move to window.el.
13189 (keys_of_window): Move bindings for delete-other-windows,
13190 split-window, delete-window and enlarge-window to window.el.
13191
13192 * buffer.c: Temporarily extern Qdelete_window.
13193 (Fbury_buffer): Temporarily call Qdelete_window instead of
13194 Fdelete_window (Fbury_buffer will move to window.el soon).
13195
13196 * frame.c (set_menu_bar_lines_1): Remove code handling
13197 orig_top_line and orig_total_lines.
13198
13199 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13200 set_window_height but set heights directly.
13201 (change_frame_size_1): Use resize_frame_windows.
13202
13203 * xdisp.c (init_xdisp): Don't use set_window_height but set
13204 heights directly.
13205
13206 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13207 Use resize_frame_windows instead of change_window_heights and run
13208 run_window_configuration_change_hook.
13209
13210 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13211 instead of change_window_heights and run
13212 run_window_configuration_change_hook.
13213
13214 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13215
13216 * window.c (replace_window): Rename second argument REPLACEMENT to
13217 NEW. New third argument SETFLAG. Rewrite.
13218 (delete_window, make_dummy_parent): Call replace_window with
13219 third argument 1.
13220 (window_list_1): Move down in code.
13221 (run_window_configuration_change_hook): Move set_buffer part
13222 before select_frame_norecord part in order to unwind correctly.
13223 Rename count1 to count.
13224 (recombine_windows, delete_deletable_window, resize_root_window)
13225 (Fdelete_other_windows_internal)
13226 (Frun_window_configuration_change_hook, make_parent_window)
13227 (resize_window_check, resize_window_apply, Fresize_window_apply)
13228 (resize_frame_windows, Fsplit_window_internal)
13229 (Fdelete_window_internal, Fresize_mini_window_internal):
13230 New functions.
13231 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13232
13233 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13234
13235 * window.h (window): Add some new members to window structure -
13236 normal_lines, normal_cols, new_total, new_normal, clone_number,
13237 splits, nest, prev_buffers, next_buffers.
13238 (WINDOW_TOTAL_SIZE): Move here from window.c.
13239 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13240
13241 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13242 Remove.
13243 (make_dummy_parent): Set new members of windows structure.
13244 (make_window): Move down in code. Handle new members of window
13245 structure.
13246 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13247 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13248 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13249 (Fset_window_prev_buffers, Fwindow_next_buffers)
13250 (Fset_window_next_buffers, Fset_window_clone_number):
13251 New functions.
13252 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13253 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13254 Doc-string fixes.
13255 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13256 Argument WINDOW can be now internal window too.
13257 (Fwindow_use_time): Move up in code.
13258 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13259 Rewrite doc-string.
13260 (Fset_window_configuration, saved_window)
13261 (Fcurrent_window_configuration, save_window_save): Handle new
13262 members of window structure.
13263 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13264 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13265 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13266 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13267 Qget_mru_window, Qresize_root_window,
13268 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13269 Qauto_buffer_name; staticpro them.
13270
13271 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13272
13273 * window.c (Fwindow_total_size, Fwindow_left_column)
13274 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13275 (Fwindow_list_1): New functions.
13276 (window_box_text_cols): Replace with window_body_cols.
13277 (Fwindow_width, Fscroll_left, Fscroll_right):
13278 Use window_body_cols instead of window_box_text_cols.
13279 (delete_window, Fset_window_configuration):
13280 Call delete_all_subwindows with window as argument.
13281 (delete_all_subwindows): Take a window as argument and not a
13282 structure. Rewrite.
13283 (window_loop): Remove handling of GET_LRU_WINDOW and
13284 GET_LARGEST_WINDOW.
13285 (Fget_lru_window, Fget_largest_window): Move to window.el.
13286
13287 * window.h: Extern window_body_cols instead of
13288 window_box_text_cols. delete_all_subwindows now takes a
13289 Lisp_Object as argument.
13290
13291 * indent.c (compute_motion, Fcompute_motion):
13292 Use window_body_cols instead of window_box_text_cols.
13293
13294 * frame.c (delete_frame): Call delete_all_subwindows with root
13295 window as argument.
13296
13297 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13298
13299 * fns.c (Fputhash): Document return value.
13300
13301 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13302
13303 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13304
13305 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13306
13307 Cons<->int and similar integer overflow fixes (Bug#8794).
13308
13309 Check for overflow when converting integer to cons and back.
13310 * charset.c (Fdefine_charset_internal, Fdecode_char):
13311 Use cons_to_unsigned to catch overflow.
13312 (Fencode_char): Use INTEGER_TO_CONS.
13313 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13314 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13315 * data.c (long_to_cons, cons_to_long): Remove.
13316 (cons_to_unsigned, cons_to_signed): New functions.
13317 These signal an error for invalid or out-of-range values.
13318 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13319 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13320 * font.c (Ffont_variation_glyphs):
13321 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13322 * lisp.h: Include <intprops.h>.
13323 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13324 (cons_to_signed, cons_to_unsigned): New decls.
13325 (long_to_cons, cons_to_long): Remove decls.
13326 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13327 (Fprimitive_undo): Use CONS_TO_INTEGER.
13328 * xfns.c (Fx_window_property): Likewise.
13329 * xselect.c: Include <limits.h>.
13330 (x_own_selection, selection_data_to_lisp_data):
13331 Use INTEGER_TO_CONS.
13332 (x_handle_selection_request, x_handle_selection_clear)
13333 (x_get_foreign_selection, Fx_disown_selection_internal)
13334 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13335 (lisp_data_to_selection_data): Use cons_to_unsigned.
13336 (x_fill_property_data): Use cons_to_signed.
13337 Report values out of range.
13338
13339 Check for buffer and string overflow more precisely.
13340 * buffer.h (BUF_BYTES_MAX): New macro.
13341 * lisp.h (STRING_BYTES_MAX): New macro.
13342 * alloc.c (Fmake_string):
13343 * character.c (string_escape_byte8):
13344 * coding.c (coding_alloc_by_realloc):
13345 * doprnt.c (doprnt):
13346 * editfns.c (Fformat):
13347 * eval.c (verror):
13348 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13349 since they may not be the same number.
13350 * editfns.c (Finsert_char):
13351 * fileio.c (Finsert_file_contents):
13352 Likewise for BUF_BYTES_MAX.
13353
13354 * image.c: Use ptrdiff_t, not int, for sizes.
13355 (slurp_file): Switch from int to ptrdiff_t.
13356 All uses changed.
13357 (slurp_file): Check that file size fits in both size_t (for
13358 malloc) and ptrdiff_t (for sanity and safety).
13359
13360 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13361 if b->modtime has its maximal value.
13362
13363 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13364
13365 Don't assume time_t can fit into int.
13366 * buffer.h (struct buffer.modtime): Now time_t, not int.
13367 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13368 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13369
13370 Minor fixes for signed vs unsigned integers.
13371 * character.h (MAYBE_UNIFY_CHAR):
13372 * charset.c (maybe_unify_char):
13373 * keyboard.c (read_char, reorder_modifiers):
13374 XINT -> XFASTINT, since the integer must be nonnegative.
13375 * ftfont.c (ftfont_spec_pattern):
13376 * keymap.c (access_keymap, silly_event_symbol_error):
13377 XUINT -> XFASTINT, since the integer must be nonnegative.
13378 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13379 since it makes no difference and we prefer signed.
13380 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13381 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13382 nonnegative.
13383
13384 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13385
13386 * window.h (Fwindow_frame): Declare.
13387
13388 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13389
13390 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13391 (SPARE_MEMORY): Always define.
13392 (LARGE_REQUEST): Remove.
13393 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13394
13395 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13396
13397 * lisp.h: Move EXFUNS for Fframe_root_window,
13398 Fframe_first_window and Fset_frame_selected_window to window.h.
13399
13400 * window.h: Move EXFUNS for Fframe_root_window,
13401 Fframe_first_window and Fset_frame_selected_window here from
13402 lisp.h.
13403
13404 * frame.c (Fwindow_frame, Fframe_first_window)
13405 (Fframe_root_window, Fframe_selected_window)
13406 (Fset_frame_selected_window): Move to window.c.
13407 (Factive_minibuffer_window): Move to minibuf.c.
13408 (Fother_visible_frames_p): New function.
13409
13410 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13411
13412 * window.c (decode_window, decode_any_window): Move up in code.
13413 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13414 (inhibit_frame_unsplittable): Remove unused variable.
13415 (Fwindow_buffer): Move up and rewrite doc-string.
13416 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13417 (Fwindow_prev): New functions.
13418 (Fwindow_frame): Move here from frame.c. Accept any window as
13419 argument.
13420 (Fframe_root_window, Fframe_first_window)
13421 (Fframe_selected_window): Move here from frame.c. Accept frame
13422 or arbitrary window as argument. Update doc-strings.
13423 (Fminibuffer_window): Move up in code.
13424 (Fwindow_minibuffer_p): Move up in code and simplify.
13425 (Fset_frame_selected_window): Move here from frame.c.
13426 Marginal rewrite.
13427 (Fselected_window, select_window, Fselect_window): Move up in
13428 code. Minor doc-string fixes.
13429
13430 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13431
13432 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13433 Do not assume that spare memory exists; that assumption is valid
13434 only if SYSTEM_MALLOC.
13435 (LARGE_REQUEST): New macro, so that the issue of large requests
13436 is separated from the issue of spare memory.
13437
13438 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13439
13440 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13441 format. (Bug#8806)
13442
13443 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13444
13445 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13446 before statements.
13447
13448 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13449
13450 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13451
13452 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13453
13454 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13455 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13456
13457 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13458
13459 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13460
13461 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13462
13463 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13464 (x_clipboard_manager_save): Add return value.
13465 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13466 New error handlers.
13467 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13468 Obey Vx_select_enable_clipboard_manager. Catch errors in
13469 x_clipboard_manager_save (Bug#8779).
13470 (Vx_select_enable_clipboard_manager): New variable.
13471 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13472
13473 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13474
13475 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13476
13477 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13478
13479 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13480 in the current matrix if keep_current_p is non-zero.
13481
13482 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13483
13484 * bidi.c (bidi_level_of_next_char): Fix last change.
13485
13486 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13487
13488 Support bidi reordering of text covered by display properties.
13489
13490 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13491 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13492 (bidi_cache_search, bidi_cache_iterator_state)
13493 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13494 (bidi_level_of_next_char, bidi_move_to_visually_next):
13495 Support character positions inside a run of characters covered by a
13496 display string.
13497 (bidi_paragraph_init, bidi_resolve_explicit_1)
13498 (bidi_level_of_next_char): Call bidi_fetch_char and
13499 bidi_fetch_char_advance instead of FETCH_CHAR and
13500 FETCH_CHAR_ADVANCE.
13501 (bidi_init_it): Initialize new members.
13502 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13503 definitions.
13504 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13505 instead of using explicit *_CHAR codes.
13506 (bidi_resolve_explicit, bidi_resolve_weak):
13507 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13508 bidirectional text is supported only in multibyte buffers.
13509 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13510 it to initialize the frame_window_p member of struct bidi_it.
13511 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13512 (bidi_resolve_explicit, bidi_resolve_weak)
13513 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13514 bidi_it->nchars is non-positive.
13515 (bidi_level_of_next_char): Don't try to lookup the cache for the
13516 next/previous character if nothing is cached there yet, or if we
13517 were just reseat()'ed to a new position.
13518
13519 * xdisp.c (set_cursor_from_row): Set start and stop points
13520 according to the row's direction when priming the loop that looks
13521 for the glyph on which to display cursor.
13522 (single_display_spec_intangible_p): Function deleted.
13523 (display_prop_intangible_p): Reimplement to call
13524 handle_display_spec instead of single_display_spec_intangible_p.
13525 Accept 3 additional arguments needed by handle_display_spec.
13526 This fixes incorrect cursor motion across display property with complex
13527 values: lists, `(when COND...)' forms, etc.
13528 (single_display_spec_string_p): Support property values that are
13529 lists with the argument STRING its top-level element.
13530 (display_prop_string_p): Fix the condition for processing a
13531 property that is a list to be consistent with handle_display_spec.
13532 (handle_display_spec): New function, refactored from the
13533 last portion of handle_display_prop.
13534 (compute_display_string_pos): Accept additional argument
13535 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13536 value of a `display' property is a "replacing spec".
13537 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13538 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13539 the display property, but just return a value indicating whether
13540 the display property will replace the characters it covers.
13541 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13542 frame_window_p members of struct bidi_it.
13543 (compute_display_string_pos, compute_display_string_end):
13544 New functions.
13545 (push_it): Accept second argument POSITION, where pop_it should
13546 jump to continue iteration.
13547 (reseat_1): Initialize bidi_it.disp_pos.
13548
13549 * keyboard.c (adjust_point_for_property): Adjust the call to
13550 display_prop_intangible_p to its new signature.
13551
13552 * dispextern.h (struct bidi_it): New member frame_window_p.
13553 (bidi_init_it): Update prototypes.
13554 (display_prop_intangible_p): Update prototype.
13555 (compute_display_string_pos, compute_display_string_end):
13556 Declare prototypes.
13557 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13558 EMACS_INT.
13559
13560 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13561
13562 Malloc failure behavior now depends on size of allocation.
13563 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13564 * lisp.h: Change signatures accordingly.
13565 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13566 All callers changed. (Bug#8762)
13567
13568 * gnutls.c: Use Emacs's memory allocators.
13569 Without this change, the gnutls library would invoke malloc etc.
13570 directly, which causes problems on non-SYNC_INPUT hosts, and which
13571 runs afoul of improving memory_full behavior. (Bug#8761)
13572 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13573 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13574 xfree instead of the default malloc, realloc, free.
13575 (Fgnutls_boot): No need to check for memory allocation failure,
13576 since xmalloc does that for us.
13577
13578 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13579 * category.c (hash_get_category_set):
13580 * ccl.c (ccl_driver):
13581 * charset.c (Fdefine_charset_internal):
13582 * charset.h (struct charset.hash_index):
13583 * composite.c (get_composition_id, gstring_lookup_cache)
13584 (composition_gstring_put_cache):
13585 * composite.h (struct composition.hash_index):
13586 * dispextern.h (struct image.hash):
13587 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13588 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13589 (hashfn_equal, hashfn_user_defined, make_hash_table)
13590 (maybe_resize_hash_table, hash_lookup, hash_put)
13591 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13592 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13593 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13594 * image.c (make_image, search_image_cache, lookup_image)
13595 (xpm_put_color_table_h):
13596 * lisp.h (struct Lisp_Hash_Table):
13597 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13598 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13599 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13600 * alloc.c (allocate_vectorlike):
13601 Check for overflow in vector size calculations.
13602 * ccl.c (ccl_driver):
13603 Check for overflow when converting EMACS_INT to int.
13604 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13605 need to be updated by these changes.
13606 * fns.c (make_hash_table, maybe_resize_hash_table):
13607 Check for integer overflow with large hash tables.
13608 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13609 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13610 (SXHASH_REDUCE): New macro.
13611 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13612 Use it instead of discarding useful hash info with large hash values.
13613 (sxhash_float): New function.
13614 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13615 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13616 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13617 Rewrite to use FIXNUM_BITS, as this simplifies things.
13618 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13619 Adjust signatures to match updated version of code.
13620 (consing_since_gc): Now EMACS_INT, since a single hash table can
13621 use more than INT_MAX bytes.
13622
13623 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13624
13625 Make it possible to build with GCC-4.6+ -O2 -flto.
13626
13627 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13628
13629 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13630
13631 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13632 Call minibuffer-inactive-mode.
13633
13634 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13635
13636 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13637 Update dependencies.
13638
13639 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13640
13641 * data.c (init_data): Remove code for UTS, this system is not
13642 supported anymore.
13643
13644 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13645
13646 Don't force ./temacs to start in terminal mode.
13647
13648 * frame.c (make_initial_frame): Initialize faces in all cases, not
13649 only when CANNOT_DUMP is defined.
13650 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13651
13652 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13653
13654 * dispnew.c (add_window_display_history): Use const for the string
13655 pointer. Remove declaration, not needed.
13656
13657 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13658
13659 Use 'inline', not 'INLINE'.
13660 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13661 * alloc.c, fontset.c (INLINE): Remove.
13662 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13663 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13664 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13665 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13666 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13667
13668 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13669
13670 Make it possible to run ./temacs.
13671
13672 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13673 syms_of_callproc does the same thing. Remove test for
13674 "initialized", do it in the caller.
13675 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13676
13677 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13678
13679 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13680 (read_minibuf): Use get_minibuffer.
13681 (syms_of_minibuf): Use DEFSYM.
13682 (Qmetadata): New var.
13683 * data.c (Qbuffer): Don't make it static.
13684 (syms_of_data): Use DEFSYM.
13685
13686 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13687
13688 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13689 (CCL_CODE_MIN): New macro.
13690
13691 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13692
13693 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13694
13695 * eval.c (Qdebug): Now static.
13696 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13697 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13698 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13699
13700 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13701
13702 * image.c: Various fixes to ImageMagick code comments.
13703 (Fimagemagick_types): Doc fix.
13704
13705 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13706
13707 Minor fixes prompted by GCC 4.6.0 warnings.
13708
13709 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13710
13711 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13712 (x_clipboard_manager_save_all): Move extern decl to ...
13713 * xterm.h: ... here, so that it can be checked for consistency.
13714
13715 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13716
13717 * xselect.c (x_clipboard_manager_save_frame)
13718 (x_clipboard_manager_save_all): New functions.
13719 (Fx_clipboard_manager_save): Lisp function deleted.
13720
13721 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13722 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13723
13724 * xterm.h: Update prototype.
13725
13726 2011-05-28 William Xu <william.xwl@gmail.com>
13727
13728 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13729 exiting (Bug#8239).
13730
13731 2011-05-28 Jim Meyering <meyering@redhat.com>
13732
13733 Avoid a sign-extension bug in crypto_hash_function.
13734 * fns.c (to_uchar): Define.
13735 (crypto_hash_function): Use it to convert some newly-signed
13736 variables to unsigned, to avoid sign-extension bugs. For example,
13737 without this change, (md5 "truc") would evaluate to
13738 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13739 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13740 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13741
13742 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13743
13744 Integer overflow fixes.
13745
13746 * dbusbind.c: Serial number integer overflow fixes.
13747 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13748 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13749 to hold a serial number that is too large for a fixnum.
13750 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13751 Check for serial numbers out of range. Decode any serial number
13752 that was so large that it became a float. (Bug#8722)
13753
13754 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13755 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13756 Use XFASTINT rather than XUINT when numbers are nonnegative.
13757 (xd_append_arg, Fdbus_method_return_internal):
13758 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13759 arguments, check that Lisp number is nonnegative, rather than
13760 silently wrapping negative numbers around. (Bug#8722)
13761 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13762 (Bug#8722)
13763
13764 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13765
13766 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13767
13768 ccl: Add integer overflow checks.
13769 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13770 (IN_INT_RANGE): New macros.
13771 (ccl_driver): Use them to check for integer overflow when
13772 decoding a CCL program. Many of the new checks are whether XINT (x)
13773 fits in int; it doesn't always, on 64-bit hosts. The new version
13774 doesn't catch all possible integer overflows, but it's an
13775 improvement. (Bug#8719)
13776
13777 * alloc.c (make_event_array): Use XINT, not XUINT.
13778 There's no need for unsigned here.
13779
13780 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13781 This follows up to the 2011-05-06 change that substituted uintptr_t
13782 for EMACS_INT. This case wasn't caught back then.
13783
13784 Rework Fformat to avoid integer overflow issues.
13785 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13786 now (part of C89). Include <verify.h>.
13787 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13788 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13789 (Fformat): Avoid the prepass trying to compute sizes; it was only
13790 approximate and thus did not catch overflow reliably. Instead, walk
13791 through the format just once, formatting and computing sizes as we go,
13792 checking for integer overflow at every step, and allocating a larger
13793 buffer as needed. Keep track separately whether the format is
13794 multibyte. Keep only the most-recently calculated precision, rather
13795 than them all. Record whether each argument has been converted to
13796 string. Use EMACS_INT, not int, for byte and char and arg counts.
13797 Support field widths and precisions larger than INT_MAX. Avoid
13798 sprintf's undefined behavior with conversion specifications such as %#d
13799 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13800 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13801 formatting out-of-range floating point numbers with int
13802 formats. (Bug#8668)
13803
13804 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13805
13806 * data.c: Avoid integer truncation in expressions involving floats.
13807 * data.c: Include <intprops.h>.
13808 (arith_driver): When there's an integer overflow in an expression
13809 involving floating point, convert the integers to floating point
13810 so that the resulting value does not suffer from catastrophic
13811 integer truncation. For example, on a 64-bit host (* 4
13812 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13813 Do not rely on undefined behavior after integer overflow.
13814
13815 merge count_size_as_multibyte, parse_str_to_multibyte
13816 * character.c, character.h (count_size_as_multibyte):
13817 Rename from parse_str_to_multibyte; all uses changed.
13818 Check for integer overflow.
13819 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13820 since it's now a duplicate of the other. This is more of
13821 a character than a buffer op, so better that it's in character.c.
13822 * fns.c, print.c: Adjust to above changes.
13823
13824 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13825
13826 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13827
13828 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13829
13830 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13831 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13832 (x_clipboard_manager_save): Now static.
13833 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13834
13835 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13836 (crypto_hash_function): Now static.
13837 Fix pointer signedness problems. Avoid unnecessary initializations.
13838
13839 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13840
13841 * termhooks.h (Vselection_alist): Make it terminal-local.
13842
13843 * terminal.c (create_terminal): Initialize it.
13844
13845 * xselect.c: Support for clipboard managers.
13846 (Vselection_alist): Move to termhooks.h as terminal-local var.
13847 (LOCAL_SELECTION): New macro.
13848 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13849 (symbol_to_x_atom): Remove gratuitous arg.
13850 (x_handle_selection_request, lisp_data_to_selection_data)
13851 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13852 (x_own_selection, x_get_local_selection, x_convert_selection):
13853 New arg, specifying work frame. Use terminal-local Vselection_alist.
13854 (some_frame_on_display): Delete unused function.
13855 (Fx_own_selection_internal, Fx_get_selection_internal)
13856 (Fx_disown_selection_internal, Fx_selection_owner_p)
13857 (Fx_selection_exists_p): New optional frame arg.
13858 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13859 (x_handle_selection_clear): Don't treat other terminals with the
13860 same keyboard specially. Use the terminal-local Vselection_alist.
13861 (x_clear_frame_selections): Use Frun_hook_with_args.
13862
13863 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13864
13865 * xterm.h: Add support for those atoms.
13866
13867 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13868
13869 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13870 (converted_selections, conversion_fail_tag): New global variables.
13871 (x_selection_request_lisp_error): Free the above.
13872 (x_get_local_selection): Remove unnecessary code.
13873 (x_reply_selection_request): Args changed; handle arbitrary array
13874 of converted selections stored in converted_selections.
13875 Separate the XChangeProperty and SelectionNotify steps.
13876 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13877 (x_convert_selection): New function.
13878 (x_handle_selection_event): Simplify.
13879 (x_get_foreign_selection): Don't ignore incoming requests while
13880 waiting for an answer; this will fail when we implement
13881 SAVE_TARGETS, and seems unnecessary anyway.
13882 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13883 (Vx_sent_selection_functions): Doc fix.
13884
13885 2011-05-26 Leo Liu <sdl.web@gmail.com>
13886
13887 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13888
13889 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13890
13891 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13892
13893 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13894 for fringe update if it has periodic bitmap.
13895 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13896 and fringe_bitmap_periodic_p.
13897
13898 * fringe.c (get_fringe_bitmap_data): New function.
13899 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13900 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13901 row. Mark glyph row for fringe update if periodicity changed.
13902
13903 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13904 for fringe update unless it has periodic bitmap.
13905
13906 2011-05-25 Kenichi Handa <handa@m17n.org>
13907
13908 * xdisp.c (get_next_display_element): Set correct it->face_id for
13909 a static composition.
13910
13911 2011-05-24 Leo Liu <sdl.web@gmail.com>
13912
13913 * deps.mk (fns.o):
13914 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13915
13916 * fns.c (crypto_hash_function, Fsha1): New function.
13917 (Fmd5): Use crypto_hash_function.
13918 (syms_of_fns): Add Ssha1.
13919
13920 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13921
13922 * gnutls.c: Remove unused macros.
13923 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13924 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13925 Remove macros that are defined and never used.
13926 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13927
13928 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13929
13930 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13931 (Fx_get_selection_internal): Minor cleanup.
13932 (Fx_own_selection_internal): Rename arguments for consistency with
13933 select.el.
13934
13935 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13936
13937 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13938
13939 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13940
13941 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13942
13943 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13944
13945 * dispnew.c (scrolling_window): Don't exclude the case that the
13946 last enabled row in the desired matrix touches the bottom boundary.
13947
13948 2011-05-21 Glenn Morris <rgm@gnu.org>
13949
13950 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13951 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13952 and add some more files.
13953
13954 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13955
13956 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13957 report_file_error introduced by the change from 2011-05-07.
13958
13959 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13960
13961 * systime.h (Time): Define only if emacs is defined.
13962 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13963 where the include path doesn't have X11/X.h by default. See
13964 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13965
13966 2011-05-20 Kenichi Handa <handa@m17n.org>
13967
13968 * composite.c (find_automatic_composition): Fix previous change.
13969
13970 2011-05-20 Glenn Morris <rgm@gnu.org>
13971
13972 * lisp.mk: New file, split from Makefile.in.
13973 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13974 (shortlisp): Remove.
13975 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13976
13977 2011-05-19 Glenn Morris <rgm@gnu.org>
13978
13979 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13980 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13981 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13982 (lisp): Set the order to that of loadup.el.
13983 (shortlisp): Make it a copy of $lisp.
13984 (SOME_MACHINE_LISP): Remove.
13985 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13986 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13987
13988 2011-05-18 Kenichi Handa <handa@m17n.org>
13989
13990 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13991 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13992 (find_automatic_composition): Mostly rewrite for efficiency.
13993
13994 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
13995
13996 * makefile.w32-in: Update dependencies.
13997
13998 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13999
14000 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14001 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14002
14003 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14004
14005 Fix some integer overflow issues, such as string length overflow.
14006
14007 * insdel.c (count_size_as_multibyte): Check for string overflow.
14008
14009 * character.c (lisp_string_width): Check for string overflow.
14010 Use EMACS_INT, not int, for string indexes and lengths; in
14011 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14012 the resulting string length overflows an EMACS_INT; instead,
14013 report a string overflow if no precision given. When checking for
14014 precision exhaustion, use a check that cannot possibly have
14015 integer overflow. (Bug#8675)
14016 * character.h (lisp_string_width): Adjust to new signature.
14017
14018 * alloc.c (string_overflow): New function.
14019 (Fmake_string): Use it. This doesn't change behavior, but saves
14020 a few bytes and will simplify future changes.
14021 * character.c (string_escape_byte8): Likewise.
14022 * lisp.h (string_overflow): New decl.
14023
14024 Fixups, following up to the user-interface timestamp change.
14025 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14026 for UI timestamps, instead of unsigned long.
14027 * msdos.c (mouse_get_pos): Likewise.
14028 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14029 * w32gui.h (Time): Define by including "systime.h" rather than by
14030 declaring it ourselves. (Bug#8664)
14031
14032 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14033 * image.c (clear_image_cache): Likewise.
14034
14035 * term.c (term_mouse_position): Don't assume time_t wraparound.
14036
14037 Be more systematic about user-interface timestamps.
14038 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14039 and sometimes 'EMACS_UINT', to represent these timestamps.
14040 This change causes it to use 'Time' uniformly, as that's what X uses.
14041 This makes the code easier to follow, and makes it easier to catch
14042 integer overflow bugs such as Bug#8664.
14043 * frame.c (Fmouse_position, Fmouse_pixel_position):
14044 Use Time, not unsigned long, for user-interface timestamps.
14045 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14046 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14047 * keyboard.h (last_event_timestamp): Likewise.
14048 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14049 * menu.h (xmenu_show): Likewise.
14050 * term.c (term_mouse_position): Likewise.
14051 * termhooks.h (struct input_event.timestamp): Likewise.
14052 (struct terminal.mouse_position_hook): Likewise.
14053 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14054 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14055 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14056 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14057 what it was before.
14058 * menu.h, termhooks.h: Include "systime.h", for Time.
14059
14060 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14061 Don't assume that the difference between two unsigned long values
14062 can fit into an integer. At this point, we know button_down_time
14063 <= event->timestamp, so the difference must be nonnegative, so
14064 there's no need to cast the result if double-click-time is
14065 nonnegative, as it should be; check that it's nonnegative, just in
14066 case. This bug is triggered when events are more than 2**31 ms
14067 apart (about 25 days). (Bug#8664)
14068
14069 * xselect.c (last_event_timestamp): Remove duplicate decl.
14070 (x_own_selection): Remove needless cast to unsigned long.
14071
14072 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14073 that always fit in int. Use a sentinel instead of a counter, to
14074 avoid a temp and to allay GCC's concerns about possible int overflow.
14075 * frame.h (struct frame): Use int for menu_bar_items_used
14076 instead of EMACS_INT, since it always fits in int.
14077
14078 * menu.c (grow_menu_items): Check for int overflow.
14079
14080 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14081
14082 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14083 Before, the code was not consistent. These values cannot exceed
14084 2**31 - 1 so there's no need to make them unsigned.
14085 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14086 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14087 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14088 as modifiers.
14089 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14090
14091 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14092 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14093 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14094 presumably because the widths might not match.
14095
14096 * window.c (size_window): Avoid needless test at loop start.
14097
14098 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14099
14100 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14101
14102 2011-05-12 Drew Adams <drew.adams@oracle.com>
14103
14104 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14105
14106 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14107
14108 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14109 `width' to `bar_area_x' and `bar_area_width', respectively.
14110 (x_scroll_run): Take account of fringe background extension.
14111
14112 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14113 Rename local vars `left' and `width' to `bar_area_x' and
14114 `bar_area_width', respectively.
14115 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14116 background extension.
14117
14118 2011-05-10 Jim Meyering <meyering@redhat.com>
14119
14120 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14121
14122 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14123
14124 * image.c (Finit_image_library): Return t for built-in image types,
14125 like pbm and xbm. (Bug#8640)
14126
14127 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14128
14129 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14130
14131 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14132
14133 * w32console.c (Fset_screen_color): Doc fix.
14134 (Fget_screen_color): New function.
14135 (syms_of_ntterm): Defsubr it.
14136
14137 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14138 unlink the temporary file if Fcall_process didn't create it in the
14139 first place.
14140 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14141 child process will be redirected to a file specified with `:file'.
14142 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14143 cue to call_process_cleanup not to close that handle.
14144
14145 2011-05-07 Ben Key <bkey76@gmail.com>
14146
14147 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14148 one of two shell specific rules, either bootstrap-temacs-CMD or
14149 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14150 to the previous implementation of the bootstrap-temacs rule.
14151 The bootstrap-temacs-CMD rule is similar to the previous
14152 implementation of the bootstrap-temacs rule except that it
14153 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14154 variable.
14155
14156 These changes, along with some changes to nt/configure.bat,
14157 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14158 earlier fix to add support for --cflags and --ldflags options
14159 that include quotes so that it works whether make uses cmd or
14160 sh as the shell.
14161
14162 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14163
14164 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14165 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14166 is a constant.
14167 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14168 a string. Handle both cases.
14169 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14170 (Fdbus_register_method): Use Qinvalid_function.
14171
14172 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14173
14174 * makefile.w32-in: Update dependencies.
14175 (LISP_H): Add inttypes.h and stdin.h.
14176 (PROCESS_H): Add unistd.h.
14177
14178 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14179
14180 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14181 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14182
14183 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14184
14185 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14186
14187 * term.c (vfatal): Remove stray call to va_end.
14188 It's not needed and the C Standard doesn't allow it here anyway.
14189
14190 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14191 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14192
14193 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14194 bytes.
14195
14196 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14197
14198 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14199
14200 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14201
14202 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14203
14204 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14205
14206 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14207 * charset.c (Fdefine_charset_internal): Don't initialize
14208 charset.code_space[15]. The value was garbage, on hosts with
14209 32-bit int (Bug#8600).
14210
14211 * lread.c (read_integer): Be more consistent with string-to-number.
14212 Use string_to_number to do the actual conversion; this avoids
14213 rounding errors and fixes some other screwups. Without this fix,
14214 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14215 (digit_to_number): Move earlier, for benefit of read_integer.
14216 Return -1 if the digit is out of range for the base, -2 if it is
14217 not a digit in any supported base. (Bug#8602)
14218
14219 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14220
14221 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14222 to match comment at start of function. This also removes a
14223 GCC warning about overflow in a 32+64-bit port.
14224
14225 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14226
14227 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14228 Reported by Stefan Monnier in
14229 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14230 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14231 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14232
14233 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14234 (EMACS_UINTPTR): Likewise, with uintptr_t.
14235
14236 * lisp.h: Prefer 64-bit EMACS_INT if available.
14237 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14238 on 32-bit hosts that have 64-bit int, so that they can access
14239 large files.
14240 However, temporarily disable this change unless the temporary
14241 symbol WIDE_EMACS_INT is defined.
14242
14243 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14244
14245 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14246 This removes an assumption that EMACS_INT and long are the same
14247 width as pointers. The assumption is true for Emacs porting targets
14248 now, but we want to make other targets possible.
14249 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14250 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14251 In the rest of the code, change types of integers that hold casted
14252 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14253 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14254 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14255 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14256 No need to cast type when ORing.
14257 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14258 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14259 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14260 assume EMACS_INT is the same width as char *.
14261 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14262 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14263 Remove no-longer-needed casts.
14264 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14265 (xg_tool_bar_help_callback, xg_make_tool_item):
14266 Use EMACS_INTPTR to hold an integer
14267 that will be cast to void *; this can avoid a GCC warning
14268 if EMACS_INT is not the same width as void *.
14269 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14270 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14271 (current_message_1, set_message_1):
14272 Use a local to convert to proper width without a cast.
14273 * xmenu.c (dialog_selection_callback): Likewise.
14274
14275 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14276 Also, don't assume VALBITS / RAND_BITS is less than 5,
14277 and don't rely on undefined behavior when shifting a 1 left into
14278 the sign bit.
14279 * lisp.h (get_random): Change signature to match.
14280
14281 * lread.c (hash_string): Use size_t, not int, for hash computation.
14282 Normally we prefer signed values; but hashing is special, because
14283 it's better to use unsigned division on hash table sizes so that
14284 the remainder is nonnegative. Also, size_t is the natural width
14285 for hashing into memory. The previous code used 'int', which doesn't
14286 retain enough info to hash well into very large tables.
14287 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14288
14289 * dbusbind.c: Don't possibly lose pointer info when converting.
14290 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14291 Use XPNTR rather than XHASH, so that the high-order bits of
14292 the pointer aren't lost when converting through void *.
14293
14294 * eval.c (Fautoload): Don't double-shift a pointer.
14295
14296 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14297
14298 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14299
14300 * gnutls.c (DEF_GNUTLS_FN):
14301 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14302
14303 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14304
14305 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14306 marker. (Bug#8610)
14307
14308 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14309
14310 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14311 New version that can reserve upto 2GB of heap space.
14312
14313 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14314
14315 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14316
14317 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14318
14319 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14320 `gnutls_certificate_set_x509_key_file'.
14321
14322 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14323
14324 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14325 Update dependencies.
14326
14327 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14328
14329 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14330 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14331 Remove unused parameter `fildes'.
14332 * process.c (read_process_output, send_process): Don't pass it.
14333
14334 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14335
14336 Fix previous change: the library cache is defined in w32.c.
14337 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14338 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14339
14340 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14341
14342 Implement dynamic loading of GnuTLS on Windows.
14343
14344 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14345 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14346 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14347 Declare.
14348
14349 * gnutls.c (Qgnutls_dll): Define.
14350 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14351 (gnutls_*): Declare function pointers.
14352 (init_gnutls_functions): New function to initialize function pointers.
14353 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14354 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14355 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14356 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14357 (emacs_gnutls_write, emacs_gnutls_read)
14358 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14359 (Fgnutls_available_p): New function.
14360 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14361 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14362 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14363
14364 * image.c: Include w32.h.
14365 (Vimage_type_cache): Delete.
14366 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14367 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14368 (w32_delayed_load): Move to w32.c.
14369
14370 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14371
14372 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14373 (w32_delayed_load): Move from image.c. When loading a library, record
14374 its filename in the :loaded-from property of the library id.
14375 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14376 Initialize and staticpro them.
14377 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14378
14379 * process.c: Include lisp.h before w32.h, not after.
14380 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14381 instead of gnutls_record_check_pending.
14382
14383 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14384
14385 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14386
14387 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14388 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14389 as passed in.
14390
14391 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14392
14393 * xterm.c (x_set_frame_alpha): Do not set property on anything
14394 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14395
14396 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14397
14398 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14399
14400 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14401
14402 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14403 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14404 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14405 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14406 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14407 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14408 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14409 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14410 (Qgnutls_bootprop_callbacks_verify): Make static.
14411
14412 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14413
14414 * callproc.c: Indentation fixup.
14415
14416 * sysdep.c (wait_for_termination_1): Make static.
14417 (wait_for_termination, interruptible_wait_for_termination):
14418 Move after wait_for_termination_1.
14419
14420 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14421
14422 * sysdep.c (interruptible_wait_for_termination): New function
14423 which is like wait_for_termination, but allows keyboard
14424 interruptions.
14425
14426 * callproc.c (Fcall_process): Add (:file "file") as an option for
14427 the STDOUT buffer.
14428 (Fcall_process_region): Ditto.
14429
14430 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14431
14432 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14433 rather than `XVECTOR (FOO)->size'.
14434
14435 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14436 inttypes.h, as a gnulib replacement is used if it not available in
14437 system headers.
14438
14439 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14440
14441 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14442 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14443 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14444
14445 * coding.c (coding_alloc_by_realloc): Error out if destination
14446 will grow beyond MOST_POSITIVE_FIXNUM.
14447 (decode_coding_emacs_mule): Abort if there isn't enough place in
14448 charbuf for the composition carryover bytes. Reserve an extra
14449 space for up to 2 characters produced in a loop.
14450 (decode_coding_iso_2022): Abort if there isn't enough place in
14451 charbuf for the composition carryover bytes.
14452
14453 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14454
14455 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14456 aborting when %lld or %lll format is passed.
14457 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14458 %llo or %llx format is passed. (Bug#8545)
14459
14460 * window.c (window_scroll_line_based): Use a marker instead of
14461 simple variables to record original value of point. (Bug#7952)
14462
14463 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14464 produced by %s or %c overflows available buffer space. (Bug#8545)
14465
14466 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14467
14468 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14469 (SIZE_MAX): Move defn after all includes, as they might #define it.
14470
14471 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14472
14473 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14474
14475 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14476
14477 * keyboard.c (Qdelayed_warnings_hook): Define.
14478 (command_loop_1): Run `delayed-warnings-hook'
14479 if Vdelayed_warnings_list is non-nil.
14480 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14481 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14482
14483 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14484
14485 * doprnt.c (doprnt): Don't return value smaller than the buffer
14486 size if the message was truncated. (Bug#8545).
14487
14488 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14489
14490 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14491 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14492
14493 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14494
14495 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14496
14497 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14498
14499 * makefile.w32-in: Update dependencies.
14500
14501 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14502
14503 Improve `doprnt' and its usage. (Bug#8545)
14504 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14505 `format_end'. Remove support for %l as a conversion specifier.
14506 Don't use xrealloc. Improve diagnostics when the %l size modifier
14507 is used. Update the commentary.
14508
14509 * eval.c (verror): Simplify calculation of size_t.
14510
14511 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14512 messages.
14513
14514 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14515
14516 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14517 change.
14518
14519 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14520
14521 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14522 This makes this file independent of the recent pseudovector change.
14523
14524 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14525
14526 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14527
14528 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14529 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14530 Remove unused local.
14531 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14532
14533 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14534 GCC 4.6.0 optimizes based on type-based alias analysis.
14535 For example, if b is of type struct buffer * and v of type struct
14536 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14537 != &v->size, and therefore "v->size = 1; b->size = 2; return
14538 v->size;" must therefore return 1. This assumption is incorrect
14539 for Emacs, since it type-puns struct Lisp_Vector * with many other
14540 types. To fix this problem, this patch adds a new type struct
14541 vectorlike_header that documents the constraints on layout of vectors
14542 and pseudovectors, and helps optimizing compilers not get fooled
14543 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14544 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14545 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14546 the size member.
14547 (XSETPVECTYPE): Rewrite in terms of new macro.
14548 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14549 This is a bit clearer, and further avoids the possibility of
14550 undesirable aliasing.
14551 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14552 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14553 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14554 since Lisp_Subr is a special case (no "next" field).
14555 (ASIZE): Now uses header.size rather than size.
14556 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14557 to avoid the hassle of writing XVECTOR (foo)->header.size.
14558 (struct vectorlike_header): New type.
14559 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14560 object, to help avoid aliasing.
14561 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14562 (SUBRP): Likewise, since Lisp_Subr is a special case.
14563 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14564 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14565 (struct Lisp_Hash_Table): Combine first two members into a single
14566 struct vectorlike_header member. All uses of "size" and "next" members
14567 changed to be "header.size" and "header.next".
14568 * buffer.h (struct buffer): Likewise.
14569 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14570 * frame.h (struct frame): Likewise.
14571 * process.h (struct Lisp_Process): Likewise.
14572 * termhooks.h (struct terminal): Likewise.
14573 * window.c (struct save_window_data, struct saved_window): Likewise.
14574 * window.h (struct window): Likewise.
14575 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14576 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14577 * buffer.c (init_buffer_once): Likewise.
14578 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14579 special case.
14580 * process.c (Fformat_network_address): Use local var for size,
14581 for brevity.
14582
14583 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14584
14585 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14586 * data.c (atof): Remove decl; no longer used or needed.
14587 (digit_to_number): Move to lread.c.
14588 (Fstring_to_number): Use new string_to_number function, to be
14589 consistent with how the Lisp reader treats infinities and NaNs.
14590 Do not assume that floating-point numbers represent EMACS_INT
14591 without losing information; this is not true on most 64-bit hosts.
14592 Avoid double-rounding errors, by insisting on integers when
14593 parsing non-base-10 numbers, as the documentation specifies.
14594 * lisp.h (string_to_number): New decl, replacing ...
14595 (isfloat_string): Remove.
14596 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14597 (read1): Do not accept +. and -. as integers; this
14598 appears to have been a coding error. Similarly, do not accept
14599 strings like +-1e0 as floating point numbers. Do not report
14600 overflow for integer overflows unless the base is not 10 which
14601 means we have no simple and reliable way to continue.
14602 Break out the floating-point parsing into a new
14603 function string_to_number, so that Fstring_to_number parses
14604 floating point numbers consistently with the Lisp reader.
14605 (digit_to_number): Move here from data.c. Make it static inline.
14606 (E_CHAR, EXP_INT): Remove, replacing with ...
14607 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14608 (string_to_number): New function, replacing isfloat_string.
14609 This function checks for valid syntax and produces the resulting
14610 Lisp float number too. Rework it so that string-to-number
14611 no longer mishandles examples like "1.0e+". Use strtoumax,
14612 so that overflow for non-base-10 numbers is reported only when
14613 there's no portable and simple way to convert to floating point.
14614
14615 * textprop.c (set_text_properties_1): Rewrite for clarity,
14616 and to avoid GCC warning about integer overflow.
14617
14618 * intervals.h (struct interval): Use EMACS_INT for members
14619 where EMACS_UINT might cause problems. See
14620 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14621 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14622 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14623 All uses changed.
14624 (offset_intervals): Tell GCC not to worry about length overflow
14625 when negating a negative length.
14626
14627 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14628 (overrun_check_free): Likewise.
14629
14630 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14631 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14632 word size.
14633
14634 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14635 (gnutls_make_error): Rename local to avoid shadowing.
14636 (gnutls_emacs_global_deinit): ifdef out; not used.
14637 (Fgnutls_boot): Use const for pointer to readonly storage.
14638 Comment out unused local. Fix pointer signedness problems.
14639
14640 * lread.c (openp): Don't stuff size_t into an 'int'.
14641 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14642 about possible signed overflow.
14643
14644 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14645 (GDK_KEY_g): Don't define if already defined.
14646 (xg_prepare_tooltip): Avoid pointer signedness problem.
14647 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14648
14649 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14650 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14651
14652 * xfns.c (Fx_window_property): Simplify a bit,
14653 to make a bit faster and to avoid GCC 4.6.0 warning.
14654 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14655
14656 * fns.c (internal_equal): Don't assume size_t fits in int.
14657
14658 * alloc.c (compact_small_strings): Tighten assertion a little.
14659
14660 Replace pEd with more-general pI, and fix some printf arg casts.
14661 * lisp.h (pI): New macro, generalizing old pEd macro to other
14662 conversion specifiers. For example, use "...%"pI"d..." rather
14663 than "...%"pEd"...".
14664 (pEd): Remove. All uses replaced with similar uses of pI.
14665 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14666 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14667 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14668 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14669 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14670 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14671 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14672 64-bit hosts.
14673 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14674 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14675 * print.c (safe_debug_print, print_object): Likewise.
14676 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14677 to int.
14678 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14679 avoiding the 0 flag, which is not portable.
14680 * process.c (Fmake_network_process): Use pI to avoid cast.
14681 * region-cache.c (pp_cache): Likewise.
14682 * xdisp.c (decode_mode_spec): Likewise.
14683 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14684 behavior on 64-bit hosts with printf arg.
14685 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14686 (x_stop_queuing_selection_requests): Likewise.
14687 (x_get_window_property): Don't truncate byte count to an 'int'
14688 when tracing.
14689
14690 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14691 here, since it parses constructs like leading '-' and spaces,
14692 which are not wanted; and it overflows with large numbers.
14693 Instead, simply match F[0-9]+, which is what is wanted anyway.
14694
14695 * alloc.c: Remove unportable assumptions about struct layout.
14696 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14697 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14698 (allocate_vectorlike, make_pure_vector): Use the new macros,
14699 plus offsetof, to remove unportable assumptions about struct layout.
14700 These assumptions hold on all porting targets that I know of, but
14701 they are not guaranteed, they're easy to remove, and removing them
14702 makes further changes easier.
14703
14704 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14705 This doesn't fix a bug but makes the code clearer.
14706 (string_overrun_cookie): Now const. Use initializers that
14707 don't formally overflow signed char, to avoid warnings.
14708 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14709 can cause Emacs to crash when string overrun checking is enabled.
14710 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14711 multiple of sizeof (EMACS_INT); it need not be, if
14712 alignof(EMACS_INT) < sizeof (EMACS_INT).
14713 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14714
14715 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14716
14717 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14718
14719 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14720
14721 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14722 supposed to be handshaking. (Bug#8556)
14723 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14724
14725 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14726
14727 * lisp.h (Qdebug): List symbol.
14728 * eval.c (Qdebug): Restore global linkage.
14729 * keyboard.c (debug-on-event): New variable.
14730 (handle_user_signal): Break into debugger when debug-on-event
14731 matches the current signal symbol.
14732
14733 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14734
14735 * alloc.c (check_sblock, check_string_bytes)
14736 (check_string_free_list): Convert to standard C.
14737
14738 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14739
14740 * w32.c (emacs_gnutls_push): Fix typo.
14741
14742 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14743
14744 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14745 "cast to pointer from integer of different size".
14746
14747 Improve doprnt and its use in verror. (Bug#8545)
14748 * doprnt.c (doprnt): Document the set of format control sequences
14749 supported by the function. Use SAFE_ALLOCA instead of always
14750 using `alloca'.
14751
14752 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14753 is one byte too soon. Don't use xrealloc; instead xfree and
14754 xmalloc anew.
14755
14756 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14757
14758 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14759 callbacks stage.
14760
14761 * gnutls.c: Renamed global_initialized to
14762 gnutls_global_initialized. Added internals for the
14763 :verify-hostname-error, :verify-error, and :verify-flags
14764 parameters of `gnutls-boot' and documented those parameters in the
14765 docstring. Start callback support.
14766 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14767 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14768 on error. Return error code.
14769 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14770 (emacs_gnutls_read): Likewise.
14771 (Fgnutls_boot): Return handshake error code.
14772 (emacs_gnutls_handle_error): New function.
14773 (wsaerror_to_errno): Likewise.
14774
14775 * w32.h (emacs_gnutls_pull): Add prototype.
14776 (emacs_gnutls_push): Likewise.
14777
14778 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14779 (emacs_gnutls_push): Likewise.
14780
14781 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14782
14783 * process.c (wait_reading_process_output): Check if GnuTLS
14784 buffered some data internally if no FDs are set for TLS
14785 connections.
14786
14787 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14788 (LIBS): Link to USER_LIBS.
14789 ($(BLD)/gnutls.$(0)): New target.
14790
14791 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14792
14793 * xdisp.c (handle_single_display_spec): Rename the
14794 display_replaced_before_p argument into display_replaced_p, to
14795 make it consistent with the commentary. Fix typos in the
14796 commentary.
14797
14798 * textprop.c (syms_of_textprop): Remove dead code.
14799 (copy_text_properties): Delete obsolete commentary about an
14800 interface that was deleted long ago. Fix typos in the description
14801 of arguments.
14802
14803 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14804 to changes in oldXMenu/XMenu.h from 2011-04-16.
14805 <menu_help_message, prev_menu_help_message>: Constify.
14806 (IT_menu_make_room): menu->help_text is now `const char **';
14807 adjust.
14808
14809 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14810 to changes in oldXMenu/XMenu.h from 2011-04-16.
14811 (struct XMenu): Declare `help_text' `const char **'.
14812
14813 * xfaces.c <Qunspecified>: Make extern again.
14814
14815 * syntax.c: Include sys/types.h before including regex.h, as
14816 required by POSIX.
14817
14818 * doc.c (get_doc_string): Improve the format passed to `error'.
14819
14820 * doprnt.c (doprnt): Improve commentary.
14821
14822 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14823
14824 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14825 them with etags.
14826
14827 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14828 changes in globals.h immediately force recompilation.
14829 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14830 $(CURDIR)/s/ms-w32.h.
14831 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14832
14833 * character.c (Fchar_direction): Function deleted.
14834 (syms_of_character): Don't defsubr it.
14835 <char-direction-table>: Deleted.
14836
14837 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14838
14839 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14840 * doprnt.c: Include limits.h.
14841 (SIZE_MAX): New macro.
14842 (doprnt): Return a size_t value. 2nd arg is now size_t.
14843 Many local variables are now size_t instead of int or unsigned.
14844 Improve overflow protection. Support `l' modifier for integer
14845 conversions. Support %l conversion. Don't assume an EMACS_INT
14846 argument for integer conversions and for %c.
14847
14848 * lisp.h (doprnt): Restore prototype.
14849
14850 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14851 $(SRC)/character.h.
14852
14853 * Makefile.in (base_obj): Add back doprnt.o.
14854
14855 * deps.mk (doprnt.o): Add back prerequisites.
14856 (callint.o): Depend on character.h.
14857
14858 * eval.c (internal_lisp_condition_case): Include the handler
14859 representation in the error message.
14860 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14861 when breaking from the loop.
14862
14863 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14864
14865 * callint.c (Fcall_interactively): When displaying error message
14866 about invalid control letter, pass the character's codepoint, not
14867 a pointer to its multibyte form. Improve display of the character
14868 in octal and display also its hex code.
14869
14870 * character.c (char_string): Use %x to display the (unsigned)
14871 codepoint of an invalid character, to avoid displaying a bogus
14872 negative value.
14873
14874 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14875 `error', not SYMBOL_NAME itself.
14876
14877 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14878 character arguments to `error'.
14879
14880 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14881 to `error' in error message about FINAL_CHAR argument. Make sure
14882 FINAL_CHAR is a character, and use %c when it is passed as
14883 argument to `error'.
14884
14885 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14886
14887 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14888
14889 * w32.c: Include <time.h>.
14890 (sys_localtime): New function.
14891
14892 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14893
14894 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14895
14896 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14897
14898 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14899
14900 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14901 zombies (Bug#8467).
14902
14903 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14904
14905 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14906 gl_state.e_property when gl_state.object is Qt.
14907
14908 * insdel.c (make_gap_larger): Remove limitation of buffer size
14909 to <= INT_MAX.
14910
14911 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14912
14913 * xdisp.c (lookup_glyphless_char_display)
14914 (produce_glyphless_glyph): Handle cons cell entry in
14915 glyphless-char-display.
14916 (Vglyphless_char_display): Document it.
14917
14918 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14919 glyphless-char-display.
14920
14921 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14922
14923 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14924
14925 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14926
14927 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14928 definition for no-X builds.
14929
14930 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14931
14932 Static checks with GCC 4.6.0 and non-default toolkits.
14933
14934 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14935
14936 * process.c (keyboard_bit_set): Define only if SIGIO.
14937 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14938 (send_process): Repair possible setjmp clobbering.
14939
14940 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14941
14942 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14943
14944 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14945
14946 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14947 Define only if needed.
14948
14949 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14950 by pacifying GCC about it. Maybe it's time to retire it?
14951 * xfaces.c (USG, __TIMEVAL__): Likewise.
14952
14953 * dispextern.h (struct redisplay_interface): Rename param
14954 to avoid shadowing.
14955 * termhooks.h (struct terminal): Likewise.
14956 * xterm.c (xembed_send_message): Likewise.
14957
14958 * insdel.c (make_gap_smaller): Define only if
14959 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14960
14961 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14962 it.
14963
14964 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14965 so that we aren't warned about unused symbols.
14966
14967 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14968
14969 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14970
14971 * xfns.c (x_real_positions): Mark locals as initialized.
14972
14973 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14974
14975 * xterm.c: Fix problems found by static analysis with other toolkits.
14976 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14977 (x_dispatch_event): Declare static if USE_GTK, and
14978 define if USE_GTK || USE_X_TOOLKIT.
14979 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
14980 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
14981 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14982 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
14983
14984 * xmenu.c (menu_help_callback): Pointer type fixes.
14985 Use const pointers when pointing at readonly data. Avoid pointer
14986 signedness clashes.
14987 (FALSE): Remove unused macro.
14988 (update_frame_menubar): Remove unused decl.
14989
14990 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14991
14992 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14993 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14994 (single_menu_item): Rename local to avoid shadowing.
14995
14996 * keyboard.c (make_lispy_event): Remove unused local var.
14997
14998 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14999 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15000
15001 * bitmaps: Change bitmaps from unsigned char back to the X11
15002 compatible char. Avoid the old compiler warnings about
15003 out-of-range initializers by using, for example, '\xab' rather
15004 than 0xab.
15005
15006 * xgselect.c (xgselect_initialize): Check vs interface
15007 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15008
15009 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15010
15011 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15012 to read-only memory.
15013
15014 * fns.c (vector): Remove; this old hack is no longer needed.
15015
15016 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15017 Remove unused var.
15018 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15019
15020 * xrdb.c (x_load_resources): Omit unused local.
15021
15022 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15023 (x_window): Rename locals to avoid shadowing.
15024 (USG): Use the kludged USG macro, to pacify gcc.
15025
15026 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15027 (x_term_init): Remove local to avoid shadowing.
15028
15029 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15030
15031 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15032 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15033
15034 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15035
15036 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15037
15038 Fix regex.c, syntax.c and friends for buffers > 2GB.
15039 * syntax.h (struct gl_state_s): Declare character position members
15040 EMACS_INT.
15041
15042 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15043
15044 * textprop.c (verify_interval_modification, interval_of):
15045 Declare arguments EMACS_INT.
15046
15047 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15048 EMACS_INT.
15049
15050 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15051
15052 * indent.c (Fvertical_motion): Local variable it_start is now
15053 EMACS_INT.
15054
15055 * regex.c (re_match, re_match_2, re_match_2_internal)
15056 (bcmp_translate, regcomp, regexec, print_double_string)
15057 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15058 (re_compile_pattern, re_exec): Declare arguments and local
15059 variables `size_t' and `ssize_t' and return values `regoff_t', as
15060 appropriate.
15061 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15062 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15063 <compile_stack_type>: `size' and `avail' are now `size_t'.
15064
15065 * regex.h <regoff_t>: Use ssize_t, not int.
15066 (re_search, re_search_2, re_match, re_match_2): Arguments that
15067 specify buffer/string position and length are now ssize_t and
15068 size_t. Return type is regoff_t.
15069
15070 2011-04-16 Ben Key <bkey76@gmail.com>
15071
15072 * nsfont.m: Fixed bugs in ns_get_family and
15073 ns_descriptor_to_entity that were caused by using free to
15074 deallocate memory blocks that were allocated by xmalloc (via
15075 xstrdup). This caused Emacs to crash when compiled with
15076 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15077 --enable-checking=xmallocoverrun). xfree is now used to
15078 deallocate these memory blocks.
15079
15080 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15081
15082 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15083
15084 emacs_write: Accept and return EMACS_INT for sizes.
15085 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15086 et seq.
15087 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15088 Accept and return EMACS_INT.
15089 (emacs_gnutls_write): Return the number of bytes written on
15090 partial writes.
15091 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15092 (emacs_read, emacs_write): Remove check for negative size, as the
15093 Emacs source code has been audited now.
15094 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15095 (emacs_read, emacs_write): Use it.
15096 * process.c (send_process): Adjust to the new signatures of
15097 emacs_write and emacs_gnutls_write. Do not attempt to store
15098 a byte offset into an 'int'; it might overflow.
15099 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15100
15101 * sound.c: Don't assume sizes fit in 'int'.
15102 (struct sound_device.period_size, alsa_period_size):
15103 Return EMACS_INT, not int.
15104 (struct sound_device.write, vox_write, alsa_write):
15105 Accept EMACS_INT, not int.
15106 (wav_play, au_play): Use EMACS_INT to store sizes and to
15107 record read return values.
15108
15109 2011-04-15 Ben Key <bkey76@gmail.com>
15110
15111 * keyboard.c (Qundefined): Don't declare static since it is used
15112 in nsfns.m.
15113 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15114 static since they are used in nsfont.m.
15115
15116 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15117
15118 * process.c (Qprocessp): Don't declare static.
15119 * lisp.h (Qprocessp): Declare again.
15120
15121 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15122
15123 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15124
15125 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15126
15127 Improve C-level modularity by making more things 'static'.
15128
15129 Don't publish debugger-only interfaces to other modules.
15130 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15131 (verify_bytepos, count_markers): Move decls to the only modules
15132 that need them.
15133 * region-cache.h (pp_cache): Likewise.
15134 * window.h (check_all_windows): Likewise.
15135 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15136
15137 * sysdep.c (croak): Now static, if
15138 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15139 * syssignal.h (croak): Declare only if not static.
15140
15141 * alloc.c (refill_memory_reserve): Now static if
15142 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15143 * lisp.h (refill_memory_reserve): Declare only if not static.
15144
15145 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15146 Define only if USE_LUCID.
15147
15148 * xrdb.c (x_customization_string, x_rm_string): Now static.
15149
15150 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15151 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15152
15153 * xdisp.c (draw_row_with_mouse_face): Now static.
15154 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15155
15156 * window.h (check_all_windows): Mark externally visible.
15157
15158 * window.c (window_deletion_count): Now static.
15159
15160 * undo.c: Make symbols static if they're not exported.
15161 (last_undo_buffer, last_boundary_position, pending_boundary):
15162 Now static.
15163
15164 * textprop.c (interval_insert_behind_hooks): Now static.
15165 (interval_insert_in_front_hooks): Likewise.
15166
15167 * term.c: Make symbols static if they're not exported.
15168 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15169 (max_frame_lines, tty_set_terminal_modes):
15170 (tty_reset_terminal_modes, tty_turn_off_highlight):
15171 (get_tty_terminal): Now static.
15172 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15173 * termhooks.h (term_mouse_moveto): Do not declare if
15174 HAVE_WINDOW_SYSTEM.
15175 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15176 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15177
15178 * sysdep.c: Make symbols static if they're not exported.
15179 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15180 Now static.
15181 (sigprocmask_set, full_mask): Remove; unused.
15182 (wait_debugging): Mark as visible.
15183 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15184 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15185
15186 * syntax.c (syntax_temp): Define only if !__GNUC__.
15187
15188 * sound.c (current_sound_device, current_sound): Now static.
15189
15190 * search.c (searchbufs, searchbuf_head): Now static.
15191
15192 * scroll.c (scroll_cost): Remove; unused.
15193 * dispextern.h (scroll_cost): Remove decl.
15194
15195 * region-cache.h (pp_cache): Mark as externally visible.
15196
15197 * process.c: Make symbols static if they're not exported.
15198 (process_tick, update_tick, create_process, chan_process):
15199 (Vprocess_alist, proc_buffered_char, datagram_access):
15200 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15201 (deactivate_process): Mark defn as static, as well as decl.
15202 * lisp.h (create_process): Remove decl.
15203 * process.h (chan_process, Vprocess_alist): Remove decls.
15204
15205 * print.c: Make symbols static if they're not exported.
15206 (print_depth, new_backquote_output, being_printed, print_buffer):
15207 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15208 (print_interval, print_number_index, initial_stderr_stream):
15209 Now static.
15210 * lisp.h (Fprinc): Remove decl.
15211 (debug_output_compilation_hack): Mark as externally visible.
15212
15213 * sysdep.c (croak): Move decl from here to syssignal.h.
15214 * syssignal.h (croak): Put it here, so the API can be checked when
15215 'croak' is called from dissociate_if_controlling_tty.
15216
15217 * minibuf.c: Make symbols static if they're not exported.
15218 (minibuf_save_list, choose_minibuf_frame): Now static.
15219 * lisp.h (choose_minibuf_frame): Remove decl.
15220
15221 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15222
15223 * lread.c: Make symbols static if they're not exported.
15224 (read_objects, initial_obarray, oblookup_last_bucket_number):
15225 Now static.
15226 (make_symbol): Remove; unused.
15227 * lisp.h (initial_obarray, make_symbol): Remove decls.
15228
15229 * keyboard.c: Make symbols static if they're not exported.
15230 (single_kboard, recent_keys_index, total_keys, recent_keys):
15231 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15232 (this_single_command_key_start, echoing, last_auto_save):
15233 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15234 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15235 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15236 (Vlispy_mouse_stem, double_click_count):
15237 Now static.
15238 (force_auto_save_soon): Define only if SIGDANGER.
15239 (ignore_mouse_drag_p): Now static if
15240 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15241 (print_help): Remove; unused.
15242 (stop_character, last_timer_event): Mark as externally visible.
15243 * keyboard.h (ignore_mouse_drag_p): Declare only if
15244 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15245 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15246 * lisp.h (echoing): Remove decl.
15247 (force_auto_save_soon): Declare only if SIGDANGER.
15248 * xdisp.c (redisplay_window): Simplify code, to make it more
15249 obvious that ignore_mouse_drag_p is not accessed if !defined
15250 USE_GTK && !defined HAVE_NS.
15251
15252 * intervals.c: Make symbols static if they're not exported.
15253 (merge_properties_sticky, merge_interval_right, delete_interval):
15254 Now static.
15255 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15256
15257 * insdel.c: Make symbols static if they're not exported.
15258 However, leave prepare_to_modify_buffer alone. It's never
15259 called from outside this function, but that appears to be a bug.
15260 (combine_after_change_list, combine_after_change_buffer):
15261 (adjust_after_replace, signal_before_change): Now static.
15262 (adjust_after_replace_noundo): Remove; unused.
15263 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15264 (signal_before_change): Remove decls.
15265
15266 * indent.c (val_compute_motion, val_vmotion): Now static.
15267
15268 * image.c: Make symbols static if they're not exported.
15269 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15270 if USE_GTK.
15271 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15272 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15273
15274 * fringe.c (standard_bitmaps): Now static.
15275 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15276
15277 * frame.c: Make symbols static if they're not exported.
15278 (x_report_frame_params, make_terminal_frame): Now static.
15279 (get_frame_param): Now static, unless HAVE_NS.
15280 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15281 (x_get_resource_string): Remove; not used.
15282 * frame.h (make_terminal_frame, x_report_frame_params):
15283 (x_get_resource_string); Remove decls.
15284 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15285 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15286
15287 * font.c, fontset.c: Make symbols static if they're not exported.
15288 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15289 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15290 * font.c (font_close_object): Now static.
15291 * font.h (font_close_object): Remove.
15292 * fontset.c (FONTSET_OBJLIST): Remove.
15293 (free_realized_fontset) #if-0 the body, which does nothing.
15294 (face_suitable_for_char_p): #if-0, as it's never called.
15295 * fontset.h (face_suitable_for_char_p): Remove decl.
15296 * xfaces.c (face_at_string_position):
15297 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15298 since 0 is always ASCII.
15299
15300 * fns.c (weak_hash_tables): Now static.
15301
15302 * fileio.c: Make symbols static if they're not exported.
15303 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15304 (Vwrite_region_annotation_buffers): Now static.
15305
15306 * eval.c: Make symbols static if they're not exported.
15307 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15308 * lisp.h (backtrace_list): Remove decl.
15309
15310 * emacs.c: Make symbols static if they're not exported.
15311 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15312 (fatal_error_code, fatal_error_signal_hook, standard_args):
15313 Now static.
15314 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15315 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15316 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15317 * lisp.h (fatal_error_signal_hook): Remove decl.
15318 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15319
15320 * editfns.c: Move a (normally-unused) function to its only use.
15321 * editfns.c, lisp.h (get_operating_system_release): Remove.
15322 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15323 worth the hassle of breaking this out.
15324
15325 * xterm.c: Make symbols static if they're not exported.
15326 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15327 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15328 (x_destroy_window, x_delete_display):
15329 Now static.
15330 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15331 (x_mouse_leave): Remove; unused.
15332 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15333 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15334 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15335 Remove decls.
15336 (x_mouse_leave): Declare only if WINDOWSNT.
15337 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15338 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15339 USE_X_TOOLKIT.
15340
15341 * ftxfont.c: Make symbols static if they're not exported.
15342 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15343 HAVE_FREETYPE.
15344 * font.h (ftxfont_driver): Likewise.
15345
15346 * xfns.c: Make symbols static if they're not exported.
15347 (x_last_font_name, x_display_info_for_name):
15348 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15349 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15350 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15351 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15352 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15353 (last_show_tip_args): Now static.
15354 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15355 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15356 (x_screen_planes): Remove; unused.
15357 * dispextern.h (x_screen_planes): Remove decl.
15358
15359 * dispnew.c: Make symbols static if they're not exported.
15360 * dispextern.h (redraw_garbaged_frames, scrolling):
15361 (increment_row_positions): Remove.
15362 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15363 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15364 Now static.
15365 (redraw_garbaged_frames): Remove; unused.
15366
15367 * xfaces.c: Make symbols static if they're not exported.
15368 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15369 Remove decls.
15370 * xterm.h (defined_color): Remove decls.
15371 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15372 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15373 (menu_face_changed_default, defined_color, free_realized_face):
15374 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15375 (ascii_face_of_lisp_face): Remove; unused.
15376
15377 * xdisp.c: Make symbols static if they're not exported.
15378 * dispextern.h (scratch_glyph_row, window_box_edges):
15379 (glyph_to_pixel_coords, set_cursor_from_row):
15380 (get_next_display_element, set_iterator_to_next):
15381 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15382 (show_mouse_face): Remove decls
15383 * frame.h (message_buf_print): Likewise.
15384 * lisp.h (pop_message, set_message, check_point_in_composition):
15385 Likewise.
15386 * xterm.h (set_vertical_scroll_bar): Likewise.
15387 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15388 (message_buf_print, scratch_glyph_row, displayed_buffer):
15389 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15390 (get_next_display_element, show_mouse_face, window_box_edges):
15391 (frame_to_window_pixel_xy, check_point_in_composition):
15392 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15393 (glyph_to_pixel_coords): Remove; unused.
15394
15395 * dired.c (file_name_completion): Now static.
15396
15397 * dbusbind.c (xd_in_read_queued_messages): Now static.
15398
15399 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15400 * data.c (circular_list_error): Remove.
15401
15402 * commands.h (last_point_position, last_point_position_buffer):
15403 (last_point_position_window): Remove decls.
15404 * keyboard.c: Make these variables static.
15405
15406 * coding.h (coding, code_convert_region, encode_coding_gap):
15407 Remove decls.
15408 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15409 (iso_code_class, detect_coding, code_convert_region): Now static.
15410 (encode_coding_gap): Remove; unused.
15411
15412 * chartab.c (chartab_chars, chartab_bits): Now static.
15413
15414 * charset.h (charset_iso_8859_1): Remove decl.
15415 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15416 Now static.
15417
15418 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15419 * ccl.c (Vccl_program_table): Now static.
15420 (check_ccl_update): Remove; unused.
15421
15422 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15423 * category.h: ... from here.
15424 * category.c (check_category_table, set_category_set): Now static.
15425
15426 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15427 * lisp.h: Remove these decls.
15428
15429 * buffer.c (buffer_count): Remove unused var.
15430
15431 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15432 so that it's not optimized away.
15433 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15434 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15435 exported only to the debugger.
15436
15437 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15438 * atimer.h (run_all_atimers): Remove; not exported.
15439
15440 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15441 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15442 was inaccessible from Lisp.
15443 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15444 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15445
15446 alloc.c: Import and export fewer symbols, and remove unused items.
15447 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15448 is defined.
15449 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15450 it's not optimized away by whole-program optimization.
15451 (message_enable_multibyte, free_misc): Remove.
15452 (catchlist, handlerlist, mark_backtrace):
15453 Declare only if BYTE_MARK_STACK.
15454 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15455 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15456 (message_enable_multibyte): Remove decl.
15457 (free_misc, interval_free_list, float_block, float_block_index):
15458 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15459 (cons_free_list, last_marked_index):
15460 Now static.
15461 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15462 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15463 (mark_backtrace): Define only if BYTE_MARK_STACK.
15464 * xdisp.c (message_enable_multibyte): Now static.
15465
15466 Declare Lisp_Object Q* variables to be 'static' if not exported.
15467 This makes it easier for human readers (and static analyzers)
15468 to see whether these variables are used from other modules.
15469 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15470 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15471 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15472 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15473 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15474 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15475 * xmenu.c, xselect.c:
15476 Declare Q* vars static if they are not used in other modules.
15477 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15478 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15479 Remove decls of unexported vars.
15480 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15481
15482 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15483
15484 Make Emacs functions such as Fatom 'static' by default.
15485 This makes it easier for human readers (and static analyzers)
15486 to see whether these functions can be called from other modules.
15487 DEFUN now defines a static function. To make the function external
15488 so that it can be used in other C modules, use the new macro DEFUE.
15489 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15490 (Finit_image_library):
15491 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15492 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15493 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15494 Remove decls, since these functions are now static.
15495 (Funintern, Fget_internal_run_time): New decls, since these functions
15496 were already external.
15497
15498 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15499 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15500 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15501 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15502 * keyboard.c, keymap.c, lread.c:
15503 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15504 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15505 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15506 Mark functions with DEFUE instead of DEFUN,
15507 if they are used in other modules.
15508 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15509 decls for now-static functions.
15510 * buffer.h (Fdelete_overlay): Remove decl.
15511 * callproc.c (Fgetenv_internal): Mark as internal.
15512 * composite.c (Fremove_list_of_text_properties): Remove decl.
15513 (Fcomposition_get_gstring): New forward static decl.
15514 * composite.h (Fcomposite_get_gstring): Remove decl.
15515 * dired.c (Ffile_attributes): New forward static decl.
15516 * doc.c (Fdocumntation_property): New forward static decl.
15517 * eval.c (Ffetch_bytecode): New forward static decl.
15518 (Funintern): Remove extern decl; now in .h file where it belongs.
15519 * fileio.c (Fmake_symbolic_link): New forward static decl.
15520 * image.c (Finit_image_library): New forward static decl.
15521 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15522 * intervals.h (Fprevious_property_change):
15523 (Fremove_list_of_text_properties): Remove decls.
15524 * keyboard.c (Fthis_command_keys): Remove decl.
15525 (Fcommand_execute): New forward static decl.
15526 * keymap.c (Flookup_key): New forward static decl.
15527 (Fcopy_keymap): Now static.
15528 * keymap.h (Flookup_key): Remove decl.
15529 * process.c (Fget_process): New forward static decl.
15530 (Fprocess_datagram_address): Mark as internal.
15531 * syntax.c (Fsyntax_table_p): New forward static decl.
15532 (skip_chars): Remove duplicate decl.
15533 * textprop.c (Fprevious_property_change): New forward static decl.
15534 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15535 Now internal.
15536 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15537 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15538
15539 * editfns.c (Fformat): Remove unreachable code.
15540
15541 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15542
15543 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15544 change. (Bug#8496)
15545
15546 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15547
15548 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15549 when at ZV. (Bug#8487)
15550
15551 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15552
15553 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15554 (Bug#8437)
15555 * keyboard.c (parse_tool_bar_item): Likewise.
15556 * sound.c (sound_cleanup, alsa_close): Likewise.
15557 * termcap.c (tgetent): Likewise.
15558 * xfns.c (x_default_font_parameter): Likewise.
15559 * xsettings.c (read_and_apply_settings): Likewise.
15560
15561 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15562 (overrun_check_free): Protoize.
15563
15564 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15565
15566 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15567 since callers should never pass a negative size.
15568 Change the signature to match that of plain 'read' and 'write'; see
15569 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15570 * lisp.h: Update prototypes of emacs_write and emacs_read.
15571
15572 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15573
15574 * xdisp.c (redisplay_window): Don't try to determine the character
15575 position of the scroll margin if the window start point w->startp
15576 is outside the buffer's accessible region. (Bug#8468)
15577
15578 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15579
15580 Fix write-region and its subroutines for buffers > 2GB.
15581 * fileio.c (a_write, e_write): Modify declaration of arguments and
15582 local variables to support buffers larger than 2GB.
15583 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15584
15585 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15586 argument, local variables, and return value.
15587
15588 * lisp.h: Update prototypes of emacs_write and emacs_read.
15589
15590 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15591
15592 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15593
15594 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15595
15596 Fix more problems found by GCC 4.6.0's static checks.
15597
15598 * xdisp.c (vmessage): Use a better test for character truncation.
15599
15600 * charset.c (load_charset_map): <, not <=, for optimization,
15601 and to avoid potential problems with integer overflow.
15602 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15603 * casetab.c (set_identity, shuffle): Likewise.
15604 * editfns.c (Fformat): Likewise.
15605 * syntax.c (skip_chars): Likewise.
15606
15607 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15608 This also lets GCC 4.6.0 generate slightly better loop code.
15609
15610 * callint.c (Fcall_interactively): <, not <=, for optimization.
15611 (Fcall_interactively): Count the number of arguments produced,
15612 not the number of arguments given. This is simpler and lets GCC
15613 4.6.0 generate slightly better code.
15614
15615 * ftfont.c: Distingish more carefully between FcChar8 and char.
15616 The previous code passed unsigned char * to a functions like
15617 strlen and xstrcasecmp that expect char *, which does not
15618 conform to the C standard.
15619 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15620 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15621 char * when the C standard requires it.
15622
15623 * keyboard.c (read_char): Remove unused var.
15624
15625 * eval.c: Port to Windows vsnprintf (Bug#8435).
15626 Include <limits.h>.
15627 (SIZE_MAX): Define if the headers do not.
15628 (verror): Do not give up if vsnprintf returns a negative count.
15629 Instead, grow the buffer. This ports to Windows vsnprintf, which
15630 does not conform to C99. Problem reported by Eli Zaretskii.
15631 Also, simplify the allocation scheme, by avoiding the need for
15632 calling realloc, and removing the ALLOCATED variable.
15633
15634 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15635
15636 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15637 But keep the doprint source code for now, as we might revamp it
15638 and use it again (Bug#8435).
15639 * lisp.h (doprnt): Remove.
15640 * Makefile.in (base_obj): Remove doprnt.o.
15641 * deps.mk (doprnt.o): Remove.
15642
15643 error: Print 32- and 64-bit integers portably (Bug#8435).
15644 Without this change, on typical 64-bit hosts error ("...%d...", N)
15645 was used to print both 32- and 64-bit integers N, which relied on
15646 undefined behavior.
15647 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15648 * lisp.h (error, verror): Mark as printf-like functions.
15649 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15650 Report overflow in size calculations when allocating printf buffer.
15651 Do not truncate output string at its first null byte.
15652 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15653 Truncate the output at a character boundary, since vsnprintf does not
15654 do that.
15655 * charset.c (check_iso_charset_parameter): Convert internal
15656 character to string before calling 'error', since %c now has the
15657 printf meaning.
15658 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15659 overflow when computing char to be passed to 'error'. Do not
15660 pass Lisp_Object to 'error'; pass the integer instead.
15661 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15662 formatted with plain %d.
15663
15664 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15665
15666 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15667
15668 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15669
15670 * xterm.c (x_catch_errors): Remove duplicate declaration.
15671
15672 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15673
15674 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15675
15676 2011-04-10 Jim Meyering <meyering@redhat.com>
15677
15678 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15679 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15680 return ssize_t not "int", and use size_t as the buffer length.
15681 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15682 * gnutls.h: Update declarations.
15683 * process.c (read_process_output): Use ssize_t, to match.
15684 (send_process): Likewise.
15685
15686 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15687
15688 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15689
15690 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15691
15692 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15693 Use unsigned char, to match FcChar8 type definition.
15694
15695 * xterm.c (handle_one_xevent):
15696 * xmenu.c (create_and_show_popup_menu):
15697 * xselect.c (x_decline_selection_request)
15698 (x_reply_selection_request): Avoid type-punned deref of X events.
15699
15700 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15701
15702 Fix some uses of `int' instead of EMACS_INT.
15703 * search.c (string_match_1, fast_string_match)
15704 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15705 (scan_buffer, find_next_newline_no_quit)
15706 (find_before_next_newline, search_command, Freplace_match)
15707 (Fmatch_data): Make some `int' variables be EMACS_INT.
15708
15709 * xdisp.c (display_count_lines): 3rd argument and return value now
15710 EMACS_INT. All callers changed.
15711 (pint2hrstr): Last argument is now EMACS_INT.
15712
15713 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15714 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15715 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15716 (decode_coding_utf_16, decode_coding_emacs_mule)
15717 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15718 (decode_coding_ccl, decode_coding_charset)
15719 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15720 (decode_coding_iso_2022, decode_coding_emacs_mule)
15721 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15722 <char_offset, last_offset>: Declare EMACS_INT.
15723 (encode_coding_utf_8, encode_coding_utf_16)
15724 (encode_coding_emacs_mule, encode_invocation_designation)
15725 (encode_designation_at_bol, encode_coding_iso_2022)
15726 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15727 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15728 Declare EMACS_INT.
15729 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15730 (encode_invocation_designation): Last argument P_NCHARS is now
15731 EMACS_INT.
15732 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15733 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15734
15735 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15736 All users changed.
15737
15738 * ccl.c (Fccl_execute_on_string): Declare some variables
15739 EMACS_INT.
15740
15741 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15742
15743 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15744
15745 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15746
15747 * process.c (Fformat_network_address): Doc fix.
15748
15749 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15750
15751 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15752
15753 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15754
15755 * keyboard.c (read_char): Call Lisp function help-form-show,
15756 instead of using internal_with_output_to_temp_buffer.
15757 (Qhelp_form_show): New var.
15758 (syms_of_keyboard): Use DEFSYM macro.
15759
15760 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15761
15762 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15763
15764 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15765
15766 * process.c (Flist_processes): Remove to Lisp.
15767 (list_processes_1): Delete.
15768
15769 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15770
15771 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15772
15773 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15774
15775 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15776
15777 Fix more problems found by GCC 4.6.0's static checks.
15778
15779 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15780
15781 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15782
15783 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15784
15785 * xdisp.c (vmessage): Mark as a printf-like function.
15786
15787 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15788
15789 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15790
15791 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15792 printf-like functions.
15793 (tiff_load): Add casts to remove these marks before passing them
15794 to system-supplied API.
15795
15796 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15797
15798 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15799 This avoids several warnings with gcc -Wstrict-overflow.
15800 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15801 directly, rather than having caller test rule sign. This avoids
15802 some unnecessary tests.
15803 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15804 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15805 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15806
15807 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15808 (xfont_open): Avoid unnecessary tests.
15809
15810 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15811
15812 * composite.h, composite.c (composition_gstring_put_cache):
15813 Use EMACS_INT, not int, for length.
15814
15815 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15816 breaking out part of COMPOSITION_DECODE_RULE.
15817 (COMPOSITION_DECODE_RULE): Use it.
15818 * composite.c (get_composition_id): Remove unused local vars,
15819 by using the new macro.
15820
15821 * textprop.c (set_text_properties_1): Change while to do-while,
15822 since the condition is always true at first.
15823
15824 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15825 (interval_deletion_adjustment): Return unsigned value.
15826 All uses changed.
15827
15828 * process.c (list_processes_1, create_pty, read_process_output):
15829 (exec_sentinel): Remove vars that were set but not used.
15830 (create_pty): Remove unnecessary "volatile"s.
15831 (Fnetwork_interface_info): Avoid possibility of int overflow.
15832 (read_process_output): Do adaptive read buffering even if carryover.
15833 (read_process_output): Simplify nbytes computation if buffered.
15834
15835 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15836
15837 * syntax.c (scan_words): Remove var that was set but not used.
15838 (update_syntax_table): Use unsigned instead of int.
15839
15840 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15841 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15842 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15843
15844 * print.c (print_error_message): Avoid int overflow.
15845
15846 * font.c (font_list_entities): Redo for clarity,
15847 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15848
15849 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15850 (font_score): Avoid potential overflow in diff calculation.
15851
15852 * fns.c (substring_both): Remove var that is set but not used.
15853 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15854
15855 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15856
15857 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15858 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15859 can always succeed if overflow has undefined behavior.
15860
15861 * search.c (boyer_moore, wordify): Remove vars set but not used.
15862 (wordify): Omit three unnecessary tests.
15863
15864 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15865 All callers changed. This avoids the need for an unused var.
15866
15867 * casefiddle.c (casify_region): Remove var that is set but not used.
15868
15869 * dired.c (file_name_completion): Remove var that is set but not used.
15870
15871 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15872
15873 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15874 (Finsert_file_contents): Remove unnecessary code checking fd.
15875
15876 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15877 Check for integer overflow on size calculations.
15878
15879 * buffer.c (Fprevious_overlay_change): Remove var that is set
15880 but not used.
15881
15882 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15883 Remove vars that are set but not used.
15884 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15885 (timer_check_2): Mark vars as initialized.
15886
15887 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15888
15889 * image.c (lookup_image): Remove var that is set but not used.
15890 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15891
15892 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15893 that are set but not used.
15894
15895 * xfns.c (make_invisible_cursor): Don't return garbage
15896 if XCreateBitmapFromData fails (Bug#8410).
15897
15898 * xselect.c (x_get_local_selection, x_handle_property_notify):
15899 Remove vars that are set but not used.
15900
15901 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15902 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15903
15904 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15905 Remove var that is set but not used.
15906 (scroll_bar_windows_size): Now size_t, not int.
15907 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15908 Check for overflow.
15909
15910 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15911 (map_tty_color) [!defined MSDOS]: Likewise.
15912
15913 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15914
15915 * coding.c: Remove vars that are set but not used.
15916 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15917 All callers changed.
15918 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15919 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15920 (decode_coding_charset): Remove vars that are set but not used.
15921
15922 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15923 that is set but not used.
15924
15925 * print.c (print_object): Remove var that is set but not used.
15926
15927 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15928 The gnulib version avoids calling malloc in the usual case,
15929 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15930 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15931 * filelock.c (current_lock_owner): Likewise.
15932 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15933 * sysdep.c: Include allocator.h, careadlinkat.h.
15934 (emacs_no_realloc_allocator): New static constant.
15935 (emacs_readlink): New function.
15936 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15937 ../lib/careadlinkat.h.
15938
15939 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15940
15941 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15942 first non-nil return value).
15943
15944 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15945
15946 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15947 if not defined (Bug#8403).
15948
15949 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15950
15951 * xdisp.c (display_count_lines): Remove parameter `start',
15952 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15953 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15954 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15955 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15956 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15957 and thereabouts. All callers changed.
15958 (get_per_char_metric): Remove parameter `f', unused since
15959 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15960
15961 2011-04-02 Jim Meyering <meyering@redhat.com>
15962
15963 do not dereference NULL upon failed strdup
15964 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15965 (ns_get_family): Likewise.
15966
15967 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15968
15969 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15970
15971 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15972
15973 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15974 later (Bug#8403).
15975
15976 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15977
15978 Add lexical binding.
15979
15980 * window.c (Ftemp_output_buffer_show): New fun.
15981 (Fsave_window_excursion):
15982 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15983
15984 * lread.c (lisp_file_lexically_bound_p): New function.
15985 (Fload): Bind Qlexical_binding.
15986 (readevalloop): Remove `evalfun' arg.
15987 Bind Qinternal_interpreter_environment.
15988 (Feval_buffer): Bind Qlexical_binding.
15989 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15990 Mark as dynamic.
15991 (syms_of_lread): Declare `lexical-binding'.
15992
15993 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15994
15995 * keyboard.c (eval_dyn): New fun.
15996 (menu_item_eval_property): Use it.
15997
15998 * image.c (parse_image_spec): Use Ffunctionp.
15999
16000 * fns.c (concat, mapcar1): Accept byte-code-functions.
16001
16002 * eval.c (Fsetq): Handle lexical vars.
16003 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16004 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16005 (FletX, Flet): Obey lexical binding.
16006 (Fcommandp): Handle closures.
16007 (Feval): New `lexical' arg.
16008 (eval_sub): New function extracted from Feval. Use it almost
16009 everywhere where Feval was used. Look up vars in lexical env.
16010 Handle closures.
16011 (Ffunctionp): Move from subr.el.
16012 (Ffuncall): Handle closures.
16013 (apply_lambda): Remove `eval_flags'.
16014 (funcall_lambda): Handle closures and new byte-code-functions.
16015 (Fspecial_variable_p): New function.
16016 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16017 but without exporting it to Lisp.
16018
16019 * doc.c (Fdocumentation, store_function_docstring):
16020 * data.c (Finteractive_form): Handle closures.
16021
16022 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16023 interactive spec.
16024
16025 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16026 New byte-codes.
16027 (exec_byte_code): New function extracted from Fbyte_code to handle new
16028 calling convention for byte-code-functions. Add new byte-codes.
16029
16030 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16031
16032 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16033
16034 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16035
16036 * xdisp.c (redisplay_internal): Fix prototype.
16037
16038 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16039
16040 * xdisp.c (SCROLL_LIMIT): New macro.
16041 (try_scrolling): Use it when setting scroll_limit.
16042 Limit scrolling to 100 screen lines.
16043 (redisplay_window): Even when falling back on "recentering",
16044 position point in the window according to scroll-conservatively,
16045 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16046
16047 (try_scrolling): When point is above the window, allow searching
16048 as far as scroll_max, or one screenful, to compute vertical
16049 distance from PT to the scroll margin position. This prevents
16050 try_scrolling from unnecessarily failing when
16051 scroll-conservatively is set to a value slightly larger than the
16052 window height. Clean up the case of PT below the margin at bottom
16053 of window: scroll_max can no longer be INT_MAX. When aggressive
16054 scrolling is in use, don't let point enter the opposite scroll
16055 margin as result of the scroll.
16056 (syms_of_xdisp) <scroll-conservatively>: Document the
16057 threshold of 100 lines for never-recentering scrolling.
16058
16059 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16060
16061 * dispextern.h (move_it_by_lines):
16062 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16063 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16064 (message_log_check_duplicate): Remove parameters `prev_bol' and
16065 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16066 (redisplay_internal): Remove parameter `preserve_echo_area',
16067 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16068
16069 * indent.c (Fvertical_motion):
16070 * window.c (window_scroll_pixel_based, Frecenter):
16071 Don't pass `need_y_p' to `move_it_by_lines'.
16072
16073 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16074
16075 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16076 steal a few bits to be more compact.
16077 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16078 Remove unneeded casts.
16079
16080 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16081
16082 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16083
16084 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16085 binding" message (bug#7967).
16086
16087 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16088
16089 Fix more problems found by GCC 4.6.0's static checks.
16090
16091 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16092 Remove unused local var.
16093
16094 * editfns.c (Fmessage_box): Remove unused local var.
16095
16096 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16097 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16098 Omit unused local vars.
16099 * window.c (shrink_windows): Omit unused local var.
16100 * menu.c (digest_single_submenu): Omit unused local var.
16101 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16102 Omit unused local var.
16103
16104 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16105 Don't assume string length fits in int.
16106 (keyremap_step, read_key_sequence): Use size_t for sizes.
16107 (read_key_sequence): Don't check last_real_key_start redundantly.
16108
16109 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16110 instead of alloca (Bug#8344).
16111
16112 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16113 (Fbacktrace_frame): Don't assume nframes fits in int.
16114
16115 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16116
16117 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16118 concerns.
16119
16120 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16121
16122 * cm.c (calccost): Turn while-do into do-while, for clarity.
16123
16124 * keyboard.c (syms_of_keyboard): Use the same style as later
16125 in this function when indexing through an array. This also
16126 works around GCC bug 48267.
16127
16128 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16129
16130 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16131
16132 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16133 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16134
16135 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16136 This avoids undefined behavior on integer overflow, and is a bit
16137 more convenient anyway since it is compared to a size_t variable.
16138
16139 Variadic C functions now count arguments with size_t, not int.
16140 This avoids an unnecessary limitation on 64-bit machines, which
16141 caused (substring ...) to crash on large vectors (Bug#8344).
16142 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16143 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16144 All variadic functions and their callers changed accordingly.
16145 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16146 * data.c (arith_driver, float_arith_driver): Likewise.
16147 * editfns.c (general_insert_function): Likewise.
16148 * eval.c (struct backtrace.nargs, interactive_p)
16149 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16150 (funcall_lambda, mark_backtrace): Likewise.
16151 * fns.c (concat): Likewise.
16152 * frame.c (x_set_frame_parameters): Likewise.
16153 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16154 0 if not found, not -1. All callers changed.
16155
16156 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16157 (stack_copy_size): Now size_t, not int.
16158 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16159
16160 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16161
16162 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16163 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16164 All callers changed.
16165
16166 * lisp.h (multibyte_char_to_unibyte):
16167 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16168 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16169 * character.h (CHAR_TO_BYTE8):
16170 * cmds.c (internal_self_insert):
16171 * editfns.c (general_insert_function):
16172 * keymap.c (push_key_description):
16173 * search.c (Freplace_match):
16174 * xdisp.c (message_dolog, set_message_1): All callers changed.
16175
16176 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16177
16178 * keyboard.c (safe_run_hook_funcall): New function.
16179 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16180 don't set the hook to nil, but remove the offending function instead.
16181 (Qcommand_hook_internal): Remove, unused.
16182 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16183 Vcommand_hook_internal.
16184
16185 * eval.c (enum run_hooks_condition): Remove.
16186 (funcall_nil, funcall_not): New functions.
16187 (run_hook_with_args): Call each function through a `funcall' argument.
16188 Remove `cond' argument, now redundant.
16189 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16190 (Frun_hook_with_args_until_failure): Adjust accordingly.
16191 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16192
16193 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16194
16195 * dispextern.h (string_buffer_position): Remove declaration.
16196
16197 * print.c (strout): Remove parameter `multibyte', unused since
16198 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16199
16200 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16201 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16202 All callers changed.
16203
16204 * w32.c (_wsa_errlist): Use braces for struct initializers.
16205
16206 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16207 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16208 All callers changed.
16209 (string_buffer_position): Likewise. Also, make static (it's never
16210 used outside xdisp.c).
16211 (cursor_row_p): Remove parameter `w', unused since
16212 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16213 (decode_mode_spec): Remove parameter `precision', introduced during
16214 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16215 All callers changed.
16216
16217 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16218
16219 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16220
16221 2011-03-27 Anders Lindgren <andlind@gmail.com>
16222
16223 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16224 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16225 (ns_update_auto_hide_menu_bar): New functions.
16226 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16227 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16228 ns_constrain_all_frames.
16229 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16230 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16231
16232 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16233
16234 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16235
16236 2011-03-27 Glenn Morris <rgm@gnu.org>
16237
16238 * syssignal.h: Replace RETSIGTYPE with void.
16239 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16240 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16241 Replace SIGTYPE with void everywhere.
16242 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16243 * s/template.h (SIGTYPE): Remove commented out definition.
16244
16245 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16246
16247 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16248 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16249
16250 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16251
16252 * w32.c (read_unc_volume): Use parameter `henum', instead of
16253 global variable `wget_enum_handle'.
16254
16255 * keymap.c (describe_vector): Remove parameters `indices' and
16256 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16257 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16258
16259 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16260
16261 * keyboard.c (timer_check): Remove parameter `do_it_now',
16262 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16263 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16264 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16265
16266 * keyboard.c (read_char):
16267 * w32menu.c (w32_menu_display_help):
16268 * xmenu.c (show_help_event, menu_help_callback):
16269 Adjust calls to `show_help_echo'.
16270
16271 * gtkutil.c (xg_maybe_add_timer):
16272 * keyboard.c (readable_events):
16273 * process.c (wait_reading_process_output):
16274 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16275
16276 * insdel.c (adjust_markers_gap_motion):
16277 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16278 (gap_left, gap_right): Don't call it.
16279
16280 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16281
16282 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16283 incurred during fontification.
16284
16285 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16286
16287 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16288 (DEFVAR_PER_BUFFER): Don't pass it.
16289
16290 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16291 (scrolling_window): Don't pass it.
16292
16293 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16294
16295 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16296
16297 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16298 and `suffix'.
16299 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16300 of variables specific to SELinux and computation of `encoded_absname'.
16301
16302 * image.c (XPutPixel): Remove unused variable `height'.
16303
16304 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16305
16306 * unexw32.c (get_section_info): Remove unused variable `section'.
16307
16308 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16309 (system_process_attributes): Remove unused variable `sess'.
16310 (sys_read): Remove unused variable `err'.
16311
16312 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16313 (w32_wnd_proc): Remove unused variable `isdead'.
16314 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16315 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16316 (x_create_tip_frame): Remove unused variable `tem'.
16317
16318 * w32inevt.c (w32_console_read_socket):
16319 Remove unused variable `no_events'.
16320
16321 * w32term.c (x_draw_composite_glyph_string_foreground):
16322 Remove unused variable `width'.
16323
16324 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16325
16326 * w32term.c (x_set_glyph_string_clipping):
16327 Don't pass uninitialized region to CombineRgn.
16328
16329 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16330
16331 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16332 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16333 (Fx_close_connection): Remove unused variable `i'.
16334
16335 * w32font.c (w32font_draw): Return number of glyphs.
16336 (w32font_open_internal): Remove unused variable `i'.
16337 (w32font_driver): Add missing initializer.
16338
16339 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16340 (fill_in_menu): Remove unused variable `items_added'.
16341
16342 * w32term.c (last_mouse_press_frame): Remove static global variable.
16343 (w32_clip_to_row): Remove unused variable `f'.
16344 (x_delete_terminal): Remove unused variable `i'.
16345
16346 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16347 (NOTHING): Remove unused static global variable.
16348 (uniscribe_check_otf): Remove unused variable `table'.
16349 (uniscribe_font_driver): Add missing initializers.
16350
16351 2011-03-23 Julien Danjou <julien@danjou.info>
16352
16353 * term.c (Fsuspend_tty, Fresume_tty):
16354 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16355 * window.c (temp_output_buffer_show):
16356 * insdel.c (signal_before_change):
16357 * frame.c (Fhandle_switch_frame):
16358 * fileio.c (Fdo_auto_save):
16359 * emacs.c (Fkill_emacs):
16360 * editfns.c (save_excursion_restore):
16361 * cmds.c (internal_self_insert):
16362 * callint.c (Fcall_interactively):
16363 * buffer.c (Fkill_all_local_variables):
16364 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16365 Use Frun_hooks.
16366 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16367 unconditionally since it does the check itself.
16368
16369 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16370
16371 Fix more problems found by GCC 4.5.2's static checks.
16372
16373 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16374 the first time through the loop, since we know p0 < p1 then.
16375 This also avoids a gcc -Wstrict-overflow warning.
16376
16377 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16378 leading to a memory leak, possible in functions like
16379 load_charset_map_from_file that can allocate an unbounded number
16380 of objects (Bug#8318).
16381
16382 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16383 that could (at least in theory) be that large.
16384
16385 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16386 This is less likely to overflow, and avoids undefined behavior if
16387 overflow does occur. All callers changed. Use strtoul to scan
16388 for the unsigned long integer.
16389 (pint2hrstr): Simplify and tune code slightly.
16390 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16391
16392 * scroll.c (do_scrolling): Work around GCC bug 48228.
16393 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16394
16395 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16396 This also avoids a warning with gcc -Wstrict-overflow.
16397 (validate_x_resource_name): Simplify count usage.
16398 This also avoids a warning with gcc -Wstrict-overflow.
16399
16400 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16401 fail (Bug#8306).
16402
16403 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16404
16405 * process.c (Fmake_network_process): Use socklen_t, not int,
16406 where POSIX says socklen_t is required in portable programs.
16407 This fixes a porting bug on hosts like 64-bit HP-UX, where
16408 socklen_t is wider than int (Bug#8277).
16409 (Fmake_network_process, server_accept_connection):
16410 (wait_reading_process_output, read_process_output):
16411 Likewise.
16412
16413 * process.c: Rename or move locals to avoid shadowing.
16414 (list_processes_1, Fmake_network_process):
16415 (read_process_output_error_handler, exec_sentinel_error_handler):
16416 Rename or move locals.
16417 (Fmake_network_process): Define label "retry_connect" only if needed.
16418 (Fnetwork_interface_info): Fix pointer signedness.
16419 (process_send_signal): Add cast to avoid pointer signedness problem.
16420 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16421 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16422
16423 Make tparam.h and terminfo.c consistent.
16424 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16425 Include tparam.h instead, since it declares them.
16426 * cm.h (PC): Remove extern decl; tparam.h now does this.
16427 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16428 * terminfo.c: Include tparam.h, to check interfaces.
16429 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16430 (tparam): Adjust signature to match interface in tparam.h;
16431 this removes some undefined behavior. Check that outstring and len
16432 are zero, which they always are with Emacs.
16433 * tparam.h (PC, BC, UP): New extern decls.
16434
16435 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16436 (xftfont_open): Rename locals to avoid shadowing.
16437
16438 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16439 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16440 (OTF_TAG_SYM): Omit macro if not needed.
16441 (ftfont_list): Remove unused local.
16442 (get_adstyle_property, ftfont_pattern_entity):
16443 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16444 Rename locals to avoid shadowing.
16445
16446 * xfont.c (xfont_list_family): Mark var as initialized.
16447
16448 * xml.c (make_dom): Now static.
16449
16450 * composite.c (composition_compute_stop_pos): Rename local to
16451 avoid shadowing.
16452 (composition_reseat_it): Remove unused locals.
16453 (find_automatic_composition, composition_adjust_point): Likewise.
16454 (composition_update_it): Mark var as initialized.
16455 (find_automatic_composition): Mark vars as initialized,
16456 with a FIXME (Bug#8290).
16457
16458 character.h: Rename locals to avoid shadowing.
16459 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16460 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16461 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16462 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16463 to avoid shadowing.
16464
16465 * textprop.c (property_change_between_p): Remove; unused.
16466
16467 * intervals.c (interval_start_pos): Now static.
16468
16469 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16470
16471 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16472 Rename locals to avoid shadowing.
16473
16474 * sound.c (wav_play, au_play, Fplay_sound_internal):
16475 Fix pointer signedness.
16476 (alsa_choose_format): Remove unused local var.
16477 (wav_play): Initialize a variable to 0, to prevent undefined
16478 behavior (Bug#8278).
16479
16480 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16481
16482 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16483
16484 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16485 clobbering (Bug#8298).
16486 * sysdep.c (sys_subshell): Likewise.
16487 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16488
16489 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16490 This should get cleaned up, so that child_setup has the
16491 same signature on all platforms.
16492
16493 * callproc.c (call_process_cleanup): Now static.
16494 (relocate_fd): Rename locals to avoid shadowing.
16495
16496 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16497
16498 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16499 not to be necessary, and produces flickering.
16500
16501 2011-03-20 Glenn Morris <rgm@gnu.org>
16502
16503 * config.in: Remove file.
16504
16505 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16506
16507 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16508 are now in src/globals.h.
16509 (syms_of_minibuf): Remove spurious & from previous change.
16510
16511 2011-03-20 Leo Liu <sdl.web@gmail.com>
16512
16513 * minibuf.c (completing-read-function): New variable.
16514 (completing-read-default): Rename from completing-read.
16515 (completing-read): Call completing-read-function.
16516
16517 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16518
16519 * xfaces.c (Fx_load_color_file):
16520 Read color file from absolute filename (bug#8250).
16521
16522 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16523
16524 * makefile.w32-in: Update dependencies.
16525
16526 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16527
16528 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16529
16530 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16531
16532 Fix more problems found by GCC 4.5.2's static checks.
16533
16534 * process.c (make_serial_process_unwind, send_process_trap):
16535 (sigchld_handler): Now static.
16536
16537 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16538 That way, the code declares only the vars that it needs.
16539 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16540 * s/cygwin.h (PTY_ITERATION): Likewise.
16541 * s/darwin.h (PTY_ITERATION): Likewise.
16542 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16543
16544 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16545 * process.c (allocate_pty): Don't declare stb unless it's needed.
16546
16547 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16548 (CONSTANTLIM): Remove; unused.
16549 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16550 Define only if needed.
16551
16552 * unexelf.c (unexec): Name an expression,
16553 to avoid gcc -Wbad-function-cast warning.
16554 Use a different way to cause a compilation error if anyone uses
16555 n rather than nn, a way that does not involve shadowing.
16556 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16557
16558 * deps.mk (unexalpha.o): Remove; unused.
16559
16560 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16561 * unexec.h: New file.
16562 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16563 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16564 Depend on unexec.h.
16565 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16566 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16567 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16568 Change as necessary to match prototype in unexec.h.
16569
16570 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16571 shadowing.
16572 (back_comment, skip_chars): Mark vars as initialized.
16573
16574 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16575 Rename locals to avoid shadowing.
16576
16577 * lread.c (read1): Rewrite so as not to use empty "else".
16578 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16579
16580 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16581
16582 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16583 warning when compiling print.c.
16584
16585 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16586 instead of using an uninitialized var.
16587 (font_sort_entities): Mark var as initialized.
16588
16589 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16590
16591 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16592 pointers to constants.
16593 (font_parse_fcname): Remove unused vars.
16594 (font_delete_unmatched): Now static.
16595 (font_get_spec): Remove; unused.
16596 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16597 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16598 Rename or move locals to avoid shadowing.
16599
16600 * fns.c (require_nesting_list, require_unwind): Now static.
16601 (Ffillarray): Rename locals to avoid shadowing.
16602
16603 * floatfns.c (domain_error2): Define only if needed.
16604 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16605
16606 * alloc.c (mark_backtrace): Move decl from here ...
16607 * lisp.h: ... to here, so that it can be checked.
16608
16609 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16610 (Fdefvar): Rewrite so as not to use empty "else".
16611 (lisp_indirect_variable): Name an expression,
16612 to avoid gcc -Wbad-function-cast warning.
16613 (Fdefvar): Rename locals to avoid shadowing.
16614
16615 * callint.c (quotify_arg, quotify_args): Now static.
16616 (Fcall_interactively): Rename locals to avoid shadowing.
16617 Use const pointer when appropriate.
16618
16619 * lisp.h (get_system_name, get_operating_system_release):
16620 Move decls here, to check interfaces.
16621 * process.c (get_operating_system_release): Move decl to lisp.h.
16622 * xrdb.c (get_system_name): Likewise.
16623 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16624 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16625 some of which prompt warnings from gcc -Wbad-function-cast.
16626 (Fformat_time_string, Fencode_time, Finsert_char):
16627 (Ftranslate_region_internal, Fformat):
16628 Rename or remove local vars to avoid shadowing.
16629 (Ftranslate_region_internal): Mark var as initialized.
16630
16631 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16632 avoid shadowing.
16633
16634 * lisp.h (eassert): Check that the argument compiles, even if
16635 ENABLE_CHECKING is not defined.
16636
16637 * data.c (Findirect_variable): Name an expression, to avoid
16638 gcc -Wbad-function-cast warning.
16639 (default_value, arithcompare, arith_driver, arith_error): Now static.
16640 (store_symval_forwarding): Rename local to avoid shadowing.
16641 (Fmake_variable_buffer_local, Fmake_local_variable):
16642 Mark variables as initialized.
16643 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16644
16645 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16646 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16647 Rename locals to avoid shadowing.
16648 (mark_stack): Move local variables into the #ifdef region where
16649 they're used.
16650 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16651 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16652 needed otherwise.
16653 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16654 (GC_STRING_CHARS): Remove; not used.
16655 (Fmemory_limit): Cast sbrk's returned value to char *.
16656
16657 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16658 avoids undefined behavior in theory.
16659
16660 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16661
16662 Use functions, not macros, for up- and down-casing (Bug#8254).
16663 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16664 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16665 to use the following functions instead of these macros.
16666 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16667 EMACS_INT, since callers assume the returned value fits in int.
16668 (upcase1): Likewise, for UPCASE_TABLE.
16669 (uppercasep, lowercasep, upcase): New static inline functions.
16670 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16671 the race-condition problem in the old DOWNCASE.
16672
16673 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16674 Rename locals to avoid shadowing.
16675 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16676 (regex_compile, re_search_2, re_match_2_internal):
16677 Remove unused local vars.
16678 (FREE_VAR): Rewrite so as not to use empty "else",
16679 which gcc can warn about.
16680 (regex_compile, re_match_2_internal): Mark locals as initialized.
16681 (RETALLOC_IF): Define only if needed.
16682 (WORDCHAR_P): Likewise. This one is never needed, but is used
16683 only in a comment talking about a compiler bug, so put inside
16684 the #if 0 of that comment.
16685 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16686 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16687 Remove; unused.
16688
16689 * search.c (boyer_moore): Rename locals to avoid shadowing.
16690 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16691 (PREV_CHAR_BOUNDARY): Likewise.
16692
16693 * search.c (simple_search): Remove unused var.
16694
16695 * dired.c (compile_pattern): Move decl from here ...
16696 * lisp.h: ... to here, so that it can be checked.
16697 (struct re_registers): New forward decl.
16698
16699 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16700
16701 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16702 All uses changed.
16703 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16704 Rename locals to avoid shadowing.
16705 (Fvertical_motion): Mark locals as initialized.
16706
16707 * casefiddle.c (casify_object, casify_region): Now static.
16708 (casify_region): Mark local as initialized.
16709
16710 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16711
16712 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16713 New macros, so that the caller can use some names other than
16714 gcpro1, gcpro2, etc.
16715 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16716 of the new macros.
16717 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16718 argument, for consistency with GCPRO2_VAR, etc: it is now the
16719 prefix of the variable, not the variable itself. All uses
16720 changed.
16721 * dired.c (directory_files_internal, file_name_completion):
16722 Rename locals to avoid shadowing.
16723
16724 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16725 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16726 dired.c's scmp function, had undefined behavior.
16727 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16728 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16729 * buffer.h: ... to here, because these macros use current_buffer,
16730 and the new implementation with inline functions needs to have
16731 current_buffer in scope now, rather than later when the macros
16732 are used.
16733 (downcase, upcase1): New static inline functions.
16734 (DOWNCASE, UPCASE1): Reimplement using these functions.
16735 This avoids undefined behavior in expressions like
16736 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16737 from race conditions in accessing the global variables
16738 case_temp1 and case_temp2.
16739 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16740 * lisp.h (case_temp1, case_temp2): Remove their decls.
16741 * character.h (ASCII_CHAR_P): Move from here ...
16742 * lisp.h: ... to here, so that the inline functions mentioned
16743 above can use them.
16744
16745 * dired.c (directory_files_internal_unwind): Now static.
16746
16747 * fileio.c (file_name_as_directory, directory_file_name):
16748 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16749 Now static.
16750 (file_name_as_directory): Use const pointers when appropriate.
16751 (Fexpand_file_name): Likewise. In particular, newdir might
16752 point at constant storage, so make it a const pointer.
16753 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16754 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16755 signedness issues.
16756 (Fset_file_times, Finsert_file_contents, auto_save_error):
16757 Rename locals to avoid shadowing.
16758
16759 * minibuf.c (choose_minibuf_frame_1): Now static.
16760 (Ftry_completion, Fall_completions): Rename or remove locals
16761 to avoid shadowing.
16762
16763 * marker.c (bytepos_to_charpos): Remove; unused.
16764
16765 * lisp.h (verify_bytepos, count_markers): New decls,
16766 so that gcc does not warn that these functions aren't declared.
16767
16768 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16769 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16770 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16771 (copy_text): Remove unused local var.
16772
16773 * filelock.c (within_one_second): Now static.
16774 (lock_file_1): Rename local to avoid shadowing.
16775
16776 * buffer.c (fix_overlays_before): Mark locals as initialized.
16777 (fix_start_end_in_overlays): Likewise. This function should be
16778 simplified by using pointers-to-pointers, but that's a different
16779 matter.
16780 (switch_to_buffer_1): Now static.
16781 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16782 (report_overlay_modification): Rename locals to avoid shadowing.
16783
16784 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16785 Fix pointer signedness issue.
16786 (sys_subshell): Mark local as volatile if checking for lint,
16787 to suppress a gcc -Wclobbered warning that does not seem to be right.
16788 (MAXPATHLEN): Define only if needed.
16789
16790 * process.c (serial_open, serial_configure): Move decls from here ...
16791 * systty.h: ... to here, so that they can be checked.
16792
16793 * fns.c (get_random, seed_random): Move extern decls from here ...
16794 * lisp.h: ... to here, so that they can be checked.
16795
16796 * sysdep.c (reset_io): Now static.
16797 (wait_for_termination_signal): Remove; unused.
16798
16799 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16800 (copy_keymap_item, append_key, push_text_char_description):
16801 Now static.
16802 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16803 (DENSE_TABLE_SIZE): Remove; unused.
16804 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16805 (describe_map_tree):
16806 Rename locals to avoid shadowing.
16807
16808 * keyboard.c: Declare functions static if they are not used elsewhere.
16809 (echo_char, echo_dash, cmd_error, top_level_2):
16810 (poll_for_input, handle_async_input): Now static.
16811 (read_char, kbd_buffer_get_event, make_lispy_position):
16812 (make_lispy_event, make_lispy_movement, apply_modifiers):
16813 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16814 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16815 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16816 (read_key_sequence, read_char): Mark locals as initialized.
16817 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16818
16819 * keyboard.h (make_ctrl_char): New decl.
16820 (mark_kboards): Move decl here ...
16821 * alloc.c (mark_kboards): ... from here.
16822
16823 * lisp.h (force_auto_save_soon): New decl.
16824
16825 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16826 (DEFINE_DUMMY_FUNCTION): New macro.
16827 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16828 Use it.
16829 (main): Add casts to avoid warnings
16830 if GCC considers string literals to be constants.
16831
16832 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16833
16834 * dbusbind.c: Pointer signedness fixes.
16835 (xd_signature, xd_append_arg, xd_initialize):
16836 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16837 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16838 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16839 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16840
16841 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16842 if GCC considers string literals to be constants.
16843 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16844
16845 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16846
16847 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16848 (print_preprocess, print_object): New macro to fix last change.
16849
16850 * print.c (print_preprocess): Don't forget font objects.
16851
16852 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16853
16854 * emacs.c (USAGE3): Doc fixes.
16855
16856 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16857
16858 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16859 structure.
16860
16861 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16862
16863 * lisp.h (VWindow_system, Qfile_name_history):
16864 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16865 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16866 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16867
16868 * w32select.c: Don't #include "keyboard.h".
16869 (run_protected): Add extern declaration for waiting_for_input.
16870
16871 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16872 * w32console.c (detect_input_pending, read_input_pending)
16873 (encode_terminal_code):
16874 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16875 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16876 (w32_system_caret_y, Qfile_name_history):
16877 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16878 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16879 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16880 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16881 * w32proc.c (Qlocal, report_file_error):
16882 * w32term.c (Vwindow_system, updating_frame):
16883 * w32uniscribe.c (initialized, uniscribe_font_driver):
16884 Remove unneeded extern declarations.
16885
16886 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16887
16888 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16889
16890 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16891
16892 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16893 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16894 These macros can no longer be used for assignment.
16895
16896 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16897 Assign struct members directly, instead of using BUF_BEGV etc.
16898 (record_buffer_markers, fetch_buffer_markers): New functions for
16899 recording and fetching special buffer markers.
16900 (set_buffer_internal_1, set_buffer_temp): Use them.
16901
16902 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16903
16904 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16905
16906 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16907 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16908
16909 * xdisp.c (hscroll_window_tree):
16910 (reconsider_clip_changes): Use PT instead of BUF_PT.
16911
16912 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16913
16914 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16915 $(EMACS_ROOT)/lib/intprops.h.
16916
16917 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16918
16919 Fix more problems found by GCC 4.5.2's static checks.
16920
16921 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16922 to unsigned char * to avoid compiler diagnostic.
16923 (xg_free_frame_widgets): Make it clear that a local variable is
16924 needed only if USE_GTK_TOOLTIP.
16925 (gdk_window_get_screen): Make it clear that this macro is needed
16926 only if USE_GTK_TOOLTIP.
16927 (int_gtk_range_get_value): New function, which avoids a diagnostic
16928 from gcc -Wbad-function-cast.
16929 (xg_set_toolkit_scroll_bar_thumb): Use it.
16930 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16931 diagnostic from gcc -Wbad-function-cast.
16932 (get_utf8_string, xg_get_file_with_chooser):
16933 Rename locals to avoid shadowing.
16934 (create_dialog): Move locals to avoid shadowing.
16935
16936 * xgselect.c (xg_select): Remove unused var.
16937
16938 * image.c (four_corners_best): Mark locals as initialized.
16939 (gif_load): Initialize transparent_p to zero (Bug#8238).
16940 Mark another local as initialized.
16941 (my_png_error, my_error_exit): Mark with NO_RETURN.
16942
16943 * image.c (clear_image_cache): Now static.
16944 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16945 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16946 (x_edge_detection): Remove unnecessary cast that
16947 gcc -Wbad-function-cast diagnoses.
16948 (gif_load): Fix pointer signedness.
16949 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16950 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16951
16952 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16953
16954 Improve quality of tests for time stamp overflow.
16955 For example, without this patch (encode-time 0 0 0 1 1
16956 1152921504606846976) returns the obviously-bogus value (-948597
16957 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16958 reports time overflow. See
16959 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16960 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16961 * editfns.c: Include limits.h and intprops.h.
16962 (TIME_T_MIN, TIME_T_MAX): New macros.
16963 (time_overflow): Move earlier, to before first use.
16964 (hi_time, lo_time): New functions, for an accurate test for
16965 out-of-range times.
16966 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16967 (Fget_internal_run_time): Don't assume time_t fits in int.
16968 (make_time): Use list2 instead of Fcons twice.
16969 (Fdecode_time): More accurate test for out-of-range times.
16970 (check_tm_member): New function.
16971 (Fencode_time): Use it, to test for out-of-range times.
16972 (lisp_time_argument): Don't rely on undefined left-shift and
16973 right-shift behavior when checking for time stamp overflow.
16974
16975 * editfns.c (time_overflow): New function, refactoring common code.
16976 (Fformat_time_string, Fdecode_time, Fencode_time):
16977 (Fcurrent_time_string): Use it.
16978
16979 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16980 * dired.c (make_time): Move to ...
16981 * editfns.c (make_time): ... here.
16982 * systime.h: Note the move.
16983
16984 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16985
16986 * fringe.c (update_window_fringes): Remove unused variables.
16987
16988 * unexmacosx.c (copy_data_segment): Also copy __got section.
16989 (Bug#8223)
16990
16991 2011-03-12 Eli Zaretskii <eliz@gnu.org>
16992
16993 * termcap.c [MSDOS]: Include "msdos.h".
16994 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16995 Constify `char *' arguments and their references according to
16996 prototypes in tparam.h.
16997
16998 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
16999
17000 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17001 Adapt all references accordingly.
17002
17003 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17004
17005 2011-03-11 Tom Tromey <tromey@redhat.com>
17006
17007 * buffer.c (syms_of_buffer): Remove obsolete comment.
17008
17009 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17010
17011 * termhooks.h (encode_terminal_code): Declare prototype.
17012
17013 * msdos.c (encode_terminal_code): Don't declare prototype.
17014
17015 * term.c (encode_terminal_code): Now external again, used by
17016 w32console.c and msdos.c.
17017
17018 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17019 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17020
17021 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17022
17023 Fix some minor problems found by GCC 4.5.2's static checks.
17024
17025 * fringe.c (update_window_fringes): Mark locals as initialized
17026 (Bug#8227).
17027 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17028
17029 * alloc.c (mark_fringe_data): Move decl from here ...
17030 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17031 to check its interface.
17032 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17033
17034 * fontset.c (free_realized_fontset): Now static.
17035 (Fset_fontset_font): Rename local to avoid shadowing.
17036 (fontset_font): Mark local as initialized.
17037 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17038
17039 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17040
17041 * xselect.c (x_disown_buffer_selections): Remove; not used.
17042 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17043 (x_own_selection, Fx_disown_selection_internal): Rename locals
17044 to avoid shadowing.
17045 (x_handle_dnd_message): Remove local to avoid shadowing.
17046
17047 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17048 so that the caller can use some name other than gcpro1.
17049 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17050 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17051 (Fx_backspace_delete_keys_p):
17052 Use them to avoid shadowing, and rename vars to avoid shadowing.
17053 (x_decode_color, x_set_name, x_window): Now static.
17054 (Fx_create_frame): Add braces to silence GCC warning.
17055 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17056 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17057 Remove unused locals.
17058 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17059 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17060 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17061 macros.
17062
17063 * xterm.h (x_mouse_leave): New decl.
17064
17065 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17066 Remove unused functions.
17067 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17068 (x_calc_absolute_position): Now static.
17069 (XTread_socket): Don't define label "out" unless it's used.
17070 Don't declare local "event" unless it's used.
17071 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17072 unless they are used.
17073 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17074 (x_fatal_error_signal): Remove; not used.
17075 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17076 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17077 (x_error_catcher, x_connection_closed, x_error_handler):
17078 (x_error_quitter, xembed_send_message, x_iconify_frame):
17079 (my_log_handler): Rename locals to avoid shadowing.
17080 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17081 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17082
17083 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17084 Rename or move locals to avoid shadowing.
17085 (tty_defined_color, merge_face_heights): Now static.
17086 (free_realized_faces_for_fontset): Remove; not used.
17087 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17088 does not deduce is never used uninitialized.
17089 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17090 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17091
17092 * terminal.c (store_terminal_param): Now static.
17093
17094 * xmenu.c (menu_highlight_callback): Now static.
17095 (set_frame_menubar): Remove unused local.
17096 (xmenu_show): Rename parameter to avoid shadowing.
17097 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17098 since they might point to immutable storage.
17099 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17100 since it's unused otherwise.
17101
17102 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17103 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17104 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17105 avoids a gcc -Wuninitialized diagnostic.
17106 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17107 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17108 does not deduce are never used uninitialized.
17109
17110 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17111
17112 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17113 * window.c (window_loop, size_window):
17114 (run_window_configuration_change_hook, enlarge_window): Likewise.
17115
17116 * window.c (display_buffer): Now static.
17117 (size_window): Mark variables that gcc -Wuninitialized
17118 does not deduce are never used uninitialized.
17119 * window.h (check_all_windows): New decl, to forestall
17120 gcc -Wmissing-prototypes diagnostic.
17121 * dispextern.h (bidi_dump_cached_states): Likewise.
17122
17123 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17124 shadowing.
17125 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17126 Include <limits.h>.
17127 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17128 and to avoid gcc -Wuninitialized warning.
17129 (load_charset_map): Mark variables that gcc -Wuninitialized
17130 does not deduce are never used uninitialized.
17131 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17132
17133 * coding.c (coding_set_source, coding_set_destination):
17134 Use "else { /* comment */ }" rather than "else /* comment */;"
17135 for clarity, and to avoid gcc -Wempty-body warning.
17136 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17137 a block, when the outer 'i' will do.
17138 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17139 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17140 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17141 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17142 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17143 Rename locals to avoid shadowing.
17144 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17145 * coding.c (emacs_mule_char, encode_invocation_designation):
17146 Now static, since they're not used elsewhere.
17147 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17148 (decode_coding_object, encode_coding_object, detect_coding_system):
17149 (decode_coding_emacs_mule): Mark variables that gcc
17150 -Wuninitialized does not deduce are never used uninitialized.
17151 (detect_coding_iso_2022): Initialize a local variable that might
17152 be used uninitialized. Leave a FIXME because it's not clear that
17153 this initialization is needed. (Bug#8211)
17154 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17155 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17156 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17157 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17158 Remove unused macros.
17159
17160 * category.c (hash_get_category_set): Remove unused local var.
17161 (copy_category_table): Now static, since it's not used elsewhere.
17162 * character.c (string_count_byte8): Likewise.
17163
17164 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17165 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17166
17167 * chartab.c (copy_sub_char_table): Now static, since it's not used
17168 elsewhere.
17169 (sub_char_table_ref_and_range, char_table_ref_and_range):
17170 Rename locals to avoid shadowing.
17171 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17172
17173 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17174 (BIDI_BOB): Remove unused macro.
17175
17176 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17177 deduce are never used uninitialized.
17178 * term.c (encode_terminal_code): Likewise.
17179
17180 * term.c (encode_terminal_code): Now static. Remove unused local.
17181
17182 * tparam.h: New file.
17183 * term.c, tparam.h: Include it.
17184 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17185 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17186 Move these decls to tparam.h, and make them agree with what
17187 is actually in tparam.c. The previous trick of using incompatible
17188 decls in different modules does not conform to the C standard.
17189 All callers of tparam changed to use tparam's actual API.
17190 * tparam.c (tparam1, tparam, tgoto):
17191 Use const pointers where appropriate.
17192
17193 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17194 * cm.h (struct cm): Likewise.
17195 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17196 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17197 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17198 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17199 (turn_on_face, init_tty): Likewise.
17200 * termchar.h (struct tty_display_info): Likewise.
17201
17202 * term.c (term_mouse_position): Rename local to avoid shadowing.
17203
17204 * alloc.c (mark_ttys): Move decl from here ...
17205 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17206
17207 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17208
17209 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17210
17211 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17212
17213 * search.c (compile_pattern_1): Remove argument regp, unused since
17214 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17215 (compile_pattern): Don't pass it.
17216
17217 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17218
17219 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17220 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17221 for ! HAVE_GTK3.
17222 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17223
17224 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17225
17226 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17227 gdk_window_get_screen, gdk_window_get_geometry,
17228 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17229 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17230 (xg_get_pixbuf_from_pixmap): New function.
17231 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17232 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17233 Call xg_get_pixbuf_from_pixmap instead of
17234 gdk_pixbuf_get_from_drawable.
17235 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17236 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17237 (xg_check_special_colors): Use GtkStyleContext and its functions
17238 for HAVE_GTK3.
17239 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17240 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17241 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17242 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17243 Call gtk_widget_get_preferred_size.
17244 (xg_frame_resized): gdk_window_get_geometry only takes 5
17245 parameters.
17246 (xg_win_to_widget, xg_event_is_for_menubar):
17247 Call gdk_x11_window_lookup_for_display.
17248 (xg_set_widget_bg): New function.
17249 (delete_cb): New function.
17250 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17251 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17252 (xg_set_background_color): Call xg_set_widget_bg.
17253 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17254 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17255 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17256 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17257 if ! HAVE_GTK3.
17258 (update_frame_tool_bar): Call gtk_widget_hide.
17259 (xg_initialize): Use GDK_KEY_g.
17260
17261 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17262 if ! HAVE_GTK3
17263 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17264
17265 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17266 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17267 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17268
17269 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17270
17271 * w32xfns.c (select_palette): Check success of RealizePalette against
17272 GDI_ERROR, not zero.
17273
17274 See ChangeLog.11 for earlier changes.
17275
17276 ;; Local Variables:
17277 ;; coding: utf-8
17278 ;; End:
17279
17280 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17281
17282 This file is part of GNU Emacs.
17283
17284 GNU Emacs is free software: you can redistribute it and/or modify
17285 it under the terms of the GNU General Public License as published by
17286 the Free Software Foundation, either version 3 of the License, or
17287 (at your option) any later version.
17288
17289 GNU Emacs is distributed in the hope that it will be useful,
17290 but WITHOUT ANY WARRANTY; without even the implied warranty of
17291 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17292 GNU General Public License for more details.
17293
17294 You should have received a copy of the GNU General Public License
17295 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.