Window parameter functions again accept any window as argument (Bug#12452).
[bpt/emacs.git] / src / ChangeLog
1 2012-09-16 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
4 any window as argument (Bug#12452).
5
6 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7
8 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
9 to ns_term_init to avoid memory leak.
10
11 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
12 explicit retain/release.
13 (ns_term_init): Only allow one display. Initialize outerpool and
14 ns_*_types.
15
16 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
17
18 Port _setjmp fix to POSIXish hosts as well as Microsoft.
19 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
20 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
21 the Microsoft problem in a different way, by altering ../nt/config.nt.
22
23 2012-09-15 Eli Zaretskii <eliz@gnu.org>
24
25 * w32xfns.c:
26 * w32uniscribe.c:
27 * w32term.c:
28 * w32select.c:
29 * w32reg.c:
30 * w32proc.c:
31 * w32menu.c:
32 * w32inevt.c:
33 * w32heap.c:
34 * w32font.c:
35 * w32fns.c:
36 * w32console.c:
37 * w32.c:
38 * w16select.c: Remove inclusion of setjmp.h, as it is now included
39 by lisp.h. This completes removal of setjmp.h inclusion
40 erroneously announced in the previous commit. (Bug#12446)
41
42 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
43 more accurate.
44
45 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
46 not defined as a macro. The latter happens on MS-Windows.
47 (Bug#12446)
48
49 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
50
51 Port better to POSIX hosts lacking _setjmp (Bug#12446).
52 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
53 Some instances of '#include <setjmp.h>' removed, if the
54 only reason for the instance was because "lisp.h" was included.
55 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
56 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
57 and _longjmp with the new symbols. Emacs already uses _setjmp if
58 available, so this change affects only POSIXish hosts that have
59 sigsetjmp but not _setjmp, such as some versions of Solaris and
60 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
61 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
62 (png_load_body) [HAVE_PNG]:
63 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
64 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
65 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
66 since PNG requires jmp_buf. This is the only exception to the
67 general rule that we now use sys_setjmp and sys_longjmp.
68 This exception is OK since this code does not change the signal
69 mask or longjmp out of a signal handler.
70
71 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
72
73 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
74 Include "syssignal.h", for 'main_thread'.
75
76 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
77
78 Avoid out-of-range marker position (Bug#12426).
79 * insdel.c (replace_range, replace_range_2): Adjust
80 markers before overlays, as suggested by comments.
81 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
82 Remove redundant check before calling offset_intervals.
83
84 2012-09-14 Martin Rudalics <rudalics@gmx.at>
85
86 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
87 current buffer (Bug#12387).
88
89 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
90
91 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
92
93 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
94
95 Use a more backwards-compatible timer format (Bug#12430).
96 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
97 vector element, not from the 4th, since PSECS is now at the end.
98 (Fcurrent_idle_time): Doc fix.
99
100 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
101
102 Function to mark objects and remove killed buffers at once.
103 * alloc.c (discard_killed_buffers): Rename to ...
104 (mark_discard_killed buffers) ... new name. Add marking
105 of remaining objects. Fix comment. Adjust users.
106 (mark_object): Do not touch frame buffer lists here.
107 * frame.c (delete_frame): Reset frame buffer lists here.
108
109 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
110
111 Better workaround for GNOME bug when --enable-gcc-warnings.
112 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
113 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
114 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
115
116 Simplify SIGIO usage (Bug#12408).
117 The code that dealt with SIGIO was crufty and confusing, e.g., it
118 played tricks like "#undef SIGIO" but these tricks were not used
119 consistently. Simplify mostly by not #undeffing standard symbols,
120 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
121 or not as we please) rather than "defined SIGIO" (standard symbol
122 that we probably shouldn't #undef).
123 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
124 Modules that need it can include it.
125 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
126 * dispextern.h (ignore_sigio): New decl.
127 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
128 unconditionally, since it's now a no-op if !USABLE_SIGIO.
129 * emacs.c (shut_down_emacs):
130 * keyboard.c (kbd_buffer_store_event_hold):
131 Use ignore_sigio rather than invoking 'signal' directly.
132 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
133 for FIONREAD.
134 (FIONREAD, SIGIO): Do not #undef.
135 (tty_read_avail_input): Use #error rather than a syntax error.
136 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
137 for I_PIPE, used by SETUP_SLAVE_PTY.
138 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
139 * sysdep.c (croak): Remove; no longer needed. This bit of
140 temporary code, with Fred N. Fish's comment that it's temporary,
141 has been in Emacs since at least 1992!
142 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
143 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
144 * syssignal.h (croak): Remove decl.
145 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
146 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
147 now that we're termios-only.
148 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
149 * term.c (dissociate_if_controlling_tty): Use #error rather than
150 a run-time error.
151
152 Work around GCC and GNOME bugs when --enable-gcc-warnings.
153 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
154 to work around GNOME bug 683906.
155 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
156 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
157 This works around GCC bug 54561.
158
159 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
160
161 More fixes for 'volatile' and setjmp/longjmp.
162 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
163 * image.c (struct png_load_context) [HAVE_PNG]: New type.
164 (png_load_body) [HAVE_PNG]:
165 (jpeg_load_body) [HAVE_JPEG]:
166 New function, with most of the old parent function's body.
167 (png_load) [HAVE_PNG]:
168 (jpeg_load) [HAVE_JPEG]:
169 Invoke the new function, to avoid longjmp munging our locals.
170 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
171 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
172 longjmp is passed 2, as the C standard doesn't guarantee this.
173 Instead, store the failure code into mgr->failure_code.
174
175 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
176
177 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
178 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
179 (syms_of_keyboard): Remove support for unread-command-char.
180
181 2012-09-12 Eli Zaretskii <eliz@gnu.org>
182
183 * w32proc.c (sys_kill): If PID is our process ID and the signal is
184 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
185 violation. (Bug#12426)
186
187 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
188
189 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
190
191 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
192
193 * eval.c: Add `inhibit-debugger'.
194 (Qinhibit_debugger): New symbol.
195 (call_debugger): Bind it instead of Qdebug_on_error.
196 (maybe_call_debugger): Test Vinhibit_debugger.
197 (syms_of_eval): Define inhibit-debugger.
198 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
199 (syms_of_xdisp): Remove inhibit-debug-on-message.
200
201 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
202
203 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
204 If a nonvolatile local variable is written before a _longjmp to
205 the frame containing the variable, and is read after the _longjmp,
206 the value read is indeterminate. Some local variables of type
207 'struct handler' and 'struct catchtag' are used in this way, so
208 mark each of their slots as volatile if the slot can be set before
209 _longjmp and read afterwards.
210 * lisp.h (struct handler): var and chosen_clause are now volatile.
211 (struct catchtag): val, next, and pdlcount are now volatile.
212
213 * bidi.c (bidi_push_it, bidi_pop_it):
214 * fns.c (copy_hash_table):
215 * image.c (define_image_type):
216 * keyboard.c (kbd_buffer_store_event_hold):
217 * process.c (Fprocess_send_eof):
218 * xfaces.c (x_create_gc) [HAVE_NS]:
219 * xgselect.c (xg_select):
220 Prefer assignment to memcpy when either will do.
221
222 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
223 Use pointer-to-a-pointer to simplify and avoid a NILP check each
224 time an item is removed. No need to mark this function 'inline';
225 the compiler knows better than we do.
226
227 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
228
229 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
230 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
231 to change_frame_size (Bug#12388).
232 (windowDidResize:): Pass YES to updateFrameSize.
233
234 * nsterm.h: Add delay parameter to updateFrameSize.
235
236 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
237
238 Discard killed buffers from deleted window and frame objects.
239 This reduces an amount of references to killed buffers and
240 helps GC to reclaim them faster.
241 * alloc.c (discard_killed_buffers): New function.
242 (mark_object): Use it for deleted windows and frames.
243 (mark_object): If symbol's value is set up for a killed buffer
244 or deleted frame, restore it's global binding.
245 * data.c (swap_in_global_binding): Add GC notice.
246 (swap_in_symval_forwarding): Use convenient set_blv_where.
247 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
248 * window.h: ... to here.
249
250 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
251
252 Convenient macro to check whether the buffer is live.
253 * buffer.h (BUFFER_LIVE_P): New macro.
254 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
255 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
256
257 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
258
259 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
260 composition cases (Bug#12364).
261
262 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
263 overhang of succeeding glyphs overlapping box cursor.
264
265 * w32term.c (x_draw_glyph_string): Likewise.
266
267 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
268
269 Simplify, document, and port floating-point (Bug#12381).
270 The porting part of this patch fixes bugs on non-IEEE platforms
271 with frexp, ldexp, logb.
272 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
273 Now static.
274 * floatfns.c: Simplify discussion of functions that Emacs doesn't
275 support, by removing commented-out code and briefly listing the
276 C89 functions excluded. The commented-out stuff was confusing
277 maintenance, e.g., we thought we needed cbrt but it was commented out.
278 (logb): Remove decl; no longer needed.
279 (isfinite): New macro, if not already supplied.
280 (isnan): Don't replace any existing macro.
281 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
282 are present on all C89 platforms.
283 (Ffrexp): Do not special-case zero, as frexp does the right thing
284 for that case.
285 (Flogb): Do not use logb, as it doesn't have the desired meaning
286 on hosts that use non-base-2 floating point. Instead, stick with
287 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
288 frexp, to avoid getting an unspecified result.
289
290 * xdisp.c (Qinhibit_debug_on_message): Now static.
291
292 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
293
294 * nsterm.m (ns_update_begin): Set clip path to whole view by using
295 NSBezierPath (Bug#12131).
296
297 2012-09-10 Chong Yidong <cyd@gnu.org>
298
299 * fns.c (Fdelq, Fdelete): Doc fix.
300
301 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
302
303 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
304 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
305
306 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
307
308 * lisp.h (make_lisp_ptr): New macro to replace XSET.
309 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
310 Use it.
311
312 2012-09-09 Eli Zaretskii <eliz@gnu.org>
313
314 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
315 left fringe if the window has a left margin. This avoids leaving
316 traces of the cursor because its leftmost pixel is not drawn over.
317
318 * dispnew.c (update_window_line): When the left margin area of a
319 screen line is updated, set the redraw_fringe_bitmaps_p flag of
320 that screen line. (Bug#12277)
321
322 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
323
324 Assume C89 or later for math functions (Bug#12381).
325 This simplifies the code, and makes it a bit smaller and faster,
326 and (most important) makes it easier to clean up signal handling
327 since we can stop worring about floating-point exceptions in
328 library code. That was a problem before C89, but the problem
329 went away many years ago on all practical Emacs targets.
330 * data.c, image.c, lread.c, print.c:
331 Don't include <math.h>; no longer needed.
332 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
333 might be autoconfigured, as that never happens.
334 * data.c (fmod):
335 * doprnt.c (DBL_MAX_10_EXP):
336 * print.c (DBL_DIG):
337 Remove. C89 or later always defines these.
338 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
339 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
340 (arith_error, domain_error, domain_error2):
341 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
342 no longer needed -- we simply return what C returns. All uses removed.
343 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
344 the wrapped code.
345 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
346 Remove. All uses expanded, as these macros are no longer used
347 more than once and are now more trouble than they're worth.
348 (Ftan): Use tan, not sin / cos.
349 (Flogb): Assume C89 frexp.
350 (fmod_float): Assume C89 fmod.
351 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
352 (init_floatfns): Remove. All uses removed.
353
354 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
355
356 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
357 compositeToPoint for OSX < 10.6 (Bug#12390).
358
359 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
360
361 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
362 This produces more-accurate results.
363
364 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
365
366 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
367 changes (Bug#12088).
368
369 2012-09-08 Chong Yidong <cyd@gnu.org>
370
371 * syntax.c (Fstring_to_syntax): Doc fix.
372
373 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
374
375 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
376 in the internal border.
377 (x_set_window_size): Remove static variables and their usage.
378 (ns_redraw_scroll_bars): Fix NSTRACE arg.
379 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
380 fringe/internal border adjustment (Bug#11052).
381 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
382 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
383 (ns_fix_rect_ibw): Remove.
384 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
385 (ns_dumpglyphs_box_or_relief): Ditto.
386 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
387 adjustment.
388 (ns_dumpglyphs_image): Ditto.
389 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
390 border adjustment.
391 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
392 their usage. Add fringe_extended_p and its use as in other terms.
393 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
394 scroll bar was removed.
395 (updateFrameSize): New function.
396 (windowDidResize): Move code to updateFrameSize and call it.
397
398 * nsterm.h (EmacsView): Add updateFrameSize.
399
400 2012-09-07 Chong Yidong <cyd@gnu.org>
401
402 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
403
404 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
405
406 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
407
408 More signal-handler cleanup (Bug#12327).
409 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
410 Problem introduced when merging patches. Noted by Eli Zaretskii in
411 <http://bugs.gnu.org/12327#67>.
412 * floatfns.c: Comment fix.
413 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
414 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
415 and anyway the declaration is harmless even if SIGDANGER is not defined.
416 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
417 defined BROKEN_FIONREAD). systty.h formerly did this, but other
418 source files not surprisingly expected syssignal.h to define, or
419 not define, SIGIO, and it's cleaner to do it that way, for consistency.
420 Include <sys/ioctl.h>, for FIONREAD.
421 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
422 This eliminates a problem whereby other files mysteriously had
423 to include "syssignal.h" before including "systty.h" if they
424 wanted to use "#ifdef SIGIO".
425
426 2012-09-07 Eli Zaretskii <eliz@gnu.org>
427
428 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
429
430 * w32.c (sigemptyset): Empty the set.
431 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
432
433 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
434
435 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
436
437 * alloc.c (mark_buffer): Revert unsafe marking optimization.
438 (mark_object): Likewise for frame objects.
439
440 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
441
442 * syssignal.h (handle_on_main_thread): Always declare,
443 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
444 This ports to platforms without HAVE_PTHREAD.
445
446 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
447
448 Signal-handler cleanup (Bug#12327).
449 Emacs's signal handlers were written in the old 4.2BSD style with
450 sigblock and sigmask and so forth, and this led to some
451 inefficiencies and confusion. Rewrite these to use
452 pthread_sigmask etc. without copying signal sets around. Also,
453 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
454 'signal', and instead use functions that do not attempt to take
455 over the system name space. This patch causes Emacs's text
456 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
457 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
458 Do not include <signal.h> or "syssignal.h", as these
459 modules do not use signals.
460 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
461 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
462 Do not include <signal.h>, as "syssignal.h" does that for us now.
463 * atimer.c (sigmask_atimers): New function.
464 (block_atimers, unblock_atimers): New functions,
465 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
466 All uses replaced.
467 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
468 no longer needed here.
469 * emacs.c (main): Inspect existing signal handler with sigaction,
470 so that there's no need to block and unblock SIGHUP.
471 * sysdep.c (struct save_signal): New member 'action', replacing
472 old member 'handler'.
473 (save_signal_handlers, restore_signal_handlers):
474 Use sigaction instead of 'signal' to save and restore.
475 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
476 New function. All users of 'signal' modified to use set_sighandler
477 if they're writeonly, and to use sys_signal if they're read+write.
478 (emacs_sigaction_init, forwarded_signal): New functions.
479 (sys_signal): Remove. All uses replaced by calls to sigaction
480 and emacs_sigaction_init, or by direct calls to 'signal'.
481 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
482 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
483 all uses replaced by pthread_sigmask etc. calls.
484 * syssignal.h: Include <signal.h>.
485 (emacs_sigaction_init, forwarded_signal): New decls.
486 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
487 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
488 (sigmask, sys_sigmask): Remove; no longer needed.
489 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
490 (sigblock, sigunblock, sigfree):
491 (sigsetmask) [!defined sigsetmask]:
492 Remove. All uses replaced by pthread_sigmask.
493 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
494 no longer need to be replaced, and its typical old uses
495 are now done via emacs_sigaction_init and sigaction.
496 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
497 (sys_sigdel): Remove; unused.
498 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
499
500 2012-09-06 Eli Zaretskii <eliz@gnu.org>
501
502 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
503 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
504
505 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
506
507 Explicitly mark buffer_defaults and buffer_local_symbols.
508 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
509 mark_local_symbols here.
510 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
511 since special buffers aren't marked here any more.
512 (allocate_buffer): Chain new buffer with all_buffers here...
513 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
514 not here.
515 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
516 (syms_of_buffer): Remove staticpro of the above.
517 (init_buffer_once): Set names for buffer_defaults and
518 buffer_local_symbols.
519
520 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
521
522 Use bool for booleans in font-related modules.
523 * font.c (font_intern_prop, font_style_to_value)
524 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
525 (generate_otf_features, font_check_otf_features, font_check_otf)
526 (font_match_p, font_list_entities, font_at):
527 * fontset.c (fontset_id_valid_p, reorder_font_vector
528 (fontset_find_font, Fset_fontset_font)
529 (face_suitable_for_char_p) [0]:
530 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
531 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
532 (m17n_flt_initialized, ftfont_shape_by_flt):
533 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
534 * nsfont.m (nsfont_draw):
535 * w32font.c (w32font_draw):
536 * w32term.c (x_draw_glyphless_glyph_string_foreground):
537 Use bool for booleans.
538 * font.h: Adjust to above API changes.
539 (struct font, struct font_driver, struct font_driver_list):
540 Use bool for booleans.
541 (struct font): Remove useless member encoding_type.
542 All users removed.
543 * fontset.c, xftfont.c: Omit unnecessary static decls.
544
545 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
546
547 * alloc.c (mark_object): Revert window marking code
548 since it's unsafe for the Fset_window_configuration.
549
550 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
551
552 Fix race conditions with signal handlers and errno (Bug#12327).
553 Be more systematic about preserving errno whenever a signal
554 handler returns, even if it's not in the main thread. Do this by
555 renaming signal handlers to distinguish between signal delivery
556 and signal handling. All uses changed.
557 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
558 * data.c (deliver_arith_signal): Rename from arith_error.
559 * dispnew.c (deliver_window_change_signal): Rename from
560 window_change_signal.
561 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
562 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
563 * keyboard.c (deliver_input_available_signal): Rename from
564 input_available_signal.
565 (deliver_user_signal): Rename from handle_user_signal.
566 (deliver_interrupt_signal): Rename from interrupt_signal.
567 * process.c (deliver_pipe_signal): Rename from send_process_trap.
568 (deliver_child_signal): Rename from sigchld_handler.
569 * atimer.c (handle_alarm_signal):
570 * data.c (handle_arith_signal):
571 * dispnew.c (handle_window_change_signal):
572 * emacs.c (handle_fatal_signal, handle_danger_signal):
573 * keyboard.c (handle_input_available_signal):
574 * keyboard.c (handle_user_signal, handle_interrupt_signal):
575 * process.c (handle_pipe_signal, handle_child_signal):
576 New functions, with the actual signal-handling code taken from the
577 original respective signal handlers, sans the sporadic attempts to
578 preserve errno, since that's now done by handle_on_main_thread.
579 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
580 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
581 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
582 Move to sysdep.c.
583 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
584 Move initialization of main_thread to sysdep.c's init_signals.
585 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
586 our usage, and simplifies the mainline code.
587 (record_child_status_change): New static function, as a helper
588 for handle_child_signal, and with most of the old child handler's
589 contents.
590 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
591 (handle_child_signal): Use the above.
592 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
593 Moved here from emacs.c.
594 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
595 code moved here from emacs.c's main function.
596 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
597 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
598 lets callers save and restore errno properly.
599
600 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
601
602 Remove redundant or unused things here and there.
603 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
604 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
605 * editfns.c (Fcompare_buffer_substrings): Likewise.
606 * frame.h (struct terminal, struct font_driver_list):
607 Remove redundant declarations.
608 * window.h (Qleft, Qright): Likewise.
609
610 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
611
612 Do not mark objects from deleted buffers, windows and frames.
613 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
614 (mark_object): Likewise for windows and frames.
615
616 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
617
618 * alloc.c (valid_lisp_object_p): Treat killed buffers,
619 buffer_defaults and buffer_local_symbols as valid objects.
620 Return special value to denote them.
621
622 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
623
624 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
625 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
626 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
627 (file_name_absolute_p, Fsubstitute_in_file_name):
628 (check_executable, check_writable, Ffile_accessible_directory_p)
629 (Fset_file_selinux_context, Fdefault_file_modes)
630 (Finsert_file_contents, choose_write_coding_system)
631 (Fwrite_region, build_annotations, a_write, e_write)
632 (Fdo_auto_save):
633 * filelock.c (boot_time_initialized, get_boot_time)
634 (get_boot_time_1, lock_file_1, within_one_second):
635 * floatfns.c (in_float):
636 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
637 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
638 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
639 * lisp.h (struct Lisp_Hash_Table.cmpfn):
640 * window.c (compare_window_configurations):
641 Use bool for booleans.
642 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
643 (Fdefault_file_modes): Now mode_t, not int, for modes.
644 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
645 (internal_delete_file): Now returns void, not a (boolean) int,
646 since nobody was looking at the return value.
647 * lisp.h, window.h: Adjust to above API changes.
648
649 * xdisp.c (set_message): Simplify and reindent last change.
650
651 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
652
653 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
654
655 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
656
657 * eval.c (call_debugger): Make the function non-static so that we
658 can call it from set_message.
659
660 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
661 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
662
663 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
664
665 Give more-useful info on a fatal error (Bug#12328).
666 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
667 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
668 of doing the work ourselves.
669 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
670 do most of the work.
671 (fatal_error_backtrace): New function, taken from the guts
672 of the old fatal_error_signal, but with a new option to output
673 a backtrace.
674 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
675 info about the signal than just its number.
676 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
677 * sysdep.c: Include <execinfo.h>
678 (emacs_backtrace): New function, taken partly from the previous
679 code of the 'die' function.
680 (emacs_abort): Call fatal_error_backtrace rather than abort.
681
682 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
683
684 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
685 eager (load-time) macro-expansion.
686 * lisp.mk (lisp): Add macroexp.
687
688 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
689
690 Simplify redefinition of 'abort' (Bug#12316).
691 Do not try to redefine the 'abort' function. Instead, redo
692 the code so that it calls 'emacs_abort' rather than 'abort'.
693 This removes the need for the NO_ABORT configure-time macro
694 and makes it easier to change the abort code to do a backtrace.
695 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
696 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
697 Remove; sysdep.c's emacs_abort now takes its place.
698 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
699 'abort' changed to use 'emacs_abort'.
700 * msdos.c (dos_abort) [defined abort]: Remove; not used.
701 (abort) [!defined abort]: Rename to ...
702 (emacs_abort): ... new name.
703 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
704 the place of the old 'abort' in emacs.c.
705 * w32.c, w32fns.c (abort): Do not #undef.
706 * w32.c (emacs_abort): Rename from w32_abort.
707
708 2012-09-04 Eli Zaretskii <eliz@gnu.org>
709
710 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
711 offsets[j].dv, since the y axis of the screen coordinates points
712 down, while the y axis of the font definition coordinates points
713 up. This fixes display of Arabic diacritics such as KASRA and
714 KASRATAN. (Bug#11860)
715
716 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
717
718 Be more systematic about _setjmp vs setjmp.
719 * alloc.c (test_setjmp, mark_stack):
720 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
721 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
722 (png_load, my_error_exit, jpeg_load):
723 * process.c (send_process_trap, send_process):
724 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
725 The underscored versions are up to 30x faster on some hosts.
726 Formerly, the code used setjmp+longjmp sometimes and
727 _setjmp+_longjmp at other times, with no particular reason to
728 prefer setjmp+longjmp.
729
730 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
731
732 Fix minor problem found by static checking.
733 * buffer.c (Fdelete_all_overlays): Return nil.
734
735 2012-09-03 Martin Rudalics <rudalics@gmx.at>
736
737 * buffer.c (Fdelete_all_overlays): New function.
738
739 2012-09-03 Chong Yidong <cyd@gnu.org>
740
741 * gtkutil.c: Add extern decl for Qxft.
742
743 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
744
745 * emacs.c, eval.c: Use bool for boolean.
746 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
747 (malloc_using_checking) [DOUG_LEA_MALLOC]:
748 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
749 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
750 (main, decode_env_path, Fdaemon_initialized):
751 * eval.c (call_debugger, Finteractive_p, interactive_p):
752 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
753 (maybe_call_debugger, Fbacktrace):
754 * process.c (read_process_output, exec_sentinel):
755 Use bool for booleans.
756 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
757 All callers changed.
758 * eval.c (interactive_p): Omit always-true boolean argument
759 EXCLUDE_SUBRS_P. All callers changed.
760 * dispextern.h, lisp.h: Reflect above API changes.
761 * firstfile.c (dummy): Use the address of 'main', whose signature
762 won't change, instead of the address of 'initialize', whose
763 signature just changed from int to bool.
764 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
765 * msdos.c (fatal_error_in_progress): ... from here.
766 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
767 of incrementing it.
768 (redisplay_internal, unwind_redisplay): Simply clear
769 REDISPLAYING_P when unwinding, instead of saving its previous,
770 always-false value and then restoring it.
771
772 Clean up some extern decls.
773 Mostly, this hoists extern decls out of .c files and into .h files.
774 That way, we're more likely to catch errors if the interfaces change.
775 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
776 declare xg_mark_data.
777 * dispextern.h (x_frame_parm_handlers):
778 * font.h (Qxft):
779 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
780 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
781 (Qultra_bold, Qoblique, Qitalic):
782 Move extern decl here from .c file.
783 * alloc.c (xg_mark_data) [USE_GTK]:
784 * doc.c (Qclosure):
785 * eval.c (Qlexical_binding):
786 * fns.c (time) [!HAVE_UNISTD_H]:
787 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
788 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
789 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
790 * lread.c (Qinternal_interpreter_environment):
791 * minibuf.c (Qbuffer):
792 * process.c (QCfamily, QCfilter):
793 * widget.c (free_frame_faces):
794 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
795 * xfont.c (x_clear_errors):
796 * xterm.c (x_frame_parm_handlers):
797 Remove now-redundant extern decls.
798 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
799 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
800 Now static.
801 * xfaces.c: Remove unnecessary static decls.
802 * xterm.c (updating_frame): Remove decl of nonexistent object.
803
804 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
805 when building globals.h, as the objects that are not built on
806 this host are not needed to compile C files on this host.
807
808 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
809
810 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
811
812 * frame.h: Add missing prototype for x_wm_set_size_hint.
813
814 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
815
816 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
817 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
818 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
819 (Fsubstitute_command_keys):
820 * editfns.c (region_limit, find_field, Fconstrain_to_field)
821 (save_excursion_save, save_excursion_restore)
822 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
823 (format_time_string, general_insert_function)
824 (make_buffer_string, make_buffer_string_both)
825 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
826 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
827 (copy_text, insert_1, insert_1_both, insert_from_string)
828 (insert_from_string_before_markers, insert_from_string_1)
829 (insert_from_buffer, insert_from_buffer_1, replace_range)
830 (replace_range_2, del_range_1, del_range_byte, del_range_both)
831 (del_range_2, modify_region):
832 * intervals.c (intervals_equal, balance_possible_root_interval)
833 (adjust_intervals_for_insertion, merge_properties_sticky)
834 (graft_intervals_into_buffer, lookup_char_property)
835 (adjust_for_invis_intang, set_point_both)
836 (get_property_and_range, compare_string_intervals)
837 (set_intervals_multibyte_1, set_intervals_multibyte):
838 * keyboard.c (decode_timer):
839 Use bool for boolean.
840 * intervals.h, lisp.h, systime.h: Reflect above API changes.
841 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
842
843 2012-09-02 Chong Yidong <cyd@gnu.org>
844
845 * keymap.c (push_key_description): Print M-TAB as C-M-i
846 (Bug#11758).
847
848 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
849
850 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
851 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
852 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
853 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
854 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
855 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
856 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
857
858 2012-09-01 Eli Zaretskii <eliz@gnu.org>
859
860 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
861 more than one grapheme cluster passed to the shaper: compute the
862 offset adjustment values separately for each cluster. (Bug#11860)
863
864 * image.c: Restore mistakenly removed inclusion of w32.h. Without
865 it, GCC doesn't see prototypes of w32_delayed_load, and complains
866 about implicit conversions from integer to pointer.
867
868 2012-09-01 Daniel Colascione <dancol@dancol.org>
869
870 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
871 system used too early.
872
873 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
874
875 Better seed support for (random).
876 * emacs.c (main): Call init_random.
877 * fns.c (Frandom): Set the seed from a string argument, if given.
878 Remove long-obsolete Gentzel cruft.
879 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
880 (init_random): New function.
881
882 2012-09-01 Daniel Colascione <dancol@dancol.org>
883
884 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
885 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
886 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
887 x_wm_set_size_hint, x_query_colors, x_real_positions,
888 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
889 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
890 all of which have been moved to common code.
891
892 * xfaces.c: Include TERM_HEADER instead of listing all possible
893 window-system headers.
894
895 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
896 to match header.
897
898 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
899 directly accessing frame internals.
900
901 * w32font.h: Include font.h. Define syms_of_w32font and
902 globals_of_w32font.
903
904 * process.c: Include TERM_HEADER instead of listing all possible
905 window-system headers.
906
907 * nsterm.h: Remove declarations now in frame.h. Define
908 FRAME_X_SCREEN, FRAME_X_VISUAL.
909
910 * menu.c: Include TERM_HEADER instead of listing all possible
911 window-system headers.
912
913 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
914 window system.
915
916 * keyboard.c: Include TERM_HEADER instead of listing all possible
917 window-system headers.
918
919 * image.c: Include TERM_HEADER instead of listing all possible
920 window-system headers. Declare Vlibrary_cache when compiling for
921 Windows.
922
923 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
924 window system declarations.
925
926 * frame.h: Move common functions here: set_frame_menubar,
927 x_set_window_size, x_sync, x_get_focus_frame,
928 x_set_mouse_position, x_set_mouse_pixel_position,
929 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
930 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
931 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
932 x_activate_menubar, x_real_positions, x_bitmap_icon,
933 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
934 and x_query_colors.
935
936 * frame.c: Include TERM_HEADER instead of listing all possible
937 window-system headers.
938
939 * font.c: Include TERM_HEADER instead of listing all possible
940 window-system headers.
941
942 * emacs.c: Include TERM_HEADER.
943
944 * dispnew.c: Include TERM_HEADER instead of listing all possible
945 window-system headers.
946
947 * ccl.h: Include character.h.
948
949 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
950 the current window system; include in list of objects to link into
951 Emacs.
952
953 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
954
955 Remove mark_ttys function and fix tty_display_info initialization.
956 * lisp.h (mark_ttys): Remove prototype.
957 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
958 to mark_ttys because all possible values of 'top_frame' slot are
959 the frames which are reachable from Vframe_list.
960 * term.c (mark_ttys): Remove.
961 (init_tty): Safely initialize 'top_frame' slot with Qnil.
962
963 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
964
965 Change struct frame bitfields from unsigned char to unsigned.
966 * frame.h (struct frame): Change type of 'display_preempted',
967 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
968 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
969 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
970 bitfields from unsigned char to unsigned.
971
972 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
973
974 Remove unused member of struct x_output and struct w32_output.
975 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
976 * w32term.h (struct w32_output): Likewise.
977
978 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
979
980 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
981 does not become zero (Bug#12234).
982
983 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
984
985 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
986 for GCC 4.7.1 x86-64.
987
988 2012-08-30 Glenn Morris <rgm@gnu.org>
989
990 * lread.c (init_lread): For out-of-tree builds, only add the
991 source directory's site-lisp dir to the load-path if it exists,
992 consistent with in-tree builds. (Bug#12302)
993
994 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
995
996 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
997 button_values to NULL. Call setStykeMask so dialogs get a close button.
998 (windowShouldClose:): Set window_closed.
999 (dealloc): New member, free button_values.
1000 (process_dialog:): Make member function. Remove window argument,
1001 replace window with self. Count buttons and allocate and store values
1002 in button_values.
1003 (addButton:value:row:): value is int with the name tag. Call setTag
1004 with tag. Remove return self, declare return value as void.
1005 (addString:row:): Remove return self, declare return value as void.
1006 (addSplit): Remove return self, declare return value as void.
1007 (clicked:): Remove return self, declare return value as void.
1008 Set dialog_return to button_values[seltag]. Code formatting change.
1009 (initFromContents:isQuestion:): Adjust call to process_dialog.
1010 Code formatting change.
1011 (timeout_handler:): Set timer_fired to YES.
1012 (runDialogAt:): Set timer_fired to NO.
1013 Handle click on close button as quit.
1014
1015 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1016 Add window_closed and button_values. Add void as return value for
1017 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1018 Add process_dialog as new member.
1019
1020 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1021
1022 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1023 is not one of the heaps we manage. (Bug#12242)
1024
1025 2012-08-28 Glenn Morris <rgm@gnu.org>
1026
1027 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1028
1029 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1030
1031 * window.c (Fset_window_configuration): Remove handling of
1032 auto-buffer-name window parameter. Install revision of reverted
1033 fix.
1034
1035 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1036
1037 Do not allow to set major mode for a dead buffer.
1038 * buffer.c (Fset_buffer_major_mode): Signal an error
1039 if the buffer is dead.
1040 (Fother_buffer, other_buffer_safely): Remove redundant
1041 nested declaration.
1042
1043 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1044
1045 Always use set_buffer_if_live to restore original buffer at unwind.
1046 * buffer.h (record_unwind_current_buffer): New function.
1047 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1048 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1049 * undo.c, window.c: Adjust users.
1050 * buffer.c (set_buffer_if_live): Fix comment.
1051
1052 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1053
1054 Fix usage of set_buffer_internal.
1055 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1056 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1057 * coding.c (decode_coding): Omit redundant test.
1058 * fileio.c (decide_coding_unwind): Likewise.
1059 * fns.c (secure_hash): Likewise.
1060 * insdel.c (modify_region): Likewise.
1061 * keyboard.c (command_loop_1): Likewise.
1062 * print.c (PRINTFINISH): Likewise.
1063 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1064
1065 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1066
1067 * dispnew.c: Use bool for boolean.
1068 (frame_garbaged, display_completed, delayed_size_change)
1069 (fonts_changed_p, add_window_display_history)
1070 (add_frame_display_history, verify_row_hash)
1071 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1072 (row_equal_p, realloc_glyph_pool)
1073 (allocate_matrices_for_frame_redisplay)
1074 (showing_window_margins_p)
1075 (adjust_frame_glyphs_for_frame_redisplay)
1076 (build_frame_matrix_from_leaf_window, make_current)
1077 (mirrored_line_dance, mirror_line_dance, update_frame)
1078 (update_window_tree, update_single_window)
1079 (check_current_matrix_flags, update_window, update_text_area)
1080 (update_window_line, set_window_update_flags, scrolling_window)
1081 (update_frame_1, scrolling, buffer_posn_from_coords)
1082 (do_pending_window_change, change_frame_size)
1083 (change_frame_size_1, sit_for):
1084 Use bool for boolean.
1085 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1086 and remove last int (actually boolean) argument, which was always 0.
1087 All callers changed.
1088 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1089 * dispextern.h (struct composition_it): Use bool for boolean.
1090 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1091 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1092 * dired.c (file_name_completion):
1093 Use bool for boolean. (This was missed in an earlier change.)
1094
1095 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1096
1097 * window.c (Fset_window_configuration): Revert first part of
1098 last change.
1099
1100 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1101
1102 * nsterm.h (NSPanel): New class variable dialog_return.
1103
1104 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1105 dialog_return.
1106 (windowShouldClose:): Use stop instead of stopModalWithCode.
1107 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1108 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1109 event.
1110 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1111 modal loop returns.
1112
1113 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1114
1115 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1116 * composite.c (find_composition, composition_gstring_p)
1117 (composition_reseat_it, find_automatic_composition):
1118 * data.c (let_shadows_buffer_binding_p)
1119 (let_shadows_global_binding_p, set_internal, make_blv)
1120 (Fmake_variable_buffer_local, Fmake_local_variable)
1121 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1122 (cons_to_signed, arith_driver):
1123 * dbusbind.c (xd_in_read_queued_messages):
1124 * dired.c (directory_files_internal, file_name_completion):
1125 Use bool for booleans.
1126 * dired.c (file_name_completion):
1127 * process.h (fd_callback):
1128 Omit int (actually boolean) argument. It wasn't being used.
1129 All uses changed.
1130 * composite.h, lisp.h: Reflect above API changes.
1131
1132 * cmds.c, coding.c: Use bool for booleans.
1133 * cmds.c (move_point, Fself_insert_command):
1134 * coding.h (struct composition status, struct coding_system):
1135 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1136 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1137 (emacs_mule_char, decode_coding_emacs_mule)
1138 (encode_coding_emacs_mule, detect_coding_iso_2022)
1139 (decode_coding_iso_2022, encode_invocation_designation)
1140 (encode_designation_at_bol, encode_coding_iso_2022)
1141 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1142 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1143 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1144 (encode_coding_raw_text, detect_coding_charset)
1145 (decode_coding_charset, encode_coding_charset, detect_eol)
1146 (detect_coding, get_translation_table, produce_chars)
1147 (consume_chars, reused_workbuf_in_use)
1148 (make_conversion_work_buffer, code_conversion_save)
1149 (decode_coding_object, encode_coding_object)
1150 (detect_coding_system, char_encodable_p)
1151 (Funencodable_char_position, code_convert_region)
1152 (code_convert_string, code_convert_string_norecord)
1153 (Fset_coding_system_priority):
1154 * fileio.c (Finsert_file_contents):
1155 Use bool for booleans.
1156 * coding.h, lisp.h: Reflect above API changes.
1157 * coding.c: Remove unnecessary static function decls.
1158 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1159 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1160 not a boolean 'int', since callers never look at the return value.
1161 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1162 * coding.h (decoding_buffer_size, encoding_buffer_size)
1163 (emacs_mule_string_char): Remove unused extern decls.
1164 (struct iso_2022_spec, struct coding_system):
1165 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1166 (struct emacs_mule_spec): Remove unused field 'full_support'.
1167 All initializations removed.
1168 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1169
1170 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1171
1172 Fix spare memory change (Bug#12286).
1173 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1174 (valid_lisp_object_p): Likewise.
1175
1176 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1177
1178 * window.c (Fset_window_configuration): Record any window's old
1179 buffer if it's replaced (see Bug#8789). If the new current
1180 buffer doesn't appear in the selected window, go to its old
1181 point (Bug#12208).
1182
1183 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1184
1185 Special MEM_TYPE_SPARE to denote reserved memory.
1186 * alloc.c (enum mem_type): New memory type.
1187 (refill_memory_reserve): Use new type for spare memory.
1188 This prevents live_cons_p and live_string_p from incorrect
1189 detection of uninitialized objects from spare memory as live.
1190
1191 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1192
1193 Spelling fixes.
1194 * Makefile.in (.PHONY): versioclean -> versionclean.
1195
1196 Remove unused external symbols.
1197 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1198 * window.c (Qwindow_valid_p, decode_valid_window):
1199 Now static, not extern.
1200 * data.c (Qinterval): Remove; unused.
1201 (syms_of_data): Do not define 'interval'.
1202 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1203 * window.h (decode_valid_window):
1204 Remove decls.
1205
1206 * character.c, charset.c, chartab.c: Use bool for booleans.
1207 * character.c (lisp_string_width, string_count_byte8)
1208 (string_escape_byte8):
1209 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1210 (load_charset_map_from_file, map_charset_chars)
1211 (Fdefine_charset_internal, define_charset_internal)
1212 (Fdeclare_equiv_charset, find_charsets_in_text)
1213 (Ffind_charset_region, char_charset, Fiso_charset):
1214 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1215 (sub_char_table_set, sub_char_table_set_range)
1216 (char_table_set_range, optimize_sub_char_table)
1217 (map_sub_char_table):
1218 Use bool for boolean.
1219 * character.c (str_to_unibyte): Omit last boolean argument; it was
1220 always 0. All callers changed.
1221 * character.h, charset.h: Adjust to match previous changes.
1222 * character.h (char_printable_p): Remove decl of nonexistent function.
1223 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1224 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1225 are all boolean, so make them single-bit bitfields.
1226
1227 * lisp.h (ASET): Remove attempt to detect side effects.
1228 It was meant to be temporary and it often doesn't work,
1229 because when IDX has side effects the behavior of IDX==IDX
1230 is undefined. See Stefan Monnier in
1231 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1232
1233 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1234
1235 * lisp.h (functionp): New function (extracted from Ffunctionp).
1236 (FUNCTIONP): Use it.
1237 * eval.c (Ffunctionp): Use it.
1238
1239 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1242 as that's faster and simpler than static storage. Don't bother
1243 with the g_main_context_query overhead if g_main_context_pending
1244 says no events are pending.
1245 (gfds, gfds_size): Remove these static vars.
1246 (xgselect_initialize): Remove; no longer needed.
1247 All uses and decls removed.
1248
1249 * emacs.c (fatal_error_signal_hook): Remove.
1250 All uses removed. This leftover from old code was always 0.
1251
1252 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1253 * casefiddle.c (casify_object, casify_region):
1254 * casetab.c (set_case_table):
1255 * category.c, category.h (word_boundary_p):
1256 * category.h (CHAR_HAS_CATEGORY):
1257 Use bool for booleans, instead of int.
1258
1259 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1260
1261 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1262
1263 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1264
1265 On assertion failure, print backtrace if available.
1266 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1267 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1268 * Makefile.in (LIB_EXECINFO): New macro.
1269 (LIBES): Use it.
1270
1271 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1272 * bytecode.c (exec_byte_code):
1273 * callint.c (check_mark, Fcall_interactively):
1274 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1275 (getenv_internal, sync_process_alive, call_process_exited):
1276 * lisp.h (USE_SAFE_ALLOCA):
1277 Use bool for booleans, instead of int.
1278 * lisp.h, process.h: Adjust prototypes to match above changes.
1279 * callint.c (Fcall_interactively): Don't assume the mark's
1280 offset fits in 'int'.
1281
1282 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1283
1284 * buffer.c, buffer.h: Use bool for boolean.
1285 * buffer.c (reset_buffer_local_variables)
1286 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1287 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1288 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1289 (overlay_touches_p, overlay_strings, Foverlay_put)
1290 (report_overlay_modification, call_overlay_mod_hooks):
1291 (mmap_enlarge, mmap_set_vars):
1292 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1293 Use bool for booleans, instead of int.
1294 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1295 since the 1-or-0 return value is always ignored anyway.
1296 (mmap_initialized_p):
1297 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1298 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1299
1300 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1301
1302 * bidi.c: Use bool for boolean.
1303 This is a bit more readable, and makes the text segment of bidi.o
1304 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1305 Presumably it's faster too.
1306 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1307 Now bool.
1308 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1309 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1310 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1311 (bidi_explicit_dir_char, bidi_level_of_next_char)
1312 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1313 Use bool for booleans, instead of int.
1314 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1315 (bidi_unshelve_cache): Adjust decls to match code.
1316
1317 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1318
1319 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1320 argument.
1321
1322 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1323
1324 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1325 * atimer.h: Include <stdbool.h>.
1326
1327 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1328
1329 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1330 compile time tests instead of run time tests on systems that do
1331 not use them.
1332 (FRAME_MAC_P): Remove leftover from deleted code.
1333 * frame.c (syms_of_frame): Remove leftover from deleted code.
1334
1335 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1336
1337 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1338
1339 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1340
1341 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1342 Otherwise, the compiler complains about (A?B:C) where B is void
1343 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1344 (fontset_add): Return void, for FONTSET_ADD.
1345
1346 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1347
1348 * alloc.c: Use bool for booleans.
1349 (gc_in_progress, abort_on_gc)
1350 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1351 (dont_register_blocks) [GC_MALLOC_CHECK]:
1352 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1353 (check_string_bytes, make_specified_string, memory_full)
1354 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1355 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1356 (mark_stack, valid_pointer_p, make_pure_string)
1357 (Fgarbage_collect, survives_gc_p, gc_sweep):
1358 Use bool for booleans, instead of int.
1359 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1360 Remove unused local.
1361 * alloc.c (PURE_POINTER_P):
1362 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1363 * editfns.c (Fformat):
1364 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1365 (Fdo_auto_save):
1366 * fns.c (sweep_weak_table):
1367 * lisp.h (suppress_checking, push_message, survives_gc_p)
1368 (make_pure_string, gc_in_progress, abort_on_gc):
1369 * lread.c (readchar, read1):
1370 * print.c (Fprin1_to_string):
1371 * xdisp.c (push_message):
1372 Use bool for booleans affected directly or indirectly by
1373 alloc.c's changes.
1374
1375 Make recently-introduced setters macros.
1376 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1377 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1378 (set_fontset_default, set_fontset_fallback): Rename from their
1379 upper-case counterparts, and make them functions rather than macros.
1380 This is more consistent with the other recently-introduced setters.
1381 These don't need to be inline, since they're local.
1382
1383 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1384
1385 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1386 the loop (Bug#12247).
1387
1388 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1389
1390 * lisp.h (vcopy): Use memcpy rather than our own loop.
1391 This fixes a performance regression introduced by the recent
1392 addition of vcopy. This means 'vcopy' will need to be modified
1393 for a copying collector, but that's OK. Also, tighten the
1394 checking in the assertion.
1395
1396 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1397
1398 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1399 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1400 non-base glyph for the width of the base character, according to
1401 what x_draw_composite_glyph_string_foreground expects.
1402 Generate WADJUST value according to composition_gstring_width's
1403 expectations, to produce correct width of the composed character.
1404 Reverse the sign of the DU offset produced by ScriptPlace.
1405
1406 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1407
1408 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1409
1410 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1411
1412 Avoid direct writes to contents member of struct Lisp_Vector.
1413 * lisp.h (vcopy): New function to copy data into vector.
1414 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1415 * fns.c (Ffillarray): Use ASET.
1416 * keyboard.c (timer_check_2): Use AREF and ASET.
1417 (append_tool_bar_item, Frecent_keys): Use vcopy.
1418 * lread.c (read_vector): Use ASET.
1419 * msdos.c (Frecent_doskeys): Use vcopy.
1420 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1421 (Finternal_merge_in_global_face): Use ASET and vcopy.
1422 * xfont.c (xfont_list_pattern): Likewise.
1423
1424 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1425
1426 * window.c (Fwindow_point): For the selected window always return
1427 the position of its buffer's point.
1428 (Fset_window_point): For the selected window always go in its
1429 buffer to the specified position.
1430
1431 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1432
1433 Setter macros for fontsets.
1434 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1435 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1436 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1437 Adjust users.
1438
1439 2012-08-20 Glenn Morris <rgm@gnu.org>
1440
1441 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1442 Don't assume that `ln -f' works.
1443
1444 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1445
1446 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1447 and later about non-assignments with no effect. See discussion at
1448 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1449 details.
1450
1451 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1452
1453 Inline setter functions for Lisp_Objects slots of struct specbinding.
1454 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1455 Adjust users.
1456
1457 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1458
1459 * window.c (select_window): Always make selected window's buffer
1460 current.
1461
1462 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1463
1464 Use AREF and ASET for docstrings of category tables.
1465 * category.h (CATEGORY_DOCSTRING): Use AREF.
1466 (SET_CATEGORY_DOCSTRING): Use ASET.
1467 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1468
1469 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1470
1471 Inline setter functions for hash table members.
1472 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1473 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1474 (set_hash_key_and_value, set_hash_index, set_hash_next)
1475 (set_hash_hash): New functions.
1476 * charset.c, fns.c: Adjust users.
1477
1478 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1479
1480 Inline getter and setter functions for per-buffer values.
1481 * buffer.h (per_buffer_default, set_per_buffer_default)
1482 (per_buffer_value, set_per_buffer_value): New functions.
1483 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1484 * buffer.c, data.c: Adjust users.
1485
1486 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1487
1488 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1489
1490 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1491
1492 Rely on <config.h> + <unistd.h> to declare 'environ',
1493 as gnulib does this if the system doesn't.
1494 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1495 Remove declaration. MS-Windows declares it on stdlib.h which is
1496 included by conf_post.h.
1497 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1498 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1499 * vm-limit.c: Include <unistd.h>, for 'environ'.
1500
1501 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1502 (start_of_data): Remove decl; mem-limits.h provides it.
1503
1504 * xdisp.c (handle_invisible_prop): Make it a bit faster
1505 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1506
1507 2012-08-19 Chong Yidong <cyd@gnu.org>
1508
1509 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1510 ends (Bug#3874).
1511
1512 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1513
1514 * .gdbinit: Use call instead of set when calling a function in the
1515 inferior.
1516
1517 * data.c (set_internal): Don't use set_blv_found.
1518 (Fkill_local_variable): Likewise.
1519
1520 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1521
1522 * nsfont.m (ns_ascii_average_width): Ensure the string
1523 ascii_printable is initialized with a null-terminated character
1524 array. Otherwise, it can contain undesired extra characters.
1525
1526 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1527
1528 port new setting code to Sun C 5.8 2005/10/13
1529 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1530 Return void, not Lisp_Object. Otherwise, the compiler
1531 complains about (A?B:C) where B is void and C is Lisp_Object
1532 when compiling CHAR_TABLE_SET, due to the recent change to
1533 the API of sub_char_table_set_contents.
1534
1535 2012-08-18 Chong Yidong <cyd@gnu.org>
1536
1537 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1538 for the string case (Bug#3874).
1539
1540 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1541
1542 * buffer.h (BSET): Remove (Bug#12215).
1543 Replace all uses with calls to new setter functions.
1544 (bset_bidi_paragraph_direction, bset_case_canon_table)
1545 (bset_case_eqv_table, bset_directory, bset_display_count)
1546 (bset_display_time, bset_downcase_table)
1547 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1548 (bset_last_selected_window, bset_local_var_alist)
1549 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1550 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1551 (bset_width_table):
1552 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1553 (bset_auto_fill_function, bset_auto_save_file_format)
1554 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1555 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1556 (bset_cache_long_line_scans, bset_case_fold_search)
1557 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1558 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1559 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1560 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1561 (bset_header_line_format, bset_indicate_buffer_boundaries)
1562 (bset_indicate_empty_lines, bset_invisibility_spec)
1563 (bset_left_fringe_width, bset_major_mode, bset_mark)
1564 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1565 (bset_name, bset_overwrite_mode, bset_pt_marker)
1566 (bset_right_fringe_width, bset_save_length)
1567 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1568 (bset_scroll_up_aggressively, bset_selective_display)
1569 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1570 (bset_word_wrap, bset_zv_marker):
1571 * category.c (bset_category_table):
1572 * syntax.c (bset_syntax_table):
1573 New setter functions.
1574
1575 * process.h (PSET): Remove (Bug#12215).
1576 Replace all uses with calls to new setter functions.
1577 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1578 (PROCESS_INLINE): New macro.
1579 (pset_childp): New setter function.
1580 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1581 * process.c (PROCESS_INLINE):
1582 Define to EXTERN_INLINE, so that the corresponding functions
1583 are compiled into code.
1584 (pset_buffer, pset_command, pset_decode_coding_system)
1585 (pset_decoding_buf, pset_encode_coding_system)
1586 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1587 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1588 (pset_type, pset_write_queue): New setter functions.
1589
1590 * window.h (WSET): Remove (Bug#12215).
1591 Replace all uses with calls to new setter functions.
1592 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1593 (WINDOW_INLINE): New macro.
1594 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1595 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1596 (wset_total_lines, wset_vertical_scroll_bar)
1597 (wset_window_end_pos, wset_window_end_valid)
1598 (wset_window_end_vpos): New setter functions.
1599 * window.c (WINDOW_INLINE):
1600 Define to EXTERN_INLINE, so that the corresponding functions
1601 are compiled into code.
1602 (wset_combination_limit, wset_dedicated, wset_display_table)
1603 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1604 (wset_new_normal, wset_new_total, wset_next_buffers)
1605 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1606 (wset_prev_buffers, wset_right_fringe_width)
1607 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1608 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1609 (wset_window_parameters):
1610 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1611 (wset_column_number_displayed, wset_region_showing):
1612 New setter functions.
1613
1614 * termhooks.h (TSET): Remove (Bug#12215).
1615 Replace all uses with calls to new setter functions.
1616 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1617 (TERMHOOKS_INLINE): New macro.
1618 (tset_charset_list, tset_selection_alist): New setter functions.
1619 * terminal.c (TERMHOOKS_INLINE):
1620 Define to EXTERN_INLINE, so that the corresponding functions
1621 are compiled into code.
1622 (tset_param_alist): New setter function.
1623
1624 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1625
1626 * keyboard.h (KSET): Remove (Bug#12215).
1627 Replace all uses with calls to new setter functions.
1628 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1629 (KEYBOARD_INLINE): New macro.
1630 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1631 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1632 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1633 New setter functions.
1634 * keyboard.c (KEYBOARD_INLINE):
1635 Define to EXTERN_INLINE, so that the corresponding functions
1636 are compiled into code.
1637 (kset_echo_string, kset_kbd_queue)
1638 (kset_keyboard_translate_table, kset_last_prefix_arg)
1639 (kset_last_repeatable_command, kset_local_function_key_map)
1640 (kset_overriding_terminal_local_map, kset_real_last_command)
1641 (kset_system_key_syms): New setter functions.
1642
1643 * frame.h (FSET): Remove (Bug#12215).
1644 Replace all uses with calls to new setter functions.
1645 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1646 (FRAME_INLINE): New macro.
1647 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1648 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1649 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1650 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1651 (fset_param_alist, fset_root_window, fset_scroll_bars)
1652 (fset_selected_window, fset_title, fset_tool_bar_items)
1653 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1654 * frame.c (FRAME_INLINE):
1655 Define to EXTERN_INLINE, so that the corresponding functions
1656 are compiled into code.
1657 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1658
1659 A few more naming-convention fixes for getters and setters.
1660 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1661 and rename from buffer_overlays_set_before.
1662 (set_buffer_overlays_after): Move here from buffer.h, and rename
1663 from buffer_overlays_set_after.
1664 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1665 All uses changed.
1666 (set_buffer_intervals): Rename from buffer_set_intervals.
1667 * intervals.c (set_interval_object): Move here from intervals.h,
1668 and rename from interval_set_object.
1669 (set_interval_left): Move here from intervals.h, and rename from
1670 interval_set_left.
1671 (set_interval_right): Move here from intervals.h, and rename from
1672 interval_set_right.
1673 (copy_interval_parent): Move here from intervals.h, and rename from
1674 interval_copy_parent.
1675 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1676 (set_interval_plist): Rename from interval_set_plist.
1677 Return void, not Lisp_Object, since no caller uses the result.
1678 * lisp.h (string_intervals): Rename from string_get_intervals.
1679 (set_string_intervals): Rename from string_set_intervals.
1680
1681 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1682 (set_char_table_contents): Rename from char_table_set_contents.
1683 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1684 All uses changed. See the end of
1685 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1686
1687 * lisp.h (CSET): Remove (Bug#12215).
1688 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1689 (set_char_table_purpose): New functions,
1690 replacing CSET. All uses changed. For example, replace
1691 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1692 "set_char_table_parent (char_table, parent);".
1693 The old version was confusing because it used the same name
1694 'parent' for two different things.
1695
1696 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1697
1698 Functions to get and set Lisp_Object fields of buffer-local variables.
1699 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1700 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1701 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1702 * data.c, eval.c, frame.c: Adjust users.
1703
1704 2012-08-17 Chong Yidong <cyd@gnu.org>
1705
1706 * xfaces.c (merge_face_vectors): If the target font specfies a
1707 font spec, make the font's attributes take precedence over
1708 directly-specified attributes.
1709 (merge_face_ref): Recognize :font.
1710
1711 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1712
1713 Do not use memcpy for copying intervals.
1714 * intervals.c (reproduce_interval): New function.
1715 (reproduce_tree, reproduce_tree_obj): Use it.
1716 (reproduce_tree_obj): Remove prototype.
1717
1718 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1719
1720 * lisp.h (duration_to_sec_usec): Remove unused decl.
1721
1722 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1723
1724 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1725 to an allocated instance of NSString, not to the class itself.
1726
1727 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1728
1729 * makefile.w32-in (C_CTYPE_H): New macro.
1730 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1731 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1732 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1733
1734 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1735
1736 Use ASCII tests for character types.
1737 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1738 * xfns.c, xterm.c:
1739 Don't include <ctype.h>; was not needed.
1740 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1741 * sysdep.c, xfaces.c:
1742 Include <c-ctype.h> instead of <ctype.h>.
1743 * nsterm.m: Include <c-ctype.h>.
1744 * charset.c (read_hex):
1745 * doc.c (Fsnarf_documentation):
1746 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1747 (DRIVE_LETTER) [DOS_NT]:
1748 (Ffile_name_directory, Fexpand_file_name)
1749 (Fsubstitute_in_file_name):
1750 * font.c (font_parse_xlfd, font_parse_fcname):
1751 * frame.c (x_set_font_backend):
1752 * gtkutil.c (xg_get_font):
1753 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1754 * nsimage.m (hexchar):
1755 * nsterm.m (ns_xlfd_to_fontname):
1756 * sysdep.c (system_process_attributes):
1757 * xfaces.c (hash_string_case_insensitive):
1758 Use C-locale tests instead of locale-specific tests for character
1759 types, since we want the ASCII interpretation here, not the
1760 interpretation suitable for whatever happens to be the current locale.
1761
1762 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1763
1764 Consistently check windows for validity/liveness
1765 (Bug#11984, Bug#12025, Bug#12026).
1766 * lisp.h (CHECK_VALID_WINDOW): New macro.
1767 * window.c (decode_window): Rename to decode_live_window.
1768 (decode_valid_window, Fwindow_valid_p): New functions.
1769 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1770 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1771 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1772 (Fwindow_prev_sibling, Fwindow_combination_limit)
1773 (Fset_window_combination_limit, Fwindow_use_time)
1774 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1775 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1776 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1777 (Fwindow_hscroll, Fset_window_hscroll)
1778 (Fwindow_redisplay_end_trigger)
1779 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1780 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1781 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1782 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1783 (Fwindow_end, Fset_window_point, Fset_window_start)
1784 (Fpos_visible_in_window_p, Fwindow_line_height)
1785 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1786 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1787 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1788 (Fset_window_parameter, Fwindow_display_table)
1789 (Fset_window_display_table, Fdelete_other_windows_internal)
1790 (Fset_window_buffer, Fset_window_new_total)
1791 (Fset_window_new_normal, Fdelete_window_internal)
1792 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1793 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1794 (Fwindow_scroll_bars): Check whether argument window is a valid or
1795 live window. Update doc-strings.
1796 (syms_of_window): New symbol Qwindow_valid_p.
1797 * keyboard.c (Fposn_at_x_y): Check whether argument
1798 frame_or_window denotes a valid window.
1799
1800 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1801
1802 Fix previous char table change.
1803 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1804 * chartab.c (optimize_sub_char_table): Likewise.
1805
1806 2012-08-16 Chong Yidong <cyd@gnu.org>
1807
1808 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1809
1810 * xfont.c (xfont_open):
1811 * xftfont.c (xftfont_open): Set the font's max_width field.
1812
1813 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1814 min_width to space_width and average_width to the average over
1815 printable ASCII characters.
1816 (ns_char_width): Code cleanup.
1817 (ns_ascii_average_width): New utility function.
1818
1819 * font.h (struct font): Update comments.
1820
1821 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1822
1823 Simple interface to set Lisp_Object fields of character tables.
1824 * lisp.h (CSET): New macro.
1825 (char_table_set_extras, char_table_set_contents)
1826 (sub_char_table_set_contents): New function.
1827 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1828 * syntax.c: Adjust users.
1829
1830 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1831
1832 * eval.c (eval_sub): Bind lexical-binding.
1833 * lread.c (Qlexical_binding): Make non-static.
1834
1835 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1836
1837 * nsmenu.m (popupSession): Remove.
1838 (pop_down_menu): Remove endModalSession.
1839 (timeout_handler:): New method.
1840 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1841 Call runModalForWindow. Check timer_fired when it returns.
1842 If not set, cancel timer and break out of loop.
1843 Otherwise loop again, with a new timeout.
1844
1845 * nsterm.m: Include fcntl.h if present.
1846 (fd_entry, t_readfds, inNsSelect): Remove.
1847 (select_writefds, select_valid, select_timeout, selfds)
1848 (select_mutex, apploopnr): Add.
1849 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1850 Otherwise call kbd_buffer_store_event.
1851 (ns_send_appdefined): Remove release of fd_entry.
1852 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1853 Increment and decrement apploopnr.
1854 (ns_select): If no file descriptors, just do a NSTimer.
1855 Otherwise copy read/write masks and start select thread (fd_handler).
1856 Start main loop and wait for application defined event.
1857 Inform select thread to stop selecting after main loop is exited.
1858 (ns_term_init): Create selfds pipe and set non-blocking.
1859 Initialize select_mutex. Start the select thread (fd_handler).
1860 (fd_handler:): Loop forever, wait for info from the main thread
1861 to either start or stop selecting. When select returns, send
1862 and appdefined event.
1863 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1864 If not call kbd_buffer_store_event.
1865
1866 * nsterm.h (EmacsApp): fd_handler takes id argument.
1867 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1868
1869 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1870
1871 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1872
1873 * region-cache.c (move_cache_gap): Update gap_len using the actual
1874 growth of the boundaries array. Do not change cache_len.
1875 (Bug#12196)
1876
1877 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1878
1879 Generalize and cleanup font subsystem checks.
1880 * font.h (FONT_DEBUG, font_assert): Remove.
1881 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
1882 Change font_assert to eassert. Use eassert where appropriate.
1883
1884 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1885
1886 * gtkutil.c (xg_get_font): Use pango_units_to_double.
1887
1888 2012-08-15 Chong Yidong <cyd@gnu.org>
1889
1890 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
1891 When using the new font chooser, use gtk_font_chooser_get_font_desc to
1892 extract the font descriptor instead of just the font name.
1893 In that case, return a font spec instead of a string.
1894 (x_last_font_name): Move to this file from xfns.c.
1895
1896 * xfns.c (Fx_select_font): The return value can also be a font
1897 spec. Move x_last_font_name management to gtkutil.c.
1898
1899 * xfaces.c: Make font weight and style symbols non-static.
1900
1901 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
1902
1903 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
1904 (bug#12117).
1905
1906 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
1907
1908 * alloc.c (Fgarbage_collect): Use plural form consistently.
1909
1910 2012-08-14 Eli Zaretskii <eliz@gnu.org>
1911
1912 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
1913 iteration through the command loop. Fixes a problem whereby mouse
1914 movements are ignored until the first mouse click.
1915
1916 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1917
1918 Use bool, not int, for Lisp booleans.
1919 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
1920 makes Emacs a bit smaller and presumably a bit faster.
1921 * lisp.h: Include <stdbool.h>.
1922 (struct Lisp_Boolfwd, defvar_bool):
1923 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
1924 * regex.c [!emacs]: Include <stdbool.h>.
1925 (false, true): Remove; <stdbool.h> does this for us now.
1926
1927 2012-08-14 Chong Yidong <cyd@gnu.org>
1928
1929 * character.c (Fcharacterp): Doc fix (Bug#12076).
1930
1931 * data.c (Findirect_variable): Doc fix (Bug#11040).
1932
1933 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
1934
1935 * editfns.c (Fformat): Doc fix (Bug#12059).
1936 (Fsave_current_buffer): Doc fix (Bug#11542).
1937
1938 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1939
1940 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
1941 (bug#12022).
1942
1943 2012-08-14 Martin Rudalics <rudalics@gmx.at>
1944
1945 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
1946 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
1947 * minibuf.c (choose_minibuf_frame, read_minibuf):
1948 * w32fns.c (x_create_tip_frame):
1949 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
1950 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
1951
1952 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1953
1954 * intervals.c (offset_intervals): Remove obsolete comment.
1955
1956 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1957
1958 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1959
1960 2012-08-14 Gergely Risko <gergely@risko.hu>
1961
1962 * coding.c (decode_coding): Record buffer modification before
1963 disabling undo_list (Bug#11773).
1964
1965 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1966
1967 Revert and cleanup some recent overlay changes.
1968 * buffer.h (enum overlay_type): Remove.
1969 (buffer_get_overlays, buffer_set_overlays): Likewise.
1970 (buffer_set_overlays_before, buffer_set_overlays_after):
1971 New function. Adjust users.
1972 (unchain_both): Add eassert.
1973
1974 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1975
1976 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1977
1978 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1979
1980 * gtkutil.c (xg_mark_data): Don't assume C99.
1981
1982 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1983
1984 * gtkutil.c (xg_frame_tb_info): New struct.
1985 (TB_INFO_KEY): New define.
1986 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1987 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1988 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1989 if not present.
1990 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1991 is up to date. Otherwise store new data.
1992 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1993
1994 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1995
1996 Use KSET for write access to Lisp_Object members of struct kboard.
1997 * keyboard.h (KSET): New macro.
1998 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1999 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2000 * xterm.c: Adjust users.
2001
2002 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2003
2004 Use BSET for write access to Lisp_Object members of struct buffer.
2005 * buffer.h (BSET): New macro.
2006 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2007 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2008 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2009 * window.c, xdisp.c, xfns.c: Adjust users.
2010
2011 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2012
2013 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2014
2015 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2016
2017 * nsterm.m (not_in_argv): New function.
2018 (application:openFile, application:openTempFile:):
2019 (application:openFileWithoutUI:, application:openFiles:): Open file
2020 if not_in_argv returns non-zero (bug#12171).
2021
2022 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2023 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2024 Define for Gtk+ versions less than 3.2.
2025 (xg_get_font_name): Use those functions/macros here.
2026 Reported by Frans Oilinki <moilinki@gmail.com>.
2027
2028 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2029
2030 * unexmacosx.c (copy_data_segment): Copy initialized data in
2031 statically linked libraries from input file rather than memory.
2032
2033 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2034 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2035 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2036
2037 2012-08-10 Glenn Morris <rgm@gnu.org>
2038
2039 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2040 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2041
2042 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2043
2044 Fix last change to allow compilation with low optimization levels.
2045 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2046 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2047
2048 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2049
2050 Use common inline syntax in intervals.h.
2051 * intervals.h (INTERVALS_INLINE): New macro.
2052 Change all users from LISP_INLINE.
2053
2054 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2055
2056 Define Qnone once for all platforms.
2057 * frame.c (Qnone): Define here.
2058 (syms_of_frame): DEFSYM it.
2059 * lisp.h (Qnone): New declaration.
2060 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2061 * xfns.c: Remove duplication. Adjust users.
2062
2063 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2064
2065 Remove unused macros from intervals.h.
2066 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2067 * intervals.c: Adjust comment.
2068
2069 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2070
2071 * w32fns.c <w32_unicode_gui>: New static variable.
2072 (globals_of_w32fns): Initialize it according to os_subtype.
2073 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2074 testing os_subtype.
2075
2076 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2077 Eli Zaretskii <eliz@gnu.org>
2078
2079 Fix bug #10299 with Unicode characters sent by customized
2080 keyboards created by MSKLC.
2081 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2082 (w32_init_class): Use it to initialize the Emacs class with either
2083 ANSI or Unicode API calls.
2084 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2085 later.
2086 (w32_wnd_proc): If the character code sent by WM_CHAR or
2087 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2088 original message. Call DefWindowProcW on NT and later.
2089
2090 2012-08-10 Glenn Morris <rgm@gnu.org>
2091
2092 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2093
2094 * lisp.h (DIRECTORY_SEP): Let configure set it.
2095
2096 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2097
2098 Use TSET for write access to Lisp_Object slots of struct terminal.
2099 * termhooks.h (TSET): New macro.
2100 * coding.c, terminal.c, xselect.c: Adjust users.
2101
2102 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2103
2104 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2105 the failing expression, include them in the error message.
2106 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2107 * lisp.h (internal_condition_case_n): Update declaration.
2108
2109 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2110
2111 Inline functions to examine and change buffer overlays.
2112 * buffer.c (unchain_both): New function.
2113 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2114 (buffer_has_overlays): New function.
2115 (enum overlay_type): New enum.
2116 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2117 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2118
2119 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2120
2121 Inline functions to examine and change buffer intervals.
2122 * alloc.c (mark_interval_tree): Remove.
2123 (MARK_INTERVAL_TREE): Simplify.
2124 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2125 * intervals.c (buffer_balance_intervals): New function.
2126 (graft_intervals_into_buffer): Adjust indentation.
2127 (set_intervals_multibyte): Simplify.
2128 * buffer.h (BUF_INTERVALS): Remove.
2129 (buffer_get_intervals, buffer_set_intervals): New function.
2130 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2131 * intervals.c, textprop.c: Adjust users.
2132
2133 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2134
2135 Inline functions to examine and change string intervals.
2136 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2137 (string_get_intervals, string_set_intervals): New function.
2138 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2139 * lread.c, print.c, textprop.c: Adjust users.
2140
2141 2012-08-08 Glenn Morris <rgm@gnu.org>
2142
2143 * lisp.mk (lisp): Remove language/persian.elc.
2144
2145 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2146
2147 Cleanup intervals.
2148 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2149 (NULL_INTERVAL_P): Likewise. Adjust users.
2150 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2151 Adjust comment. Move under #if 0.
2152 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2153 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2154
2155 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2156
2157 Check total length of intervals with eassert.
2158 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2159 * intervals.c: Change all users to eassert.
2160
2161 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2162
2163 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2164 Rename fields to match removal of FGET and WGET and disuse of
2165 INTERNAL_FIELD in Lisp_Cons.
2166
2167 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2168
2169 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2170 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2171 name since all xname users are fixed long time ago. Do not
2172 use INTERNAL_FIELD.
2173 (set_symbol_name, set_symbol_function, set_symbol_plist):
2174 (set_symbol_next, set_overlay_plist): New function.
2175 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2176 (struct Lisp_Overlay): Likewise.
2177 (CVAR, MVAR, SVAR): Remove.
2178 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2179 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2180 * xterm.c: Adjust users.
2181 * .gdbinit: Change to use name field of struct Lisp_Symbol
2182 where appropriate.
2183
2184 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2185
2186 Basic functions to set Lisp_Object and pointer slots of intervals.
2187 * intervals.h (interval_set_parent, interval_set_object):
2188 (interval_set_left, interval_set_right, interval_set_plist):
2189 (interval_copy_parent): New function.
2190 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2191 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2192 Adjust indentation.
2193 (INTERVAL_SIZE): Remove. Adjust users.
2194 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2195
2196 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2197
2198 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2199 * process.h (PGET): Remove.
2200 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2201 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2202
2203 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2204
2205 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2206 * window.h (WGET): Remove.
2207 (struct window): Do not use INTERNAL_FIELD.
2208 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2209 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2210 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2211 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2212 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2213 Adjust users.
2214
2215 2012-08-07 Chong Yidong <cyd@gnu.org>
2216
2217 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2218 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2219 (Fdelete_window_internal): Signal an error if the window is not on
2220 a live frame (Bug#12025).
2221
2222 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2223
2224 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2225 * frame.h (FGET): Remove.
2226 (struct frame): Do not use INTERNAL_FIELD.
2227 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2228 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2229 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2230 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2231
2232 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2233
2234 * w32.c: Silence compiler warnings.
2235 (map_w32_filename): Remove unused variable `is_fat'.
2236 (chase_symlinks): Add parentheses around expression.
2237
2238 2012-08-06 Glenn Morris <rgm@gnu.org>
2239
2240 * sysdep.c: Respect BROKEN_GETWD.
2241
2242 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2243 Let configure handle it.
2244 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2245
2246 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2247
2248 Use GCALIGNMENT where appropriate.
2249 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2250 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2251 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2252
2253 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2254
2255 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2256 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2257
2258 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2259
2260 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2261 that should be sufficient for everyone.
2262
2263 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2264
2265 * keyboard.c (timer_check_2): Add break so timer_check returns next
2266 timeout.
2267
2268 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2269
2270 Fix Windows build errors introduced after converting to WGET and WSET.
2271 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2272 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2273
2274 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2275
2276 * nsterm.m (ns_frame_rehighlight): Use FSET.
2277
2278 * nsmenu.m (ns_update_menubar): Use FSET.
2279
2280 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2281
2282 Separate read and write access to Lisp_Object slots of Lisp_Process.
2283 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2284 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2285
2286 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2287
2288 Separate read and write access to Lisp_Object slots of struct window.
2289 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2290 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2291 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2292 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2293 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2294 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2295 Adjust users.
2296
2297 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2298
2299 Fix Windows build errors introduced after converting to FGET and FSET.
2300 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2301 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2302 (w32_judge_scroll_bars): Change to use FSET.
2303 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2304
2305 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2306
2307 Fix replacement typo.
2308 * window.c (replace_window): Set root_window instead of
2309 selected_window. This fixes a total window subsystem
2310 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2311
2312 2012-08-06 Glenn Morris <rgm@gnu.org>
2313
2314 * lisp.mk (lisp): Add language/persian.elc.
2315
2316 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2317
2318 Separate read and write access to Lisp_Object slots of struct frame.
2319 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2320 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2321 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2322 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2323 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2324
2325 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2326
2327 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2328
2329 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2330
2331 Generalize common compile-time constants.
2332 * lisp.h (header_size, bool_header_size, word_size): Now here.
2333 (struct Lisp_Vector): Add comment.
2334 (struct Lisp_Bool_Vector): Move up to define handy constants.
2335 (VECSIZE, PSEUDOVECSIZE): Simplify.
2336 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2337 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2338 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2339 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2340 * xfont.c, xmenu.c: Use word_size where appropriate.
2341
2342 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2343
2344 * search.c (Freplace_match): Treat \? in the replacement text
2345 literally (Bug#8161).
2346
2347 2012-08-05 Chong Yidong <cyd@gnu.org>
2348
2349 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2350 * frame.c (Vdelete_frame_functions):
2351 * emacs.c (Vkill_emacs_hook): Doc fix.
2352
2353 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2354
2355 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2356 --with-x-toolkit=no builds.
2357 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2358
2359 2012-08-04 Chong Yidong <cyd@gnu.org>
2360
2361 * syntax.c (Fmodify_syntax_entry): Doc fix.
2362
2363 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2364
2365 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2366 * w32.c (init_environment): Change the default values of many
2367 environment variables in dflt_envvars[] to NULL, to avoid pushing
2368 them into environment when they were not already defined.
2369 Remove the code that deletes site-lisp subdirectories from the default
2370 value of EMACSLOADPATH, as it is no longer needed.
2371 (check_windows_init_file): Now external, not static.
2372 Use Vload_path as is, without adding anything, as this function is now
2373 called when Vload_path is already set up.
2374
2375 * w32.h (check_windows_init_file): Add prototype.
2376
2377 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2378 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2379 compatibility with Posix platforms.
2380 (main): Move the call to check_windows_init_file to here from
2381 w32.c.
2382 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2383 any, in the DEFALT argument into the root of the Emacs build or
2384 installation tree, as appropriate.
2385
2386 * callproc.c (init_callproc_1): Call decode_env_path instead of
2387 doing its equivalent by hand.
2388 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2389 the code that sets Vexec_path run on MS-Windows.
2390
2391 * lread.c (init_lread): Add comments to #ifdef's.
2392
2393 * msdos.c (dos_set_window_size, IT_update_begin)
2394 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2395 instead of direct references.
2396
2397 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2398
2399 Export DEFAULT_REHASH_* to GDB.
2400 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2401 Now constants, not macros.
2402
2403 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2404
2405 Remove unnecessary casts involving pointers.
2406 These casts are no longer needed now that we assume C89 or later,
2407 since they involve casting to or from void *.
2408 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2409 (make_pure_float, make_pure_vector):
2410 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2411 * macros.c (Fstart_kbd_macro):
2412 * menu.c (find_and_return_menu_selection):
2413 * minibuf.c (read_minibuf_noninteractive):
2414 * sysdep.c (closedir):
2415 * xdisp.c (x_produce_glyphs):
2416 * xfaces.c (compare_fonts_by_sort_order):
2417 * xfns.c (x_real_positions, select_visual):
2418 * xselect.c (x_stop_queuing_selection_requests)
2419 (x_get_window_property, x_get_window_property_as_lisp_data):
2420 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2421 Remove unnecessary pointer casts.
2422 * alloc.c (record_xmalloc): New function.
2423 * lisp.h (record_xmalloc): New decl.
2424 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2425 more like a function. This is because the pointer cast is not
2426 needed. All uses changed.
2427 * print.c (print_string, print_error_message): Avoid length recalc.
2428
2429 Improve fix for macroexp crash with debugging (Bug#12118).
2430 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2431 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2432 not supposed to be invoked from the garbage collector.
2433 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2434 (gc_aset): New function, which is like ASET but can be
2435 used in the garbage collector.
2436 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2437 (set_hash_index): Use it instead of ASET.
2438
2439 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2440
2441 Support symlinks on latest versions of MS-Windows.
2442 * w32.c: Include winioctl.h and aclapi.h.
2443 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2444 (revert_to_self): Forward declarations of static functions.
2445 <static BOOL g_b_init_get_security_info>:
2446 <g_b_init_create_symbolic_link>: New static flags.
2447 (globals_of_w32): Initialize them to zero.
2448 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2449 (map_w32_filename): Improve commentary. Simplify switch.
2450 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2451 headers (most versions of MinGW w32api don't).
2452 (get_security_info, create_symbolic_link)
2453 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2454 New functions.
2455 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2456 in the argument file name.
2457 (sys_access): Call unc_volume_file_attributes only if
2458 GetFileAttributes fails with network-related error codes.
2459 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2460 have the required privileges.
2461 (get_file_security_desc_by_name): Rename from
2462 get_file_security_desc.
2463 (stat_worker): New function, with most of the guts of 'stat', and
2464 with addition of handling of symlinks and support for 'lstat'.
2465 If possible, get file's attributes and security information by
2466 handle, not by name. Produce S_IFLNK bit for symlinks, when
2467 called from 'lstat'.
2468 (stat, lstat): New functions, call 'stat_worker'.
2469 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2470 symlinks when the underlying filesystem supports them.
2471
2472 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2473
2474 Fix macroexp crash on Windows with debugging (Bug#12118).
2475 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2476 checking subscripts; problem introduced with the recent
2477 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2478 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2479 since it's used in non-static inline functions now.
2480
2481 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2482 Don't assume buffer size fits in 'int'. Remove unused local.
2483
2484 Use C99-style 'extern inline' if available.
2485 * buffer.h (BUFFER_INLINE):
2486 * category.h (CATEGORY_INLINE):
2487 * character.h (CHARACTER_INLINE):
2488 * charset.h (CHARSET_INLINE):
2489 * composite.h (COMPOSITE_INLINE):
2490 * dispextern.h (DISPEXTERN_INLINE):
2491 * lisp.h (LISP_INLINE):
2492 * systime.h (SYSTIME_INLINE):
2493 New macro, replacing 'static inline' in this header.
2494 * buffer.h, category.h, character.h, charset.h, composite.h:
2495 * dispextern.h, lisp.h, systime.h:
2496 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2497 * alloc.c (LISP_INLINE):
2498 * buffer.c (BUFFER_INLINE):
2499 * category.c (CATEGORY_INLINE):
2500 * character.c (CHARACTER_INLINE):
2501 * charset.c (CHARSET_INLINE):
2502 * composite.c (COMPOSITE_INLINE):
2503 * dispnew.c (DISPEXTERN_INLINE):
2504 * sysdep.c (SYSTIME_INLINE):
2505 Define to EXTERN_INLINE, so that the corresponding functions
2506 are compiled into code.
2507 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2508 (INLINE_HEADER_END): New macros.
2509 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2510 since it's used in non-static inline functions now.
2511 (VALMASK) [!USE_LSB_TAG]: Likewise.
2512
2513 2012-08-02 Glenn Morris <rgm@gnu.org>
2514
2515 * s/: Remove empty directory.
2516
2517 * s/ms-w32.h: Move to ../nt/inc.
2518 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2519 Update for new ms-w32.h location.
2520
2521 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2522
2523 Port to Solaris 8.
2524 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2525
2526 2012-08-02 Glenn Morris <rgm@gnu.org>
2527
2528 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2529 hard-coding the path separator.
2530
2531 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2532
2533 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2534 This how ASET and AREF are supposed to work, and makes
2535 it easier to think about future improvements. See
2536 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2537 * charset.h (set_charset_attr): New function.
2538 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2539 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2540 (aref_addr): New function. All uses of &AREF(...) changed.
2541 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2542 (set_hash_index): New functions. All lvalue-style uses of
2543 HASH_KEY etc. changed.
2544 * keyboard.c (set_prop): New function. All lvalue-style uses
2545 of PROP changed.
2546
2547 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2548
2549 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2550 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2551 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2552 * nsfns.m (ns_set_name_as_filename): Likewise.
2553 * nsmenu.m (ns_update_menubar): Likewise.
2554 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2555
2556 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2557
2558 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2559 Adapt to latest changes in field names of the corresponding Lisp
2560 objects.
2561
2562 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2563
2564 2012-08-01 Glenn Morris <rgm@gnu.org>
2565
2566 * s/msdos.h: Remove file.
2567 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2568 * Makefile.in (S_FILE): Remove.
2569 (config_h): Remove S_FILE.
2570
2571 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2572
2573 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2574 Remove; moved to nt/config.nt.
2575
2576 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2577
2578 Use INTERNAL_FIELD for conses and overlays.
2579 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2580 Remove obsolete comment.
2581 (MVAR): New macro.
2582 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2583 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2584
2585 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2586
2587 Use INTERNAL_FIELD for symbols.
2588 * lisp.h (SVAR): New macro. Adjust users.
2589 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2590 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2591
2592 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2593
2594 Use INTERNAL_FIELD for processes.
2595 * process.h (PVAR): New macro. Adjust style.
2596 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2597 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2598
2599 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2600
2601 Use INTERNAL_FIELD for windows.
2602 * window.h (WVAR): New macro.
2603 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2604 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2605 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2606 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2607 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2608 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2609
2610 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2611
2612 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2613
2614 2012-08-01 Glenn Morris <rgm@gnu.org>
2615
2616 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2617 Move to configure.ac.
2618
2619 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2620
2621 * makefile.w32-in (CONFIG_H): Update dependencies.
2622 (CONF_POST_H): New macro.
2623
2624 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2625
2626 2012-07-31 Glenn Morris <rgm@gnu.org>
2627
2628 * Makefile.in (S_FILE): No longer set by configure.
2629
2630 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2631 is available.
2632 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2633
2634 * process.h (NULL_DEVICE):
2635 * emacs.c (SEPCHAR):
2636 * editfns.c (USER_FULL_NAME): Let configure set them.
2637
2638 * s/README, s/template.h: Remove files.
2639
2640 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2641
2642 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2643 Move to configure.ac.
2644
2645 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2646
2647 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2648 resulting renaming of 'struct frame' members.
2649
2650 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2651
2652 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2653 after introduction of FVAR.
2654
2655 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2656
2657 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2658
2659 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2660 instead of compositeToPoint.
2661 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2662
2663 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2664
2665 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2666
2667 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2668 * lisp.h (INTERNAL_FIELD): New macro.
2669 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2670 (BVAR): Change to use INTERNAL_FIELD.
2671 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2672 (KVAR): Change to use INTERNAL_FIELD.
2673 * frame.h (FVAR): New macro.
2674 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2675 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2676 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2677 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2678 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2679
2680 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2681
2682 Miscellaneous fixes for non-default X toolkits.
2683 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2684 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2685 Move under #ifdef USE_LUCID.
2686 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2687 definition and usage to avoid warnings.
2688
2689 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2690
2691 * nsterm.m (openFiles): Fix previous checkin.
2692
2693 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2694
2695 * indent.c (compute_motion): Remove unused local.
2696
2697 2012-07-31 Glenn Morris <rgm@gnu.org>
2698
2699 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2700
2701 * conf_post.h [USG5_4]:
2702 Move remaining contents of s/usg5-4-common.h here.
2703 * s/usg5-4-common.h: Remove file.
2704
2705 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2706 * s/irix6-5.h: Remove file.
2707
2708 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2709 * s/darwin.h: Remove file.
2710
2711 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2712 * s/hpux10-20.h: Remove file, which is now empty.
2713
2714 2012-07-30 Glenn Morris <rgm@gnu.org>
2715
2716 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2717 * Makefile.in (config_h): Add conf_post.h.
2718 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2719
2720 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2721
2722 * nsterm.m (ns_do_open_file): New variable.
2723 (ns_term_init): Set ns_do_open_file to YES after run returns.
2724 (openFile, openTempFile, openFileWithoutUI, openFiles):
2725 Open files only if ns_do_open_file.
2726
2727 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2728
2729 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2730 This no-op macro hasn't been needed for many years.
2731 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2732
2733 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2734 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2735 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2736 gdb_make_enums_visible.
2737 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2738 (DIRECTORY_SEP): Now a constant, not a macro.
2739
2740 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2741
2742 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2743 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2744
2745 * w32term.c <w32_keyboard_codepage>: Renamed from
2746 keyboard_codepage and now external. All users changed.
2747
2748 * w32term.h: Add declaration of w32_keyboard_codepage.
2749
2750 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2751 the codepage to translate keys to Unicode. If this argument is
2752 -1, use the value returned by GetConsoleCP. All callers changed.
2753
2754 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2755
2756 Update .PHONY listings in makefiles.
2757 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2758 bootstrap-clean, distclean, maintainer-clean, versioclean,
2759 extraclean, frc.
2760
2761 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2762 This is a bit clearer. Fix some commentary typos.
2763
2764 2012-07-30 Glenn Morris <rgm@gnu.org>
2765
2766 * s/netbsd.h: Let configure include signal.h if needed.
2767 Remove file, which is now empty.
2768
2769 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2770 Let configure set them.
2771 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2772 No more need to undefine.
2773
2774 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2775
2776 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2777 non-single-byte char when adding meta modifier. (Bug#12090)
2778
2779 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2780
2781 Convert safe_call to use variable number of arguments.
2782 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2783 (safe_call2): Fix comment.
2784 * lisp.h (safe_call): Adjust prototype.
2785 * coding.c (encode_coding_object): Change to use safe_call2.
2786 * xfaces.c (merge_face_heights): Change to use safe_call1.
2787
2788 2012-07-30 Glenn Morris <rgm@gnu.org>
2789
2790 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2791 does that unconditionally. Remove file, which is now empty.
2792
2793 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2794 Remove empty files.
2795
2796 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2797
2798 Export to GDB most of lisp.h's remaining object-like macros.
2799 * lisp.h (min, max): Move earlier, because they're used earlier now.
2800 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2801 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2802 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2803 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2804 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2805 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2806 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2807 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2808 Now constants, for GDB. They need not be macros.
2809 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2810 Now constants, for GDB, as well as macros, for static initializers.
2811 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2812 Move to after the definition of struct Lisp_Char_Table,
2813 since the former now needs that type defined.
2814 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2815 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2816 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2817 New enums, for gdb_make_enums_visible.
2818 (GLYPH_MODE_LINE_FACE): Remove; unused.
2819 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2820 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2821 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2822 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2823 enum maxargs, enum MAX_ALLOCA.
2824 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2825 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2826 no longer needed, now that they are done in lisp.h.
2827
2828 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2829
2830 Cleanup string bytes checking.
2831 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2832 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2833 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2834 (check_sblock, compact_small_strings): Simplify.
2835
2836 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2837
2838 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2839 These macros are confusing and no longer need to be defined, as
2840 the enum values now suffice. All uses replaced with definiens.
2841 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2842
2843 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2844
2845 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2846 ($(BLD)/w32console.$(O)): Update dependencies.
2847
2848 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2849
2850 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2851 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2852 time. Adjust users.
2853 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2854
2855 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2856
2857 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2858 setting sitelisp (Bug#12010).
2859
2860 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2861
2862 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2863
2864 * w32heap.c (cache_system_info):
2865 * w32.c (sys_rename):
2866 * w32proc.c (find_child_console, sys_kill): All users changed.
2867
2868 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2869
2870 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2871
2872 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2873
2874 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2875
2876 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2877
2878 Cleanup statistics calculation in Fgarbage_collect.
2879 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
2880 Fix zombies percentage calculation. Simplify elapsed time calculation.
2881
2882 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2883
2884 Generalize marker debugging code under MARKER_DEBUG and use eassert.
2885 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
2886 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
2887 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
2888 (replace_range, replace_range_2, del_range_2): Change to eassert.
2889 * marker.c (byte_char_debug_check): Adjust style.
2890
2891 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2892
2893 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
2894 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
2895 long-ago-commented-out code that talks about "WIN32".
2896 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
2897 All uses changed.
2898
2899 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
2900
2901 Use Gnulib stdalign module (Bug#9772, Bug#9960).
2902 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
2903 Simplify by using alignof.
2904 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
2905 * lisp.h: Include <stdalign.h>.
2906 (GCALIGNMENT): New macro and constant.
2907 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
2908 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
2909 (stdalign): New macro, if not already defined.
2910
2911 2012-07-28 Eli Zaretskii <eliz@gnu.org>
2912
2913 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
2914 * w32inevt.c: Include w32inevt.h.
2915 (w32_read_console_input): New inline function, calls either
2916 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
2917 w32_console_unicode_input.
2918 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
2919 (w32_kbd_patch_key, key_event): Use the codepage returned by
2920 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
2921 (key_event): use uChar.UnicodeChar only if
2922 w32_console_unicode_input is non-zero.
2923
2924 * w32console.c: Include w32heap.h.
2925 <w32_console_unicode_input>: New global variable.
2926 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
2927 family of Windows, zero otherwise.
2928
2929 * w32inevt.h: Declare w32_console_unicode_input.
2930
2931 * xdisp.c (init_iterator): Don't reference tip_frame in a build
2932 --without-x. (Bug#11742)
2933
2934 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2935
2936 Adjust GDB to reflect pvec_type changes (Bug#12036).
2937 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
2938 2012-07-04 changes to pseudovector representation.
2939 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
2940
2941 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
2942
2943 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
2944 bus address.
2945 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
2946
2947 2012-07-27 Eli Zaretskii <eliz@gnu.org>
2948
2949 * alloc.c (listn): Fix the order the arguments are consed onto the
2950 list.
2951
2952 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2953 enumeration constants, as PURE and HEAP are too general, and clash
2954 with other headers and sources, such as gmalloc.c and the
2955 MS-Windows system headers. All users changed.
2956
2957 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2958
2959 Revert last save_excursion_save and save_excursion_restore changes.
2960 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2961 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2962
2963 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2964
2965 Fix recently-introduced typos in Windows port.
2966 Reported by Martin Rudalics <rudalics@gmx.at>.
2967 * w32.c (init_environment): Replace comma with semicolon.
2968 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
2969
2970 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2971
2972 Improve GDB symbol export (Bug#12036).
2973 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2974 arms of an 'if', not using conditional expressions; otherwise GDB
2975 complains about the types in the unevaluated arm when the argument
2976 is an integer literal.
2977 (xgetint): Simplify expression.
2978 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2979 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2980 Zaretskii in <http://bugs.gnu.org/12036#13>.
2981 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2982 needed now that we have gdb_make_enums_visible.
2983 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2984 (enum enum_USE_LSB_TAG):
2985 New enum types, packaging up enums that need to be exported to GDB.
2986
2987 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2988
2989 Utility function to make a list from specified amount of objects.
2990 * lisp.h (enum constype): New datatype.
2991 (listn): New prototype.
2992 * alloc.c (listn): New function.
2993 (Fmemory_use_count, syms_of_alloc): Use it.
2994 * buffer.c (syms_of_buffer): Likewise.
2995 * callint.c (syms_of_callint): Likewise.
2996 * charset.c (define_charset_internal): Likewise.
2997 * coding.c (syms_of_coding): Likewise.
2998 * keymap.c (syms_of_keymap): Likewise.
2999 * search.c (syms_of_search): Likewise.
3000 * syntax.c (syms_of_syntax): Likewise.
3001 * w32.c (init_environment): Likewise.
3002 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3003 * xdisp.c (syms_of_xdisp): Likewise.
3004 * xfns.c (syms_of_xfns): Likewise.
3005
3006 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3007
3008 Fast save_excursion_save and save_excursion_restore.
3009 * lisp.h (struct Lisp_Excursion): New data type.
3010 (PVEC_EXCURSION): New pseudovector type.
3011 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3012 to deal with it. Adjust comments.
3013 (init_marker, attach_marker): New prototype.
3014 (unchain_marker): Adjust prototype.
3015 * marker.c (attach_marker): Change to global.
3016 (init_marker): New function.
3017 * alloc.c (Fmake_marker, build_marker): Use it.
3018 (build_marker): More easserts.
3019 (mark_object): Handle struct Lisp_Excursion.
3020 * editfns.c (save_excursion_save, save_excursion_restore):
3021 Reimplement to use struct Lisp_Excursion. Add comments.
3022
3023 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3024
3025 Fix export of symbols to GDB (Bug#12036).
3026 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3027 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3028 emacs.c, as this is a more-suitable home. Had this been done earlier
3029 the fix for 12036 would have avoided some of the problems noted in
3030 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3031 would have been more obvious.
3032 * emacs.c: Do not include <verify.h>; no longer needed.
3033 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3034 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3035 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3036 Remove; now done in lisp.h.
3037 * lisp.h (PUBLISH_TO_GDB): New macro.
3038 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3039 (DATA_SEG_BITS): Use it.
3040 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3041 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3042 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3043 not be usable in #if. This simplifies things.
3044
3045 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3046
3047 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3048
3049 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 Simplify export of symbols to GDB (Bug#12036).
3052 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3053 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3054 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3055 Adjust to changes in lisp.h and emacs.c, by using
3056 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3057 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3058 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3059 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3060 instead of gdb_valbits.
3061 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3062 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3063 instead of gdb_array_mark_flag.
3064 (xboolvector): Get size from $->size, not $->header.size.
3065 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3066 (xreload, hook-run, hookpost-run): Remove.
3067 * emacs.c: Include <verify.h>.
3068 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3069 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3070 Remove.
3071 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3072 (gdb_USE_LSB_TAG): New enum constants.
3073 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3074 Also define these as enum constants, so they're visible to GDB.
3075 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3076 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3077 as constants, so they're visible to GDB.
3078 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3079 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3080 Now enum constants, not macros, so they're visible to GDB.
3081 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3082 more convenient now. All uses changed.
3083 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3084 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3085
3086 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3087
3088 Explicitly free restriction data that are not needed anymore.
3089 * editfns.c (save_restriction_restore): Free restriction data.
3090
3091 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3092
3093 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3094 add argument, tune behavior, and adjust all callers.
3095
3096 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3097
3098 Use typedef for EMACS_INT, EMACS_UINT.
3099 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3100 than macros. This simplifies debugging in the usual case, since
3101 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3102 and it allows expressions involving EMACS_INT casts.
3103 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3104
3105 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3106
3107 * nsterm.m (ns_read_socket): Return early if there is a modal
3108 window (Bug#12043).
3109
3110 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3111
3112 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3113 that FOCUS-FRAME can be omitted.
3114
3115 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3116
3117 Adjust buffer text indirection counters at the end of Fkill_buffer.
3118 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3119 buffer is definitely dead. This should really fix an issue reported
3120 by Christoph Scholtes again. (Bug#12007).
3121 (init_buffer_once): Initialize indirection counters of
3122 buffer_defaults and buffer_local_symbols (for sanity and safety).
3123
3124 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3125
3126 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3127 and continuation glyphs on tooltip frames, leave them at zero.
3128 Avoids continued lines in tooltips. (Bug#11832)
3129
3130 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3131
3132 Simplify copy_overlay.
3133 * buffer.c (copy_overlay): Simplify. Use build_marker.
3134 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3135
3136 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3137
3138 * print.c (print_object): Don't crash when a frame's name is nil
3139 or invalid. (Bug#12025)
3140
3141 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3142 it signals an error when a tooltip frame is being created.
3143
3144 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3145
3146 Cleanup miscellaneous objects allocation and initialization.
3147 * alloc.c (allocate_misc): Change to static. Add argument to
3148 specify the subtype. Adjust comment and users.
3149 (build_overlay): New function.
3150 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3151 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3152 (allocate_misc): Remove prototype.
3153 (build_overlay): Add prototype.
3154
3155 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3156
3157 Swap buffer text indirection counters in Fbuffer_swap_text.
3158 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3159 This avoids crash reported by Christoph Scholtes at
3160 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3161
3162 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3163
3164 * nsmenu.m (Popdown_data): New struct.
3165 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3166 free Popdown_data.
3167 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3168 (initWithContentRect): Make imgView and contentView non-static
3169 and autorelease them. Also autorelease img and matrix (Bug#12005).
3170 (dealloc): Remove (Bug#12005).
3171
3172 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3173
3174 Adjust consing_since_gc when objects are explicitly freed.
3175 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3176 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3177 (free_cons, free_misc): Subtract object size from consing_since_gc.
3178
3179 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3180
3181 Simplify and cleanup markers positioning code.
3182 * marker.c (attach_marker): More useful eassert.
3183 (live_buffer, set_marker_internal): New function.
3184 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3185 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3186
3187 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3188
3189 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3190 as it's limited by the amount of memory, not by INT_MAX.
3191
3192 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3193
3194 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3195 in special-event-map. See the discussion at
3196 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3197 for the reasons.
3198
3199 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3200 info.dwItemData. Fixes crashes on 64-bit Windows.
3201 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3202
3203 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3204
3205 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3206 (conversationIdentifier): Return value is NSInteger.
3207 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3208
3209 2012-07-21 Chong Yidong <cyd@gnu.org>
3210
3211 * window.c (decode_any_window): Signal an error if the window is
3212 on a dead frame (Bug#11984).
3213
3214 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3215
3216 Add indirection counting to speed up Fkill_buffer.
3217 * buffer.h (struct buffer): New member.
3218 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3219 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3220 base buffer indirection counter.
3221 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3222 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3223 through buffer list if indirection counter is 0.
3224
3225 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3226
3227 Extend the value returned by Fgarbage_collect with heap statistics.
3228 * alloc.c (Qheap): New symbol.
3229 (syms_of_alloc): DEFSYM it.
3230 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3231 (Fmemory_free): Remove.
3232 (syms_of_alloc): Don't defsubr it.
3233 * buffer.c (Fcompact_buffer): Remove.
3234 (syms_of_buffer): Don't defsubr it.
3235
3236 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3237
3238 Make maybe_gc inline.
3239 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3240 * lisp.h (consing_since_gc, gc_relative_threshold)
3241 (memory_full_cons_threshold): Revert declaration.
3242 (maybe_gc): Remove prototype, define as inline.
3243 * alloc.c: Remove old commented-out code.
3244 (consing_since_gc, gc_relative_threshold)
3245 (memory_full_cons_threshold): Revert to global.
3246 (maybe_gc): Remove.
3247
3248 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3249
3250 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3251 * lisp.h (build_unibyte_string): New function.
3252 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3253 * sysdep.c, w32fns.c, xfns.c: Use it.
3254 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3255 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3256 Adjust users accordingly.
3257 * font.h (font_open_by_name): Adjust prototype.
3258
3259 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3260
3261 Cleanup calls to Fgarbage_collect.
3262 * lisp.h (maybe_gc): New prototype.
3263 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3264 Remove declarations.
3265 * alloc.c (maybe_gc): New function.
3266 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3267 Make them static.
3268 * bytecode.c (MAYBE_GC): Use maybe_gc.
3269 * eval.c (eval_sub, Ffuncall): Likewise.
3270 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3271 to avoid dependency from auto-save feature.
3272
3273 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3274
3275 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3276 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3277 'for_each_per_buffer_object_at'.
3278 All uses changed. It's better to use upper-case for macros that
3279 cannot be implemented as functions, to give the reader a clue
3280 that they're special.
3281
3282 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3283
3284 * alloc.c (Fgarbage_collect): Tweak docstring.
3285
3286 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3287
3288 Tweak the value returned from Fgarbage_collect again.
3289 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3290 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3291 Adjust documentation.
3292 (total_vector_bytes): Rename to total_vector_slots, adjust
3293 accounting.
3294 (total_free_vector_bytes): Rename to total_free_vector_slots,
3295 adjust accounting.
3296 (Qstring_bytes, Qvector_slots): New symbols.
3297 (syms_of_alloc): DEFSYM them.
3298
3299 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3300
3301 Buffer compaction primitive which may be used from Lisp.
3302 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3303 (syms_of_buffer): Register Fcompact_buffer.
3304 * alloc.c (Fgarbage_collect): Use compact_buffer.
3305 * buffer.h (compact_buffer): New prototype.
3306 (struct buffer_text): New member.
3307
3308 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3309
3310 New macro to iterate over all buffers, miscellaneous cleanups.
3311 * lisp.h (all_buffers): Remove declaration.
3312 * buffer.h (all_buffers): Add declaration, with comment.
3313 (for_each_buffer): New macro.
3314 * alloc.c (Fgarbage_collect, mark_object): Use it.
3315 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3316 (init_buffer): Likewise.
3317 * data.c (Fset_default): Likewise.
3318 * coding.c (code_conversion_restore): Remove redundant check
3319 for dead buffer.
3320 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3321
3322 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3323
3324 Fix bug that created negative-length intervals.
3325 * intervals.c (merge_interval_right, merge_interval_left):
3326 Do not zero out this interval if it is absorbed by its children,
3327 as this interval's total length doesn't change in that case. See
3328 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3329
3330 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3331
3332 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3333 when invoking (make-bool-vector N t) and N is a positive
3334 multiple of 8 -- the last 8 bits were mistakenly cleared.
3335
3336 Remove some struct layout assumptions in bool vectors.
3337 * alloc.c (bool_header_size): New constant.
3338 (header_size, word_size): Move earlier, as they're now used earlier.
3339 Use 'word_size' in a few more places, where it's appropriate.
3340 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3341 padding before the data member of a bool vector.
3342 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3343 than doing the check by hand with an abort ().
3344
3345 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3346
3347 * eval.c (Fdefvar): Don't check constants since we only set the var if
3348 it's not yet defined anyway (bug#11904).
3349
3350 * lisp.h (last_undo_boundary): Declare new var.
3351 * keyboard.c (command_loop_1): Set it.
3352 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3353 were auto-added by the command loop (bug#11774).
3354
3355 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3356
3357 * w32font.c (Qsymbol): Remove local definition.
3358 (syms_of_w32font): Don't DEFSYM it.
3359
3360 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3361
3362 Fix sweep_vectors to handle large bool vectors correctly.
3363 * alloc.c (sweep_vectors): Account total_vector_bytes for
3364 bool vectors larger than VBLOCK_BYTES_MAX.
3365
3366 2012-07-18 Chong Yidong <cyd@gnu.org>
3367
3368 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3369 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3370
3371 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3372
3373 Return more descriptive data from Fgarbage_collect.
3374 Suggested by Stefan Monnier in
3375 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3376 * alloc.c (bounded_number): New function.
3377 (total_buffers, total_vectors): New variable.
3378 (total_string_size): Rename to total_string_bytes, adjust users.
3379 (total_vector_size): Rename to total_vector_bytes, adjust users.
3380 (sweep_vectors): Account total_vectors and total_vector_bytes.
3381 (Fgarbage_collect): New return value. Adjust documentation.
3382 (gc_sweep): Account total_buffers.
3383 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3384 (VECTOR_SIZE): Remove.
3385 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3386 (Qinterval, Qmisc): New symbols.
3387 (syms_of_data): Initialize them.
3388 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3389 (Qcons, Qbuffer): New declarations.
3390
3391 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3392
3393 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3394 Round up, not down. Improve doc.
3395
3396 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3397
3398 Restore old code in allocate_string_data to avoid Faset breakage.
3399 Reported by Julien Danjou <julien@danjou.info> in
3400 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3401 * alloc.c (allocate_string_data): Restore old code with minor
3402 adjustments, fix comment to explain this subtle issue.
3403
3404 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3405
3406 Remove FILE_SYSTEM_CASE.
3407 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3408
3409 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3410 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3411 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3412 call-process-region passes it through expand-file-name.
3413
3414 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3415
3416 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3417
3418 Fix crash when creating indirect buffer (Bug#11917)
3419 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3420 Don't handle unbound variables specially if non-zero.
3421 (Fbuffer_local_variables): Pass zero.
3422 (clone_per_buffer_values): Pass non-zero.
3423
3424 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3425
3426 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3427 to make the loop interruptible.
3428
3429 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3430
3431 * gnutls.c (emacs_gnutls_handshake): Only retry if
3432 GNUTLS_E_INTERRUPTED.
3433
3434 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3435
3436 Cleanup and convert miscellaneous checks to eassert.
3437 * alloc.c (mark_interval): Fix comment, partially rephrase
3438 old comment from intervals.h (see below).
3439 * intervals.c (find_interval, adjust_intervals_for_insertion)
3440 (delete_interval, adjust_intervals_for_deletion)
3441 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3442 Convert to eassert.
3443 (adjust_intervals_for_insertion, make_new_interval):
3444 Remove obsolete and unused code.
3445 * intervals.h (struct interval): Remove obsolete comment.
3446 * textprotp.c (erase_properties): Remove unused code.
3447 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3448 (Fremove_list_of_text_properties): Convert to eassert.
3449
3450 2012-07-17 Chong Yidong <cyd@gnu.org>
3451
3452 * editfns.c (Finsert_char): Doc fix.
3453
3454 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3455
3456 Fix previous change to make Fmemory_free always accurate.
3457 * alloc.c (make_interval): Update total_free_intervals.
3458 (make_float): Likewise for total_free_floats.
3459 (free_cons, Fcons): Likewise for total_free_conses.
3460 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3461 Likewise for total_free_vector_bytes.
3462 (Fmake_symbol): Likewise for total_free_symbols.
3463 (bytes_free): Remove.
3464
3465 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3466
3467 Simple free memory accounting feature.
3468 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3469 (sweep_vectors): Accumulate size of free vectors.
3470 (Fgarbage_collect): Setup bytes_free.
3471 (Fmemory_free): New function.
3472 (syms_of_alloc): Register it.
3473
3474 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3475
3476 Cleanup overlays checking.
3477 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3478 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3479 eassert and OVERLAYP.
3480 (sort_overlays): Change to use OVERLAYP.
3481
3482 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3483
3484 * editfns.c (Finsert_char): Make it interactive, and make the
3485 second arg optional. Copy interactive spec and docstring from
3486 ucs-insert.
3487
3488 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3489
3490 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3491 Unlike the other wrapped functions, fabs has an unspecified
3492 effect on errno.
3493
3494 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3495
3496 * nsterm.m (keyDown): Interpret flags without left/right bits
3497 as the left key (Bug#11670).
3498
3499 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3500
3501 Remove empty and useless init functions.
3502 * lisp.h (init_character_once, init_fns, init_image)
3503 (init_filelock, init_sound): Remove prototype.
3504 * character.c (init_character_once): Remove.
3505 * filelock.c (init_filelock): Likewise.
3506 * fns.c (init_fns): Likewise.
3507 * image.c (init_image): Likewise.
3508 * sound.c (init_sound): Likewise.
3509 * emacs.c (main): Adjust accordingly.
3510
3511 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3512
3513 * gtkutil.h: Tiny cleanups.
3514 (use_old_gtk_file_dialog): Remove useless declaration.
3515 (xg_uses_old_file_dialog): Add suggested const attribute.
3516
3517 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3518
3519 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3520 (bidi_paragraph_init): Use it to limit search forward for a strong
3521 directional character in abnormally large paragraphs full of
3522 neutral or weak characters. (Bug#11943)
3523
3524 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3525
3526 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3527 the toolbar (Bug#9451).
3528 (xg_make_tool_item): Give the widget event box a transparent
3529 background.
3530
3531 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3532
3533 Cleanup basic allocation variables and functions.
3534 * alloc.c (ignore_warnings, init_intervals, init_float)
3535 (init_cons, init_symbol, init_marker): Remove.
3536 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3537 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3538 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3539 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3540 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3541 (staticidx, init_alloc_once, init_strings, free_ablock):
3542 Remove redundant initialization.
3543 * fns.c (init_weak_hash_tables): Remove.
3544 * lisp.h (init_weak_hash_tables): Remove prototype.
3545
3546 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3547
3548 Use zero_vector where appropriate.
3549 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3550 accordingly.
3551 * lisp.h (zero_vector): New declaration.
3552 * font.c (null_vector): Remove.
3553 (syms_of_font): Remove initialization and staticpro.
3554 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3555 * keymap.c (Faccessible_keymaps): Likewise.
3556
3557 2012-07-15 Leo Liu <sdl.web@gmail.com>
3558
3559 * fringe.c: Fix typo in comments.
3560
3561 2012-07-14 Leo Liu <sdl.web@gmail.com>
3562
3563 * fringe.c: Add a new bitmap exclamation-mark.
3564
3565 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3566
3567 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3568
3569 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3570 (HAVE_MENUS): Don't define, defined by editing config.in with
3571 msdos/sed2v2.inp.
3572 (GMALLOC_INHIBIT_VALLOC): Don't define.
3573 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3574
3575 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3576
3577 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3578
3579 2012-07-14 Glenn Morris <rgm@gnu.org>
3580
3581 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3582 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3583 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3584
3585 2012-07-13 Glenn Morris <rgm@gnu.org>
3586
3587 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3588
3589 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3590 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3591
3592 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3593
3594 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3595 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3596 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3597 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3598 where appropriate.
3599 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3600 as boolean expression.
3601 (x_set_window_size): Remove unused variable toolbar.
3602 (ns_get_color_default, ns_mod_to_lisp): Remove.
3603 (ns_mouse_position): Remove unused variables xchar and ychar.
3604 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3605 (ns_set_vertical_scroll_bar): Remove unused variable count.
3606 (ns_delete_terminal): Remove unused variable i.
3607 (ns_term_init): Remove unused variables r, g and b.
3608 (mouseDown): Remove unused variable window.
3609 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3610 (initFrameFromEmacs): Remove unused variable vbextra.
3611 (mouseEntered): Remove unused variables p and dpyinfo.
3612 (mouseExited): Remove unused variables p and r.
3613 (ns_define_frame_cursor, ns_clear_frame_area)
3614 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3615 (menuDown): Assign [sender tag] to variable and cast the variable.
3616
3617 * nsterm.h (menuDown): Add id as type to argument sender.
3618 (ns_display_info_for_name): Add Lisp_Object argument.
3619 (ns_term_init): Add Lisp_Object argument.
3620 (ns_map_event_to_object): Add void argument.
3621 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3622 prototype with arguments and only declare if __OBJC__.
3623 (nxatoms_of_nsselect): Add void argument.
3624 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3625 (ns_alloc_autorelease_pool): Add void argument.
3626 (ns_release_autorelease_pool): Add void* argument.
3627 (ns_get_defaults_value): Add const char* argument.
3628
3629 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3630 (initFromContents): Use SSDATA where appropriate.
3631 (ns_update_menubar): Add braces to ambigous if-else.
3632 (initWithTitle): Put () around assignment in if statement.
3633 (ns_menu_show): Remove unused variables window and keymap.
3634 (update_frame_tool_bar): Remove unused variable selected_p.
3635 (initWithContentRect): Remove unused variable this_cmd_name.
3636
3637 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3638 appropriate.
3639 (setXBMColor): Remove unused variable len.
3640 (setPixmapData): Put () around assignment in loop statement.
3641
3642 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3643 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3644 where appropriate.
3645 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3646 around assignment in loop statement.
3647 (nsfont_open): Remove unused variable i.
3648 (nsfont_open): Remove unused variable len.
3649 (nsfont_draw): Remove unused variable cs.
3650
3651 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3652 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3653 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3654 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3655 (Fns_font_name, Fns_perform_service)
3656 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3657 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3658 (ns_set_name): Remove unused variable view.
3659 (x_set_menu_bar_lines): Remove unused variable olines.
3660 (x_set_tool_bar_lines): Remove unused variable root_window.
3661 (Fns_list_colors): Put () around assignment in while statement.
3662 (Fns_perform_service): Remove unused variable len.
3663 (Fns_display_usable_bounds): Remove unused variable top.
3664 (syms_of_nsfns): Remove unused variable i.
3665
3666 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3667 memcpy (Bug#11907).
3668
3669 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3670
3671 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3672 and free it with DestroyExceptionInfo (Bug#11558).
3673
3674 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3675
3676 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3677 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3678 Set here, not in nt/config.nt.
3679
3680 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3681
3682 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3683 cursor overflow into the last glyph on display line when the right
3684 fringe is off. (Bug#11832)
3685
3686 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3687
3688 * xdisp.c (produce_special_glyphs): Now static.
3689 * dispextern.h (produce_special_glyphs): Remove decl.
3690
3691 2012-07-13 Glenn Morris <rgm@gnu.org>
3692
3693 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3694 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3695
3696 * s/usg5-4-common.h (USG, USG5):
3697 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3698 * s/sol2-6.h (SOLARIS2):
3699 * s/irix6-5.h (IRIX6_5):
3700 * s/hpux10-20.h (USG, USG5, HPUX):
3701 * s/gnu-linux.h (USG, GNU_LINUX):
3702 * s/freebsd.h (BSD_SYSTEM):
3703 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3704 * s/cygwin.h (CYGWIN):
3705 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3706 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3707
3708 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3709
3710 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3711
3712 2012-07-13 Glenn Morris <rgm@gnu.org>
3713
3714 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3715
3716 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3717
3718 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3719 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3720
3721 2012-07-12 Glenn Morris <rgm@gnu.org>
3722
3723 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3724
3725 * process.c (init_process_emacs): Rename from init_process.
3726 The old name is also the name of a Mach system call.
3727 * lisp.h, emacs.c: Update for this name change.
3728 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3729 longer needed.
3730
3731 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3732
3733 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3734 memmove call that removes glyphs covered by the left truncation
3735 glyph. Improve commentary.
3736 (display_line): Fix display of continuation glyphs on GUI frames
3737 when the right fringe is turned off and variable-size fonts are
3738 used in the window. Move the code that appends a stretch glyph to
3739 produce_special_glyphs, so that it could be used for truncation
3740 and continuation glyphs alike.
3741 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3742 glyph of a suitably computed width, to align the special glyphs at
3743 the window margin. Code moved from display_line. (Bug#11832)
3744
3745 2012-07-12 Glenn Morris <rgm@gnu.org>
3746
3747 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3748
3749 * s/gnu-linux.h, s/hpux10-20.h:
3750 Do not unconditionally define HAVE_XRMSETDATABASE.
3751
3752 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3753
3754 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3755
3756 Fix typos that broke OS X build.
3757 Reported by Randal L. Schwartz in
3758 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3759 * nsterm.m (ns_timeout): Add missing local decl.
3760 (ns_get_color): snprintf -> sprintf, to fix typo.
3761
3762 2012-07-12 Glenn Morris <rgm@gnu.org>
3763
3764 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3765 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3766 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3767 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3768
3769 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3770 Move PTY_OPEN to configure.
3771
3772 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3773 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3774 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3775
3776 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3777
3778 Use empty_unibyte_string where applicable.
3779 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3780 * lread.c (read1): Likewise.
3781 * xsettings.c (syms_of_xsettings): Likewise.
3782
3783 2012-07-12 Glenn Morris <rgm@gnu.org>
3784
3785 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3786 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3787 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3788 * s/hpux10-20.h (RUN_TIME_REMAP):
3789 * s/bsd-common.h (TABDLY): Move to configure.
3790
3791 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3792
3793 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3794
3795 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3796 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3797
3798 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3799
3800 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3801 * s/template.h: Move NARROWPROTO to configure.
3802
3803 2012-07-11 Glenn Morris <rgm@gnu.org>
3804
3805 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3806 unused since 2011-01-17 change to systty.h.
3807
3808 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3809 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3810 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3811
3812 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3813
3814 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3815
3816 2012-07-11 Glenn Morris <rgm@gnu.org>
3817
3818 * s/darwin.h, s/gnu-linux.h, s/template.h:
3819 Move INTERRUPT_INPUT to configure.
3820
3821 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3822
3823 Minor adjustments to interning code.
3824 * lisp.h (intern, intern_c_string): Redefine as static inline
3825 wrappers for intern_1 and intern_c_string_1, respectively.
3826 (intern_1, intern_c_string_1): Rename prototypes.
3827 * lread.c (intern_1, intern_c_string_1, oblookup):
3828 Simplify Vobarray checking.
3829 * font.c (font_intern_prop): Likewise. Adjust comment.
3830 * w32font.c (intern_font_name): Likewise.
3831
3832 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3833
3834 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3835
3836 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3837 of Fcar/Fcdr if possible.
3838 * font.c (check_otf_features): Likewise.
3839 * fontset.c (Fnew_fontset): Likewise.
3840 * gnutls.c (Fgnutls_boot): Likewise.
3841 * minibuf.c (read_minibuf): Likewise.
3842 * msdos.c (IT_set_frame_parameters): Likewise.
3843 * xmenu.c (Fx_popup_dialog): Likewise.
3844 * w32menu.c (Fx_popup_dialog): Likewise.
3845
3846 2012-07-11 Glenn Morris <rgm@gnu.org>
3847
3848 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3849 since nothing has defined it on these platforms.
3850
3851 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3852 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3853
3854 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3855 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3856 Move CLASH_DETECTION to configure.
3857
3858 * s/gnu.h: Remove file, which is now empty.
3859
3860 * s/gnu.h, s/gnu-linux.h:
3861 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3862
3863 2012-07-11 John Wiegley <johnw@newartisans.com>
3864
3865 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3866 function attribute, so we only use it if it exists in the
3867 compiler.
3868
3869 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3870
3871 Avoid call to strlen in fast_c_string_match_ignore_case.
3872 * search.c (fast_c_string_match_ignore_case): Change to use
3873 length argument. Adjust users accordingly.
3874 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3875
3876 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3877
3878 Assume mkdir, rmdir.
3879 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
3880 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
3881
3882 Assume rename.
3883 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
3884
3885 Assume perror.
3886 * s/hpux10-20.h (HAVE_PERROR): Remove.
3887 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
3888 Remove dummy definition, as this problem was obsolete long ago.
3889
3890 Assume strerror.
3891 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
3892
3893 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3894
3895 Avoid calls to strlen in font processing functions.
3896 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
3897 (font_open_by_name): Change to use length argument.
3898 Adjust users accordingly.
3899 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
3900 Adjust prototypes.
3901 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
3902 Change to return ptrdiff_t.
3903 (xfont_list_pattern, xfont_match): Use length returned by
3904 xfont_decode_coding_xlfd.
3905 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
3906
3907 2012-07-11 Glenn Morris <rgm@gnu.org>
3908
3909 * s/darwin.h, s/freebsd.h, s/netbsd.h:
3910 Move DONT_REOPEN_PTY to configure.
3911
3912 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
3913 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
3914
3915 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
3916
3917 Remove "#define unix" that is no longer needed (Bug#11905).
3918 * s/aix4-2.h (unix): Remove; no longer needed.
3919
3920 EMACS_TIME simplification (Bug#11875).
3921 This replaces macros (which typically do not work in GDB)
3922 with functions, typedefs and enums, making the code easier to debug.
3923 The functional style also makes code easier to read and maintain.
3924 * systime.h: Include <sys/time.h> on all hosts, not just if
3925 WINDOWSNT, since 'struct timeval' is needed in general.
3926 (EMACS_TIME): Now a typedef, not a macro.
3927 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
3928 not macros.
3929 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
3930 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
3931 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
3932 (EMACS_TIME_LE): Now functions, not macros.
3933 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
3934 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
3935 which are not functions. All uses rewritten to use:
3936 (make_emacs_time): New function.
3937 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
3938 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
3939 not functions. All uses rewritten to use the following, respectively:
3940 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
3941 (add_emacs_time, sub_emacs_time): New functions.
3942 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
3943 * fileio.c (Fcopy_file):
3944 * xterm.c (XTflash): Get the current time closer to when it's used.
3945 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
3946
3947 * bytecode.c (targets): Suppress -Woverride-init warnings.
3948
3949 Simplify by avoiding confusing use of strncpy etc.
3950 * doc.c (Fsnarf_documentation):
3951 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3952 * frame.c (Fmake_terminal_frame):
3953 * gtkutil.c (get_utf8_string):
3954 * lread.c (openp):
3955 * nsmenu.m (ns_update_menubar):
3956 * regex.c (regerror):
3957 Prefer memcpy to strncpy and strncat when either will do.
3958 * fileio.c (Fsubstitute_in_file_name):
3959 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3960 (menu_separator_name_p):
3961 * nsmenu.m (ns_update_menubar):
3962 Prefer memcmp to strncmp when either will do.
3963 * nsterm.m: Include <ftoastr.h>.
3964 (ns_get_color):
3965 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3966 Prefer snprintf to strncpy.
3967 * nsterm.m (ns_term_init):
3968 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3969 * nsterm.m (ns_term_init):
3970 Avoid the need for strncpy, by using build_string or
3971 make_unibyte_string directly. Use dtoastr, not snprintf.
3972 * process.c (Fmake_network_process): Diagnose service names that
3973 are too long, rather than silently truncating them or creating
3974 non-null-terminated names.
3975 (Fnetwork_interface_info): Likewise, for interface names.
3976 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3977 Prefer sprintf to strncat.
3978 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3979 Prefer vsnprintf to vsprintf + strncpy.
3980
3981 2012-07-10 Glenn Morris <rgm@gnu.org>
3982
3983 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3984 Clarify fallback case.
3985
3986 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3987
3988 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3989 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3990 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
3991 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
3992 where argument type is known to be a Lisp_Cons.
3993
3994 2012-07-10 Tom Tromey <tromey@redhat.com>
3995
3996 * bytecode.c (BYTE_CODE_THREADED): New macro.
3997 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3998 (enum byte_code_op): New type.
3999 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4000 (exec_byte_code): Use them. Use token threading when applicable.
4001
4002 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4003
4004 Optimize pure C strings initialization.
4005 * lisp.h (make_pure_string): Fix prototype.
4006 (build_pure_c_string): New function, defined as static inline. This
4007 provides a better opportunity to optimize away calls to strlen when
4008 the function is called with compile-time constant argument.
4009 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4010 argument, adjust users accordingly. Use build_pure_c_string where
4011 appropriate.
4012 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4013 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4014 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4015
4016 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4017
4018 Avoid calls to strlen in miscellaneous functions.
4019 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4020 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4021 * lread.c (openp): Likewise.
4022
4023 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4024
4025 Avoid calls to strlen in path processing functions.
4026 * fileio.c (file_name_as_directory): Add comment. Change to add
4027 srclen argument and return the length of result. Adjust users
4028 accordingly.
4029 (directory_file_name): Fix comment. Change to add srclen argument,
4030 swap 1st and 2nd arguments to obey the common convention.
4031 Adjust users accordingly.
4032 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4033
4034 2012-07-10 Glenn Morris <rgm@gnu.org>
4035
4036 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4037 Move PENDING_OUTPUT_COUNT definition to configure.
4038
4039 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4040 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4041 * s/gnu.h (DATA_START): Move definitions to configure.
4042
4043 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4044 We include usg5-4-common.h, which defines them both.
4045
4046 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4047 O_RDONLY already includes it).
4048
4049 Stop ns builds setting the EMACSLOADPATH environment variable.
4050 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4051 Now it does not set EMACSLOADPATH, just returns the load-path string.
4052 * nsterm.h: Update accordingly.
4053 * lread.c [HAVE_NS]: Include nsterm.h.
4054 (init_lread) [HAVE_NS]: Use ns_load_path.
4055 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4056
4057 2012-07-09 Glenn Morris <rgm@gnu.org>
4058
4059 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4060 since the included bsd-common.h does so.
4061
4062 Stop ns builds setting the EMACSPATH environment variable.
4063 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4064 (ns_init_paths): Do not set EMACSPATH.
4065 * nsterm.h (ns_exec_path): Add it.
4066 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4067 Use ns_exec_path.
4068
4069 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4070
4071 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4072
4073 * process.c (wait_reading_process_output): 'waitchannels' was unset
4074 when read_kbd || !NILP (wait_for_cell); fix this.
4075
4076 Add GCC-style 'const' attribute to functions that can use it.
4077 * character.h (char_resolve_modifier_mask):
4078 * keyboard.h (make_ctrl_char):
4079 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4080 (init_character_once, next_almost_prime, init_fns, init_image)
4081 (flush_pending_output, init_sound):
4082 * mem-limits.h (start_of_data):
4083 * menu.h (finish_menu_items):
4084 Add ATTRIBUTE_CONST.
4085 * emacs.c (DEFINE_DUMMY_FUNCTION):
4086 Declare the dummy function with ATTRIBUTE_CONST.
4087 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4088 Add decls with ATTRIBUTE_CONST.
4089
4090 Minor improvements to make_formatted_string.
4091 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4092 where int is good enough, as vsprintf returns an int.
4093 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4094
4095 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4096
4097 Use make_formatted_string to avoid double length calculation.
4098 * lisp.h (make_formatted_string): New prototype.
4099 * alloc.c (make_formatted_string): New function.
4100 * buffer.c (Fgenerate_new_buffer_name): Use it.
4101 * dbus.c (syms_of_dbusbind): Likewise.
4102 * editfns.c (Fcurrent_time_zone): Likewise.
4103 * filelock.c (get_boot_time): Likewise.
4104 * frame.c (make_terminal_frame, set_term_frame_name)
4105 (x_report_frame_params): Likewise.
4106 * image.c (gs_load): Likewise.
4107 * minibuf.c (get_minibuffer): Likewise.
4108 * msdos.c (dos_set_window_size): Likewise.
4109 * process.c (make_process): Likewise.
4110 * xdisp.c (ensure_echo_area_buffers): Likewise.
4111 * xsettings.c (apply_xft_settings): Likewise.
4112
4113 2012-07-09 Glenn Morris <rgm@gnu.org>
4114
4115 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4116 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4117 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4118 * nsterm.h (ns_etc_directory): Add it.
4119 * callproc.c [HAVE_NS]: Include nsterm.h.
4120 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4121
4122 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4123
4124 Move marker debugging code under MARKER_DEBUG.
4125 * marker.c (MARKER_DEBUG): Move marker debugging code under
4126 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4127 for bootstrap with --enable-checking (~3x slowdown reported
4128 by Juanma Barranquero <lekktu@gmail.com>).
4129 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4130
4131 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4132
4133 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4134 See <http://bugs.gnu.org/11825#29>.
4135
4136 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4137
4138 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4139 has no font, use the frame's font. (Bug#11813)
4140 (display_line): Add commentary about displaying truncation glyphs
4141 on GUI frames.
4142 (produce_special_glyphs): Move here from term.c.
4143
4144 * term.c (produce_special_glyphs): Move to xdisp.c.
4145
4146 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4147 section.
4148
4149 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4150
4151 * xdisp.c (display_line): Avoid warning about implicit declaration
4152 of FRAME_FONT.
4153
4154 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4155
4156 * lisp.h: Remove empty conditional.
4157
4158 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4159
4160 * lread.c (load_path_check): Now static.
4161
4162 Fix some minor --with-ns problems found by static checking.
4163 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4164 (x_set_font) [!HAVE_X_WINDOWS]:
4165 * image.c (xpm_load_image) [HAVE_NS]:
4166 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4167 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4168 Remove unused local.
4169 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4170 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4171 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4172 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4173 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4174 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4175 Fix pointer signedness problem.
4176 * xfaces.c (FRAME_X_FONT_TABLE):
4177 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4178
4179 2012-07-07 Glenn Morris <rgm@gnu.org>
4180
4181 * lread.c (load_path_check): New function, split from init_lread.
4182 (init_lread): Reorganize. Motivation:
4183 If EMACSLOADPATH is set, check/warn about that rather than the
4184 defaults, which we are not going to use. Hence we can remove
4185 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4186 Don't warn if site-lisp directories are missing.
4187 If not installed, start from a blank load-path, since
4188 PATH_LOADSEARCH refers to the eventual installation directories.
4189
4190 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4191
4192 Support truncation and continuation glyphs on GUI frames, when
4193 fringes are disabled. (Bug#11832)
4194 * xdisp.c (init_iterator): Get dimensions of truncation and
4195 continuation glyphs even if on GUI frames.
4196 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4197 or both, are absent.
4198 (start_display, move_it_in_display_line_to): Handle the case of a
4199 GUI frame without a fringe to display continuation or truncation
4200 glyphs.
4201 (insert_left_trunc_glyphs): Support GUI frames: make sure
4202 truncation glyphs overwrite enough glyphs from the current line to
4203 have sufficient space in pixels.
4204 (display_line): Support truncation and continuation glyphs on GUI
4205 frames. If some spare pixels are left on the line after inserting
4206 the truncation glyphs, fill that space with a stretch glyph of a
4207 suitably computed width.
4208
4209 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4210 produce_glyphs, to support GUI sessions.
4211
4212 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4213
4214 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4215
4216 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4217
4218 Do not require float-time's arg to fit in time_t (Bug#11825).
4219 This works better on hosts where time_t is unsigned, and where
4220 float-time is applied to the (negative) difference between two times.
4221 * editfns.c (decode_time_components): Last arg is now double *,
4222 not int *, and means to store all the result as a double, without
4223 worrying about whether the seconds part fits in time_t.
4224 All callers changed.
4225 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4226 All callers changed.
4227 (Ffloat_time): Do not fail merely because the specified time falls
4228 outside of time_t range.
4229
4230 2012-07-07 Glenn Morris <rgm@gnu.org>
4231
4232 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4233 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4234 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4235
4236 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4237
4238 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4239 Update dependencies.
4240
4241 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4242
4243 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4244
4245 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4246 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4247 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4248 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4249 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4250 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4251
4252 * xfont.c (compare_font_names): Redo to omit the need for casts.
4253
4254 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4255
4256 * xfns.c (Fx_change_window_property): Doc fix.
4257 * w32fns.c (Fx_change_window_property): Doc fix.
4258
4259 * w32fns.c (Fx_window_property): Accept the same arguments as the
4260 X Windows version. Doc fix.
4261 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4262
4263 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4264 Eli Zaretskii <eliz@gnu.org>
4265
4266 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4267 Windows-specific code from nt/config.nt moved here.
4268 Obsolete settings removed.
4269
4270 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4271
4272 * process.c: Avoid unnecessary calls to gettime.
4273 (wait_reading_process_output): Don't get the time of day
4274 when gobbling data immediately and not waiting, as there's no need
4275 for it in that case. This removes a FIXME.
4276
4277 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4278
4279 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4280 is defined (Bug#11768).
4281
4282 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4283
4284 Fix marker debugging code.
4285 * marker.c (byte_char_debug_check): Do not perform the check
4286 if buffer is not multibyte.
4287 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4288 Call byte_char_debug_check with correct arguments.
4289
4290 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4291
4292 Compile marker debugging code only if ENABLE_CHECKING is defined.
4293 * marker.c (byte_char_debug_check, count_markers):
4294 Use only if ENABLE_CHECKING is defined.
4295 (byte_debug_flag): Remove.
4296 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4297 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4298
4299 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4300
4301 Avoid code repetition in marker-related functions.
4302 * marker.c (attach_marker): New function.
4303 (Fset_marker, set_marker_restricted, set_marker_both)
4304 (set_marker_restricted_both): Use it.
4305 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4306 Consistently rename charno to charpos.
4307 (marker_position): Add eassert.
4308 (marker_byte_position): Convert to eassert.
4309
4310 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4311
4312 Simplify list operations in unchain_overlay and unchain_marker.
4313 * buffer.c (unchain_overlay): Simplify. Add comment.
4314 * marker.c (unchain_marker): Simplify. Fix comments.
4315
4316 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4317
4318 Introduce fast path for the widely used marker operation.
4319 * alloc.c (build_marker): New function.
4320 * lisp.h (build_marker): New prototype.
4321 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4322 * composite.c (autocmp_chars): Likewise.
4323 * editfns.c (buildmark): Remove.
4324 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4325 (save_restriction_save): Use build_marker.
4326 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4327 * window.c (save_window_save): Likewise.
4328
4329 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4330
4331 Do not use Fdelete_overlay in delete_all_overlays
4332 to avoid redundant calls to unchain_overlay.
4333 * buffer.c (drop_overlay): New function.
4334 (delete_all_overlays, Fdelete_overlay): Use it.
4335 * minibuf.c (get_minibuffer): Fix comment.
4336
4337 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4338
4339 Port to OpenBSD 5.1 amd64.
4340 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4341 This is needed for OpenBSD, and should be harmless on all BSD systems.
4342 Also, include <sys/sysctl.h>, as it should be available on all
4343 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4344 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4345 use p_pid member, not kp_proc.pid.
4346
4347 2012-07-06 Glenn Morris <rgm@gnu.org>
4348
4349 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4350
4351 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4352
4353 More xmalloc and related cleanup.
4354 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4355 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4356 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4357 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4358 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4359 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4360 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4361 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4362 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4363 * xterm.c:
4364 Omit needless casts involving void * pointers and allocation.
4365 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4366 as the former is more robust if P's type is changed.
4367 Prefer xzalloc to xmalloc + memset 0.
4368 Simplify malloc-or-realloc to realloc.
4369 Don't worry about xmalloc returning a null pointer.
4370 Prefer xstrdup to xmalloc + strcpy.
4371 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4372 growing it.
4373 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4374 alloca of a constant.
4375
4376 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4377
4378 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4379 hscroll is larger than the line width. Fixes long and futile
4380 looping inside extend_face_to_end_of_line (on a TTY) producing
4381 glyphs that are not needed and thrown away.
4382
4383 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4384
4385 * marker.c (set_marker_restricted_both): Simplify by using
4386 clip_to_bounds.
4387
4388 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4389
4390 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4391
4392 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4393
4394 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4395 not defined (Bug#11768).
4396 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4397 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4398 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4399 followed by gtk_box_set_homogeneous (Bug#11768).
4400 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4401 (update_theme_scrollbar_width, xg_create_scroll_bar):
4402 Use gtk_scrollbar_new (Bug#11768).
4403 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4404 (is_box_type): New function (Bug#11768).
4405 (xg_tool_item_stale_p): Call is_box_type.
4406 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4407 with default display (Bug#11768).
4408
4409 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4410
4411 * xdisp.c (window_hscroll_limited): New function.
4412 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4413 coordinates when window's hscroll is set to insanely large
4414 values. (Bug#11857)
4415
4416 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4417
4418 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4419 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4420
4421 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4422
4423 Cleanup xmalloc.
4424 * lisp.h (xzalloc): New prototype. Omit needless casts.
4425 * alloc.c (xzalloc): New function. Omit needless casts.
4426 * charset.c: Omit needless casts. Convert all calls to
4427 xmalloc with following memset to xzalloc.
4428 * dispnew.c: Likewise.
4429 * fringe.c: Likewise.
4430 * image.c: Likewise.
4431 * sound.c: Likewise.
4432 * term.c: Likewise.
4433 * w32fns.c: Likewise.
4434 * w32font.c: Likewise.
4435 * w32term.c: Likewise.
4436 * xfaces.c: Likewise.
4437 * xfns.c: Likewise.
4438 * xterm.c: Likewise.
4439 * atimer.c: Omit needless casts.
4440 * buffer.c: Likewise.
4441 * callproc.c: Likewise.
4442 * ccl.c: Likewise.
4443 * coding.c: Likewise.
4444 * composite.c: Likewise.
4445 * doc.c: Likewise.
4446 * doprnt.c: Likewise.
4447 * editfns.c: Likewise.
4448 * emacs.c: Likewise.
4449 * eval.c: Likewise.
4450 * filelock.c: Likewise.
4451 * fns.c: Likewise.
4452 * gtkutil.c: Likewise.
4453 * keyboard.c: Likewise.
4454 * lisp.h: Likewise.
4455 * lread.c: Likewise.
4456 * minibuf.c: Likewise.
4457 * msdos.c: Likewise.
4458 * print.c: Likewise.
4459 * process.c: Likewise.
4460 * region-cache.c: Likewise.
4461 * search.c: Likewise.
4462 * sysdep.c: Likewise.
4463 * termcap.c: Likewise.
4464 * terminal.c: Likewise.
4465 * tparam.c: Likewise.
4466 * w16select.c: Likewise.
4467 * w32.c: Likewise.
4468 * w32reg.c: Likewise.
4469 * w32select.c: Likewise.
4470 * w32uniscribe.c: Likewise.
4471 * widget.c: Likewise.
4472 * xdisp.c: Likewise.
4473 * xmenu.c: Likewise.
4474 * xrdb.c: Likewise.
4475 * xselect.c: Likewise.
4476
4477 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4478
4479 * fileio.c (time_error_value): Check the right error number.
4480 Problem reported by Troels Nielsen in
4481 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4482
4483 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4484
4485 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4486 This should be fixed in a better way; see Eli Zaretskii in
4487 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4488 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4489
4490 * fileio.c (time_error_value): Rename from special_mtime.
4491 The old name's problems were noted by Eli Zaretskii in
4492 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4493
4494 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4495 This variable's comment says Emacs needs at least one GDB-visible
4496 symbol of type enum pvec_type, to work around GDB problems.
4497 The symbol's value doesn't matter.
4498
4499 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4500 that causes compilation to fail on pre-C99 compilers.
4501
4502 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4503
4504 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4505 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4506
4507 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4508
4509 * buffer.c (init_buffer_once): Fix initialization of
4510 headers for buffer_defaults and buffer_local_symbols.
4511 Reported by Juanma Barranquero <lekktu@gmail.com>.
4512
4513 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4514
4515 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4516 * lisp.h (enum pvec_type): Use fewer bits.
4517 (PSEUDOVECTOR_SIZE_BITS): New constant.
4518 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4519 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4520 change in pvec_type.
4521 (PSEUDOVECTOR_TYPEP): New macro.
4522 (TYPED_PSEUDOVECTORP): Use it.
4523 * fns.c (internal_equal): Adapt code to extract pvectype.
4524 * emacs.c (gdb_pvec_type): Update type.
4525 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4526 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4527 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4528 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4529 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4530 abusing vector->header.next.nbytes.
4531 (live_vector_p): Use PVEC_TYPE.
4532 (mark_object): Adapt code to extract pvectype. Use switch.
4533
4534 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4535
4536 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4537 Tighten new eassert a bit.
4538
4539 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4540
4541 Fix compilation with --enable-gcc-warnings and -O1
4542 optimization level.
4543 * doprnt.c (doprnt): Change type of tem to int, initialize
4544 to avoid compiler warning. Add eassert.
4545 * search.c (simple_search): Initialize match_byte to avoid
4546 compiler warning. Add eassert.
4547
4548 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4549
4550 Avoid weird behavior with large horizontal scrolls.
4551 Without this change, for example, large hscroll values would
4552 mess up Emacs's display on Fedora 15 x86, presumably due to
4553 overflows in int calculations in the display code.
4554 Also, if buffers had long lines, Emacs would freeze.
4555 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4556 (set_window_hscroll): New function, containing the old guts of
4557 Fset_window_hscroll. Return the clipped value.
4558 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4559 This avoids the need to check against PTRDIFF_MAX.
4560
4561 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4562
4563 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4564
4565 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4566
4567 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4568
4569 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4570 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4571 since GCC 4.4.6 issues a bogus warning for them.
4572
4573 Fix bugs in file timestamp newness comparisons.
4574 * fileio.c (Ffile_newer_than_file_p):
4575 * lread.c (Fload): Use full timestamp resolution of files,
4576 not just the 1-second resolution, so that files that are only
4577 slightly newer still count as newer.
4578 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4579 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4580
4581 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4582
4583 * fileio.c: Improve handling of file time marker. (Bug#11852)
4584 (special_mtime): New function.
4585 (Finsert_file_contents, Fverify_visited_file_modtime):
4586 Use it to set special mtime values consistently.
4587
4588 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4589
4590 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4591 marker for non-existing file. (Bug#11852)
4592
4593 2012-07-03 Glenn Morris <rgm@gnu.org>
4594
4595 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4596 and did not make it into globals.h).
4597
4598 2012-07-03 Tom Tromey <tromey@redhat.com>
4599
4600 * window.c (Fset_window_margins, Fset_window_fringes)
4601 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4602 * textprop.c (Fprevious_property_change): No longer static.
4603 * syntax.c (Fsyntax_table_p): No longer static.
4604 * process.c (Fget_process, Fprocess_datagram_address): No longer
4605 static.
4606 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4607 * keyboard.c (Fcommand_execute): No longer static.
4608 Remove EXFUN.
4609 * insdel.c (Fcombine_after_change_execute): No longer static.
4610 * image.c (Finit_image_library): No longer static.
4611 * fileio.c (Fmake_symbolic_link): No longer static.
4612 * eval.c (Ffetch_bytecode): No longer static.
4613 * editfns.c (Fuser_full_name): No longer static.
4614 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4615 No longer static.
4616 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4617 static.
4618 * dired.c (Ffile_attributes): No longer static.
4619 * composite.c (Fcomposition_get_gstring): No longer static.
4620 * callproc.c (Fgetenv_internal): No longer static.
4621
4622 * ccl.h: Remove EXFUNs.
4623 * buffer.h: Remove EXFUNs.
4624 * dispextern.h: Remove EXFUNs.
4625 * intervals.h: Remove EXFUNs.
4626 * fontset.h: Remove EXFUN.
4627 * font.h: Remove EXFUNs.
4628 * dosfns.c (system_process_attributes): Remove EXFUN.
4629 * keymap.h: Remove EXFUNs.
4630 * lisp.h: Remove EXFUNs.
4631 * w32term.h: Remove EXFUNs.
4632 * window.h: Remove EXFUNs.
4633 * xsettings.h: Remove EXFUN.
4634 * xterm.h: Remove EXFUN.
4635
4636 2012-07-03 Glenn Morris <rgm@gnu.org>
4637
4638 * lisp.h (Frandom): Make it visible to C.
4639 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4640 buffer for invisible buffers. (Bug#1229)
4641
4642 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4643
4644 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4645 values which aren't power of 2.
4646 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4647 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4648 accordingly.
4649
4650 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4651
4652 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4653
4654 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4655
4656 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4657
4658 * alloc.c (allocate_vector_block): Remove redundant
4659 calls to mallopt if DOUG_LEA_MALLOC is defined.
4660 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4661 avoid calls to mallopt if zero_vector is returned.
4662
4663 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4664
4665 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4666 is enabled, avoid dereferencing NULL current_sblock if
4667 running undumped.
4668
4669 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4670
4671 Cleanup basic buffer management.
4672 * buffer.h (struct buffer): Change layout to use generic vector
4673 marking code. Fix some comments. Change type of 'clip_changed'
4674 to bitfield. Remove unused #ifndef old.
4675 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4676 (GET_OVERLAYS_AT): Fix indentation.
4677 (for_each_per_buffer_object_at): New macro.
4678 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4679 (Fbuffer_local_variables): Use it.
4680 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4681 * alloc.c (allocate_buffer): Adjust to match new layout of
4682 struct buffer. Fix comment.
4683 (mark_overlay): New function.
4684 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4685 Lisp area of struct buffer.
4686 (mark_object): Use it. Adjust marking of misc objects
4687 and related comments.
4688
4689 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4690
4691 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4692 wrapper that is not needed because the wrapped code is a no-op (zero
4693 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4694 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4695
4696 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4697
4698 * alloc.c (mark_buffer): Simplify. Remove prototype.
4699 (mark_object): Add comment. Reorganize marking of vector-like
4700 objects. Use CHECK_LIVE for all vector-like objects except buffers
4701 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4702 Avoid redundant calls to mark_vectorlike for bool vectors.
4703
4704 2012-06-30 Glenn Morris <rgm@gnu.org>
4705
4706 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4707
4708 * epaths.in (PATH_SITELOADSEARCH): New.
4709 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4710 This is rather than relying on --enable-locallisppath elements
4711 having "site-lisp" in their names. (Bug#10208#25, 11658)
4712
4713 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4714
4715 * w32proc.c (sys_select): Accept and ignore one more argument.
4716
4717 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4718
4719 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4720 (pselect) [!MS_DOS]: Redirect to sys_select.
4721
4722 * sysdep.c: Don't include dos.h and dosfns.h.
4723
4724 * process.c (sys_select):
4725 * msdos.c (sys_select): Accept one more argument and ignore it.
4726
4727 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4728 adapt data types and code to that.
4729
4730 * dosfns.c:
4731 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4732 which clashes with the gnulib function of the same name.
4733
4734 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4735
4736 * font.c (font_style_to_value, font_style_symbolic)
4737 (font_prop_validate_style): Add type checks for values in
4738 font_style_table.
4739
4740 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4741 argument.
4742 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4743 uses.
4744
4745 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4746
4747 * xdisp.c (try_window_id): Undo last change.
4748
4749 * w32.c (getwd): Adjust commentary about startup_dir.
4750 (init_environment): Always call sys_access, even in non-MSVC
4751 builds. Don't chdir to the directory of the Emacs executable.
4752 This undoes code from 1997 which was justified by the need to
4753 "avoid conflicts when removing and renaming directories". But its
4754 downside was that every relative file name was being interpreted
4755 relative to the directory of the Emacs executable, which can never
4756 be TRT. In particular, it broke sys_access when called with
4757 relative file names.
4758 (sys_access): Map GetLastError to errno.
4759
4760 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4761
4762 * window.h (struct window): Change type of 'fringes_outside_margins'
4763 to bitfield. Fix comment. Adjust users accordingly.
4764 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4765 Adjust comment.
4766 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4767 to ptrdiff_t.
4768
4769 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4770
4771 * gnutls.c (emacs_gnutls_handshake):
4772 Add QUIT to make the loop interruptible.
4773
4774 2012-06-29 Glenn Morris <rgm@gnu.org>
4775
4776 * charset.c (init_charset): Make lack of etc/charsets fatal.
4777
4778 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4779
4780 * editfns.c (region_limit): Fix type mismatch.
4781
4782 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4783
4784 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4785 undefined. Convert from xassert to eassert.
4786 * nsmenu.m: Convert from xassert to eassert.
4787 * nsterm.m: Likewise.
4788
4789 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4790
4791 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4792
4793 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4794
4795 Avoid integer overflow on scroll-left and scroll-right.
4796 * window.c (HSCROLL_MAX): New macro.
4797 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4798 overflow when requested scroll falls outside ptrdiff_t range.
4799
4800 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4801
4802 * window.h (struct window): Change type of 'hscroll',
4803 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4804 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4805 Adjust users accordingly.
4806 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4807 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4808 from EMACS_INT to ptrdiff_t.
4809 (make_window): Omit redundant initialization.
4810
4811 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4812
4813 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4814
4815 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4816
4817 * window.h (struct window): Change type of 'use_time' and
4818 'sequence_number' from Lisp_Object to int.
4819 * frame.c (make_frame): Adjust users accordingly.
4820 * print.c (print_object): Likewise.
4821 * window.c (select_window, Fwindow_use_time, make_parent_window)
4822 (make_window): Likewise.
4823
4824 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4825
4826 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4827 enabled with --enable-checking=[all,glyphs] configure option.
4828 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4829 adjust comments accordingly.
4830 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4831 undefined, adjust comments accordingly.
4832 * image.c: Likewise.
4833 * scroll.c: Likewise.
4834 * w32fns.c: Likewise.
4835 * w32term.c: Likewise.
4836 * xdisp.c: Likewise.
4837 * xfaces.c: Likewise.
4838 * xfns.c: Likewise.
4839 * xterm.c: Likewise.
4840
4841 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4842
4843 Generalize run-time debugging checks.
4844 * dispextern.h (XASSERTS): Remove.
4845 * fontset.c (xassert): Remove.
4846 Convert from xassert to eassert.
4847 * alloc.c: Convert from xassert to eassert.
4848 * bidi.c: Likewise.
4849 * dispnew.c: Likewise.
4850 * fns.c: Likewise.
4851 * fringe.c: Likewise.
4852 * ftfont.c: Likewise.
4853 * gtkutil.c: Likewise.
4854 * image.c: Likewise.
4855 * keyboard.c: Likewise.
4856 * menu.c: Likewise.
4857 * process.c: Likewise.
4858 * scroll.c: Likewise.
4859 * sound.c: Likewise.
4860 * term.c: Likewise.
4861 * w32console.c: Likewise.
4862 * w32fns.c: Likewise.
4863 * w32term.c: Likewise.
4864 * window.c: Likewise.
4865 * xdisp.c: Likewise.
4866 * xfaces.c: Likewise.
4867 * xfns.c: Likewise.
4868 * xselect.c: Likewise.
4869 * xterm.c: Likewise.
4870
4871 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4872
4873 * fns.c (maybe_resize_hash_table): Output message when growing the
4874 purify-hashtable.
4875
4876 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4877
4878 * alloc.c (allocate_string_data): Remove dead code.
4879 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
4880 avoid GCC warning about unused macro.
4881
4882 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4883
4884 * alloc.c (allocate_string): Omit intervals initialization.
4885 * alloc.c (make_uninit_multibyte_string): Initialize intervals
4886 as in make_pure_string and make_pure_c_string.
4887
4888 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4889
4890 * alloc.c (allocate_string): Fix last change.
4891
4892 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4893
4894 * alloc.c (allocate_string): Remove two redundant calls
4895 to memset, add explicit initialization where appropriate.
4896
4897 2012-06-27 Glenn Morris <rgm@gnu.org>
4898
4899 * lisp.mk (lisp): Remove paths.elc.
4900
4901 2012-06-27 Chong Yidong <cyd@gnu.org>
4902
4903 * doc.c (Fsubstitute_command_keys): Fix punctuation.
4904
4905 2012-06-26 John Wiegley <johnw@newartisans.com>
4906
4907 * unexmacosx.c (copy_data_segment): Add two section names used
4908 on Mac OS X Lion: __mod_init_func and __mod_term_func.
4909
4910 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
4911 when building with Clang.
4912
4913 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
4914
4915 * eval.c (Fapply): Allow calling it with a single argument.
4916
4917 2012-06-26 Eli Zaretskii <eliz@gnu.org>
4918
4919 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
4920 _stricmp and _strnicmp.
4921 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
4922
4923 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4924
4925 * alloc.c (allocate_window): Zero out non-Lisp part of newly
4926 allocated window.
4927 (allocate_process): Likewise for new process.
4928 (allocate_terminal): Change to use offsetof.
4929 (allocate_frame): Likewise.
4930 * frame.c (make_frame): Omit redundant initialization.
4931 * window.c (make_parent_window): Use memset.
4932 (make_window): Omit redundant initialization.
4933 * process.c (make_process): Omit redundant initialization.
4934 * terminal.c (create_terminal): Likewise.
4935
4936 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4937
4938 * term.c (delete_tty): Remove redundant call to memset.
4939
4940 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
4941
4942 * alloc.c: Remove build_string.
4943 * lisp.h: Define build_string as static inline. This provides
4944 a better opportunity to optimize away calls to strlen when the
4945 function is called with compile-time constant argument.
4946 * image.c (imagemagick_error): Convert to build_string.
4947 * w32proc.c (sys_spawnve): Likewise.
4948 * xterm.c (x_term_init): Likewise.
4949
4950 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
4951
4952 Use sprintf return value instead of invoking strlen on result.
4953 In the old days this wasn't portable, since some sprintf
4954 implementations returned char *. But they died out years ago and
4955 Emacs already assumes sprintf returns int.
4956 Similarly for float_to_string.
4957 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4958 * ccl.c (ccl_driver):
4959 * character.c (string_escape_byte8):
4960 * data.c (Fnumber_to_string):
4961 * doprnt.c (doprnt):
4962 * print.c (print_object):
4963 * xdisp.c (message_dolog):
4964 * xfns.c (syms_of_xfns):
4965 Use sprintf or float_to_string result to avoid need to call strlen.
4966 * data.c (Fnumber_to_string):
4967 Use make_unibyte_string, since the string must be ASCII.
4968 * lisp.h, print.c (float_to_string): Now returns int length.
4969 * term.c (produce_glyphless_glyph):
4970 Use sprintf result rather than recomputing it.
4971
4972 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4973 * Makefile.in (ALL_CFLAGS):
4974 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4975 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4976
4977 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4978
4979 * dispextern.h (xstrcasecmp): Define to library function
4980 strcasecmp if available.
4981 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4982
4983 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4984
4985 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4986 Avoid comma operator.
4987 * menu.c (push_submenu_start, push_submenu_end)
4988 (push_left_right_boundary, push_menu_pane): Likewise.
4989 * msdos.c (dos_rawgetc): Likewise.
4990
4991 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4992
4993 * xfns.c (xic_create_fontsetname): Remove redundant calls
4994 to memset.
4995
4996 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4997
4998 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4999 sprintf already null-terminates its output.
5000
5001 * xfns.c (x_window): Remove redundant cast.
5002
5003 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5004
5005 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5006 `const char *' to `char *' to avoid compiler warning.
5007
5008 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5009
5010 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5011 instead of truncating it to 63 (admittedly a generous limit).
5012
5013 * process.c: Fix spelling and caps in comments.
5014
5015 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5016
5017 * emacs.c (setpgrp): Remove definition, unused.
5018 * sysdep.c (setpgrp): Remove definition, not used in this file.
5019
5020 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5021
5022 * makefile.w32-in: Update dependencies.
5023
5024 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5025
5026 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5027 (SYSTIME_H): Add nt/inc/sys/time.h.
5028
5029 * systime.h [WINDOWSNT]: Include sys/time.h.
5030
5031 * s/ms-w32.h (struct timespec): Definition moved from
5032 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5033
5034 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5035
5036 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5037 * buffer.h (buffer_slot_type_mismatch):
5038 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5039 * eval.c (unwind_to_catch):
5040 * image.c (my_png_error, my_error_exit):
5041 * keyboard.c (quit_throw_to_read_char, user_error)
5042 (Fexit_recursive_edit, Fabort_recursive_edit):
5043 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5044 (wrong_type_argument, buffer_overflow, __executable_start)
5045 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5046 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5047 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5048 (fatal):
5049 (child_setup) [!DOS_NT]:
5050 * lread.c (end_of_file_error, invalid_syntax):
5051 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5052 * puresize.h (pure_write_error):
5053 * search.c (matcher_overflow):
5054 * sound.c (sound_perror, alsa_sound_perror):
5055 * sysdep.c, syssignal.h (croak):
5056 * term.c (maybe_fatal, vfatal):
5057 * textprop.c (text_read_only):
5058 * undo.c (user_error):
5059 * unexmacosx.c (unexec_error):
5060 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5061 Use _Noreturn rather than NO_RETURN.
5062 No need for separate decl merely because of _Noreturn.
5063 * sound.c (sound_warning, parse_sound):
5064 Remove unnecessary forward decls.
5065
5066 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5067
5068 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5069 * lisp.h (WAIT_READING_MAX): New macro.
5070 * dispnew.c (Fsleep_for, sit_for):
5071 * keyboard.c (kbd_buffer_get_event):
5072 * process.c (Faccept_process_output):
5073 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5074 This improves on the previous patch, which introduced a bug
5075 when time_t is unsigned and as wide as intmax_t.
5076 See <http://bugs.gnu.org/9000#51>.
5077
5078 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5079
5080 * dispnew.c (sit_for, Fsleep_for):
5081 * keyboard.c (kbd_buffer_get_event):
5082 * process.c (Faccept_process_output): Avoid compiler warnings when
5083 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5084
5085 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5086
5087 * makefile.w32-in: Update dependencies.
5088
5089 * w32.c (ltime): Add return type and declare static.
5090 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5091
5092 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5093
5094 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5095 Privately reported by Herbert J. Skuhra.
5096 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5097 All uses changed.
5098 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5099 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5100
5101 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5102
5103 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5104 last argument of make_unibyte_string.
5105
5106 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5107 language ID in the event parameters.
5108
5109 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5110 event.code, not the obscure "character set ID".
5111
5112 2012-06-23 Chong Yidong <cyd@gnu.org>
5113
5114 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5115
5116 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5117
5118 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5119 * w32.c (fdutimens): New function.
5120
5121 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5122
5123 * s/ms-w32.h (pselect): Redirect to sys_select.
5124
5125 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5126
5127 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5128 in the logic of incrementing and decrementing the value of
5129 use_relocatable_buffers.
5130
5131 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5132
5133 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5134 Privately reported by Herbert J. Skuhra.
5135 [__FreeBSD__]: Remove "*/" typo after "#include".
5136 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5137 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5138 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5139 Don't assume EMACS_TIME and struct timeval are the same type.
5140
5141 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5142
5143 Support higher-resolution time stamps (Bug#9000).
5144 The time stamps are only nanosecond-resolution at the C level,
5145 since that's the best that any real-world system supports now.
5146 But they are picosecond-resolution at the Lisp level, as that's
5147 easy, and leaves room for future OS improvements.
5148
5149 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5150 (LIBES): Use it.
5151
5152 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5153 Don't get current time unless it's needed.
5154
5155 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5156 now provides it if it's absent.
5157 (start_atimer): Port to higher-res time stamps.
5158 Check for time stamp overflow. Don't get current time more
5159 often than is needed.
5160
5161 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5162 Include systime.h, not time.h.
5163 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5164
5165 * dired.c: Include stat-time.h.
5166 (Ffile-attributes): File times now have higher resolution.
5167
5168 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5169 (struct image): Timestamp now has higher resolution.
5170
5171 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5172 has at least microseconds now. All uses removed.
5173 (update_frame, update_single_window, update_window, update_frame_1)
5174 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5175 (duration_to_sec_usec): Remove; no longer needed.
5176
5177 * editfns.c (time_overflow): Now extern.
5178 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5179 (float-time, Fformat_time_string, Fcurrent_time_string)
5180 (Fcurrent_time_zone): Accept and generate higher-resolution
5181 time stamps.
5182 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5183 (decode_time_components, lisp_seconds_argument): New functions.
5184 (make_time): Now static.
5185 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5186 Report an error if the time is invalid, rather than having the caller
5187 do that.
5188
5189 * fileio.c: Include <stat-time.h>
5190 (Fcopy_file): Copy higher-resolution time stamps.
5191 Prefer to set the time stamp via a file descriptor if that works.
5192 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5193 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5194 (Fvisited_file_modtime, Fset_visited_file_modtime):
5195 Support higher-resolution time stamps.
5196
5197 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5198
5199 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5200
5201 * image.c (prepare_image_for_display, clear_image_cache)
5202 (lookup_image): Port to higer-resolution time stamps.
5203
5204 * keyboard.c (start_polling, bind_polling_period):
5205 Check for time stamp overflow.
5206 (read_char, kbd_buffer_get_event, timer_start_idle)
5207 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5208 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5209 Port to higher-resolution time stamps. Do not assume time_t is signed.
5210 (decode_timer): New function. Timers are now vectors of length 9,
5211 not 8, to accommodate the picosecond component.
5212 (timer_check_2): Use it.
5213
5214 * nsterm.m (select_timeout, timeval_subtract): Remove.
5215 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5216 as they're a bit more accurate and handle overflow better.
5217 (ns_select): Change prototype to be compatible with pselect.
5218 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5219 * nsterm.h (ns_select): Adjust prototype.
5220
5221 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5222 us-resolution time stamps.
5223 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5224
5225 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5226
5227 * lisp.h (time_overflow): New decl.
5228 (wait_reading_process_output): First arg is now intmax_t, not int,
5229 to accommodate larger waits.
5230
5231 * process.h (struct Lisp_Process.read_output_delay):
5232 Now counts nanoseconds, not microseconds.
5233 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5234 EMACS_HAS_USECS.
5235 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5236 (wait_reading_process_output):
5237 Port to ns-resolution time stamps.
5238 (Faccept_process_output, wait_reading_process_output):
5239 Check for time stamp overflow. Do not assume time_t is signed.
5240 (select_wrapper): Remove; we now use pselect.
5241 (Fprocess_attributes): Now generates ns-resolution time stamps.
5242
5243 * sysdep.c: Include utimens.h. Don't include utime.h
5244 or worry about struct utimbuf; gnulib does that for us now.
5245 (gettimeofday): Remove; gnulib provides a substitute.
5246 (make_timeval): New function.
5247 (set_file_times): Now sets ns-resolution time stamps.
5248 New arg FD; all uses changed.
5249 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5250 (system_process_attributes):
5251 Now returns ns-resolution time stamp. All uses changed.
5252 Check for time stamp overflow.
5253
5254 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5255 provides a substitute now.
5256
5257 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5258 since it guarantees struct timespec.
5259 (EMACS_TIME): Now struct timespec, so that we can support
5260 ns-resolution time stamps.
5261 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5262 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5263 (EMACS_USECS): Remove.
5264 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5265 so multiply the arg by 1000 before storing it.
5266 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5267 New macros.
5268 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5269 Port to ns-resolution time stamps.
5270 (EMACS_TIME_NEG_P): Remove; replaced by....
5271 (EMACS_TIME_SIGN): New macro.
5272 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5273 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5274 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5275 (make_timeval, make_lisp_time, decode_time_components): New decls.
5276 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5277 that it mishandled time_t overflow. You can't compare by subtracting!
5278 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5279 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5280
5281 * term.c: Include <sys/time.h>.
5282 (timeval_to_Time): New function, for proper overflow wraparound.
5283 (term_mouse_position, term_mouse_click): Use it.
5284
5285 * undo.c (record_first_change): Support higher-resolution time stamps
5286 in the undo buffer.
5287 (Fprimitive_undo): Use them when restoring time stamps.
5288
5289 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5290 (w32_get_internal_run_time):
5291 Port to higher-resolution Emacs time stamps.
5292 (ltime): Now accepts single 64-bit integer, as that's more convenient
5293 for callers.
5294
5295 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5296
5297 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5298 for compatibility with pselect. Support ns-resolution time stamps.
5299
5300 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5301
5302 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5303 Check for time stamp overflow, and support ns-resolution time stamps.
5304
5305 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5306 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5307 (timeval_subtract): Remove; no longer needed.
5308 (XTflash, XTring_bell, x_wait_for_event):
5309 Port to ns-resolution time stamps. Don't assume time_t is signed.
5310
5311 2012-06-22 Chong Yidong <cyd@gnu.org>
5312
5313 * xdisp.c (x_consider_frame_title): Revert last change.
5314
5315 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5316
5317 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5318 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5319 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5320 staticidx goes up to 1597 out of 1600 = 0x640.)
5321
5322 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5323
5324 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5325 Otherwise, the umask might be mistakenly 0 while handling input signals.
5326
5327 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5328
5329 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5330
5331 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5332
5333 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5334 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5335 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5336 access to `contents' member of Lisp_Vector objects with AREF and ASET
5337 where appropriate.
5338
5339 2012-06-19 Chong Yidong <cyd@gnu.org>
5340
5341 * frame.c (delete_frame): When selecting a frame on a different
5342 text terminal, do not alter the terminal's top-frame.
5343
5344 * xdisp.c (format_mode_line_unwind_data): Record the target
5345 frame's selected window and its terminal's top-frame.
5346 (unwind_format_mode_line): Restore them.
5347 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5348 Callers changed.
5349 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5350 since tty frames can be explicitly named.
5351 (prepare_menu_bars): Likewise.
5352
5353 * term.c (Ftty_top_frame): New function.
5354
5355 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5356
5357 Port byte-code-meter to modern targets.
5358 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5359 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5360 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5361 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5362 (METER_1, METER_2): Simplify.
5363
5364 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5365
5366 * data.c (Fdefalias): Return `symbol' (bug#11686).
5367
5368 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5369
5370 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5371 gets killed during executing of this function (Bug#11665).
5372 Try to always return Qt when the buffer has been actually killed.
5373 (Vkill_buffer_query_functions): In doc-string say that functions
5374 run by this hook should not change the current buffer.
5375
5376 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5377
5378 Fix recently-introduced process.c problems found by static checking.
5379 * process.c (write_queue_push, write_queue_pop, send_process):
5380 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5381 (write_queue_pop): Fix pointer signedness problem.
5382 (send_process): Remove unused local.
5383
5384 2012-06-17 Chong Yidong <cyd@gnu.org>
5385
5386 * xdisp.c (redisplay_internal): No need to redisplay terminal
5387 frames that are not on top.
5388
5389 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5390
5391 * process.c (make_process): Initialize write_queue.
5392 (write_queue_push, write_queue_pop): New functions.
5393 (send_process): Use them to maintain correct ordering of process
5394 writes (Bug#10815).
5395
5396 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5397
5398 * lisp.h (eassert): Assume C89 or later.
5399 This removes the need for CHECK.
5400 (CHECK): Remove. Its comments about always evaluating its
5401 argument were confusing, as 'eassert' typically does not evaluate
5402 its argument.
5403
5404 * coding.c (produce_chars): Use ptrdiff_t, not int.
5405
5406 * xterm.c (x_draw_underwave): Check for integer overflow.
5407 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5408
5409 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5410
5411 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5412 referenced (Bug#11583).
5413
5414 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5415
5416 Implement wave-style variant of underlining.
5417 * dispextern.h (face_underline_type): New enum.
5418 (face): Add field for underline type.
5419 * nsterm.m (ns_draw_underwave): New function.
5420 (ns_draw_text_decoration): Use it.
5421 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5422 New functions.
5423 (x_draw_glyph_string): Use them.
5424 * xfaces.c (Qline, Qwave): New Lisp objects.
5425 (check_lface_attrs, merge_face_ref)
5426 (Finternal_set_lisp_face_attribute, realize_x_face):
5427 Handle wave-style underline face attributes.
5428 * xterm.c (x_draw_underwave): New function.
5429 (x_draw_glyph_string): Use it.
5430
5431 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5432
5433 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5434 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5435 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5436 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5437 ($(BLD)/w32select.$(O)): Update dependencies.
5438
5439 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5440
5441 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5442 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5443 * character.c (_fetch_multibyte_char_p): Remove.
5444 * alloc.c: Include "character.h" before "buffer.h".
5445 * bidi.c: Likewise.
5446 * buffer.c: Likewise.
5447 * bytecode.c: Likewise.
5448 * callint.c: Likewise.
5449 * callproc.c: Likewise.
5450 * casefiddle.c: Likewise.
5451 * casetab.c: Likewise.
5452 * category.c: Likewise.
5453 * cmds.c: Likewise.
5454 * coding.c: Likewise.
5455 * composite.c: Likewise.
5456 * dired.c: Likewise.
5457 * dispnew.c: Likewise.
5458 * doc.c: Likewise.
5459 * dosfns.c: Likewise.
5460 * editfns.c: Likewise.
5461 * emacs.c: Likewise.
5462 * fileio.c: Likewise.
5463 * filelock.c: Likewise.
5464 * font.c: Likewise.
5465 * fontset.c: Likewise.
5466 * fringe.c: Likewise.
5467 * indent.c: Likewise.
5468 * insdel.c: Likewise.
5469 * intervals.c: Likewise.
5470 * keyboard.c: Likewise.
5471 * keymap.c: Likewise.
5472 * lread.c: Likewise.
5473 * macros.c: Likewise.
5474 * marker.c: Likewise.
5475 * minibuf.c: Likewise.
5476 * nsfns.m: Likewise.
5477 * nsmenu.m: Likewise.
5478 * print.c: Likewise.
5479 * process.c: Likewise.
5480 * regex.c: Likewise.
5481 * region-cache.c: Likewise.
5482 * search.c: Likewise.
5483 * syntax.c: Likewise.
5484 * term.c: Likewise.
5485 * textprop.c: Likewise.
5486 * undo.c: Likewise.
5487 * unexsol.c: Likewise.
5488 * w16select.c: Likewise.
5489 * w32fns.c: Likewise.
5490 * w32menu.c: Likewise.
5491 * window.c: Likewise.
5492 * xdisp.c: Likewise.
5493 * xfns.c: Likewise.
5494 * xmenu.c: Likewise.
5495 * xml.c: Likewise.
5496 * xselect.c: Likewise.
5497
5498 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5499
5500 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5501 If all the glyphs of the glyph row came from strings, and we have no
5502 cursor positioning clues, put the cursor on the first glyph of the
5503 row.
5504 (handle_face_prop): Use chunk-relative overlay string index when
5505 indexing into it->string_overlays array. (Bug#11653)
5506 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5507 the rightmost. (Bug#11720)
5508
5509 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5510
5511 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5512 (CATEGORY_MEMBER): Enforce 1/0 value.
5513 * category.c (_temp_category_set): Remove.
5514
5515 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5516
5517 * window.c (Fdelete_other_windows_internal)
5518 (Fdelete_window_internal): Don't access frame's mouse highlight
5519 info of the initial frame. (Bug#11677)
5520
5521 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5522
5523 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5524 Assume USE_2_TAGS_FOR_INTS.
5525 (xreload): Adjust $tagmask width to match recent lisp.h change.
5526
5527 Simplify lisp.h in minor ways that should not affect code.
5528 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5529 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5530 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5531 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5532 (INTTYPEBITS): New macro, for clarity.
5533 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5534 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5535 Simplify now that USE_LSB_TAG is always defined.
5536 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5537 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5538
5539 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5540
5541 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5542
5543 2012-06-13 Glenn Morris <rgm@gnu.org>
5544
5545 * s/bsd-common.h (BSD4_3):
5546 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5547
5548 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5549
5550 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5551 instead of union.
5552 (XLI, XIL): Define.
5553 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5554 Use them.
5555 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5556 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5557 * alloc.c (widen_to_Lisp_Object): Remove.
5558 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5559 * frame.c (delete_frame): Remove outdated comment.
5560 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5561 USE_LISP_UNION_TYPE.
5562 (Fw32_unregister_hot_key): Likewise.
5563 (Fw32_toggle_lock_key): Likewise.
5564 * w32menu.c (add_menu_item): Likewise.
5565 (w32_menu_display_help): Use XIL instead of checking
5566 USE_LISP_UNION_TYPE.
5567 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5568 (init_heap): Likewise.
5569 * w32term.c (w32_read_socket): Update comment.
5570
5571 2012-06-13 Glenn Morris <rgm@gnu.org>
5572
5573 * s/usg5-4-common.h, src/s/unixware.h:
5574 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5575
5576 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5577
5578 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5579
5580 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5581 * alloc.c (make_number) [!defined make_number]:
5582 Remove, as lisp.h always defines this now.
5583 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5584 (roundup_size): Verify that it is a power of 2.
5585 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5586 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5587 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5588 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5589 USE_LSB_TAG now is always defined to be either 0 or 1.
5590 All uses changed.
5591 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5592 code works fine either way, and efficiency is not a concern here,
5593 as the union type is for debugging, not for production.
5594 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5595 Use an inline function on all platforms when using the union type,
5596 since this is simpler and 'static inline' can be used portably
5597 within Emacs now.
5598 (LISP_INITIALLY_ZERO): New macro.
5599 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5600 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5601
5602 2012-06-12 Glenn Morris <rgm@gnu.org>
5603
5604 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5605
5606 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5607
5608 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5609 Move BROKEN_SIGIO to configure.
5610
5611 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5612 Move NO_TERMIO to configure.
5613
5614 2012-06-12 Chong Yidong <cyd@gnu.org>
5615
5616 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5617 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5618 MagickExportImagePixels is undefined.
5619
5620 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5621
5622 * image.c (imagemagick_load_image): Remove unused label.
5623
5624 2012-06-11 Glenn Morris <rgm@gnu.org>
5625
5626 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5627 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5628 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5629 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5630
5631 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5632
5633 * alloc.c (make_byte_code): New function.
5634 (Fmake_byte_code): Use it. Don't purify here.
5635 * lread.c (read1): Use it as well to avoid extra allocation.
5636
5637 2012-06-11 Chong Yidong <cyd@gnu.org>
5638
5639 * image.c (imagemagick_load_image): Implement transparency.
5640
5641 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5642
5643 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5644 account for preceding backslashes. (Bug#11663)
5645
5646 2012-06-09 Chong Yidong <cyd@gnu.org>
5647
5648 * term.c: Support italics in capable terminals (Bug#9652).
5649 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5650 (turn_on_face): Output using TS_enter_italic_mode if available.
5651 Don't handle unused blinking and alt-charset cases.
5652 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5653 and tty_alt_charset_p cases.
5654 (tty_capable_p, init_tty): Support italics.
5655
5656 * termchar.h (struct tty_display_info): Add field for italics.
5657 Remove unused blink field.
5658
5659 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5660 Handle slant.
5661
5662 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5663 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5664 tty_alt_charset_p. Add tty_italic_p.
5665
5666 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5667
5668 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5669 dbus_type_is_basic if available.
5670 (xd_extract_signed, xd_extract_unsigned): Rename from
5671 extract_signed and extract_unsigned, respectively. Adapt callers.
5672
5673 2012-06-09 Chong Yidong <cyd@gnu.org>
5674
5675 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5676
5677 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5678 case (Bug#9752).
5679
5680 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5681
5682 * xdisp.c (vmessage): Treat frame message as multibyte.
5683 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5684 would generate the diagnostic "Making \302\247 buffer-local while
5685 let-bound!".
5686
5687 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5688
5689 * dispnew.c (showing_window_margins_p): Undo last change, which
5690 was done due to an inadvertent commit.
5691 (adjust_frame_glyphs_for_frame_redisplay): Do call
5692 showing_window_margins_p.
5693
5694 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5695
5696 * eval.c (Fmake_var_non_special): New primitive.
5697 (syms_of_eval): Defsubr it.
5698 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5699
5700 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5701
5702 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5703 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5704
5705 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5706
5707 * alloc.c (allocate_vectorlike): Fix last change.
5708
5709 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5710
5711 Block-based vector allocation of small vectors.
5712 * lisp.h (struct vectorlike_header): New field `nbytes',
5713 adjust comment accordingly.
5714 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5715 to denote vector blocks. Adjust users (live_vector_p,
5716 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5717 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5718 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5719 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5720 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5721 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5722 (roundup_size): New constant.
5723 (struct vector_block): New data type.
5724 (vector_blocks, vector_free_lists, zero_vector): New variables.
5725 (all_vectors): Rename to `large_vectors'.
5726 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5727 (sweep_vectors): New functions.
5728 (allocate_vectorlike): Return `zero_vector' as the only vector of
5729 0 items. Allocate new vector from block if vector size is less than
5730 or equal to VBLOCK_BYTES_MAX.
5731 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5732 (init_alloc_once): Add call to init_vectors.
5733
5734 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5735
5736 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5737
5738 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5739
5740 * doprnt.c (doprnt): Truncate multibyte char correctly.
5741 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5742 would mishandle a string argument "Xc" if X was a multibyte
5743 character of length 2: it would truncate after X's first byte
5744 rather than including all of X.
5745
5746 2012-06-06 Chong Yidong <cyd@gnu.org>
5747
5748 * buffer.c (word_wrap): Doc fix.
5749
5750 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5751
5752 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5753
5754 2012-06-03 Glenn Morris <rgm@gnu.org>
5755
5756 * xdisp.c (tool-bar-style): Doc fix.
5757
5758 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5759
5760 * Makefile.in (PAXCTL): Define.
5761 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5762 binary via PaX flags if the paxctl utility is available.
5763 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5764 Restore PaX flags to their default. (Bug#11398)
5765
5766 2012-06-03 Chong Yidong <cyd@gnu.org>
5767
5768 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5769 buffer (Bug#11226).
5770
5771 2012-06-03 Chong Yidong <cyd@gnu.org>
5772
5773 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5774 (note_mode_line_or_margin_highlight): If there is no help echo,
5775 use mode-line-default-help-echo. Handle the case where the mouse
5776 position is past the end of the mode line string.
5777
5778 * buffer.c (buffer_local_value_1): New function, split from
5779 Fbuffer_local_value; can return Qunbound.
5780 (Fbuffer_local_value): Use it.
5781 (Vmode_line_format): Docstring tweaks.
5782
5783 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5784
5785 * sysdep.c (system_process_attributes): Improve comment.
5786
5787 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5788
5789 * keyboard.c: Export real-this-command to Elisp.
5790 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5791 and DEFVAR it. Update all users.
5792
5793 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5794
5795 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5796
5797 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5798 Convert pctcpu and pctmem to Lisp float properly.
5799 Let the compiler fold better, as 100.0/0x8000 is exact.
5800
5801 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5802
5803 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5804 cons_block.
5805
5806 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5807
5808 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5809
5810 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5811
5812 For a 'struct window', replace some Lisp_Object fields to
5813 bitfields where appropriate, remove unused fields.
5814 * window.h (struct window): Remove unused 'last_mark_x' and
5815 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5816 change it's type from Lisp_Object to bitfield.
5817 Change type of 'force_start', 'optional_new_start',
5818 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5819 fields from Lisp_Object to bitfield. Adjust users accordingly.
5820
5821 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5822
5823 Pacify gcc -Wdouble-precision when using Xaw.
5824 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5825 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5826 Use 'float' consistently, rather than 'float' in most places
5827 and 'double' in a couple of places.
5828
5829 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5830
5831 * xdisp.c (handle_stop): Detect whether we have overlay strings
5832 loaded by testing it->current.overlay_string_index to be
5833 non-negative, instead of checking whether n_overlay_strings is
5834 positive. (Bug#11587)
5835
5836 2012-05-31 Chong Yidong <cyd@gnu.org>
5837
5838 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5839
5840 * doc.c (Fsubstitute_command_keys): Doc fix.
5841
5842 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5843
5844 * search.c (search_buffer): Remove calls to
5845 r_alloc_inhibit_buffer_relocation, as it is now called by
5846 maybe_unify_char, which was the cause of relocation of buffer text
5847 in bug#11519.
5848
5849 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5850
5851 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5852 for the duration of call to load_charset, to avoid problems with
5853 callers of maybe_unify_char that access buffer text through C
5854 pointers.
5855
5856 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5857 decrement the inhibition flag, instead of just setting or
5858 resetting it.
5859
5860 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5861
5862 Remove obsolete '#define static' cruft.
5863 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5864 This #undef was "temporary" in 2000; it is no longer needed
5865 now that '#define static' has gone away.
5866 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5867 (gray_bitmap_bits): Remove; no longer needed.
5868 All uses replaced with definiens.
5869 * xterm.c: Include "bitmaps/gray.xbm".
5870
5871 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 Clean up __executable_start, monstartup when --enable-profiling.
5874 The following changes affect the code only when profiling.
5875 * dispnew.c (__executable_start): Rename from safe_bcopy.
5876 Define only on platforms that need it.
5877 * emacs.c: Include <sys/gmon.h> when profiling.
5878 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
5879 (__executable_start): Remove decl, since lisp.h does it now.
5880 (safe_bcopy): Remove decl; no longer has that name.
5881 (main): Coalesce #if into single bit of code, for simplicity.
5882 Cast pointers to uintptr_t, since standard libraries want integers
5883 and not pointers.
5884 * lisp.h (__executable_start): New decl.
5885
5886 2012-05-31 Glenn Morris <rgm@gnu.org>
5887
5888 * image.c (Fimagemagick_types): Doc fix.
5889
5890 2012-05-30 Jim Meyering <meyering@redhat.com>
5891
5892 * callproc.c (Fcall_process_region): Include directory component
5893 in mkstemp error message (Bug#11586).
5894
5895 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5896
5897 * alloc.c, lisp.h (make_pure_vector): Now static.
5898
5899 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
5900
5901 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
5902 Move to byte-run.el.
5903 (Fautoload): Do the hash-doc more carefully.
5904 * data.c (Fdefalias): Purify definition, except for keymaps.
5905 (Qdefun): Move from eval.c.
5906 * lisp.h (Qdefun): Remove.
5907 * lread.c (read1): Tiny simplification.
5908
5909 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
5910
5911 Do not create empty overlays with the evaporate property (Bug#9642).
5912 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
5913 Bug#9642, but explicitly check that the buffer the overlay would
5914 be moved to is live and rearrange lines to make sure that errors
5915 will not put the overlay in an inconsistent state.
5916 (Fdelete_overlay): Cosmetics.
5917
5918 2012-05-28 Eli Zaretskii <eliz@gnu.org>
5919
5920 * w32term.c (my_bring_window_to_top): New function.
5921 (x_raise_frame): Use handle returned by DeferWindowPos, which
5922 could be different from the original one.
5923 Call my_bring_window_to_top instead of my_set_foreground_window.
5924 (Bug#11513)
5925
5926 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
5927 by calling BringWindowToTop.
5928
5929 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
5930 (WM_EMACS_END): Increase by one.
5931
5932 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
5933
5934 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
5935 This avoids undefined behavior that might cause the eassert
5936 to not catch an out-of-range value.
5937
5938 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
5939
5940 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
5941 Update dependencies.
5942
5943 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5944
5945 * bidi.c (bidi_mirror_char): Fix last change.
5946
5947 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
5948
5949 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
5950 when referring to sectname field in printf format.
5951
5952 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5953
5954 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5955 Only r_alloc_inhibit_buffer_relocation needed to be added;
5956 the others were already declared.
5957
5958 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5959 before checking whether it's out of range. Put the check inside
5960 eassert. See
5961 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5962
5963 2012-05-27 Ken Brown <kbrown@cornell.edu>
5964
5965 * callproc.c (Fcall_process): Restore a line that was accidentally
5966 commented out in the 2011-02-13 change (bug#11547).
5967
5968 2012-05-27 Eli Zaretskii <eliz@gnu.org>
5969
5970 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5971 defined on ralloc.c.
5972
5973 * buffer.c [REL_ALLOC]: Remove prototypes of
5974 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5975 they are now on lisp.h.
5976
5977 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5978
5979 * search.c (search_buffer): Use it to inhibit relocation of buffer
5980 text while re_search_2 is doing its job, because re_search_2 is
5981 passed C pointers to buffer text. (Bug#11519)
5982
5983 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5984 Update value to 24.
5985
5986 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5987 state after an additional call to move_it_in_display_line_to, keep
5988 the values of it->max_ascent and it->max_descent found for the
5989 entire line.
5990 (pos_visible_p): Revert the comparison against bottom_y to what it
5991 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5992 (Bug#11464)
5993
5994 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5995
5996 Fix coding-related core dumps with gcc -ftrapv.
5997 The code was computing A - B, where A and B are pointers, and B is
5998 random garbage. This can lead to core dumps on platforms that
5999 have special pointer registers, and it also leads to core dumps on
6000 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6001 A - B only when B is initialized properly.
6002 * coding.c (coding_set_source, coding_set_destination): Return void.
6003 (coding_change_source, coding_change_destinations): New functions,
6004 with the old behaviors of coding_set_source and coding_set_destination.
6005 All callers that need an offset changed to use these new functions.
6006
6007 2012-05-26 Glenn Morris <rgm@gnu.org>
6008
6009 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6010
6011 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6012
6013 Extend mouse support on W32 text-mode console.
6014 * xdisp.c (draw_row_with_mouse_face):
6015 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6016
6017 * w32console.c: Include window.h.
6018 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6019 New functions.
6020 (initialize_w32_display): Initialize mouse-highlight data.
6021
6022 * w32inevt.c: Include termchar.h and window.h.
6023 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6024 moves, call note_mouse_highlight. If help_echo changed, call
6025 gen_help_event to produce help-echo message in the echo area.
6026 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6027 highlight info.
6028
6029 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6030
6031 * lread.c (read1): Simplify slightly to avoid an overflow warning
6032 with GCC 4.7.0 on x86-64.
6033
6034 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6035
6036 * bidi.c (bidi_mirror_char): Revert last change: an int is
6037 definitely wide enough here.
6038
6039 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6040
6041 Fix integer width and related bugs (Bug#9874).
6042 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6043 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6044 (string_bytes, check_sblock, allocate_string_data):
6045 (compact_small_strings, Fmake_bool_vector, make_string)
6046 (make_unibyte_string, make_multibyte_string)
6047 (make_string_from_bytes, make_specified_string)
6048 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6049 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6050 (mark_vectorlike):
6051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6052 (allocate_pseudovector):
6053 Use int, not EMACS_INT, where int is wide enough.
6054 (inhibit_garbage_collection, Fgarbage_collect):
6055 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6056 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6057 int might not be wide enough.
6058 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6059 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6060 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6061 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6062 (bidi_level_of_next_char, bidi_move_to_visually_next):
6063 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6064 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6065 (Fkill_buffer, Fset_buffer_major_mode)
6066 (advance_to_char_boundary, Fbuffer_swap_text)
6067 (Fset_buffer_multibyte, overlays_at, overlays_in)
6068 (overlay_touches_p, struct sortvec, record_overlay_string)
6069 (overlay_strings, recenter_overlay_lists)
6070 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6071 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6072 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6073 (Foverlay_recenter, last_overlay_modification_hooks_used)
6074 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6075 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6076 (validate_region): Omit unnecessary test for b <= e,
6077 since that's guaranteed by the previous test.
6078 (adjust_overlays_for_delete): Avoid pos + length overflow.
6079 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6080 (report_overlay_modification):
6081 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6082 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6083 Omit pointer cast, which isn't needed anyway, and doesn't work
6084 after the EMACS_INT -> ptrdiff_t change.
6085 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6086 * buffer.h: Adjust decls to match defn changes elsewhere.
6087 (struct buffer_text, struct buffer):
6088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6089 Use EMACS_INT, not int, where int might not be wide enough.
6090 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6091 not int, to avoid needless 32-bit limit on 64-bit hosts.
6092 (exec_byte_code): Use tighter memory-full test, one that checks
6093 for alloca overflow. Don't compute the address of the object just
6094 before an array, as that's not portable. Use EMACS_INT, not
6095 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6096 * callint.c (Fcall_interactively):
6097 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6098 * callproc.c (call_process_kill, Fcall_process):
6099 Don't assume pid_t fits into an Emacs fixnum.
6100 (call_process_cleanup, Fcall_process, child_setup):
6101 Don't assume pid_t fits into int.
6102 (call_process_cleanup, Fcall_process, delete_temp_file)
6103 (Fcall_process_region):
6104 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6105 (Fcall_process): Simplify handling of volatile integers.
6106 Use int, not EMACS_INT, where int will do.
6107 * casefiddle.c (casify_object, casify_region, operate_on_word)
6108 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6109 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6110 (casify_object): Avoid integer overflow when overallocating buffer.
6111 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6112 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6113 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6114 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6115 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6116 integers are now checked earlier. All uses replaced with XINT.
6117 (ccl_driver):
6118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6119 For CCL_MapSingle, check that content and value are in int range.
6120 (ccl_driver, Fregister_code_conversion_map):
6121 Check that Vcode_version_map_vector is a vector.
6122 (resolve_symbol_ccl_program): Check that vector header is in range.
6123 Always copy the vector, so that we can check its contents reliably
6124 now rather than having to recheck each instruction as it's being
6125 executed. Check that vector words fit in 'int'.
6126 (ccl_get_compiled_code, Fregister_ccl_program)
6127 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6128 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6129 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6130 contents are in range.
6131 (Fccl_execute_on_string): Check that status is in range.
6132 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6133 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6134 Accept and return EMACS_INT, not int, because callers can pass values
6135 out of 'int' range.
6136 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6137 (multibyte_chars_in_text, parse_str_as_multibyte)
6138 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6139 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6140 (string_escape_byte8, Fget_byte):
6141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6142 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6143 avoid mishandling large integers.
6144 * character.h: Adjust decls to match defn changes elsewhere.
6145 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6146 (Ffind_charset_region):
6147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6148 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6149 (load_charset_map_from_vector, Fdefine_charset_internal):
6150 Don't assume fixnum fits in int.
6151 (load_charset_map_from_vector, Fmap_charset_chars):
6152 Remove now-unnecessary CHECK_NATNUMs.
6153 (Fdefine_charset_internal): Check ranges here, more carefully.
6154 Don't rely on undefined behavior with signed left shift overflow.
6155 Don't assume unsigned int fits into fixnum, or that fixnum fits
6156 into unsigned int. Don't require max_code to be a valid fixnum;
6157 that's not true for gb10830 4-byte on a 32-bit host. Allow
6158 invalid_code to be a cons, for the same reason. Require code_offset
6159 to be a character. Avoid int overflow if max_char is close
6160 to INT_MAX.
6161 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6162 this is intended anyway and avoids some undefined behavior.
6163 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6164 INDEX_TO_CODE_POINT, as that's what it expects.
6165 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6166 * charset.h (DECODE_CHAR): Return int, not unsigned;
6167 this is what was intended anyway, and it avoids undefined behavior.
6168 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6169 integer-overflow issues.
6170 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6171 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6172 where the argument is EMACS_INT, and this behavior is not intended.
6173 * chartab.c (Fmake_char_table, Fset_char_table_range)
6174 (uniprop_get_decoder, uniprop_get_encoder):
6175 Don't assume fixnum fits in int.
6176 * cmds.c (move_point): New function, that does the gist of
6177 Fforward_char and Fbackward_char, but does so while checking
6178 for integer overflow more accurately.
6179 (Fforward_char, Fbackward_char): Use it.
6180 (Fforward_line, Fend_of_line, internal_self_insert)
6181 (internal_self_insert):
6182 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6183 Fix a FIXME, by checking for integer overflow when calculating
6184 target_clm and actual_clm.
6185 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6186 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6187 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6188 (coding_alloc_by_making_gap, alloc_destination)
6189 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6190 (encode_coding_utf_16, detect_coding_emacs_mule)
6191 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6192 (detect_coding_iso_2022, decode_coding_iso_2022)
6193 (encode_invocation_designation, encode_designation_at_bol)
6194 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6195 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6196 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6197 (encode_coding_ccl, encode_coding_raw_text)
6198 (detect_coding_charset, decode_coding_charset)
6199 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6200 (produce_composition, produce_charset, produce_annotation)
6201 (decode_coding, handle_composition_annotation)
6202 (handle_charset_annotation, consume_chars, decode_coding_gap)
6203 (decode_coding_object, encode_coding_object, detect_coding_system)
6204 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6205 (code_convert_region, code_convert_string)
6206 (Fdefine_coding_system_internal)
6207 (coding_set_source, coding_set_destination):
6208 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6209 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6210 (Fdefine_coding_system_internal):
6211 Don't assume fixnums fit in int.
6212 (decode_coding_gap, decode_coding_object, encode_coding_object)
6213 (Fread_coding_system, Fdetect_coding_region)
6214 (Funencodable_char_position, Fcheck_coding_systems_region)
6215 (get_translation, handle_composition_annotation, consume_chars):
6216 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6217 (consume_chars): Rewrite to not calculate an address outside buffer.
6218 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6219 Don't access memory outside of the args array.
6220 (Fdefine_coding_system_internal): Check for charset-id overflow.
6221 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6222 result of ENCODE_CHAR.
6223 * coding.h: Adjust decls to match defn changes elsewhere.
6224 (struct coding_system):
6225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6226 * composite.c (get_composition_id, find_composition)
6227 (run_composition_function, update_compositions)
6228 (compose_text, composition_gstring_put_cache)
6229 (composition_gstring_p, composition_gstring_width)
6230 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6231 (composition_compute_stop_pos, composition_reseat_it)
6232 (composition_update_it, struct position_record)
6233 (find_automatic_composition, composition_adjust_point)
6234 (Fcomposition_get_gstring, Ffind_composition_internal):
6235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6236 (update_compositions):
6237 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6238 * composite.h: Adjust decls to match defn changes elsewhere.
6239 (struct composition):
6240 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6241 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6242 Do not attempt to compute the address of the object just before a
6243 buffer; this is not portable.
6244 (Faref, Faset):
6245 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6246 (Faset): Use int, not EMACS_INT, where int is wide enough.
6247 (Fstring_to_number): Don't assume fixnums fit in int.
6248 (Frem): Don't assume arg is nonnegative.
6249 * dbusbind.c (xd_append_arg): Check for integers out of range.
6250 (Fdbus_call_method): Don't overflow the timeout int.
6251 (extract_signed, extract_unsigned): New functions.
6252 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6253 (xd_get_connection_references): Return ptrdiff_t, not int.
6254 All uses changed.
6255 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6256 (xd_read_message_1):
6257 Use int, not unsigned, where the dbus API uses int.
6258 (Fdbus_message_internal): Don't overflow mtype.
6259 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6260 * dired.c (directory_files_internal, file_name_completion, scmp)
6261 (file_name_completion_stat):
6262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6263 (file_name_completion): Don't overflow matchcount.
6264 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6265 * dispextern.h: Adjust decls to match defn changes elsewhere.
6266 (struct text_pos, struct glyph, struct bidi_saved_info)
6267 (struct bidi_string_data, struct bidi_it, struct composition_it)
6268 (struct it):
6269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6270 (struct display_pos, struct composition_it, struct it):
6271 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6272 * dispnew.c (increment_matrix_positions)
6273 (increment_row_positions, mode_line_string)
6274 (marginal_area_string):
6275 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6276 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6277 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6278 (duration_to_sec_usec): New function, to check for overflow better.
6279 (Fsleep_for, sit_for): Use it.
6280 * doc.c (get_doc_string, store_function_docstring):
6281 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6282 (get_doc_string, Fsnarf_documentation):
6283 Use int, not EMACS_INT, where int is wide enough.
6284 (get_doc_string):
6285 Use SAFE_ALLOCA, not alloca.
6286 Check for overflow when converting EMACS_INT to off_t.
6287 * doprnt.c (doprnt):
6288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6289 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6290 Don't assume uid_t fits into fixnum.
6291 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6292 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6293 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6294 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6295 (general_insert_function)
6296 (Finsert_char, make_buffer_string, make_buffer_string_both)
6297 (update_buffer_properties, Fbuffer_substring)
6298 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6299 (Fsubst_char_in_region, check_translation)
6300 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6301 (transpose_markers, Ftranspose_regions):
6302 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6303 (clip_to_bounds): Move to lisp.h as an inline function).
6304 (Fconstrain_to_field): Don't assume integers are nonnegative.
6305 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6306 (Fsubst_char_in_region, Fsave_restriction):
6307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6308 (Femacs_pid): Don't assume pid_t fits into fixnum.
6309 (lo_time): Use int, not EMACS_INT, when int suffices.
6310 (lisp_time_argument): Check for usec out of range.
6311 (Fencode_time): Don't assume fixnum fits in int.
6312 (Fuser_login_name, Fuser_full_name): Signal an error
6313 if a uid argument is out of range, rather than relying on
6314 undefined behavior.
6315 (Fformat_time_string): Remove now-unnecessary check.
6316 lisp_time_argument checks for out-of-range usec now.
6317 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6318 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6319 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6320 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6321 (init_cmdargs, Fdump_emacs):
6322 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6323 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6324 the bottom (typically) 32 bits of the fixnum.
6325 * eval.c (specpdl_size, call_debugger):
6326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6327 (when_entered_debugger, Fbacktrace_debug):
6328 Don't assume fixnum can fit in int.
6329 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6330 the object just before a buffer; this is not portable.
6331 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6332 (grow_specpdl, unbind_to):
6333 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6334 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6335 (grow_specpdl): Simplify allocation by using xpalloc.
6336 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6337 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6338 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6339 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6340 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6341 (a_write, e_write):
6342 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6343 (Fcopy_file, non_regular_nbytes, read_non_regular)
6344 (Finsert_file_contents):
6345 Use int, not EMACS_INT, where int is wide enough.
6346 (READ_BUF_SIZE): Verify that it fits in int.
6347 (Finsert_file_contents): Check that counts are in proper range,
6348 rather than assuming fixnums fit into ptrdiff_t etc.
6349 Don't assume fixnums fit into int.
6350 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6351 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6352 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6353 (string_char_to_byte, string_byte_to_char)
6354 (string_make_multibyte, string_to_multibyte)
6355 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6356 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6357 (substring_both, Fdelete, internal_equal, Ffillarray)
6358 (Fclear_string, mapcar1)
6359 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6360 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6361 (larger_vector, make_hash_table, maybe_resize_hash_table)
6362 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6363 (Fmaphash, secure_hash):
6364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6365 (concat): Check for string index and length overflow.
6366 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6367 (Frequire):
6368 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6369 (larger_vector): New API (vec, incr_min, size_max) replaces old
6370 one (vec, new_size, init). This catches size overflow.
6371 INIT was removed because it was always Qnil.
6372 All callers changed.
6373 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6374 the upper bound on a hash table index size.
6375 (make_hash_table, maybe_resize_hash_table): Use it.
6376 (secure_hash): Computer start_byte and end_byte only after
6377 they're known to be in ptrdiff_t range.
6378 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6379 (Ffont_get_glyphs, Ffont_at):
6380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6381 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6382 (Flist_fonts, Fopen_font):
6383 Don't assume fixnum can fit in int.
6384 (check_gstring): Don't assume index can fit in int.
6385 (font_match_p): Check that fixnum is a character, not a nonnegative
6386 fixnum, since the later code needs to stuff it into an int.
6387 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6388 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6389 conversion overflow issues.
6390 (Fopen_font): Check for integer out of range.
6391 (Ffont_get_glyphs): Don't assume index can fit in int.
6392 * font.h: Adjust decls to match defn changes elsewhere.
6393 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6394 integer overflow.
6395 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6396 printmax_t, where ptrdiff_t is wide enough.
6397 (Finternal_char_font):
6398 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6399 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6400 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6401 (Fset_frame_position, x_set_frame_parameters)
6402 (x_set_line_spacing, x_set_border_width)
6403 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6404 Check that fixnums are in proper range for system types.
6405 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6407 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6408 Use SAFE_ALLOCA_LISP, not alloca.
6409 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6410 intptr_t is wide enough.
6411 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6412 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6413 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6414 Check for fixnum out of range.
6415 * ftfont.c (ftfont_list): Don't assume index fits in int.
6416 Check that fixnums are in proper range for system types.
6417 (ftfont_shape_by_flt):
6418 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6419 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6421 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6422 Check that fixnums are in proper range for system types.
6423 * gnutls.h: Adjust decls to match defn changes elsewhere.
6424 * gtkutil.c (xg_dialog_run):
6425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6426 (update_frame_tool_bar):
6427 Check that fixnums are in proper range for system types.
6428 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6429 (lookup_image): Check that fixnums are in range for system types.
6430 * indent.c (last_known_column, last_known_column_point):
6431 (current_column_bol_cache):
6432 (skip_invisible, current_column, check_display_width):
6433 (check_display_width, scan_for_column, current_column_1)
6434 (Findent_to, Fcurrent_indentation, position_indentation)
6435 (indented_beyond_p, Fmove_to_column, compute_motion):
6436 (Fcompute_motion, Fvertical_motion):
6437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6438 (last_known_column_modified): Use EMACS_INT, not int.
6439 (check_display_width):
6440 (Fcompute_motion):
6441 Check that fixnums and floats are in proper range for system types.
6442 (compute_motion): Don't assume index or fixnum fits in int.
6443 (compute_motion, Fcompute_motion):
6444 Use int, not EMACS_INT, when it is wide enough.
6445 (vmotion): Omit local var start_hpos that is always 0; that way
6446 we don't need to worry about overflow in expressions involving it.
6447 * indent.h: Adjust decls to match defn changes elsewhere.
6448 (struct position):
6449 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6450 Use int, not EMACS_INT, where int is wide enough.
6451 Remove unused members ovstring_chars_done and tab_offset;
6452 all uses removed.
6453 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6454 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6455 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6456 (make_gap, copy_text, insert, insert_and_inherit)
6457 (insert_before_markers, insert_before_markers_and_inherit)
6458 (insert_1, count_combining_before, count_combining_after)
6459 (insert_1_both, insert_from_string)
6460 (insert_from_string_before_markers, insert_from_string_1)
6461 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6462 (adjust_after_replace, adjust_after_insert, replace_range)
6463 (replace_range_2, del_range, del_range_1, del_range_byte)
6464 (del_range_both, del_range_2, modify_region)
6465 (prepare_to_modify_buffer, signal_before_change)
6466 (signal_after_change, Fcombine_after_change_execute):
6467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6468 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6469 (balance_an_interval, split_interval_right, split_interval_left)
6470 (find_interval, next_interval, update_interval)
6471 (adjust_intervals_for_insertion, delete_node, delete_interval)
6472 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6473 (static_offset_intervals, offset_intervals)
6474 (merge_interval_right, merge_interval_left, make_new_interval)
6475 (graft_intervals_into_buffer, temp_set_point_both)
6476 (temp_set_point, set_point, adjust_for_invis_intang)
6477 (set_point_both, move_if_not_intangible, get_property_and_range)
6478 (get_local_map, copy_intervals, copy_intervals_to_string)
6479 (compare_string_intervals, set_intervals_multibyte_1):
6480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6481 * intervals.h: Adjust decls to match defn changes elsewhere.
6482 (struct interval):
6483 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6484 * keyboard.c (this_command_key_count, this_single_command_key_start)
6485 (before_command_key_count, before_command_echo_length, echo_now)
6486 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6487 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6488 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6489 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6490 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6491 (last_non_minibuf_size, last_point_position, echo_truncate)
6492 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6493 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6494 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6495 (stuff_buffered_input):
6496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6497 (last_auto_save, command_loop_1, read_char):
6498 Use EMACS_INT, not int, to avoid integer overflow.
6499 (record_char): Avoid overflow in total_keys computation.
6500 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6501 * keyboard.h: Adjust decls to match defn changes elsewhere.
6502 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6503 (Fkey_description, Fdescribe_vector, Flookup_key):
6504 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6505 (click_position): New function, to check that positions are in range.
6506 (Fcurrent_active_maps):
6507 (describe_command):
6508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6509 (Faccessible_keymaps, Fkey_description):
6510 (preferred_sequence_p):
6511 Don't assume fixnum can fit into int.
6512 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6513 Check for integer overflow in size calculations.
6514 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6515 avoid mishandling large integers.
6516 * lisp.h: Adjust decls to match defn changes elsewhere.
6517 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6518 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6519 (struct Lisp_Marker):
6520 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6521 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6522 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6523 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6524 All callers changed.
6525 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6526 Assume the arg has valid form, since it always does.
6527 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6528 unsigned integer system type.
6529 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6530 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6532 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6533 (duration_to_sec_usec): New decl.
6534 * lread.c (read_from_string_index, read_from_string_index_byte)
6535 (read_from_string_limit, readchar, unreadchar, openp)
6536 (read_internal_start, read1, oblookup):
6537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6538 (Fload, readevalloop, Feval_buffer, Feval_region):
6539 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6540 (openp): Check for out-of-range argument to 'access'.
6541 (read1): Use int, not EMACS_INT, where int is wide enough.
6542 Don't assume fixnum fits into int.
6543 Fix off-by-one error that can read outside a buffer.
6544 (read_filtered_event): Use duration_to_sec_usec
6545 to do proper overflow checking on durations.
6546 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6547 in size calculation.
6548 (Fexecute_kbd_macro):
6549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6550 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6551 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6552 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6553 (set_marker_both, set_marker_restricted_both, marker_position)
6554 (marker_byte_position, Fbuffer_has_markers_at):
6555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6556 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6557 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6558 It now merely ensures that the menu is large enough, without
6559 necessarily growing it, as this avoids some integer overflow issues.
6560 All callers changed.
6561 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6563 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6564 Use SAFE_ALLOCA_LISP, not alloca.
6565 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6566 to EMACS_INT. Check that fixnums are in proper range for system types.
6567 * minibuf.c (minibuf_prompt_width, string_to_object)
6568 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6569 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6571 (get_minibuffer, read_minibuf_unwind):
6572 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6573 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6574 this simplifies overflow checking. All callers changed.
6575 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6576 (Ftest_completion):
6577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6578 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6579 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6580 Check that fixnums are in proper range for system types.
6581 (Fx_create_frame, Fx_show_tip):
6582 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6583 * nsfont.m (ns_findfonts, nsfont_list_family):
6584 Don't assume fixnum fits in long.
6585 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6586 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6587 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6588 wide enough.
6589 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6590 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6591 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6592 (PRINTDECLARE, PRINTPREPARE):
6593 (strout, print_string):
6594 (print, print_preprocess, print_check_string_charset_prop)
6595 (print_object):
6596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6597 (PRINTDECLARE):
6598 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6599 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6600 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6601 (printchar, strout): Use xpalloc to catch size calculation overflow.
6602 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6603 (print_error_message): Use SAFE_ALLOCA, not alloca.
6604 (print_object): Use int, not EMACS_INT, where int is wide enough.
6605 (print_depth, new_backquote_output, print_number_index):
6606 Use ptrdiff_t, not int, where int might not be wide enough.
6607 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6608 (Fset_process_window_size, Fformat_network_address)
6609 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6610 (sigchld_handler):
6611 Check that fixnums are in proper range for system types.
6612 (Fsignal_process): Simplify by avoiding a goto.
6613 Check for process-ids out of pid_t range rather than relying on
6614 undefined behavior.
6615 (process_tick, update_tick): Use EMACS_INT, not int.
6616 (Fformat_network_address, read_process_output, send_process)
6617 (Fprocess_send_region, status_notify):
6618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6619 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6620 (wait_reading_process_output, read_process_output, exec_sentinel):
6621 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6622 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6623 (Faccept_process_output): Use duration_to_sec_usec to do proper
6624 overflow checking on durations.
6625 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6626 Don't assume pid_t fits in int.
6627 * process.h (struct Lisp_Process): Members tick and update_tick
6628 are now of type EMACS_INT, not int.
6629 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6630 configured --with-wide-int.
6631 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6632 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6633 * search.c (looking_at_1, string_match_1):
6634 (fast_string_match, fast_c_string_match_ignore_case)
6635 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6636 (scan_newline, find_before_next_newline, search_command)
6637 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6638 (set_search_regs, wordify):
6639 (Freplace_match):
6640 (Fmatch_data):
6641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6642 (string_match_1, search_buffer, set_search_regs):
6643 (Fmatch_data):
6644 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6645 (wordify): Check for overflow in size calculation.
6646 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6647 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6648 Check that fixnums are in proper range for system types.
6649 * sound.c (struct sound_device)
6650 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6651 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6652 (Fplay_sound_internal):
6653 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6654 * syntax.c (struct lisp_parse_state, find_start_modiff)
6655 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6656 (Fparse_partial_sexp):
6657 Don't assume fixnums can fit in int.
6658 (struct lisp_parse_state, find_start_pos, find_start_value)
6659 (find_start_value_byte, find_start_begv)
6660 (update_syntax_table, char_quoted, dec_bytepos)
6661 (find_defun_start, prev_char_comend_first, back_comment):
6662 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6663 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6665 (Finternal_describe_syntax_value): Check that match_lisp is a
6666 character, not an integer, since the code stuffs it into int.
6667 (scan_words, scan_sexps_forward):
6668 Check that fixnums are in proper range for system types.
6669 (Fforward_word):
6670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6671 (scan_sexps_forward):
6672 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6673 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6674 * syntax.h: Adjust decls to match defn changes elsewhere.
6675 (struct gl_state_s):
6676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6677 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6678 MOST_POSITIVE_FIXNUM.
6679 * sysdep.c (wait_for_termination_1, wait_for_termination)
6680 (interruptible_wait_for_termination, mkdir):
6681 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6682 (emacs_read, emacs_write):
6683 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6684 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6685 and double all fit in int.
6686 * term.c (set_tty_color_mode):
6687 Check that fixnums are in proper range for system types.
6688 * termhooks.h (struct input_event):
6689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6690 * textprop.c (validate_interval_range, interval_of)
6691 (Fadd_text_properties, set_text_properties_1)
6692 (Fremove_text_properties, Fremove_list_of_text_properties)
6693 (Ftext_property_any, Ftext_property_not_all)
6694 (copy_text_properties, text_property_list, extend_property_ranges)
6695 (verify_interval_modification):
6696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6697 (Fnext_single_char_property_change)
6698 (Fprevious_single_char_property_change):
6699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6700 (copy_text_properties):
6701 Check for integer overflow in index calculation.
6702 * undo.c (last_boundary_position, record_point, record_insert)
6703 (record_delete, record_marker_adjustment, record_change)
6704 (record_property_change):
6705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6706 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6707 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6708 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6709 (Fx_hide_tip, Fx_file_dialog):
6710 * w32menu.c (set_frame_menubar):
6711 Use ptrdiff_t, not int, for consistency with rest of code.
6712 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6713 (select_window, Fdelete_other_windows_internal)
6714 (window_scroll_pixel_based, window_scroll_line_based)
6715 (Frecenter, Fset_window_configuration):
6716 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6717 (Fset_window_hscroll, run_window_configuration_change_hook)
6718 (set_window_buffer, temp_output_buffer_show, scroll_command)
6719 (Fscroll_other_window, Frecenter):
6720 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6721 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6722 Don't assume fixnum fits in int.
6723 (Fset_window_scroll_bars):
6724 Check that fixnums are in proper range for system types.
6725 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6726 (string_pos, c_string_pos, number_of_chars, init_iterator)
6727 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6728 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6729 (compute_display_string_end, handle_face_prop)
6730 (face_before_or_after_it_pos, handle_invisible_prop)
6731 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6732 (display_prop_intangible_p, string_buffer_position_lim)
6733 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6734 (get_overlay_strings_1, get_overlay_strings)
6735 (iterate_out_of_display_property, forward_to_next_line_start)
6736 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6737 (get_next_display_element, set_iterator_to_next)
6738 (get_visually_first_element, compute_stop_pos_backwards)
6739 (handle_stop_backwards, next_element_from_buffer)
6740 (move_it_in_display_line_to, move_it_in_display_line)
6741 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6742 (add_to_log, message_dolog, message_log_check_duplicate)
6743 (message2, message2_nolog, message3, message3_nolog
6744 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6745 (current_message_1, truncate_echo_area, truncate_message_1)
6746 (set_message, set_message_1, store_mode_line_noprop)
6747 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6748 (text_outside_line_unchanged_p, check_point_in_composition)
6749 (reconsider_clip_changes)
6750 (redisplay_internal, set_cursor_from_row, try_scrolling)
6751 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6752 (redisplay_window, find_last_unchanged_at_beg_row)
6753 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6754 (trailing_whitespace_p, find_row_edges, display_line)
6755 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6756 (display_mode_element, store_mode_line_string)
6757 (pint2str, pint2hrstr, decode_mode_spec)
6758 (display_count_lines, display_string, draw_glyphs)
6759 (x_produce_glyphs, x_insert_glyphs)
6760 (rows_from_pos_range, mouse_face_from_buffer_pos)
6761 (fast_find_string_pos, mouse_face_from_string_pos)
6762 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6764 (safe_call, init_from_display_pos, handle_fontified_prop)
6765 (handle_single_display_spec, load_overlay_strings)
6766 (with_echo_area_buffer, setup_echo_area_for_printing)
6767 (display_echo_area, echo_area_display)
6768 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6769 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6770 (redisplay_window, dump_glyph_row, display_mode_line)
6771 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6772 (handle_display_spec, display_prop_string_p):
6773 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6774 (handle_single_display_spec, build_desired_tool_bar_string)
6775 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6776 (get_specified_cursor_type):
6777 Check that fixnums are in proper range for system types.
6778 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6779 (Flookup_image_map):
6780 Don't assume fixnums fit in int.
6781 (compare_overlay_entries):
6782 Avoid mishandling comparisons due to subtraction overflow.
6783 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6784 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6785 (handle_tool_bar_click):
6786 Use int, not unsigned, since we prefer signed and the signedness
6787 doesn't matter here.
6788 (get_next_display_element, next_element_from_display_vector):
6789 Use int, not EMACS_INT, when int is wide enough.
6790 (start_hourglass): Use duration_to_sec_usec to do proper
6791 overflow checking on durations.
6792 * xfaces.c (Fbitmap_spec_p):
6793 Check that fixnums are in proper range for system types.
6794 (compare_fonts_by_sort_order):
6795 Avoid mishandling comparisons due to subtraction overflow.
6796 (Fx_family_fonts, realize_basic_faces):
6797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6798 (Fx_family_fonts):
6799 Don't assume fixnum fits in int.
6800 Use SAFE_ALLOCA_LISP, not alloca.
6801 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6802 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6803 (face_at_buffer_position, face_for_overlay_string)
6804 (face_at_string_position):
6805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6806 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6807 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6808 (Fx_show_tip):
6809 Check that fixnums are in proper range for system types.
6810 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6811 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6812 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6813 (Fx_change_window_property): Don't assume fixnums fit in int.
6814 * xfont.c (xfont_chars_supported):
6815 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6816 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6817 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6818 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6819 * xml.c (parse_region):
6820 * xrdb.c (magic_file_p):
6821 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6822 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6823 (x_get_local_selection, x_reply_selection_request)
6824 (x_handle_selection_request, wait_for_property_change):
6825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6826 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6827 short is wide enough.
6828 (x_send_client_event): Don't assume fixnum fits in int.
6829 * xterm.c (x_x_to_emacs_modifiers):
6830 Don't assume EMACS_INT overflows nicely into int.
6831 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6832 may come from Lisp.
6833 (handle_one_xevent): NATNUMP can eval its arg twice.
6834 (x_connection_closed):
6835 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6836 * xterm.h: Adjust decls to match defn changes elsewhere.
6837 (struct scroll_bar): Use struct vectorlike_header
6838 rather than rolling our own approximation.
6839 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6840
6841 2012-05-25 Glenn Morris <rgm@gnu.org>
6842
6843 * lisp.mk (lisp): Update for more files being compiled now.
6844
6845 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6846
6847 * lread.c: Remove `read_pure' which makes no difference.
6848 (read_pure): Remove var.
6849 (unreadpure): Remove function.
6850 (readevalloop): Don't call read_list with -1 flag.
6851 (read1, read_vector): Don't test read_pure any more.
6852 (read_list): Simplify.
6853
6854 * fileio.c, character.h: Minor style tweaks.
6855
6856 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6857
6858 * window.h (clip_changed): Remove useless declaration.
6859
6860 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6861
6862 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6863 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6864
6865 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6866
6867 Remove src/m/*.
6868 This directory predates autoconf and is no longer needed nowadays.
6869 Move its few remaining bits of functionality to where they're needed.
6870 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6871 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6872 * m/template.h: Remove.
6873 * Makefile.in (M_FILE): Remove. All uses removed.
6874 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6875 * lisp.h (USE_LSB_TAG):
6876 * mem-limits.h (EXCEEDS_LISP_PTR):
6877 Use VAL_MAX, not VALBITS, in #if.
6878 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
6879 (EMACS_UINT): Define unconditionally now.
6880 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
6881 (BITS_PER_EMACS_INT): New constants, replacing
6882 what used to be in config.h, but not useful in #if.
6883 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
6884 define them any more.
6885 (VAL_MAX): New macro.
6886 (VALMASK): Use it.
6887 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
6888 BITS_PER_EMACS_INT, in #if.
6889 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
6890 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
6891 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
6892 * s/ms-w32.h (DATA_START):
6893 Move here from removed file m/intel386.h.
6894 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
6895 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
6896
6897 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
6898
6899 Assume C89 or later.
6900 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
6901 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
6902 (xrealloc):
6903 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
6904 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
6905 * textprop.c, tparam.c (NULL): Remove.
6906 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
6907 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
6908 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
6909 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
6910 * xterm.c (input_signal_count): Assume volatile works.
6911
6912 2012-05-21 Ken Brown <kbrown@cornell.edu>
6913
6914 * xgselect.c (xg_select): Fix first argument in call to 'select'
6915 (bug#11508).
6916
6917 2012-05-20 Ken Brown <kbrown@cornell.edu>
6918
6919 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
6920 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
6921
6922 2012-05-19 Ken Brown <kbrown@cornell.edu>
6923
6924 * xfns.c (x_in_use): Remove `static' qualifier.
6925 * xterm.h (x_in_use): Declare.
6926 * xgselect.c: Include xterm.h.
6927 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
6928 and `display_arg' (bug#9754).
6929
6930 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
6931
6932 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
6933
6934 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
6935 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
6936
6937 2012-05-18 Eli Zaretskii <eliz@gnu.org>
6938
6939 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
6940
6941 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
6942 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
6943
6944 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
6945 reference to image_cache->refcount.
6946 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
6947
6948 2012-05-17 Juri Linkov <juri@jurta.org>
6949
6950 * search.c (Fword_search_regexp, Fword_search_backward)
6951 (Fword_search_forward, Fword_search_backward_lax)
6952 (Fword_search_forward_lax): Move functions to isearch.el
6953 (bug#10145, bug#11381).
6954
6955 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6956
6957 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6958
6959 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6960
6961 * lread.c (init_obarray): Declare Qt and Qnil as special.
6962
6963 2012-05-14 Glenn Morris <rgm@gnu.org>
6964
6965 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
6966 Put "libexec" before "bin", for the sake of init_callproc_1.
6967
6968 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6969
6970 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6971
6972 * unexaix.c: Port to more-recent AIX compilers.
6973 (report_error, report_error_1, make_hdr, copy_sym)
6974 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6975 Make arguments const char *, not char *, to avoid violations of C
6976 standard and to fix some AIX warnings reported by Gilles Pion.
6977
6978 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6979
6980 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6981 already have overlays loaded.
6982 (handle_single_display_spec): Before returning without displaying
6983 fringe bitmap, synchronize the bidi iterator with the main display
6984 iterator, by calling iterate_out_of_display_property.
6985 (iterate_out_of_display_property): Detect buffer iteration by
6986 testing that it->string is a Lisp string.
6987 (get_next_display_element): When the current object is exhausted,
6988 and there's something on it->stack, call set_iterator_to_next to
6989 proceed with what's on the stack, instead of returning zero.
6990 (set_iterator_to_next): If called at the end of a Lisp string,
6991 proceed to consider_string_end without incrementing string
6992 position. Don't increment display vector index past the end of
6993 the display vector. (Bug#11417)
6994 (pos_visible_p): Don't report a position visible when move_it_to
6995 stopped at the last line of window, which happens to be scanned
6996 backwards by the bidi iteration. (Bug#11464)
6997
6998 2012-05-14 Eli Zaretskii <eliz@gnu.org>
6999
7000 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7001 and right-margin display specs even if the spec is invalid or we
7002 are on a TTY, and thus unable to display on the fringes.
7003 That's because the text with the property will not be displayed anyway,
7004 so we need to signal to the caller that this is a "replacing"
7005 display spec. This fixes display when the spec is invalid or we
7006 are on a TTY.
7007
7008 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7009
7010 * unexaix.c (make_hdr): Fix typo in prototype.
7011 This bug broke the build on AIX. Problem reported by Gilles Pion.
7012
7013 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7014
7015 * keyboard.c (kbd_buffer_get_event): Read special events also in
7016 batch mode. (Bug#11415)
7017
7018 2012-05-12 Glenn Morris <rgm@gnu.org>
7019
7020 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7021
7022 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7023
7024 * lisp.mk (lisp): Add newcomment.elc.
7025
7026 2012-05-12 Glenn Morris <rgm@gnu.org>
7027
7028 * Makefile.in (MKDIR_P): New, set by configure.
7029 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7030
7031 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7032
7033 Remove unused function hourglass_started.
7034 * dispextern.h (hourglass_started):
7035 * w32fns.c (hourglass_started):
7036 * xdisp.c (hourglass_started): Remove.
7037
7038 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7039
7040 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7041 Update dependencies.
7042
7043 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7044
7045 * xgselect.c (xg_select): Put maxfds+1 into a var.
7046 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7047
7048 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7049
7050 2012-05-10 Dave Abrahams <dave@boostpro.com>
7051
7052 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7053 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7054
7055 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7056
7057 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7058 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7059 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7060 Initialize xd_registered_buses.
7061
7062 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7063
7064 Untag more efficiently if USE_LSB_TAG.
7065 This is based on a proposal by YAMAMOTO Mitsuharu in
7066 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7067 For an admittedly artificial (nth 8000 longlist) benchmark on
7068 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7069 Emacs's overall text size by 1%.
7070 * lisp.h (XUNTAG): New macro.
7071 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7072 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7073 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7074 * eval.c (Fautoload):
7075 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7076 * frame.h (XFRAME): Use XUNTAG.
7077
7078 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7079 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7080 Remove unportable assumptions about print widths of types like
7081 dbus_uint32_t.
7082 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7083 intptr_t when converting between pointer and integer, to avoid GCC
7084 warnings about wrong width.
7085
7086 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7087
7088 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7089 stack for each reader_thread, instead of defaulting to 8MB
7090 determined by the linker. This avoids failures in creating
7091 subprocesses on Windows 7, see the discussion in this thread:
7092 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7093
7094 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7095
7096 Fix up display of the *Minibuf-0* buffer in the mini window.
7097 * keyboard.c (read_char): Don't clear the echo area if there's no
7098 message to clear.
7099 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7100 contents of *Minibuf-0*) if there's no message displayed in its stead.
7101
7102 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7103
7104 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7105 batch mode.
7106
7107 2012-05-06 Chong Yidong <cyd@gnu.org>
7108
7109 * lisp.mk (lisp): Update.
7110
7111 2012-05-05 Jim Meyering <meyering@redhat.com>
7112
7113 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7114
7115 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7116
7117 * data.c (PUT_ERROR): New macro.
7118 (syms_of_data): Use it. Add new error type `user-error'.
7119 * undo.c (user_error): New function.
7120 (Fprimitive_undo): Use it.
7121 * print.c (print_error_message): Adjust print style for `user-error'.
7122 * keyboard.c (user_error): New function.
7123 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7124
7125 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7126
7127 Do not limit current-time-string to years 1000..9999.
7128 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7129 (Fcurrent_time_string): Support any year that is supported by the
7130 underlying localtime representation. Don't use asctime, as it
7131 has undefined behavior for years outside the range -999..9999.
7132
7133 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 Fix race conditions involving setenv, gmtime, localtime, asctime.
7136 Without this fix, interrupts could mess up code that uses these
7137 nonreentrant functions, since setting TZ invalidates existing
7138 tm_zone or tzname values, and since most of these functions return
7139 pointers to static storage.
7140 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7141 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7142 Grow the critical sections to include not just invoking
7143 localtime/gmtime, but also accessing these functions' results
7144 including their tm_zone values if any, and any related TZ setting.
7145 (format_time_string): Last arg is now struct tm *, not struct tm **,
7146 so that the struct tm is saved in the critical section.
7147 All callers changed. Simplify allocation of initial buffer, partly
7148 motivated by the fact that memory allocation needs to be outside
7149 the critical section.
7150
7151 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7152
7153 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7154 with RESET_INTERVAL.
7155
7156 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7157 Remove duplicated buffer name initialization.
7158
7159 2012-05-02 Jim Meyering <jim@meyering.net>
7160
7161 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7162
7163 * xfns.c (x_window): Use xstrdup (Bug#11375).
7164
7165 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7166
7167 * xdisp.c (pos_visible_p): If already at a newline from the
7168 display string before the 'while' loop, don't walk back the glyphs
7169 from it3.glyph_row. Solves assertion violation when the display
7170 string begins with a newline (egg.el). (Bug#11367)
7171
7172 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7173
7174 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7175 Move to simple.el.
7176
7177 2012-05-01 Glenn Morris <rgm@gnu.org>
7178
7179 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7180 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7181 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7182 All were removed before 23.1.
7183
7184 * dispnew.c: Remove HAVE_LIBNCURSES test;
7185 it is always true on relevant platforms.
7186
7187 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7188 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7189
7190 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7191
7192 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7193
7194 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7195 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7196 Remove.
7197
7198 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7199
7200 Do not avoid creating empty evaporating overlays (Bug#9642).
7201 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7202 That is, do not delete an evaporating overlay if it becomes
7203 empty after its bounds are adjusted to fit within its buffer.
7204 This fix caused other problems, and I'm reverting it until we get
7205 to the bottom of them.
7206
7207 2012-04-27 Chong Yidong <cyd@gnu.org>
7208
7209 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7210
7211 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7212
7213 * xdisp.c (pos_visible_p): If the window start position is beyond
7214 ZV, start the display from buffer beginning. Prevents assertion
7215 violation in init_iterator when the minibuffer window is scrolled
7216 via the scroll bar.
7217
7218 * window.c (window_scroll_pixel_based): Likewise.
7219
7220 2012-04-27 Chong Yidong <cyd@gnu.org>
7221
7222 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7223
7224 2012-04-27 Glenn Morris <rgm@gnu.org>
7225
7226 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7227 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7228
7229 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7230
7231 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7232 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7233
7234 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7235
7236 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7237 display element, check also the underlying string or buffer
7238 character. (Bug#11341)
7239
7240 * w32menu.c: Include w32heap.h.
7241 (add_menu_item): If the call to AppendMenuW (via
7242 unicode_append_menu) fails, disable Unicode menus only if we are
7243 running on Windows 9X/Me.
7244
7245 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7246
7247 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7248 (xgetint): Add missing shift for LSB tags.
7249
7250 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7251
7252 * keyboard.c (read_char): Don't wipe echo area for select window
7253 events: These might get delayed via `mouse-autoselect-window'
7254 (Bug#11304).
7255
7256 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7257
7258 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7259 manipulation of :loaded-from data.
7260
7261 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7262
7263 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7264 now a cons (bug#11311).
7265
7266 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7267
7268 Do not create empty overlays with the evaporate property (Bug#9642).
7269 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7270 if it becomes empty after its bounds are adjusted to fit within
7271 its buffer. Without this fix, in a nonempty buffer (let ((o
7272 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7273 yields an empty overlay that has the evaporate property, which is
7274 not supposed to happen.
7275
7276 Fix minor GTK3 problems found by static checking.
7277 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7278 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7279 (struct _EmacsFixedClass, emacs_fixed_get_type):
7280 Move decls here from emacsgtkfixed.h, since they needn't be public.
7281 (emacs_fixed_get_type): Now static.
7282 (emacs_fixed_class_init): Omit unused local.
7283 (emacs_fixed_child_type): Remove; unused.
7284 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7285 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7286 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7287 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7288 (EMACS_FIXED_GET_CLASS): Remove; unused.
7289 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7290
7291 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7292 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7293
7294 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7295
7296 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7297 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7298 (__malloc_size_t, __malloc_ptrdiff_t):
7299 Remove. All uses removed, replaced by the definiens if needed,
7300 since we can assume C89 or better now.
7301 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7302 (protect_malloc_state, align, get_contiguous_space)
7303 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7304 (malloc_atfork_handler_child, malloc_enable_thread)
7305 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7306 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7307 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7308 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7309 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7310 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7311 Define using prototypes, not old style.
7312 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7313 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7314 (align): Don't assume that signed integer overflow wraps around.
7315 Omit unused local var.
7316 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7317 (_free_internal_nolock, memalign, mallochook, reallochook):
7318 Omit no-longer-needed casts.
7319 (valloc): Use getpagesize, not __getpagesize.
7320 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7321 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7322
7323 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7324
7325 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7326
7327 Move functions from C to Lisp. Make non-blocking method calls
7328 the default. Implement further D-Bus standard interfaces.
7329
7330 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7331 (QCdbus_request_name_allow_replacement)
7332 (QCdbus_request_name_replace_existing)
7333 (QCdbus_request_name_do_not_queue)
7334 (QCdbus_request_name_reply_primary_owner)
7335 (QCdbus_request_name_reply_in_queue)
7336 (QCdbus_request_name_reply_exists)
7337 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7338 (QCdbus_registered_serial, QCdbus_registered_method)
7339 (QCdbus_registered_signal): New Lisp objects.
7340 (XD_DEBUG_MESSAGE): Use sizeof.
7341 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7342 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7343 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7344 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7345 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7346 (xd_signature, xd_append_arg): Allow float for integer types.
7347 (xd_get_connection_references): New function.
7348 (xd_get_connection_address): Rename from xd_initialize.
7349 Return cached address.
7350 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7351 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7352 level.
7353 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7354 Return number of refcounts.
7355 (Fdbus_get_unique_name): Make stronger parameter check.
7356 (Fdbus_message_internal): New defun.
7357 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7358 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7359 (Fdbus_send_signal, Fdbus_register_service)
7360 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7361 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7362 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7363 (Vdbus_compiled_version, Vdbus_runtime_version)
7364 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7365 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7366 (Vdbus_message_type_signal): New defvars.
7367 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7368 Adapt docstring.
7369
7370 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7371
7372 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7373 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7374 Do not assume ptrdiff_t is the same width as 'int'.
7375
7376 * alloc.c: Handle unusual debugging option combinations.
7377 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7378 since the two debugging options are incompatible.
7379 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7380 is defined.
7381 (mem_init, mem_insert, mem_insert_fixup):
7382 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7383 (NEED_MEM_INSERT): Remove; no longer needed.
7384
7385 2012-04-22 Leo Liu <sdl.web@gmail.com>
7386
7387 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7388
7389 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7390
7391 * sysdep.c [__FreeBSD__]: Minor cleanups.
7392 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7393 Use Emacs indenting style more consistently. Avoid some casts.
7394 Use 'double' consistently rather than mixing 'float' and 'double'.
7395
7396 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7397
7398 * sysdep.c (list_system_processes, system_process_attributes):
7399 Add implementation for FreeBSD (Bug#5243).
7400
7401 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7402
7403 * lisp.mk (lisp): Update.
7404
7405 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7406
7407 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7408 It is never used otherwise.
7409
7410 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7411
7412 * print.c (print_preprocess): Only check print_depth if print-circle
7413 is nil.
7414 (print_object): Check for cycles even when print-circle is nil and
7415 print-gensym is t, but only check print_depth if print-circle is nil.
7416
7417 2012-04-20 Chong Yidong <cyd@gnu.org>
7418
7419 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7420 set the status to "failed" and ensure that sentinel is run.
7421
7422 2012-04-20 Glenn Morris <rgm@gnu.org>
7423
7424 * process.c (Fset_process_inherit_coding_system_flag)
7425 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7426 (Fmake_network_process, Fmake_serial_process): Doc fix.
7427
7428 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7429
7430 * xdisp.c (string_buffer_position_lim): Limit starting position to
7431 BEGV.
7432 (set_cursor_from_row): If called for a mode-line or header-line
7433 row, return zero immediately.
7434 (try_cursor_movement): If inside continuation line, don't back up
7435 farther than the first row after the header line, if any.
7436 Don't consider the header-line row as "partially visible", even if
7437 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7438
7439 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7440
7441 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7442 (bug#11238).
7443
7444 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7445 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7446
7447 configure: new option --enable-gcc-warnings (Bug#11207)
7448 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7449 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7450 (ALL_CFLAGS): Use new macros rather than old.
7451 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7452 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7453 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7454 -Wunused-result, -Wunused-variable. This should go away once
7455 the Emacs and Gnulib regex code is merged.
7456 (xmalloc, xrealloc): Now static.
7457
7458 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7459
7460 * dired.c (Fsystem_groups): Remove unused local.
7461
7462 2012-04-17 Glenn Morris <rgm@gnu.org>
7463
7464 * dired.c (Fsystem_users): Doc fix.
7465
7466 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7467
7468 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7469 (syms_of_dired): Add them.
7470
7471 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7472
7473 Fix minor alloc.c problems found by static checking.
7474 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7475 New extern decls, to avoid calling undeclared functions.
7476 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7477 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7478 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7479 (NEED_MEM_INSERT): New macro.
7480 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7481 Remove one incorrect comment and fix another.
7482
7483 Fix minor ralloc.c problems found by static checking.
7484 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7485 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7486 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7487 (r_alloc_sbrk): Now static.
7488
7489 Improve ralloc.c interface checking.
7490 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7491 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7492 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7493 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7494 [REL_ALLOC]: ... to here, to check interface.
7495 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7496 Remove decls. This fixes an "It stinks!".
7497
7498 * alloc.c (which_symbols): Fix alignment issue / type clash.
7499
7500 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7501
7502 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7503 (struct Lisp_Misc_Any): Likewise.
7504 (struct Lisp_Free): Likewise.
7505 * alloc.c (union aligned_Lisp_Symbol): Define.
7506 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7507 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7508 (union aligned_Lisp_Misc): Define.
7509 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7510 aligned_Lisp_Misc instead of union Lisp_Misc.
7511 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7512
7513 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7514
7515 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7516 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7517 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7518 * s/netbsd.h, s/sol2-6.h:
7519 Remove definition of GC_MARK_STACK, since the default now works.
7520 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7521 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7522 no longer the default.
7523 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7524
7525 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7526
7527 * lread.c (lisp_file_lexically_bound_p):
7528 Fix hang at ";-*-\n" (bug#11238).
7529
7530 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7531
7532 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7533 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7534
7535 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7536
7537 * nsterm.m (constrainFrameRect): Always constrain when there is only
7538 one screen (Bug#10962).
7539
7540 2012-04-13 Ken Brown <kbrown@cornell.edu>
7541
7542 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7543
7544 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7545
7546 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7547
7548 2012-04-11 Daniel Colascione <dancol@dancol.org>
7549
7550 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7551 against is gone. It's better to use vfork now so that when Cygwin
7552 gains a new, working vfork, we use it automatically (bug#10398).
7553
7554 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7555
7556 * window.c (save_window_save): Obey window-point-insertion-type.
7557
7558 2012-04-11 Glenn Morris <rgm@gnu.org>
7559
7560 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7561
7562 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7563
7564 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7565
7566 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7567
7568 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7569 (force_quit_count): New var.
7570 (handle_interrupt): Use it.
7571
7572 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7573
7574 * w32.c (w32_delayed_load): Record the full path of the library
7575 being loaded (bug#10424).
7576
7577 2012-04-09 Glenn Morris <rgm@gnu.org>
7578
7579 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7580 not just in the obarray, before snarfing them. (Bug#11036)
7581
7582 * Makefile.in ($(leimdir)/leim-list.el):
7583 Pass EMACS rather than BUILT_EMACS.
7584
7585 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7586
7587 * process.c (make_process):
7588 * process.h: Add integer `gnutls_handshakes_tried' member to
7589 process struct.
7590
7591 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7592 Add convenience `GNUTLS_LOG2i' macro.
7593
7594 * gnutls.c (gnutls_log_function2i): Convenience log function.
7595 (emacs_gnutls_read): Use new log functions,
7596 `gnutls_handshakes_tried' process member, and
7597 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7598 attempts per process (connection).
7599
7600 2012-04-09 Chong Yidong <cyd@gnu.org>
7601
7602 * eval.c (Fuser_variable_p, user_variable_p_eh)
7603 (lisp_indirect_variable): Functions deleted.
7604 (Fdefvar): Caller changed.
7605
7606 * callint.c (Finteractive, Fcall_interactively):
7607 * minibuf.c (Fread_variable): Callers changed.
7608
7609 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7610
7611 * xdisp.c (set_cursor_from_row): If the display string appears in
7612 the buffer at position that is closer to point than the position
7613 after the display string, display the cursor on the first glyph of
7614 the display string. Fixes cursor display when a 'display' text
7615 property immediately follows invisible text. (Bug#11094)
7616
7617 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7618
7619 composite.c: use 'double' consistently
7620 * composite.c (get_composition_id): Use 'double' consistently
7621 instead of converting 'float' to 'double' and vice versa; this is
7622 easier to understand and avoids a GCC warning.
7623
7624 2012-04-09 Glenn Morris <rgm@gnu.org>
7625
7626 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7627 preparation for dumping it with emacs. (Bug#4789)
7628 (leimdir): New variable.
7629 ($(leimdir)/leim-list.el): New rule.
7630 (emacs$(EXEEXT)): Depend on leim-list.el.
7631
7632 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7633 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7634 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7635
7636 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7637
7638 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7639 proper alignment.
7640
7641 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7642
7643 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7644 Remove unused local variable.
7645
7646 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7649 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7650 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7651 objects, as mark_maybe_pointer will catch them otherwise.
7652 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7653 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7654
7655 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7656
7657 Fix typo that broke non-Windows builds.
7658 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7659
7660 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7661
7662 Support building on MS-Windows with libxml2.
7663
7664 * makefile.w32-in (OBJ2): Add xml.$(O).
7665 (GLOBAL_SOURCES): Add xml.c.
7666 ($(BLD)/xml.$(O)): New dependency list.
7667
7668 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7669 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7670 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7671 [!WINDOWSNT]: New macros.
7672 (init_libxml2_functions, libxml2_loaded_p): New functions.
7673 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7674 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7675 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7676 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7677 linked in).
7678 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7679 Call init_libxml2_functions before calling libxml2 functions.
7680 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7681
7682 * emacs.c: Don't include libxml/parser.h.
7683 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7684 xmlCleanupParser directly.
7685
7686 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7687
7688 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7689
7690 * indent.c (Fvertical_motion): If there is a display string at
7691 point, use it.vpos to compute how many lines to backtrack after
7692 move_it_to point. (Bug#11133)
7693
7694 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7695
7696 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7697 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7698 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7699 macros related to unification of CJK characters. For the details,
7700 see the discussion following the message here:
7701 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7702
7703 2012-04-04 Chong Yidong <cyd@gnu.org>
7704
7705 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7706
7707 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7708
7709 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7710 instead of alloca. (Bug#11138)
7711
7712 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7713
7714 * w32menu.c (is_simple_dialog): Properly check lisp types.
7715 (Bug#11141)
7716
7717 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7718
7719 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7720 position we get to after a call to move_it_to fails the
7721 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7722 only if we wind up in a string from display property. (Bug#11063)
7723
7724 * window.c (Fdelete_other_windows_internal): Invalidate the row
7725 and column information about mouse highlight, so that redisplay
7726 restores it after reallocating the glyph matrices. (Bug#7464)
7727
7728 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7729 string comes from a `display' text property, use the buffer
7730 position of that property as if we actually saw that position in
7731 the row's glyphs.
7732 (move_it_by_lines): Remove the assertion that
7733 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7734 violated when there's a before-string at the beginning of a line.
7735 (Bug#11063)
7736
7737 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7738
7739 * xdisp.c (append_space_for_newline): If the default face was
7740 remapped, use the remapped face for the appended newline.
7741 (extend_face_to_end_of_line): Use the remapped default face for
7742 extending the face to the end of the line.
7743 (display_line): Call extend_face_to_end_of_line when the default
7744 face was remapped. (Bug#11068)
7745
7746 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7747
7748 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7749
7750 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7751
7752 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7753
7754 2012-03-27 Glenn Morris <rgm@gnu.org>
7755
7756 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7757 Doc fixes.
7758
7759 2012-03-26 Kenichi Handa <handa@m17n.org>
7760
7761 * dispextern.h (struct glyph): Fix previous change. Change the
7762 bit length of glyphless.ch to 25 (Bug#11082).
7763
7764 2012-03-26 Chong Yidong <cyd@gnu.org>
7765
7766 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7767 (command_loop_1): Use it; inhibit selection update for
7768 handle-select-window too (Bug#8996).
7769
7770 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7771
7772 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7773
7774 2012-03-25 Kenichi Handa <handa@m17n.org>
7775
7776 * dispextern.h (struct glyph): Change the bit length of
7777 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7778
7779 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7780
7781 * s/ms-w32.h (tzname): Include time.h before redirecting to
7782 _tzname. Fixes the MSVC build. (Bug#9960)
7783
7784 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7785
7786 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7787 characters.
7788
7789 * xterm.c (XTread_socket): Only modify handling_signal if
7790 !SYNC_INPUT. (Bug#11080)
7791
7792 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7793
7794 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7795 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7796 when fetching a multibyte character consumes more bytes than
7797 CHAR_BYTES returns, due to unification of CJK characters in
7798 string_char. (Bug#11073)
7799
7800 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7801
7802 * process.c (wait_reading_process_output): Handle pty disconnect
7803 by refraining from sending oneself a SIGCHLD (bug#10933).
7804
7805 2012-03-22 Chong Yidong <cyd@gnu.org>
7806
7807 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7808
7809 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7810 Mark string as coming from a prefix property.
7811 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7812 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7813
7814 2012-03-21 Chong Yidong <cyd@gnu.org>
7815
7816 * xfaces.c (Vface_remapping_alist): Doc fix.
7817
7818 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7819
7820 * w32proc.c (Fw32_set_console_codepage)
7821 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7822 Doc fixes.
7823
7824 2012-03-20 Chong Yidong <cyd@gnu.org>
7825
7826 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7827 to reflect default non-nil value of redisplay-dont-pause.
7828
7829 2012-03-19 Kenichi Handa <handa@m17n.org>
7830
7831 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7832 it fit in a valid range (Bug#11003).
7833
7834 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7835
7836 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7837 that is not from display property, accept the row as a "cursor
7838 row" if one of the string's character has a non-nil `cursor'
7839 property. Fixes cursor positioning when there are newlines in
7840 overlay strings, e.g. in icomplete.el. (Bug#11035)
7841
7842 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7843
7844 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7845
7846 2012-03-12 Chong Yidong <cyd@gnu.org>
7847
7848 * eval.c (inhibit_lisp_code): Rename from
7849 inhibit_window_configuration_change_hook; move from window.c.
7850
7851 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7852 * window.c (run_window_configuration_change_hook)
7853 (syms_of_window): Callers changed.
7854
7855 2012-03-11 Chong Yidong <cyd@gnu.org>
7856
7857 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7858
7859 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7860
7861 2012-03-10 Chong Yidong <cyd@gnu.org>
7862
7863 * frame.c (other_visible_frames): Don't assume the selected frame
7864 is visible (Bug#10955).
7865
7866 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7867
7868 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7869
7870 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7871
7872 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7873 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7874 zero (Bug#10954).
7875
7876 2012-03-03 Glenn Morris <rgm@gnu.org>
7877
7878 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
7879
7880 2012-03-02 Eli Zaretskii <eliz@gnu.org>
7881
7882 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
7883 position past the first glyph_row that ends at ZV. (Bug#10902)
7884 (redisplay_window, next_element_from_string): Fix typos in
7885 comments.
7886 (redisplay_window): Pass to move_it_vertically the margin in
7887 pixels, not in screen lines.
7888
7889 2012-03-02 Glenn Morris <rgm@gnu.org>
7890
7891 * buffer.c (buffer-list-update-hook): Doc fix.
7892
7893 2012-02-29 Eli Zaretskii <eliz@gnu.org>
7894
7895 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
7896 push_it before setting up the iterator for the first overlay
7897 string, even if we have an empty string loaded.
7898 (next_overlay_string): If there's an empty string on the iterator
7899 stack, pop the stack. (Bug#10903)
7900
7901 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
7902
7903 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
7904 Suggested by Stefan Monnier in
7905 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
7906 * alloc.c (widen_to_Lisp_Object): New static function.
7907 (mark_memory): Also mark Lisp_Objects by fetching pointer words
7908 and widening them to Lisp_Objects. This would work even if
7909 USE_LSB_TAG is defined and wide integers are used, which might
7910 happen in a future version of Emacs.
7911
7912 2012-02-25 Chong Yidong <cyd@gnu.org>
7913
7914 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
7915 Doc fix.
7916
7917 * xselect.c (Fx_selection_exists_p): Doc fix.
7918 (x_clipboard_manager_save_all): Print an informative message
7919 before saving to clipboard manager.
7920
7921 2012-02-24 Chong Yidong <cyd@gnu.org>
7922
7923 * keyboard.c (process_special_events): Handle all X selection
7924 requests in kbd_buffer, not just the next one (Bug#8869).
7925
7926 2012-02-23 Chong Yidong <cyd@gnu.org>
7927
7928 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
7929 call when setting menu-bar-lines and tool-bar-lines parameters.
7930 (unwind_create_frame_1): New helper function.
7931
7932 * window.c (inhibit_window_configuration_change_hook): New var.
7933 (run_window_configuration_change_hook): Obey it.
7934 (syms_of_window): Initialize it.
7935
7936 2012-02-22 Chong Yidong <cyd@gnu.org>
7937
7938 * xterm.c (x_draw_image_relief): Add missing type check for
7939 Vtool_bar_button_margin (Bug#10743).
7940
7941 2012-02-21 Chong Yidong <cyd@gnu.org>
7942
7943 * fileio.c (Vfile_name_handler_alist): Doc fix.
7944
7945 * buffer.c (Fget_file_buffer): Protect against invalid file
7946 handler return value.
7947
7948 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
7949
7950 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
7951 when computing $valmask.
7952
7953 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7954 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7955 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7956 It's useless in that case, and it can cause problems on hosts
7957 that allocate halves of EMACS_INT values separately.
7958 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7959 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7960 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7961 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7962 it avoids undefined behavior on hosts where shifting right by more
7963 than the word width has undefined behavior.
7964
7965 2012-02-19 Chong Yidong <cyd@gnu.org>
7966
7967 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7968 (Funhandled_file_name_directory, Ffile_name_as_directory)
7969 (Fdirectory_file_name, Fexpand_file_name)
7970 (Fsubstitute_in_file_name): Protect against invalid file handler
7971 return values (Bug#10845).
7972
7973 2012-02-18 Eli Zaretskii <eliz@gnu.org>
7974
7975 * .gdbinit (pitx): Fix incorrect references to fields of the
7976 iterator stack.
7977
7978 2012-02-17 Chong Yidong <cyd@gnu.org>
7979
7980 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7981
7982 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7983
7984 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7985 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7986
7987 2012-02-15 Chong Yidong <cyd@gnu.org>
7988
7989 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7990 marked as special. Also, starting docstrings with * is obsolete.
7991
7992 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7993
7994 * gnutls.c (emacs_gnutls_write): Fix last change.
7995
7996 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7997
7998 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7999 send_process.
8000
8001 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8002
8003 * keymap.c (Fsingle_key_description): Handle char ranges.
8004
8005 2012-02-12 Chong Yidong <cyd@gnu.org>
8006
8007 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8008 as that creates a dangerous corner case.
8009
8010 * window.c (Fdelete_window_internal): Invalidate the mouse
8011 highlight (Bug#9904).
8012
8013 2012-02-12 Glenn Morris <rgm@gnu.org>
8014
8015 * xselect.c (Fx_own_selection_internal)
8016 (Fx_get_selection_internal, Fx_disown_selection_internal)
8017 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8018 * nsselect.m (Fx_own_selection_internal)
8019 (Fx_disown_selection_internal, Fx_selection_exists_p)
8020 (Fx_selection_owner_p, Fx_get_selection_internal):
8021 Sync docs and argument specs with the xselect.c versions.
8022
8023 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8024
8025 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8026
8027 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8028
8029 * w32select.c (Fx_selection_exists_p): Sync doc string and
8030 argument list with xselect.c. (Bug#10783)
8031
8032 * w16select.c (Fx_selection_exists_p): Sync doc string and
8033 argument list with xselect.c. (Bug#10783)
8034
8035 2012-02-10 Glenn Morris <rgm@gnu.org>
8036
8037 * fns.c (Fsecure_hash): Doc fix.
8038
8039 2012-02-09 Kenichi Handa <handa@m17n.org>
8040
8041 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8042
8043 2012-02-07 Chong Yidong <cyd@gnu.org>
8044
8045 * buffer.c (Fbuffer_local_variables)
8046 (buffer_lisp_local_variables): Handle unbound vars correctly;
8047 don't let Qunbound leak into Lisp.
8048
8049 2012-02-07 Glenn Morris <rgm@gnu.org>
8050
8051 * image.c (Fimagemagick_types): Doc fix.
8052
8053 * image.c (imagemagick-render-type): Change it from a lisp object
8054 to an integer. Move the doc here from the lisp manual.
8055 Treat all values not equal to 0 the same.
8056
8057 2012-02-06 Chong Yidong <cyd@gnu.org>
8058
8059 * doc.c (store_function_docstring): Avoid applying docstring of
8060 alias to base function (Bug#2603).
8061
8062 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8063
8064 * .gdbinit (pp1, pv1): Remove redundant defines.
8065 (pr): Use pp.
8066
8067 2012-02-04 Chong Yidong <cyd@gnu.org>
8068
8069 * nsterm.m: Declare a global (Bug#10694).
8070
8071 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8072
8073 * w32.c (get_emacs_configuration_options):
8074 Include --enable-checking, if specified, in the return value.
8075
8076 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8077
8078 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8079 after rounding frame sizes. (Bug#9723)
8080
8081 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8082
8083 * keyboard.c (adjust_point_for_property): Don't position point
8084 before BEGV. (Bug#10696)
8085
8086 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8087
8088 Handle overflow when computing char display width (Bug#9496).
8089 * character.c (char_width): Return EMACS_INT, not int.
8090 (char_width, c_string_width): Check for overflow when
8091 computing the width; this is possible now that individual
8092 characters can have unbounded width. Problem introduced
8093 by merge from Emacs 23 on 2012-01-19.
8094
8095 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8096
8097 * dbusbind.c (Fdbus_register_method): Mention the return value
8098 :ignore in the docstring.
8099
8100 2012-02-02 Glenn Morris <rgm@gnu.org>
8101
8102 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8103
8104 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8105 Unconditionally set to t. (Bug#10673)
8106 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8107 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8108 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8109
8110 2012-02-02 Kenichi Handa <handa@m17n.org>
8111
8112 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8113 0, do not call append_composite_glyph.
8114
8115 2012-02-02 Kenichi Handa <handa@m17n.org>
8116
8117 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8118 NULL (Bug#6988).
8119 (x_produce_glyphs): If the component of a composition is a null
8120 string, set it->pixel_width to 1 to avoid zero-width glyph.
8121
8122 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8123
8124 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8125 first 2 arguments are identical. This makes inserting large
8126 output from a subprocess an order of magnitude faster on
8127 MS-Windows, where all sbrk'ed memory is always contiguous.
8128
8129 2012-01-31 Glenn Morris <rgm@gnu.org>
8130
8131 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8132 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8133 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8134
8135 2012-01-29 Glenn Morris <rgm@gnu.org>
8136
8137 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8138
8139 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8140
8141 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8142
8143 2012-01-28 Chong Yidong <cyd@gnu.org>
8144
8145 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8146
8147 2012-01-26 Chong Yidong <cyd@gnu.org>
8148
8149 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8150
8151 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8152 repeat counts (Bug#10507).
8153
8154 2012-01-26 Glenn Morris <rgm@gnu.org>
8155
8156 * lread.c (syms_of_lread): Doc fix.
8157
8158 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8159
8160 * coding.c (encode_designation_at_bol): Change return value to
8161 EMACS_INT.
8162
8163 2012-01-25 Chong Yidong <cyd@gnu.org>
8164
8165 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8166
8167 2012-01-21 Chong Yidong <cyd@gnu.org>
8168
8169 * floatfns.c (Fcopysign): Make the second argument non-optional,
8170 since nil is not allowed anyway.
8171
8172 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8173
8174 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8175 (send_process): Likewise.
8176
8177 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8178
8179 * window.c (save_window_save, Fcurrent_window_configuration)
8180 (Vwindow_persistent_parameters): Do not use Qstate.
8181 Rewrite doc-strings.
8182
8183 2012-01-19 Kenichi Handa <handa@m17n.org>
8184
8185 * character.c (char_width): New function.
8186 (Fchar_width, c_string_width, lisp_string_width):
8187 Use char_width (Bug#9496).
8188
8189 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8190
8191 * window.c (Vwindow_persistent_parameters): New variable.
8192 (Fset_window_configuration, save_window_save): Handle persistent
8193 window parameters.
8194
8195 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8196
8197 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8198 thrashing the stack of the thread. (Bug#9087)
8199
8200 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8201
8202 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8203
8204 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8205
8206 * xdisp.c (rows_from_pos_range): Handle the case where the
8207 highlight ends on a newline. (Bug#10464)
8208 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8209 he end column for display of highlight that ends on a newline
8210 before a R2L line.
8211
8212 2012-01-11 Glenn Morris <rgm@gnu.org>
8213
8214 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8215 from load-path also when installation-directory is nil. (Bug#10208)
8216
8217 2012-01-10 Glenn Morris <rgm@gnu.org>
8218
8219 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8220
8221 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8222 Update template values to be closer to their typical values these days.
8223
8224 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8225
8226 * xdisp.c (rows_from_pos_range): Accept additional argument
8227 DISP_STRING, and accept any glyph in a row whose object is that
8228 string as eligible for mouse highlight. Fixes mouse highlight of
8229 display strings from overlays. (Bug#10464)
8230
8231 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8232
8233 emacs: fix an auto-save permissions race condition (Bug#10400)
8234 * fileio.c (auto_saving_dir_umask): New static var.
8235 (Fmake_directory_internal): Use it.
8236 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8237 creating the directory. The old code temporarily assigns
8238 too-generous permissions to the directory.
8239 (do_auto_save_eh): Clear it.
8240 (Fdo_auto_save): Catch all errors, not just file errors, so
8241 that the var is always cleared.
8242
8243 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8244
8245 * search.c (scan_buffer): Pass character positions to
8246 know_region_cache, not byte positions. (Bug#6540)
8247
8248 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8249
8250 * w32.c (sys_rename): Report EXDEV when rename of a directory
8251 fails because the target is on another logical disk. (Bug#10284)
8252
8253 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8254
8255 * xterm.c (x_embed_request_focus): New function.
8256
8257 * xterm.h: Add prototype.
8258
8259 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8260
8261 2012-01-05 Glenn Morris <rgm@gnu.org>
8262
8263 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8264
8265 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8266
8267 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8268 Load gnutls_transport_set_lowat only if GnuTLS version is below
8269 2.11.1.
8270 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8271 GnuTLS versions below 2.11.1.
8272
8273 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8274
8275 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8276 to the doc string advising against its use for altering the way
8277 windows are scrolled.
8278
8279 2011-12-28 Kenichi Handa <handa@m17n.org>
8280
8281 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8282 coding-system ASCII compatible only when it does not produce BOM
8283 on encoding (Bug#10383).
8284
8285 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8286
8287 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8288 can scroll.
8289 (create_and_show_popup_menu): Always use menu_position_func for
8290 Gtk3 (Bug#10361).
8291
8292 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8293
8294 * callint.c (Fcall_interactively): Don't truncate prompt string.
8295
8296 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8297
8298 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8299 property that ends at ZV, so that the bidi iteration could be
8300 resumed from there (after widening). (Bug#10360)
8301
8302 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8303
8304 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8305
8306 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8307
8308 * nsterm.m (x_free_frame_resources):
8309 Release f->output_data.ns->miniimage.
8310 (ns_index_color): Fix indentation. Do not retain
8311 color_table->colors[i].
8312
8313 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8314 before returning.
8315
8316 * nsfns.m (x_set_background_color): Assign return value from
8317 ns_index_color to face-background instead of NSColor*.
8318 (ns_implicitly_set_icon_type): Fix indentation.
8319 Change assignment in for loop to comparison.
8320
8321 * emacs.c (ns_pool): New variable.
8322 (main): Assign ns_pool.
8323 (Fkill_emacs): Call ns_release_autorelease_pool.
8324
8325 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8326 autorelease fdesc, release fdAttrs and tdict.
8327 (ns_get_covering_families): Release charset.
8328 (ns_findfonts): Release NSFontDescriptor created with new.
8329 (ns_uni_to_glyphs): Fix indentation.
8330 (setString): Release attrStr before assigning new value.
8331
8332 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8333
8334 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8335 and NS_IMPL_COCOA.
8336 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8337 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8338
8339 2011-12-18 David Reitter <reitter@cmu.edu>
8340
8341 * nsterm.m (ns_term_init): Subscribe for notifications
8342 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8343 to method trackingNotification in EmacsMenu.
8344
8345 * nsmenu.m (trackingMenu): New variable.
8346 (trackingNotification): New method (from Aquamacs).
8347 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8348 from Aquamacs (Bug#7030).
8349
8350 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8351
8352 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8353 (symbol_to_nsstring): Fix indentation.
8354 (ns_symbol_to_pb): New function.
8355 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8356 (Fns_rotate_cut_buffers_internal): Remove.
8357 (Fns_store_selection_internal): Rename from
8358 Fns_store_cut_buffer_internal.
8359 (ns_get_foreign_selection, Fx_own_selection_internal)
8360 (Fx_disown_selection_internal, Fx_selection_exists_p)
8361 (Fns_get_selection_internal, Fns_store_selection_internal):
8362 Use ns_symbol_to_pb and check if return value is nil.
8363 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8364 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8365 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8366 renamed to Sns_store_selection_internal.
8367 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8368 and remove this function.
8369 (ns_handle_selection_clear): Remove, never used.
8370 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8371 here.
8372
8373 2011-12-17 Ken Brown <kbrown@cornell.edu>
8374
8375 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8376 GID is unknown (Bug#10257).
8377
8378 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8379
8380 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8381 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8382 which caused a build failure on GNU/Linux IA-64. This problem was
8383 introduced by my 2011-10-07 patch.
8384
8385 2011-12-15 Juri Linkov <juri@jurta.org>
8386
8387 * image.c (imagemagick_error): New function. (Bug#10112)
8388 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8389 Use `imagemagick_error' where ImageMagick functions return
8390 `MagickFalse'.
8391 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8392 proper order.
8393
8394 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8395
8396 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8397 fill background (Bug#8992).
8398
8399 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8400
8401 * window.c (Vwindow_combination_resize)
8402 (Vwindow_combination_limit): Use t instead of non-nil in
8403 doc-strings.
8404 (Vrecenter_redisplay): Add first sentence of doc-string on
8405 separate line.
8406 (Frecenter): Fix doc-string typo.
8407
8408 2011-12-11 Kenichi Handa <handa@m17n.org>
8409
8410 * coding.c (Funencodable_char_position): Pay attention to the
8411 buffer text relocation (Bug#9389).
8412
8413 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8414
8415 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8416 gtk_init (Bug#10100).
8417
8418 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8419
8420 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8421 IT->string is nil. (Bug#10263)
8422
8423 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8424
8425 * nsterm.h (x_free_frame_resources): Declare.
8426
8427 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8428 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8429
8430 * nsterm.h (ns_get_defaults_value): Declare.
8431
8432 * nsterm.m (ns_default): Call ns_get_defaults_value.
8433
8434 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8435
8436 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8437 (Bug#10170)
8438
8439 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8440
8441 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8442 that where the value of an _OBJC_* symbol points to is in the .bss
8443 section (Bug#10240).
8444
8445 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8446
8447 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8448 after the loop to call ccl_driver at least once (Bug#8619).
8449
8450 2011-12-08 Kenichi Handa <handa@m17n.org>
8451
8452 * ftfont.c (get_adstyle_property): Fix previous change
8453 (Bug#10233).
8454
8455 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8456
8457 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8458 dirs from the default value of EMACSLOADPATH (bug#10208).
8459
8460 2011-12-07 Glenn Morris <rgm@gnu.org>
8461
8462 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8463 installation and source directories as well. (Bug#10208)
8464
8465 2011-12-06 Chong Yidong <cyd@gnu.org>
8466
8467 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8468
8469 2011-12-06 Glenn Morris <rgm@gnu.org>
8470
8471 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8472 as an error, not just -1. (Bug#10217)
8473
8474 2011-12-05 Chong Yidong <cyd@gnu.org>
8475
8476 * keyboard.c (process_special_events): New function.
8477 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8478
8479 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8480
8481 * coding.c (encode_designation_at_bol): Don't use uninitialized
8482 local variable (Bug#9318).
8483
8484 2011-12-05 Kenichi Handa <handa@m17n.org>
8485
8486 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8487 return Qnil (Bug#8046, Bug#10193).
8488
8489 2011-12-05 Kenichi Handa <handa@m17n.org>
8490
8491 * coding.c (encode_designation_at_bol): New args charbuf_end and
8492 dst. Return the number of produced bytes. Callers changed.
8493 (coding_set_source): Return how many bytes coding->source was
8494 relocated.
8495 (coding_set_destination): Return how many bytes
8496 coding->destination was relocated.
8497 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8498 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8499
8500 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8501
8502 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8503 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8504 macro (Bug#9318).
8505
8506 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8507
8508 The following changes are to fix Bug#9318.
8509
8510 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8511 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8512 (encode_coding_iso_2022, encode_coding_sjis)
8513 (encode_coding_big5, encode_coding_charset): Use the above macros.
8514
8515 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8516
8517 * lisp.h (process_quit_flag): Fix external declaration.
8518
8519 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8520
8521 Don't macro-inline non-performance-critical code.
8522 * eval.c (process_quit_flag): New function.
8523 * lisp.h (QUIT): Use it.
8524
8525 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8526
8527 * nsfns.m (get_geometry_from_preferences): New function.
8528 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8529
8530 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8531
8532 * emacs.c (Qkill_emacs): Define.
8533 (syms_of_emacs): Initialize it.
8534 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8535 Qquit_flag to `kill-emacs' instead.
8536 (quit_throw_to_read_char): Add parameter `from_signal'.
8537 All callers changed. Call Fkill_emacs if requested and safe.
8538 * lisp.h (QUIT): Call Fkill_emacs if requested.
8539
8540 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8541
8542 * widget.c (update_wm_hints): Return if wmshell is null.
8543 (widget_update_wm_size_hints): New function.
8544
8545 * widget.h (widget_update_wm_size_hints): Declare.
8546
8547 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8548 widget_update_wm_size_hints (Bug#10104).
8549
8550 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8551
8552 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8553 before a newline, prepare the bidi iterator for consuming the
8554 newline, and keep the current paragraph direction. (Bug#10183)
8555 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8556
8557 2011-12-02 Juri Linkov <juri@jurta.org>
8558
8559 * search.c (Fword_search_regexp): New Lisp function created from
8560 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8561 (Fword_search_backward, Fword_search_forward)
8562 (Fword_search_backward_lax, Fword_search_forward_lax):
8563 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8564 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8565
8566 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8567
8568 * fileio.c (Finsert_file_contents): Move after-change-function call
8569 to before the "handled:" label, since all "goto handled" appear in
8570 cases where the *-change-functions have already been properly called
8571 (bug#10117).
8572
8573 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8574
8575 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8576 waiting for input. (Bug#10169)
8577
8578 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8579
8580 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8581 verifies glyph row's hash code--we have just reallocated the
8582 glyphs, so their contents can be complete garbage. (Bug#10164)
8583
8584 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8585
8586 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8587
8588 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8589
8590 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8591 attributes are tested _before_ calling verify_row_hash, to protect
8592 against GCC re-ordering of the tests. (Bug#10164)
8593
8594 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8595
8596 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8597
8598 * xterm.c (handle_one_xevent): Only set async_visible and friends
8599 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8600 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8601 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8602
8603 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8604
8605 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8606 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8607 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8608 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8609 All uses changed to use GCPRO1 etc.
8610 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8611 Revert to old implementation (i.e., before 2011-03-11).
8612
8613 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8614
8615 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8616 of scroll runs so as to avoid assigning disabled bogus rows and
8617 unnecessary graphics copy operations.
8618
8619 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8620
8621 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8622 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8623 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8624 (malloc, free, realloc, calloc): Redirect to e_* only when
8625 compiling Emacs.
8626
8627 * lisp.h (GCTYPEBITS): Move before first use.
8628 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8629 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8630 this macro definition.
8631
8632 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8633 _MSC_VER.
8634
8635 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8636
8637 * gtkutil.c (xg_create_frame_widgets):
8638 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8639 present with Gtk+ 2.0.
8640
8641 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8642
8643 * fileio.c (Finsert_file_contents): Undo previous change; see
8644 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8645
8646 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8647
8648 Rename locals to avoid shadowing.
8649 * fileio.c (Finsert_file_contents):
8650 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8651 * process.c (wait_reading_process_output):
8652 Rename inner 'proc' to 'p' to avoid shadowing.
8653 Indent for consistency with usual Emacs style.
8654
8655 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8656
8657 * xdisp.c (redisplay_window): If cursor row is not fully visible
8658 after recentering, and scroll-conservatively is set to a large
8659 number, scroll window by a few more lines to make the cursor fully
8660 visible and out of scroll-margin. (Bug#10105)
8661 (start_display): Don't move to the next line if the display should
8662 start at a newline that is part of a display vector or an overlay
8663 string. (Bug#10119)
8664
8665 2011-11-24 Juri Linkov <juri@jurta.org>
8666
8667 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8668 after the `MagickPingImage' call. (Bug#10112)
8669
8670 2011-11-23 Chong Yidong <cyd@gnu.org>
8671
8672 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8673
8674 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8675
8676 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8677 making another buffer current. (Bug#10114)
8678
8679 2011-11-23 Glenn Morris <rgm@gnu.org>
8680
8681 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8682
8683 2011-11-23 Chong Yidong <cyd@gnu.org>
8684
8685 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8686 using it (Bug#5984).
8687
8688 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8689
8690 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8691 and header-lines, as they don't have one computed for them.
8692 (Bug#10098)
8693
8694 * .gdbinit (prow): Make displayed values more self-explaining.
8695 Add row's hash code.
8696
8697 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8698
8699 * process.c (wait_reading_process_output): Fix asynchrounous
8700 GnuTLS socket handling on some versions of the GnuTLS library.
8701 (wait_reading_process_output): Add comment and URL.
8702
8703 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8704
8705 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8706
8707 2011-11-21 Chong Yidong <cyd@gnu.org>
8708
8709 * window.c (Fnext_window, Fprevious_window): Doc fix.
8710
8711 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8712
8713 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8714
8715 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8716
8717 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8718
8719 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8720
8721 * window.c (Fset_window_combination_limit): Rename argument
8722 STATUS to LIMIT.
8723 (Vwindow_combination_limit): Remove "status" from doc-string.
8724
8725 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8726
8727 * m/ibms390.h: Remove.
8728 * m/ibms390x.h: Don't include "ibms390.h".
8729
8730 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8731
8732 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8733 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8734
8735 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8736
8737 * casetab.c (Fset_case_table):
8738 * charset.c (Fcharset_after): Fix typos.
8739
8740 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8741
8742 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8743 Otherwise, valgrind does not work on some platforms.
8744 Problem reported by Andreas Schwab in
8745 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8746 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8747 is set, removing the need for VIRT_ADDRESS_VARIES.
8748 (PURE_P): Use a more-efficient implementation that needs just one
8749 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8750 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8751 to 4 (xorl, subq, cmpq, setbe).
8752 * alloc.c (pure): Always extern now, since that's the
8753 VIRT_ADDR_VARIES behavior.
8754 (PURE_POINTER_P): Use a single comparison, not two, for
8755 consistency with the new puresize.h.
8756 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8757 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8758 Remove VIRT_ADDR_VARIES no longer needed.
8759
8760 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8761
8762 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8763 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8764 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8765 behave as if the cursor position were at the window margin.
8766
8767 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8768 and the cursor position is out of bounds, behave as if the cursor
8769 position were at the window margin. (Bug#10075)
8770
8771 2011-11-18 Chong Yidong <cyd@gnu.org>
8772
8773 * window.c (Fwindow_combination_limit): Make first argument
8774 non-optional, since it is meaningless for live windows like the
8775 selected window.
8776
8777 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8778
8779 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8780
8781 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8782
8783 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8784 (graft_intervals_into_buffer): Simplify.
8785
8786 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8787
8788 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8789 hash values of the two rows.
8790 (copy_row_except_pointers): Preserve the used[] arrays and the
8791 hash values of the two rows. (Bug#10035)
8792 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8793
8794 * xdisp.c (row_hash): New function, body extracted from
8795 compute_line_metrics.
8796 (compute_line_metrics): Call row_hash, instead of computing the
8797 hash code inline.
8798
8799 * dispnew.c (verify_row_hash): Call row_hash for computing the
8800 hash code of a row, instead of duplicating code from xdisp.c.
8801
8802 * dispextern.h (row_hash): Add prototype.
8803
8804 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8805
8806 * frame.c (delete_frame): Don't delete the terminal when the last
8807 X frame is closed if emacs is built with GTK toolkit.
8808
8809 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8810
8811 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8812
8813 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8814
8815 * window.c (Vwindow_splits): Rename to
8816 Vwindow_combination_resize. Suggested by Juri Linkov.
8817 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8818 of Vwindow_splits.
8819
8820 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8821
8822 * nsfns.m (Fns_font_name):
8823 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8824
8825 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8826
8827 * window.h (window): Rename slot "nest" to "combination_limit".
8828 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8829 (Fset_window_nest): Rename to Fset_window_combination_limit.
8830 (Vwindow_nest): Rename to Vwindow_combination_limit.
8831 (recombine_windows, make_parent_window, make_window)
8832 (Fsplit_window_internal, saved_window)
8833 (Fset_window_configuration, save_window_save): Rename all
8834 occurrences of window_nest to window_combination_limit.
8835
8836 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8837
8838 * image.c (imagemagick_load_image): Fix typo.
8839
8840 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8841
8842 * xdisp.c (display_line): Move the call to
8843 highlight_trailing_whitespace before the call to
8844 compute_line_metrics, since the latter needs to see the final
8845 faces of all the glyphs to compute ROW's hash value.
8846 Fixes assertion violations in row_equal_p. (Bug#10035)
8847
8848 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8849
8850 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8851 just return (bug#10044).
8852
8853 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8854
8855 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8856 with user-defined heap size. Bump the default size of the temacs
8857 heap to 27MB, to avoid memory warning when running temacs.
8858 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8859
8860 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8861 current_matrix and desired_matrix. (Bug#9990)
8862 (verify_row_hash) [XASSERTS]: New function.
8863 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8864 that the hash value of glyph rows is correct.
8865
8866 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8867
8868 * window.h (window): Remove splits slot.
8869 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8870 (Fdelete_other_windows_internal, make_parent_window)
8871 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8872 (Fset_window_configuration, save_window_save): Don't deal with
8873 split status of windows.
8874 (saved_window): Remove splits slot.
8875 (Vwindow_splits): Rewrite doc-string.
8876
8877 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8878
8879 * xfns.c (unwind_create_frame):
8880 * nsfns.m (unwind_create_frame):
8881 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
8882 Vframe_list (Bug#9999).
8883
8884 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
8885
8886 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
8887
8888 2011-11-11 Kenichi Handa <handa@m17n.org>
8889
8890 * callproc.c (Fcall_process): Set the member dst_multibyte of
8891 process_coding.
8892
8893 2011-11-11 Johan Bockgård <bojohan@gnu.org>
8894
8895 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
8896 avoid a crash (bug#9496).
8897
8898 2011-11-09 Chong Yidong <cyd@gnu.org>
8899
8900 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8901 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
8902
8903 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8904
8905 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
8906
8907 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
8908
8909 Avoid some portability problems by eschewing 'extern inline' functions.
8910 The trivial performance wins aren't worth the portability hassles; see
8911 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
8912 et seq.
8913 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8914 (window_box_width, window_box_left, window_box_left_offset)
8915 (window_box_right, window_box_right_offset): Undo previous change,
8916 by removing the "extern"s.
8917 * intervals.c (adjust_intervals_for_insertion)
8918 (adjust_intervals_for_deletion): Undo previous change,
8919 making these static again.
8920 (offset_intervals, temp_set_point_both, temp_set_point)
8921 (copy_intervals_to_string): No longer inline.
8922 * xdisp.c (window_text_bottom_y, window_box_width)
8923 (window_box_height, window_box_left_offset)
8924 (window_box_right_offset, window_box_left, window_box_right)
8925 (window_box): No longer inline.
8926
8927 2011-11-08 Chong Yidong <cyd@gnu.org>
8928
8929 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
8930 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
8931 Signal an error if not a live window.
8932 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
8933 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
8934
8935 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
8936
8937 * lisp.h (syms_of_abbrev): Remove declaration.
8938 Reported by CHENG Gao <chenggao@royau.me>.
8939
8940 2011-11-07 Eli Zaretskii <eliz@gnu.org>
8941
8942 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
8943 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
8944 of temacs in GUI mode.
8945
8946 2011-11-07 Martin Rudalics <rudalics@gmx.at>
8947
8948 * window.h: Declare delete_all_child_windows instead of
8949 delete_all_subwindows.
8950 * window.c (Fwindow_nest, Fset_window_nest)
8951 (Fset_window_new_total, Fset_window_new_normal)
8952 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8953 (delete_all_subwindows): Rename to delete_all_child_windows.
8954 (Fdelete_other_windows_internal, Fset_window_configuration):
8955 Call delete_all_child_windows instead of delete_all_subwindows.
8956 * frame.c (delete_frame): Call delete_all_child_windows instead
8957 of delete_all_subwindows.
8958
8959 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8960
8961 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8962 This is also needed for porting to any host where GC_MARK_STACK is
8963 not GC_MAKE_GCPROS_NOOPS.
8964 (which_symbols): Use it.
8965
8966 2011-11-07 Kenichi Handa <handa@m17n.org>
8967
8968 * coding.c (coding_set_destination): Check coding->src_pos only
8969 when coding->src_object is a buffer (bug#9910).
8970
8971 * process.c (send_process): Set the member src_multibyte of coding
8972 to 0 (bug#9911) when sending a unibyte text.
8973
8974 * callproc.c (Fcall_process): Set the member src_multibyte of
8975 process_coding to 0 (bug#9912).
8976
8977 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8978
8979 * xmenu.c (cleanup_widget_value_tree): New function.
8980 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8981 calling free_menubar_widget_value_tree directly (Bug#9830).
8982
8983 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8984
8985 Fix some portability problems with 'inline'.
8986 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8987 (window_box_width, window_box_left, window_box_left_offset)
8988 (window_box_right, window_box_right_offset): Declare extern.
8989 Otherwise, these inline functions do not conform to C99 and
8990 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8991 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8992 * intervals.c (adjust_intervals_for_insertion)
8993 (adjust_intervals_for_deletion): Now extern, because otherwise the
8994 extern inline functions 'offset_intervals' couldn't refer to it.
8995 (static_offset_intervals): Remove.
8996 (offset_intervals): Rewrite using the old contents of
8997 static_offset_intervals. The old version didn't conform to C99
8998 because an extern inline function contained a reference to an
8999 identifier with static linkage.
9000
9001 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9002
9003 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9004 GC.
9005
9006 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9007
9008 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9009 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9010 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9011 return Qleft_to_right.
9012
9013 2011-11-06 Chong Yidong <cyd@gnu.org>
9014
9015 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9016 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9017 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9018 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9019 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9020 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9021 (Fwindow_vscroll): Doc fix.
9022 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9023 argument, since it makes no sense to pass a live window and for
9024 consistency with window-child.
9025
9026 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9027
9028 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9029 support MSVC.
9030
9031 2011-11-05 Jason Rumney <jasonr@gnu.org>
9032
9033 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9034 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9035 fonts (Bug#6029).
9036 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9037 bitwise arithmetic preventing use of unicode-sip and non-truetype
9038 opentype fonts.
9039
9040 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9041
9042 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9043 "emacs"-only part.
9044
9045 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9046 initialization code to keep similarity to xfns.c after changes
9047 from 2011-11-05.
9048
9049 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9050
9051 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9052 (unwind_create_frame): New function (Bug#9943).
9053 (Fx_create_frame): Restructure code to be more similar to the one in
9054 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9055 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9056 Move terminal->reference_count++ just before making the frame official
9057 (Bug#9943).
9058
9059 * nsterm.m (x_free_frame_resources): New function.
9060 (x_destroy_window): Move code to x_free_frame_resources.
9061
9062 * xfns.c (unwind_create_frame): Fix comment.
9063 (Fx_create_frame, x_create_tip_frame):
9064 Move terminal->reference_count++ just before making the frame
9065 official. Move initialization of image_cache_refcount and
9066 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9067
9068 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9069
9070 Support MSVC build with newer versions of Visual Studio.
9071 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9072 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9073 nt/gmake.defs.
9074
9075 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9076 which are not supported by MSVC.
9077 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9078 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9079 bitfields.
9080 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9081 types in bitfields.
9082 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9083
9084 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9085
9086 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9087
9088 Support MSVC build with newer versions of Visual Studio.
9089 * w32.c: Don't include w32api.h for MSVC.
9090 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9091
9092 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9093 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9094 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9095 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9096 e_* cousins.
9097 (alloca) [_MSC_VER]: Define to _alloca.
9098
9099 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9100
9101 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9102
9103 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9104
9105 * xdisp.c (note_mouse_highlight): If either of
9106 previous/next-single-property-change returns nil, treat that as
9107 the beginning or the end of the buffer. (Bug#9955)
9108
9109 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9110
9111 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9112 label is not null (Bug#9951).
9113 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9114 may be NULL.
9115
9116 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9117
9118 * window.c (Fwindow_body_size): Mention in the doc string that the
9119 return value is in frame's canonical units. (Bug#9949)
9120
9121 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9122
9123 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9124
9125 * w32fns.c (unwind_create_frame): If needed, free the glyph
9126 matrices of the partially constructed frame. (Bug#9943)
9127 * xfns.c (unwind_create_frame): Likewise.
9128
9129 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9130
9131 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9132 Don't stop backward scan on the continuation glyph, even though
9133 its CHARPOS is positive.
9134 (mouse_face_from_buffer_pos, note_mouse_highlight):
9135 Rename cover_string to disp_string.
9136
9137 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9138
9139 * window.c (temp_output_buffer_show): Don't use
9140 Vtemp_buffer_show_specifiers.
9141 (Vtemp_buffer_show_specifiers): Remove unused variable.
9142
9143 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9144
9145 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9146 past the beginning of the current glyph matrix.
9147
9148 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9149
9150 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9151 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9152 HAVE_GTK3 (Bug#9869).
9153
9154 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9155 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9156
9157 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9158
9159 * xterm.c: Declare x_handle_net_wm_state to return int.
9160 (handle_one_xevent): Check if we are iconified but don't have
9161 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9162 (get_current_wm_state): Return non-zero if not hidden,
9163 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9164 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9165 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9166 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9167
9168 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9169
9170 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9171 so that this new function doesn't get optimized away by a
9172 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9173
9174 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9175
9176 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9177
9178 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9179
9180 Fix the `xbytecode' command.
9181 * .gdbinit (xprintbytestr): New command.
9182 (xwhichsymbols): Rename from `which'; all callers changed.
9183 (xbytecode): Print the byte-code string as well.
9184
9185 2011-10-29 Kim Storm <storm@cua.dk>
9186
9187 * alloc.c (which_symbols): New function.
9188
9189 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9190
9191 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9192 line. (Bug#9903)
9193
9194 2011-10-29 Glenn Morris <rgm@gnu.org>
9195
9196 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9197 Not clear what it was for, and it causes various bugs. (Bug#9839)
9198
9199 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9200
9201 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9202 possible random value that matches one of those tested as
9203 condition to clear the mouse face.
9204
9205 2011-10-28 Chong Yidong <cyd@gnu.org>
9206
9207 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9208
9209 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9210
9211 * window.c (make_window): Initialize phys_cursor_on_p.
9212
9213 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9214
9215 * lisp.h (struct Lisp_Symbol): Update comments.
9216
9217 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9218
9219 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9220
9221 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9222
9223 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9224 <oslsachem@gmail.com> for helping to debug this.
9225
9226 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9227 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9228 (g_b_init_get_glyph_outline_w): New static variables.
9229 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9230 (GetGlyphOutlineW_Proc): New typedefs.
9231 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9232 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9233 New functions.
9234 (w32font_open_internal, compute_metrics):
9235 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9236 instead of calling the "wide" APIs directly.
9237
9238 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9239
9240 * w32.h (syms_of_w32font): Add prototype.
9241
9242 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9243
9244 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9245 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9246 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9247 (Fmove_to_window_line): Doc fix.
9248
9249 2011-10-27 Chong Yidong <cyd@gnu.org>
9250
9251 * process.c (make_process): Set gnutls_state to NULL.
9252
9253 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9254 non-NULL, regardless of GNUTLS_INITSTAGE.
9255 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9256 an error. Set process slots as soon as we allocate them.
9257
9258 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9259
9260 2011-10-27 Chong Yidong <cyd@gnu.org>
9261
9262 * gnutls.c (emacs_gnutls_deinit): New function.
9263 Deallocate credentials structures as well as calling gnutls_deinit.
9264 (Fgnutls_deinit, Fgnutls_boot): Use it.
9265
9266 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9267 (deactivate_process): Call emacs_gnutls_deinit.
9268
9269 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9270
9271 * image.c (x_create_x_image_and_pixmap):
9272 * w32.c (sys_rename, w32_delayed_load):
9273 * w32font.c (fill_in_logfont):
9274 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9275
9276 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9277
9278 * w32fns.c (w32_default_color_map): New function,
9279 extracted from Fw32_default_color_map.
9280 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9281
9282 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9283
9284 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9285
9286 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9287
9288 * keyboard.c (test_undefined): New function (bug#9751).
9289 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9290
9291 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9292
9293 * sysdep.c (init_sys_modes): Fix the check for the controlling
9294 terminal (Bug#6649).
9295
9296 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9297
9298 * dispextern.h (struct bidi_it): New member next_en_type.
9299
9300 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9301 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9302 current character, check also for next_en_type being WEAK_EN.
9303 (bidi_resolve_weak): Don't enter the expensive loop if the current
9304 position is before next_en_pos. Record the bidi type of the first
9305 non-ET, non-BN character we find, in addition to its position.
9306 (bidi_level_of_next_char): Invalidate next_en_type when
9307 next_en_pos is over-stepped.
9308
9309 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9310
9311 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9312 * editfns.c: Rewrite current-time-zone so that it invokes
9313 the equivalent of (format-time-string "%Z") to get the time zone name.
9314 This fixes a bug when the time zone name contains characters that
9315 need converting from the system time locale to Emacs internal format.
9316 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9317 that patch fixed format-time-string to do the conversion, but
9318 I forgot to fix current-time-zone.
9319 (format_time_string): New function, containing most of
9320 what Fformat_time_string used to contain.
9321 (Fformat_time_string): Rewrite in terms of format_time_string.
9322 This doesn't change this function's behavior.
9323 (current-time-zone): Rewrite to use format_time_string.
9324 This fixes the bug reported by Michael Schierl in
9325 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9326 Jason Rumney's 2007-06-07 change worked around this bug, but
9327 didn't fix it.
9328 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9329
9330 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9331
9332 * xdisp.c (start_display): If the character at POS is displayed
9333 via a display vector, reset IT->current.dpvec_index to zero.
9334 (try_window_reusing_current_matrix): If a line ends in a display
9335 vector or the next line starts in a display vector, continue
9336 redrawing the window even though the character position of
9337 start_row was reached.
9338 (Bug#9771, part 2)
9339
9340 2011-10-18 Chong Yidong <cyd@gnu.org>
9341
9342 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9343 with nobreak-char-display too.
9344
9345 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9346
9347 Fix part 3 of bug#9771.
9348 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9349 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9350 non-neutral characters if the current character is a paragraph
9351 separator (a.k.a. Newline). This avoids running the same
9352 expensive loop twice, once when we consume the preceding newline
9353 and the other time when the line actually needs to be displayed.
9354 Avoid the loop when we see neutrals on the base embedding level
9355 following a character whose directionality is the same as the
9356 paragraph's. This avoids running the expensive loop when a line
9357 ends in a long sequence of neutrals, like control characters.
9358 Add assertion against STRONG_AL type. Slightly rearrange code
9359 that determines the type of a neutral given the first non-neutral
9360 that follows it.
9361 (bidi_level_of_next_char): Set next_en_pos to zero when
9362 invalidating its info.
9363
9364 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9365
9366 * xdisp.c (push_display_prop): Determine whether to record string
9367 or buffer position by IT->string, not by IT->method. Allow
9368 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9369 (move_it_vertically_backward): Don't look for character position
9370 immediately after the newline when in a continuation line.
9371 (Bug#9771, part 1)
9372
9373 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9374
9375 * window.c (coordinates_in_window): Rewrite and delabelize
9376 vertical border check. (Bug#5357) (Bug#9618)
9377
9378 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9379
9380 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9381 errors in XSetWindowBorder (bug#9310).
9382
9383 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9384
9385 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9386 avoid crash when xmalloc overrun checking is enabled.
9387
9388 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9389
9390 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9391 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9392 cursor motion with <left> and <right> arrow keys.
9393
9394 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9395 some callers set that themselves.
9396
9397 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9398
9399 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9400 display string and the previous row comes from the same string and
9401 is empty. (Bug#9739) (Bug#9738)
9402
9403 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9404
9405 * doc.c (get_doc_string): Encode file name (bug#9735).
9406
9407 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9408
9409 * bidi.c (bidi_level_of_next_char):
9410 * xdisp.c (get_visually_first_element): Remove old incorrect
9411 comments regarding the Unicode Line Separator character.
9412
9413 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9414
9415 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9416
9417 * alloc.c (Fgc_status): Do not access beyond zombies array
9418 boundary if nzombies > MAX_ZOMBIES.
9419 * alloc.c (dump_zombies): Add missing format specifier.
9420
9421 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9422
9423 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9424 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9425
9426 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9427 Some packages use them to denote characters with modifiers.
9428
9429 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9430
9431 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9432 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9433 matching a pp-number. Rename parameter var to var1.
9434
9435 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9436
9437 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9438
9439 2011-10-08 Glenn Morris <rgm@gnu.org>
9440
9441 * callint.c (Fcall_interactively): Give a more explicit error for the
9442 'c' case with a non-character input. (Bug#8479)
9443
9444 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9445
9446 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9447 lines.
9448 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9449 lines that are hscrolled on the left.
9450
9451 * dispnew.c (buffer_posn_from_coords): Account for a possible
9452 presence of header-line. (Bug#4426)
9453
9454 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9455
9456 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9457 Don't advertise functionality which we discourage or doesn't work.
9458
9459 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9460
9461 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9462 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9463 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9464 this makes Emacs dump core during garbage collection on rare
9465 occasions. sizeof is obviously inferior to offsetof here, so
9466 stick with offsetof.
9467 (GC_POINTER_ALIGNMENT): New macro.
9468 (mark_memory): Omit 3rd (offset) arg; caller changed.
9469 Don't assume EMACS_INT alignment is the same as pointer alignment.
9470
9471 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9472
9473 * keyboard.c (read_key_sequence_remapped): New var.
9474 (read_key_sequence): Compute remapping in the right buffer.
9475 (command_loop_1): Use read_key_sequence's remapping directly.
9476
9477 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9478
9479 * dired.c (file_name_completion): Don't expand file name.
9480 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9481 before checking file name handler.
9482
9483 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9484 they've been requested explicitly (bug#9591).
9485
9486 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9487
9488 * keymap.c (Fsingle_key_description): Use make_specified_string
9489 instead of build_string to build string from push_key_description.
9490 (Bug#5193)
9491
9492 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9493
9494 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9495 This fixes a Y2038 bug on 64-bit hosts.
9496 * buffer.c (reset_buffer):
9497 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9498 (Fclear_buffer_auto_save_failure):
9499 Use 0, not -1, to represent an unset failure time, since time_t
9500 might not be signed.
9501
9502 Remove dependency on glibc malloc internals.
9503 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9504 Move back here from lisp.h, but with their new implementations.
9505 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9506 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9507 * charset.c (charset_table_init): New static var.
9508 (syms_of_charset): Use it instead of xmalloc. This removes a
9509 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9510 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9511 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9512 Move back to alloc.c.
9513 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9514 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9515
9516 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9517
9518 * nsterm.m (windowDidResize): Call x_set_window_size only when
9519 ns_in_resize is true. Otherwise set pixelwidth/height and
9520 call change_frame_size (Bug#9628).
9521
9522 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9523
9524 Port --enable-checking=all to Fedora 14 x86-64.
9525 * charset.c (syms_of_charset): Also account for glibc malloc's
9526 internal overhead when calculating the initial malloc maximum.
9527
9528 Port --enable-checking=all to Fedora 14 x86.
9529 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9530 Move to lisp.h.
9531 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9532 (overrun_check_realloc, overrun_check_free):
9533 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9534 That way, xmalloc returns a properly-aligned pointer even if
9535 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9536 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9537 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9538 into account when calculating the initial malloc maximum.
9539 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9540 Move here from alloc.c, so that charset.c can use it too.
9541 Properly align; the old code wasn't right for common 32-bit hosts
9542 when configured with --enable-checking=all.
9543 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9544 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9545
9546 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9547
9548 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9549 use EDOM.
9550
9551 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9552
9553 * xdisp.c (compute_display_string_end): If there's no display
9554 string at CHARPOS, return -1.
9555
9556 * bidi.c (bidi_fetch_char): When compute_display_string_end
9557 returns a negative value, treat the character as a normal
9558 character not covered by a display string. (Bug#9624)
9559
9560 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9561
9562 * lread.c (Fread_from_string): Fix typo in docstring.
9563
9564 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9565
9566 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9567 newline, reseat the iterator instead of bidi-iterating there one
9568 character at a time. (Bug#9610)
9569 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9570 TO_CHARPOS if the bidi iterator is at base embedding level.
9571
9572 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9573
9574 * lread.c (readevalloop): Use correct code for NBSP.
9575 (read1): Likewise. (Bug#9608)
9576
9577 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9578
9579 * dbusbind.c (Fdbus_register_signal): When service is not
9580 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9581
9582 2011-09-25 Glenn Morris <rgm@gnu.org>
9583
9584 * buffer.c (truncate-lines): Doc fix.
9585
9586 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9587
9588 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9589 (Fset_window_next_buffers): Doc fix.
9590
9591 2011-09-24 Glenn Morris <rgm@gnu.org>
9592
9593 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9594
9595 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9596
9597 Fix minor problems found by static checking.
9598 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9599 * indent.c (Fvertical_motion): Fix == vs = typo.
9600
9601 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9602
9603 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9604 Default value is now t. Doc fix.
9605
9606 * indent.c (Fvertical_motion): Compute and apply the overshoot
9607 logic when moving up, not only when moving down. Fix the
9608 confusing name and values of the it_overshoot_expected variable;
9609 logic changes accordingly. (Bug#9254) (Bug#9549)
9610
9611 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9612 CHARPOS is covered by a display string which includes newlines.
9613 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9614 is covered by a display string with embedded newlines.
9615
9616 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9617
9618 * dbusbind.c (Fdbus_register_signal): Add match rule to
9619 Vdbus_registered_objects_table. (Bug#9581)
9620 (Fdbus_register_method, Vdbus_registered_objects_table):
9621 Fix docstring.
9622
9623 2011-09-24 Jim Meyering <meyering@redhat.com>
9624
9625 do not ignore write error for any output size
9626 The previous change was incomplete.
9627 While it makes emacs --batch detect the vast majority of stdout
9628 write failures, errors were still ignored whenever the output size is
9629 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9630 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9631 && echo FAIL: ignored write error
9632 FAIL: ignored write error
9633 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9634 && echo FAIL: ignored write error
9635 FAIL: ignored write error
9636 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9637
9638 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9639
9640 * emacs.c (Fkill_emacs): In noninteractive mode exit
9641 non-successfully if a write error occurred on stdout. (Bug#9574)
9642
9643 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9644
9645 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9646 the xassert test.
9647
9648 * dispextern.h (struct it): Update the comment documenting what
9649 can it->OBJECT be.
9650
9651 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9652
9653 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9654 a display string, extend search for cursor position to end of row.
9655 (find_row_edges): If the row ends in a newline from a display
9656 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9657 Handle the case of a display string with multiple newlines.
9658 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9659 non-empty line. Fixes confusing cursor motion with arrow keys at
9660 the beginning of a line that starts with whitespace.
9661
9662 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9663
9664 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9665 (bug#9493).
9666
9667 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9668
9669 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9670 boolean (Bug#9154).
9671
9672 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9673
9674 * xdisp.c (display_line): Record maximum and minimum buffer
9675 positions even if no glyphs were produced (e.g., by a zero-width
9676 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9677 buffer positions that will be removed from the glyph row because
9678 they don't fit.
9679 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9680 column is beyond frame width: don't subtract 1 "pixel" when
9681 computing width of the stretch.
9682 (reseat_at_next_visible_line_start): Undo the change made on
9683 2011-09-17 that saved paragraph information and restored it after
9684 the call to `reseat'. (Bug#9545)
9685
9686 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9687
9688 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9689 and turn window cursor on if cleared (Bug#9415).
9690
9691 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9692
9693 * search.c (boyer_moore): Take unibyte characters from pattern
9694 literally. (Bug#9458)
9695
9696 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9697
9698 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9699
9700 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9701
9702 Fix minor problem found by static checking.
9703 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9704 initialized, to pacify gcc -Wuninitialized.
9705
9706 * fileio.c: Report proper errno when syscall falls.
9707 (Finsert_file_contents): Save and restore errno,
9708 so that report_file_error outputs the correct diagnostic.
9709 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9710
9711 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9712
9713 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9714
9715 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9716
9717 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9718 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9719
9720 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9721
9722 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9723 about the current paragraph and restore it after the call to reseat.
9724
9725 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9726 (bidi_find_paragraph_start): Search back for paragraph beginning
9727 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9728 (bidi_move_to_visually_next): Only trigger paragraph-related
9729 computations when the last character is a newline or at EOB, not
9730 just any NEUTRAL_B. (Bug#9470)
9731
9732 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9733 truncated lines if point is covered by a display string. (Bug#9524)
9734
9735 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9736
9737 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9738 (cons_to_x_long): New function.
9739 (lisp_data_to_selection_data): Use it. Correct the test for
9740 short-versus-long data; it was negated. Break out of vector
9741 loop, for efficiency, when a long datum is discovered.
9742
9743 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9744
9745 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9746
9747 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9748
9749 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9750 GCC PR/17406) by declaring this function with external scope.
9751
9752 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9753
9754 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9755 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9756
9757 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9758
9759 * editfns.c (Fformat): Correctly handle text properties on "%%".
9760
9761 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9762
9763 * xterm.c (x_draw_composite_glyph_string_foreground):
9764 * w32term.c (x_draw_composite_glyph_string_foreground):
9765 * term.c (encode_terminal_code):
9766 * composite.c (composition_update_it, get_composition_id):
9767 * xdisp.c (get_next_display_element)
9768 (fill_composite_glyph_string): Add comments about special meaning
9769 of TAB characters in a composition.
9770
9771 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9772
9773 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9774 This occurs when processing a multibyte format.
9775 Problem reported by Wolfgang Jenker.
9776
9777 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9778
9779 * xdisp.c (try_cursor_movement): Only check for exact match if
9780 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9781
9782 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9783
9784 Remove unused external symbols.
9785 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9786 * xdisp.c (calc_pixel_width_or_height): Now static.
9787 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9788 * indent.c (check_display_width):
9789 * w32term.c: Fix comment to match code.
9790 * xterm.c, xterm.h (x_catching_errors): Remove.
9791
9792 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9793
9794 * xselect.c: Use signed conversions more consistently (Bug#9498).
9795 (selection_data_to_lisp_data): Assume incoming selection data are
9796 signed integers, not unsigned. This is to be consistent with
9797 outgoing selection data, which was modified to use signed integers
9798 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9799 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9800 expects long, not unsigned long.
9801
9802 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9803
9804 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9805 computation of loop end. Reported by Johan Bockgård
9806 <bojohan@gnu.org>.
9807
9808 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9809
9810 * frame.c (Fother_visible_frames_p): Function deleted.
9811
9812 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9813
9814 * indent.c (compute_motion): Process display vector front to back
9815 rather than the other way around. (Bug#2496)
9816
9817 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9818
9819 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9820
9821 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9822
9823 * minibuf.c (Fread_from_minibuffer): Doc fix.
9824
9825 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9826
9827 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9828 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9829
9830 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9831
9832 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9833 value for non-existent files.
9834
9835 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9836
9837 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9838 set its "size" to -1. This will set the modtime_size field of
9839 the corresponding buffer to -1, which is what
9840 verify-visited-file-modtime expects for files that do not exist.
9841 (Bug#9139)
9842
9843 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9844
9845 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9846 here ...
9847 * lisp.h: ... from here. push_key_description is no longer
9848 defined in keyboard.c, so its declaration should not be in
9849 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9850 logically belongs with push_key_description.
9851
9852 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9853
9854 * buffer.h: Include <sys/types.h> instead of <time.h>.
9855 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9856 Problem reported by Herbert J. Skuhra.
9857
9858 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9859
9860 * xml.c (parse_region): Make the parsing work for
9861 non-comment-starting XML files again (bug#9144).
9862
9863 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9864
9865 * image.c (gif_load): Fix calculation of bottom and right corner.
9866 (Bug#9468)
9867
9868 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9869
9870 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9871 redisplay in small windows.
9872
9873 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9874
9875 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9876
9877 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9878
9879 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
9880 Operate on live windows only.
9881
9882 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
9883
9884 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
9885
9886 2011-09-07 Eli Zaretskii <eliz@gnu.org>
9887
9888 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
9889 only under bidi iteration.
9890
9891 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
9892
9893 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
9894
9895 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9896
9897 isnan: Fix porting problem to Solaris 10 with bundled gcc.
9898 Without this fix, the command to link temacs failed due to an
9899 undefined symbol __builtin_isnan. This is because
9900 /usr/include/iso/math_c99.h #defines isnan(x) to
9901 __builtin_isnan(x), but the bundled gcc, which identifies itself
9902 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
9903 a __builtin_isnan.
9904 * floatfns.c (isnan): #undef, and then #define to a clone of
9905 what's in data.c.
9906 (Fisnan): Always define, since it's always available now.
9907 (syms_of_floatfns): Always define isnan at the Lisp level.
9908
9909 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9910
9911 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
9912
9913 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
9914
9915 * fileio.c: Fix bugs with large file offsets (Bug#9428).
9916 The previous code assumed that file offsets (off_t values) fit in
9917 EMACS_INT variables, which is not true on typical 32-bit hosts.
9918 The code messed up by falsely reporting buffer overflow in cases
9919 such as (insert-file-contents "big" nil 1 2) into an empty buffer
9920 when "big" contains more than 2**29 bytes, even though this
9921 inserts just one byte and does not overflow the buffer.
9922 (Finsert_file_contents): Store file offsets as off_t
9923 values, not as EMACS_INT values. Check for overflow when
9924 converting between EMACS_INT and off_t. When checking for
9925 buffer overflow or for overlap, take the offsets into account.
9926 Don't use EMACS_INT for small values where int suffices.
9927 When checking for overlap, fix a typo: ZV was used where
9928 ZV_BYTE was intended.
9929 (Fwrite_region): Don't assume off_t fits into 'long'.
9930 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
9931
9932 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
9933
9934 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
9935
9936 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9937
9938 sprintf-related integer and memory overflow issues (Bug#9412).
9939
9940 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
9941 (esprintf, exprintf, evxprintf): New functions.
9942 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
9943 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
9944 (modify_event_symbol): Do not assume that the length of
9945 name_alist_or_stem is safe to alloca and fits in int.
9946 (Fexecute_extended_command): Likewise for function name and binding.
9947 (Frecursion_depth): Wrap around reliably on integer overflow.
9948 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
9949 since some callers pass EMACS_INT values.
9950 (Fsingle_key_description): Don't crash if symbol name contains more
9951 than MAX_ALLOCA bytes.
9952 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9953 (get_minibuffer): Arg is now EMACS_INT, not int.
9954 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
9955 (esprintf, exprintf, evxprintf): New decls.
9956 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9957
9958 * dbusbind.c (signature_cat): New function.
9959 (xd_signature, Fdbus_register_signal):
9960 Do not overrun buffer; instead, report string overflow.
9961
9962 * dispnew.c (add_window_display_history): Don't overrun buffer.
9963 Truncate instead; this is OK since it's just a log.
9964
9965 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9966 even if the time zone offset is outlandishly large.
9967 Don't mishandle offset == INT_MIN.
9968
9969 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9970 when creating daemon; the previous buffer-overflow check was incorrect.
9971
9972 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9973 which has the guts of the old verror function.
9974
9975 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9976 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9977
9978 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9979 (font_unparse_xlfd): Don't blindly alloca long strings.
9980 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
9981 fits in int, when using sprintf. Use single snprintf to count
9982 length of string rather than counting it via multiple sprintfs;
9983 that's simpler and more reliable.
9984 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9985 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9986 sprintf, in case result does not fit in int.
9987
9988 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9989 (fontset_from_font): Print it.
9990
9991 * frame.c (tty_frame_count): Now printmax_t, not int.
9992 (make_terminal_frame, set_term_frame_name): Print it.
9993 (x_report_frame_params): In X, window IDs are unsigned long,
9994 not signed long, so print them as unsigned.
9995 (validate_x_resource_name): Check for implausibly long names,
9996 and don't assume name length fits in 'int'.
9997 (x_get_resource_string): Don't blindly alloca invocation name;
9998 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9999 not fit in int.
10000
10001 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10002 (xg_check_special_colors, xg_set_geometry):
10003 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10004
10005 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10006 Use esprintf, not sprintf, in case result does not fit in int.
10007
10008 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10009 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10010 it as a large positive number.
10011 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10012 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10013
10014 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10015 in case result does not fit in int.
10016
10017 * print.c (float_to_string): Detect width overflow more reliably.
10018 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10019 buffer overrun. Don't assume list length fits in 'int'. Treat
10020 print length of 0 as 0, not as infinity; to be consistent with other
10021 uses of print length in this function. Don't overflow print length
10022 index. Don't assume hash table size fits in 'long', or that
10023 vectorlike size fits in 'unsigned long'.
10024
10025 * process.c (make_process): Use printmax_t, not int, to format
10026 process-name gensyms.
10027
10028 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10029
10030 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10031 to avoid potential buffer overrun.
10032
10033 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10034 if X resource line is longer than 512 bytes.
10035
10036 * xfns.c (x_window): Make sprintf buffer a bit bigger
10037 to avoid potential buffer overrun.
10038
10039 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10040
10041 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10042
10043 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10044
10045 Integer overflow fixes for scrolling, etc.
10046 Without these, Emacs silently mishandles large integers sometimes.
10047 For example, "C-u 4294967297 M-x recenter" was treated as if
10048 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10049
10050 * xdisp.c (try_window_id): Check Emacs fixnum range before
10051 converting to 'int'.
10052
10053 * window.c (window_scroll_line_based, Frecenter):
10054 Check that an Emacs fixnum is in range before assigning it to 'int'.
10055 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10056 values converted from Emacs fixnums.
10057 (Frecenter): Don't wrap around a line count if it is out of 'int'
10058 range; instead, treat it as an extreme value.
10059 (Fset_window_configuration, compare_window_configurations):
10060 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10061
10062 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10063 that can exceed INT_MAX. Check that EMACS_INT value is in range
10064 before assigning it to the (possibly-narrower) index.
10065 (match_limit): Don't assume that a fixnum can fit in 'int'.
10066
10067 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10068 exceed INT_MAX.
10069
10070 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10071 (Fvertical_motion): Don't wrap around LINES values that don't fit
10072 in 'int'. Instead, treat them as extreme values. This is good
10073 enough for windows, which can't have more than INT_MAX lines anyway.
10074
10075 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10076
10077 * Require libxml/parser.h to avoid compilation warning.
10078
10079 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10080
10081 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10082 since this reportedly can destroy thread storage.
10083
10084 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10085
10086 * syntax.c (find_defun_start): Update all cache variables if
10087 exiting early (Bug#9401).
10088
10089 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10090
10091 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10092
10093 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10094 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10095 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10096
10097 * term.c (tty_append_glyph): New function.
10098 (produce_stretch_glyph): Static function and its prototype deleted.
10099
10100 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10101 Add prototypes.
10102
10103 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10104
10105 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10106 when checking :margin (Bug#9390).
10107 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10108 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10109 so that the name doesn't mislead. All uses changed.
10110
10111 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10112
10113 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10114 set_tty_hooks.
10115
10116 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10117
10118 * xdisp.c (move_it_to): Don't bail out early when reaching
10119 position beyond to_charpos, if we are scanning backwards.
10120 (move_it_vertically_backward): When DY == 0, make sure we get to
10121 the first character in the line after the newline.
10122
10123 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10124
10125 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10126 (ccl_driver): Do not generate an out-of-range pointer.
10127 (Fccl_execute_on_string): Remove unnecessary check for
10128 integer overflow, noted by Stefan Monnier in
10129 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10130 Remove a FIXME that didn't need fixing.
10131 Simplify the newly-introduced buffer reallocation code.
10132
10133 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10134
10135 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10136
10137 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10138
10139 Integer and memory overflow issues (Bug#9196).
10140
10141 * doc.c (get_doc_string): Rework so that
10142 get_doc_string_buffer_size is the actual buffer size, rather than
10143 being 1 less than the actual buffer size; this makes xpalloc more
10144 convenient.
10145
10146 * image.c (x_allocate_bitmap_record, cache_image):
10147 * xselect.c (Fx_register_dnd_atom):
10148 Simplify previous changes by using xpalloc.
10149
10150 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10151 since either will do and ptrdiff_t is convenient with xpalloc.
10152
10153 * charset.c (charset_table_size)
10154 (struct charset_sort_data.priority): Now ptrdiff_t.
10155 (charset_compare): Don't overflow if priorities differ greatly.
10156 (Fsort_charsets): Don't assume list length fits in int.
10157 Check for size-calculation overflow when allocating sort data.
10158 (syms_of_charset): Allocate an initial charset table that is
10159 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10160
10161 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10162
10163 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10164 The actual value is always <= INT_MAX, and leaving it unsigned made
10165 overflow checking harder.
10166
10167 * dispextern.h (struct glyph_matrix.rows_allocated)
10168 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10169 with xpalloc. The values are still always <= INT_MAX.
10170
10171 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10172
10173 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10174 (SAFE_NALLOCA): New macro.
10175
10176 * region-cache.c (struct boundary.pos, find_cache_boundary)
10177 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10178 (set_cache_region, invalidate_region_cache)
10179 (revalidate_region_cache, know_region_cache, region_cache_forward)
10180 (region_cache_backward, pp_cache):
10181 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10182 so that ptrdiff_t * can be passed to xpalloc.
10183 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10184 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10185 (pp_cache): Don't assume cache_len fits in int.
10186 * region-cache.h: Adjust extern decls to match.
10187
10188 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10189 EMACS_INT, since either will do, for xpalloc.
10190
10191 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10192 (xnmalloc, xnrealloc, xpalloc): New functions.
10193
10194 * bidi.c (bidi_shelve_header_size): New constant.
10195 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10196 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10197
10198 * bidi.c (bidi_cache_shrink):
10199 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10200 (overlay_strings):
10201 Don't update size of array until after memory allocation succeeds,
10202 because xmalloc/xrealloc may not return.
10203 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10204 now that we have proper integer overflow checking.
10205 (record_overlay_string, overlay_strings): Catch overflows when
10206 calculating size of overlay_str_buf.
10207
10208 * callproc.c (Fcall_process): Check for size overflow when
10209 calculating size of args2.
10210 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10211 Normally we prefer signed values, but sticking with ptrdiff_t would
10212 require adding more-complicated checks.
10213
10214 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10215 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10216 Redo buffer-overflow calculations to avoid integer overflow.
10217 Add a FIXME comment where memory seems to be over-allocated.
10218
10219 * character.c (Fstring): Check for size-calculation overflow.
10220
10221 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10222 unnecessary integer overflow. Check for size overflow.
10223 (encode_coding_object): Don't update size until xmalloc succeeds.
10224
10225 * composite.c (get_composition_id): Check for overflow in glyph
10226 length calculations.
10227
10228 Integer and memory overflow fixes for display code.
10229 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10230 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10231 (scrolling_window): Check for overflow in size calculations.
10232 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10233 Don't assume glyph table len fits in int.
10234 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10235 (row_table_size): Now ptrdiff_t, not int.
10236 (scrolling_window): Avoid overflow in size calculations.
10237 Don't update size until allocation succeeds.
10238 * fns.c (concat): Check for overflow in size calculations.
10239 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10240 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10241 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10242
10243 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10244 (get_doc_string): Check for size calculation overflow.
10245 Don't update size until allocation succeeds.
10246 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10247 EMACS_INT, where ptrdiff_t will do.
10248 (Fsubstitute_command_keys): Check for string overflow.
10249
10250 * editfns.c (set_time_zone_rule): Don't assume environment length
10251 fits in int.
10252 (message_length): Now ptrdiff_t, not int.
10253 (Fmessage_box): Don't update size until allocation succeeds.
10254 Don't assume message length fits in int.
10255 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10256
10257 * emacs.c (main): Do not reallocate argv, since there is a null at
10258 the end that can be overwritten, and this way there's no need to
10259 worry about size-calculation overflow.
10260 (sort_args): Check for size-calculation overflow.
10261
10262 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10263 alloc succeeds.
10264 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10265
10266 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10267 (x_set_scroll_bar_width, x_figure_window_size):
10268 Check for integer overflow.
10269 (x_set_alpha): Do not assume XINT fits in int.
10270
10271 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10272 This is for the members text_lines, text_cols, total_lines, total_cols,
10273 where the system imposes an 'int' limit.
10274
10275 * fringe.c (Fdefine_fringe_bitmap):
10276 Don't update size until alloc works.
10277
10278 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10279 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10280
10281 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10282 Check for size-calculation overflow.
10283 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10284 do, as we prefer signed integers.
10285 (id_to_widget.max_size, id_to_widget.used)
10286 (xg_store_widget_in_map, xg_remove_widget_from_map)
10287 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10288 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10289 Use and return ptrdiff_t, not int.
10290 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10291 * gtkutil.h: Change prototypes to match the above.
10292
10293 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10294 are duplicate now that they've been promoted to lisp.h.
10295 (x_allocate_bitmap_record, x_alloc_image_color)
10296 (make_image_cache, cache_image, xpm_load):
10297 Don't update size until alloc is done.
10298 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10299 (x_detect_edges):
10300 Check for size calculation overflow.
10301 (ct_colors_allocated_max): New constant.
10302 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10303 overflow.
10304
10305 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10306 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10307 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10308 Use ptrdiff_t, not int, to count maps.
10309 (read_char_minibuf_menu_prompt): Check for overflow in size
10310 calculations. Don't update size until allocation succeeds.
10311 Redo calculations to avoid overflow.
10312 * keyboard.h: Change prototypes to match the above.
10313
10314 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10315 to count maps.
10316 (current_minor_maps): Check for size calculation overflow.
10317 * keymap.h: Change prototypes to match the above.
10318
10319 * lread.c (read1, init_obarray): Don't update size until alloc done.
10320
10321 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10322 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10323
10324 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10325 Now ptrdiff_t, not int.
10326 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10327 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10328
10329 * process.c (Fnetwork_interface_list): Check for overflow
10330 in size calculation.
10331
10332 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10333
10334 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10335 overflow. Don't bother calling xmalloc when xrealloc will do.
10336
10337 * search.c (Freplace_match): Check for size calculation overflow.
10338 (Fset_match_data): Don't assume list lengths fit in 'int'.
10339
10340 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10341 for command line length. Do not attempt to address one before the
10342 beginning of an array, as that's not portable.
10343
10344 * term.c (max_frame_lines): Remove; unused.
10345 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10346 not int.
10347 (encode_terminal_code, calculate_costs): Check for size
10348 calculation overflow.
10349 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10350 table lengths and related sizes. Don't update size until alloc
10351 done. Redo calculations to avoid overflow.
10352 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10353
10354 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10355 subtracting pointers.
10356 (gobble_line): Check for overflow more carefully. Don't update size
10357 until alloc done.
10358
10359 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10360 Don't update size until alloc done.
10361 Redo size calculations to avoid overflow.
10362 Check for size calculation overflow.
10363 (main) [DEBUG]: Fix typo in invoking tparam1.
10364
10365 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10366 Use ptrdiff_t, not int, for sizes.
10367 (store_mode_line_noprop_char): Don't update size until alloc done.
10368
10369 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10370 Use ptrdiff_t, not int, for sizes.
10371 (Finternal_make_lisp_face, cache_face):
10372 Check for size calculation overflow.
10373 (cache_face): Treat size calculation overflows as if they were
10374 memory exhaustion (the usual treatment), rather than aborting.
10375
10376 * xfns.c (x_encode_text, x_set_name_internal)
10377 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10378 sizes, since they can exceed INT_MAX in size. Check for size
10379 calculation overflow.
10380
10381 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10382 (xg_select): Check for size calculation overflow.
10383 Don't update size until alloc done.
10384
10385 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10386 as sprintf is limited to int lengths.
10387
10388 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10389 (X_LONG_MIN): New macros.
10390 Use them to make the following changes clearer.
10391 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10392 This change doesn't affect the value now, but it may help remind
10393 future maintainers not to raise the value too much later.
10394 (SELECTION_QUANTUM): Remove, replacing with ...
10395 (selection_quantum): ... new function, which avoids overflow.
10396 All uses changed.
10397 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10398 assumption that selection length fits in 'int'.
10399 (x_reply_selection_request, x_handle_selection_request)
10400 (x_get_window_property, receive_incremental_selection)
10401 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10402 (lisp_data_to_selection_data, clean_local_selection_data):
10403 Use ptrdiff_t, not int, to record length of selection.
10404 (x_reply_selection_request, x_get_window_property)
10405 (receive_incremental_selection, x_property_data_to_lisp):
10406 Redo calculations to avoid overflow.
10407 (x_reply_selection_request): When sending hint, ceiling it at
10408 X_LONG_MAX rather than relying on wraparound overflow to send
10409 something.
10410 (x_get_window_property, receive_incremental_selection)
10411 (lisp_data_to_selection_data, x_property_data_to_lisp):
10412 Check for size-calculation overflow.
10413 (x_get_window_property, receive_incremental_selection)
10414 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10415 Don't store size until memory allocation succeeds.
10416 (x_get_window_property): Plug memory leak on memory exhaustion.
10417 Don't double-block input; malloc is safe here. Don't assume 2**34
10418 - 4 fits in unsigned long. Add an xassert to check
10419 XGetWindowProperty overflow. Be more careful about overflow
10420 calculations, and distinguish size from memory overflow better.
10421 (receive_incremental_selection): When tracing, don't assume
10422 unsigned int is less than INT_MAX.
10423 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10424 harmful) conversions of unsigned short to int.
10425 (lisp_data_to_selection_data): Don't assume that integers
10426 in the range -65535 through -1 fit in an X unsigned short.
10427 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10428 result parameters unless successful. Rely on cons_to_unsigned
10429 to report problems with elements; the old code wasn't right anyway.
10430 (x_check_property_data): Check for int overflow; we cannot use
10431 a wider type due to X limits.
10432 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10433
10434 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10435
10436 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10437 (x_term_init): Check for size calculation overflow.
10438 (x_color_cells): Don't store size until memory allocation succeeds.
10439 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10440 Don't assume alloca size is less than MAX_ALLOCA.
10441 (x_term_init): Don't assume length fits in int (sprintf is limited
10442 to int size).
10443
10444 Use ptrdiff_t for composition IDs.
10445 * character.c (lisp_string_width):
10446 * composite.c (composition_table_size, n_compositions)
10447 (get_composition_id, composition_gstring_from_id):
10448 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10449 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10450 * window.c (Frecenter):
10451 Use ptrdiff_t, not int, for composition IDs.
10452 * composite.c (get_composition_id): Check for integer overflow.
10453 * composite.h: Adjust prototypes to match the above changes.
10454
10455 Use ptrdiff_t for hash table indexes.
10456 * category.c (hash_get_category_set):
10457 * ccl.c (ccl_driver):
10458 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10459 * coding.c (coding_system_charset_list, detect_coding_system):
10460 * coding.h (struct coding_system.id):
10461 * composite.c (get_composition_id, gstring_lookup_cache):
10462 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10463 * image.c (xpm_get_color_table_h):
10464 * lisp.h (hash_lookup, hash_put):
10465 * minibuf.c (Ftest_completion):
10466 Use ptrdiff_t for hash table indexes, not int (which is too
10467 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10468 32-bit --with-wide-int hosts).
10469
10470 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10471 Add a FIXME comment about memory leaks.
10472 (syms_of_charset): Don't assume xmalloc returns.
10473
10474 Don't assume that stated character widths fit in int.
10475 * character.c (Fchar_width, c_string_width, lisp_string_width):
10476 * character.h (CHAR_WIDTH):
10477 * indent.c (MULTIBYTE_BYTES_WIDTH):
10478 Use sanitize_char_width to avoid undefined and/or bad behavior
10479 with outlandish widths.
10480 * character.h (sanitize_tab_width): Rename from sanitize_width,
10481 now that we have two such functions. All uses changed.
10482 (sanitize_char_width): New inline function.
10483
10484 Don't assume that tab-width fits in int.
10485 * character.h (sanitize_width): New inline function.
10486 (SANE_TAB_WIDTH): New macro.
10487 (ASCII_CHAR_WIDTH): Use it.
10488 * indent.c (sane_tab_width): Remove. All uses replaced by
10489 SANE_TAB_WIDTH (current_buffer).
10490 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10491
10492 * fileio.c: Integer overflow issues with file modes.
10493 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10494
10495 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10496 Remove unreachable code.
10497 (read_hex, load_charset_map_from_file): Check for integer overflow.
10498
10499 * xterm.c: Don't go over XClientMessageEvent limit.
10500 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10501 (x_send_scroll_bar_event): Likewise. Check that the size does not
10502 exceed limits imposed by XClientMessageEvent, as well as the usual
10503 ptrdiff_t and size_t limits.
10504
10505 * keyboard.c: Overflow, signedness and related fixes.
10506 (make_lispy_movement): Use same integer type in forward decl
10507 that is used in the definition.
10508 (read_key_sequence, keyremap_step):
10509 Change bufsize argument back to int, undoing my 2011-03-30 change.
10510 We prefer signed types, and int is wide enough here.
10511 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10512 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10513 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10514 length, not size_t. Use ptrdiff_t for index, not int.
10515 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10516 possibility of integer overflow.
10517
10518 Overflow, signedness and related fixes for images.
10519
10520 * dispextern.h (struct it.stack[0].u.image.image_id)
10521 (struct_it.image_id, struct image.id, struct image_cache.size)
10522 (struct image_cache.used, struct image_cache.ref_count):
10523 * gtkutil.c (update_frame_tool_bar):
10524 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10525 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10526 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10527 * nsmenu.m (update_frame_tool_bar):
10528 * xdisp.c (calc_pixel_width_or_height):
10529 * xfns.c (image_cache_refcount):
10530 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10531 on typical 64-bit hosts.
10532
10533 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10534 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10535 Omit unnecessary casts to int.
10536 (parse_image_spec): Check that integers fall into 'int' range
10537 when the callers expect that.
10538 (image_ascent): Redo ascent calculation to avoid int overflow.
10539 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10540 (lookup_image): Remove unnecessary tests.
10541 (xbm_image_p): Locals are now of int, not EMACS_INT,
10542 since parse_image_check makes sure they fit into int.
10543 (png_load, gif_load, svg_load_image):
10544 Prefer int to unsigned where either will do.
10545 (tiff_handler): New function, combining the cores of the
10546 old tiff_error_handler and tiff_warning_handler.
10547 This function is rewritten to use vsnprintf and thereby avoid
10548 stack buffer overflows. It uses only the features of vsnprintf
10549 that are common to both POSIX and native Microsoft.
10550 (tiff_error_handler, tiff_warning_handler): Use it.
10551 (tiff_load, gif_load, imagemagick_load_image):
10552 Don't assume :index value fits in 'int'.
10553 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10554 (imagemagick_load_image): Check that crop parameters fit into
10555 the integer types that MagickCropImage accepts. Don't assume
10556 Vimagemagick_render_type has a nonnegative value. Don't assume
10557 size_t fits in 'long'.
10558 (gs_load): Use printmax_t to print the widest integers possible.
10559 Check for integer overflow when computing image height and width.
10560
10561 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10562
10563 * xdisp.c (redisplay_window): Don't force window start if point
10564 will be invisible in the resulting window. (Bug#9324)
10565
10566 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10567
10568 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10569 the display spec is of the form `(space ...)'.
10570 (handle_display_spec): Return the value returned by
10571 handle_single_display_spec, not just 1 or zero.
10572 (handle_single_display_spec): If the display spec is of the form
10573 `(space ...)', and specifies display in the text area, return 2
10574 rather than 1.
10575 (try_cursor_movement): Check for the need to scroll more
10576 accurately, and prefer exact match for point under bidi.
10577 Don't advance `row' beyond the last row of the window.
10578
10579 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10580 into disp_prop; all users changed.
10581
10582 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10583 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10584 for the text covered by the display property.
10585
10586 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10587
10588 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10589 Change return value to nil.
10590 (Frecord_buffer): Delete unused function.
10591
10592 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10593
10594 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10595 buffers, return left-to-right.
10596 (set_cursor_from_row): Consider candidate row a win if its glyph
10597 represents a newline and point is on that newline. Fixes cursor
10598 positioning on the newline at EOL of R2L text within L2R
10599 paragraph, and vice versa.
10600 (try_cursor_movement): Check continued rows, in addition to
10601 continuation rows. Fixes unwarranted scroll when point enters a
10602 continued line of R2L text within an L2R paragraph, or vice versa.
10603 (cursor_row_p): Consider the case of point being equal to
10604 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10605 from the end of a short line to the beginning of a continued line
10606 of R2L text within L2R paragraph.
10607 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10608 composed characters.
10609
10610 * bidi.c (bidi_check_type): Use xassert.
10611 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10612 members.
10613
10614 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10615
10616 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10617 a character.
10618
10619 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10620
10621 * nsfont.m (ns_otf_to_script): Fix typo.
10622
10623 2011-08-22 Kenichi Handa <handa@m17n.org>
10624
10625 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10626 extra slot even if the purpose is char-code-property-table.
10627
10628 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10629
10630 * xdisp.c (redisplay_window): When computing centering_position,
10631 account for the height of the header line. (Bug#8874)
10632
10633 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10634 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10635 candidate is selected by the mouse, and that candidate has a
10636 composed character under the mouse.
10637
10638 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10639 coordinates reported by pos-visible-in-window-p for a composed
10640 character in column zero.
10641
10642 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10643
10644 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10645
10646 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10647
10648 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10649 consider it a hit if to_charpos is anywhere in the range of the
10650 composed buffer positions.
10651
10652 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10653
10654 * image.c (gif_load): Don't assume that each subimage has the same
10655 dimensions as the base image. Handle disposal method that is
10656 "undefined" by the gif spec (Bug#9335).
10657
10658 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10659
10660 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10661 (Fcondition_case): Document `debug' symbol in error handler.
10662
10663 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10664
10665 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10666 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10667 from an Org mode buffer to a Speedbar frame.
10668
10669 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10670 a composition, take its buffer position from IT->cmp_it.charpos.
10671 Fixes cursor positioning at the beginning of a line that begins
10672 with a composed character.
10673
10674 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10675
10676 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10677 character bidirectional type, use STRONG_L instead. Fixes crashes
10678 in a buffer produced by `describe-categories'.
10679
10680 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10681 members before the level stack, so they would be saved and
10682 restored when copying iterator state. Fixes incorrect reordering
10683 around TABs covered by display properties.
10684
10685 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10686
10687 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10688
10689 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10690
10691 * eval.c (internal_condition_case, internal_condition_case_1)
10692 (internal_condition_case_2, internal_condition_case_n):
10693 Remove unnecessary aborts (Bug#9081).
10694
10695 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10696
10697 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10698 has no `load' handler, try opening the file locally. (Bug#9311)
10699
10700 2011-08-16 Ken Brown <kbrown@cornell.edu>
10701
10702 * gmalloc.c: Expand comment.
10703
10704 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10705
10706 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10707 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10708
10709 2011-08-16 Ken Brown <kbrown@cornell.edu>
10710
10711 Fix memory allocation problems in Cygwin build (Bug#9273).
10712
10713 * unexcw.c ( __malloc_initialized): Declare external variable.
10714 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10715
10716 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10717 New variables.
10718 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10719 dumped emacs.
10720 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10721 in the static heap.
10722 [CYGWIN] (special_realloc): New function.
10723 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10724 requests to realloc storage in the static heap.
10725
10726 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10727
10728 * bidi.c (bidi_initialize): Remove unused local.
10729
10730 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10731
10732 * bidimirror.h:
10733 * biditype.h: Remove file.
10734 * makefile.w32-in ($(BLD)/bidi.$(O)):
10735 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10736
10737 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10738
10739 * chartab.c: Improve commentary for the uniprop_table API.
10740
10741 * bidi.c (bidi_paragraph_init): Support zero value of
10742 bidi_ignore_explicit_marks_for_paragraph_level.
10743 (bidi_initialize): Use uniprop_table instead of including
10744 biditype.h and bidimirror.h.
10745
10746 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10747 coordinates of the iterator when restoring from ppos_it.
10748 (Bug#9296)
10749
10750 2011-08-14 Kenichi Handa <handa@m17n.org>
10751
10752 * process.c (create_process): Call setup_process_coding_systems
10753 after the pid of the process is set to -1 (Bug#8162).
10754
10755 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10756
10757 * xdisp.c (move_it_in_display_line_to): Don't invoke
10758 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10759 ppos_it. Fixes vertical cursor motion when line beginning is
10760 covered by an image. (Bug#9296)
10761
10762 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10763
10764 * nsterm.h (ns_run_ascript): Declare.
10765 (NSAPP_DATA2_RUNASSCRIPT): Define.
10766
10767 * nsfns.m (as_script, as_result, as_status): New static variables.
10768 (ns_run_ascript): New function.
10769 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10770 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10771 the event loop. Get status from as_status (Bug#7276).
10772
10773 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10774 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10775 the event loop (Bug#7276).
10776
10777 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10778
10779 * gnutls.c (QCgnutls_bootprop_priority)
10780 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10781 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10782 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10783 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10784 (QCgnutls_bootprop_verify_hostname_error)
10785 (QCgnutls_bootprop_callbacks_verify): Rename from
10786 Qgnutls_bootprop_..., all uses changed.
10787
10788 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10789 uses changed.
10790
10791 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10792
10793 * xfaces.c (Qframe_set_background_mode): Now static.
10794 * dispextern.h (Qframe_set_background_mode): Remove decl.
10795
10796 * process.c (Fnetwork_interface_info): Declare local only if needed.
10797
10798 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10799
10800 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10801 (Fnetwork_interface_list): Allocate in increments of bytes instead
10802 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10803 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10804 sockaddr.
10805 (struct ifflag_def): notrailers is smart on OSX.
10806 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10807 Get hardware address with getifaddrs if available.
10808
10809 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10810
10811 * xdisp.c (iterate_out_of_display_property): xassert that
10812 IT->position is set to within IT->object's boundaries. Break from
10813 the loop as soon as EOB is reached; avoids infloops in redisplay
10814 when IT->position is set up wrongly due to some bug.
10815 Set IT->current to match the bidi iterator unconditionally.
10816 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10817 entry. Force push_it to save on the stack the current
10818 buffer/string position, to be restored by pop_it. Fix flags in
10819 the iterator structure wrt the object coming from a display
10820 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10821 properties. (Bug#9284)
10822
10823 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10824
10825 * fontset.c (fontset_get_font_group): Add proper type checks.
10826 (Bug#9172)
10827
10828 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10829
10830 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10831 and LC_VERSION_MIN_MACOSX.
10832 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10833 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10834
10835 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10836
10837 * xdisp.c (forward_to_next_line_start): Allow to use the
10838 no-display-properties-and-no-overlays under bidi display.
10839 Set disp_pos in the bidi iterator to avoid searches for display
10840 properties and overlays.
10841
10842 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10843
10844 * editfns.c (Fset_time_zone_rule): Document relationship with the
10845 setenv function.
10846
10847 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10848 the font entity extracted from the cache (Bug#8109).
10849
10850 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10851
10852 * composite.c (autocmp_chars): Don't reset point. That is done by
10853 restore_point_unwind (Bug#5984).
10854
10855 2011-08-07 Juri Linkov <juri@jurta.org>
10856
10857 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10858 to show the arg `TIME' instead of `TIMEVAL'.
10859
10860 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10861
10862 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10863 display property strides EOL and includes a newline, as in
10864 longlines-mode. (Bug#9254)
10865 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10866 word-wrap under bidirectional display. (Bug#9224)
10867
10868 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10869 is non-zero, even if the data buffer is NULL. Fixes a crash in
10870 vertical-motion with longlines-mode. (Bug#9254)
10871
10872 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10873
10874 * bidi.c <bidi_cache_total_alloc>: Now static.
10875 (bidi_initialize): Initialize bidi_cache_total_alloc.
10876
10877 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10878 cache. (Bug#9221)
10879
10880 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
10881 amount allocated this far in `bidi_cache_total_alloc'.
10882 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
10883 non-zero, only free the data buffer without restoring the cache
10884 contents. All callers changed.
10885
10886 * dispextern.h (bidi_unshelve_cache): Update prototype.
10887
10888 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
10889 (move_it_in_display_line, move_it_to)
10890 (move_it_vertically_backward, move_it_by_lines): Replace the call
10891 to xfree to an equivalent call to bidi_unshelve_cache.
10892 (move_it_in_display_line_to): Fix logic of returning
10893 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
10894
10895 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10896
10897 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
10898 came from a string character with a `cursor' property. (Bug#9229)
10899
10900 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10901
10902 * Makefile.in (LIB_PTHREAD): New variable.
10903 (LIBES): Add LIB_PTHREAD (Bug#9216).
10904
10905 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
10906 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
10907
10908 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
10909
10910 * regex.c (re_iswctype): Remove some redundant boolean conversions.
10911
10912 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
10913
10914 * xterm.c (x_find_topmost_parent): New function.
10915 (x_set_frame_alpha): Find topmost parent window with
10916 x_find_topmost_parent and set the property there also (bug#9181).
10917 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
10918
10919 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
10920
10921 * callproc.c (Fcall_process): Avoid vfork clobbering
10922 the local vars buffer, coding_systems, current_dir.
10923
10924 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
10925
10926 * keymap.c (Fmake_composed_keymap): Move to subr.el.
10927
10928 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
10929
10930 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
10931 so that it is not optimized away.
10932
10933 * xdisp.c (compute_display_string_pos): Remove unused local.
10934
10935 2011-08-02 Eli Zaretskii <eliz@gnu.org>
10936
10937 Fix slow cursor motion and scrolling in large buffers with
10938 selective display, like Org Mode buffers. (Bug#9218)
10939
10940 * dispextern.h (struct bidi_it): New member disp_prop_p.
10941
10942 * xdisp.c: Remove one-slot cache of display string positions.
10943 (compute_display_string_pos): Accept an additional argument
10944 DISP_PROP_P; callers changed. Scan at most 5K characters forward
10945 for a display string or property. If found, set DISP_PROP_P
10946 non-zero.
10947
10948 * bidi.c (bidi_fetch_char): Accept an additional argument
10949 DISP_PROP_P, and pass it to compute_display_string_pos.
10950 Only handle text covered by a display string if DISP_PROP_P is returned
10951 non-zero. All callers of bidi_fetch_char changed.
10952
10953 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10954
10955 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10956
10957 2010-12-03 Don March <don@ohspite.net>
10958
10959 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10960 last character M-[char] is translated to ESC [char] (bug#7541).
10961
10962 2011-08-02 Kenichi Handa <handa@m17n.org>
10963
10964 * lisp.h (uniprop_table): Extern it.
10965
10966 * chartab.c (uniprop_table): Make it non-static.
10967
10968 2011-08-01 Eli Zaretskii <eliz@gnu.org>
10969
10970 * xdisp.c (forward_to_next_line_start): Accept additional argument
10971 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10972 on the newline.
10973 (reseat_at_next_visible_line_start): Use the bidi iterator state
10974 returned by forward_to_next_line_start to restore the state of
10975 it->bidi_it after backing up to previous newline. (Bug#9212)
10976
10977 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10978
10979 * regex.c (re_comp): Protoize.
10980 (re_exec): Fix return type.
10981 (regexec): Fix type of `ret'. (Bug#9203)
10982
10983 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10984
10985 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10986 This is needed if max-image-size is a floating-point number.
10987
10988 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10989
10990 * print.c (print_object): Print empty symbol as ##.
10991
10992 * lread.c (read1): Read ## as empty symbol.
10993
10994 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10995
10996 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10997 setting frame foreground color (Bug#9175).
10998 (x_set_background_color): Likewise.
10999
11000 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11001 contents (Bug#9176).
11002 (EmacsTooltip -init): Remove bezels and add shadows to
11003 tooltip windows.
11004
11005 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11006 or scroll bar (Bug#8470).
11007
11008 * nsfont.m (nsfont_open): Remove assignment to voffset and
11009 unnecessary vars hshink, expand, hd, full_height, min_height.
11010 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11011
11012 * nsterm.h (nsfont_info): Remove voffset field.
11013
11014 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11015
11016 Implement strike-through and overline on NextStep (Bug#8863).
11017
11018 * nsfont.m (nsfont_open): Use underline position provided by font,
11019 instead of hard-coded value of 2.
11020 (nsfont_draw): Call ns_draw_text_decoration instead.
11021
11022 * nsterm.h: Add declaration for ns_draw_text_decoration.
11023
11024 * nsterm.m (ns_draw_text_decoration): New function for drawing
11025 underline, overline, and strike-through.
11026 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11027 ns_draw_text_decoration. Change treatment of cursor drawing to
11028 accommodate underlining, etc.
11029
11030 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11031
11032 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11033 default.
11034
11035 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11036
11037 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11038 Without this fix, if a signal arrives just after memory fills up,
11039 'malloc' might be invoked reentrantly.
11040
11041 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11042 In other words, assume that every image size is allowed, on non-X
11043 hosts. This assumption is probably wrong, but it lets Emacs compile.
11044
11045 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11046
11047 * regex.c (re_iswctype): Convert return values to boolean.
11048
11049 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11050
11051 * xdisp.c (compute_display_string_pos): Don't use cached display
11052 string position if the buffer had its restriction changed.
11053 (Bug#9184)
11054
11055 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11056
11057 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11058
11059 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11060
11061 Integer signedness and overflow and related fixes. (Bug#9079)
11062
11063 * bidi.c: Integer size and overflow fixes.
11064 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11065 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11066 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11067 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11068 (bidi_find_other_level_edge):
11069 Use ptrdiff_t instead of EMACS_INT where either will do.
11070 This works better on 32-bit hosts configured --with-wide-int.
11071 (bidi_cache_ensure_space): Check for size-calculation overflow.
11072 Use % rather than repeated addition, for better worst-case speed.
11073 Don't set bidi_cache_size until after xrealloc returns, because it
11074 might not return.
11075 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11076 (bidi_cache_ensure_space): Also check that the bidi cache size
11077 does not exceed that of the largest Lisp string or buffer. See Eli
11078 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11079
11080 * alloc.c (__malloc_size_t): Remove.
11081 All uses replaced by size_t. See Andreas Schwab's note
11082 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11083
11084 * image.c: Improve checking for integer overflow.
11085 (check_image_size): Assume that f is nonnull, since
11086 it is always nonnull in practice. This is one less thing to
11087 worry about when checking for integer overflow later.
11088 (x_check_image_size): New function, which checks for integer
11089 overflow issues inside X.
11090 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11091 This removes the need for a memory_full check.
11092 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11093 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11094 (xbm_read_bitmap_data): Change locals back to 'int', since
11095 their values must fit in 'int'.
11096 (xpm_load_image, png_load, tiff_load):
11097 Invoke x_create_x_image_and_pixmap earlier,
11098 to avoid much needless work if the image is too large.
11099 (tiff_load): Treat overly large images as if
11100 x_create_x_image_and_pixmap failed, not as malloc failures.
11101 (gs_load): Use x_check_image_size.
11102
11103 * gtkutil.c: Omit integer casts.
11104 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11105 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11106
11107 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11108
11109 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11110 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11111 would wrongly return t on a 64-bit host.
11112
11113 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11114 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11115 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11116 and therefore cause GCC to emit a bogus diagnostic in some cases.
11117
11118 * image.c: Integer signedness and overflow and related fixes.
11119 This is not an exhaustive set of fixes, but it's time to
11120 record what I've got.
11121 (lookup_pixel_color, check_image_size): Remove redundant decls.
11122 (check_image_size): Don't assume that arbitrary EMACS_INT values
11123 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11124 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11125 (tiff_load, imagemagick_load_image):
11126 Check for overflow in size calculations.
11127 (x_create_x_image_and_pixmap): Remove unnecessary test for
11128 xmalloc returning NULL; that can't happen.
11129 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11130 (xpm_color_bucket): Use better integer hashing function.
11131 (xpm_cache_color): Don't possibly over-allocate memory.
11132 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11133 (gif_memory_source):
11134 Use ptrdiff_t, not int or size_t, to record sizes.
11135 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11136 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11137 either works, as we prefer signed integers.
11138 (tiff_read_from_memory, tiff_write_from_memory):
11139 Return tsize_t, not size_t, since that's what the TIFF API wants.
11140 (tiff_read_from_memory): Don't fail simply because the read would
11141 go past EOF; instead, return a short read.
11142 (tiff_load): Omit no-longer-needed casts.
11143 (Fimagemagick_types): Don't assume size fits into 'int'.
11144
11145 Improve hashing quality when configured --with-wide-int.
11146 * fns.c (hash_string): New function, taken from sxhash_string.
11147 Do not discard information about ASCII character case; this
11148 discarding is no longer needed.
11149 (sxhash-string): Use it. Change sig to match it. Caller changed.
11150 * lisp.h: Declare it.
11151 * lread.c (hash_string): Remove, since we now use fns.c's version.
11152 The fns.c version returns a wider integer if --with-wide-int is
11153 specified, so this should help the quality of the hashing a bit.
11154
11155 * emacs.c: Integer overflow minor fix.
11156 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11157 Define only if GNU_LINUX.
11158 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11159
11160 * dispnew.c: Integer signedness and overflow fixes.
11161 Remove unnecessary forward decls, that were a maintenance hassle.
11162 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11163 All uses changed.
11164 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11165 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11166 (prepare_desired_row, line_draw_cost):
11167 Use int, not unsigned, where either works.
11168 (save_current_matrix, restore_current_matrix):
11169 Use ptrdiff_t, not size_t, where either works.
11170 (init_display): Check for overflow more accurately, and without
11171 relying on undefined behavior.
11172
11173 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11174 Remove, replacing with the new symbols in lisp.h. All uses changed.
11175 * fileio.c (make_temp_name):
11176 * filelock.c (lock_file_1, lock_file):
11177 * xdisp.c (message_dolog):
11178 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11179 Use pMd etc. instead.
11180 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11181 replacing the pWIDE etc. symbols removed from editfns.c.
11182
11183 * keyboard.h (num_input_events): Now uintmax_t.
11184 This is (very slightly) less likely to mess up due to wraparound.
11185 All uses changed.
11186
11187 * buffer.c: Integer signedness fixes.
11188 (alloc_buffer_text, enlarge_buffer_text):
11189 Use ptrdiff_t rather than size_t when either will do, as we prefer
11190 signed integers.
11191
11192 * alloc.c: Integer signedness and overflow fixes.
11193 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11194 (__malloc_size_t): Default to size_t, not to int.
11195 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11196 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11197 Prefer ptrdiff_t to size_t when either would do, as we prefer
11198 signed integers.
11199 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11200 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11201 Now const. Initialize with values that are in range even if char
11202 is signed.
11203 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11204 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11205 These functions do the right thing with sizes > 2**32.
11206 (check_depth): Now ptrdiff_t, not int.
11207 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11208 Adjust to new way of storing sizes. Check for size overflow bugs
11209 in rest of code.
11210 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11211 slightly wrong anyway, as it missed one instance of
11212 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11213 (refill_memory_reserve): Omit needless cast to size_t.
11214 (mark_object_loop_halt): Mark as externally visible.
11215
11216 * xselect.c: Integer signedness and overflow fixes.
11217 (Fx_register_dnd_atom, x_handle_dnd_message):
11218 Use ptrdiff_t, not size_t, since we prefer signed.
11219 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11220 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11221 x_dnd_atoms_size and x_dnd_atoms_length.
11222
11223 * doprnt.c: Prefer signed to unsigned when either works.
11224 * eval.c (verror):
11225 * doprnt.c (doprnt):
11226 * lisp.h (doprnt):
11227 * xdisp.c (vmessage):
11228 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11229 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11230 prefer signed arithmetic to avoid comparison confusion.
11231 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11232 but is a bit tricky.
11233
11234 Assume freestanding C89 headers, string.h, stdlib.h.
11235 * data.c, doprnt.c, floatfns.c, print.c:
11236 Include float.h unconditionally.
11237 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11238 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11239 * regex.c: Likewise for stddef.h, string.h.
11240 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11241 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11242 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11243 (STDC_HEADERS): Remove obsolete defines.
11244 * sysdep.c: Include limits.h unconditionally.
11245
11246 Assume support for memcmp, memcpy, memmove, memset.
11247 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11248 * regex.c (memcmp, memcpy):
11249 Remove; we assume C89 now.
11250
11251 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11252 (__malloc_safe_bcopy): Remove; no longer needed.
11253
11254 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11255 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11256 well either way, and we prefer signed to unsigned.
11257
11258 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11259
11260 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11261 closes the connection while we're reading (bug#9182).
11262
11263 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11264
11265 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11266 are specified (Bug#9168).
11267
11268 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11269
11270 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11271 Found by GCC static checking and --with-wide-int on a 32-bit host.
11272
11273 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11274
11275 * xdisp.c (compute_display_string_pos): Fix logic of caching
11276 previous display string position. Initialize cached_prev_pos to
11277 -1. Fixes slow-down at the beginning of a buffer.
11278
11279 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11280
11281 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11282 for attrs[LFACE_FONTSET_INDEX].
11283
11284 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11285
11286 * xml.c (parse_region): Remove unused local
11287 that was recently introduced.
11288
11289 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11290
11291 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11292 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11293
11294 * xdisp.c (move_it_in_display_line_to): Record the best matching
11295 position for TO_CHARPOS while scanning the line, and restore it on
11296 exit if none of the characters scanned was an exact match.
11297 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11298 when exact match is impossible due to invisible text, and the
11299 lines are truncated.
11300
11301 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11302
11303 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11304 for OSX >= 10.7.
11305
11306 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11307
11308 Fix a significant slow-down of cursor motion with C-n, C-p,
11309 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11310 auto-repeat under bidi redisplay in fontified buffers.
11311 * xdisp.c (compute_stop_pos_backwards): New function.
11312 (next_element_from_buffer): Call compute_stop_pos_backwards to
11313 find a suitable prev_stop when we find ourselves before
11314 base_level_stop.
11315 (reseat): Don't look for prev_stop, as that could mean a very long
11316 run.
11317 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11318 <cached_disp_overlay_modiff>: Cache for last found display string
11319 position.
11320 (compute_display_string_pos): Return the cached position if asked
11321 about the same buffer in the same area of character positions, and
11322 the buffer wasn't changed since the time the display string
11323 position was cached.
11324
11325 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11326
11327 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11328 is an integer, which is important for empty lines. (Bug#9149)
11329
11330 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11331
11332 * frame.c (Fmodify_frame_parameters): In tty case, update the
11333 default face if necessary (Bug#4238).
11334
11335 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11336
11337 * editfns.c (Fstring_to_char): No need to explain what a character
11338 is in the docstring (Bug#6576).
11339
11340 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11341
11342 * xml.c (parse_region): Make sure we always return a tree.
11343
11344 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11345
11346 * xml.c (parse_region): If a document contains only comments,
11347 return that, too.
11348
11349 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11350
11351 * xml.c (make_dom): Return comments, too.
11352
11353 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11354
11355 Port to OpenBSD.
11356 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11357 and the surrounding thread.
11358 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11359 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11360 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11361 timer goes off.
11362 * s/openbsd.h (BROKEN_SIGIO): Define.
11363 * unexelf.c (unexec) [__OpenBSD__]:
11364 Don't update the .mdebug section of the Alpha COFF symbol table.
11365
11366 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11367
11368 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11369 (bug#8460).
11370
11371 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11372
11373 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11374 This fixes some race conditions on the permissions of any newly
11375 created file.
11376
11377 * alloc.c (valid_pointer_p): Use pipe, not open.
11378 This fixes some permissions issues when debugging.
11379
11380 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11381 If fchown fails to set both uid and gid, try to set just gid,
11382 as that is sometimes allowed. Adjust the file's mode to eliminate
11383 setuid or setgid bits that are inappropriate if fchown fails.
11384
11385 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11386
11387 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11388 to compare Lisp_Objects.
11389 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11390 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11391 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11392
11393 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11394
11395 * lread.c (read_integer): Unread even EOF character.
11396 (read1): Likewise. Properly record start position of symbol.
11397
11398 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11399 symbol character follows.
11400
11401 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11402
11403 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11404 This works around a problem with the previous change to Fcopy_file.
11405 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11406 and without this change, GCC might complain about discarding
11407 fchown's return value.
11408
11409 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11410
11411 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11412
11413 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11414
11415 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11416
11417 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11418
11419 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11420 it's used from the C level.
11421
11422 * process.c: Use the same condition for POLL_FOR_INPUT in both
11423 keyboard.c and process.c (bug#1858).
11424
11425 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11426
11427 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11428 (Fgnutls_boot): Use it.
11429
11430 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11431
11432 * doc.c (Fsubstitute_command_keys): Revert last change.
11433
11434 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11435
11436 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11437 quotes the next character, and doesn't affect other longer
11438 sequences (bug#8935).
11439
11440 * lread.c (syms_of_lread): Clarify that is isn't only
11441 `eval-buffer' and `eval-defun' that's affected by
11442 `lexical-binding' (bug#8460).
11443
11444 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11445
11446 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11447 bidi redisplay when a line includes both an image and is truncated.
11448
11449 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11450
11451 Fix minor problems found by static checking.
11452 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11453 (elsz): Now a signed constant, not a size_t var. We prefer signed
11454 types to unsigned, to avoid integer comparison confusion. Without
11455 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11456 "cannot optimize loop, the loop counter may overflow", a symptom
11457 of the confusion.
11458 * indent.c (Fvertical_motion): Mark locals as initialized.
11459 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11460
11461 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11462
11463 * search.c (Fre_search_backward): Mention `case-fold-search' in
11464 all the re_search_* functions (bug#8138).
11465
11466 * keyboard.c (Fopen_dribble_file): Document when the file is
11467 closed (bug#8056).
11468
11469 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11470
11471 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11472 bidi_cache_idx.
11473
11474 Support bidi reordering of display and overlay strings.
11475 * xdisp.c (compute_display_string_pos)
11476 (compute_display_string_end): Accept additional argument STRING.
11477 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11478 (reseat_to_string): Initialize bidi_it->string.s and
11479 bidi_it->string.schars.
11480 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11481 NULL (avoids a crash in bidi_paragraph_init).
11482 Initialize itb.string.lstring.
11483 (init_iterator): Call bidi_init_it only of a valid
11484 buffer position was specified. Initialize paragraph_embedding to
11485 L2R.
11486 (reseat_to_string): Initialize the bidi iterator.
11487 (display_string): If we need to ignore text properties of
11488 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11489 original value of -1 will not work with bidi.)
11490 (compute_display_string_pos): First arg is now struct
11491 `text_pos *'; all callers changed. Support display properties on
11492 Lisp strings.
11493 (compute_display_string_end): Support display properties on Lisp
11494 strings.
11495 (init_iterator, reseat_1, reseat_to_string): Initialize the
11496 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11497 when iterating on a string not from display properties).
11498 (compute_display_string_pos, compute_display_string_end):
11499 Fix calculation of the object to scan. Fixes an error when using
11500 arrow keys.
11501 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11502 base_level_stop; instead, set base_level_stop to BEGV.
11503 Fixes crashes in vertical-motion.
11504 (next_element_from_buffer): Improve commentary for when
11505 the iterator is before prev_stop.
11506 (init_iterator): Initialize bidi_p from the default value of
11507 bidi-display-reordering, not from buffer-local value. Use the
11508 buffer-local value only if initializing for buffer iteration.
11509 (handle_invisible_prop): Support invisible properties on strings
11510 that are being bidi-reordered.
11511 (set_iterator_to_next): Support bidi reordering of C strings and
11512 Lisp strings.
11513 (next_element_from_string): Support bidi reordering of Lisp
11514 strings.
11515 (handle_stop_backwards): Support Lisp strings as well.
11516 (display_string): Support display of R2L glyph rows.
11517 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11518 (init_iterator): Don't initialize it->bidi_p for strings
11519 here.
11520 (reseat_to_string): Initialize it->bidi_p for strings here.
11521 (next_element_from_string, next_element_from_c_string)
11522 (next_element_from_buffer): Add xassert's for correspondence
11523 between IT's object being iterated and it->bidi_it.string
11524 structure.
11525 (face_before_or_after_it_pos): Support bidi iteration.
11526 (next_element_from_c_string): Handle the case of the first string
11527 character that is not the first one in the visual order.
11528 (get_visually_first_element): New function, refactored from common
11529 parts of next_element_from_buffer, next_element_from_string, and
11530 next_element_from_c_string.
11531 (tool_bar_lines_needed, redisplay_tool_bar)
11532 (display_menu_bar): Force left-to-right direction. Add a FIXME
11533 comment for making that be controlled by a user option.
11534 (push_it, pop_it): Save and restore the state of the
11535 bidi iterator. Save and restore the bidi_p flag.
11536 (pop_it): Iterate out of display property for string iteration as
11537 well.
11538 (iterate_out_of_display_property): Support iteration over strings.
11539 (handle_single_display_spec): Set up it->bidi_it for iteration
11540 over a display string, and call bidi_init_it.
11541 (handle_single_display_spec, next_overlay_string)
11542 (get_overlay_strings_1, push_display_prop): Set up the bidi
11543 iterator for displaying display or overlay strings.
11544 (forward_to_next_line_start): Don't use the shortcut if
11545 bidi-iterating.
11546 (back_to_previous_visible_line_start): If handle_display_prop
11547 pushed the iterator stack, restore the internal state of the bidi
11548 iterator by calling bidi_pop_it same number of times.
11549 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11550 and we are bidi-iterating, don't decrement the iterator position;
11551 instead, set the first_elt flag in the bidi iterator, to produce
11552 the same effect.
11553 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11554 (push_display_prop): xassert that we are iterating a buffer.
11555 (push_it, pop_it): Save and restore paragraph_embedding member.
11556 (handle_single_display_spec, next_overlay_string)
11557 (get_overlay_strings_1, reseat_1, reseat_to_string)
11558 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11559 correctly. Don't assume unibyte strings are not bidi-reordered.
11560 (compute_display_string_pos)
11561 (compute_display_string_end): Fix handling the case of C string.
11562 (push_it, pop_it): Save and restore from_disp_prop_p.
11563 (handle_single_display_spec, push_display_prop): Set the
11564 from_disp_prop_p flag.
11565 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11566 (pop_it): Call iterate_out_of_display_property only if we are
11567 popping after iteration over a string that came from a display
11568 property. Fix a typo in popping stretch info. Add an assertion
11569 for verifying that the iterator position is in sync with the bidi
11570 iterator.
11571 (handle_single_display_spec, get_overlay_strings_1)
11572 (push_display_prop): Fix initialization of paragraph direction for
11573 string when that of the parent object is not yet determined.
11574 (reseat_1): Call bidi_init_it to resync the bidi
11575 iterator with IT's position. (Bug#7616)
11576 (find_row_edges): If ROW->start.pos gives position
11577 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11578 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11579 Reset the from_disp_prop_p flag.
11580 (SAVE_IT, RESTORE_IT): New macros.
11581 (pos_visible_p, face_before_or_after_it_pos)
11582 (back_to_previous_visible_line_start)
11583 (move_it_in_display_line_to, move_it_in_display_line)
11584 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11585 (try_scrolling, redisplay_window, display_line): Use them when
11586 saving a temporary copy of the iterator and restoring it back.
11587 (back_to_previous_visible_line_start, reseat_1)
11588 (init_iterator): Empty the bidi cache "stack".
11589 (move_it_in_display_line_to): If iterator ended up at
11590 EOL, but we never saw any buffer positions smaller than
11591 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11592 motion in bidi-reordered lines.
11593 (move_it_in_display_line_to): Record prev_method and prev_pos
11594 immediately before the call to set_iterator_to_next. Fixes cursor
11595 motion in bidi-reordered lines with stretch glyphs and strings
11596 displayed in margins. (Bug#8133) (Bug#8867)
11597 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11598 TO_CHARPOS.
11599 (pos_visible_p): Support positions in bidi-reordered lines.
11600 Save and restore bidi cache.
11601
11602 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11603 (bidi_paragraph_info): Delete unused struct.
11604 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11605 (bidi_cache_start): New variable.
11606 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11607 to zero.
11608 (bidi_cache_fetch_state, bidi_cache_search)
11609 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11610 (bidi_cache_find, bidi_peek_at_next_level)
11611 (bidi_level_of_next_char, bidi_find_other_level_edge)
11612 (bidi_move_to_visually_next): Compare cache index with
11613 bidi_cache_start rather than with zero.
11614 (bidi_fetch_char): Accept new argument STRING; all callers
11615 changed. Support iteration over a string. Support strings with
11616 display properties. Support unibyte strings. Fix the type of
11617 `len' according to what STRING_CHAR_AND_LENGTH expects.
11618 (bidi_paragraph_init, bidi_resolve_explicit_1)
11619 (bidi_resolve_explicit, bidi_resolve_weak)
11620 (bidi_level_of_next_char, bidi_move_to_visually_next):
11621 Support iteration over a string.
11622 (bidi_set_sor_type, bidi_resolve_explicit_1)
11623 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11624 can now be zero (for strings); special values 0 and -1 were
11625 changed to -1 and -2, respectively.
11626 (bidi_char_at_pos): New function.
11627 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11628 Call it instead of FETCH_MULTIBYTE_CHAR.
11629 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11630 initialized to valid values.
11631 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11632 values.
11633 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11634 the test for valid cached positions. Fix the logic for looking up
11635 the sentinel state in the cache. GCPRO the Lisp string we are
11636 iterating.
11637 (bidi_push_it, bidi_pop_it): New functions.
11638 (bidi_initialize): Initialize the bidi cache start stack pointer.
11639 (bidi_cache_ensure_space): New function, refactored from part of
11640 bidi_cache_iterator_state. Don't assume the required size is just
11641 one BIDI_CACHE_CHUNK away.
11642 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11643 (bidi_count_bytes, bidi_char_at_pos): New functions.
11644 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11645 always valid if bidi_cache_idx is valid.
11646 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11647 is valid if it's going to be used.
11648 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11649 (bidi_cache_fetch_state, bidi_cache_search)
11650 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11651 (bidi_cache_iterator_state, bidi_cache_find)
11652 (bidi_find_other_level_edge, bidi_cache_start_stack):
11653 All variables related to cache indices are now EMACS_INT.
11654
11655 * dispextern.h (struct bidi_string_data): New structure.
11656 (struct bidi_it): New member `string'. Make flag members be 1-bit
11657 fields, and put them last in the struct.
11658 (compute_display_string_pos, compute_display_string_end):
11659 Update prototypes.
11660 (bidi_push_it, bidi_pop_it): Add prototypes.
11661 (struct iterator_stack_entry): New members bidi_p,
11662 paragraph_embedding, and from_disp_prop_p.
11663 (struct it): Member bidi_p is now a bit field 1 bit wide.
11664 (bidi_shelve_cache, bidi_unshelve_cache):
11665 Declare prototypes.
11666
11667 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11668 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11669 and vector-like objects.
11670
11671 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11672 cache around display iteration.
11673
11674 * window.c (Fwindow_end, window_scroll_pixel_based)
11675 (displayed_window_lines, Frecenter): Save and restore the bidi
11676 cache around display iteration.
11677
11678 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11679
11680 * editfns.c (Fdelete_region): Clarify the use of the named
11681 parameters (bug#6788).
11682
11683 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11684
11685 * indent.c (Fvertical_motion): Set and restore w->pointm when
11686 saving and restoring the window's buffer (Bug#9006).
11687
11688 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11689
11690 * editfns.c (Fstring_to_char): Clarify just what is returned
11691 (bug#6576). Text by Eli Zaretskii.
11692
11693 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11694
11695 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11696
11697 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11698
11699 * buffer.c (mmap_find): Fix a typo.
11700
11701 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11702
11703 Fix execution of x selection hooks.
11704 * xselect.c (Qx_lost_selection_functions)
11705 (Qx_sent_selection_functions): New vars.
11706 (syms_of_xselect): DEFSYM them.
11707 (x_handle_selection_request): Pass Qx_sent_selection_functions
11708 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11709 (x_handle_selection_clear,x_clear_frame_selections):
11710 Pass Qx_lost_selection_functions rather than
11711 Vx_lost_selection_functions to Frun_hook_with_args.
11712
11713 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11714
11715 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11716 The old code sometimes used this field without initializing it.
11717
11718 * alloc.c (gc_sweep): Don't read past end of array.
11719 In theory, the old code could also have corrupted Emacs internals,
11720 though it'd be very unlikely.
11721
11722 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11723
11724 * character.c (Fcharacterp): Don't advertise optional ignored
11725 argument. (Bug#4026)
11726
11727 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11728
11729 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11730 key" (bug#4257).
11731
11732 * window.c (Fset_window_start): Doc fix (bug#4199).
11733 (Fset_window_hscroll): Ditto.
11734
11735 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11736
11737 Fix minor new problems caught by GCC 4.6.1.
11738 * term.c (init_tty): Remove unused local.
11739 * xsettings.c (store_monospaced_changed): Define this function only
11740 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11741 not used otherwise.
11742
11743 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11744
11745 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11746
11747 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11748
11749 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11750 are the mini-buffer and the echo area (bug#3320).
11751
11752 * term.c (init_tty): Remove support for supdup, c10 and perq
11753 terminals, which are no longer supported (bug#1482).
11754
11755 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11756
11757 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11758
11759 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11760
11761 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11762 for non-popups (Bug#3642).
11763
11764 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11765
11766 * alloc.c (reset_malloc_hooks): Protoize.
11767 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11768 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11769 * cm.c (losecursor): Likewise.
11770 * data.c (fmod): Likewise.
11771 * dispnew.c (swap_glyphs_in_rows): Likewise.
11772 * emacs.c (memory_warning_signal): Likewise.
11773 * floatfns.c (float_error): Likewise.
11774 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11775 (otf_open, font_otf_capability, generate_otf_features)
11776 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11777 Likewise.
11778 * image.c (pbm_read_file): Likewise.
11779 * indent.c (string_display_width): Likewise.
11780 * intervals.c (check_for_interval, search_for_interval)
11781 (inc_interval_count, count_intervals, root_interval)
11782 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11783 * lread.c (defalias): Likewise.
11784 * ralloc.c (r_alloc_check): Likewise.
11785 * regex.c (set_image_of_range_1, set_image_of_range)
11786 (regex_grow_registers): Likewise.
11787 * sysdep.c (strerror): Likewise.
11788 * termcap.c (valid_filename_p, tprint, main): Likewise.
11789 * tparam.c (main): Likewise.
11790 * unexhp9k800.c (run_time_remap, save_data_space)
11791 (update_file_ptrs, read_header, write_header, calculate_checksum)
11792 (copy_file, copy_rest, display_header): Likewise.
11793 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11794 Likewise.
11795 * xdisp.c (check_it): Likewise.
11796 * xfaces.c (register_color, unregister_color, unregister_colors):
11797 Likewise.
11798 * xfns.c (print_fontset_result): Likewise.
11799 * xrdb.c (member, fatal, main): Likewise.
11800
11801 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11802
11803 Fix minor problems found by static checking (Bug#9031).
11804 * chartab.c (char_table_set_range, map_sub_char_table):
11805 Remove unused locals.
11806 (uniprop_table): Now static.
11807 * composite.c (_work_char): Remove unused static var.
11808
11809 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11810
11811 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11812
11813 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11814
11815 * gtkutil.c (qttip_cb): Remove code without function.
11816
11817 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11818
11819 * w32.c (pthread_sigmask): New stub.
11820
11821 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11822
11823 Use pthread_sigmask, not sigprocmask (Bug#9010).
11824 sigprocmask is portable only for single-threaded applications, and
11825 Emacs can be multi-threaded when it uses GTK.
11826 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11827 (LIBES): Use it.
11828 * callproc.c (Fcall_process):
11829 * process.c (create_process):
11830 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11831 Use pthread_sigmask, not sigprocmask.
11832
11833 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11834
11835 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11836 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11837 wrong (Bug#8591).
11838
11839 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11840
11841 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11842 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11843 (xg_hide_tooltip): Fix comment.
11844
11845 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11846 in registerServicesMenuSendTypes.
11847 (validRequestorForSendType): Don't check ns_return_types.
11848
11849 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11850 ns_return_type.
11851
11852 2011-07-08 Jason Rumney <jasonr@gnu.org>
11853
11854 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11855 SH_SHOW for hidden windows (Bug#5482).
11856
11857 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11858 frame struct members of non-existent frames (Bug#6284).
11859
11860 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11861
11862 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11863 variable firstTime not needed on OSX >= 10.6.
11864 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11865 >= 10.5. Use setKnobProportion, setDoubleValue.
11866
11867 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11868 (MAC_OS_X_VERSION_10_5): Define if not defined.
11869 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11870 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11871 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11872
11873 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11874 cString and lossyCString on OSX >= 10.4.
11875
11876 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11877 sizeToFit on OSX >= 10.2.
11878
11879 * nsimage.m (allocInitFromFile): Don't use deprecated method
11880 bestRepresentationForDevice on OSX >= 10.6.
11881
11882 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
11883 to avoid warning.
11884
11885 * emacs.c: Declare unexec_init_emacs_zone.
11886
11887 * nsgui.h: Fix compiler warning about gnulib redefining verify.
11888
11889 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
11890
11891 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
11892 on svcsMenu (Bug#8842).
11893
11894 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
11895 ns_return_types.
11896 (Fns_list_services): Just return Qnil on 10.6, code not working there.
11897
11898 * nsterm.m (QUTF8_STRING): Declare.
11899 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
11900 (validRequestorForSendType): Return type is (id).
11901 Change indexOfObjectIdenticalTo to indexOfObject.
11902 Check if we have local selection before returning self (Bug#8842).
11903 (writeSelectionToPasteboard): Put local selection into paste board
11904 if we have a local selection (Bug#8842).
11905 (syms_of_nsterm): DEFSYM QUTF8_STRING.
11906
11907 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
11908 (ns_get_local_selection): Declare.
11909
11910 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
11911
11912 * keymap.c (describe_map_tree): Don't insert a double newline at
11913 the end of the buffer (bug#1169) and return whether we inserted
11914 something.
11915
11916 * callint.c (Fcall_interactively): Change "reading args" to
11917 "providing args" to try to clarify what it does (bug#1010).
11918
11919 2011-07-07 Kenichi Handa <handa@m17n.org>
11920
11921 * composite.c (composition_compute_stop_pos): Ignore a static
11922 composition starting before CHARPOS (Bug#8915).
11923
11924 * xdisp.c (handle_composition_prop): Likewise.
11925
11926 2011-07-07 Eli Zaretskii <eliz@gnu.org>
11927
11928 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
11929 (Bug#9015)
11930
11931 2011-07-07 Kenichi Handa <handa@m17n.org>
11932
11933 * character.h (unicode_category_t): New enum type.
11934
11935 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
11936 (Qchar_code_property_table): New variable.
11937 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
11938 (UNIPROP_COMPRESSED_FORM_P): New macros.
11939 (char_table_ascii): Uncompress the compressed values.
11940 (sub_char_table_ref): New arg is_uniprop. Callers changed.
11941 Uncompress the compressed values.
11942 (sub_char_table_ref_and_range): Likewise.
11943 (char_table_ref_and_range): Uncompress the compressed values.
11944 (sub_char_table_set): New arg is_uniprop. Callers changed.
11945 Uncompress the compressed values.
11946 (sub_char_table_set_range): Args changed. Callers changed.
11947 (char_table_set_range): Adjuted for the above change.
11948 (map_sub_char_table): Delete args default_val and parent. Add arg
11949 top. Give decoded values to a Lisp function.
11950 (map_char_table): Adjust for the above change. Give decoded
11951 values to a Lisp function. Gcpro more variables.
11952 (uniprop_table_uncompress)
11953 (uniprop_decode_value_run_length): New functions.
11954 (uniprop_decoder, uniprop_decoder_count): New variables.
11955 (uniprop_get_decoder, uniprop_encode_value_character)
11956 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11957 New functions.
11958 (uniprop_encoder, uniprop_encoder_count): New variables.
11959 (uniprop_get_encoder, uniprop_table)
11960 (Funicode_property_table_internal, Fget_unicode_property_internal)
11961 (Fput_unicode_property_internal): New functions.
11962 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11963 Sunicode_property_table_internal, Sget_unicode_property_internal,
11964 and Sput_unicode_property_internal. Defvar_lisp
11965 char-code-property-alist.
11966
11967 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
11968 Vunicode_category_table.
11969
11970 * font.c (font_range): Adjust for the change of
11971 Vunicode_category_table.
11972
11973 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11974
11975 * m/iris4d.h: Remove file, move contents ...
11976 * s/irix6-5.h: ... here.
11977
11978 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11979
11980 Remove unportable assumption about struct layout (Bug#8884).
11981 * alloc.c (mark_buffer):
11982 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11983 (clone_per_buffer_values): Don't assume that
11984 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11985 This isn't true in general, and it's particularly not true
11986 if Emacs is configured with --with-wide-int.
11987 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11988 New macros, used in the buffer.c change.
11989
11990 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11991
11992 * xsettings.c: Use both GConf and GSettings if both are available.
11993 (store_config_changed_event): Add comment.
11994 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11995 (store_tool_bar_style_changed): New functions.
11996 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
11997 (struct xsettings): Move font inside HAVE_XFT.
11998 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
11999 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12000 Move inside HAVE_XFT.
12001 (something_changed_gsettingsCB): Rename from something_changedCB.
12002 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12003 also.
12004 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12005 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12006 (something_changed_gconfCB): Rename from something_changedCB.
12007 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12008 (parse_settings): Move check for font inside HAVE_XFT.
12009 (read_settings, apply_xft_settings): Add comment.
12010 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12011 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12012 call store_font_name_changed.
12013 (xft_settings_event): Add comment.
12014 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12015 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12016 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12017 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12018 (xsettings_initialize): Call init_gsettings last.
12019 (xsettings_get_system_font, xsettings_get_system_normal_font):
12020 Add comment.
12021
12022 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12023
12024 Random fixes. E.g., (random) never returned negative values.
12025 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12026 subseconds part to the entropy, as that's a bit more random.
12027 Prefer signed to unsigned, since the signedness doesn't matter and
12028 in general we prefer signed. When given a limit, use a
12029 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12030 latter isn't right if USE_2_TAGS_FOR_INTS.
12031 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12032 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12033
12034 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12035
12036 * textprop.c (text_property_stickiness):
12037 Obey Vtext_property_default_nonsticky.
12038 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12039 * w32fns.c (syms_of_w32fns):
12040 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12041
12042 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12043
12044 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12045 This is more efficient than Ffile_directory_p and avoids a minor race.
12046
12047 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12048
12049 * buffer.c (Foverlay_put): Say what the return value is
12050 (bug#7835).
12051
12052 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12053 is a directory before asking whether to use the file name
12054 (bug#7564).
12055 (barf_or_query_if_file_exists): Make the "File is a directory"
12056 error be more correct.
12057
12058 * fns.c (Frequire): Remove the mention of the .gz files, since
12059 that's installation-specific, but keep the mention of
12060 `get-load-suffixes'.
12061
12062 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12063
12064 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12065 Report string overflow if the output is too long.
12066
12067 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12068
12069 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12070 (syms_of_gnutls): Remove duplicate DEFSYM for
12071 Qgnutls_bootprop_verify_hostname_error, an error for
12072 Qgnutls_bootprop_verify_error (which is no longer used).
12073
12074 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12075 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12076 Also (re)move comments that are misplaced or no longer relevant.
12077
12078 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12079
12080 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12081
12082 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12083
12084 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12085 and background color parameters if they have been changed.
12086
12087 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12088
12089 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12090
12091 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12092
12093 * xsettings.c (SYSTEM_FONT): Define only when used.
12094 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12095
12096 * keymap.c (access_keymap_1): Now static.
12097
12098 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12099
12100 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12101 leave any prefix arg for the up event (Bug#1586).
12102
12103 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12104
12105 * lread.c (syms_of_lread): Mention single symbols defined by
12106 `defvar' or `defconst' (bug#7154).
12107
12108 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12109 (Frequire): Mention get-load-suffixes.
12110
12111 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12112
12113 * window.h (window): Remove clone_number slot.
12114 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12115 Remove.
12116 (make_parent_window, make_window, saved_window)
12117 (Fset_window_configuration, save_window_save): Don't deal with
12118 clone numbers.
12119 * buffer.c (Qclone_number): Remove declaration.
12120 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12121
12122 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12123
12124 Add multiple inheritance to keymaps.
12125 * keymap.c (Fmake_composed_keymap): New function.
12126 (Fset_keymap_parent): Simplify.
12127 (fix_submap_inheritance): Remove.
12128 (access_keymap_1): New function extracted from access_keymap to handle
12129 embedded parents and handle lists of maps.
12130 (access_keymap): Use it.
12131 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12132 (Fcopy_keymap): Handle embedded parents.
12133 (Fcommand_remapping, define_as_prefix): Simplify.
12134 (Fkey_binding): Simplify.
12135 (syms_of_keymap): Move minibuffer-local-completion-map,
12136 minibuffer-local-filename-completion-map,
12137 minibuffer-local-must-match-map, and
12138 minibuffer-local-filename-must-match-map to Elisp.
12139 (syms_of_keymap): Defsubr make-composed-keymap.
12140 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12141 (parse_menu_item): Trivial simplification.
12142
12143 2011-07-01 Glenn Morris <rgm@gnu.org>
12144
12145 * Makefile.in (SETTINGS_LIBS): Fix typo.
12146
12147 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12148
12149 * coding.c (Fencode_coding_string): Record the last coding system
12150 used, as the function doc string says (bug#8738).
12151
12152 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12153
12154 * xsettings.c (store_monospaced_changed): Take new font as arg and
12155 check for change against current_mono_font.
12156 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12157 (emacs_settings_constructor, emacs_settings_get_property)
12158 (emacs_settings_set_property, emacs_settings_class_init)
12159 (emacs_settings_init, gsettings_obj): Remove.
12160 (something_changedCB): New function for HAVE_GSETTINGS.
12161 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12162 with value as argument.
12163 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12164 g_settings_new (Bug#8967). Do not create gsettings_obj.
12165 Remove calls to g_settings_bind. Connect something_changedCB to
12166 "changed".
12167
12168 * xgselect.c: Add defined (HAVE_GSETTINGS).
12169 (xgselect_initialize): Ditto.
12170
12171 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12172 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12173 xg_select.
12174
12175 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12176
12177 * eval.c (struct backtrace): Simplify and port the data structure.
12178 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12179 signed bit field, as this assumption is not portable and it makes
12180 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12181 "char debug_on_exit : 1" as this is not portable either; instead,
12182 use the portable "unsigned int debug_on_exit : 1". Remove unused
12183 member evalargs. Remove obsolete comments about cc bombing out.
12184
12185 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12186
12187 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12188 Let HAVE_GSETTINGS override HAVE_GCONF.
12189 (store_monospaced_changed): New function.
12190 (EMACS_SETTINGS): A new type derived from GObject to handle
12191 GSettings notifications.
12192 (emacs_settings_constructor, emacs_settings_get_property)
12193 (emacs_settings_set_property, emacs_settings_class_init):
12194 New functions.
12195 (gsettings_client, gsettings_obj): New variables.
12196 (GSETTINGS_SCHEMA): New define.
12197 (something_changedCB): Call store_monospaced_changed.
12198 (init_gsettings): New function.
12199 (xsettings_initialize): Call init_gsettings.
12200 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12201 to NULL.
12202
12203 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12204 GCONF_CFLAGS/LIBS.
12205
12206 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12207
12208 * window.c (resize_root_window, grow_mini_window)
12209 (shrink_mini_window): Rename Qresize_root_window to
12210 Qwindow_resize_root_window and Qresize_root_window_vertically to
12211 Qwindow_resize_root_window_vertically.
12212
12213 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12214
12215 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12216
12217 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12218
12219 * makefile.w32-in: Redesign dependencies so they reflect more
12220 clearly which files are directly included by each source file,
12221 and not through other includes.
12222
12223 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12224
12225 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12226 (sort_overlays, overlay_strings): When an overlay's clone number
12227 matches the window's clone number process the overlay even if
12228 the overlay's window property doesn't match the current window.
12229
12230 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12231 (Fwindow_hchild): Rename to Fwindow_left_child.
12232 (Fwindow_next): Rename to Fwindow_next_sibling.
12233 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12234 (resize_window_check): Rename to window_resize_check.
12235 (resize_window_apply): Rename to window_resize_apply.
12236 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12237 (Fdelete_other_windows_internal, resize_frame_windows)
12238 (Fsplit_window_internal, Fdelete_window_internal)
12239 (grow_mini_window, shrink_mini_window)
12240 (Fresize_mini_window_internal): Fix callers accordingly.
12241
12242 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12243
12244 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12245 (emacs_fixed_set_min_size): Remove.
12246 (emacs_fixed_new): Take frame as argument.
12247
12248 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12249 (_EmacsFixedPrivate): Remove minwidth/height.
12250 Add struct frame *f.
12251 (emacs_fixed_init): Initialize priv->f.
12252 (get_parent_class, emacs_fixed_set_min_size): Remove.
12253 (emacs_fixed_new): Set priv->f to argument.
12254 (emacs_fixed_get_preferred_width)
12255 (emacs_fixed_get_preferred_height): Use min_width/height from
12256 frames size_hint to set minimum and natural (Bug#8919).
12257 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12258 and use min_width/height from frames size_hint to set
12259 min_width/height (Bug#8919).
12260
12261 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12262 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12263 Fix indentation.
12264
12265 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12266
12267 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12268 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12269 called at ZV.
12270
12271 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12272
12273 * process.c (wait_reading_process_output): Bypass select if
12274 waiting for a cell while ignoring keyboard input, and input is
12275 pending. Suggested by Jan Djärv (Bug#8869).
12276
12277 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12278
12279 Use gnulib's dup2 module instead of rolling our own.
12280 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12281
12282 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12283
12284 * dispnew.c (scrolling_window): Before scrolling, turn off a
12285 mouse-highlight in the window being scrolled.
12286
12287 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12288
12289 Move DEFSYM to lisp.h and use everywhere.
12290
12291 * character.h (DEFSYM): Move declaration...
12292 * lisp.h (DEFSYM): ...here.
12293
12294 * gnutls.c:
12295 * minibuf.c:
12296 * w32menu.c:
12297 * w32proc.c:
12298 * w32select.c: Don't include character.h.
12299
12300 * alloc.c (syms_of_alloc):
12301 * buffer.c (syms_of_buffer):
12302 * bytecode.c (syms_of_bytecode):
12303 * callint.c (syms_of_callint):
12304 * casefiddle.c (syms_of_casefiddle):
12305 * casetab.c (init_casetab_once):
12306 * category.c (init_category_once, syms_of_category):
12307 * ccl.c (syms_of_ccl):
12308 * cmds.c (syms_of_cmds):
12309 * composite.c (syms_of_composite):
12310 * dbusbind.c (syms_of_dbusbind):
12311 * dired.c (syms_of_dired):
12312 * dispnew.c (syms_of_display):
12313 * doc.c (syms_of_doc):
12314 * editfns.c (syms_of_editfns):
12315 * emacs.c (syms_of_emacs):
12316 * eval.c (syms_of_eval):
12317 * fileio.c (syms_of_fileio):
12318 * fns.c (syms_of_fns):
12319 * frame.c (syms_of_frame):
12320 * fringe.c (syms_of_fringe):
12321 * insdel.c (syms_of_insdel):
12322 * keymap.c (syms_of_keymap):
12323 * lread.c (init_obarray, syms_of_lread):
12324 * macros.c (syms_of_macros):
12325 * msdos.c (syms_of_msdos):
12326 * print.c (syms_of_print):
12327 * process.c (syms_of_process):
12328 * search.c (syms_of_search):
12329 * sound.c (syms_of_sound):
12330 * syntax.c (init_syntax_once, syms_of_syntax):
12331 * terminal.c (syms_of_terminal):
12332 * textprop.c (syms_of_textprop):
12333 * undo.c (syms_of_undo):
12334 * w32.c (globals_of_w32):
12335 * window.c (syms_of_window):
12336 * xdisp.c (syms_of_xdisp):
12337 * xfaces.c (syms_of_xfaces):
12338 * xfns.c (syms_of_xfns):
12339 * xmenu.c (syms_of_xmenu):
12340 * xsettings.c (syms_of_xsettings):
12341 * xterm.c (syms_of_xterm): Use DEFSYM.
12342
12343 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12344
12345 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12346
12347 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12348
12349 Integer and buffer overflow fixes (Bug#8873).
12350
12351 * print.c (printchar, strout): Check for string overflow.
12352 (PRINTPREPARE, printchar, strout):
12353 Don't set size unless allocation succeeds.
12354
12355 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12356 for sizes. Check for string overflow more accurately.
12357 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12358
12359 * macros.c: Integer and buffer overflow fixes.
12360 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12361 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12362 Use ptrdiff_t, not int, for sizes.
12363 Don't increment bufsize until after realloc succeeds.
12364 Check for size-calculation overflow.
12365 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12366
12367 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12368
12369 * lread.c: Integer overflow fixes.
12370 (read_integer): Radix is now EMACS_INT, not int,
12371 to improve quality of diagnostics for out-of-range radices.
12372 Calculate buffer size correctly for out-of-range radices.
12373 (read1): Check for integer overflow in radices, and in
12374 read-circle numbers.
12375 (read_escape): Avoid int overflow.
12376 (Fload, openp, read_buffer_size, read1)
12377 (substitute_object_recurse, read_vector, read_list, map_obarray):
12378 Use ptrdiff_t, not int, for sizes.
12379 (read1): Use EMACS_INT, not int, for sizes.
12380 Check for size overflow.
12381
12382 * image.c (cache_image): Check for size arithmetic overflow.
12383
12384 * lread.c: Integer overflow issues.
12385 (saved_doc_string_size, saved_doc_string_length)
12386 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12387 Now ptrdiff_t, not int.
12388 (read1): Don't assume doc string length fits in int. Check for
12389 out-of-range doc string lengths.
12390 (read_list): Don't assume file position fits in int.
12391 (read_escape): Check for hex character overflow.
12392
12393 2011-06-22 Leo Liu <sdl.web@gmail.com>
12394
12395 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12396 Move to minibuffer.el.
12397
12398 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12399
12400 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12401 The following patches are for when GLYPH_DEBUG && !XASSERT.
12402 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12403 * dispnew.c (flush_stdout):
12404 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12405 Mark as externally visible.
12406 * dispnew.c (check_window_matrix_pointers): Now static.
12407 * dispnew.c (window_to_frame_vpos):
12408 * xfns.c (unwind_create_frame):
12409 * xterm.c (x_check_font): Remove unused local.
12410 * scroll.c (CHECK_BOUNDS):
12411 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12412 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12413 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12414 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12415 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12416 Now static.
12417 (debug_method_add): Use va_list and vsprintf rather than relying
12418 on undefined behavior with wrong number of arguments.
12419 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12420 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12421 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12422 since we're not interested in debugging glyphs with old libraries.
12423 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12424 GCC 4.6.0's static checking.
12425
12426 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12427
12428 Integer overflow and signedness fixes (Bug#8873).
12429 A few related buffer overrun fixes, too.
12430
12431 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12432
12433 * dispextern.h (struct face.stipple):
12434 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12435 (x_bitmap_mask, x_allocate_bitmap_record)
12436 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12437 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12438 (x_create_bitmap_from_xpm_data):
12439 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12440 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12441 (.bitmaps_last):
12442 * xfaces.c (load_pixmap):
12443 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12444 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12445 (.bitmaps_last, struct x_output.icon_bitmap):
12446 Use ptrdiff_t, not int, for bitmap indexes.
12447 (x_allocate_bitmap_record): Check for size overflow.
12448 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12449
12450 Use ptrdiff_t, not int, for overlay counts.
12451 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12452 * editfns.c (overlays_around, get_pos_property):
12453 * textprop.c (get_char_property_and_overlay):
12454 * xdisp.c (next_overlay_change, note_mouse_highlight):
12455 * xfaces.c (face_at_buffer_position):
12456 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12457 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12458 (Fnext_overlay_change, Fprevious_overlay_change)
12459 (mouse_face_overlay_overlaps, Foverlays_in):
12460 Use ptrdiff_t, not int, for sizes.
12461 (overlays_at, overlays_in): Check for size-calculation overflow.
12462
12463 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12464
12465 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12466 (x_session_initialize): Do not assume string length fits in int.
12467
12468 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12469 This is unlikely, but can occur if DPI is outlandish.
12470
12471 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12472 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12473
12474 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12475 * xrdb.c (magic_file_p, search_magic_path):
12476 Omit last arg SUFFIX; it was always 0. All callers changed.
12477 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12478
12479 * xfont.c (xfont_match): Avoid need for strlen.
12480
12481 * xfns.c: Don't assume strlen fits in int.
12482 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12483
12484 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12485 not unsigned long, as we prefer signed integers. All callers changed.
12486 Detect integer overflow in repeat count.
12487 (message_dolog): Don't assume print length fits in 39 bytes.
12488 (display_mode_element): Don't assume strlen fits in int.
12489
12490 * termcap.c: Don't assume sizes fit in int and never overflow.
12491 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12492 (gobble_line): Check for size-calculation overflow.
12493
12494 * minibuf.c (Fread_buffer):
12495 * lread.c (intern, intern_c_string):
12496 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12497 Don't assume string length fits in int.
12498
12499 * keyboard.c (parse_tool_bar_item):
12500 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12501
12502 * font.c: Don't assume string length fits in int.
12503 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12504 Use ptrdiff_t, not int.
12505 (font_intern_prop): Don't assume string length fits in int.
12506 Don't assume integer property fits in fixnum.
12507 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12508
12509 * filelock.c: Fix some buffer overrun and integer overflow issues.
12510 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12511 Reformulate so as not to need the command string.
12512 Invoke gzip -cd rather than gunzip, as it's more portable.
12513 (lock_info_type, lock_file_1, lock_file):
12514 Don't assume pid_t and time_t fit in unsigned long.
12515 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12516 (current_lock_owner): Prefer signed type for sizes.
12517 Use memcpy, not strncpy, where memcpy is what is really wanted.
12518 Don't assume (via atoi) that time_t and pid_t fit in int.
12519 Check for time_t and/or pid_t out of range, e.g., via a network share.
12520 Don't alloca where an auto var works fine.
12521
12522 * fileio.c: Fix some integer overflow issues.
12523 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12524 Don't assume string length fits in int.
12525 (directory_file_name): Don't assume string length fits in long.
12526 (make_temp_name): Don't assume pid fits in int, or that its print
12527 length is less than 20.
12528
12529 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12530
12531 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12532
12533 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12534
12535 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12536 We prefer signed integers, even for size calculations.
12537
12538 * emacs.c: Don't assume string length fits in 'int'.
12539 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12540 (main): Don't invoke strlen when not needed.
12541
12542 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12543 (XD_DEBUG_MESSAGE): Don't waste a byte.
12544
12545 * callproc.c (getenv_internal_1, getenv_internal)
12546 (Fgetenv_internal):
12547 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12548
12549 * lread.c (invalid_syntax): Omit length argument.
12550 All uses changed. This doesn't fix a bug, but it simplifies the
12551 code away from its former Hollerith-constant appearance, and it's
12552 one less 'int' to worry about when looking at integer-overflow issues.
12553 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12554
12555 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12556 This didn't break anything, but it didn't help either.
12557 It's confusing to put a bogus integer in a place where the actual
12558 value does not matter.
12559 (LIST_END_P): Remove unused macro and its bogus comment.
12560 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12561
12562 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12563 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12564 implementation.
12565 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12566 We prefer signed types, and the value cannot exceed the EMACS_INT
12567 range anyway (because otherwise the length would not be representable).
12568 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12569 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12570 This avoids a GCC warning when WIDE_EMACS_INT.
12571
12572 * indent.c (sane_tab_width): New function.
12573 (current_column, scan_for_column, Findent_to, position_indentation)
12574 (compute_motion): Use it. This is just for clarity.
12575 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12576
12577 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12578
12579 * lisp.h (lint_assume): New macro.
12580 * composite.c (composition_gstring_put_cache):
12581 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12582
12583 * editfns.c, insdel.c:
12584 Omit unnecessary forward decls, to simplify future changes.
12585
12586 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12587
12588 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12589
12590 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12591 Use much-faster test for byte-length change.
12592 Don't assume string byte-length fits in 'int'.
12593 Check that character arg fits in 'int'.
12594 (mapcar1): Declare byte as byte, for clarity.
12595
12596 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12597
12598 * fns.c (concat): Catch string overflow earlier.
12599 Do not rely on integer wraparound.
12600
12601 * dispextern.h (struct it.overlay_strings_charpos)
12602 (struct it.selective): Now EMACS_INT, not int.
12603 * xdisp.c (forward_to_next_line_start)
12604 (back_to_previous_visible_line_start)
12605 (reseat_at_next_visible_line_start, next_element_from_buffer):
12606 Don't arbitrarily truncate the value of 'selective' to int.
12607
12608 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12609
12610 * composite.c: Don't truncate sizes to 'int'.
12611 (composition_gstring_p, composition_reseat_it)
12612 (composition_adjust_point): Use EMACS_INT, not int.
12613 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12614 not EMACS_UINT, for indexes.
12615
12616 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12617
12618 * buffer.c: Include <verify.h>.
12619 (struct sortvec.priority, struct sortstr.priority):
12620 Now EMACS_INT, not int.
12621 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12622 (struct sortstr.size, record_overlay_string)
12623 (struct sortstrlist.size, struct sortlist.used):
12624 Don't truncate size to int.
12625 (record_overlay_string): Check for size-calculation overflow.
12626 (init_buffer_once): Check at compile-time, not run-time.
12627
12628 2011-06-22 Jim Meyering <meyering@redhat.com>
12629
12630 Don't leak an XBM-image-sized buffer
12631 * image.c (xbm_load): Free the image buffer after using it.
12632
12633 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12634
12635 Port to Sun C.
12636 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12637 that Sun C diagnosed.
12638 * fns.c (secure_hash): Fix pointer signedness issue.
12639 * intervals.c (static_offset_intervals): New function.
12640 (offset_intervals): Use it.
12641
12642 2011-06-21 Leo Liu <sdl.web@gmail.com>
12643
12644 * deps.mk (fns.o):
12645 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12646 sha512.h.
12647
12648 * fns.c (secure_hash): Rename from crypto_hash_function and change
12649 the first arg to accept symbols.
12650 (Fsecure_hash): New primitive.
12651 (syms_of_fns): New symbols.
12652
12653 2011-06-20 Deniz Dogan <deniz@dogan.se>
12654
12655 * process.c (Fset_process_buffer): Clarify return value in
12656 docstring.
12657
12658 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12659
12660 * dispnew.c (add_window_display_history): Use BVAR.
12661
12662 * xdisp.c (debug_method_add): Use BVAR.
12663 (check_window_end, dump_glyph_matrix, dump_glyph)
12664 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12665
12666 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12667 Likewise.
12668
12669 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12670 check till after the cache is created in init_frame_faces.
12671
12672 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12673
12674 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12675
12676 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12677
12678 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12679 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12680 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12681
12682 Improve buffer-overflow checking (Bug#8873).
12683 * fileio.c (Finsert_file_contents):
12684 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12685 Remove the old (too-loose) buffer overflow checks.
12686 They weren't needed, since make_gap checks for buffer overflow.
12687 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12688 The old code merely checked for Emacs fixnum overflow, and relied
12689 on undefined (wraparound) behavior. The new code avoids undefined
12690 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12691
12692 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12693 Tune. Don't use wider integers than needed. Don't use alloca.
12694 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12695
12696 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12697
12698 * insdel.c, lisp.h (buffer_overflow): New function.
12699 (insert_from_buffer_1, replace_range, replace_range_2):
12700 * insdel.c (make_gap_larger):
12701 * editfns.c (Finsert_char):
12702 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12703
12704 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12705
12706 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12707
12708 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12709
12710 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12711 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12712
12713 * fileio.c: Don't assume EMACS_INT fits in off_t.
12714 (emacs_lseek): New static function.
12715 (Finsert_file_contents, Fwrite_region): Use it.
12716 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12717
12718 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12719
12720 * fns.c: Don't overflow int when computing a list length.
12721 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12722 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12723 truncation on 64-bit hosts. Check for QUIT every
12724 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12725 faster and is responsive enough.
12726 (Flength): Report an error instead of overflowing an integer.
12727 (Fsafe_length): Return a float if the value is not representable
12728 as a fixnum. This shouldn't happen except in contrived situations.
12729 (Fnthcdr, Fsort): Don't assume list length fits in int.
12730 (Fcopy_sequence): Don't assume vector length fits in int.
12731
12732 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12733 (header_size, word_size): New constants.
12734 (allocate_vectorlike): Don't check size overflow here.
12735 (allocate_vector): Check it here instead, since this is the only
12736 caller of allocate_vectorlike that could cause overflow.
12737 Check that the new vector's length is representable as a fixnum.
12738
12739 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12740 The previous code was bogus. For example, next_almost_prime (32)
12741 returned 39, which is undesirable as it is a multiple of 3; and
12742 next_almost_prime (24) returned 25, which is a multiple of 5 so
12743 why was the code bothering to check for multiples of 7?
12744
12745 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12746
12747 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12748
12749 Variadic C functions now count arguments with ptrdiff_t.
12750 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12751 Back then I didn't know that the Emacs coding style prefers signed int.
12752 Also, in the meantime I found a few more instances where arguments
12753 were being counted with int, which may truncate counts on 64-bit
12754 machines, or EMACS_INT, which may be unnecessarily wide.
12755 * lisp.h (struct Lisp_Subr.function.aMANY)
12756 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12757 Arg counts are now ptrdiff_t, not size_t.
12758 All variadic functions and their callers changed accordingly.
12759 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12760 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12761 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12762 * callint.c (Fcall_interactively): Check arg count for overflow,
12763 to avoid potential buffer overrun. Use signed char, not 'int',
12764 for 'varies' array, so that we needn't bother to check its size
12765 calculation for overflow.
12766 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12767 * eval.c (apply_lambda):
12768 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12769 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12770 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12771
12772 * callint.c (Fcall_interactively): Don't use index var as event count.
12773
12774 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12775 * mem-limits.h (SIZE): Remove; no longer used.
12776
12777 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12778
12779 Remove unnecessary casts.
12780 * xterm.c (x_term_init):
12781 * xfns.c (x_set_border_pixel):
12782 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12783 These aren't needed now that we assume ANSI C.
12784
12785 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12786 It's more likely to cause problems (due to unsigned overflow)
12787 than to cure them.
12788
12789 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12790
12791 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12792
12793 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12794
12795 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12796
12797 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12798
12799 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12800
12801 GLYPH_CODE_FACE returns EMACS_INT, not int.
12802 * dispextern.h (merge_faces):
12803 * xfaces.c (merge_faces):
12804 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12805 Don't assume EMACS_INT fits in int.
12806
12807 * character.h (CHAR_VALID_P): Remove unused parameter.
12808 * fontset.c, lisp.h, xdisp.c: All uses changed.
12809
12810 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12811
12812 * fns.c (concat): Minor tuning based on overflow analysis.
12813 This doesn't fix any bugs. Use int to hold character, instead
12814 of constantly refetching from Emacs object. Use XFASTINT, not
12815 XINT, for value known to be a character. Don't bother comparing
12816 a single byte to 0400, as it's always less.
12817
12818 * floatfns.c (Fexpt):
12819 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12820
12821 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12822 for characters.
12823
12824 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12825
12826 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12827 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12828 incorrectly succeed when S was a string, because 4294967386 was
12829 truncated before it was used.
12830
12831 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12832 Otherwise, an out-of-range integer could cause undefined behavior
12833 on a 64-bit host.
12834
12835 * composite.c: Use int, not EMACS_INT, for characters.
12836 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12837 EMACS_INT, for values that are known to be in character range.
12838 This doesn't fix any bugs but is the usual style inside Emacs and
12839 may generate better code on 32-bit machines.
12840
12841 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12842 This is for reasons similar to the recent CHAR_STRING fix.
12843 * charset.c (Fencode_char): Check that character arg is actually
12844 a character. Pass an int to ENCODE_CHAR.
12845 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12846 wider than 'int', as a compile-time check to prevent future regressions
12847 in this area.
12848
12849 * character.c (char_string): Remove unnecessary casts.
12850
12851 Make sure a 64-bit char is never passed to CHAR_STRING.
12852 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12853 by silently ignoring the top 32 bits, allowing some values
12854 that were far too large to be valid characters.
12855 * character.h: Include <verify.h>.
12856 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12857 arguments are no wider than unsigned, as a compile-time check
12858 to prevent future regressions in this area.
12859 * data.c (Faset):
12860 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12861 (Fsubst_char_in_region):
12862 * fns.c (concat):
12863 * xdisp.c (decode_mode_spec_coding):
12864 Adjust to CHAR_STRING's new requirement.
12865 * editfns.c (Finsert_char, Fsubst_char_in_region):
12866 * fns.c (concat): Check that character args are actually
12867 characters. Without this test, these functions did the wrong
12868 thing with wildly out-of-range values on 64-bit hosts.
12869
12870 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12871 These casts should not be needed on 32-bit hosts, either.
12872 * keyboard.c (read_char):
12873 * lread.c (Fload): Remove casts to unsigned.
12874
12875 * lisp.h (UNSIGNED_CMP): New macro.
12876 This fixes comparison bugs on 64-bit hosts.
12877 (ASCII_CHAR_P): Use it.
12878 * casefiddle.c (casify_object):
12879 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
12880 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
12881 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
12882 * dispextern.h (FACE_FROM_ID):
12883 * keyboard.c (read_char): Use UNSIGNED_CMP.
12884
12885 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
12886 not to EMACS_INT, to avoid GCC warning.
12887
12888 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
12889
12890 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
12891 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
12892 isn't needed on 32-bit machines.
12893
12894 * buffer.c (Fgenerate_new_buffer_name):
12895 Use EMACS_INT for count, not int.
12896 (advance_to_char_boundary): Return EMACS_INT, not int.
12897
12898 * data.c (Qcompiled_function): Now static.
12899
12900 * window.c (window_body_lines): Now static.
12901
12902 * image.c (gif_load): Rename local to avoid shadowing.
12903
12904 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
12905 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
12906 * alloc.c (make_save_value): Integer argument is now of type
12907 ptrdiff_t, not int.
12908 (mark_object): Use ptrdiff_t, not int.
12909 * lisp.h (pD): New macro.
12910 * print.c (print_object): Use it.
12911
12912 * alloc.c: Use EMACS_INT, not int, to count objects.
12913 (total_conses, total_markers, total_symbols, total_vector_size)
12914 (total_free_conses, total_free_markers, total_free_symbols)
12915 (total_free_floats, total_floats, total_free_intervals)
12916 (total_intervals, total_strings, total_free_strings):
12917 Now EMACS_INT, not int. All uses changed.
12918 (Fgarbage_collect): Compute overall total using a double, so that
12919 integer overflow is less likely to be a problem. Check for overflow
12920 when converting back to an integer.
12921 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
12922 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
12923 These were 'int' variables that could overflow on 64-bit hosts;
12924 they were never used, so remove them instead of repairing them.
12925 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
12926 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
12927 Previously, this ceilinged at INT_MAX, but that doesn't work on
12928 64-bit machines.
12929 (allocate_pseudovector): Don't use EMACS_INT when int would do.
12930
12931 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
12932 (allocate_vectorlike): Check for ptrdiff_t overflow.
12933 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
12934 when a (possibly-narrower) signed value would do just as well.
12935 We prefer using signed arithmetic, to avoid comparison confusion.
12936
12937 * alloc.c: Catch some string size overflows that we were missing.
12938 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
12939 for convenience in STRING_BYTES_MAX.
12940 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
12941 The definition here is exact; the one in lisp.h was approximate.
12942 (allocate_string_data): Check for string overflow. This catches
12943 some instances we weren't catching before. Also, it catches
12944 size_t overflow on (unusual) hosts where SIZE_MAX <= min
12945 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
12946 and ptrdiff_t and EMACS_INT are both 64 bits.
12947
12948 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
12949 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
12950 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
12951
12952 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12953
12954 * alloc.c (Fmake_string): Check for out-of-range init.
12955
12956 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12957
12958 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12959
12960 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12961
12962 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12963 xg_get_default_scrollbar_width.
12964
12965 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12966 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12967 (style_changed_cb): Call update_theme_scrollbar_width and call
12968 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12969 all frames (Bug#8505).
12970 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12971 Call gtk_window_set_resizable if HAVE_GTK3.
12972 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12973 and height if HAVE_GTK3 (Bug#8505).
12974 (scroll_bar_width_for_theme): New variable.
12975 (update_theme_scrollbar_width): New function.
12976 (xg_get_default_scrollbar_width): Move code to
12977 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12978 (xg_initialize): Call update_theme_scrollbar_width.
12979
12980 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12981
12982 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12983
12984 2011-06-12 Martin Rudalics <rudalics@gmx.at>
12985
12986 * frame.c (make_frame): Call other_buffer_safely instead of
12987 other_buffer.
12988
12989 * window.c (temp_output_buffer_show): Call display_buffer with
12990 second argument Vtemp_buffer_show_specifiers and reset latter
12991 immediately after the call.
12992 (Vtemp_buffer_show_specifiers): New variable.
12993 (auto_window_vscroll_p, next_screen_context_lines)
12994 (Vscroll_preserve_screen_position): Remove leading asterisks from
12995 doc-strings.
12996
12997 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
12998
12999 Fix minor problems found by GCC 4.6.0 static checking.
13000 * buffer.c (Qclone_number): Remove for now, as it's unused.
13001 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13002 (record_buffer): Remove unused local.
13003 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13004 (set_frame_buffer_list): Remove; unused.
13005 * frame.h (other_visible_frames): Remove decl.
13006 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13007 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13008 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13009 if HAVE_GPM.
13010 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13011 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13012 Define only if HAVE_GPM.
13013 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13014 (update_hints_inhibit): Remove; never set. All uses removed.
13015 * widgetprv.h (emacsFrameClassRec): Remove decl.
13016 * window.c (delete_deletable_window): Now returns void, since it
13017 wasn't returning anything.
13018 (compare_window_configurations): Remove unused locals.
13019 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13020 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13021 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13022 the same widths as pointers. This follows up on the 2011-05-06 patch.
13023 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13024 * xterm.h: Likewise.
13025 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13026
13027 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13028
13029 * makefile.w32-in: Update dependencies.
13030 (LISP_H): Add lib/intprops.h.
13031
13032 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13033
13034 * image.c (gif_load): Add animation frame delay to the metadata.
13035 (syms_of_image): Use DEFSYM. New symbol `delay'.
13036
13037 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13038
13039 * window.c (delete_deletable_window): Re-add.
13040 (Fset_window_configuration): Rewrite to handle dead buffers and
13041 consequently deletable windows.
13042 (window_tree, Fwindow_tree): Remove. Supply functionality in
13043 window.el.
13044 (compare_window_configurations): Simplify code.
13045
13046 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13047
13048 * image.c (imagemagick_load_image): Fix type mismatch.
13049 (Fimagemagick_types): Likewise.
13050
13051 * window.h (replace_buffer_in_windows): Declare.
13052
13053 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13054
13055 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13056 Qclone_number. Remove external declaration of Qdelete_window.
13057 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13058 code.
13059 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13060 Run Qbuffer_list_update_hook if allowed.
13061 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13062 buffer list implementation.
13063 (other_buffer_safely): New function.
13064 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13065 calls to replace_buffer_in_windows and
13066 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13067 if allowed.
13068 (record_buffer): Inhibit quitting and rewrite using quittable
13069 functions. Run Qbuffer_list_update_hook if allowed.
13070 (Frecord_buffer, Funrecord_buffer): New functions.
13071 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13072 Move switch-to-buffer to window.el.
13073 (bury-buffer): Move to window.el.
13074 (Vbuffer_list_update_hook): New variable.
13075
13076 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13077 section.
13078
13079 * window.h (resize_frame_windows): Move up in code.
13080 (Fwindow_frame): Remove EXFUN.
13081 (replace_buffer_in_all_windows): Remove prototype.
13082 (replace_buffer_in_windows_safely): Add prototype.
13083
13084 * window.c: Declare Qdelete_window static again. Move down
13085 declaration of select_count.
13086 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13087 (Fother_window): Move to window.el.
13088 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13089 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13090 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13091 window.el.
13092 (replace_buffer_in_windows): Implement by calling
13093 Qreplace_buffer_in_windows.
13094 (replace_buffer_in_all_windows): Remove with some functionality
13095 moved into replace_buffer_in_windows_safely.
13096 (replace_buffer_in_windows_safely): New function.
13097 (select_window_norecord, select_frame_norecord): Move in front
13098 of run_window_configuration_change_hook. Remove now obsolete
13099 declarations.
13100 (Fset_window_buffer): Rewrite doc-string.
13101 Call Qrecord_window_buffer.
13102 (keys_of_window): Move binding for other-window to window.el.
13103
13104 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13105
13106 * dispextern.h (struct image): Replace data member, whose int_val
13107 and ptr_val fields were not used by anything, with a single
13108 lisp_val object.
13109
13110 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13111 (gif_clear_image, gif_load, imagemagick_load_image)
13112 (gs_clear_image, gs_load): Callers changed.
13113
13114 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13115
13116 * buffer.h: Include <time.h>, for time_t.
13117 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13118
13119 Fix minor problems found by static checking.
13120
13121 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13122
13123 Make identifiers static if they are not used in other modules.
13124 * data.c (Qcompiled_function, Qframe, Qvector):
13125 * image.c (QimageMagick, Qsvg):
13126 * minibuf.c (Qmetadata):
13127 * window.c (resize_window_check, resize_root_window): Now static.
13128 * window.h (resize_window_check, resize_root_window): Remove decls.
13129
13130 * window.c (window_deletion_count, delete_deletable_window):
13131 Remove; unused.
13132 (window_body_lines): Now static.
13133 (Fdelete_other_windows_internal): Mark vars as initialized.
13134 Make sure 'resize_failed' is initialized.
13135 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13136 (resize_window_apply): Remove unused local.
13137 * window.h (delete_deletable_window): Remove decl.
13138
13139 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13140 (imagemagick_load_image): Fix pointer signedness problem by changing
13141 last arg from unsigned char * to char *. All uses changed.
13142 Also, fix a local for similar reasons.
13143 Remove unused locals. Remove locals to avoid shadowing.
13144 (fn_rsvg_handle_free): Remove; unused.
13145 (svg_load, svg_load_image): Fix pointer signedness problem.
13146 (imagemagick_load_image): Don't use garbage pointer image_wand.
13147
13148 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13149
13150 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13151
13152 * image.c (gif_load): Fix omitted cast error introduced by
13153 2011-06-06 change.
13154
13155 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13156
13157 * window.h (resize_proportionally, orig_total_lines)
13158 (orig_top_line): Remove from window structure.
13159 (set_window_height, set_window_width, change_window_heights)
13160 (Fdelete_window): Remove prototypes.
13161 (resize_frame_windows): Remove duplicate declaration.
13162
13163 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13164
13165 * window.h (resize_frame_windows, resize_window_check)
13166 (delete_deletable_window, resize_root_window)
13167 (resize_frame_windows): Declare prototypes.
13168
13169 * window.c (resize_window_apply): Make definition be "static" to
13170 match the prototype.
13171
13172 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13173
13174 * window.c: Remove declarations of Qwindow_size_fixed,
13175 window_min_size_1, window_min_size_2, window_min_size,
13176 size_window, window_fixed_size_p, enlarge_window, delete_window.
13177 Remove static from declaration of Qdelete_window, it's
13178 temporarily needed by Fbury_buffer.
13179 (replace_window): Don't assign orig_top_line and
13180 orig_total_lines.
13181 (Fdelete_window, delete_window): Remove. Window deletion is
13182 handled by window.el.
13183 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13184 Replace Fdelete_window calls with calls to Qdelete_window.
13185 (Fdelete_other_windows): Remove. Deleting other windows is
13186 handled by window.el.
13187 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13188 handled in window.el.
13189 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13190 Window minimum sizes are handled in window.el.
13191 (shrink_windows, size_window, set_window_height)
13192 (set_window_width, change_window_heights, window_height)
13193 (window_width, CURBEG, CURSIZE, enlarge_window)
13194 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13195 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13196 handled in window.el.
13197 (make_dummy_parent): Rename to make_parent_window and give it a
13198 second argument horflag.
13199 (make_window): Don't set resize_proportionally any more.
13200 (Fsplit_window): Remove. Windows are split in window.el.
13201 (save_restore_action, save_restore_orig_size)
13202 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13203 Resize mini windows in window.el.
13204 (grow_mini_window, shrink_mini_window): Implement by calling
13205 Qresize_root_window_vertically, resize_window_check and
13206 resize_window_apply.
13207 (saved_window, Fset_window_configuration, save_window_save):
13208 Do not handle orig_top_line, orig_total_lines, and
13209 resize_proportionally.
13210 (window_min_height, window_min_width): Move to window.el.
13211 (keys_of_window): Move bindings for delete-other-windows,
13212 split-window, delete-window and enlarge-window to window.el.
13213
13214 * buffer.c: Temporarily extern Qdelete_window.
13215 (Fbury_buffer): Temporarily call Qdelete_window instead of
13216 Fdelete_window (Fbury_buffer will move to window.el soon).
13217
13218 * frame.c (set_menu_bar_lines_1): Remove code handling
13219 orig_top_line and orig_total_lines.
13220
13221 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13222 set_window_height but set heights directly.
13223 (change_frame_size_1): Use resize_frame_windows.
13224
13225 * xdisp.c (init_xdisp): Don't use set_window_height but set
13226 heights directly.
13227
13228 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13229 Use resize_frame_windows instead of change_window_heights and run
13230 run_window_configuration_change_hook.
13231
13232 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13233 instead of change_window_heights and run
13234 run_window_configuration_change_hook.
13235
13236 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13237
13238 * window.c (replace_window): Rename second argument REPLACEMENT to
13239 NEW. New third argument SETFLAG. Rewrite.
13240 (delete_window, make_dummy_parent): Call replace_window with
13241 third argument 1.
13242 (window_list_1): Move down in code.
13243 (run_window_configuration_change_hook): Move set_buffer part
13244 before select_frame_norecord part in order to unwind correctly.
13245 Rename count1 to count.
13246 (recombine_windows, delete_deletable_window, resize_root_window)
13247 (Fdelete_other_windows_internal)
13248 (Frun_window_configuration_change_hook, make_parent_window)
13249 (resize_window_check, resize_window_apply, Fresize_window_apply)
13250 (resize_frame_windows, Fsplit_window_internal)
13251 (Fdelete_window_internal, Fresize_mini_window_internal):
13252 New functions.
13253 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13254
13255 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13256
13257 * window.h (window): Add some new members to window structure -
13258 normal_lines, normal_cols, new_total, new_normal, clone_number,
13259 splits, nest, prev_buffers, next_buffers.
13260 (WINDOW_TOTAL_SIZE): Move here from window.c.
13261 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13262
13263 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13264 Remove.
13265 (make_dummy_parent): Set new members of windows structure.
13266 (make_window): Move down in code. Handle new members of window
13267 structure.
13268 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13269 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13270 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13271 (Fset_window_prev_buffers, Fwindow_next_buffers)
13272 (Fset_window_next_buffers, Fset_window_clone_number):
13273 New functions.
13274 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13275 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13276 Doc-string fixes.
13277 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13278 Argument WINDOW can be now internal window too.
13279 (Fwindow_use_time): Move up in code.
13280 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13281 Rewrite doc-string.
13282 (Fset_window_configuration, saved_window)
13283 (Fcurrent_window_configuration, save_window_save): Handle new
13284 members of window structure.
13285 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13286 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13287 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13288 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13289 Qget_mru_window, Qresize_root_window,
13290 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13291 Qauto_buffer_name; staticpro them.
13292
13293 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13294
13295 * window.c (Fwindow_total_size, Fwindow_left_column)
13296 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13297 (Fwindow_list_1): New functions.
13298 (window_box_text_cols): Replace with window_body_cols.
13299 (Fwindow_width, Fscroll_left, Fscroll_right):
13300 Use window_body_cols instead of window_box_text_cols.
13301 (delete_window, Fset_window_configuration):
13302 Call delete_all_subwindows with window as argument.
13303 (delete_all_subwindows): Take a window as argument and not a
13304 structure. Rewrite.
13305 (window_loop): Remove handling of GET_LRU_WINDOW and
13306 GET_LARGEST_WINDOW.
13307 (Fget_lru_window, Fget_largest_window): Move to window.el.
13308
13309 * window.h: Extern window_body_cols instead of
13310 window_box_text_cols. delete_all_subwindows now takes a
13311 Lisp_Object as argument.
13312
13313 * indent.c (compute_motion, Fcompute_motion):
13314 Use window_body_cols instead of window_box_text_cols.
13315
13316 * frame.c (delete_frame): Call delete_all_subwindows with root
13317 window as argument.
13318
13319 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13320
13321 * fns.c (Fputhash): Document return value.
13322
13323 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13324
13325 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13326
13327 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13328
13329 Cons<->int and similar integer overflow fixes (Bug#8794).
13330
13331 Check for overflow when converting integer to cons and back.
13332 * charset.c (Fdefine_charset_internal, Fdecode_char):
13333 Use cons_to_unsigned to catch overflow.
13334 (Fencode_char): Use INTEGER_TO_CONS.
13335 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13336 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13337 * data.c (long_to_cons, cons_to_long): Remove.
13338 (cons_to_unsigned, cons_to_signed): New functions.
13339 These signal an error for invalid or out-of-range values.
13340 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13341 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13342 * font.c (Ffont_variation_glyphs):
13343 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13344 * lisp.h: Include <intprops.h>.
13345 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13346 (cons_to_signed, cons_to_unsigned): New decls.
13347 (long_to_cons, cons_to_long): Remove decls.
13348 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13349 (Fprimitive_undo): Use CONS_TO_INTEGER.
13350 * xfns.c (Fx_window_property): Likewise.
13351 * xselect.c: Include <limits.h>.
13352 (x_own_selection, selection_data_to_lisp_data):
13353 Use INTEGER_TO_CONS.
13354 (x_handle_selection_request, x_handle_selection_clear)
13355 (x_get_foreign_selection, Fx_disown_selection_internal)
13356 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13357 (lisp_data_to_selection_data): Use cons_to_unsigned.
13358 (x_fill_property_data): Use cons_to_signed.
13359 Report values out of range.
13360
13361 Check for buffer and string overflow more precisely.
13362 * buffer.h (BUF_BYTES_MAX): New macro.
13363 * lisp.h (STRING_BYTES_MAX): New macro.
13364 * alloc.c (Fmake_string):
13365 * character.c (string_escape_byte8):
13366 * coding.c (coding_alloc_by_realloc):
13367 * doprnt.c (doprnt):
13368 * editfns.c (Fformat):
13369 * eval.c (verror):
13370 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13371 since they may not be the same number.
13372 * editfns.c (Finsert_char):
13373 * fileio.c (Finsert_file_contents):
13374 Likewise for BUF_BYTES_MAX.
13375
13376 * image.c: Use ptrdiff_t, not int, for sizes.
13377 (slurp_file): Switch from int to ptrdiff_t.
13378 All uses changed.
13379 (slurp_file): Check that file size fits in both size_t (for
13380 malloc) and ptrdiff_t (for sanity and safety).
13381
13382 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13383 if b->modtime has its maximal value.
13384
13385 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13386
13387 Don't assume time_t can fit into int.
13388 * buffer.h (struct buffer.modtime): Now time_t, not int.
13389 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13390 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13391
13392 Minor fixes for signed vs unsigned integers.
13393 * character.h (MAYBE_UNIFY_CHAR):
13394 * charset.c (maybe_unify_char):
13395 * keyboard.c (read_char, reorder_modifiers):
13396 XINT -> XFASTINT, since the integer must be nonnegative.
13397 * ftfont.c (ftfont_spec_pattern):
13398 * keymap.c (access_keymap, silly_event_symbol_error):
13399 XUINT -> XFASTINT, since the integer must be nonnegative.
13400 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13401 since it makes no difference and we prefer signed.
13402 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13403 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13404 nonnegative.
13405
13406 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13407
13408 * window.h (Fwindow_frame): Declare.
13409
13410 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13411
13412 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13413 (SPARE_MEMORY): Always define.
13414 (LARGE_REQUEST): Remove.
13415 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13416
13417 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13418
13419 * lisp.h: Move EXFUNS for Fframe_root_window,
13420 Fframe_first_window and Fset_frame_selected_window to window.h.
13421
13422 * window.h: Move EXFUNS for Fframe_root_window,
13423 Fframe_first_window and Fset_frame_selected_window here from
13424 lisp.h.
13425
13426 * frame.c (Fwindow_frame, Fframe_first_window)
13427 (Fframe_root_window, Fframe_selected_window)
13428 (Fset_frame_selected_window): Move to window.c.
13429 (Factive_minibuffer_window): Move to minibuf.c.
13430 (Fother_visible_frames_p): New function.
13431
13432 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13433
13434 * window.c (decode_window, decode_any_window): Move up in code.
13435 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13436 (inhibit_frame_unsplittable): Remove unused variable.
13437 (Fwindow_buffer): Move up and rewrite doc-string.
13438 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13439 (Fwindow_prev): New functions.
13440 (Fwindow_frame): Move here from frame.c. Accept any window as
13441 argument.
13442 (Fframe_root_window, Fframe_first_window)
13443 (Fframe_selected_window): Move here from frame.c. Accept frame
13444 or arbitrary window as argument. Update doc-strings.
13445 (Fminibuffer_window): Move up in code.
13446 (Fwindow_minibuffer_p): Move up in code and simplify.
13447 (Fset_frame_selected_window): Move here from frame.c.
13448 Marginal rewrite.
13449 (Fselected_window, select_window, Fselect_window): Move up in
13450 code. Minor doc-string fixes.
13451
13452 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13453
13454 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13455 Do not assume that spare memory exists; that assumption is valid
13456 only if SYSTEM_MALLOC.
13457 (LARGE_REQUEST): New macro, so that the issue of large requests
13458 is separated from the issue of spare memory.
13459
13460 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13461
13462 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13463 format. (Bug#8806)
13464
13465 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13466
13467 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13468 before statements.
13469
13470 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13471
13472 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13473
13474 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13475
13476 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13477 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13478
13479 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13480
13481 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13482
13483 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13484
13485 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13486 (x_clipboard_manager_save): Add return value.
13487 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13488 New error handlers.
13489 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13490 Obey Vx_select_enable_clipboard_manager. Catch errors in
13491 x_clipboard_manager_save (Bug#8779).
13492 (Vx_select_enable_clipboard_manager): New variable.
13493 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13494
13495 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13496
13497 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13498
13499 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13500
13501 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13502 in the current matrix if keep_current_p is non-zero.
13503
13504 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13505
13506 * bidi.c (bidi_level_of_next_char): Fix last change.
13507
13508 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13509
13510 Support bidi reordering of text covered by display properties.
13511
13512 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13513 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13514 (bidi_cache_search, bidi_cache_iterator_state)
13515 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13516 (bidi_level_of_next_char, bidi_move_to_visually_next):
13517 Support character positions inside a run of characters covered by a
13518 display string.
13519 (bidi_paragraph_init, bidi_resolve_explicit_1)
13520 (bidi_level_of_next_char): Call bidi_fetch_char and
13521 bidi_fetch_char_advance instead of FETCH_CHAR and
13522 FETCH_CHAR_ADVANCE.
13523 (bidi_init_it): Initialize new members.
13524 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13525 definitions.
13526 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13527 instead of using explicit *_CHAR codes.
13528 (bidi_resolve_explicit, bidi_resolve_weak):
13529 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13530 bidirectional text is supported only in multibyte buffers.
13531 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13532 it to initialize the frame_window_p member of struct bidi_it.
13533 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13534 (bidi_resolve_explicit, bidi_resolve_weak)
13535 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13536 bidi_it->nchars is non-positive.
13537 (bidi_level_of_next_char): Don't try to lookup the cache for the
13538 next/previous character if nothing is cached there yet, or if we
13539 were just reseat()'ed to a new position.
13540
13541 * xdisp.c (set_cursor_from_row): Set start and stop points
13542 according to the row's direction when priming the loop that looks
13543 for the glyph on which to display cursor.
13544 (single_display_spec_intangible_p): Function deleted.
13545 (display_prop_intangible_p): Reimplement to call
13546 handle_display_spec instead of single_display_spec_intangible_p.
13547 Accept 3 additional arguments needed by handle_display_spec.
13548 This fixes incorrect cursor motion across display property with complex
13549 values: lists, `(when COND...)' forms, etc.
13550 (single_display_spec_string_p): Support property values that are
13551 lists with the argument STRING its top-level element.
13552 (display_prop_string_p): Fix the condition for processing a
13553 property that is a list to be consistent with handle_display_spec.
13554 (handle_display_spec): New function, refactored from the
13555 last portion of handle_display_prop.
13556 (compute_display_string_pos): Accept additional argument
13557 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13558 value of a `display' property is a "replacing spec".
13559 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13560 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13561 the display property, but just return a value indicating whether
13562 the display property will replace the characters it covers.
13563 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13564 frame_window_p members of struct bidi_it.
13565 (compute_display_string_pos, compute_display_string_end):
13566 New functions.
13567 (push_it): Accept second argument POSITION, where pop_it should
13568 jump to continue iteration.
13569 (reseat_1): Initialize bidi_it.disp_pos.
13570
13571 * keyboard.c (adjust_point_for_property): Adjust the call to
13572 display_prop_intangible_p to its new signature.
13573
13574 * dispextern.h (struct bidi_it): New member frame_window_p.
13575 (bidi_init_it): Update prototypes.
13576 (display_prop_intangible_p): Update prototype.
13577 (compute_display_string_pos, compute_display_string_end):
13578 Declare prototypes.
13579 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13580 EMACS_INT.
13581
13582 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13583
13584 Malloc failure behavior now depends on size of allocation.
13585 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13586 * lisp.h: Change signatures accordingly.
13587 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13588 All callers changed. (Bug#8762)
13589
13590 * gnutls.c: Use Emacs's memory allocators.
13591 Without this change, the gnutls library would invoke malloc etc.
13592 directly, which causes problems on non-SYNC_INPUT hosts, and which
13593 runs afoul of improving memory_full behavior. (Bug#8761)
13594 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13595 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13596 xfree instead of the default malloc, realloc, free.
13597 (Fgnutls_boot): No need to check for memory allocation failure,
13598 since xmalloc does that for us.
13599
13600 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13601 * category.c (hash_get_category_set):
13602 * ccl.c (ccl_driver):
13603 * charset.c (Fdefine_charset_internal):
13604 * charset.h (struct charset.hash_index):
13605 * composite.c (get_composition_id, gstring_lookup_cache)
13606 (composition_gstring_put_cache):
13607 * composite.h (struct composition.hash_index):
13608 * dispextern.h (struct image.hash):
13609 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13610 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13611 (hashfn_equal, hashfn_user_defined, make_hash_table)
13612 (maybe_resize_hash_table, hash_lookup, hash_put)
13613 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13614 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13615 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13616 * image.c (make_image, search_image_cache, lookup_image)
13617 (xpm_put_color_table_h):
13618 * lisp.h (struct Lisp_Hash_Table):
13619 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13620 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13621 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13622 * alloc.c (allocate_vectorlike):
13623 Check for overflow in vector size calculations.
13624 * ccl.c (ccl_driver):
13625 Check for overflow when converting EMACS_INT to int.
13626 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13627 need to be updated by these changes.
13628 * fns.c (make_hash_table, maybe_resize_hash_table):
13629 Check for integer overflow with large hash tables.
13630 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13631 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13632 (SXHASH_REDUCE): New macro.
13633 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13634 Use it instead of discarding useful hash info with large hash values.
13635 (sxhash_float): New function.
13636 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13637 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13638 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13639 Rewrite to use FIXNUM_BITS, as this simplifies things.
13640 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13641 Adjust signatures to match updated version of code.
13642 (consing_since_gc): Now EMACS_INT, since a single hash table can
13643 use more than INT_MAX bytes.
13644
13645 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13646
13647 Make it possible to build with GCC-4.6+ -O2 -flto.
13648
13649 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13650
13651 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13652
13653 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13654 Call minibuffer-inactive-mode.
13655
13656 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13657
13658 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13659 Update dependencies.
13660
13661 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13662
13663 * data.c (init_data): Remove code for UTS, this system is not
13664 supported anymore.
13665
13666 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13667
13668 Don't force ./temacs to start in terminal mode.
13669
13670 * frame.c (make_initial_frame): Initialize faces in all cases, not
13671 only when CANNOT_DUMP is defined.
13672 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13673
13674 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13675
13676 * dispnew.c (add_window_display_history): Use const for the string
13677 pointer. Remove declaration, not needed.
13678
13679 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13680
13681 Use 'inline', not 'INLINE'.
13682 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13683 * alloc.c, fontset.c (INLINE): Remove.
13684 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13685 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13686 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13687 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13688 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13689
13690 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13691
13692 Make it possible to run ./temacs.
13693
13694 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13695 syms_of_callproc does the same thing. Remove test for
13696 "initialized", do it in the caller.
13697 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13698
13699 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13700
13701 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13702 (read_minibuf): Use get_minibuffer.
13703 (syms_of_minibuf): Use DEFSYM.
13704 (Qmetadata): New var.
13705 * data.c (Qbuffer): Don't make it static.
13706 (syms_of_data): Use DEFSYM.
13707
13708 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13709
13710 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13711 (CCL_CODE_MIN): New macro.
13712
13713 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13714
13715 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13716
13717 * eval.c (Qdebug): Now static.
13718 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13719 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13720 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13721
13722 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13723
13724 * image.c: Various fixes to ImageMagick code comments.
13725 (Fimagemagick_types): Doc fix.
13726
13727 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13728
13729 Minor fixes prompted by GCC 4.6.0 warnings.
13730
13731 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13732
13733 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13734 (x_clipboard_manager_save_all): Move extern decl to ...
13735 * xterm.h: ... here, so that it can be checked for consistency.
13736
13737 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13738
13739 * xselect.c (x_clipboard_manager_save_frame)
13740 (x_clipboard_manager_save_all): New functions.
13741 (Fx_clipboard_manager_save): Lisp function deleted.
13742
13743 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13744 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13745
13746 * xterm.h: Update prototype.
13747
13748 2011-05-28 William Xu <william.xwl@gmail.com>
13749
13750 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13751 exiting (Bug#8239).
13752
13753 2011-05-28 Jim Meyering <meyering@redhat.com>
13754
13755 Avoid a sign-extension bug in crypto_hash_function.
13756 * fns.c (to_uchar): Define.
13757 (crypto_hash_function): Use it to convert some newly-signed
13758 variables to unsigned, to avoid sign-extension bugs. For example,
13759 without this change, (md5 "truc") would evaluate to
13760 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13761 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13762 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13763
13764 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13765
13766 Integer overflow fixes.
13767
13768 * dbusbind.c: Serial number integer overflow fixes.
13769 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13770 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13771 to hold a serial number that is too large for a fixnum.
13772 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13773 Check for serial numbers out of range. Decode any serial number
13774 that was so large that it became a float. (Bug#8722)
13775
13776 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13777 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13778 Use XFASTINT rather than XUINT when numbers are nonnegative.
13779 (xd_append_arg, Fdbus_method_return_internal):
13780 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13781 arguments, check that Lisp number is nonnegative, rather than
13782 silently wrapping negative numbers around. (Bug#8722)
13783 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13784 (Bug#8722)
13785
13786 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13787
13788 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13789
13790 ccl: Add integer overflow checks.
13791 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13792 (IN_INT_RANGE): New macros.
13793 (ccl_driver): Use them to check for integer overflow when
13794 decoding a CCL program. Many of the new checks are whether XINT (x)
13795 fits in int; it doesn't always, on 64-bit hosts. The new version
13796 doesn't catch all possible integer overflows, but it's an
13797 improvement. (Bug#8719)
13798
13799 * alloc.c (make_event_array): Use XINT, not XUINT.
13800 There's no need for unsigned here.
13801
13802 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13803 This follows up to the 2011-05-06 change that substituted uintptr_t
13804 for EMACS_INT. This case wasn't caught back then.
13805
13806 Rework Fformat to avoid integer overflow issues.
13807 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13808 now (part of C89). Include <verify.h>.
13809 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13810 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13811 (Fformat): Avoid the prepass trying to compute sizes; it was only
13812 approximate and thus did not catch overflow reliably. Instead, walk
13813 through the format just once, formatting and computing sizes as we go,
13814 checking for integer overflow at every step, and allocating a larger
13815 buffer as needed. Keep track separately whether the format is
13816 multibyte. Keep only the most-recently calculated precision, rather
13817 than them all. Record whether each argument has been converted to
13818 string. Use EMACS_INT, not int, for byte and char and arg counts.
13819 Support field widths and precisions larger than INT_MAX. Avoid
13820 sprintf's undefined behavior with conversion specifications such as %#d
13821 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13822 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13823 formatting out-of-range floating point numbers with int
13824 formats. (Bug#8668)
13825
13826 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13827
13828 * data.c: Avoid integer truncation in expressions involving floats.
13829 * data.c: Include <intprops.h>.
13830 (arith_driver): When there's an integer overflow in an expression
13831 involving floating point, convert the integers to floating point
13832 so that the resulting value does not suffer from catastrophic
13833 integer truncation. For example, on a 64-bit host (* 4
13834 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13835 Do not rely on undefined behavior after integer overflow.
13836
13837 merge count_size_as_multibyte, parse_str_to_multibyte
13838 * character.c, character.h (count_size_as_multibyte):
13839 Rename from parse_str_to_multibyte; all uses changed.
13840 Check for integer overflow.
13841 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13842 since it's now a duplicate of the other. This is more of
13843 a character than a buffer op, so better that it's in character.c.
13844 * fns.c, print.c: Adjust to above changes.
13845
13846 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13847
13848 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13849
13850 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13851
13852 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13853 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13854 (x_clipboard_manager_save): Now static.
13855 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13856
13857 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13858 (crypto_hash_function): Now static.
13859 Fix pointer signedness problems. Avoid unnecessary initializations.
13860
13861 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13862
13863 * termhooks.h (Vselection_alist): Make it terminal-local.
13864
13865 * terminal.c (create_terminal): Initialize it.
13866
13867 * xselect.c: Support for clipboard managers.
13868 (Vselection_alist): Move to termhooks.h as terminal-local var.
13869 (LOCAL_SELECTION): New macro.
13870 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13871 (symbol_to_x_atom): Remove gratuitous arg.
13872 (x_handle_selection_request, lisp_data_to_selection_data)
13873 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13874 (x_own_selection, x_get_local_selection, x_convert_selection):
13875 New arg, specifying work frame. Use terminal-local Vselection_alist.
13876 (some_frame_on_display): Delete unused function.
13877 (Fx_own_selection_internal, Fx_get_selection_internal)
13878 (Fx_disown_selection_internal, Fx_selection_owner_p)
13879 (Fx_selection_exists_p): New optional frame arg.
13880 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
13881 (x_handle_selection_clear): Don't treat other terminals with the
13882 same keyboard specially. Use the terminal-local Vselection_alist.
13883 (x_clear_frame_selections): Use Frun_hook_with_args.
13884
13885 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
13886
13887 * xterm.h: Add support for those atoms.
13888
13889 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
13890
13891 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
13892 (converted_selections, conversion_fail_tag): New global variables.
13893 (x_selection_request_lisp_error): Free the above.
13894 (x_get_local_selection): Remove unnecessary code.
13895 (x_reply_selection_request): Args changed; handle arbitrary array
13896 of converted selections stored in converted_selections.
13897 Separate the XChangeProperty and SelectionNotify steps.
13898 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
13899 (x_convert_selection): New function.
13900 (x_handle_selection_event): Simplify.
13901 (x_get_foreign_selection): Don't ignore incoming requests while
13902 waiting for an answer; this will fail when we implement
13903 SAVE_TARGETS, and seems unnecessary anyway.
13904 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
13905 (Vx_sent_selection_functions): Doc fix.
13906
13907 2011-05-26 Leo Liu <sdl.web@gmail.com>
13908
13909 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
13910
13911 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13912
13913 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
13914
13915 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
13916 for fringe update if it has periodic bitmap.
13917 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
13918 and fringe_bitmap_periodic_p.
13919
13920 * fringe.c (get_fringe_bitmap_data): New function.
13921 (draw_fringe_bitmap_1, update_window_fringes): Use it.
13922 (update_window_fringes): Record periodicity of fringe bitmap in glyph
13923 row. Mark glyph row for fringe update if periodicity changed.
13924
13925 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
13926 for fringe update unless it has periodic bitmap.
13927
13928 2011-05-25 Kenichi Handa <handa@m17n.org>
13929
13930 * xdisp.c (get_next_display_element): Set correct it->face_id for
13931 a static composition.
13932
13933 2011-05-24 Leo Liu <sdl.web@gmail.com>
13934
13935 * deps.mk (fns.o):
13936 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
13937
13938 * fns.c (crypto_hash_function, Fsha1): New function.
13939 (Fmd5): Use crypto_hash_function.
13940 (syms_of_fns): Add Ssha1.
13941
13942 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13943
13944 * gnutls.c: Remove unused macros.
13945 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
13946 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
13947 Remove macros that are defined and never used.
13948 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
13949
13950 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13951
13952 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13953 (Fx_get_selection_internal): Minor cleanup.
13954 (Fx_own_selection_internal): Rename arguments for consistency with
13955 select.el.
13956
13957 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13958
13959 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13960
13961 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
13962
13963 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13964
13965 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13966
13967 * dispnew.c (scrolling_window): Don't exclude the case that the
13968 last enabled row in the desired matrix touches the bottom boundary.
13969
13970 2011-05-21 Glenn Morris <rgm@gnu.org>
13971
13972 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
13973 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13974 and add some more files.
13975
13976 2011-05-20 Eli Zaretskii <eliz@gnu.org>
13977
13978 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13979 report_file_error introduced by the change from 2011-05-07.
13980
13981 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13982
13983 * systime.h (Time): Define only if emacs is defined.
13984 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13985 where the include path doesn't have X11/X.h by default. See
13986 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13987
13988 2011-05-20 Kenichi Handa <handa@m17n.org>
13989
13990 * composite.c (find_automatic_composition): Fix previous change.
13991
13992 2011-05-20 Glenn Morris <rgm@gnu.org>
13993
13994 * lisp.mk: New file, split from Makefile.in.
13995 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13996 (shortlisp): Remove.
13997 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13998
13999 2011-05-19 Glenn Morris <rgm@gnu.org>
14000
14001 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14002 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14003 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14004 (lisp): Set the order to that of loadup.el.
14005 (shortlisp): Make it a copy of $lisp.
14006 (SOME_MACHINE_LISP): Remove.
14007 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14008 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14009
14010 2011-05-18 Kenichi Handa <handa@m17n.org>
14011
14012 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14013 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14014 (find_automatic_composition): Mostly rewrite for efficiency.
14015
14016 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14017
14018 * makefile.w32-in: Update dependencies.
14019
14020 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14021
14022 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14023 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14024
14025 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14026
14027 Fix some integer overflow issues, such as string length overflow.
14028
14029 * insdel.c (count_size_as_multibyte): Check for string overflow.
14030
14031 * character.c (lisp_string_width): Check for string overflow.
14032 Use EMACS_INT, not int, for string indexes and lengths; in
14033 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14034 the resulting string length overflows an EMACS_INT; instead,
14035 report a string overflow if no precision given. When checking for
14036 precision exhaustion, use a check that cannot possibly have
14037 integer overflow. (Bug#8675)
14038 * character.h (lisp_string_width): Adjust to new signature.
14039
14040 * alloc.c (string_overflow): New function.
14041 (Fmake_string): Use it. This doesn't change behavior, but saves
14042 a few bytes and will simplify future changes.
14043 * character.c (string_escape_byte8): Likewise.
14044 * lisp.h (string_overflow): New decl.
14045
14046 Fixups, following up to the user-interface timestamp change.
14047 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14048 for UI timestamps, instead of unsigned long.
14049 * msdos.c (mouse_get_pos): Likewise.
14050 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14051 * w32gui.h (Time): Define by including "systime.h" rather than by
14052 declaring it ourselves. (Bug#8664)
14053
14054 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14055 * image.c (clear_image_cache): Likewise.
14056
14057 * term.c (term_mouse_position): Don't assume time_t wraparound.
14058
14059 Be more systematic about user-interface timestamps.
14060 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14061 and sometimes 'EMACS_UINT', to represent these timestamps.
14062 This change causes it to use 'Time' uniformly, as that's what X uses.
14063 This makes the code easier to follow, and makes it easier to catch
14064 integer overflow bugs such as Bug#8664.
14065 * frame.c (Fmouse_position, Fmouse_pixel_position):
14066 Use Time, not unsigned long, for user-interface timestamps.
14067 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14068 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14069 * keyboard.h (last_event_timestamp): Likewise.
14070 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14071 * menu.h (xmenu_show): Likewise.
14072 * term.c (term_mouse_position): Likewise.
14073 * termhooks.h (struct input_event.timestamp): Likewise.
14074 (struct terminal.mouse_position_hook): Likewise.
14075 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14076 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14077 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14078 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14079 what it was before.
14080 * menu.h, termhooks.h: Include "systime.h", for Time.
14081
14082 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14083 Don't assume that the difference between two unsigned long values
14084 can fit into an integer. At this point, we know button_down_time
14085 <= event->timestamp, so the difference must be nonnegative, so
14086 there's no need to cast the result if double-click-time is
14087 nonnegative, as it should be; check that it's nonnegative, just in
14088 case. This bug is triggered when events are more than 2**31 ms
14089 apart (about 25 days). (Bug#8664)
14090
14091 * xselect.c (last_event_timestamp): Remove duplicate decl.
14092 (x_own_selection): Remove needless cast to unsigned long.
14093
14094 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14095 that always fit in int. Use a sentinel instead of a counter, to
14096 avoid a temp and to allay GCC's concerns about possible int overflow.
14097 * frame.h (struct frame): Use int for menu_bar_items_used
14098 instead of EMACS_INT, since it always fits in int.
14099
14100 * menu.c (grow_menu_items): Check for int overflow.
14101
14102 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14103
14104 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14105 Before, the code was not consistent. These values cannot exceed
14106 2**31 - 1 so there's no need to make them unsigned.
14107 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14108 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14109 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14110 as modifiers.
14111 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14112
14113 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14114 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14115 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14116 presumably because the widths might not match.
14117
14118 * window.c (size_window): Avoid needless test at loop start.
14119
14120 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14121
14122 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14123
14124 2011-05-12 Drew Adams <drew.adams@oracle.com>
14125
14126 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14127
14128 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14129
14130 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14131 `width' to `bar_area_x' and `bar_area_width', respectively.
14132 (x_scroll_run): Take account of fringe background extension.
14133
14134 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14135 Rename local vars `left' and `width' to `bar_area_x' and
14136 `bar_area_width', respectively.
14137 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14138 background extension.
14139
14140 2011-05-10 Jim Meyering <meyering@redhat.com>
14141
14142 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14143
14144 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14145
14146 * image.c (Finit_image_library): Return t for built-in image types,
14147 like pbm and xbm. (Bug#8640)
14148
14149 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14150
14151 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14152
14153 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14154
14155 * w32console.c (Fset_screen_color): Doc fix.
14156 (Fget_screen_color): New function.
14157 (syms_of_ntterm): Defsubr it.
14158
14159 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14160 unlink the temporary file if Fcall_process didn't create it in the
14161 first place.
14162 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14163 child process will be redirected to a file specified with `:file'.
14164 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14165 cue to call_process_cleanup not to close that handle.
14166
14167 2011-05-07 Ben Key <bkey76@gmail.com>
14168
14169 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14170 one of two shell specific rules, either bootstrap-temacs-CMD or
14171 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14172 to the previous implementation of the bootstrap-temacs rule.
14173 The bootstrap-temacs-CMD rule is similar to the previous
14174 implementation of the bootstrap-temacs rule except that it
14175 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14176 variable.
14177
14178 These changes, along with some changes to nt/configure.bat,
14179 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14180 earlier fix to add support for --cflags and --ldflags options
14181 that include quotes so that it works whether make uses cmd or
14182 sh as the shell.
14183
14184 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14185
14186 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14187 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14188 is a constant.
14189 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14190 a string. Handle both cases.
14191 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14192 (Fdbus_register_method): Use Qinvalid_function.
14193
14194 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14195
14196 * makefile.w32-in: Update dependencies.
14197 (LISP_H): Add inttypes.h and stdin.h.
14198 (PROCESS_H): Add unistd.h.
14199
14200 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14201
14202 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14203 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14204
14205 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14206
14207 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14208
14209 * term.c (vfatal): Remove stray call to va_end.
14210 It's not needed and the C Standard doesn't allow it here anyway.
14211
14212 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14213 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14214
14215 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14216 bytes.
14217
14218 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14219
14220 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14221
14222 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14223
14224 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14225
14226 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14227
14228 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14229 * charset.c (Fdefine_charset_internal): Don't initialize
14230 charset.code_space[15]. The value was garbage, on hosts with
14231 32-bit int (Bug#8600).
14232
14233 * lread.c (read_integer): Be more consistent with string-to-number.
14234 Use string_to_number to do the actual conversion; this avoids
14235 rounding errors and fixes some other screwups. Without this fix,
14236 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14237 (digit_to_number): Move earlier, for benefit of read_integer.
14238 Return -1 if the digit is out of range for the base, -2 if it is
14239 not a digit in any supported base. (Bug#8602)
14240
14241 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14242
14243 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14244 to match comment at start of function. This also removes a
14245 GCC warning about overflow in a 32+64-bit port.
14246
14247 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14248
14249 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14250 Reported by Stefan Monnier in
14251 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14252 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14253 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14254
14255 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14256 (EMACS_UINTPTR): Likewise, with uintptr_t.
14257
14258 * lisp.h: Prefer 64-bit EMACS_INT if available.
14259 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14260 on 32-bit hosts that have 64-bit int, so that they can access
14261 large files.
14262 However, temporarily disable this change unless the temporary
14263 symbol WIDE_EMACS_INT is defined.
14264
14265 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14266
14267 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14268 This removes an assumption that EMACS_INT and long are the same
14269 width as pointers. The assumption is true for Emacs porting targets
14270 now, but we want to make other targets possible.
14271 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14272 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14273 In the rest of the code, change types of integers that hold casted
14274 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14275 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14276 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14277 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14278 No need to cast type when ORing.
14279 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14280 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14281 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14282 assume EMACS_INT is the same width as char *.
14283 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14284 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14285 Remove no-longer-needed casts.
14286 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14287 (xg_tool_bar_help_callback, xg_make_tool_item):
14288 Use EMACS_INTPTR to hold an integer
14289 that will be cast to void *; this can avoid a GCC warning
14290 if EMACS_INT is not the same width as void *.
14291 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14292 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14293 (current_message_1, set_message_1):
14294 Use a local to convert to proper width without a cast.
14295 * xmenu.c (dialog_selection_callback): Likewise.
14296
14297 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14298 Also, don't assume VALBITS / RAND_BITS is less than 5,
14299 and don't rely on undefined behavior when shifting a 1 left into
14300 the sign bit.
14301 * lisp.h (get_random): Change signature to match.
14302
14303 * lread.c (hash_string): Use size_t, not int, for hash computation.
14304 Normally we prefer signed values; but hashing is special, because
14305 it's better to use unsigned division on hash table sizes so that
14306 the remainder is nonnegative. Also, size_t is the natural width
14307 for hashing into memory. The previous code used 'int', which doesn't
14308 retain enough info to hash well into very large tables.
14309 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14310
14311 * dbusbind.c: Don't possibly lose pointer info when converting.
14312 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14313 Use XPNTR rather than XHASH, so that the high-order bits of
14314 the pointer aren't lost when converting through void *.
14315
14316 * eval.c (Fautoload): Don't double-shift a pointer.
14317
14318 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14319
14320 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14321
14322 * gnutls.c (DEF_GNUTLS_FN):
14323 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14324
14325 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14326
14327 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14328 marker. (Bug#8610)
14329
14330 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14331
14332 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14333 New version that can reserve upto 2GB of heap space.
14334
14335 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14336
14337 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14338
14339 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14340
14341 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14342 `gnutls_certificate_set_x509_key_file'.
14343
14344 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14345
14346 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14347 Update dependencies.
14348
14349 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14350
14351 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14352 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14353 Remove unused parameter `fildes'.
14354 * process.c (read_process_output, send_process): Don't pass it.
14355
14356 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14357
14358 Fix previous change: the library cache is defined in w32.c.
14359 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14360 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14361
14362 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14363
14364 Implement dynamic loading of GnuTLS on Windows.
14365
14366 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14367 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14368 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14369 Declare.
14370
14371 * gnutls.c (Qgnutls_dll): Define.
14372 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14373 (gnutls_*): Declare function pointers.
14374 (init_gnutls_functions): New function to initialize function pointers.
14375 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14376 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14377 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14378 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14379 (emacs_gnutls_write, emacs_gnutls_read)
14380 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14381 (Fgnutls_available_p): New function.
14382 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14383 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14384 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14385
14386 * image.c: Include w32.h.
14387 (Vimage_type_cache): Delete.
14388 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14389 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14390 (w32_delayed_load): Move to w32.c.
14391
14392 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14393
14394 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14395 (w32_delayed_load): Move from image.c. When loading a library, record
14396 its filename in the :loaded-from property of the library id.
14397 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14398 Initialize and staticpro them.
14399 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14400
14401 * process.c: Include lisp.h before w32.h, not after.
14402 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14403 instead of gnutls_record_check_pending.
14404
14405 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14406
14407 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14408
14409 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14410 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14411 as passed in.
14412
14413 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14414
14415 * xterm.c (x_set_frame_alpha): Do not set property on anything
14416 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14417
14418 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14419
14420 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14421
14422 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14423
14424 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14425 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14426 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14427 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14428 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14429 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14430 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14431 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14432 (Qgnutls_bootprop_callbacks_verify): Make static.
14433
14434 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14435
14436 * callproc.c: Indentation fixup.
14437
14438 * sysdep.c (wait_for_termination_1): Make static.
14439 (wait_for_termination, interruptible_wait_for_termination):
14440 Move after wait_for_termination_1.
14441
14442 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14443
14444 * sysdep.c (interruptible_wait_for_termination): New function
14445 which is like wait_for_termination, but allows keyboard
14446 interruptions.
14447
14448 * callproc.c (Fcall_process): Add (:file "file") as an option for
14449 the STDOUT buffer.
14450 (Fcall_process_region): Ditto.
14451
14452 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14453
14454 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14455 rather than `XVECTOR (FOO)->size'.
14456
14457 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14458 inttypes.h, as a gnulib replacement is used if it not available in
14459 system headers.
14460
14461 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14462
14463 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14464 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14465 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14466
14467 * coding.c (coding_alloc_by_realloc): Error out if destination
14468 will grow beyond MOST_POSITIVE_FIXNUM.
14469 (decode_coding_emacs_mule): Abort if there isn't enough place in
14470 charbuf for the composition carryover bytes. Reserve an extra
14471 space for up to 2 characters produced in a loop.
14472 (decode_coding_iso_2022): Abort if there isn't enough place in
14473 charbuf for the composition carryover bytes.
14474
14475 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14476
14477 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14478 aborting when %lld or %lll format is passed.
14479 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14480 %llo or %llx format is passed. (Bug#8545)
14481
14482 * window.c (window_scroll_line_based): Use a marker instead of
14483 simple variables to record original value of point. (Bug#7952)
14484
14485 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14486 produced by %s or %c overflows available buffer space. (Bug#8545)
14487
14488 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14489
14490 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14491 (SIZE_MAX): Move defn after all includes, as they might #define it.
14492
14493 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14494
14495 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14496
14497 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14498
14499 * keyboard.c (Qdelayed_warnings_hook): Define.
14500 (command_loop_1): Run `delayed-warnings-hook'
14501 if Vdelayed_warnings_list is non-nil.
14502 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14503 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14504
14505 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14506
14507 * doprnt.c (doprnt): Don't return value smaller than the buffer
14508 size if the message was truncated. (Bug#8545).
14509
14510 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14511
14512 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14513 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14514
14515 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14516
14517 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14518
14519 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14520
14521 * makefile.w32-in: Update dependencies.
14522
14523 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14524
14525 Improve `doprnt' and its usage. (Bug#8545)
14526 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14527 `format_end'. Remove support for %l as a conversion specifier.
14528 Don't use xrealloc. Improve diagnostics when the %l size modifier
14529 is used. Update the commentary.
14530
14531 * eval.c (verror): Simplify calculation of size_t.
14532
14533 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14534 messages.
14535
14536 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14537
14538 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14539 change.
14540
14541 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14542
14543 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14544 This makes this file independent of the recent pseudovector change.
14545
14546 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14547
14548 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14549
14550 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14551 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14552 Remove unused local.
14553 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14554
14555 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14556 GCC 4.6.0 optimizes based on type-based alias analysis.
14557 For example, if b is of type struct buffer * and v of type struct
14558 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14559 != &v->size, and therefore "v->size = 1; b->size = 2; return
14560 v->size;" must therefore return 1. This assumption is incorrect
14561 for Emacs, since it type-puns struct Lisp_Vector * with many other
14562 types. To fix this problem, this patch adds a new type struct
14563 vectorlike_header that documents the constraints on layout of vectors
14564 and pseudovectors, and helps optimizing compilers not get fooled
14565 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14566 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14567 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14568 the size member.
14569 (XSETPVECTYPE): Rewrite in terms of new macro.
14570 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14571 This is a bit clearer, and further avoids the possibility of
14572 undesirable aliasing.
14573 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14574 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14575 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14576 since Lisp_Subr is a special case (no "next" field).
14577 (ASIZE): Now uses header.size rather than size.
14578 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14579 to avoid the hassle of writing XVECTOR (foo)->header.size.
14580 (struct vectorlike_header): New type.
14581 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14582 object, to help avoid aliasing.
14583 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14584 (SUBRP): Likewise, since Lisp_Subr is a special case.
14585 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14586 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14587 (struct Lisp_Hash_Table): Combine first two members into a single
14588 struct vectorlike_header member. All uses of "size" and "next" members
14589 changed to be "header.size" and "header.next".
14590 * buffer.h (struct buffer): Likewise.
14591 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14592 * frame.h (struct frame): Likewise.
14593 * process.h (struct Lisp_Process): Likewise.
14594 * termhooks.h (struct terminal): Likewise.
14595 * window.c (struct save_window_data, struct saved_window): Likewise.
14596 * window.h (struct window): Likewise.
14597 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14598 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14599 * buffer.c (init_buffer_once): Likewise.
14600 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14601 special case.
14602 * process.c (Fformat_network_address): Use local var for size,
14603 for brevity.
14604
14605 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14606
14607 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14608 * data.c (atof): Remove decl; no longer used or needed.
14609 (digit_to_number): Move to lread.c.
14610 (Fstring_to_number): Use new string_to_number function, to be
14611 consistent with how the Lisp reader treats infinities and NaNs.
14612 Do not assume that floating-point numbers represent EMACS_INT
14613 without losing information; this is not true on most 64-bit hosts.
14614 Avoid double-rounding errors, by insisting on integers when
14615 parsing non-base-10 numbers, as the documentation specifies.
14616 * lisp.h (string_to_number): New decl, replacing ...
14617 (isfloat_string): Remove.
14618 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14619 (read1): Do not accept +. and -. as integers; this
14620 appears to have been a coding error. Similarly, do not accept
14621 strings like +-1e0 as floating point numbers. Do not report
14622 overflow for integer overflows unless the base is not 10 which
14623 means we have no simple and reliable way to continue.
14624 Break out the floating-point parsing into a new
14625 function string_to_number, so that Fstring_to_number parses
14626 floating point numbers consistently with the Lisp reader.
14627 (digit_to_number): Move here from data.c. Make it static inline.
14628 (E_CHAR, EXP_INT): Remove, replacing with ...
14629 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14630 (string_to_number): New function, replacing isfloat_string.
14631 This function checks for valid syntax and produces the resulting
14632 Lisp float number too. Rework it so that string-to-number
14633 no longer mishandles examples like "1.0e+". Use strtoumax,
14634 so that overflow for non-base-10 numbers is reported only when
14635 there's no portable and simple way to convert to floating point.
14636
14637 * textprop.c (set_text_properties_1): Rewrite for clarity,
14638 and to avoid GCC warning about integer overflow.
14639
14640 * intervals.h (struct interval): Use EMACS_INT for members
14641 where EMACS_UINT might cause problems. See
14642 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14643 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14644 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14645 All uses changed.
14646 (offset_intervals): Tell GCC not to worry about length overflow
14647 when negating a negative length.
14648
14649 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14650 (overrun_check_free): Likewise.
14651
14652 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14653 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14654 word size.
14655
14656 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14657 (gnutls_make_error): Rename local to avoid shadowing.
14658 (gnutls_emacs_global_deinit): ifdef out; not used.
14659 (Fgnutls_boot): Use const for pointer to readonly storage.
14660 Comment out unused local. Fix pointer signedness problems.
14661
14662 * lread.c (openp): Don't stuff size_t into an 'int'.
14663 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14664 about possible signed overflow.
14665
14666 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14667 (GDK_KEY_g): Don't define if already defined.
14668 (xg_prepare_tooltip): Avoid pointer signedness problem.
14669 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14670
14671 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14672 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14673
14674 * xfns.c (Fx_window_property): Simplify a bit,
14675 to make a bit faster and to avoid GCC 4.6.0 warning.
14676 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14677
14678 * fns.c (internal_equal): Don't assume size_t fits in int.
14679
14680 * alloc.c (compact_small_strings): Tighten assertion a little.
14681
14682 Replace pEd with more-general pI, and fix some printf arg casts.
14683 * lisp.h (pI): New macro, generalizing old pEd macro to other
14684 conversion specifiers. For example, use "...%"pI"d..." rather
14685 than "...%"pEd"...".
14686 (pEd): Remove. All uses replaced with similar uses of pI.
14687 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14688 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14689 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14690 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14691 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14692 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14693 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14694 64-bit hosts.
14695 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14696 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14697 * print.c (safe_debug_print, print_object): Likewise.
14698 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14699 to int.
14700 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14701 avoiding the 0 flag, which is not portable.
14702 * process.c (Fmake_network_process): Use pI to avoid cast.
14703 * region-cache.c (pp_cache): Likewise.
14704 * xdisp.c (decode_mode_spec): Likewise.
14705 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14706 behavior on 64-bit hosts with printf arg.
14707 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14708 (x_stop_queuing_selection_requests): Likewise.
14709 (x_get_window_property): Don't truncate byte count to an 'int'
14710 when tracing.
14711
14712 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14713 here, since it parses constructs like leading '-' and spaces,
14714 which are not wanted; and it overflows with large numbers.
14715 Instead, simply match F[0-9]+, which is what is wanted anyway.
14716
14717 * alloc.c: Remove unportable assumptions about struct layout.
14718 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14719 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14720 (allocate_vectorlike, make_pure_vector): Use the new macros,
14721 plus offsetof, to remove unportable assumptions about struct layout.
14722 These assumptions hold on all porting targets that I know of, but
14723 they are not guaranteed, they're easy to remove, and removing them
14724 makes further changes easier.
14725
14726 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14727 This doesn't fix a bug but makes the code clearer.
14728 (string_overrun_cookie): Now const. Use initializers that
14729 don't formally overflow signed char, to avoid warnings.
14730 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14731 can cause Emacs to crash when string overrun checking is enabled.
14732 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14733 multiple of sizeof (EMACS_INT); it need not be, if
14734 alignof(EMACS_INT) < sizeof (EMACS_INT).
14735 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14736
14737 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14738
14739 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14740
14741 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14742
14743 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14744 supposed to be handshaking. (Bug#8556)
14745 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14746
14747 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14748
14749 * lisp.h (Qdebug): List symbol.
14750 * eval.c (Qdebug): Restore global linkage.
14751 * keyboard.c (debug-on-event): New variable.
14752 (handle_user_signal): Break into debugger when debug-on-event
14753 matches the current signal symbol.
14754
14755 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14756
14757 * alloc.c (check_sblock, check_string_bytes)
14758 (check_string_free_list): Convert to standard C.
14759
14760 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14761
14762 * w32.c (emacs_gnutls_push): Fix typo.
14763
14764 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14765
14766 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14767 "cast to pointer from integer of different size".
14768
14769 Improve doprnt and its use in verror. (Bug#8545)
14770 * doprnt.c (doprnt): Document the set of format control sequences
14771 supported by the function. Use SAFE_ALLOCA instead of always
14772 using `alloca'.
14773
14774 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14775 is one byte too soon. Don't use xrealloc; instead xfree and
14776 xmalloc anew.
14777
14778 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14779
14780 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14781 callbacks stage.
14782
14783 * gnutls.c: Renamed global_initialized to
14784 gnutls_global_initialized. Added internals for the
14785 :verify-hostname-error, :verify-error, and :verify-flags
14786 parameters of `gnutls-boot' and documented those parameters in the
14787 docstring. Start callback support.
14788 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14789 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14790 on error. Return error code.
14791 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14792 (emacs_gnutls_read): Likewise.
14793 (Fgnutls_boot): Return handshake error code.
14794 (emacs_gnutls_handle_error): New function.
14795 (wsaerror_to_errno): Likewise.
14796
14797 * w32.h (emacs_gnutls_pull): Add prototype.
14798 (emacs_gnutls_push): Likewise.
14799
14800 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14801 (emacs_gnutls_push): Likewise.
14802
14803 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14804
14805 * process.c (wait_reading_process_output): Check if GnuTLS
14806 buffered some data internally if no FDs are set for TLS
14807 connections.
14808
14809 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14810 (LIBS): Link to USER_LIBS.
14811 ($(BLD)/gnutls.$(0)): New target.
14812
14813 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14814
14815 * xdisp.c (handle_single_display_spec): Rename the
14816 display_replaced_before_p argument into display_replaced_p, to
14817 make it consistent with the commentary. Fix typos in the
14818 commentary.
14819
14820 * textprop.c (syms_of_textprop): Remove dead code.
14821 (copy_text_properties): Delete obsolete commentary about an
14822 interface that was deleted long ago. Fix typos in the description
14823 of arguments.
14824
14825 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14826 to changes in oldXMenu/XMenu.h from 2011-04-16.
14827 <menu_help_message, prev_menu_help_message>: Constify.
14828 (IT_menu_make_room): menu->help_text is now `const char **';
14829 adjust.
14830
14831 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14832 to changes in oldXMenu/XMenu.h from 2011-04-16.
14833 (struct XMenu): Declare `help_text' `const char **'.
14834
14835 * xfaces.c <Qunspecified>: Make extern again.
14836
14837 * syntax.c: Include sys/types.h before including regex.h, as
14838 required by POSIX.
14839
14840 * doc.c (get_doc_string): Improve the format passed to `error'.
14841
14842 * doprnt.c (doprnt): Improve commentary.
14843
14844 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14845
14846 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14847 them with etags.
14848
14849 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14850 changes in globals.h immediately force recompilation.
14851 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14852 $(CURDIR)/s/ms-w32.h.
14853 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14854
14855 * character.c (Fchar_direction): Function deleted.
14856 (syms_of_character): Don't defsubr it.
14857 <char-direction-table>: Deleted.
14858
14859 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14860
14861 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14862 * doprnt.c: Include limits.h.
14863 (SIZE_MAX): New macro.
14864 (doprnt): Return a size_t value. 2nd arg is now size_t.
14865 Many local variables are now size_t instead of int or unsigned.
14866 Improve overflow protection. Support `l' modifier for integer
14867 conversions. Support %l conversion. Don't assume an EMACS_INT
14868 argument for integer conversions and for %c.
14869
14870 * lisp.h (doprnt): Restore prototype.
14871
14872 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14873 $(SRC)/character.h.
14874
14875 * Makefile.in (base_obj): Add back doprnt.o.
14876
14877 * deps.mk (doprnt.o): Add back prerequisites.
14878 (callint.o): Depend on character.h.
14879
14880 * eval.c (internal_lisp_condition_case): Include the handler
14881 representation in the error message.
14882 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
14883 when breaking from the loop.
14884
14885 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
14886
14887 * callint.c (Fcall_interactively): When displaying error message
14888 about invalid control letter, pass the character's codepoint, not
14889 a pointer to its multibyte form. Improve display of the character
14890 in octal and display also its hex code.
14891
14892 * character.c (char_string): Use %x to display the (unsigned)
14893 codepoint of an invalid character, to avoid displaying a bogus
14894 negative value.
14895
14896 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
14897 `error', not SYMBOL_NAME itself.
14898
14899 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
14900 character arguments to `error'.
14901
14902 * charset.c (check_iso_charset_parameter): Fix incorrect argument
14903 to `error' in error message about FINAL_CHAR argument. Make sure
14904 FINAL_CHAR is a character, and use %c when it is passed as
14905 argument to `error'.
14906
14907 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14908
14909 * s/ms-w32.h (localtime): Redirect to sys_localtime.
14910
14911 * w32.c: Include <time.h>.
14912 (sys_localtime): New function.
14913
14914 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
14915
14916 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
14917
14918 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
14919
14920 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
14921
14922 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
14923 zombies (Bug#8467).
14924
14925 2011-04-19 Eli Zaretskii <eliz@gnu.org>
14926
14927 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
14928 gl_state.e_property when gl_state.object is Qt.
14929
14930 * insdel.c (make_gap_larger): Remove limitation of buffer size
14931 to <= INT_MAX.
14932
14933 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
14934
14935 * xdisp.c (lookup_glyphless_char_display)
14936 (produce_glyphless_glyph): Handle cons cell entry in
14937 glyphless-char-display.
14938 (Vglyphless_char_display): Document it.
14939
14940 * term.c (produce_glyphless_glyph): Handle cons cell entry in
14941 glyphless-char-display.
14942
14943 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
14944
14945 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
14946
14947 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
14948
14949 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
14950 definition for no-X builds.
14951
14952 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
14953
14954 Static checks with GCC 4.6.0 and non-default toolkits.
14955
14956 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14957
14958 * process.c (keyboard_bit_set): Define only if SIGIO.
14959 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14960 (send_process): Repair possible setjmp clobbering.
14961
14962 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14963
14964 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14965
14966 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14967
14968 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14969 Define only if needed.
14970
14971 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14972 by pacifying GCC about it. Maybe it's time to retire it?
14973 * xfaces.c (USG, __TIMEVAL__): Likewise.
14974
14975 * dispextern.h (struct redisplay_interface): Rename param
14976 to avoid shadowing.
14977 * termhooks.h (struct terminal): Likewise.
14978 * xterm.c (xembed_send_message): Likewise.
14979
14980 * insdel.c (make_gap_smaller): Define only if
14981 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14982
14983 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14984 it.
14985
14986 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14987 so that we aren't warned about unused symbols.
14988
14989 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14990
14991 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
14992
14993 * xfns.c (x_real_positions): Mark locals as initialized.
14994
14995 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14996
14997 * xterm.c: Fix problems found by static analysis with other toolkits.
14998 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
14999 (x_dispatch_event): Declare static if USE_GTK, and
15000 define if USE_GTK || USE_X_TOOLKIT.
15001 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15002 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15003 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15004 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15005
15006 * xmenu.c (menu_help_callback): Pointer type fixes.
15007 Use const pointers when pointing at readonly data. Avoid pointer
15008 signedness clashes.
15009 (FALSE): Remove unused macro.
15010 (update_frame_menubar): Remove unused decl.
15011
15012 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15013
15014 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15015 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15016 (single_menu_item): Rename local to avoid shadowing.
15017
15018 * keyboard.c (make_lispy_event): Remove unused local var.
15019
15020 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15021 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15022
15023 * bitmaps: Change bitmaps from unsigned char back to the X11
15024 compatible char. Avoid the old compiler warnings about
15025 out-of-range initializers by using, for example, '\xab' rather
15026 than 0xab.
15027
15028 * xgselect.c (xgselect_initialize): Check vs interface
15029 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15030
15031 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15032
15033 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15034 to read-only memory.
15035
15036 * fns.c (vector): Remove; this old hack is no longer needed.
15037
15038 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15039 Remove unused var.
15040 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15041
15042 * xrdb.c (x_load_resources): Omit unused local.
15043
15044 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15045 (x_window): Rename locals to avoid shadowing.
15046 (USG): Use the kludged USG macro, to pacify gcc.
15047
15048 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15049 (x_term_init): Remove local to avoid shadowing.
15050
15051 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15052
15053 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15054 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15055
15056 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15057
15058 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15059
15060 Fix regex.c, syntax.c and friends for buffers > 2GB.
15061 * syntax.h (struct gl_state_s): Declare character position members
15062 EMACS_INT.
15063
15064 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15065
15066 * textprop.c (verify_interval_modification, interval_of):
15067 Declare arguments EMACS_INT.
15068
15069 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15070 EMACS_INT.
15071
15072 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15073
15074 * indent.c (Fvertical_motion): Local variable it_start is now
15075 EMACS_INT.
15076
15077 * regex.c (re_match, re_match_2, re_match_2_internal)
15078 (bcmp_translate, regcomp, regexec, print_double_string)
15079 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15080 (re_compile_pattern, re_exec): Declare arguments and local
15081 variables `size_t' and `ssize_t' and return values `regoff_t', as
15082 appropriate.
15083 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15084 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15085 <compile_stack_type>: `size' and `avail' are now `size_t'.
15086
15087 * regex.h <regoff_t>: Use ssize_t, not int.
15088 (re_search, re_search_2, re_match, re_match_2): Arguments that
15089 specify buffer/string position and length are now ssize_t and
15090 size_t. Return type is regoff_t.
15091
15092 2011-04-16 Ben Key <bkey76@gmail.com>
15093
15094 * nsfont.m: Fixed bugs in ns_get_family and
15095 ns_descriptor_to_entity that were caused by using free to
15096 deallocate memory blocks that were allocated by xmalloc (via
15097 xstrdup). This caused Emacs to crash when compiled with
15098 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15099 --enable-checking=xmallocoverrun). xfree is now used to
15100 deallocate these memory blocks.
15101
15102 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15103
15104 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15105
15106 emacs_write: Accept and return EMACS_INT for sizes.
15107 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15108 et seq.
15109 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15110 Accept and return EMACS_INT.
15111 (emacs_gnutls_write): Return the number of bytes written on
15112 partial writes.
15113 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15114 (emacs_read, emacs_write): Remove check for negative size, as the
15115 Emacs source code has been audited now.
15116 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15117 (emacs_read, emacs_write): Use it.
15118 * process.c (send_process): Adjust to the new signatures of
15119 emacs_write and emacs_gnutls_write. Do not attempt to store
15120 a byte offset into an 'int'; it might overflow.
15121 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15122
15123 * sound.c: Don't assume sizes fit in 'int'.
15124 (struct sound_device.period_size, alsa_period_size):
15125 Return EMACS_INT, not int.
15126 (struct sound_device.write, vox_write, alsa_write):
15127 Accept EMACS_INT, not int.
15128 (wav_play, au_play): Use EMACS_INT to store sizes and to
15129 record read return values.
15130
15131 2011-04-15 Ben Key <bkey76@gmail.com>
15132
15133 * keyboard.c (Qundefined): Don't declare static since it is used
15134 in nsfns.m.
15135 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15136 static since they are used in nsfont.m.
15137
15138 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15139
15140 * process.c (Qprocessp): Don't declare static.
15141 * lisp.h (Qprocessp): Declare again.
15142
15143 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15144
15145 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15146
15147 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15148
15149 Improve C-level modularity by making more things 'static'.
15150
15151 Don't publish debugger-only interfaces to other modules.
15152 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15153 (verify_bytepos, count_markers): Move decls to the only modules
15154 that need them.
15155 * region-cache.h (pp_cache): Likewise.
15156 * window.h (check_all_windows): Likewise.
15157 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15158
15159 * sysdep.c (croak): Now static, if
15160 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15161 * syssignal.h (croak): Declare only if not static.
15162
15163 * alloc.c (refill_memory_reserve): Now static if
15164 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15165 * lisp.h (refill_memory_reserve): Declare only if not static.
15166
15167 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15168 Define only if USE_LUCID.
15169
15170 * xrdb.c (x_customization_string, x_rm_string): Now static.
15171
15172 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15173 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15174
15175 * xdisp.c (draw_row_with_mouse_face): Now static.
15176 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15177
15178 * window.h (check_all_windows): Mark externally visible.
15179
15180 * window.c (window_deletion_count): Now static.
15181
15182 * undo.c: Make symbols static if they're not exported.
15183 (last_undo_buffer, last_boundary_position, pending_boundary):
15184 Now static.
15185
15186 * textprop.c (interval_insert_behind_hooks): Now static.
15187 (interval_insert_in_front_hooks): Likewise.
15188
15189 * term.c: Make symbols static if they're not exported.
15190 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15191 (max_frame_lines, tty_set_terminal_modes):
15192 (tty_reset_terminal_modes, tty_turn_off_highlight):
15193 (get_tty_terminal): Now static.
15194 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15195 * termhooks.h (term_mouse_moveto): Do not declare if
15196 HAVE_WINDOW_SYSTEM.
15197 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15198 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15199
15200 * sysdep.c: Make symbols static if they're not exported.
15201 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15202 Now static.
15203 (sigprocmask_set, full_mask): Remove; unused.
15204 (wait_debugging): Mark as visible.
15205 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15206 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15207
15208 * syntax.c (syntax_temp): Define only if !__GNUC__.
15209
15210 * sound.c (current_sound_device, current_sound): Now static.
15211
15212 * search.c (searchbufs, searchbuf_head): Now static.
15213
15214 * scroll.c (scroll_cost): Remove; unused.
15215 * dispextern.h (scroll_cost): Remove decl.
15216
15217 * region-cache.h (pp_cache): Mark as externally visible.
15218
15219 * process.c: Make symbols static if they're not exported.
15220 (process_tick, update_tick, create_process, chan_process):
15221 (Vprocess_alist, proc_buffered_char, datagram_access):
15222 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15223 (deactivate_process): Mark defn as static, as well as decl.
15224 * lisp.h (create_process): Remove decl.
15225 * process.h (chan_process, Vprocess_alist): Remove decls.
15226
15227 * print.c: Make symbols static if they're not exported.
15228 (print_depth, new_backquote_output, being_printed, print_buffer):
15229 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15230 (print_interval, print_number_index, initial_stderr_stream):
15231 Now static.
15232 * lisp.h (Fprinc): Remove decl.
15233 (debug_output_compilation_hack): Mark as externally visible.
15234
15235 * sysdep.c (croak): Move decl from here to syssignal.h.
15236 * syssignal.h (croak): Put it here, so the API can be checked when
15237 'croak' is called from dissociate_if_controlling_tty.
15238
15239 * minibuf.c: Make symbols static if they're not exported.
15240 (minibuf_save_list, choose_minibuf_frame): Now static.
15241 * lisp.h (choose_minibuf_frame): Remove decl.
15242
15243 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15244
15245 * lread.c: Make symbols static if they're not exported.
15246 (read_objects, initial_obarray, oblookup_last_bucket_number):
15247 Now static.
15248 (make_symbol): Remove; unused.
15249 * lisp.h (initial_obarray, make_symbol): Remove decls.
15250
15251 * keyboard.c: Make symbols static if they're not exported.
15252 (single_kboard, recent_keys_index, total_keys, recent_keys):
15253 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15254 (this_single_command_key_start, echoing, last_auto_save):
15255 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15256 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15257 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15258 (Vlispy_mouse_stem, double_click_count):
15259 Now static.
15260 (force_auto_save_soon): Define only if SIGDANGER.
15261 (ignore_mouse_drag_p): Now static if
15262 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15263 (print_help): Remove; unused.
15264 (stop_character, last_timer_event): Mark as externally visible.
15265 * keyboard.h (ignore_mouse_drag_p): Declare only if
15266 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15267 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15268 * lisp.h (echoing): Remove decl.
15269 (force_auto_save_soon): Declare only if SIGDANGER.
15270 * xdisp.c (redisplay_window): Simplify code, to make it more
15271 obvious that ignore_mouse_drag_p is not accessed if !defined
15272 USE_GTK && !defined HAVE_NS.
15273
15274 * intervals.c: Make symbols static if they're not exported.
15275 (merge_properties_sticky, merge_interval_right, delete_interval):
15276 Now static.
15277 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15278
15279 * insdel.c: Make symbols static if they're not exported.
15280 However, leave prepare_to_modify_buffer alone. It's never
15281 called from outside this function, but that appears to be a bug.
15282 (combine_after_change_list, combine_after_change_buffer):
15283 (adjust_after_replace, signal_before_change): Now static.
15284 (adjust_after_replace_noundo): Remove; unused.
15285 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15286 (signal_before_change): Remove decls.
15287
15288 * indent.c (val_compute_motion, val_vmotion): Now static.
15289
15290 * image.c: Make symbols static if they're not exported.
15291 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15292 if USE_GTK.
15293 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15294 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15295
15296 * fringe.c (standard_bitmaps): Now static.
15297 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15298
15299 * frame.c: Make symbols static if they're not exported.
15300 (x_report_frame_params, make_terminal_frame): Now static.
15301 (get_frame_param): Now static, unless HAVE_NS.
15302 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15303 (x_get_resource_string): Remove; not used.
15304 * frame.h (make_terminal_frame, x_report_frame_params):
15305 (x_get_resource_string); Remove decls.
15306 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15307 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15308
15309 * font.c, fontset.c: Make symbols static if they're not exported.
15310 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15311 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15312 * font.c (font_close_object): Now static.
15313 * font.h (font_close_object): Remove.
15314 * fontset.c (FONTSET_OBJLIST): Remove.
15315 (free_realized_fontset) #if-0 the body, which does nothing.
15316 (face_suitable_for_char_p): #if-0, as it's never called.
15317 * fontset.h (face_suitable_for_char_p): Remove decl.
15318 * xfaces.c (face_at_string_position):
15319 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15320 since 0 is always ASCII.
15321
15322 * fns.c (weak_hash_tables): Now static.
15323
15324 * fileio.c: Make symbols static if they're not exported.
15325 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15326 (Vwrite_region_annotation_buffers): Now static.
15327
15328 * eval.c: Make symbols static if they're not exported.
15329 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15330 * lisp.h (backtrace_list): Remove decl.
15331
15332 * emacs.c: Make symbols static if they're not exported.
15333 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15334 (fatal_error_code, fatal_error_signal_hook, standard_args):
15335 Now static.
15336 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15337 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15338 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15339 * lisp.h (fatal_error_signal_hook): Remove decl.
15340 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15341
15342 * editfns.c: Move a (normally-unused) function to its only use.
15343 * editfns.c, lisp.h (get_operating_system_release): Remove.
15344 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15345 worth the hassle of breaking this out.
15346
15347 * xterm.c: Make symbols static if they're not exported.
15348 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15349 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15350 (x_destroy_window, x_delete_display):
15351 Now static.
15352 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15353 (x_mouse_leave): Remove; unused.
15354 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15355 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15356 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15357 Remove decls.
15358 (x_mouse_leave): Declare only if WINDOWSNT.
15359 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15360 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15361 USE_X_TOOLKIT.
15362
15363 * ftxfont.c: Make symbols static if they're not exported.
15364 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15365 HAVE_FREETYPE.
15366 * font.h (ftxfont_driver): Likewise.
15367
15368 * xfns.c: Make symbols static if they're not exported.
15369 (x_last_font_name, x_display_info_for_name):
15370 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15371 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15372 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15373 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15374 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15375 (last_show_tip_args): Now static.
15376 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15377 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15378 (x_screen_planes): Remove; unused.
15379 * dispextern.h (x_screen_planes): Remove decl.
15380
15381 * dispnew.c: Make symbols static if they're not exported.
15382 * dispextern.h (redraw_garbaged_frames, scrolling):
15383 (increment_row_positions): Remove.
15384 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15385 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15386 Now static.
15387 (redraw_garbaged_frames): Remove; unused.
15388
15389 * xfaces.c: Make symbols static if they're not exported.
15390 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15391 Remove decls.
15392 * xterm.h (defined_color): Remove decls.
15393 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15394 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15395 (menu_face_changed_default, defined_color, free_realized_face):
15396 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15397 (ascii_face_of_lisp_face): Remove; unused.
15398
15399 * xdisp.c: Make symbols static if they're not exported.
15400 * dispextern.h (scratch_glyph_row, window_box_edges):
15401 (glyph_to_pixel_coords, set_cursor_from_row):
15402 (get_next_display_element, set_iterator_to_next):
15403 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15404 (show_mouse_face): Remove decls
15405 * frame.h (message_buf_print): Likewise.
15406 * lisp.h (pop_message, set_message, check_point_in_composition):
15407 Likewise.
15408 * xterm.h (set_vertical_scroll_bar): Likewise.
15409 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15410 (message_buf_print, scratch_glyph_row, displayed_buffer):
15411 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15412 (get_next_display_element, show_mouse_face, window_box_edges):
15413 (frame_to_window_pixel_xy, check_point_in_composition):
15414 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15415 (glyph_to_pixel_coords): Remove; unused.
15416
15417 * dired.c (file_name_completion): Now static.
15418
15419 * dbusbind.c (xd_in_read_queued_messages): Now static.
15420
15421 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15422 * data.c (circular_list_error): Remove.
15423
15424 * commands.h (last_point_position, last_point_position_buffer):
15425 (last_point_position_window): Remove decls.
15426 * keyboard.c: Make these variables static.
15427
15428 * coding.h (coding, code_convert_region, encode_coding_gap):
15429 Remove decls.
15430 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15431 (iso_code_class, detect_coding, code_convert_region): Now static.
15432 (encode_coding_gap): Remove; unused.
15433
15434 * chartab.c (chartab_chars, chartab_bits): Now static.
15435
15436 * charset.h (charset_iso_8859_1): Remove decl.
15437 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15438 Now static.
15439
15440 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15441 * ccl.c (Vccl_program_table): Now static.
15442 (check_ccl_update): Remove; unused.
15443
15444 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15445 * category.h: ... from here.
15446 * category.c (check_category_table, set_category_set): Now static.
15447
15448 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15449 * lisp.h: Remove these decls.
15450
15451 * buffer.c (buffer_count): Remove unused var.
15452
15453 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15454 so that it's not optimized away.
15455 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15456 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15457 exported only to the debugger.
15458
15459 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15460 * atimer.h (run_all_atimers): Remove; not exported.
15461
15462 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15463 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15464 was inaccessible from Lisp.
15465 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15466 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15467
15468 alloc.c: Import and export fewer symbols, and remove unused items.
15469 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15470 is defined.
15471 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15472 it's not optimized away by whole-program optimization.
15473 (message_enable_multibyte, free_misc): Remove.
15474 (catchlist, handlerlist, mark_backtrace):
15475 Declare only if BYTE_MARK_STACK.
15476 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15477 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15478 (message_enable_multibyte): Remove decl.
15479 (free_misc, interval_free_list, float_block, float_block_index):
15480 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15481 (cons_free_list, last_marked_index):
15482 Now static.
15483 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15484 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15485 (mark_backtrace): Define only if BYTE_MARK_STACK.
15486 * xdisp.c (message_enable_multibyte): Now static.
15487
15488 Declare Lisp_Object Q* variables to be 'static' if not exported.
15489 This makes it easier for human readers (and static analyzers)
15490 to see whether these variables are used from other modules.
15491 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15492 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15493 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15494 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15495 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15496 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15497 * xmenu.c, xselect.c:
15498 Declare Q* vars static if they are not used in other modules.
15499 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15500 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15501 Remove decls of unexported vars.
15502 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15503
15504 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15505
15506 Make Emacs functions such as Fatom 'static' by default.
15507 This makes it easier for human readers (and static analyzers)
15508 to see whether these functions can be called from other modules.
15509 DEFUN now defines a static function. To make the function external
15510 so that it can be used in other C modules, use the new macro DEFUE.
15511 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15512 (Finit_image_library):
15513 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15514 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15515 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15516 Remove decls, since these functions are now static.
15517 (Funintern, Fget_internal_run_time): New decls, since these functions
15518 were already external.
15519
15520 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15521 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15522 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15523 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15524 * keyboard.c, keymap.c, lread.c:
15525 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15526 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15527 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15528 Mark functions with DEFUE instead of DEFUN,
15529 if they are used in other modules.
15530 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15531 decls for now-static functions.
15532 * buffer.h (Fdelete_overlay): Remove decl.
15533 * callproc.c (Fgetenv_internal): Mark as internal.
15534 * composite.c (Fremove_list_of_text_properties): Remove decl.
15535 (Fcomposition_get_gstring): New forward static decl.
15536 * composite.h (Fcomposite_get_gstring): Remove decl.
15537 * dired.c (Ffile_attributes): New forward static decl.
15538 * doc.c (Fdocumntation_property): New forward static decl.
15539 * eval.c (Ffetch_bytecode): New forward static decl.
15540 (Funintern): Remove extern decl; now in .h file where it belongs.
15541 * fileio.c (Fmake_symbolic_link): New forward static decl.
15542 * image.c (Finit_image_library): New forward static decl.
15543 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15544 * intervals.h (Fprevious_property_change):
15545 (Fremove_list_of_text_properties): Remove decls.
15546 * keyboard.c (Fthis_command_keys): Remove decl.
15547 (Fcommand_execute): New forward static decl.
15548 * keymap.c (Flookup_key): New forward static decl.
15549 (Fcopy_keymap): Now static.
15550 * keymap.h (Flookup_key): Remove decl.
15551 * process.c (Fget_process): New forward static decl.
15552 (Fprocess_datagram_address): Mark as internal.
15553 * syntax.c (Fsyntax_table_p): New forward static decl.
15554 (skip_chars): Remove duplicate decl.
15555 * textprop.c (Fprevious_property_change): New forward static decl.
15556 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15557 Now internal.
15558 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15559 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15560
15561 * editfns.c (Fformat): Remove unreachable code.
15562
15563 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15564
15565 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15566 change. (Bug#8496)
15567
15568 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15569
15570 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15571 when at ZV. (Bug#8487)
15572
15573 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15574
15575 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15576 (Bug#8437)
15577 * keyboard.c (parse_tool_bar_item): Likewise.
15578 * sound.c (sound_cleanup, alsa_close): Likewise.
15579 * termcap.c (tgetent): Likewise.
15580 * xfns.c (x_default_font_parameter): Likewise.
15581 * xsettings.c (read_and_apply_settings): Likewise.
15582
15583 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15584 (overrun_check_free): Protoize.
15585
15586 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15587
15588 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15589 since callers should never pass a negative size.
15590 Change the signature to match that of plain 'read' and 'write'; see
15591 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15592 * lisp.h: Update prototypes of emacs_write and emacs_read.
15593
15594 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15595
15596 * xdisp.c (redisplay_window): Don't try to determine the character
15597 position of the scroll margin if the window start point w->startp
15598 is outside the buffer's accessible region. (Bug#8468)
15599
15600 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15601
15602 Fix write-region and its subroutines for buffers > 2GB.
15603 * fileio.c (a_write, e_write): Modify declaration of arguments and
15604 local variables to support buffers larger than 2GB.
15605 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15606
15607 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15608 argument, local variables, and return value.
15609
15610 * lisp.h: Update prototypes of emacs_write and emacs_read.
15611
15612 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15613
15614 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15615
15616 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15617
15618 Fix more problems found by GCC 4.6.0's static checks.
15619
15620 * xdisp.c (vmessage): Use a better test for character truncation.
15621
15622 * charset.c (load_charset_map): <, not <=, for optimization,
15623 and to avoid potential problems with integer overflow.
15624 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15625 * casetab.c (set_identity, shuffle): Likewise.
15626 * editfns.c (Fformat): Likewise.
15627 * syntax.c (skip_chars): Likewise.
15628
15629 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15630 This also lets GCC 4.6.0 generate slightly better loop code.
15631
15632 * callint.c (Fcall_interactively): <, not <=, for optimization.
15633 (Fcall_interactively): Count the number of arguments produced,
15634 not the number of arguments given. This is simpler and lets GCC
15635 4.6.0 generate slightly better code.
15636
15637 * ftfont.c: Distingish more carefully between FcChar8 and char.
15638 The previous code passed unsigned char * to a functions like
15639 strlen and xstrcasecmp that expect char *, which does not
15640 conform to the C standard.
15641 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15642 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15643 char * when the C standard requires it.
15644
15645 * keyboard.c (read_char): Remove unused var.
15646
15647 * eval.c: Port to Windows vsnprintf (Bug#8435).
15648 Include <limits.h>.
15649 (SIZE_MAX): Define if the headers do not.
15650 (verror): Do not give up if vsnprintf returns a negative count.
15651 Instead, grow the buffer. This ports to Windows vsnprintf, which
15652 does not conform to C99. Problem reported by Eli Zaretskii.
15653 Also, simplify the allocation scheme, by avoiding the need for
15654 calling realloc, and removing the ALLOCATED variable.
15655
15656 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15657
15658 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15659 But keep the doprint source code for now, as we might revamp it
15660 and use it again (Bug#8435).
15661 * lisp.h (doprnt): Remove.
15662 * Makefile.in (base_obj): Remove doprnt.o.
15663 * deps.mk (doprnt.o): Remove.
15664
15665 error: Print 32- and 64-bit integers portably (Bug#8435).
15666 Without this change, on typical 64-bit hosts error ("...%d...", N)
15667 was used to print both 32- and 64-bit integers N, which relied on
15668 undefined behavior.
15669 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15670 * lisp.h (error, verror): Mark as printf-like functions.
15671 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15672 Report overflow in size calculations when allocating printf buffer.
15673 Do not truncate output string at its first null byte.
15674 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15675 Truncate the output at a character boundary, since vsnprintf does not
15676 do that.
15677 * charset.c (check_iso_charset_parameter): Convert internal
15678 character to string before calling 'error', since %c now has the
15679 printf meaning.
15680 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15681 overflow when computing char to be passed to 'error'. Do not
15682 pass Lisp_Object to 'error'; pass the integer instead.
15683 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15684 formatted with plain %d.
15685
15686 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15687
15688 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15689
15690 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15691
15692 * xterm.c (x_catch_errors): Remove duplicate declaration.
15693
15694 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15695
15696 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15697
15698 2011-04-10 Jim Meyering <meyering@redhat.com>
15699
15700 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15701 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15702 return ssize_t not "int", and use size_t as the buffer length.
15703 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15704 * gnutls.h: Update declarations.
15705 * process.c (read_process_output): Use ssize_t, to match.
15706 (send_process): Likewise.
15707
15708 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15709
15710 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15711
15712 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15713
15714 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15715 Use unsigned char, to match FcChar8 type definition.
15716
15717 * xterm.c (handle_one_xevent):
15718 * xmenu.c (create_and_show_popup_menu):
15719 * xselect.c (x_decline_selection_request)
15720 (x_reply_selection_request): Avoid type-punned deref of X events.
15721
15722 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15723
15724 Fix some uses of `int' instead of EMACS_INT.
15725 * search.c (string_match_1, fast_string_match)
15726 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15727 (scan_buffer, find_next_newline_no_quit)
15728 (find_before_next_newline, search_command, Freplace_match)
15729 (Fmatch_data): Make some `int' variables be EMACS_INT.
15730
15731 * xdisp.c (display_count_lines): 3rd argument and return value now
15732 EMACS_INT. All callers changed.
15733 (pint2hrstr): Last argument is now EMACS_INT.
15734
15735 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15736 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15737 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15738 (decode_coding_utf_16, decode_coding_emacs_mule)
15739 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15740 (decode_coding_ccl, decode_coding_charset)
15741 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15742 (decode_coding_iso_2022, decode_coding_emacs_mule)
15743 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15744 <char_offset, last_offset>: Declare EMACS_INT.
15745 (encode_coding_utf_8, encode_coding_utf_16)
15746 (encode_coding_emacs_mule, encode_invocation_designation)
15747 (encode_designation_at_bol, encode_coding_iso_2022)
15748 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15749 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15750 Declare EMACS_INT.
15751 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15752 (encode_invocation_designation): Last argument P_NCHARS is now
15753 EMACS_INT.
15754 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15755 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15756
15757 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15758 All users changed.
15759
15760 * ccl.c (Fccl_execute_on_string): Declare some variables
15761 EMACS_INT.
15762
15763 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15764
15765 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15766
15767 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15768
15769 * process.c (Fformat_network_address): Doc fix.
15770
15771 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15772
15773 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15774
15775 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15776
15777 * keyboard.c (read_char): Call Lisp function help-form-show,
15778 instead of using internal_with_output_to_temp_buffer.
15779 (Qhelp_form_show): New var.
15780 (syms_of_keyboard): Use DEFSYM macro.
15781
15782 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15783
15784 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15785
15786 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15787
15788 * process.c (Flist_processes): Remove to Lisp.
15789 (list_processes_1): Delete.
15790
15791 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15792
15793 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15794
15795 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15796
15797 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15798
15799 Fix more problems found by GCC 4.6.0's static checks.
15800
15801 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15802
15803 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15804
15805 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15806
15807 * xdisp.c (vmessage): Mark as a printf-like function.
15808
15809 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15810
15811 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15812
15813 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15814 printf-like functions.
15815 (tiff_load): Add casts to remove these marks before passing them
15816 to system-supplied API.
15817
15818 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15819
15820 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15821 This avoids several warnings with gcc -Wstrict-overflow.
15822 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15823 directly, rather than having caller test rule sign. This avoids
15824 some unnecessary tests.
15825 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15826 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15827 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15828
15829 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15830 (xfont_open): Avoid unnecessary tests.
15831
15832 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15833
15834 * composite.h, composite.c (composition_gstring_put_cache):
15835 Use EMACS_INT, not int, for length.
15836
15837 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15838 breaking out part of COMPOSITION_DECODE_RULE.
15839 (COMPOSITION_DECODE_RULE): Use it.
15840 * composite.c (get_composition_id): Remove unused local vars,
15841 by using the new macro.
15842
15843 * textprop.c (set_text_properties_1): Change while to do-while,
15844 since the condition is always true at first.
15845
15846 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15847 (interval_deletion_adjustment): Return unsigned value.
15848 All uses changed.
15849
15850 * process.c (list_processes_1, create_pty, read_process_output):
15851 (exec_sentinel): Remove vars that were set but not used.
15852 (create_pty): Remove unnecessary "volatile"s.
15853 (Fnetwork_interface_info): Avoid possibility of int overflow.
15854 (read_process_output): Do adaptive read buffering even if carryover.
15855 (read_process_output): Simplify nbytes computation if buffered.
15856
15857 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15858
15859 * syntax.c (scan_words): Remove var that was set but not used.
15860 (update_syntax_table): Use unsigned instead of int.
15861
15862 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15863 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15864 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15865
15866 * print.c (print_error_message): Avoid int overflow.
15867
15868 * font.c (font_list_entities): Redo for clarity,
15869 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15870
15871 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15872 (font_score): Avoid potential overflow in diff calculation.
15873
15874 * fns.c (substring_both): Remove var that is set but not used.
15875 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15876
15877 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15878
15879 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
15880 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
15881 can always succeed if overflow has undefined behavior.
15882
15883 * search.c (boyer_moore, wordify): Remove vars set but not used.
15884 (wordify): Omit three unnecessary tests.
15885
15886 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
15887 All callers changed. This avoids the need for an unused var.
15888
15889 * casefiddle.c (casify_region): Remove var that is set but not used.
15890
15891 * dired.c (file_name_completion): Remove var that is set but not used.
15892
15893 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
15894
15895 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
15896 (Finsert_file_contents): Remove unnecessary code checking fd.
15897
15898 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
15899 Check for integer overflow on size calculations.
15900
15901 * buffer.c (Fprevious_overlay_change): Remove var that is set
15902 but not used.
15903
15904 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
15905 Remove vars that are set but not used.
15906 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
15907 (timer_check_2): Mark vars as initialized.
15908
15909 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
15910
15911 * image.c (lookup_image): Remove var that is set but not used.
15912 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
15913
15914 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
15915 that are set but not used.
15916
15917 * xfns.c (make_invisible_cursor): Don't return garbage
15918 if XCreateBitmapFromData fails (Bug#8410).
15919
15920 * xselect.c (x_get_local_selection, x_handle_property_notify):
15921 Remove vars that are set but not used.
15922
15923 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
15924 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
15925
15926 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
15927 Remove var that is set but not used.
15928 (scroll_bar_windows_size): Now size_t, not int.
15929 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
15930 Check for overflow.
15931
15932 * xfaces.c (realize_named_face): Remove vars that are set but not used.
15933 (map_tty_color) [!defined MSDOS]: Likewise.
15934
15935 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
15936
15937 * coding.c: Remove vars that are set but not used.
15938 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
15939 All callers changed.
15940 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
15941 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
15942 (decode_coding_charset): Remove vars that are set but not used.
15943
15944 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
15945 that is set but not used.
15946
15947 * print.c (print_object): Remove var that is set but not used.
15948
15949 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
15950 The gnulib version avoids calling malloc in the usual case,
15951 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15952 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15953 * filelock.c (current_lock_owner): Likewise.
15954 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15955 * sysdep.c: Include allocator.h, careadlinkat.h.
15956 (emacs_no_realloc_allocator): New static constant.
15957 (emacs_readlink): New function.
15958 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15959 ../lib/careadlinkat.h.
15960
15961 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15962
15963 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15964 first non-nil return value).
15965
15966 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15967
15968 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15969 if not defined (Bug#8403).
15970
15971 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15972
15973 * xdisp.c (display_count_lines): Remove parameter `start',
15974 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15975 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15976 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15977 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15978 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15979 and thereabouts. All callers changed.
15980 (get_per_char_metric): Remove parameter `f', unused since
15981 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15982
15983 2011-04-02 Jim Meyering <meyering@redhat.com>
15984
15985 do not dereference NULL upon failed strdup
15986 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15987 (ns_get_family): Likewise.
15988
15989 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
15990
15991 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15992
15993 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15994
15995 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15996 later (Bug#8403).
15997
15998 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15999
16000 Add lexical binding.
16001
16002 * window.c (Ftemp_output_buffer_show): New fun.
16003 (Fsave_window_excursion):
16004 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16005
16006 * lread.c (lisp_file_lexically_bound_p): New function.
16007 (Fload): Bind Qlexical_binding.
16008 (readevalloop): Remove `evalfun' arg.
16009 Bind Qinternal_interpreter_environment.
16010 (Feval_buffer): Bind Qlexical_binding.
16011 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16012 Mark as dynamic.
16013 (syms_of_lread): Declare `lexical-binding'.
16014
16015 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16016
16017 * keyboard.c (eval_dyn): New fun.
16018 (menu_item_eval_property): Use it.
16019
16020 * image.c (parse_image_spec): Use Ffunctionp.
16021
16022 * fns.c (concat, mapcar1): Accept byte-code-functions.
16023
16024 * eval.c (Fsetq): Handle lexical vars.
16025 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16026 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16027 (FletX, Flet): Obey lexical binding.
16028 (Fcommandp): Handle closures.
16029 (Feval): New `lexical' arg.
16030 (eval_sub): New function extracted from Feval. Use it almost
16031 everywhere where Feval was used. Look up vars in lexical env.
16032 Handle closures.
16033 (Ffunctionp): Move from subr.el.
16034 (Ffuncall): Handle closures.
16035 (apply_lambda): Remove `eval_flags'.
16036 (funcall_lambda): Handle closures and new byte-code-functions.
16037 (Fspecial_variable_p): New function.
16038 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16039 but without exporting it to Lisp.
16040
16041 * doc.c (Fdocumentation, store_function_docstring):
16042 * data.c (Finteractive_form): Handle closures.
16043
16044 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16045 interactive spec.
16046
16047 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16048 New byte-codes.
16049 (exec_byte_code): New function extracted from Fbyte_code to handle new
16050 calling convention for byte-code-functions. Add new byte-codes.
16051
16052 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16053
16054 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16055
16056 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16057
16058 * xdisp.c (redisplay_internal): Fix prototype.
16059
16060 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16061
16062 * xdisp.c (SCROLL_LIMIT): New macro.
16063 (try_scrolling): Use it when setting scroll_limit.
16064 Limit scrolling to 100 screen lines.
16065 (redisplay_window): Even when falling back on "recentering",
16066 position point in the window according to scroll-conservatively,
16067 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16068
16069 (try_scrolling): When point is above the window, allow searching
16070 as far as scroll_max, or one screenful, to compute vertical
16071 distance from PT to the scroll margin position. This prevents
16072 try_scrolling from unnecessarily failing when
16073 scroll-conservatively is set to a value slightly larger than the
16074 window height. Clean up the case of PT below the margin at bottom
16075 of window: scroll_max can no longer be INT_MAX. When aggressive
16076 scrolling is in use, don't let point enter the opposite scroll
16077 margin as result of the scroll.
16078 (syms_of_xdisp) <scroll-conservatively>: Document the
16079 threshold of 100 lines for never-recentering scrolling.
16080
16081 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16082
16083 * dispextern.h (move_it_by_lines):
16084 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16085 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16086 (message_log_check_duplicate): Remove parameters `prev_bol' and
16087 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16088 (redisplay_internal): Remove parameter `preserve_echo_area',
16089 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16090
16091 * indent.c (Fvertical_motion):
16092 * window.c (window_scroll_pixel_based, Frecenter):
16093 Don't pass `need_y_p' to `move_it_by_lines'.
16094
16095 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16096
16097 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16098 steal a few bits to be more compact.
16099 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16100 Remove unneeded casts.
16101
16102 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16103
16104 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16105
16106 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16107 binding" message (bug#7967).
16108
16109 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16110
16111 Fix more problems found by GCC 4.6.0's static checks.
16112
16113 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16114 Remove unused local var.
16115
16116 * editfns.c (Fmessage_box): Remove unused local var.
16117
16118 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16119 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16120 Omit unused local vars.
16121 * window.c (shrink_windows): Omit unused local var.
16122 * menu.c (digest_single_submenu): Omit unused local var.
16123 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16124 Omit unused local var.
16125
16126 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16127 Don't assume string length fits in int.
16128 (keyremap_step, read_key_sequence): Use size_t for sizes.
16129 (read_key_sequence): Don't check last_real_key_start redundantly.
16130
16131 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16132 instead of alloca (Bug#8344).
16133
16134 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16135 (Fbacktrace_frame): Don't assume nframes fits in int.
16136
16137 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16138
16139 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16140 concerns.
16141
16142 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16143
16144 * cm.c (calccost): Turn while-do into do-while, for clarity.
16145
16146 * keyboard.c (syms_of_keyboard): Use the same style as later
16147 in this function when indexing through an array. This also
16148 works around GCC bug 48267.
16149
16150 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16151
16152 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16153
16154 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16155 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16156
16157 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16158 This avoids undefined behavior on integer overflow, and is a bit
16159 more convenient anyway since it is compared to a size_t variable.
16160
16161 Variadic C functions now count arguments with size_t, not int.
16162 This avoids an unnecessary limitation on 64-bit machines, which
16163 caused (substring ...) to crash on large vectors (Bug#8344).
16164 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16165 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16166 All variadic functions and their callers changed accordingly.
16167 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16168 * data.c (arith_driver, float_arith_driver): Likewise.
16169 * editfns.c (general_insert_function): Likewise.
16170 * eval.c (struct backtrace.nargs, interactive_p)
16171 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16172 (funcall_lambda, mark_backtrace): Likewise.
16173 * fns.c (concat): Likewise.
16174 * frame.c (x_set_frame_parameters): Likewise.
16175 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16176 0 if not found, not -1. All callers changed.
16177
16178 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16179 (stack_copy_size): Now size_t, not int.
16180 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16181
16182 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16183
16184 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16185 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16186 All callers changed.
16187
16188 * lisp.h (multibyte_char_to_unibyte):
16189 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16190 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16191 * character.h (CHAR_TO_BYTE8):
16192 * cmds.c (internal_self_insert):
16193 * editfns.c (general_insert_function):
16194 * keymap.c (push_key_description):
16195 * search.c (Freplace_match):
16196 * xdisp.c (message_dolog, set_message_1): All callers changed.
16197
16198 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16199
16200 * keyboard.c (safe_run_hook_funcall): New function.
16201 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16202 don't set the hook to nil, but remove the offending function instead.
16203 (Qcommand_hook_internal): Remove, unused.
16204 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16205 Vcommand_hook_internal.
16206
16207 * eval.c (enum run_hooks_condition): Remove.
16208 (funcall_nil, funcall_not): New functions.
16209 (run_hook_with_args): Call each function through a `funcall' argument.
16210 Remove `cond' argument, now redundant.
16211 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16212 (Frun_hook_with_args_until_failure): Adjust accordingly.
16213 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16214
16215 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16216
16217 * dispextern.h (string_buffer_position): Remove declaration.
16218
16219 * print.c (strout): Remove parameter `multibyte', unused since
16220 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16221
16222 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16223 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16224 All callers changed.
16225
16226 * w32.c (_wsa_errlist): Use braces for struct initializers.
16227
16228 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16229 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16230 All callers changed.
16231 (string_buffer_position): Likewise. Also, make static (it's never
16232 used outside xdisp.c).
16233 (cursor_row_p): Remove parameter `w', unused since
16234 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16235 (decode_mode_spec): Remove parameter `precision', introduced during
16236 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16237 All callers changed.
16238
16239 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16240
16241 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16242
16243 2011-03-27 Anders Lindgren <andlind@gmail.com>
16244
16245 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16246 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16247 (ns_update_auto_hide_menu_bar): New functions.
16248 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16249 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16250 ns_constrain_all_frames.
16251 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16252 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16253
16254 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16255
16256 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16257
16258 2011-03-27 Glenn Morris <rgm@gnu.org>
16259
16260 * syssignal.h: Replace RETSIGTYPE with void.
16261 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16262 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16263 Replace SIGTYPE with void everywhere.
16264 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16265 * s/template.h (SIGTYPE): Remove commented out definition.
16266
16267 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16268
16269 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16270 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16271
16272 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16273
16274 * w32.c (read_unc_volume): Use parameter `henum', instead of
16275 global variable `wget_enum_handle'.
16276
16277 * keymap.c (describe_vector): Remove parameters `indices' and
16278 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16279 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16280
16281 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16282
16283 * keyboard.c (timer_check): Remove parameter `do_it_now',
16284 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16285 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16286 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16287
16288 * keyboard.c (read_char):
16289 * w32menu.c (w32_menu_display_help):
16290 * xmenu.c (show_help_event, menu_help_callback):
16291 Adjust calls to `show_help_echo'.
16292
16293 * gtkutil.c (xg_maybe_add_timer):
16294 * keyboard.c (readable_events):
16295 * process.c (wait_reading_process_output):
16296 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16297
16298 * insdel.c (adjust_markers_gap_motion):
16299 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16300 (gap_left, gap_right): Don't call it.
16301
16302 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16303
16304 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16305 incurred during fontification.
16306
16307 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16308
16309 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16310 (DEFVAR_PER_BUFFER): Don't pass it.
16311
16312 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16313 (scrolling_window): Don't pass it.
16314
16315 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16316
16317 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16318
16319 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16320 and `suffix'.
16321 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16322 of variables specific to SELinux and computation of `encoded_absname'.
16323
16324 * image.c (XPutPixel): Remove unused variable `height'.
16325
16326 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16327
16328 * unexw32.c (get_section_info): Remove unused variable `section'.
16329
16330 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16331 (system_process_attributes): Remove unused variable `sess'.
16332 (sys_read): Remove unused variable `err'.
16333
16334 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16335 (w32_wnd_proc): Remove unused variable `isdead'.
16336 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16337 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16338 (x_create_tip_frame): Remove unused variable `tem'.
16339
16340 * w32inevt.c (w32_console_read_socket):
16341 Remove unused variable `no_events'.
16342
16343 * w32term.c (x_draw_composite_glyph_string_foreground):
16344 Remove unused variable `width'.
16345
16346 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16347
16348 * w32term.c (x_set_glyph_string_clipping):
16349 Don't pass uninitialized region to CombineRgn.
16350
16351 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16352
16353 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16354 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16355 (Fx_close_connection): Remove unused variable `i'.
16356
16357 * w32font.c (w32font_draw): Return number of glyphs.
16358 (w32font_open_internal): Remove unused variable `i'.
16359 (w32font_driver): Add missing initializer.
16360
16361 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16362 (fill_in_menu): Remove unused variable `items_added'.
16363
16364 * w32term.c (last_mouse_press_frame): Remove static global variable.
16365 (w32_clip_to_row): Remove unused variable `f'.
16366 (x_delete_terminal): Remove unused variable `i'.
16367
16368 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16369 (NOTHING): Remove unused static global variable.
16370 (uniscribe_check_otf): Remove unused variable `table'.
16371 (uniscribe_font_driver): Add missing initializers.
16372
16373 2011-03-23 Julien Danjou <julien@danjou.info>
16374
16375 * term.c (Fsuspend_tty, Fresume_tty):
16376 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16377 * window.c (temp_output_buffer_show):
16378 * insdel.c (signal_before_change):
16379 * frame.c (Fhandle_switch_frame):
16380 * fileio.c (Fdo_auto_save):
16381 * emacs.c (Fkill_emacs):
16382 * editfns.c (save_excursion_restore):
16383 * cmds.c (internal_self_insert):
16384 * callint.c (Fcall_interactively):
16385 * buffer.c (Fkill_all_local_variables):
16386 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16387 Use Frun_hooks.
16388 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16389 unconditionally since it does the check itself.
16390
16391 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16392
16393 Fix more problems found by GCC 4.5.2's static checks.
16394
16395 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16396 the first time through the loop, since we know p0 < p1 then.
16397 This also avoids a gcc -Wstrict-overflow warning.
16398
16399 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16400 leading to a memory leak, possible in functions like
16401 load_charset_map_from_file that can allocate an unbounded number
16402 of objects (Bug#8318).
16403
16404 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16405 that could (at least in theory) be that large.
16406
16407 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16408 This is less likely to overflow, and avoids undefined behavior if
16409 overflow does occur. All callers changed. Use strtoul to scan
16410 for the unsigned long integer.
16411 (pint2hrstr): Simplify and tune code slightly.
16412 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16413
16414 * scroll.c (do_scrolling): Work around GCC bug 48228.
16415 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16416
16417 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16418 This also avoids a warning with gcc -Wstrict-overflow.
16419 (validate_x_resource_name): Simplify count usage.
16420 This also avoids a warning with gcc -Wstrict-overflow.
16421
16422 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16423 fail (Bug#8306).
16424
16425 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16426
16427 * process.c (Fmake_network_process): Use socklen_t, not int,
16428 where POSIX says socklen_t is required in portable programs.
16429 This fixes a porting bug on hosts like 64-bit HP-UX, where
16430 socklen_t is wider than int (Bug#8277).
16431 (Fmake_network_process, server_accept_connection):
16432 (wait_reading_process_output, read_process_output):
16433 Likewise.
16434
16435 * process.c: Rename or move locals to avoid shadowing.
16436 (list_processes_1, Fmake_network_process):
16437 (read_process_output_error_handler, exec_sentinel_error_handler):
16438 Rename or move locals.
16439 (Fmake_network_process): Define label "retry_connect" only if needed.
16440 (Fnetwork_interface_info): Fix pointer signedness.
16441 (process_send_signal): Add cast to avoid pointer signedness problem.
16442 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16443 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16444
16445 Make tparam.h and terminfo.c consistent.
16446 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16447 Include tparam.h instead, since it declares them.
16448 * cm.h (PC): Remove extern decl; tparam.h now does this.
16449 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16450 * terminfo.c: Include tparam.h, to check interfaces.
16451 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16452 (tparam): Adjust signature to match interface in tparam.h;
16453 this removes some undefined behavior. Check that outstring and len
16454 are zero, which they always are with Emacs.
16455 * tparam.h (PC, BC, UP): New extern decls.
16456
16457 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16458 (xftfont_open): Rename locals to avoid shadowing.
16459
16460 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16461 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16462 (OTF_TAG_SYM): Omit macro if not needed.
16463 (ftfont_list): Remove unused local.
16464 (get_adstyle_property, ftfont_pattern_entity):
16465 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16466 Rename locals to avoid shadowing.
16467
16468 * xfont.c (xfont_list_family): Mark var as initialized.
16469
16470 * xml.c (make_dom): Now static.
16471
16472 * composite.c (composition_compute_stop_pos): Rename local to
16473 avoid shadowing.
16474 (composition_reseat_it): Remove unused locals.
16475 (find_automatic_composition, composition_adjust_point): Likewise.
16476 (composition_update_it): Mark var as initialized.
16477 (find_automatic_composition): Mark vars as initialized,
16478 with a FIXME (Bug#8290).
16479
16480 character.h: Rename locals to avoid shadowing.
16481 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16482 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16483 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16484 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16485 to avoid shadowing.
16486
16487 * textprop.c (property_change_between_p): Remove; unused.
16488
16489 * intervals.c (interval_start_pos): Now static.
16490
16491 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16492
16493 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16494 Rename locals to avoid shadowing.
16495
16496 * sound.c (wav_play, au_play, Fplay_sound_internal):
16497 Fix pointer signedness.
16498 (alsa_choose_format): Remove unused local var.
16499 (wav_play): Initialize a variable to 0, to prevent undefined
16500 behavior (Bug#8278).
16501
16502 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16503
16504 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16505
16506 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16507 clobbering (Bug#8298).
16508 * sysdep.c (sys_subshell): Likewise.
16509 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16510
16511 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16512 This should get cleaned up, so that child_setup has the
16513 same signature on all platforms.
16514
16515 * callproc.c (call_process_cleanup): Now static.
16516 (relocate_fd): Rename locals to avoid shadowing.
16517
16518 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16519
16520 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16521 not to be necessary, and produces flickering.
16522
16523 2011-03-20 Glenn Morris <rgm@gnu.org>
16524
16525 * config.in: Remove file.
16526
16527 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16528
16529 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16530 are now in src/globals.h.
16531 (syms_of_minibuf): Remove spurious & from previous change.
16532
16533 2011-03-20 Leo Liu <sdl.web@gmail.com>
16534
16535 * minibuf.c (completing-read-function): New variable.
16536 (completing-read-default): Rename from completing-read.
16537 (completing-read): Call completing-read-function.
16538
16539 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16540
16541 * xfaces.c (Fx_load_color_file):
16542 Read color file from absolute filename (bug#8250).
16543
16544 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16545
16546 * makefile.w32-in: Update dependencies.
16547
16548 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16549
16550 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16551
16552 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16553
16554 Fix more problems found by GCC 4.5.2's static checks.
16555
16556 * process.c (make_serial_process_unwind, send_process_trap):
16557 (sigchld_handler): Now static.
16558
16559 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16560 That way, the code declares only the vars that it needs.
16561 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16562 * s/cygwin.h (PTY_ITERATION): Likewise.
16563 * s/darwin.h (PTY_ITERATION): Likewise.
16564 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16565
16566 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16567 * process.c (allocate_pty): Don't declare stb unless it's needed.
16568
16569 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16570 (CONSTANTLIM): Remove; unused.
16571 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16572 Define only if needed.
16573
16574 * unexelf.c (unexec): Name an expression,
16575 to avoid gcc -Wbad-function-cast warning.
16576 Use a different way to cause a compilation error if anyone uses
16577 n rather than nn, a way that does not involve shadowing.
16578 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16579
16580 * deps.mk (unexalpha.o): Remove; unused.
16581
16582 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16583 * unexec.h: New file.
16584 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16585 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16586 Depend on unexec.h.
16587 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16588 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16589 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16590 Change as necessary to match prototype in unexec.h.
16591
16592 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16593 shadowing.
16594 (back_comment, skip_chars): Mark vars as initialized.
16595
16596 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16597 Rename locals to avoid shadowing.
16598
16599 * lread.c (read1): Rewrite so as not to use empty "else".
16600 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16601
16602 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16603
16604 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16605 warning when compiling print.c.
16606
16607 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16608 instead of using an uninitialized var.
16609 (font_sort_entities): Mark var as initialized.
16610
16611 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16612
16613 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16614 pointers to constants.
16615 (font_parse_fcname): Remove unused vars.
16616 (font_delete_unmatched): Now static.
16617 (font_get_spec): Remove; unused.
16618 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16619 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16620 Rename or move locals to avoid shadowing.
16621
16622 * fns.c (require_nesting_list, require_unwind): Now static.
16623 (Ffillarray): Rename locals to avoid shadowing.
16624
16625 * floatfns.c (domain_error2): Define only if needed.
16626 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16627
16628 * alloc.c (mark_backtrace): Move decl from here ...
16629 * lisp.h: ... to here, so that it can be checked.
16630
16631 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16632 (Fdefvar): Rewrite so as not to use empty "else".
16633 (lisp_indirect_variable): Name an expression,
16634 to avoid gcc -Wbad-function-cast warning.
16635 (Fdefvar): Rename locals to avoid shadowing.
16636
16637 * callint.c (quotify_arg, quotify_args): Now static.
16638 (Fcall_interactively): Rename locals to avoid shadowing.
16639 Use const pointer when appropriate.
16640
16641 * lisp.h (get_system_name, get_operating_system_release):
16642 Move decls here, to check interfaces.
16643 * process.c (get_operating_system_release): Move decl to lisp.h.
16644 * xrdb.c (get_system_name): Likewise.
16645 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16646 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16647 some of which prompt warnings from gcc -Wbad-function-cast.
16648 (Fformat_time_string, Fencode_time, Finsert_char):
16649 (Ftranslate_region_internal, Fformat):
16650 Rename or remove local vars to avoid shadowing.
16651 (Ftranslate_region_internal): Mark var as initialized.
16652
16653 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16654 avoid shadowing.
16655
16656 * lisp.h (eassert): Check that the argument compiles, even if
16657 ENABLE_CHECKING is not defined.
16658
16659 * data.c (Findirect_variable): Name an expression, to avoid
16660 gcc -Wbad-function-cast warning.
16661 (default_value, arithcompare, arith_driver, arith_error): Now static.
16662 (store_symval_forwarding): Rename local to avoid shadowing.
16663 (Fmake_variable_buffer_local, Fmake_local_variable):
16664 Mark variables as initialized.
16665 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16666
16667 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16668 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16669 Rename locals to avoid shadowing.
16670 (mark_stack): Move local variables into the #ifdef region where
16671 they're used.
16672 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16673 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16674 needed otherwise.
16675 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16676 (GC_STRING_CHARS): Remove; not used.
16677 (Fmemory_limit): Cast sbrk's returned value to char *.
16678
16679 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16680 avoids undefined behavior in theory.
16681
16682 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16683
16684 Use functions, not macros, for up- and down-casing (Bug#8254).
16685 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16686 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16687 to use the following functions instead of these macros.
16688 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16689 EMACS_INT, since callers assume the returned value fits in int.
16690 (upcase1): Likewise, for UPCASE_TABLE.
16691 (uppercasep, lowercasep, upcase): New static inline functions.
16692 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16693 the race-condition problem in the old DOWNCASE.
16694
16695 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16696 Rename locals to avoid shadowing.
16697 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16698 (regex_compile, re_search_2, re_match_2_internal):
16699 Remove unused local vars.
16700 (FREE_VAR): Rewrite so as not to use empty "else",
16701 which gcc can warn about.
16702 (regex_compile, re_match_2_internal): Mark locals as initialized.
16703 (RETALLOC_IF): Define only if needed.
16704 (WORDCHAR_P): Likewise. This one is never needed, but is used
16705 only in a comment talking about a compiler bug, so put inside
16706 the #if 0 of that comment.
16707 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16708 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16709 Remove; unused.
16710
16711 * search.c (boyer_moore): Rename locals to avoid shadowing.
16712 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16713 (PREV_CHAR_BOUNDARY): Likewise.
16714
16715 * search.c (simple_search): Remove unused var.
16716
16717 * dired.c (compile_pattern): Move decl from here ...
16718 * lisp.h: ... to here, so that it can be checked.
16719 (struct re_registers): New forward decl.
16720
16721 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16722
16723 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16724 All uses changed.
16725 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16726 Rename locals to avoid shadowing.
16727 (Fvertical_motion): Mark locals as initialized.
16728
16729 * casefiddle.c (casify_object, casify_region): Now static.
16730 (casify_region): Mark local as initialized.
16731
16732 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16733
16734 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16735 New macros, so that the caller can use some names other than
16736 gcpro1, gcpro2, etc.
16737 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16738 of the new macros.
16739 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16740 argument, for consistency with GCPRO2_VAR, etc: it is now the
16741 prefix of the variable, not the variable itself. All uses
16742 changed.
16743 * dired.c (directory_files_internal, file_name_completion):
16744 Rename locals to avoid shadowing.
16745
16746 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16747 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16748 dired.c's scmp function, had undefined behavior.
16749 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16750 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16751 * buffer.h: ... to here, because these macros use current_buffer,
16752 and the new implementation with inline functions needs to have
16753 current_buffer in scope now, rather than later when the macros
16754 are used.
16755 (downcase, upcase1): New static inline functions.
16756 (DOWNCASE, UPCASE1): Reimplement using these functions.
16757 This avoids undefined behavior in expressions like
16758 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16759 from race conditions in accessing the global variables
16760 case_temp1 and case_temp2.
16761 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16762 * lisp.h (case_temp1, case_temp2): Remove their decls.
16763 * character.h (ASCII_CHAR_P): Move from here ...
16764 * lisp.h: ... to here, so that the inline functions mentioned
16765 above can use them.
16766
16767 * dired.c (directory_files_internal_unwind): Now static.
16768
16769 * fileio.c (file_name_as_directory, directory_file_name):
16770 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16771 Now static.
16772 (file_name_as_directory): Use const pointers when appropriate.
16773 (Fexpand_file_name): Likewise. In particular, newdir might
16774 point at constant storage, so make it a const pointer.
16775 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16776 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16777 signedness issues.
16778 (Fset_file_times, Finsert_file_contents, auto_save_error):
16779 Rename locals to avoid shadowing.
16780
16781 * minibuf.c (choose_minibuf_frame_1): Now static.
16782 (Ftry_completion, Fall_completions): Rename or remove locals
16783 to avoid shadowing.
16784
16785 * marker.c (bytepos_to_charpos): Remove; unused.
16786
16787 * lisp.h (verify_bytepos, count_markers): New decls,
16788 so that gcc does not warn that these functions aren't declared.
16789
16790 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16791 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16792 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16793 (copy_text): Remove unused local var.
16794
16795 * filelock.c (within_one_second): Now static.
16796 (lock_file_1): Rename local to avoid shadowing.
16797
16798 * buffer.c (fix_overlays_before): Mark locals as initialized.
16799 (fix_start_end_in_overlays): Likewise. This function should be
16800 simplified by using pointers-to-pointers, but that's a different
16801 matter.
16802 (switch_to_buffer_1): Now static.
16803 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16804 (report_overlay_modification): Rename locals to avoid shadowing.
16805
16806 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16807 Fix pointer signedness issue.
16808 (sys_subshell): Mark local as volatile if checking for lint,
16809 to suppress a gcc -Wclobbered warning that does not seem to be right.
16810 (MAXPATHLEN): Define only if needed.
16811
16812 * process.c (serial_open, serial_configure): Move decls from here ...
16813 * systty.h: ... to here, so that they can be checked.
16814
16815 * fns.c (get_random, seed_random): Move extern decls from here ...
16816 * lisp.h: ... to here, so that they can be checked.
16817
16818 * sysdep.c (reset_io): Now static.
16819 (wait_for_termination_signal): Remove; unused.
16820
16821 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16822 (copy_keymap_item, append_key, push_text_char_description):
16823 Now static.
16824 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16825 (DENSE_TABLE_SIZE): Remove; unused.
16826 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16827 (describe_map_tree):
16828 Rename locals to avoid shadowing.
16829
16830 * keyboard.c: Declare functions static if they are not used elsewhere.
16831 (echo_char, echo_dash, cmd_error, top_level_2):
16832 (poll_for_input, handle_async_input): Now static.
16833 (read_char, kbd_buffer_get_event, make_lispy_position):
16834 (make_lispy_event, make_lispy_movement, apply_modifiers):
16835 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16836 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16837 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16838 (read_key_sequence, read_char): Mark locals as initialized.
16839 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16840
16841 * keyboard.h (make_ctrl_char): New decl.
16842 (mark_kboards): Move decl here ...
16843 * alloc.c (mark_kboards): ... from here.
16844
16845 * lisp.h (force_auto_save_soon): New decl.
16846
16847 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16848 (DEFINE_DUMMY_FUNCTION): New macro.
16849 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16850 Use it.
16851 (main): Add casts to avoid warnings
16852 if GCC considers string literals to be constants.
16853
16854 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16855
16856 * dbusbind.c: Pointer signedness fixes.
16857 (xd_signature, xd_append_arg, xd_initialize):
16858 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16859 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16860 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16861 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16862
16863 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16864 if GCC considers string literals to be constants.
16865 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16866
16867 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16868
16869 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16870 (print_preprocess, print_object): New macro to fix last change.
16871
16872 * print.c (print_preprocess): Don't forget font objects.
16873
16874 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16875
16876 * emacs.c (USAGE3): Doc fixes.
16877
16878 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
16879
16880 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
16881 structure.
16882
16883 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
16884
16885 * lisp.h (VWindow_system, Qfile_name_history):
16886 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
16887 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
16888 (w32_system_caret_x, w32_system_caret_y): Declare extern.
16889
16890 * w32select.c: Don't #include "keyboard.h".
16891 (run_protected): Add extern declaration for waiting_for_input.
16892
16893 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
16894 * w32console.c (detect_input_pending, read_input_pending)
16895 (encode_terminal_code):
16896 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
16897 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
16898 (w32_system_caret_y, Qfile_name_history):
16899 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
16900 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
16901 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
16902 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
16903 * w32proc.c (Qlocal, report_file_error):
16904 * w32term.c (Vwindow_system, updating_frame):
16905 * w32uniscribe.c (initialized, uniscribe_font_driver):
16906 Remove unneeded extern declarations.
16907
16908 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
16909
16910 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
16911
16912 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
16913
16914 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
16915 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
16916 These macros can no longer be used for assignment.
16917
16918 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
16919 Assign struct members directly, instead of using BUF_BEGV etc.
16920 (record_buffer_markers, fetch_buffer_markers): New functions for
16921 recording and fetching special buffer markers.
16922 (set_buffer_internal_1, set_buffer_temp): Use them.
16923
16924 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
16925
16926 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
16927
16928 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
16929 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
16930
16931 * xdisp.c (hscroll_window_tree):
16932 (reconsider_clip_changes): Use PT instead of BUF_PT.
16933
16934 2011-03-13 Eli Zaretskii <eliz@gnu.org>
16935
16936 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
16937 $(EMACS_ROOT)/lib/intprops.h.
16938
16939 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
16940
16941 Fix more problems found by GCC 4.5.2's static checks.
16942
16943 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
16944 to unsigned char * to avoid compiler diagnostic.
16945 (xg_free_frame_widgets): Make it clear that a local variable is
16946 needed only if USE_GTK_TOOLTIP.
16947 (gdk_window_get_screen): Make it clear that this macro is needed
16948 only if USE_GTK_TOOLTIP.
16949 (int_gtk_range_get_value): New function, which avoids a diagnostic
16950 from gcc -Wbad-function-cast.
16951 (xg_set_toolkit_scroll_bar_thumb): Use it.
16952 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16953 diagnostic from gcc -Wbad-function-cast.
16954 (get_utf8_string, xg_get_file_with_chooser):
16955 Rename locals to avoid shadowing.
16956 (create_dialog): Move locals to avoid shadowing.
16957
16958 * xgselect.c (xg_select): Remove unused var.
16959
16960 * image.c (four_corners_best): Mark locals as initialized.
16961 (gif_load): Initialize transparent_p to zero (Bug#8238).
16962 Mark another local as initialized.
16963 (my_png_error, my_error_exit): Mark with NO_RETURN.
16964
16965 * image.c (clear_image_cache): Now static.
16966 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
16967 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
16968 (x_edge_detection): Remove unnecessary cast that
16969 gcc -Wbad-function-cast diagnoses.
16970 (gif_load): Fix pointer signedness.
16971 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16972 (jpeg_load, gif_load): Rename locals to avoid shadowing.
16973
16974 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
16975
16976 Improve quality of tests for time stamp overflow.
16977 For example, without this patch (encode-time 0 0 0 1 1
16978 1152921504606846976) returns the obviously-bogus value (-948597
16979 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16980 reports time overflow. See
16981 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
16982 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16983 * editfns.c: Include limits.h and intprops.h.
16984 (TIME_T_MIN, TIME_T_MAX): New macros.
16985 (time_overflow): Move earlier, to before first use.
16986 (hi_time, lo_time): New functions, for an accurate test for
16987 out-of-range times.
16988 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16989 (Fget_internal_run_time): Don't assume time_t fits in int.
16990 (make_time): Use list2 instead of Fcons twice.
16991 (Fdecode_time): More accurate test for out-of-range times.
16992 (check_tm_member): New function.
16993 (Fencode_time): Use it, to test for out-of-range times.
16994 (lisp_time_argument): Don't rely on undefined left-shift and
16995 right-shift behavior when checking for time stamp overflow.
16996
16997 * editfns.c (time_overflow): New function, refactoring common code.
16998 (Fformat_time_string, Fdecode_time, Fencode_time):
16999 (Fcurrent_time_string): Use it.
17000
17001 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17002 * dired.c (make_time): Move to ...
17003 * editfns.c (make_time): ... here.
17004 * systime.h: Note the move.
17005
17006 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17007
17008 * fringe.c (update_window_fringes): Remove unused variables.
17009
17010 * unexmacosx.c (copy_data_segment): Also copy __got section.
17011 (Bug#8223)
17012
17013 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17014
17015 * termcap.c [MSDOS]: Include "msdos.h".
17016 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17017 Constify `char *' arguments and their references according to
17018 prototypes in tparam.h.
17019
17020 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17021
17022 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17023 Adapt all references accordingly.
17024
17025 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17026
17027 2011-03-11 Tom Tromey <tromey@redhat.com>
17028
17029 * buffer.c (syms_of_buffer): Remove obsolete comment.
17030
17031 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17032
17033 * termhooks.h (encode_terminal_code): Declare prototype.
17034
17035 * msdos.c (encode_terminal_code): Don't declare prototype.
17036
17037 * term.c (encode_terminal_code): Now external again, used by
17038 w32console.c and msdos.c.
17039
17040 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17041 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17042
17043 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17044
17045 Fix some minor problems found by GCC 4.5.2's static checks.
17046
17047 * fringe.c (update_window_fringes): Mark locals as initialized
17048 (Bug#8227).
17049 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17050
17051 * alloc.c (mark_fringe_data): Move decl from here ...
17052 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17053 to check its interface.
17054 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17055
17056 * fontset.c (free_realized_fontset): Now static.
17057 (Fset_fontset_font): Rename local to avoid shadowing.
17058 (fontset_font): Mark local as initialized.
17059 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17060
17061 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17062
17063 * xselect.c (x_disown_buffer_selections): Remove; not used.
17064 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17065 (x_own_selection, Fx_disown_selection_internal): Rename locals
17066 to avoid shadowing.
17067 (x_handle_dnd_message): Remove local to avoid shadowing.
17068
17069 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17070 so that the caller can use some name other than gcpro1.
17071 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17072 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17073 (Fx_backspace_delete_keys_p):
17074 Use them to avoid shadowing, and rename vars to avoid shadowing.
17075 (x_decode_color, x_set_name, x_window): Now static.
17076 (Fx_create_frame): Add braces to silence GCC warning.
17077 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17078 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17079 Remove unused locals.
17080 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17081 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17082 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17083 macros.
17084
17085 * xterm.h (x_mouse_leave): New decl.
17086
17087 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17088 Remove unused functions.
17089 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17090 (x_calc_absolute_position): Now static.
17091 (XTread_socket): Don't define label "out" unless it's used.
17092 Don't declare local "event" unless it's used.
17093 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17094 unless they are used.
17095 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17096 (x_fatal_error_signal): Remove; not used.
17097 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17098 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17099 (x_error_catcher, x_connection_closed, x_error_handler):
17100 (x_error_quitter, xembed_send_message, x_iconify_frame):
17101 (my_log_handler): Rename locals to avoid shadowing.
17102 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17103 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17104
17105 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17106 Rename or move locals to avoid shadowing.
17107 (tty_defined_color, merge_face_heights): Now static.
17108 (free_realized_faces_for_fontset): Remove; not used.
17109 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17110 does not deduce is never used uninitialized.
17111 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17112 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17113
17114 * terminal.c (store_terminal_param): Now static.
17115
17116 * xmenu.c (menu_highlight_callback): Now static.
17117 (set_frame_menubar): Remove unused local.
17118 (xmenu_show): Rename parameter to avoid shadowing.
17119 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17120 since they might point to immutable storage.
17121 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17122 since it's unused otherwise.
17123
17124 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17125 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17126 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17127 avoids a gcc -Wuninitialized diagnostic.
17128 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17129 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17130 does not deduce are never used uninitialized.
17131
17132 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17133
17134 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17135 * window.c (window_loop, size_window):
17136 (run_window_configuration_change_hook, enlarge_window): Likewise.
17137
17138 * window.c (display_buffer): Now static.
17139 (size_window): Mark variables that gcc -Wuninitialized
17140 does not deduce are never used uninitialized.
17141 * window.h (check_all_windows): New decl, to forestall
17142 gcc -Wmissing-prototypes diagnostic.
17143 * dispextern.h (bidi_dump_cached_states): Likewise.
17144
17145 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17146 shadowing.
17147 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17148 Include <limits.h>.
17149 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17150 and to avoid gcc -Wuninitialized warning.
17151 (load_charset_map): Mark variables that gcc -Wuninitialized
17152 does not deduce are never used uninitialized.
17153 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17154
17155 * coding.c (coding_set_source, coding_set_destination):
17156 Use "else { /* comment */ }" rather than "else /* comment */;"
17157 for clarity, and to avoid gcc -Wempty-body warning.
17158 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17159 a block, when the outer 'i' will do.
17160 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17161 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17162 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17163 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17164 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17165 Rename locals to avoid shadowing.
17166 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17167 * coding.c (emacs_mule_char, encode_invocation_designation):
17168 Now static, since they're not used elsewhere.
17169 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17170 (decode_coding_object, encode_coding_object, detect_coding_system):
17171 (decode_coding_emacs_mule): Mark variables that gcc
17172 -Wuninitialized does not deduce are never used uninitialized.
17173 (detect_coding_iso_2022): Initialize a local variable that might
17174 be used uninitialized. Leave a FIXME because it's not clear that
17175 this initialization is needed. (Bug#8211)
17176 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17177 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17178 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17179 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17180 Remove unused macros.
17181
17182 * category.c (hash_get_category_set): Remove unused local var.
17183 (copy_category_table): Now static, since it's not used elsewhere.
17184 * character.c (string_count_byte8): Likewise.
17185
17186 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17187 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17188
17189 * chartab.c (copy_sub_char_table): Now static, since it's not used
17190 elsewhere.
17191 (sub_char_table_ref_and_range, char_table_ref_and_range):
17192 Rename locals to avoid shadowing.
17193 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17194
17195 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17196 (BIDI_BOB): Remove unused macro.
17197
17198 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17199 deduce are never used uninitialized.
17200 * term.c (encode_terminal_code): Likewise.
17201
17202 * term.c (encode_terminal_code): Now static. Remove unused local.
17203
17204 * tparam.h: New file.
17205 * term.c, tparam.h: Include it.
17206 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17207 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17208 Move these decls to tparam.h, and make them agree with what
17209 is actually in tparam.c. The previous trick of using incompatible
17210 decls in different modules does not conform to the C standard.
17211 All callers of tparam changed to use tparam's actual API.
17212 * tparam.c (tparam1, tparam, tgoto):
17213 Use const pointers where appropriate.
17214
17215 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17216 * cm.h (struct cm): Likewise.
17217 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17218 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17219 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17220 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17221 (turn_on_face, init_tty): Likewise.
17222 * termchar.h (struct tty_display_info): Likewise.
17223
17224 * term.c (term_mouse_position): Rename local to avoid shadowing.
17225
17226 * alloc.c (mark_ttys): Move decl from here ...
17227 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17228
17229 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17230
17231 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17232
17233 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17234
17235 * search.c (compile_pattern_1): Remove argument regp, unused since
17236 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17237 (compile_pattern): Don't pass it.
17238
17239 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17240
17241 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17242 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17243 for ! HAVE_GTK3.
17244 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17245
17246 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17247
17248 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17249 gdk_window_get_screen, gdk_window_get_geometry,
17250 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17251 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17252 (xg_get_pixbuf_from_pixmap): New function.
17253 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17254 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17255 Call xg_get_pixbuf_from_pixmap instead of
17256 gdk_pixbuf_get_from_drawable.
17257 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17258 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17259 (xg_check_special_colors): Use GtkStyleContext and its functions
17260 for HAVE_GTK3.
17261 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17262 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17263 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17264 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17265 Call gtk_widget_get_preferred_size.
17266 (xg_frame_resized): gdk_window_get_geometry only takes 5
17267 parameters.
17268 (xg_win_to_widget, xg_event_is_for_menubar):
17269 Call gdk_x11_window_lookup_for_display.
17270 (xg_set_widget_bg): New function.
17271 (delete_cb): New function.
17272 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17273 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17274 (xg_set_background_color): Call xg_set_widget_bg.
17275 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17276 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17277 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17278 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17279 if ! HAVE_GTK3.
17280 (update_frame_tool_bar): Call gtk_widget_hide.
17281 (xg_initialize): Use GDK_KEY_g.
17282
17283 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17284 if ! HAVE_GTK3
17285 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17286
17287 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17288 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17289 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17290
17291 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17292
17293 * w32xfns.c (select_palette): Check success of RealizePalette against
17294 GDI_ERROR, not zero.
17295
17296 See ChangeLog.11 for earlier changes.
17297
17298 ;; Local Variables:
17299 ;; coding: utf-8
17300 ;; End:
17301
17302 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17303
17304 This file is part of GNU Emacs.
17305
17306 GNU Emacs is free software: you can redistribute it and/or modify
17307 it under the terms of the GNU General Public License as published by
17308 the Free Software Foundation, either version 3 of the License, or
17309 (at your option) any later version.
17310
17311 GNU Emacs is distributed in the hope that it will be useful,
17312 but WITHOUT ANY WARRANTY; without even the implied warranty of
17313 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17314 GNU General Public License for more details.
17315
17316 You should have received a copy of the GNU General Public License
17317 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.