src/w32gui.h (XParseGeometry): Do not declare.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
2
3 * w32gui.h (XParseGeometry): Do not declare.
4
5 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6
7 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
8 Ignore 'expected'. See Eli Zaretskii in
9 <http://bugs.gnu.org/12471#8> (last line).
10
11 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
12 (XParseGeometry): Now static. Substitute extremal values for
13 values that are out of range.
14
15 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
16
17 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
18
19 * nsfns.m (XParseGeometry): Remove.
20 (Fx_create_frame): Call x_set_offset to correctly interpret
21 top_pos in geometry.
22
23 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
24 (Fx_parse_geometry): If there is a space in string, call
25 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
26
27 2012-09-17 Eli Zaretskii <eliz@gnu.org>
28
29 * search.c (scan_buffer): Use character positions in calls to
30 region_cache_forward and region_cache_backward, not byte
31 positions. (Bug#12196)
32
33 * w32term.c (w32_read_socket): Set pending_signals to 1, like
34 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
35
36 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
37 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
38 emacs_blocked_malloc, now deleted.
39
40 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
41
42 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
43 The workaround was for improving performance on Solaris 2.4, but
44 is getting in the way now. Emacs will still work if someone is
45 still running Solaris 2.4 in a museum somewhere; Sun dropped
46 support for Solaris 2.4 in 2003.
47 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
48 * process.c (create_process) [HAVE_WORKING_VFORK]:
49 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
50 since Emacs no longer uses vfork on that platform.
51
52 2012-09-17 Glenn Morris <rgm@gnu.org>
53
54 * emacs.c: Use COPYRIGHT.
55
56 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
57
58 Remove configure's --without-sync-input option (Bug#12450).
59 When auditing signal-handling in preparation for cleaning it up,
60 I found that SYNC_INPUT has race conditions and would be a real
61 pain to fix. Since it's an undocumented and deprecated
62 configure-time option, now seems like a good time to remove it.
63 Also see <http://bugs.gnu.org/11080#16>.
64 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
65 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
66 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
67 (malloc_hysteresis):
68 (check_depth) [XMALLOC_OVERRUN_CHECK]:
69 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
70 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
71 (dont_register_blocks, bytes_used_when_reconsidered)
72 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
73 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
74 [!SYSTEM_MALLOC && !SYNC_INPUT]:
75 Remove. All uses removed.
76 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
77 implementation, one that depends on whether the new macro
78 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
79 is defined.
80 * atimer.c (run_timers, handle_alarm_signal):
81 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
82 (handle_async_input, process_pending_signals)
83 (handle_input_available_signal, init_keyboard):
84 * nsterm.m (ns_read_socket):
85 * process.c (wait_reading_process_output):
86 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
87 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
88 (emacs_write):
89 * xterm.c (XTread_socket):
90 Assume SYNC_INPUT.
91 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
92 * eval.c (handling_signal): Remove. All uses removed.
93 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
94 All uses replaced with the SYNC_INPUT version.
95 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
96 Remove decls.
97 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
98 Now static.
99
100 * font.c (Ffont_shape_gstring): Remove unused local.
101
102 2012-09-16 Glenn Morris <rgm@gnu.org>
103
104 * Makefile.in (clean): No longer run nextstep's clean.
105
106 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
107 (ns_frag): Remove.
108 (ns-app): Move here from ns.mk, and simplify.
109 (clean): Simplify nextstep entry.
110 * ns.mk: Remove file.
111
112 2012-09-16 Kenichi Handa <handa@gnu.org>
113
114 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
115 not covert the last few charactes.
116
117 2012-09-16 Kenichi Handa <handa@gnu.org>
118
119 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
120 here, but just check the validity of glyphs in the glyph-string.
121
122 2012-09-16 Martin Rudalics <rudalics@gmx.at>
123
124 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
125 any window as argument (Bug#12452).
126
127 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
128
129 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
130 to ns_term_init to avoid memory leak.
131
132 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
133 explicit retain/release.
134 (ns_term_init): Only allow one display. Initialize outerpool and
135 ns_*_types.
136
137 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
138
139 Port _setjmp fix to POSIXish hosts as well as Microsoft.
140 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
141 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
142 the Microsoft problem in a different way, by altering ../nt/config.nt.
143
144 2012-09-15 Eli Zaretskii <eliz@gnu.org>
145
146 * w32xfns.c:
147 * w32uniscribe.c:
148 * w32term.c:
149 * w32select.c:
150 * w32reg.c:
151 * w32proc.c:
152 * w32menu.c:
153 * w32inevt.c:
154 * w32heap.c:
155 * w32font.c:
156 * w32fns.c:
157 * w32console.c:
158 * w32.c:
159 * w16select.c: Remove inclusion of setjmp.h, as it is now included
160 by lisp.h. This completes removal of setjmp.h inclusion
161 erroneously announced in the previous commit. (Bug#12446)
162
163 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
164 more accurate.
165
166 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
167 not defined as a macro. The latter happens on MS-Windows.
168 (Bug#12446)
169
170 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
171
172 Port better to POSIX hosts lacking _setjmp (Bug#12446).
173 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
174 Some instances of '#include <setjmp.h>' removed, if the
175 only reason for the instance was because "lisp.h" was included.
176 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
177 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
178 and _longjmp with the new symbols. Emacs already uses _setjmp if
179 available, so this change affects only POSIXish hosts that have
180 sigsetjmp but not _setjmp, such as some versions of Solaris and
181 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
182 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
183 (png_load_body) [HAVE_PNG]:
184 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
185 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
186 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
187 since PNG requires jmp_buf. This is the only exception to the
188 general rule that we now use sys_setjmp and sys_longjmp.
189 This exception is OK since this code does not change the signal
190 mask or longjmp out of a signal handler.
191
192 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
193
194 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
195 Include "syssignal.h", for 'main_thread'.
196
197 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
198
199 Avoid out-of-range marker position (Bug#12426).
200 * insdel.c (replace_range, replace_range_2): Adjust
201 markers before overlays, as suggested by comments.
202 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
203 Remove redundant check before calling offset_intervals.
204
205 2012-09-14 Martin Rudalics <rudalics@gmx.at>
206
207 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
208 current buffer (Bug#12387).
209
210 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
211
212 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
213
214 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
215
216 Use a more backwards-compatible timer format (Bug#12430).
217 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
218 vector element, not from the 4th, since PSECS is now at the end.
219 (Fcurrent_idle_time): Doc fix.
220
221 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
222
223 Function to mark objects and remove killed buffers at once.
224 * alloc.c (discard_killed_buffers): Rename to ...
225 (mark_discard_killed buffers) ... new name. Add marking
226 of remaining objects. Fix comment. Adjust users.
227 (mark_object): Do not touch frame buffer lists here.
228 * frame.c (delete_frame): Reset frame buffer lists here.
229
230 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
231
232 Better workaround for GNOME bug when --enable-gcc-warnings.
233 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
234 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
235 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
236
237 Simplify SIGIO usage (Bug#12408).
238 The code that dealt with SIGIO was crufty and confusing, e.g., it
239 played tricks like "#undef SIGIO" but these tricks were not used
240 consistently. Simplify mostly by not #undeffing standard symbols,
241 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
242 or not as we please) rather than "defined SIGIO" (standard symbol
243 that we probably shouldn't #undef).
244 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
245 Modules that need it can include it.
246 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
247 * dispextern.h (ignore_sigio): New decl.
248 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
249 unconditionally, since it's now a no-op if !USABLE_SIGIO.
250 * emacs.c (shut_down_emacs):
251 * keyboard.c (kbd_buffer_store_event_hold):
252 Use ignore_sigio rather than invoking 'signal' directly.
253 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
254 for FIONREAD.
255 (FIONREAD, SIGIO): Do not #undef.
256 (tty_read_avail_input): Use #error rather than a syntax error.
257 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
258 for I_PIPE, used by SETUP_SLAVE_PTY.
259 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
260 * sysdep.c (croak): Remove; no longer needed. This bit of
261 temporary code, with Fred N. Fish's comment that it's temporary,
262 has been in Emacs since at least 1992!
263 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
264 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
265 * syssignal.h (croak): Remove decl.
266 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
267 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
268 now that we're termios-only.
269 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
270 * term.c (dissociate_if_controlling_tty): Use #error rather than
271 a run-time error.
272
273 Work around GCC and GNOME bugs when --enable-gcc-warnings.
274 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
275 to work around GNOME bug 683906.
276 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
277 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
278 This works around GCC bug 54561.
279
280 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
281
282 More fixes for 'volatile' and setjmp/longjmp.
283 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
284 * image.c (struct png_load_context) [HAVE_PNG]: New type.
285 (png_load_body) [HAVE_PNG]:
286 (jpeg_load_body) [HAVE_JPEG]:
287 New function, with most of the old parent function's body.
288 (png_load) [HAVE_PNG]:
289 (jpeg_load) [HAVE_JPEG]:
290 Invoke the new function, to avoid longjmp munging our locals.
291 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
292 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
293 longjmp is passed 2, as the C standard doesn't guarantee this.
294 Instead, store the failure code into mgr->failure_code.
295
296 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
297
298 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
299 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
300 (syms_of_keyboard): Remove support for unread-command-char.
301
302 2012-09-12 Eli Zaretskii <eliz@gnu.org>
303
304 * w32proc.c (sys_kill): If PID is our process ID and the signal is
305 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
306 violation. (Bug#12426)
307
308 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
309
310 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
311
312 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
313
314 * eval.c: Add `inhibit-debugger'.
315 (Qinhibit_debugger): New symbol.
316 (call_debugger): Bind it instead of Qdebug_on_error.
317 (maybe_call_debugger): Test Vinhibit_debugger.
318 (syms_of_eval): Define inhibit-debugger.
319 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
320 (syms_of_xdisp): Remove inhibit-debug-on-message.
321
322 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
323
324 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
325 If a nonvolatile local variable is written before a _longjmp to
326 the frame containing the variable, and is read after the _longjmp,
327 the value read is indeterminate. Some local variables of type
328 'struct handler' and 'struct catchtag' are used in this way, so
329 mark each of their slots as volatile if the slot can be set before
330 _longjmp and read afterwards.
331 * lisp.h (struct handler): var and chosen_clause are now volatile.
332 (struct catchtag): val, next, and pdlcount are now volatile.
333
334 * bidi.c (bidi_push_it, bidi_pop_it):
335 * fns.c (copy_hash_table):
336 * image.c (define_image_type):
337 * keyboard.c (kbd_buffer_store_event_hold):
338 * process.c (Fprocess_send_eof):
339 * xfaces.c (x_create_gc) [HAVE_NS]:
340 * xgselect.c (xg_select):
341 Prefer assignment to memcpy when either will do.
342
343 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
344 Use pointer-to-a-pointer to simplify and avoid a NILP check each
345 time an item is removed. No need to mark this function 'inline';
346 the compiler knows better than we do.
347
348 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
349
350 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
351 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
352 to change_frame_size (Bug#12388).
353 (windowDidResize:): Pass YES to updateFrameSize.
354
355 * nsterm.h: Add delay parameter to updateFrameSize.
356
357 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
358
359 Discard killed buffers from deleted window and frame objects.
360 This reduces an amount of references to killed buffers and
361 helps GC to reclaim them faster.
362 * alloc.c (discard_killed_buffers): New function.
363 (mark_object): Use it for deleted windows and frames.
364 (mark_object): If symbol's value is set up for a killed buffer
365 or deleted frame, restore it's global binding.
366 * data.c (swap_in_global_binding): Add GC notice.
367 (swap_in_symval_forwarding): Use convenient set_blv_where.
368 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
369 * window.h: ... to here.
370
371 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
372
373 Convenient macro to check whether the buffer is live.
374 * buffer.h (BUFFER_LIVE_P): New macro.
375 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
376 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
377
378 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
379
380 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
381 composition cases (Bug#12364).
382
383 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
384 overhang of succeeding glyphs overlapping box cursor.
385
386 * w32term.c (x_draw_glyph_string): Likewise.
387
388 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
389
390 Simplify, document, and port floating-point (Bug#12381).
391 The porting part of this patch fixes bugs on non-IEEE platforms
392 with frexp, ldexp, logb.
393 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
394 Now static.
395 * floatfns.c: Simplify discussion of functions that Emacs doesn't
396 support, by removing commented-out code and briefly listing the
397 C89 functions excluded. The commented-out stuff was confusing
398 maintenance, e.g., we thought we needed cbrt but it was commented out.
399 (logb): Remove decl; no longer needed.
400 (isfinite): New macro, if not already supplied.
401 (isnan): Don't replace any existing macro.
402 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
403 are present on all C89 platforms.
404 (Ffrexp): Do not special-case zero, as frexp does the right thing
405 for that case.
406 (Flogb): Do not use logb, as it doesn't have the desired meaning
407 on hosts that use non-base-2 floating point. Instead, stick with
408 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
409 frexp, to avoid getting an unspecified result.
410
411 * xdisp.c (Qinhibit_debug_on_message): Now static.
412
413 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
414
415 * nsterm.m (ns_update_begin): Set clip path to whole view by using
416 NSBezierPath (Bug#12131).
417
418 2012-09-10 Chong Yidong <cyd@gnu.org>
419
420 * fns.c (Fdelq, Fdelete): Doc fix.
421
422 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
423
424 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
425 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
426
427 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
428
429 * lisp.h (make_lisp_ptr): New macro to replace XSET.
430 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
431 Use it.
432
433 2012-09-09 Eli Zaretskii <eliz@gnu.org>
434
435 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
436 left fringe if the window has a left margin. This avoids leaving
437 traces of the cursor because its leftmost pixel is not drawn over.
438
439 * dispnew.c (update_window_line): When the left margin area of a
440 screen line is updated, set the redraw_fringe_bitmaps_p flag of
441 that screen line. (Bug#12277)
442
443 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
444
445 Assume C89 or later for math functions (Bug#12381).
446 This simplifies the code, and makes it a bit smaller and faster,
447 and (most important) makes it easier to clean up signal handling
448 since we can stop worring about floating-point exceptions in
449 library code. That was a problem before C89, but the problem
450 went away many years ago on all practical Emacs targets.
451 * data.c, image.c, lread.c, print.c:
452 Don't include <math.h>; no longer needed.
453 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
454 might be autoconfigured, as that never happens.
455 * data.c (fmod):
456 * doprnt.c (DBL_MAX_10_EXP):
457 * print.c (DBL_DIG):
458 Remove. C89 or later always defines these.
459 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
460 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
461 (arith_error, domain_error, domain_error2):
462 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
463 no longer needed -- we simply return what C returns. All uses removed.
464 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
465 the wrapped code.
466 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
467 Remove. All uses expanded, as these macros are no longer used
468 more than once and are now more trouble than they're worth.
469 (Ftan): Use tan, not sin / cos.
470 (Flogb): Assume C89 frexp.
471 (fmod_float): Assume C89 fmod.
472 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
473 (init_floatfns): Remove. All uses removed.
474
475 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
476
477 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
478 compositeToPoint for OSX < 10.6 (Bug#12390).
479
480 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
481
482 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
483 This produces more-accurate results.
484
485 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
486
487 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
488 changes (Bug#12088).
489
490 2012-09-08 Chong Yidong <cyd@gnu.org>
491
492 * syntax.c (Fstring_to_syntax): Doc fix.
493
494 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
495
496 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
497 in the internal border.
498 (x_set_window_size): Remove static variables and their usage.
499 (ns_redraw_scroll_bars): Fix NSTRACE arg.
500 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
501 fringe/internal border adjustment (Bug#11052).
502 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
503 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
504 (ns_fix_rect_ibw): Remove.
505 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
506 (ns_dumpglyphs_box_or_relief): Ditto.
507 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
508 adjustment.
509 (ns_dumpglyphs_image): Ditto.
510 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
511 border adjustment.
512 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
513 their usage. Add fringe_extended_p and its use as in other terms.
514 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
515 scroll bar was removed.
516 (updateFrameSize): New function.
517 (windowDidResize): Move code to updateFrameSize and call it.
518
519 * nsterm.h (EmacsView): Add updateFrameSize.
520
521 2012-09-07 Chong Yidong <cyd@gnu.org>
522
523 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
524
525 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
526
527 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
528
529 More signal-handler cleanup (Bug#12327).
530 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
531 Problem introduced when merging patches. Noted by Eli Zaretskii in
532 <http://bugs.gnu.org/12327#67>.
533 * floatfns.c: Comment fix.
534 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
535 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
536 and anyway the declaration is harmless even if SIGDANGER is not defined.
537 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
538 defined BROKEN_FIONREAD). systty.h formerly did this, but other
539 source files not surprisingly expected syssignal.h to define, or
540 not define, SIGIO, and it's cleaner to do it that way, for consistency.
541 Include <sys/ioctl.h>, for FIONREAD.
542 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
543 This eliminates a problem whereby other files mysteriously had
544 to include "syssignal.h" before including "systty.h" if they
545 wanted to use "#ifdef SIGIO".
546
547 2012-09-07 Eli Zaretskii <eliz@gnu.org>
548
549 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
550
551 * w32.c (sigemptyset): Empty the set.
552 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
553
554 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
555
556 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
557
558 * alloc.c (mark_buffer): Revert unsafe marking optimization.
559 (mark_object): Likewise for frame objects.
560
561 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
562
563 * syssignal.h (handle_on_main_thread): Always declare,
564 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
565 This ports to platforms without HAVE_PTHREAD.
566
567 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
568
569 Signal-handler cleanup (Bug#12327).
570 Emacs's signal handlers were written in the old 4.2BSD style with
571 sigblock and sigmask and so forth, and this led to some
572 inefficiencies and confusion. Rewrite these to use
573 pthread_sigmask etc. without copying signal sets around. Also,
574 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
575 'signal', and instead use functions that do not attempt to take
576 over the system name space. This patch causes Emacs's text
577 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
578 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
579 Do not include <signal.h> or "syssignal.h", as these
580 modules do not use signals.
581 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
582 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
583 Do not include <signal.h>, as "syssignal.h" does that for us now.
584 * atimer.c (sigmask_atimers): New function.
585 (block_atimers, unblock_atimers): New functions,
586 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
587 All uses replaced.
588 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
589 no longer needed here.
590 * emacs.c (main): Inspect existing signal handler with sigaction,
591 so that there's no need to block and unblock SIGHUP.
592 * sysdep.c (struct save_signal): New member 'action', replacing
593 old member 'handler'.
594 (save_signal_handlers, restore_signal_handlers):
595 Use sigaction instead of 'signal' to save and restore.
596 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
597 New function. All users of 'signal' modified to use set_sighandler
598 if they're writeonly, and to use sys_signal if they're read+write.
599 (emacs_sigaction_init, forwarded_signal): New functions.
600 (sys_signal): Remove. All uses replaced by calls to sigaction
601 and emacs_sigaction_init, or by direct calls to 'signal'.
602 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
603 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
604 all uses replaced by pthread_sigmask etc. calls.
605 * syssignal.h: Include <signal.h>.
606 (emacs_sigaction_init, forwarded_signal): New decls.
607 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
608 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
609 (sigmask, sys_sigmask): Remove; no longer needed.
610 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
611 (sigblock, sigunblock, sigfree):
612 (sigsetmask) [!defined sigsetmask]:
613 Remove. All uses replaced by pthread_sigmask.
614 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
615 no longer need to be replaced, and its typical old uses
616 are now done via emacs_sigaction_init and sigaction.
617 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
618 (sys_sigdel): Remove; unused.
619 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
620
621 2012-09-06 Eli Zaretskii <eliz@gnu.org>
622
623 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
624 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
625
626 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
627
628 Explicitly mark buffer_defaults and buffer_local_symbols.
629 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
630 mark_local_symbols here.
631 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
632 since special buffers aren't marked here any more.
633 (allocate_buffer): Chain new buffer with all_buffers here...
634 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
635 not here.
636 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
637 (syms_of_buffer): Remove staticpro of the above.
638 (init_buffer_once): Set names for buffer_defaults and
639 buffer_local_symbols.
640
641 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
642
643 Use bool for booleans in font-related modules.
644 * font.c (font_intern_prop, font_style_to_value)
645 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
646 (generate_otf_features, font_check_otf_features, font_check_otf)
647 (font_match_p, font_list_entities, font_at):
648 * fontset.c (fontset_id_valid_p, reorder_font_vector
649 (fontset_find_font, Fset_fontset_font)
650 (face_suitable_for_char_p) [0]:
651 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
652 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
653 (m17n_flt_initialized, ftfont_shape_by_flt):
654 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
655 * nsfont.m (nsfont_draw):
656 * w32font.c (w32font_draw):
657 * w32term.c (x_draw_glyphless_glyph_string_foreground):
658 Use bool for booleans.
659 * font.h: Adjust to above API changes.
660 (struct font, struct font_driver, struct font_driver_list):
661 Use bool for booleans.
662 (struct font): Remove useless member encoding_type.
663 All users removed.
664 * fontset.c, xftfont.c: Omit unnecessary static decls.
665
666 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
667
668 * alloc.c (mark_object): Revert window marking code
669 since it's unsafe for the Fset_window_configuration.
670
671 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
672
673 Fix race conditions with signal handlers and errno (Bug#12327).
674 Be more systematic about preserving errno whenever a signal
675 handler returns, even if it's not in the main thread. Do this by
676 renaming signal handlers to distinguish between signal delivery
677 and signal handling. All uses changed.
678 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
679 * data.c (deliver_arith_signal): Rename from arith_error.
680 * dispnew.c (deliver_window_change_signal): Rename from
681 window_change_signal.
682 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
683 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
684 * keyboard.c (deliver_input_available_signal): Rename from
685 input_available_signal.
686 (deliver_user_signal): Rename from handle_user_signal.
687 (deliver_interrupt_signal): Rename from interrupt_signal.
688 * process.c (deliver_pipe_signal): Rename from send_process_trap.
689 (deliver_child_signal): Rename from sigchld_handler.
690 * atimer.c (handle_alarm_signal):
691 * data.c (handle_arith_signal):
692 * dispnew.c (handle_window_change_signal):
693 * emacs.c (handle_fatal_signal, handle_danger_signal):
694 * keyboard.c (handle_input_available_signal):
695 * keyboard.c (handle_user_signal, handle_interrupt_signal):
696 * process.c (handle_pipe_signal, handle_child_signal):
697 New functions, with the actual signal-handling code taken from the
698 original respective signal handlers, sans the sporadic attempts to
699 preserve errno, since that's now done by handle_on_main_thread.
700 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
701 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
702 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
703 Move to sysdep.c.
704 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
705 Move initialization of main_thread to sysdep.c's init_signals.
706 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
707 our usage, and simplifies the mainline code.
708 (record_child_status_change): New static function, as a helper
709 for handle_child_signal, and with most of the old child handler's
710 contents.
711 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
712 (handle_child_signal): Use the above.
713 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
714 Moved here from emacs.c.
715 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
716 code moved here from emacs.c's main function.
717 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
718 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
719 lets callers save and restore errno properly.
720
721 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
722
723 Remove redundant or unused things here and there.
724 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
725 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
726 * editfns.c (Fcompare_buffer_substrings): Likewise.
727 * frame.h (struct terminal, struct font_driver_list):
728 Remove redundant declarations.
729 * window.h (Qleft, Qright): Likewise.
730
731 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
732
733 Do not mark objects from deleted buffers, windows and frames.
734 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
735 (mark_object): Likewise for windows and frames.
736
737 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
738
739 * alloc.c (valid_lisp_object_p): Treat killed buffers,
740 buffer_defaults and buffer_local_symbols as valid objects.
741 Return special value to denote them.
742
743 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
744
745 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
746 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
747 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
748 (file_name_absolute_p, Fsubstitute_in_file_name):
749 (check_executable, check_writable, Ffile_accessible_directory_p)
750 (Fset_file_selinux_context, Fdefault_file_modes)
751 (Finsert_file_contents, choose_write_coding_system)
752 (Fwrite_region, build_annotations, a_write, e_write)
753 (Fdo_auto_save):
754 * filelock.c (boot_time_initialized, get_boot_time)
755 (get_boot_time_1, lock_file_1, within_one_second):
756 * floatfns.c (in_float):
757 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
758 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
759 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
760 * lisp.h (struct Lisp_Hash_Table.cmpfn):
761 * window.c (compare_window_configurations):
762 Use bool for booleans.
763 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
764 (Fdefault_file_modes): Now mode_t, not int, for modes.
765 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
766 (internal_delete_file): Now returns void, not a (boolean) int,
767 since nobody was looking at the return value.
768 * lisp.h, window.h: Adjust to above API changes.
769
770 * xdisp.c (set_message): Simplify and reindent last change.
771
772 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
773
774 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
775
776 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
777
778 * eval.c (call_debugger): Make the function non-static so that we
779 can call it from set_message.
780
781 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
782 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
783
784 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
785
786 Give more-useful info on a fatal error (Bug#12328).
787 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
788 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
789 of doing the work ourselves.
790 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
791 do most of the work.
792 (fatal_error_backtrace): New function, taken from the guts
793 of the old fatal_error_signal, but with a new option to output
794 a backtrace.
795 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
796 info about the signal than just its number.
797 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
798 * sysdep.c: Include <execinfo.h>
799 (emacs_backtrace): New function, taken partly from the previous
800 code of the 'die' function.
801 (emacs_abort): Call fatal_error_backtrace rather than abort.
802
803 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
804
805 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
806 eager (load-time) macro-expansion.
807 * lisp.mk (lisp): Add macroexp.
808
809 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
810
811 Simplify redefinition of 'abort' (Bug#12316).
812 Do not try to redefine the 'abort' function. Instead, redo
813 the code so that it calls 'emacs_abort' rather than 'abort'.
814 This removes the need for the NO_ABORT configure-time macro
815 and makes it easier to change the abort code to do a backtrace.
816 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
817 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
818 Remove; sysdep.c's emacs_abort now takes its place.
819 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
820 'abort' changed to use 'emacs_abort'.
821 * msdos.c (dos_abort) [defined abort]: Remove; not used.
822 (abort) [!defined abort]: Rename to ...
823 (emacs_abort): ... new name.
824 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
825 the place of the old 'abort' in emacs.c.
826 * w32.c, w32fns.c (abort): Do not #undef.
827 * w32.c (emacs_abort): Rename from w32_abort.
828
829 2012-09-04 Eli Zaretskii <eliz@gnu.org>
830
831 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
832 offsets[j].dv, since the y axis of the screen coordinates points
833 down, while the y axis of the font definition coordinates points
834 up. This fixes display of Arabic diacritics such as KASRA and
835 KASRATAN. (Bug#11860)
836
837 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
838
839 Be more systematic about _setjmp vs setjmp.
840 * alloc.c (test_setjmp, mark_stack):
841 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
842 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
843 (png_load, my_error_exit, jpeg_load):
844 * process.c (send_process_trap, send_process):
845 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
846 The underscored versions are up to 30x faster on some hosts.
847 Formerly, the code used setjmp+longjmp sometimes and
848 _setjmp+_longjmp at other times, with no particular reason to
849 prefer setjmp+longjmp.
850
851 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
852
853 Fix minor problem found by static checking.
854 * buffer.c (Fdelete_all_overlays): Return nil.
855
856 2012-09-03 Martin Rudalics <rudalics@gmx.at>
857
858 * buffer.c (Fdelete_all_overlays): New function.
859
860 2012-09-03 Chong Yidong <cyd@gnu.org>
861
862 * gtkutil.c: Add extern decl for Qxft.
863
864 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
865
866 * emacs.c, eval.c: Use bool for boolean.
867 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
868 (malloc_using_checking) [DOUG_LEA_MALLOC]:
869 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
870 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
871 (main, decode_env_path, Fdaemon_initialized):
872 * eval.c (call_debugger, Finteractive_p, interactive_p):
873 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
874 (maybe_call_debugger, Fbacktrace):
875 * process.c (read_process_output, exec_sentinel):
876 Use bool for booleans.
877 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
878 All callers changed.
879 * eval.c (interactive_p): Omit always-true boolean argument
880 EXCLUDE_SUBRS_P. All callers changed.
881 * dispextern.h, lisp.h: Reflect above API changes.
882 * firstfile.c (dummy): Use the address of 'main', whose signature
883 won't change, instead of the address of 'initialize', whose
884 signature just changed from int to bool.
885 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
886 * msdos.c (fatal_error_in_progress): ... from here.
887 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
888 of incrementing it.
889 (redisplay_internal, unwind_redisplay): Simply clear
890 REDISPLAYING_P when unwinding, instead of saving its previous,
891 always-false value and then restoring it.
892
893 Clean up some extern decls.
894 Mostly, this hoists extern decls out of .c files and into .h files.
895 That way, we're more likely to catch errors if the interfaces change.
896 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
897 declare xg_mark_data.
898 * dispextern.h (x_frame_parm_handlers):
899 * font.h (Qxft):
900 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
901 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
902 (Qultra_bold, Qoblique, Qitalic):
903 Move extern decl here from .c file.
904 * alloc.c (xg_mark_data) [USE_GTK]:
905 * doc.c (Qclosure):
906 * eval.c (Qlexical_binding):
907 * fns.c (time) [!HAVE_UNISTD_H]:
908 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
909 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
910 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
911 * lread.c (Qinternal_interpreter_environment):
912 * minibuf.c (Qbuffer):
913 * process.c (QCfamily, QCfilter):
914 * widget.c (free_frame_faces):
915 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
916 * xfont.c (x_clear_errors):
917 * xterm.c (x_frame_parm_handlers):
918 Remove now-redundant extern decls.
919 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
920 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
921 Now static.
922 * xfaces.c: Remove unnecessary static decls.
923 * xterm.c (updating_frame): Remove decl of nonexistent object.
924
925 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
926 when building globals.h, as the objects that are not built on
927 this host are not needed to compile C files on this host.
928
929 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
930
931 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
932
933 * frame.h: Add missing prototype for x_wm_set_size_hint.
934
935 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
936
937 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
938 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
939 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
940 (Fsubstitute_command_keys):
941 * editfns.c (region_limit, find_field, Fconstrain_to_field)
942 (save_excursion_save, save_excursion_restore)
943 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
944 (format_time_string, general_insert_function)
945 (make_buffer_string, make_buffer_string_both)
946 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
947 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
948 (copy_text, insert_1, insert_1_both, insert_from_string)
949 (insert_from_string_before_markers, insert_from_string_1)
950 (insert_from_buffer, insert_from_buffer_1, replace_range)
951 (replace_range_2, del_range_1, del_range_byte, del_range_both)
952 (del_range_2, modify_region):
953 * intervals.c (intervals_equal, balance_possible_root_interval)
954 (adjust_intervals_for_insertion, merge_properties_sticky)
955 (graft_intervals_into_buffer, lookup_char_property)
956 (adjust_for_invis_intang, set_point_both)
957 (get_property_and_range, compare_string_intervals)
958 (set_intervals_multibyte_1, set_intervals_multibyte):
959 * keyboard.c (decode_timer):
960 Use bool for boolean.
961 * intervals.h, lisp.h, systime.h: Reflect above API changes.
962 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
963
964 2012-09-02 Chong Yidong <cyd@gnu.org>
965
966 * keymap.c (push_key_description): Print M-TAB as C-M-i
967 (Bug#11758).
968
969 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
970
971 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
972 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
973 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
974 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
975 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
976 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
977 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
978
979 2012-09-01 Eli Zaretskii <eliz@gnu.org>
980
981 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
982 more than one grapheme cluster passed to the shaper: compute the
983 offset adjustment values separately for each cluster. (Bug#11860)
984
985 * image.c: Restore mistakenly removed inclusion of w32.h. Without
986 it, GCC doesn't see prototypes of w32_delayed_load, and complains
987 about implicit conversions from integer to pointer.
988
989 2012-09-01 Daniel Colascione <dancol@dancol.org>
990
991 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
992 system used too early.
993
994 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
995
996 Better seed support for (random).
997 * emacs.c (main): Call init_random.
998 * fns.c (Frandom): Set the seed from a string argument, if given.
999 Remove long-obsolete Gentzel cruft.
1000 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1001 (init_random): New function.
1002
1003 2012-09-01 Daniel Colascione <dancol@dancol.org>
1004
1005 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1006 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1007 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1008 x_wm_set_size_hint, x_query_colors, x_real_positions,
1009 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1010 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1011 all of which have been moved to common code.
1012
1013 * xfaces.c: Include TERM_HEADER instead of listing all possible
1014 window-system headers.
1015
1016 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1017 to match header.
1018
1019 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1020 directly accessing frame internals.
1021
1022 * w32font.h: Include font.h. Define syms_of_w32font and
1023 globals_of_w32font.
1024
1025 * process.c: Include TERM_HEADER instead of listing all possible
1026 window-system headers.
1027
1028 * nsterm.h: Remove declarations now in frame.h. Define
1029 FRAME_X_SCREEN, FRAME_X_VISUAL.
1030
1031 * menu.c: Include TERM_HEADER instead of listing all possible
1032 window-system headers.
1033
1034 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1035 window system.
1036
1037 * keyboard.c: Include TERM_HEADER instead of listing all possible
1038 window-system headers.
1039
1040 * image.c: Include TERM_HEADER instead of listing all possible
1041 window-system headers. Declare Vlibrary_cache when compiling for
1042 Windows.
1043
1044 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1045 window system declarations.
1046
1047 * frame.h: Move common functions here: set_frame_menubar,
1048 x_set_window_size, x_sync, x_get_focus_frame,
1049 x_set_mouse_position, x_set_mouse_pixel_position,
1050 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1051 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1052 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1053 x_activate_menubar, x_real_positions, x_bitmap_icon,
1054 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1055 and x_query_colors.
1056
1057 * frame.c: Include TERM_HEADER instead of listing all possible
1058 window-system headers.
1059
1060 * font.c: Include TERM_HEADER instead of listing all possible
1061 window-system headers.
1062
1063 * emacs.c: Include TERM_HEADER.
1064
1065 * dispnew.c: Include TERM_HEADER instead of listing all possible
1066 window-system headers.
1067
1068 * ccl.h: Include character.h.
1069
1070 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1071 the current window system; include in list of objects to link into
1072 Emacs.
1073
1074 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1075
1076 Remove mark_ttys function and fix tty_display_info initialization.
1077 * lisp.h (mark_ttys): Remove prototype.
1078 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1079 to mark_ttys because all possible values of 'top_frame' slot are
1080 the frames which are reachable from Vframe_list.
1081 * term.c (mark_ttys): Remove.
1082 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1083
1084 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1085
1086 Change struct frame bitfields from unsigned char to unsigned.
1087 * frame.h (struct frame): Change type of 'display_preempted',
1088 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1089 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1090 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1091 bitfields from unsigned char to unsigned.
1092
1093 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1094
1095 Remove unused member of struct x_output and struct w32_output.
1096 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1097 * w32term.h (struct w32_output): Likewise.
1098
1099 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1100
1101 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1102 does not become zero (Bug#12234).
1103
1104 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1105
1106 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1107 for GCC 4.7.1 x86-64.
1108
1109 2012-08-30 Glenn Morris <rgm@gnu.org>
1110
1111 * lread.c (init_lread): For out-of-tree builds, only add the
1112 source directory's site-lisp dir to the load-path if it exists,
1113 consistent with in-tree builds. (Bug#12302)
1114
1115 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1116
1117 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1118 button_values to NULL. Call setStykeMask so dialogs get a close button.
1119 (windowShouldClose:): Set window_closed.
1120 (dealloc): New member, free button_values.
1121 (process_dialog:): Make member function. Remove window argument,
1122 replace window with self. Count buttons and allocate and store values
1123 in button_values.
1124 (addButton:value:row:): value is int with the name tag. Call setTag
1125 with tag. Remove return self, declare return value as void.
1126 (addString:row:): Remove return self, declare return value as void.
1127 (addSplit): Remove return self, declare return value as void.
1128 (clicked:): Remove return self, declare return value as void.
1129 Set dialog_return to button_values[seltag]. Code formatting change.
1130 (initFromContents:isQuestion:): Adjust call to process_dialog.
1131 Code formatting change.
1132 (timeout_handler:): Set timer_fired to YES.
1133 (runDialogAt:): Set timer_fired to NO.
1134 Handle click on close button as quit.
1135
1136 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1137 Add window_closed and button_values. Add void as return value for
1138 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1139 Add process_dialog as new member.
1140
1141 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1142
1143 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1144 is not one of the heaps we manage. (Bug#12242)
1145
1146 2012-08-28 Glenn Morris <rgm@gnu.org>
1147
1148 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1149
1150 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1151
1152 * window.c (Fset_window_configuration): Remove handling of
1153 auto-buffer-name window parameter. Install revision of reverted
1154 fix.
1155
1156 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1157
1158 Do not allow to set major mode for a dead buffer.
1159 * buffer.c (Fset_buffer_major_mode): Signal an error
1160 if the buffer is dead.
1161 (Fother_buffer, other_buffer_safely): Remove redundant
1162 nested declaration.
1163
1164 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1165
1166 Always use set_buffer_if_live to restore original buffer at unwind.
1167 * buffer.h (record_unwind_current_buffer): New function.
1168 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1169 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1170 * undo.c, window.c: Adjust users.
1171 * buffer.c (set_buffer_if_live): Fix comment.
1172
1173 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1174
1175 Fix usage of set_buffer_internal.
1176 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1177 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1178 * coding.c (decode_coding): Omit redundant test.
1179 * fileio.c (decide_coding_unwind): Likewise.
1180 * fns.c (secure_hash): Likewise.
1181 * insdel.c (modify_region): Likewise.
1182 * keyboard.c (command_loop_1): Likewise.
1183 * print.c (PRINTFINISH): Likewise.
1184 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1185
1186 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1187
1188 * dispnew.c: Use bool for boolean.
1189 (frame_garbaged, display_completed, delayed_size_change)
1190 (fonts_changed_p, add_window_display_history)
1191 (add_frame_display_history, verify_row_hash)
1192 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1193 (row_equal_p, realloc_glyph_pool)
1194 (allocate_matrices_for_frame_redisplay)
1195 (showing_window_margins_p)
1196 (adjust_frame_glyphs_for_frame_redisplay)
1197 (build_frame_matrix_from_leaf_window, make_current)
1198 (mirrored_line_dance, mirror_line_dance, update_frame)
1199 (update_window_tree, update_single_window)
1200 (check_current_matrix_flags, update_window, update_text_area)
1201 (update_window_line, set_window_update_flags, scrolling_window)
1202 (update_frame_1, scrolling, buffer_posn_from_coords)
1203 (do_pending_window_change, change_frame_size)
1204 (change_frame_size_1, sit_for):
1205 Use bool for boolean.
1206 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1207 and remove last int (actually boolean) argument, which was always 0.
1208 All callers changed.
1209 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1210 * dispextern.h (struct composition_it): Use bool for boolean.
1211 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1212 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1213 * dired.c (file_name_completion):
1214 Use bool for boolean. (This was missed in an earlier change.)
1215
1216 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1217
1218 * window.c (Fset_window_configuration): Revert first part of
1219 last change.
1220
1221 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1222
1223 * nsterm.h (NSPanel): New class variable dialog_return.
1224
1225 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1226 dialog_return.
1227 (windowShouldClose:): Use stop instead of stopModalWithCode.
1228 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1229 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1230 event.
1231 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1232 modal loop returns.
1233
1234 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1235
1236 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1237 * composite.c (find_composition, composition_gstring_p)
1238 (composition_reseat_it, find_automatic_composition):
1239 * data.c (let_shadows_buffer_binding_p)
1240 (let_shadows_global_binding_p, set_internal, make_blv)
1241 (Fmake_variable_buffer_local, Fmake_local_variable)
1242 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1243 (cons_to_signed, arith_driver):
1244 * dbusbind.c (xd_in_read_queued_messages):
1245 * dired.c (directory_files_internal, file_name_completion):
1246 Use bool for booleans.
1247 * dired.c (file_name_completion):
1248 * process.h (fd_callback):
1249 Omit int (actually boolean) argument. It wasn't being used.
1250 All uses changed.
1251 * composite.h, lisp.h: Reflect above API changes.
1252
1253 * cmds.c, coding.c: Use bool for booleans.
1254 * cmds.c (move_point, Fself_insert_command):
1255 * coding.h (struct composition status, struct coding_system):
1256 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1257 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1258 (emacs_mule_char, decode_coding_emacs_mule)
1259 (encode_coding_emacs_mule, detect_coding_iso_2022)
1260 (decode_coding_iso_2022, encode_invocation_designation)
1261 (encode_designation_at_bol, encode_coding_iso_2022)
1262 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1263 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1264 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1265 (encode_coding_raw_text, detect_coding_charset)
1266 (decode_coding_charset, encode_coding_charset, detect_eol)
1267 (detect_coding, get_translation_table, produce_chars)
1268 (consume_chars, reused_workbuf_in_use)
1269 (make_conversion_work_buffer, code_conversion_save)
1270 (decode_coding_object, encode_coding_object)
1271 (detect_coding_system, char_encodable_p)
1272 (Funencodable_char_position, code_convert_region)
1273 (code_convert_string, code_convert_string_norecord)
1274 (Fset_coding_system_priority):
1275 * fileio.c (Finsert_file_contents):
1276 Use bool for booleans.
1277 * coding.h, lisp.h: Reflect above API changes.
1278 * coding.c: Remove unnecessary static function decls.
1279 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1280 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1281 not a boolean 'int', since callers never look at the return value.
1282 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1283 * coding.h (decoding_buffer_size, encoding_buffer_size)
1284 (emacs_mule_string_char): Remove unused extern decls.
1285 (struct iso_2022_spec, struct coding_system):
1286 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1287 (struct emacs_mule_spec): Remove unused field 'full_support'.
1288 All initializations removed.
1289 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1290
1291 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1292
1293 Fix spare memory change (Bug#12286).
1294 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1295 (valid_lisp_object_p): Likewise.
1296
1297 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1298
1299 * window.c (Fset_window_configuration): Record any window's old
1300 buffer if it's replaced (see Bug#8789). If the new current
1301 buffer doesn't appear in the selected window, go to its old
1302 point (Bug#12208).
1303
1304 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1305
1306 Special MEM_TYPE_SPARE to denote reserved memory.
1307 * alloc.c (enum mem_type): New memory type.
1308 (refill_memory_reserve): Use new type for spare memory.
1309 This prevents live_cons_p and live_string_p from incorrect
1310 detection of uninitialized objects from spare memory as live.
1311
1312 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1313
1314 Spelling fixes.
1315 * Makefile.in (.PHONY): versioclean -> versionclean.
1316
1317 Remove unused external symbols.
1318 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1319 * window.c (Qwindow_valid_p, decode_valid_window):
1320 Now static, not extern.
1321 * data.c (Qinterval): Remove; unused.
1322 (syms_of_data): Do not define 'interval'.
1323 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1324 * window.h (decode_valid_window):
1325 Remove decls.
1326
1327 * character.c, charset.c, chartab.c: Use bool for booleans.
1328 * character.c (lisp_string_width, string_count_byte8)
1329 (string_escape_byte8):
1330 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1331 (load_charset_map_from_file, map_charset_chars)
1332 (Fdefine_charset_internal, define_charset_internal)
1333 (Fdeclare_equiv_charset, find_charsets_in_text)
1334 (Ffind_charset_region, char_charset, Fiso_charset):
1335 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1336 (sub_char_table_set, sub_char_table_set_range)
1337 (char_table_set_range, optimize_sub_char_table)
1338 (map_sub_char_table):
1339 Use bool for boolean.
1340 * character.c (str_to_unibyte): Omit last boolean argument; it was
1341 always 0. All callers changed.
1342 * character.h, charset.h: Adjust to match previous changes.
1343 * character.h (char_printable_p): Remove decl of nonexistent function.
1344 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1345 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1346 are all boolean, so make them single-bit bitfields.
1347
1348 * lisp.h (ASET): Remove attempt to detect side effects.
1349 It was meant to be temporary and it often doesn't work,
1350 because when IDX has side effects the behavior of IDX==IDX
1351 is undefined. See Stefan Monnier in
1352 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1353
1354 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1355
1356 * lisp.h (functionp): New function (extracted from Ffunctionp).
1357 (FUNCTIONP): Use it.
1358 * eval.c (Ffunctionp): Use it.
1359
1360 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1361
1362 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1363 as that's faster and simpler than static storage. Don't bother
1364 with the g_main_context_query overhead if g_main_context_pending
1365 says no events are pending.
1366 (gfds, gfds_size): Remove these static vars.
1367 (xgselect_initialize): Remove; no longer needed.
1368 All uses and decls removed.
1369
1370 * emacs.c (fatal_error_signal_hook): Remove.
1371 All uses removed. This leftover from old code was always 0.
1372
1373 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1374 * casefiddle.c (casify_object, casify_region):
1375 * casetab.c (set_case_table):
1376 * category.c, category.h (word_boundary_p):
1377 * category.h (CHAR_HAS_CATEGORY):
1378 Use bool for booleans, instead of int.
1379
1380 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1381
1382 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1383
1384 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1385
1386 On assertion failure, print backtrace if available.
1387 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1388 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1389 * Makefile.in (LIB_EXECINFO): New macro.
1390 (LIBES): Use it.
1391
1392 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1393 * bytecode.c (exec_byte_code):
1394 * callint.c (check_mark, Fcall_interactively):
1395 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1396 (getenv_internal, sync_process_alive, call_process_exited):
1397 * lisp.h (USE_SAFE_ALLOCA):
1398 Use bool for booleans, instead of int.
1399 * lisp.h, process.h: Adjust prototypes to match above changes.
1400 * callint.c (Fcall_interactively): Don't assume the mark's
1401 offset fits in 'int'.
1402
1403 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1404
1405 * buffer.c, buffer.h: Use bool for boolean.
1406 * buffer.c (reset_buffer_local_variables)
1407 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1408 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1409 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1410 (overlay_touches_p, overlay_strings, Foverlay_put)
1411 (report_overlay_modification, call_overlay_mod_hooks):
1412 (mmap_enlarge, mmap_set_vars):
1413 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1414 Use bool for booleans, instead of int.
1415 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1416 since the 1-or-0 return value is always ignored anyway.
1417 (mmap_initialized_p):
1418 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1419 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1420
1421 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1422
1423 * bidi.c: Use bool for boolean.
1424 This is a bit more readable, and makes the text segment of bidi.o
1425 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1426 Presumably it's faster too.
1427 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1428 Now bool.
1429 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1430 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1431 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1432 (bidi_explicit_dir_char, bidi_level_of_next_char)
1433 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1434 Use bool for booleans, instead of int.
1435 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1436 (bidi_unshelve_cache): Adjust decls to match code.
1437
1438 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1439
1440 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1441 argument.
1442
1443 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1444
1445 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1446 * atimer.h: Include <stdbool.h>.
1447
1448 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1449
1450 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1451 compile time tests instead of run time tests on systems that do
1452 not use them.
1453 (FRAME_MAC_P): Remove leftover from deleted code.
1454 * frame.c (syms_of_frame): Remove leftover from deleted code.
1455
1456 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1457
1458 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1459
1460 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1461
1462 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1463 Otherwise, the compiler complains about (A?B:C) where B is void
1464 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1465 (fontset_add): Return void, for FONTSET_ADD.
1466
1467 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1468
1469 * alloc.c: Use bool for booleans.
1470 (gc_in_progress, abort_on_gc)
1471 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1472 (dont_register_blocks) [GC_MALLOC_CHECK]:
1473 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1474 (check_string_bytes, make_specified_string, memory_full)
1475 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1476 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1477 (mark_stack, valid_pointer_p, make_pure_string)
1478 (Fgarbage_collect, survives_gc_p, gc_sweep):
1479 Use bool for booleans, instead of int.
1480 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1481 Remove unused local.
1482 * alloc.c (PURE_POINTER_P):
1483 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1484 * editfns.c (Fformat):
1485 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1486 (Fdo_auto_save):
1487 * fns.c (sweep_weak_table):
1488 * lisp.h (suppress_checking, push_message, survives_gc_p)
1489 (make_pure_string, gc_in_progress, abort_on_gc):
1490 * lread.c (readchar, read1):
1491 * print.c (Fprin1_to_string):
1492 * xdisp.c (push_message):
1493 Use bool for booleans affected directly or indirectly by
1494 alloc.c's changes.
1495
1496 Make recently-introduced setters macros.
1497 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1498 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1499 (set_fontset_default, set_fontset_fallback): Rename from their
1500 upper-case counterparts, and make them functions rather than macros.
1501 This is more consistent with the other recently-introduced setters.
1502 These don't need to be inline, since they're local.
1503
1504 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1505
1506 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1507 the loop (Bug#12247).
1508
1509 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1510
1511 * lisp.h (vcopy): Use memcpy rather than our own loop.
1512 This fixes a performance regression introduced by the recent
1513 addition of vcopy. This means 'vcopy' will need to be modified
1514 for a copying collector, but that's OK. Also, tighten the
1515 checking in the assertion.
1516
1517 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1518
1519 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1520 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1521 non-base glyph for the width of the base character, according to
1522 what x_draw_composite_glyph_string_foreground expects.
1523 Generate WADJUST value according to composition_gstring_width's
1524 expectations, to produce correct width of the composed character.
1525 Reverse the sign of the DU offset produced by ScriptPlace.
1526
1527 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1528
1529 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1530
1531 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1532
1533 Avoid direct writes to contents member of struct Lisp_Vector.
1534 * lisp.h (vcopy): New function to copy data into vector.
1535 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1536 * fns.c (Ffillarray): Use ASET.
1537 * keyboard.c (timer_check_2): Use AREF and ASET.
1538 (append_tool_bar_item, Frecent_keys): Use vcopy.
1539 * lread.c (read_vector): Use ASET.
1540 * msdos.c (Frecent_doskeys): Use vcopy.
1541 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1542 (Finternal_merge_in_global_face): Use ASET and vcopy.
1543 * xfont.c (xfont_list_pattern): Likewise.
1544
1545 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1546
1547 * window.c (Fwindow_point): For the selected window always return
1548 the position of its buffer's point.
1549 (Fset_window_point): For the selected window always go in its
1550 buffer to the specified position.
1551
1552 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1553
1554 Setter macros for fontsets.
1555 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1556 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1557 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1558 Adjust users.
1559
1560 2012-08-20 Glenn Morris <rgm@gnu.org>
1561
1562 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1563 Don't assume that `ln -f' works.
1564
1565 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1566
1567 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1568 and later about non-assignments with no effect. See discussion at
1569 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1570 details.
1571
1572 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1573
1574 Inline setter functions for Lisp_Objects slots of struct specbinding.
1575 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1576 Adjust users.
1577
1578 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1579
1580 * window.c (select_window): Always make selected window's buffer
1581 current.
1582
1583 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1584
1585 Use AREF and ASET for docstrings of category tables.
1586 * category.h (CATEGORY_DOCSTRING): Use AREF.
1587 (SET_CATEGORY_DOCSTRING): Use ASET.
1588 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1589
1590 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1591
1592 Inline setter functions for hash table members.
1593 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1594 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1595 (set_hash_key_and_value, set_hash_index, set_hash_next)
1596 (set_hash_hash): New functions.
1597 * charset.c, fns.c: Adjust users.
1598
1599 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1600
1601 Inline getter and setter functions for per-buffer values.
1602 * buffer.h (per_buffer_default, set_per_buffer_default)
1603 (per_buffer_value, set_per_buffer_value): New functions.
1604 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1605 * buffer.c, data.c: Adjust users.
1606
1607 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1608
1609 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1610
1611 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1612
1613 Rely on <config.h> + <unistd.h> to declare 'environ',
1614 as gnulib does this if the system doesn't.
1615 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1616 Remove declaration. MS-Windows declares it on stdlib.h which is
1617 included by conf_post.h.
1618 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1619 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1620 * vm-limit.c: Include <unistd.h>, for 'environ'.
1621
1622 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1623 (start_of_data): Remove decl; mem-limits.h provides it.
1624
1625 * xdisp.c (handle_invisible_prop): Make it a bit faster
1626 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1627
1628 2012-08-19 Chong Yidong <cyd@gnu.org>
1629
1630 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1631 ends (Bug#3874).
1632
1633 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1634
1635 * .gdbinit: Use call instead of set when calling a function in the
1636 inferior.
1637
1638 * data.c (set_internal): Don't use set_blv_found.
1639 (Fkill_local_variable): Likewise.
1640
1641 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1642
1643 * nsfont.m (ns_ascii_average_width): Ensure the string
1644 ascii_printable is initialized with a null-terminated character
1645 array. Otherwise, it can contain undesired extra characters.
1646
1647 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1648
1649 port new setting code to Sun C 5.8 2005/10/13
1650 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1651 Return void, not Lisp_Object. Otherwise, the compiler
1652 complains about (A?B:C) where B is void and C is Lisp_Object
1653 when compiling CHAR_TABLE_SET, due to the recent change to
1654 the API of sub_char_table_set_contents.
1655
1656 2012-08-18 Chong Yidong <cyd@gnu.org>
1657
1658 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1659 for the string case (Bug#3874).
1660
1661 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1662
1663 * buffer.h (BSET): Remove (Bug#12215).
1664 Replace all uses with calls to new setter functions.
1665 (bset_bidi_paragraph_direction, bset_case_canon_table)
1666 (bset_case_eqv_table, bset_directory, bset_display_count)
1667 (bset_display_time, bset_downcase_table)
1668 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1669 (bset_last_selected_window, bset_local_var_alist)
1670 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1671 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1672 (bset_width_table):
1673 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1674 (bset_auto_fill_function, bset_auto_save_file_format)
1675 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1676 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1677 (bset_cache_long_line_scans, bset_case_fold_search)
1678 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1679 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1680 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1681 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1682 (bset_header_line_format, bset_indicate_buffer_boundaries)
1683 (bset_indicate_empty_lines, bset_invisibility_spec)
1684 (bset_left_fringe_width, bset_major_mode, bset_mark)
1685 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1686 (bset_name, bset_overwrite_mode, bset_pt_marker)
1687 (bset_right_fringe_width, bset_save_length)
1688 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1689 (bset_scroll_up_aggressively, bset_selective_display)
1690 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1691 (bset_word_wrap, bset_zv_marker):
1692 * category.c (bset_category_table):
1693 * syntax.c (bset_syntax_table):
1694 New setter functions.
1695
1696 * process.h (PSET): Remove (Bug#12215).
1697 Replace all uses with calls to new setter functions.
1698 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1699 (PROCESS_INLINE): New macro.
1700 (pset_childp): New setter function.
1701 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1702 * process.c (PROCESS_INLINE):
1703 Define to EXTERN_INLINE, so that the corresponding functions
1704 are compiled into code.
1705 (pset_buffer, pset_command, pset_decode_coding_system)
1706 (pset_decoding_buf, pset_encode_coding_system)
1707 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1708 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1709 (pset_type, pset_write_queue): New setter functions.
1710
1711 * window.h (WSET): Remove (Bug#12215).
1712 Replace all uses with calls to new setter functions.
1713 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1714 (WINDOW_INLINE): New macro.
1715 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1716 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1717 (wset_total_lines, wset_vertical_scroll_bar)
1718 (wset_window_end_pos, wset_window_end_valid)
1719 (wset_window_end_vpos): New setter functions.
1720 * window.c (WINDOW_INLINE):
1721 Define to EXTERN_INLINE, so that the corresponding functions
1722 are compiled into code.
1723 (wset_combination_limit, wset_dedicated, wset_display_table)
1724 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1725 (wset_new_normal, wset_new_total, wset_next_buffers)
1726 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1727 (wset_prev_buffers, wset_right_fringe_width)
1728 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1729 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1730 (wset_window_parameters):
1731 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1732 (wset_column_number_displayed, wset_region_showing):
1733 New setter functions.
1734
1735 * termhooks.h (TSET): Remove (Bug#12215).
1736 Replace all uses with calls to new setter functions.
1737 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1738 (TERMHOOKS_INLINE): New macro.
1739 (tset_charset_list, tset_selection_alist): New setter functions.
1740 * terminal.c (TERMHOOKS_INLINE):
1741 Define to EXTERN_INLINE, so that the corresponding functions
1742 are compiled into code.
1743 (tset_param_alist): New setter function.
1744
1745 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1746
1747 * keyboard.h (KSET): Remove (Bug#12215).
1748 Replace all uses with calls to new setter functions.
1749 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1750 (KEYBOARD_INLINE): New macro.
1751 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1752 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1753 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1754 New setter functions.
1755 * keyboard.c (KEYBOARD_INLINE):
1756 Define to EXTERN_INLINE, so that the corresponding functions
1757 are compiled into code.
1758 (kset_echo_string, kset_kbd_queue)
1759 (kset_keyboard_translate_table, kset_last_prefix_arg)
1760 (kset_last_repeatable_command, kset_local_function_key_map)
1761 (kset_overriding_terminal_local_map, kset_real_last_command)
1762 (kset_system_key_syms): New setter functions.
1763
1764 * frame.h (FSET): Remove (Bug#12215).
1765 Replace all uses with calls to new setter functions.
1766 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1767 (FRAME_INLINE): New macro.
1768 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1769 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1770 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1771 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1772 (fset_param_alist, fset_root_window, fset_scroll_bars)
1773 (fset_selected_window, fset_title, fset_tool_bar_items)
1774 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1775 * frame.c (FRAME_INLINE):
1776 Define to EXTERN_INLINE, so that the corresponding functions
1777 are compiled into code.
1778 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1779
1780 A few more naming-convention fixes for getters and setters.
1781 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1782 and rename from buffer_overlays_set_before.
1783 (set_buffer_overlays_after): Move here from buffer.h, and rename
1784 from buffer_overlays_set_after.
1785 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1786 All uses changed.
1787 (set_buffer_intervals): Rename from buffer_set_intervals.
1788 * intervals.c (set_interval_object): Move here from intervals.h,
1789 and rename from interval_set_object.
1790 (set_interval_left): Move here from intervals.h, and rename from
1791 interval_set_left.
1792 (set_interval_right): Move here from intervals.h, and rename from
1793 interval_set_right.
1794 (copy_interval_parent): Move here from intervals.h, and rename from
1795 interval_copy_parent.
1796 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1797 (set_interval_plist): Rename from interval_set_plist.
1798 Return void, not Lisp_Object, since no caller uses the result.
1799 * lisp.h (string_intervals): Rename from string_get_intervals.
1800 (set_string_intervals): Rename from string_set_intervals.
1801
1802 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1803 (set_char_table_contents): Rename from char_table_set_contents.
1804 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1805 All uses changed. See the end of
1806 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1807
1808 * lisp.h (CSET): Remove (Bug#12215).
1809 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1810 (set_char_table_purpose): New functions,
1811 replacing CSET. All uses changed. For example, replace
1812 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1813 "set_char_table_parent (char_table, parent);".
1814 The old version was confusing because it used the same name
1815 'parent' for two different things.
1816
1817 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1818
1819 Functions to get and set Lisp_Object fields of buffer-local variables.
1820 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1821 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1822 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1823 * data.c, eval.c, frame.c: Adjust users.
1824
1825 2012-08-17 Chong Yidong <cyd@gnu.org>
1826
1827 * xfaces.c (merge_face_vectors): If the target font specfies a
1828 font spec, make the font's attributes take precedence over
1829 directly-specified attributes.
1830 (merge_face_ref): Recognize :font.
1831
1832 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1833
1834 Do not use memcpy for copying intervals.
1835 * intervals.c (reproduce_interval): New function.
1836 (reproduce_tree, reproduce_tree_obj): Use it.
1837 (reproduce_tree_obj): Remove prototype.
1838
1839 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1840
1841 * lisp.h (duration_to_sec_usec): Remove unused decl.
1842
1843 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1844
1845 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1846 to an allocated instance of NSString, not to the class itself.
1847
1848 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1849
1850 * makefile.w32-in (C_CTYPE_H): New macro.
1851 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1852 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1853 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1854
1855 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 Use ASCII tests for character types.
1858 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1859 * xfns.c, xterm.c:
1860 Don't include <ctype.h>; was not needed.
1861 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1862 * sysdep.c, xfaces.c:
1863 Include <c-ctype.h> instead of <ctype.h>.
1864 * nsterm.m: Include <c-ctype.h>.
1865 * charset.c (read_hex):
1866 * doc.c (Fsnarf_documentation):
1867 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1868 (DRIVE_LETTER) [DOS_NT]:
1869 (Ffile_name_directory, Fexpand_file_name)
1870 (Fsubstitute_in_file_name):
1871 * font.c (font_parse_xlfd, font_parse_fcname):
1872 * frame.c (x_set_font_backend):
1873 * gtkutil.c (xg_get_font):
1874 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1875 * nsimage.m (hexchar):
1876 * nsterm.m (ns_xlfd_to_fontname):
1877 * sysdep.c (system_process_attributes):
1878 * xfaces.c (hash_string_case_insensitive):
1879 Use C-locale tests instead of locale-specific tests for character
1880 types, since we want the ASCII interpretation here, not the
1881 interpretation suitable for whatever happens to be the current locale.
1882
1883 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1884
1885 Consistently check windows for validity/liveness
1886 (Bug#11984, Bug#12025, Bug#12026).
1887 * lisp.h (CHECK_VALID_WINDOW): New macro.
1888 * window.c (decode_window): Rename to decode_live_window.
1889 (decode_valid_window, Fwindow_valid_p): New functions.
1890 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1891 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1892 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1893 (Fwindow_prev_sibling, Fwindow_combination_limit)
1894 (Fset_window_combination_limit, Fwindow_use_time)
1895 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1896 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1897 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1898 (Fwindow_hscroll, Fset_window_hscroll)
1899 (Fwindow_redisplay_end_trigger)
1900 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1901 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1902 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1903 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1904 (Fwindow_end, Fset_window_point, Fset_window_start)
1905 (Fpos_visible_in_window_p, Fwindow_line_height)
1906 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1907 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1908 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1909 (Fset_window_parameter, Fwindow_display_table)
1910 (Fset_window_display_table, Fdelete_other_windows_internal)
1911 (Fset_window_buffer, Fset_window_new_total)
1912 (Fset_window_new_normal, Fdelete_window_internal)
1913 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1914 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1915 (Fwindow_scroll_bars): Check whether argument window is a valid or
1916 live window. Update doc-strings.
1917 (syms_of_window): New symbol Qwindow_valid_p.
1918 * keyboard.c (Fposn_at_x_y): Check whether argument
1919 frame_or_window denotes a valid window.
1920
1921 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1922
1923 Fix previous char table change.
1924 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1925 * chartab.c (optimize_sub_char_table): Likewise.
1926
1927 2012-08-16 Chong Yidong <cyd@gnu.org>
1928
1929 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1930
1931 * xfont.c (xfont_open):
1932 * xftfont.c (xftfont_open): Set the font's max_width field.
1933
1934 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1935 min_width to space_width and average_width to the average over
1936 printable ASCII characters.
1937 (ns_char_width): Code cleanup.
1938 (ns_ascii_average_width): New utility function.
1939
1940 * font.h (struct font): Update comments.
1941
1942 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1943
1944 Simple interface to set Lisp_Object fields of character tables.
1945 * lisp.h (CSET): New macro.
1946 (char_table_set_extras, char_table_set_contents)
1947 (sub_char_table_set_contents): New function.
1948 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
1949 * syntax.c: Adjust users.
1950
1951 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
1952
1953 * eval.c (eval_sub): Bind lexical-binding.
1954 * lread.c (Qlexical_binding): Make non-static.
1955
1956 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
1957
1958 * nsmenu.m (popupSession): Remove.
1959 (pop_down_menu): Remove endModalSession.
1960 (timeout_handler:): New method.
1961 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
1962 Call runModalForWindow. Check timer_fired when it returns.
1963 If not set, cancel timer and break out of loop.
1964 Otherwise loop again, with a new timeout.
1965
1966 * nsterm.m: Include fcntl.h if present.
1967 (fd_entry, t_readfds, inNsSelect): Remove.
1968 (select_writefds, select_valid, select_timeout, selfds)
1969 (select_mutex, apploopnr): Add.
1970 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
1971 Otherwise call kbd_buffer_store_event.
1972 (ns_send_appdefined): Remove release of fd_entry.
1973 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
1974 Increment and decrement apploopnr.
1975 (ns_select): If no file descriptors, just do a NSTimer.
1976 Otherwise copy read/write masks and start select thread (fd_handler).
1977 Start main loop and wait for application defined event.
1978 Inform select thread to stop selecting after main loop is exited.
1979 (ns_term_init): Create selfds pipe and set non-blocking.
1980 Initialize select_mutex. Start the select thread (fd_handler).
1981 (fd_handler:): Loop forever, wait for info from the main thread
1982 to either start or stop selecting. When select returns, send
1983 and appdefined event.
1984 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
1985 If not call kbd_buffer_store_event.
1986
1987 * nsterm.h (EmacsApp): fd_handler takes id argument.
1988 (EmacsDialogPanel): Add timer_fired and timeout_handler.
1989
1990 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
1991
1992 2012-08-15 Eli Zaretskii <eliz@gnu.org>
1993
1994 * region-cache.c (move_cache_gap): Update gap_len using the actual
1995 growth of the boundaries array. Do not change cache_len.
1996 (Bug#12196)
1997
1998 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1999
2000 Generalize and cleanup font subsystem checks.
2001 * font.h (FONT_DEBUG, font_assert): Remove.
2002 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2003 Change font_assert to eassert. Use eassert where appropriate.
2004
2005 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2006
2007 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2008
2009 2012-08-15 Chong Yidong <cyd@gnu.org>
2010
2011 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2012 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2013 extract the font descriptor instead of just the font name.
2014 In that case, return a font spec instead of a string.
2015 (x_last_font_name): Move to this file from xfns.c.
2016
2017 * xfns.c (Fx_select_font): The return value can also be a font
2018 spec. Move x_last_font_name management to gtkutil.c.
2019
2020 * xfaces.c: Make font weight and style symbols non-static.
2021
2022 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2023
2024 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2025 (bug#12117).
2026
2027 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2028
2029 * alloc.c (Fgarbage_collect): Use plural form consistently.
2030
2031 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2032
2033 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2034 iteration through the command loop. Fixes a problem whereby mouse
2035 movements are ignored until the first mouse click.
2036
2037 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2038
2039 Use bool, not int, for Lisp booleans.
2040 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2041 makes Emacs a bit smaller and presumably a bit faster.
2042 * lisp.h: Include <stdbool.h>.
2043 (struct Lisp_Boolfwd, defvar_bool):
2044 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2045 * regex.c [!emacs]: Include <stdbool.h>.
2046 (false, true): Remove; <stdbool.h> does this for us now.
2047
2048 2012-08-14 Chong Yidong <cyd@gnu.org>
2049
2050 * character.c (Fcharacterp): Doc fix (Bug#12076).
2051
2052 * data.c (Findirect_variable): Doc fix (Bug#11040).
2053
2054 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2055
2056 * editfns.c (Fformat): Doc fix (Bug#12059).
2057 (Fsave_current_buffer): Doc fix (Bug#11542).
2058
2059 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2060
2061 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2062 (bug#12022).
2063
2064 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2065
2066 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2067 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2068 * minibuf.c (choose_minibuf_frame, read_minibuf):
2069 * w32fns.c (x_create_tip_frame):
2070 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2071 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2072
2073 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2074
2075 * intervals.c (offset_intervals): Remove obsolete comment.
2076
2077 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2078
2079 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2080
2081 2012-08-14 Gergely Risko <gergely@risko.hu>
2082
2083 * coding.c (decode_coding): Record buffer modification before
2084 disabling undo_list (Bug#11773).
2085
2086 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2087
2088 Revert and cleanup some recent overlay changes.
2089 * buffer.h (enum overlay_type): Remove.
2090 (buffer_get_overlays, buffer_set_overlays): Likewise.
2091 (buffer_set_overlays_before, buffer_set_overlays_after):
2092 New function. Adjust users.
2093 (unchain_both): Add eassert.
2094
2095 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2096
2097 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2098
2099 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2100
2101 * gtkutil.c (xg_mark_data): Don't assume C99.
2102
2103 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2104
2105 * gtkutil.c (xg_frame_tb_info): New struct.
2106 (TB_INFO_KEY): New define.
2107 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2108 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2109 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2110 if not present.
2111 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2112 is up to date. Otherwise store new data.
2113 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2114
2115 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2116
2117 Use KSET for write access to Lisp_Object members of struct kboard.
2118 * keyboard.h (KSET): New macro.
2119 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2120 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2121 * xterm.c: Adjust users.
2122
2123 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2124
2125 Use BSET for write access to Lisp_Object members of struct buffer.
2126 * buffer.h (BSET): New macro.
2127 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2128 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2129 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2130 * window.c, xdisp.c, xfns.c: Adjust users.
2131
2132 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2133
2134 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2135
2136 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2137
2138 * nsterm.m (not_in_argv): New function.
2139 (application:openFile, application:openTempFile:):
2140 (application:openFileWithoutUI:, application:openFiles:): Open file
2141 if not_in_argv returns non-zero (bug#12171).
2142
2143 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2144 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2145 Define for Gtk+ versions less than 3.2.
2146 (xg_get_font_name): Use those functions/macros here.
2147 Reported by Frans Oilinki <moilinki@gmail.com>.
2148
2149 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2150
2151 * unexmacosx.c (copy_data_segment): Copy initialized data in
2152 statically linked libraries from input file rather than memory.
2153
2154 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2155 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2156 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2157
2158 2012-08-10 Glenn Morris <rgm@gnu.org>
2159
2160 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2161 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2162
2163 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2164
2165 Fix last change to allow compilation with low optimization levels.
2166 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2167 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2168
2169 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2170
2171 Use common inline syntax in intervals.h.
2172 * intervals.h (INTERVALS_INLINE): New macro.
2173 Change all users from LISP_INLINE.
2174
2175 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2176
2177 Define Qnone once for all platforms.
2178 * frame.c (Qnone): Define here.
2179 (syms_of_frame): DEFSYM it.
2180 * lisp.h (Qnone): New declaration.
2181 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2182 * xfns.c: Remove duplication. Adjust users.
2183
2184 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2185
2186 Remove unused macros from intervals.h.
2187 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2188 * intervals.c: Adjust comment.
2189
2190 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2191
2192 * w32fns.c <w32_unicode_gui>: New static variable.
2193 (globals_of_w32fns): Initialize it according to os_subtype.
2194 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2195 testing os_subtype.
2196
2197 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2198 Eli Zaretskii <eliz@gnu.org>
2199
2200 Fix bug #10299 with Unicode characters sent by customized
2201 keyboards created by MSKLC.
2202 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2203 (w32_init_class): Use it to initialize the Emacs class with either
2204 ANSI or Unicode API calls.
2205 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2206 later.
2207 (w32_wnd_proc): If the character code sent by WM_CHAR or
2208 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2209 original message. Call DefWindowProcW on NT and later.
2210
2211 2012-08-10 Glenn Morris <rgm@gnu.org>
2212
2213 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2214
2215 * lisp.h (DIRECTORY_SEP): Let configure set it.
2216
2217 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2218
2219 Use TSET for write access to Lisp_Object slots of struct terminal.
2220 * termhooks.h (TSET): New macro.
2221 * coding.c, terminal.c, xselect.c: Adjust users.
2222
2223 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2224
2225 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2226 the failing expression, include them in the error message.
2227 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2228 * lisp.h (internal_condition_case_n): Update declaration.
2229
2230 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2231
2232 Inline functions to examine and change buffer overlays.
2233 * buffer.c (unchain_both): New function.
2234 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2235 (buffer_has_overlays): New function.
2236 (enum overlay_type): New enum.
2237 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2238 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2239
2240 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2241
2242 Inline functions to examine and change buffer intervals.
2243 * alloc.c (mark_interval_tree): Remove.
2244 (MARK_INTERVAL_TREE): Simplify.
2245 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2246 * intervals.c (buffer_balance_intervals): New function.
2247 (graft_intervals_into_buffer): Adjust indentation.
2248 (set_intervals_multibyte): Simplify.
2249 * buffer.h (BUF_INTERVALS): Remove.
2250 (buffer_get_intervals, buffer_set_intervals): New function.
2251 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2252 * intervals.c, textprop.c: Adjust users.
2253
2254 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2255
2256 Inline functions to examine and change string intervals.
2257 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2258 (string_get_intervals, string_set_intervals): New function.
2259 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2260 * lread.c, print.c, textprop.c: Adjust users.
2261
2262 2012-08-08 Glenn Morris <rgm@gnu.org>
2263
2264 * lisp.mk (lisp): Remove language/persian.elc.
2265
2266 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2267
2268 Cleanup intervals.
2269 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2270 (NULL_INTERVAL_P): Likewise. Adjust users.
2271 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2272 Adjust comment. Move under #if 0.
2273 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2274 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2275
2276 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2277
2278 Check total length of intervals with eassert.
2279 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2280 * intervals.c: Change all users to eassert.
2281
2282 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2283
2284 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2285 Rename fields to match removal of FGET and WGET and disuse of
2286 INTERNAL_FIELD in Lisp_Cons.
2287
2288 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2289
2290 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2291 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2292 name since all xname users are fixed long time ago. Do not
2293 use INTERNAL_FIELD.
2294 (set_symbol_name, set_symbol_function, set_symbol_plist):
2295 (set_symbol_next, set_overlay_plist): New function.
2296 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2297 (struct Lisp_Overlay): Likewise.
2298 (CVAR, MVAR, SVAR): Remove.
2299 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2300 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2301 * xterm.c: Adjust users.
2302 * .gdbinit: Change to use name field of struct Lisp_Symbol
2303 where appropriate.
2304
2305 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2306
2307 Basic functions to set Lisp_Object and pointer slots of intervals.
2308 * intervals.h (interval_set_parent, interval_set_object):
2309 (interval_set_left, interval_set_right, interval_set_plist):
2310 (interval_copy_parent): New function.
2311 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2312 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2313 Adjust indentation.
2314 (INTERVAL_SIZE): Remove. Adjust users.
2315 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2316
2317 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2318
2319 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2320 * process.h (PGET): Remove.
2321 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2322 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2323
2324 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2325
2326 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2327 * window.h (WGET): Remove.
2328 (struct window): Do not use INTERNAL_FIELD.
2329 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2330 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2331 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2332 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2333 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2334 Adjust users.
2335
2336 2012-08-07 Chong Yidong <cyd@gnu.org>
2337
2338 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2339 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2340 (Fdelete_window_internal): Signal an error if the window is not on
2341 a live frame (Bug#12025).
2342
2343 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2344
2345 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2346 * frame.h (FGET): Remove.
2347 (struct frame): Do not use INTERNAL_FIELD.
2348 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2349 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2350 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2351 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2352
2353 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2354
2355 * w32.c: Silence compiler warnings.
2356 (map_w32_filename): Remove unused variable `is_fat'.
2357 (chase_symlinks): Add parentheses around expression.
2358
2359 2012-08-06 Glenn Morris <rgm@gnu.org>
2360
2361 * sysdep.c: Respect BROKEN_GETWD.
2362
2363 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2364 Let configure handle it.
2365 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2366
2367 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2368
2369 Use GCALIGNMENT where appropriate.
2370 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2371 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2372 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2373
2374 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2375
2376 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2377 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2378
2379 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2380
2381 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2382 that should be sufficient for everyone.
2383
2384 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2385
2386 * keyboard.c (timer_check_2): Add break so timer_check returns next
2387 timeout.
2388
2389 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2390
2391 Fix Windows build errors introduced after converting to WGET and WSET.
2392 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2393 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2394
2395 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2396
2397 * nsterm.m (ns_frame_rehighlight): Use FSET.
2398
2399 * nsmenu.m (ns_update_menubar): Use FSET.
2400
2401 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2402
2403 Separate read and write access to Lisp_Object slots of Lisp_Process.
2404 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2405 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2406
2407 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2408
2409 Separate read and write access to Lisp_Object slots of struct window.
2410 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2411 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2412 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2413 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2414 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2415 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2416 Adjust users.
2417
2418 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2419
2420 Fix Windows build errors introduced after converting to FGET and FSET.
2421 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2422 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2423 (w32_judge_scroll_bars): Change to use FSET.
2424 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2425
2426 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2427
2428 Fix replacement typo.
2429 * window.c (replace_window): Set root_window instead of
2430 selected_window. This fixes a total window subsystem
2431 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2432
2433 2012-08-06 Glenn Morris <rgm@gnu.org>
2434
2435 * lisp.mk (lisp): Add language/persian.elc.
2436
2437 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2438
2439 Separate read and write access to Lisp_Object slots of struct frame.
2440 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2441 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2442 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2443 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2444 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2445
2446 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2447
2448 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2449
2450 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2451
2452 Generalize common compile-time constants.
2453 * lisp.h (header_size, bool_header_size, word_size): Now here.
2454 (struct Lisp_Vector): Add comment.
2455 (struct Lisp_Bool_Vector): Move up to define handy constants.
2456 (VECSIZE, PSEUDOVECSIZE): Simplify.
2457 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2458 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2459 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2460 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2461 * xfont.c, xmenu.c: Use word_size where appropriate.
2462
2463 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2464
2465 * search.c (Freplace_match): Treat \? in the replacement text
2466 literally (Bug#8161).
2467
2468 2012-08-05 Chong Yidong <cyd@gnu.org>
2469
2470 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2471 * frame.c (Vdelete_frame_functions):
2472 * emacs.c (Vkill_emacs_hook): Doc fix.
2473
2474 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2475
2476 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2477 --with-x-toolkit=no builds.
2478 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2479
2480 2012-08-04 Chong Yidong <cyd@gnu.org>
2481
2482 * syntax.c (Fmodify_syntax_entry): Doc fix.
2483
2484 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2485
2486 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2487 * w32.c (init_environment): Change the default values of many
2488 environment variables in dflt_envvars[] to NULL, to avoid pushing
2489 them into environment when they were not already defined.
2490 Remove the code that deletes site-lisp subdirectories from the default
2491 value of EMACSLOADPATH, as it is no longer needed.
2492 (check_windows_init_file): Now external, not static.
2493 Use Vload_path as is, without adding anything, as this function is now
2494 called when Vload_path is already set up.
2495
2496 * w32.h (check_windows_init_file): Add prototype.
2497
2498 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2499 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2500 compatibility with Posix platforms.
2501 (main): Move the call to check_windows_init_file to here from
2502 w32.c.
2503 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2504 any, in the DEFALT argument into the root of the Emacs build or
2505 installation tree, as appropriate.
2506
2507 * callproc.c (init_callproc_1): Call decode_env_path instead of
2508 doing its equivalent by hand.
2509 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2510 the code that sets Vexec_path run on MS-Windows.
2511
2512 * lread.c (init_lread): Add comments to #ifdef's.
2513
2514 * msdos.c (dos_set_window_size, IT_update_begin)
2515 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2516 instead of direct references.
2517
2518 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2519
2520 Export DEFAULT_REHASH_* to GDB.
2521 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2522 Now constants, not macros.
2523
2524 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 Remove unnecessary casts involving pointers.
2527 These casts are no longer needed now that we assume C89 or later,
2528 since they involve casting to or from void *.
2529 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2530 (make_pure_float, make_pure_vector):
2531 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2532 * macros.c (Fstart_kbd_macro):
2533 * menu.c (find_and_return_menu_selection):
2534 * minibuf.c (read_minibuf_noninteractive):
2535 * sysdep.c (closedir):
2536 * xdisp.c (x_produce_glyphs):
2537 * xfaces.c (compare_fonts_by_sort_order):
2538 * xfns.c (x_real_positions, select_visual):
2539 * xselect.c (x_stop_queuing_selection_requests)
2540 (x_get_window_property, x_get_window_property_as_lisp_data):
2541 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2542 Remove unnecessary pointer casts.
2543 * alloc.c (record_xmalloc): New function.
2544 * lisp.h (record_xmalloc): New decl.
2545 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2546 more like a function. This is because the pointer cast is not
2547 needed. All uses changed.
2548 * print.c (print_string, print_error_message): Avoid length recalc.
2549
2550 Improve fix for macroexp crash with debugging (Bug#12118).
2551 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2552 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2553 not supposed to be invoked from the garbage collector.
2554 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2555 (gc_aset): New function, which is like ASET but can be
2556 used in the garbage collector.
2557 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2558 (set_hash_index): Use it instead of ASET.
2559
2560 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2561
2562 Support symlinks on latest versions of MS-Windows.
2563 * w32.c: Include winioctl.h and aclapi.h.
2564 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2565 (revert_to_self): Forward declarations of static functions.
2566 <static BOOL g_b_init_get_security_info>:
2567 <g_b_init_create_symbolic_link>: New static flags.
2568 (globals_of_w32): Initialize them to zero.
2569 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2570 (map_w32_filename): Improve commentary. Simplify switch.
2571 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2572 headers (most versions of MinGW w32api don't).
2573 (get_security_info, create_symbolic_link)
2574 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2575 New functions.
2576 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2577 in the argument file name.
2578 (sys_access): Call unc_volume_file_attributes only if
2579 GetFileAttributes fails with network-related error codes.
2580 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2581 have the required privileges.
2582 (get_file_security_desc_by_name): Rename from
2583 get_file_security_desc.
2584 (stat_worker): New function, with most of the guts of 'stat', and
2585 with addition of handling of symlinks and support for 'lstat'.
2586 If possible, get file's attributes and security information by
2587 handle, not by name. Produce S_IFLNK bit for symlinks, when
2588 called from 'lstat'.
2589 (stat, lstat): New functions, call 'stat_worker'.
2590 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2591 symlinks when the underlying filesystem supports them.
2592
2593 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2594
2595 Fix macroexp crash on Windows with debugging (Bug#12118).
2596 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2597 checking subscripts; problem introduced with the recent
2598 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2599 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2600 since it's used in non-static inline functions now.
2601
2602 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2603 Don't assume buffer size fits in 'int'. Remove unused local.
2604
2605 Use C99-style 'extern inline' if available.
2606 * buffer.h (BUFFER_INLINE):
2607 * category.h (CATEGORY_INLINE):
2608 * character.h (CHARACTER_INLINE):
2609 * charset.h (CHARSET_INLINE):
2610 * composite.h (COMPOSITE_INLINE):
2611 * dispextern.h (DISPEXTERN_INLINE):
2612 * lisp.h (LISP_INLINE):
2613 * systime.h (SYSTIME_INLINE):
2614 New macro, replacing 'static inline' in this header.
2615 * buffer.h, category.h, character.h, charset.h, composite.h:
2616 * dispextern.h, lisp.h, systime.h:
2617 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2618 * alloc.c (LISP_INLINE):
2619 * buffer.c (BUFFER_INLINE):
2620 * category.c (CATEGORY_INLINE):
2621 * character.c (CHARACTER_INLINE):
2622 * charset.c (CHARSET_INLINE):
2623 * composite.c (COMPOSITE_INLINE):
2624 * dispnew.c (DISPEXTERN_INLINE):
2625 * sysdep.c (SYSTIME_INLINE):
2626 Define to EXTERN_INLINE, so that the corresponding functions
2627 are compiled into code.
2628 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2629 (INLINE_HEADER_END): New macros.
2630 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2631 since it's used in non-static inline functions now.
2632 (VALMASK) [!USE_LSB_TAG]: Likewise.
2633
2634 2012-08-02 Glenn Morris <rgm@gnu.org>
2635
2636 * s/: Remove empty directory.
2637
2638 * s/ms-w32.h: Move to ../nt/inc.
2639 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2640 Update for new ms-w32.h location.
2641
2642 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2643
2644 Port to Solaris 8.
2645 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2646
2647 2012-08-02 Glenn Morris <rgm@gnu.org>
2648
2649 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2650 hard-coding the path separator.
2651
2652 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2653
2654 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2655 This how ASET and AREF are supposed to work, and makes
2656 it easier to think about future improvements. See
2657 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2658 * charset.h (set_charset_attr): New function.
2659 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2660 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2661 (aref_addr): New function. All uses of &AREF(...) changed.
2662 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2663 (set_hash_index): New functions. All lvalue-style uses of
2664 HASH_KEY etc. changed.
2665 * keyboard.c (set_prop): New function. All lvalue-style uses
2666 of PROP changed.
2667
2668 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2669
2670 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2671 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2672 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2673 * nsfns.m (ns_set_name_as_filename): Likewise.
2674 * nsmenu.m (ns_update_menubar): Likewise.
2675 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2676
2677 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2678
2679 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2680 Adapt to latest changes in field names of the corresponding Lisp
2681 objects.
2682
2683 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2684
2685 2012-08-01 Glenn Morris <rgm@gnu.org>
2686
2687 * s/msdos.h: Remove file.
2688 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2689 * Makefile.in (S_FILE): Remove.
2690 (config_h): Remove S_FILE.
2691
2692 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2693
2694 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2695 Remove; moved to nt/config.nt.
2696
2697 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2698
2699 Use INTERNAL_FIELD for conses and overlays.
2700 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2701 Remove obsolete comment.
2702 (MVAR): New macro.
2703 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2704 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2705
2706 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2707
2708 Use INTERNAL_FIELD for symbols.
2709 * lisp.h (SVAR): New macro. Adjust users.
2710 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2711 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2712
2713 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2714
2715 Use INTERNAL_FIELD for processes.
2716 * process.h (PVAR): New macro. Adjust style.
2717 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2718 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2719
2720 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2721
2722 Use INTERNAL_FIELD for windows.
2723 * window.h (WVAR): New macro.
2724 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2725 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2726 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2727 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2728 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2729 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2730
2731 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2732
2733 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2734
2735 2012-08-01 Glenn Morris <rgm@gnu.org>
2736
2737 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2738 Move to configure.ac.
2739
2740 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2741
2742 * makefile.w32-in (CONFIG_H): Update dependencies.
2743 (CONF_POST_H): New macro.
2744
2745 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2746
2747 2012-07-31 Glenn Morris <rgm@gnu.org>
2748
2749 * Makefile.in (S_FILE): No longer set by configure.
2750
2751 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2752 is available.
2753 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2754
2755 * process.h (NULL_DEVICE):
2756 * emacs.c (SEPCHAR):
2757 * editfns.c (USER_FULL_NAME): Let configure set them.
2758
2759 * s/README, s/template.h: Remove files.
2760
2761 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2762
2763 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2764 Move to configure.ac.
2765
2766 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2767
2768 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2769 resulting renaming of 'struct frame' members.
2770
2771 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2772
2773 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2774 after introduction of FVAR.
2775
2776 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2777
2778 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2779
2780 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2781 instead of compositeToPoint.
2782 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2783
2784 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2785
2786 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2787
2788 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2789 * lisp.h (INTERNAL_FIELD): New macro.
2790 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2791 (BVAR): Change to use INTERNAL_FIELD.
2792 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2793 (KVAR): Change to use INTERNAL_FIELD.
2794 * frame.h (FVAR): New macro.
2795 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2796 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2797 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2798 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2799 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2800
2801 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2802
2803 Miscellaneous fixes for non-default X toolkits.
2804 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2805 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2806 Move under #ifdef USE_LUCID.
2807 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2808 definition and usage to avoid warnings.
2809
2810 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2811
2812 * nsterm.m (openFiles): Fix previous checkin.
2813
2814 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2815
2816 * indent.c (compute_motion): Remove unused local.
2817
2818 2012-07-31 Glenn Morris <rgm@gnu.org>
2819
2820 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2821
2822 * conf_post.h [USG5_4]:
2823 Move remaining contents of s/usg5-4-common.h here.
2824 * s/usg5-4-common.h: Remove file.
2825
2826 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2827 * s/irix6-5.h: Remove file.
2828
2829 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2830 * s/darwin.h: Remove file.
2831
2832 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2833 * s/hpux10-20.h: Remove file, which is now empty.
2834
2835 2012-07-30 Glenn Morris <rgm@gnu.org>
2836
2837 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2838 * Makefile.in (config_h): Add conf_post.h.
2839 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2840
2841 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2842
2843 * nsterm.m (ns_do_open_file): New variable.
2844 (ns_term_init): Set ns_do_open_file to YES after run returns.
2845 (openFile, openTempFile, openFileWithoutUI, openFiles):
2846 Open files only if ns_do_open_file.
2847
2848 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2849
2850 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2851 This no-op macro hasn't been needed for many years.
2852 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2853
2854 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2855 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2856 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2857 gdb_make_enums_visible.
2858 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2859 (DIRECTORY_SEP): Now a constant, not a macro.
2860
2861 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2862
2863 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2864 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2865
2866 * w32term.c <w32_keyboard_codepage>: Renamed from
2867 keyboard_codepage and now external. All users changed.
2868
2869 * w32term.h: Add declaration of w32_keyboard_codepage.
2870
2871 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2872 the codepage to translate keys to Unicode. If this argument is
2873 -1, use the value returned by GetConsoleCP. All callers changed.
2874
2875 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2876
2877 Update .PHONY listings in makefiles.
2878 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2879 bootstrap-clean, distclean, maintainer-clean, versioclean,
2880 extraclean, frc.
2881
2882 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2883 This is a bit clearer. Fix some commentary typos.
2884
2885 2012-07-30 Glenn Morris <rgm@gnu.org>
2886
2887 * s/netbsd.h: Let configure include signal.h if needed.
2888 Remove file, which is now empty.
2889
2890 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2891 Let configure set them.
2892 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2893 No more need to undefine.
2894
2895 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2896
2897 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2898 non-single-byte char when adding meta modifier. (Bug#12090)
2899
2900 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2901
2902 Convert safe_call to use variable number of arguments.
2903 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2904 (safe_call2): Fix comment.
2905 * lisp.h (safe_call): Adjust prototype.
2906 * coding.c (encode_coding_object): Change to use safe_call2.
2907 * xfaces.c (merge_face_heights): Change to use safe_call1.
2908
2909 2012-07-30 Glenn Morris <rgm@gnu.org>
2910
2911 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2912 does that unconditionally. Remove file, which is now empty.
2913
2914 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2915 Remove empty files.
2916
2917 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2918
2919 Export to GDB most of lisp.h's remaining object-like macros.
2920 * lisp.h (min, max): Move earlier, because they're used earlier now.
2921 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2922 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2923 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2924 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2925 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2926 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2927 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2928 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2929 Now constants, for GDB. They need not be macros.
2930 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2931 Now constants, for GDB, as well as macros, for static initializers.
2932 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2933 Move to after the definition of struct Lisp_Char_Table,
2934 since the former now needs that type defined.
2935 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2936 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2937 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2938 New enums, for gdb_make_enums_visible.
2939 (GLYPH_MODE_LINE_FACE): Remove; unused.
2940 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2941 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2942 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2943 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2944 enum maxargs, enum MAX_ALLOCA.
2945 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
2946 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
2947 no longer needed, now that they are done in lisp.h.
2948
2949 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2950
2951 Cleanup string bytes checking.
2952 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
2953 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
2954 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
2955 (check_sblock, compact_small_strings): Simplify.
2956
2957 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2958
2959 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
2960 These macros are confusing and no longer need to be defined, as
2961 the enum values now suffice. All uses replaced with definiens.
2962 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
2963
2964 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
2965
2966 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
2967 ($(BLD)/w32console.$(O)): Update dependencies.
2968
2969 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2970
2971 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
2972 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
2973 time. Adjust users.
2974 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
2975
2976 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
2977
2978 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
2979 setting sitelisp (Bug#12010).
2980
2981 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2982
2983 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
2984
2985 * w32heap.c (cache_system_info):
2986 * w32.c (sys_rename):
2987 * w32proc.c (find_child_console, sys_kill): All users changed.
2988
2989 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
2990
2991 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
2992
2993 2012-07-29 Eli Zaretskii <eliz@gnu.org>
2994
2995 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
2996
2997 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2998
2999 Cleanup statistics calculation in Fgarbage_collect.
3000 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3001 Fix zombies percentage calculation. Simplify elapsed time calculation.
3002
3003 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3004
3005 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3006 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3007 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3008 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3009 (replace_range, replace_range_2, del_range_2): Change to eassert.
3010 * marker.c (byte_char_debug_check): Adjust style.
3011
3012 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3013
3014 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3015 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3016 long-ago-commented-out code that talks about "WIN32".
3017 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3018 All uses changed.
3019
3020 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3021
3022 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3023 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3024 Simplify by using alignof.
3025 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3026 * lisp.h: Include <stdalign.h>.
3027 (GCALIGNMENT): New macro and constant.
3028 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3029 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3030 (stdalign): New macro, if not already defined.
3031
3032 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3033
3034 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3035 * w32inevt.c: Include w32inevt.h.
3036 (w32_read_console_input): New inline function, calls either
3037 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3038 w32_console_unicode_input.
3039 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3040 (w32_kbd_patch_key, key_event): Use the codepage returned by
3041 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3042 (key_event): use uChar.UnicodeChar only if
3043 w32_console_unicode_input is non-zero.
3044
3045 * w32console.c: Include w32heap.h.
3046 <w32_console_unicode_input>: New global variable.
3047 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3048 family of Windows, zero otherwise.
3049
3050 * w32inevt.h: Declare w32_console_unicode_input.
3051
3052 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3053 --without-x. (Bug#11742)
3054
3055 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3056
3057 Adjust GDB to reflect pvec_type changes (Bug#12036).
3058 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3059 2012-07-04 changes to pseudovector representation.
3060 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3061
3062 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3063
3064 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3065 bus address.
3066 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3067
3068 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3069
3070 * alloc.c (listn): Fix the order the arguments are consed onto the
3071 list.
3072
3073 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3074 enumeration constants, as PURE and HEAP are too general, and clash
3075 with other headers and sources, such as gmalloc.c and the
3076 MS-Windows system headers. All users changed.
3077
3078 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3079
3080 Revert last save_excursion_save and save_excursion_restore changes.
3081 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3082 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3083
3084 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3085
3086 Fix recently-introduced typos in Windows port.
3087 Reported by Martin Rudalics <rudalics@gmx.at>.
3088 * w32.c (init_environment): Replace comma with semicolon.
3089 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3090
3091 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3092
3093 Improve GDB symbol export (Bug#12036).
3094 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3095 arms of an 'if', not using conditional expressions; otherwise GDB
3096 complains about the types in the unevaluated arm when the argument
3097 is an integer literal.
3098 (xgetint): Simplify expression.
3099 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3100 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3101 Zaretskii in <http://bugs.gnu.org/12036#13>.
3102 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3103 needed now that we have gdb_make_enums_visible.
3104 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3105 (enum enum_USE_LSB_TAG):
3106 New enum types, packaging up enums that need to be exported to GDB.
3107
3108 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3109
3110 Utility function to make a list from specified amount of objects.
3111 * lisp.h (enum constype): New datatype.
3112 (listn): New prototype.
3113 * alloc.c (listn): New function.
3114 (Fmemory_use_count, syms_of_alloc): Use it.
3115 * buffer.c (syms_of_buffer): Likewise.
3116 * callint.c (syms_of_callint): Likewise.
3117 * charset.c (define_charset_internal): Likewise.
3118 * coding.c (syms_of_coding): Likewise.
3119 * keymap.c (syms_of_keymap): Likewise.
3120 * search.c (syms_of_search): Likewise.
3121 * syntax.c (syms_of_syntax): Likewise.
3122 * w32.c (init_environment): Likewise.
3123 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3124 * xdisp.c (syms_of_xdisp): Likewise.
3125 * xfns.c (syms_of_xfns): Likewise.
3126
3127 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3128
3129 Fast save_excursion_save and save_excursion_restore.
3130 * lisp.h (struct Lisp_Excursion): New data type.
3131 (PVEC_EXCURSION): New pseudovector type.
3132 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3133 to deal with it. Adjust comments.
3134 (init_marker, attach_marker): New prototype.
3135 (unchain_marker): Adjust prototype.
3136 * marker.c (attach_marker): Change to global.
3137 (init_marker): New function.
3138 * alloc.c (Fmake_marker, build_marker): Use it.
3139 (build_marker): More easserts.
3140 (mark_object): Handle struct Lisp_Excursion.
3141 * editfns.c (save_excursion_save, save_excursion_restore):
3142 Reimplement to use struct Lisp_Excursion. Add comments.
3143
3144 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3145
3146 Fix export of symbols to GDB (Bug#12036).
3147 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3148 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3149 emacs.c, as this is a more-suitable home. Had this been done earlier
3150 the fix for 12036 would have avoided some of the problems noted in
3151 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3152 would have been more obvious.
3153 * emacs.c: Do not include <verify.h>; no longer needed.
3154 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3155 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3156 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3157 Remove; now done in lisp.h.
3158 * lisp.h (PUBLISH_TO_GDB): New macro.
3159 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3160 (DATA_SEG_BITS): Use it.
3161 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3162 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3163 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3164 not be usable in #if. This simplifies things.
3165
3166 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3167
3168 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3169
3170 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3171
3172 Simplify export of symbols to GDB (Bug#12036).
3173 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3174 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3175 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3176 Adjust to changes in lisp.h and emacs.c, by using
3177 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3178 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3179 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3180 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3181 instead of gdb_valbits.
3182 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3183 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3184 instead of gdb_array_mark_flag.
3185 (xboolvector): Get size from $->size, not $->header.size.
3186 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3187 (xreload, hook-run, hookpost-run): Remove.
3188 * emacs.c: Include <verify.h>.
3189 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3190 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3191 Remove.
3192 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3193 (gdb_USE_LSB_TAG): New enum constants.
3194 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3195 Also define these as enum constants, so they're visible to GDB.
3196 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3197 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3198 as constants, so they're visible to GDB.
3199 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3200 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3201 Now enum constants, not macros, so they're visible to GDB.
3202 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3203 more convenient now. All uses changed.
3204 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3205 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3206
3207 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3208
3209 Explicitly free restriction data that are not needed anymore.
3210 * editfns.c (save_restriction_restore): Free restriction data.
3211
3212 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3213
3214 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3215 add argument, tune behavior, and adjust all callers.
3216
3217 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3218
3219 Use typedef for EMACS_INT, EMACS_UINT.
3220 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3221 than macros. This simplifies debugging in the usual case, since
3222 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3223 and it allows expressions involving EMACS_INT casts.
3224 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3225
3226 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3227
3228 * nsterm.m (ns_read_socket): Return early if there is a modal
3229 window (Bug#12043).
3230
3231 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3232
3233 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3234 that FOCUS-FRAME can be omitted.
3235
3236 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3237
3238 Adjust buffer text indirection counters at the end of Fkill_buffer.
3239 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3240 buffer is definitely dead. This should really fix an issue reported
3241 by Christoph Scholtes again. (Bug#12007).
3242 (init_buffer_once): Initialize indirection counters of
3243 buffer_defaults and buffer_local_symbols (for sanity and safety).
3244
3245 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3246
3247 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3248 and continuation glyphs on tooltip frames, leave them at zero.
3249 Avoids continued lines in tooltips. (Bug#11832)
3250
3251 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3252
3253 Simplify copy_overlay.
3254 * buffer.c (copy_overlay): Simplify. Use build_marker.
3255 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3256
3257 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3258
3259 * print.c (print_object): Don't crash when a frame's name is nil
3260 or invalid. (Bug#12025)
3261
3262 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3263 it signals an error when a tooltip frame is being created.
3264
3265 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3266
3267 Cleanup miscellaneous objects allocation and initialization.
3268 * alloc.c (allocate_misc): Change to static. Add argument to
3269 specify the subtype. Adjust comment and users.
3270 (build_overlay): New function.
3271 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3272 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3273 (allocate_misc): Remove prototype.
3274 (build_overlay): Add prototype.
3275
3276 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3277
3278 Swap buffer text indirection counters in Fbuffer_swap_text.
3279 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3280 This avoids crash reported by Christoph Scholtes at
3281 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3282
3283 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3284
3285 * nsmenu.m (Popdown_data): New struct.
3286 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3287 free Popdown_data.
3288 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3289 (initWithContentRect): Make imgView and contentView non-static
3290 and autorelease them. Also autorelease img and matrix (Bug#12005).
3291 (dealloc): Remove (Bug#12005).
3292
3293 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3294
3295 Adjust consing_since_gc when objects are explicitly freed.
3296 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3297 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3298 (free_cons, free_misc): Subtract object size from consing_since_gc.
3299
3300 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3301
3302 Simplify and cleanup markers positioning code.
3303 * marker.c (attach_marker): More useful eassert.
3304 (live_buffer, set_marker_internal): New function.
3305 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3306 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3307
3308 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3309
3310 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3311 as it's limited by the amount of memory, not by INT_MAX.
3312
3313 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3314
3315 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3316 in special-event-map. See the discussion at
3317 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3318 for the reasons.
3319
3320 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3321 info.dwItemData. Fixes crashes on 64-bit Windows.
3322 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3323
3324 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3325
3326 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3327 (conversationIdentifier): Return value is NSInteger.
3328 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3329
3330 2012-07-21 Chong Yidong <cyd@gnu.org>
3331
3332 * window.c (decode_any_window): Signal an error if the window is
3333 on a dead frame (Bug#11984).
3334
3335 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3336
3337 Add indirection counting to speed up Fkill_buffer.
3338 * buffer.h (struct buffer): New member.
3339 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3340 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3341 base buffer indirection counter.
3342 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3343 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3344 through buffer list if indirection counter is 0.
3345
3346 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3347
3348 Extend the value returned by Fgarbage_collect with heap statistics.
3349 * alloc.c (Qheap): New symbol.
3350 (syms_of_alloc): DEFSYM it.
3351 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3352 (Fmemory_free): Remove.
3353 (syms_of_alloc): Don't defsubr it.
3354 * buffer.c (Fcompact_buffer): Remove.
3355 (syms_of_buffer): Don't defsubr it.
3356
3357 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3358
3359 Make maybe_gc inline.
3360 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3361 * lisp.h (consing_since_gc, gc_relative_threshold)
3362 (memory_full_cons_threshold): Revert declaration.
3363 (maybe_gc): Remove prototype, define as inline.
3364 * alloc.c: Remove old commented-out code.
3365 (consing_since_gc, gc_relative_threshold)
3366 (memory_full_cons_threshold): Revert to global.
3367 (maybe_gc): Remove.
3368
3369 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3370
3371 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3372 * lisp.h (build_unibyte_string): New function.
3373 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3374 * sysdep.c, w32fns.c, xfns.c: Use it.
3375 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3376 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3377 Adjust users accordingly.
3378 * font.h (font_open_by_name): Adjust prototype.
3379
3380 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3381
3382 Cleanup calls to Fgarbage_collect.
3383 * lisp.h (maybe_gc): New prototype.
3384 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3385 Remove declarations.
3386 * alloc.c (maybe_gc): New function.
3387 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3388 Make them static.
3389 * bytecode.c (MAYBE_GC): Use maybe_gc.
3390 * eval.c (eval_sub, Ffuncall): Likewise.
3391 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3392 to avoid dependency from auto-save feature.
3393
3394 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3395
3396 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3397 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3398 'for_each_per_buffer_object_at'.
3399 All uses changed. It's better to use upper-case for macros that
3400 cannot be implemented as functions, to give the reader a clue
3401 that they're special.
3402
3403 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3404
3405 * alloc.c (Fgarbage_collect): Tweak docstring.
3406
3407 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3408
3409 Tweak the value returned from Fgarbage_collect again.
3410 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3411 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3412 Adjust documentation.
3413 (total_vector_bytes): Rename to total_vector_slots, adjust
3414 accounting.
3415 (total_free_vector_bytes): Rename to total_free_vector_slots,
3416 adjust accounting.
3417 (Qstring_bytes, Qvector_slots): New symbols.
3418 (syms_of_alloc): DEFSYM them.
3419
3420 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3421
3422 Buffer compaction primitive which may be used from Lisp.
3423 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3424 (syms_of_buffer): Register Fcompact_buffer.
3425 * alloc.c (Fgarbage_collect): Use compact_buffer.
3426 * buffer.h (compact_buffer): New prototype.
3427 (struct buffer_text): New member.
3428
3429 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3430
3431 New macro to iterate over all buffers, miscellaneous cleanups.
3432 * lisp.h (all_buffers): Remove declaration.
3433 * buffer.h (all_buffers): Add declaration, with comment.
3434 (for_each_buffer): New macro.
3435 * alloc.c (Fgarbage_collect, mark_object): Use it.
3436 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3437 (init_buffer): Likewise.
3438 * data.c (Fset_default): Likewise.
3439 * coding.c (code_conversion_restore): Remove redundant check
3440 for dead buffer.
3441 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3442
3443 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3444
3445 Fix bug that created negative-length intervals.
3446 * intervals.c (merge_interval_right, merge_interval_left):
3447 Do not zero out this interval if it is absorbed by its children,
3448 as this interval's total length doesn't change in that case. See
3449 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3450
3451 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3452
3453 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3454 when invoking (make-bool-vector N t) and N is a positive
3455 multiple of 8 -- the last 8 bits were mistakenly cleared.
3456
3457 Remove some struct layout assumptions in bool vectors.
3458 * alloc.c (bool_header_size): New constant.
3459 (header_size, word_size): Move earlier, as they're now used earlier.
3460 Use 'word_size' in a few more places, where it's appropriate.
3461 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3462 padding before the data member of a bool vector.
3463 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3464 than doing the check by hand with an abort ().
3465
3466 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3467
3468 * eval.c (Fdefvar): Don't check constants since we only set the var if
3469 it's not yet defined anyway (bug#11904).
3470
3471 * lisp.h (last_undo_boundary): Declare new var.
3472 * keyboard.c (command_loop_1): Set it.
3473 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3474 were auto-added by the command loop (bug#11774).
3475
3476 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3477
3478 * w32font.c (Qsymbol): Remove local definition.
3479 (syms_of_w32font): Don't DEFSYM it.
3480
3481 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3482
3483 Fix sweep_vectors to handle large bool vectors correctly.
3484 * alloc.c (sweep_vectors): Account total_vector_bytes for
3485 bool vectors larger than VBLOCK_BYTES_MAX.
3486
3487 2012-07-18 Chong Yidong <cyd@gnu.org>
3488
3489 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3490 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3491
3492 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3493
3494 Return more descriptive data from Fgarbage_collect.
3495 Suggested by Stefan Monnier in
3496 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3497 * alloc.c (bounded_number): New function.
3498 (total_buffers, total_vectors): New variable.
3499 (total_string_size): Rename to total_string_bytes, adjust users.
3500 (total_vector_size): Rename to total_vector_bytes, adjust users.
3501 (sweep_vectors): Account total_vectors and total_vector_bytes.
3502 (Fgarbage_collect): New return value. Adjust documentation.
3503 (gc_sweep): Account total_buffers.
3504 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3505 (VECTOR_SIZE): Remove.
3506 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3507 (Qinterval, Qmisc): New symbols.
3508 (syms_of_data): Initialize them.
3509 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3510 (Qcons, Qbuffer): New declarations.
3511
3512 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3513
3514 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3515 Round up, not down. Improve doc.
3516
3517 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3518
3519 Restore old code in allocate_string_data to avoid Faset breakage.
3520 Reported by Julien Danjou <julien@danjou.info> in
3521 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3522 * alloc.c (allocate_string_data): Restore old code with minor
3523 adjustments, fix comment to explain this subtle issue.
3524
3525 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3526
3527 Remove FILE_SYSTEM_CASE.
3528 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3529
3530 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3531 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3532 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3533 call-process-region passes it through expand-file-name.
3534
3535 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3536
3537 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3538
3539 Fix crash when creating indirect buffer (Bug#11917)
3540 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3541 Don't handle unbound variables specially if non-zero.
3542 (Fbuffer_local_variables): Pass zero.
3543 (clone_per_buffer_values): Pass non-zero.
3544
3545 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3546
3547 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3548 to make the loop interruptible.
3549
3550 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3551
3552 * gnutls.c (emacs_gnutls_handshake): Only retry if
3553 GNUTLS_E_INTERRUPTED.
3554
3555 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3556
3557 Cleanup and convert miscellaneous checks to eassert.
3558 * alloc.c (mark_interval): Fix comment, partially rephrase
3559 old comment from intervals.h (see below).
3560 * intervals.c (find_interval, adjust_intervals_for_insertion)
3561 (delete_interval, adjust_intervals_for_deletion)
3562 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3563 Convert to eassert.
3564 (adjust_intervals_for_insertion, make_new_interval):
3565 Remove obsolete and unused code.
3566 * intervals.h (struct interval): Remove obsolete comment.
3567 * textprotp.c (erase_properties): Remove unused code.
3568 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3569 (Fremove_list_of_text_properties): Convert to eassert.
3570
3571 2012-07-17 Chong Yidong <cyd@gnu.org>
3572
3573 * editfns.c (Finsert_char): Doc fix.
3574
3575 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3576
3577 Fix previous change to make Fmemory_free always accurate.
3578 * alloc.c (make_interval): Update total_free_intervals.
3579 (make_float): Likewise for total_free_floats.
3580 (free_cons, Fcons): Likewise for total_free_conses.
3581 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3582 Likewise for total_free_vector_bytes.
3583 (Fmake_symbol): Likewise for total_free_symbols.
3584 (bytes_free): Remove.
3585
3586 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3587
3588 Simple free memory accounting feature.
3589 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3590 (sweep_vectors): Accumulate size of free vectors.
3591 (Fgarbage_collect): Setup bytes_free.
3592 (Fmemory_free): New function.
3593 (syms_of_alloc): Register it.
3594
3595 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3596
3597 Cleanup overlays checking.
3598 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3599 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3600 eassert and OVERLAYP.
3601 (sort_overlays): Change to use OVERLAYP.
3602
3603 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3604
3605 * editfns.c (Finsert_char): Make it interactive, and make the
3606 second arg optional. Copy interactive spec and docstring from
3607 ucs-insert.
3608
3609 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3610
3611 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3612 Unlike the other wrapped functions, fabs has an unspecified
3613 effect on errno.
3614
3615 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3616
3617 * nsterm.m (keyDown): Interpret flags without left/right bits
3618 as the left key (Bug#11670).
3619
3620 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3621
3622 Remove empty and useless init functions.
3623 * lisp.h (init_character_once, init_fns, init_image)
3624 (init_filelock, init_sound): Remove prototype.
3625 * character.c (init_character_once): Remove.
3626 * filelock.c (init_filelock): Likewise.
3627 * fns.c (init_fns): Likewise.
3628 * image.c (init_image): Likewise.
3629 * sound.c (init_sound): Likewise.
3630 * emacs.c (main): Adjust accordingly.
3631
3632 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3633
3634 * gtkutil.h: Tiny cleanups.
3635 (use_old_gtk_file_dialog): Remove useless declaration.
3636 (xg_uses_old_file_dialog): Add suggested const attribute.
3637
3638 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3639
3640 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3641 (bidi_paragraph_init): Use it to limit search forward for a strong
3642 directional character in abnormally large paragraphs full of
3643 neutral or weak characters. (Bug#11943)
3644
3645 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3646
3647 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3648 the toolbar (Bug#9451).
3649 (xg_make_tool_item): Give the widget event box a transparent
3650 background.
3651
3652 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3653
3654 Cleanup basic allocation variables and functions.
3655 * alloc.c (ignore_warnings, init_intervals, init_float)
3656 (init_cons, init_symbol, init_marker): Remove.
3657 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3658 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3659 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3660 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3661 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3662 (staticidx, init_alloc_once, init_strings, free_ablock):
3663 Remove redundant initialization.
3664 * fns.c (init_weak_hash_tables): Remove.
3665 * lisp.h (init_weak_hash_tables): Remove prototype.
3666
3667 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3668
3669 Use zero_vector where appropriate.
3670 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3671 accordingly.
3672 * lisp.h (zero_vector): New declaration.
3673 * font.c (null_vector): Remove.
3674 (syms_of_font): Remove initialization and staticpro.
3675 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3676 * keymap.c (Faccessible_keymaps): Likewise.
3677
3678 2012-07-15 Leo Liu <sdl.web@gmail.com>
3679
3680 * fringe.c: Fix typo in comments.
3681
3682 2012-07-14 Leo Liu <sdl.web@gmail.com>
3683
3684 * fringe.c: Add a new bitmap exclamation-mark.
3685
3686 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3687
3688 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3689
3690 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3691 (HAVE_MENUS): Don't define, defined by editing config.in with
3692 msdos/sed2v2.inp.
3693 (GMALLOC_INHIBIT_VALLOC): Don't define.
3694 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3695
3696 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3697
3698 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3699
3700 2012-07-14 Glenn Morris <rgm@gnu.org>
3701
3702 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3703 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3704 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3705
3706 2012-07-13 Glenn Morris <rgm@gnu.org>
3707
3708 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3709
3710 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3711 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3712
3713 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3714
3715 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3716 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3717 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3718 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3719 where appropriate.
3720 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3721 as boolean expression.
3722 (x_set_window_size): Remove unused variable toolbar.
3723 (ns_get_color_default, ns_mod_to_lisp): Remove.
3724 (ns_mouse_position): Remove unused variables xchar and ychar.
3725 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3726 (ns_set_vertical_scroll_bar): Remove unused variable count.
3727 (ns_delete_terminal): Remove unused variable i.
3728 (ns_term_init): Remove unused variables r, g and b.
3729 (mouseDown): Remove unused variable window.
3730 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3731 (initFrameFromEmacs): Remove unused variable vbextra.
3732 (mouseEntered): Remove unused variables p and dpyinfo.
3733 (mouseExited): Remove unused variables p and r.
3734 (ns_define_frame_cursor, ns_clear_frame_area)
3735 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3736 (menuDown): Assign [sender tag] to variable and cast the variable.
3737
3738 * nsterm.h (menuDown): Add id as type to argument sender.
3739 (ns_display_info_for_name): Add Lisp_Object argument.
3740 (ns_term_init): Add Lisp_Object argument.
3741 (ns_map_event_to_object): Add void argument.
3742 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3743 prototype with arguments and only declare if __OBJC__.
3744 (nxatoms_of_nsselect): Add void argument.
3745 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3746 (ns_alloc_autorelease_pool): Add void argument.
3747 (ns_release_autorelease_pool): Add void* argument.
3748 (ns_get_defaults_value): Add const char* argument.
3749
3750 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3751 (initFromContents): Use SSDATA where appropriate.
3752 (ns_update_menubar): Add braces to ambigous if-else.
3753 (initWithTitle): Put () around assignment in if statement.
3754 (ns_menu_show): Remove unused variables window and keymap.
3755 (update_frame_tool_bar): Remove unused variable selected_p.
3756 (initWithContentRect): Remove unused variable this_cmd_name.
3757
3758 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3759 appropriate.
3760 (setXBMColor): Remove unused variable len.
3761 (setPixmapData): Put () around assignment in loop statement.
3762
3763 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3764 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3765 where appropriate.
3766 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3767 around assignment in loop statement.
3768 (nsfont_open): Remove unused variable i.
3769 (nsfont_open): Remove unused variable len.
3770 (nsfont_draw): Remove unused variable cs.
3771
3772 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3773 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3774 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3775 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3776 (Fns_font_name, Fns_perform_service)
3777 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3778 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3779 (ns_set_name): Remove unused variable view.
3780 (x_set_menu_bar_lines): Remove unused variable olines.
3781 (x_set_tool_bar_lines): Remove unused variable root_window.
3782 (Fns_list_colors): Put () around assignment in while statement.
3783 (Fns_perform_service): Remove unused variable len.
3784 (Fns_display_usable_bounds): Remove unused variable top.
3785 (syms_of_nsfns): Remove unused variable i.
3786
3787 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3788 memcpy (Bug#11907).
3789
3790 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3791
3792 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3793 and free it with DestroyExceptionInfo (Bug#11558).
3794
3795 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3796
3797 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3798 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3799 Set here, not in nt/config.nt.
3800
3801 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3802
3803 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3804 cursor overflow into the last glyph on display line when the right
3805 fringe is off. (Bug#11832)
3806
3807 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3808
3809 * xdisp.c (produce_special_glyphs): Now static.
3810 * dispextern.h (produce_special_glyphs): Remove decl.
3811
3812 2012-07-13 Glenn Morris <rgm@gnu.org>
3813
3814 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3815 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3816
3817 * s/usg5-4-common.h (USG, USG5):
3818 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3819 * s/sol2-6.h (SOLARIS2):
3820 * s/irix6-5.h (IRIX6_5):
3821 * s/hpux10-20.h (USG, USG5, HPUX):
3822 * s/gnu-linux.h (USG, GNU_LINUX):
3823 * s/freebsd.h (BSD_SYSTEM):
3824 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3825 * s/cygwin.h (CYGWIN):
3826 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3827 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3828
3829 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3830
3831 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3832
3833 2012-07-13 Glenn Morris <rgm@gnu.org>
3834
3835 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3836
3837 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3838
3839 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3840 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3841
3842 2012-07-12 Glenn Morris <rgm@gnu.org>
3843
3844 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3845
3846 * process.c (init_process_emacs): Rename from init_process.
3847 The old name is also the name of a Mach system call.
3848 * lisp.h, emacs.c: Update for this name change.
3849 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3850 longer needed.
3851
3852 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3853
3854 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3855 memmove call that removes glyphs covered by the left truncation
3856 glyph. Improve commentary.
3857 (display_line): Fix display of continuation glyphs on GUI frames
3858 when the right fringe is turned off and variable-size fonts are
3859 used in the window. Move the code that appends a stretch glyph to
3860 produce_special_glyphs, so that it could be used for truncation
3861 and continuation glyphs alike.
3862 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3863 glyph of a suitably computed width, to align the special glyphs at
3864 the window margin. Code moved from display_line. (Bug#11832)
3865
3866 2012-07-12 Glenn Morris <rgm@gnu.org>
3867
3868 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3869
3870 * s/gnu-linux.h, s/hpux10-20.h:
3871 Do not unconditionally define HAVE_XRMSETDATABASE.
3872
3873 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3874
3875 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3876
3877 Fix typos that broke OS X build.
3878 Reported by Randal L. Schwartz in
3879 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3880 * nsterm.m (ns_timeout): Add missing local decl.
3881 (ns_get_color): snprintf -> sprintf, to fix typo.
3882
3883 2012-07-12 Glenn Morris <rgm@gnu.org>
3884
3885 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3886 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3887 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3888 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3889
3890 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3891 Move PTY_OPEN to configure.
3892
3893 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3894 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3895 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3896
3897 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3898
3899 Use empty_unibyte_string where applicable.
3900 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3901 * lread.c (read1): Likewise.
3902 * xsettings.c (syms_of_xsettings): Likewise.
3903
3904 2012-07-12 Glenn Morris <rgm@gnu.org>
3905
3906 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3907 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3908 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3909 * s/hpux10-20.h (RUN_TIME_REMAP):
3910 * s/bsd-common.h (TABDLY): Move to configure.
3911
3912 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3913
3914 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3915
3916 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3917 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3918
3919 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3920
3921 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3922 * s/template.h: Move NARROWPROTO to configure.
3923
3924 2012-07-11 Glenn Morris <rgm@gnu.org>
3925
3926 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3927 unused since 2011-01-17 change to systty.h.
3928
3929 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3930 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3931 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3932
3933 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3934
3935 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3936
3937 2012-07-11 Glenn Morris <rgm@gnu.org>
3938
3939 * s/darwin.h, s/gnu-linux.h, s/template.h:
3940 Move INTERRUPT_INPUT to configure.
3941
3942 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3943
3944 Minor adjustments to interning code.
3945 * lisp.h (intern, intern_c_string): Redefine as static inline
3946 wrappers for intern_1 and intern_c_string_1, respectively.
3947 (intern_1, intern_c_string_1): Rename prototypes.
3948 * lread.c (intern_1, intern_c_string_1, oblookup):
3949 Simplify Vobarray checking.
3950 * font.c (font_intern_prop): Likewise. Adjust comment.
3951 * w32font.c (intern_font_name): Likewise.
3952
3953 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
3954
3955 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
3956
3957 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
3958 of Fcar/Fcdr if possible.
3959 * font.c (check_otf_features): Likewise.
3960 * fontset.c (Fnew_fontset): Likewise.
3961 * gnutls.c (Fgnutls_boot): Likewise.
3962 * minibuf.c (read_minibuf): Likewise.
3963 * msdos.c (IT_set_frame_parameters): Likewise.
3964 * xmenu.c (Fx_popup_dialog): Likewise.
3965 * w32menu.c (Fx_popup_dialog): Likewise.
3966
3967 2012-07-11 Glenn Morris <rgm@gnu.org>
3968
3969 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
3970 since nothing has defined it on these platforms.
3971
3972 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
3973 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
3974
3975 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3976 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3977 Move CLASH_DETECTION to configure.
3978
3979 * s/gnu.h: Remove file, which is now empty.
3980
3981 * s/gnu.h, s/gnu-linux.h:
3982 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
3983
3984 2012-07-11 John Wiegley <johnw@newartisans.com>
3985
3986 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
3987 function attribute, so we only use it if it exists in the
3988 compiler.
3989
3990 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3991
3992 Avoid call to strlen in fast_c_string_match_ignore_case.
3993 * search.c (fast_c_string_match_ignore_case): Change to use
3994 length argument. Adjust users accordingly.
3995 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
3996
3997 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3998
3999 Assume mkdir, rmdir.
4000 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4001 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4002
4003 Assume rename.
4004 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4005
4006 Assume perror.
4007 * s/hpux10-20.h (HAVE_PERROR): Remove.
4008 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4009 Remove dummy definition, as this problem was obsolete long ago.
4010
4011 Assume strerror.
4012 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4013
4014 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4015
4016 Avoid calls to strlen in font processing functions.
4017 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4018 (font_open_by_name): Change to use length argument.
4019 Adjust users accordingly.
4020 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4021 Adjust prototypes.
4022 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4023 Change to return ptrdiff_t.
4024 (xfont_list_pattern, xfont_match): Use length returned by
4025 xfont_decode_coding_xlfd.
4026 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4027
4028 2012-07-11 Glenn Morris <rgm@gnu.org>
4029
4030 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4031 Move DONT_REOPEN_PTY to configure.
4032
4033 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4034 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4035
4036 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4037
4038 Remove "#define unix" that is no longer needed (Bug#11905).
4039 * s/aix4-2.h (unix): Remove; no longer needed.
4040
4041 EMACS_TIME simplification (Bug#11875).
4042 This replaces macros (which typically do not work in GDB)
4043 with functions, typedefs and enums, making the code easier to debug.
4044 The functional style also makes code easier to read and maintain.
4045 * systime.h: Include <sys/time.h> on all hosts, not just if
4046 WINDOWSNT, since 'struct timeval' is needed in general.
4047 (EMACS_TIME): Now a typedef, not a macro.
4048 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4049 not macros.
4050 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4051 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4052 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4053 (EMACS_TIME_LE): Now functions, not macros.
4054 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4055 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4056 which are not functions. All uses rewritten to use:
4057 (make_emacs_time): New function.
4058 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4059 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4060 not functions. All uses rewritten to use the following, respectively:
4061 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4062 (add_emacs_time, sub_emacs_time): New functions.
4063 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4064 * fileio.c (Fcopy_file):
4065 * xterm.c (XTflash): Get the current time closer to when it's used.
4066 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4067
4068 * bytecode.c (targets): Suppress -Woverride-init warnings.
4069
4070 Simplify by avoiding confusing use of strncpy etc.
4071 * doc.c (Fsnarf_documentation):
4072 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4073 * frame.c (Fmake_terminal_frame):
4074 * gtkutil.c (get_utf8_string):
4075 * lread.c (openp):
4076 * nsmenu.m (ns_update_menubar):
4077 * regex.c (regerror):
4078 Prefer memcpy to strncpy and strncat when either will do.
4079 * fileio.c (Fsubstitute_in_file_name):
4080 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4081 (menu_separator_name_p):
4082 * nsmenu.m (ns_update_menubar):
4083 Prefer memcmp to strncmp when either will do.
4084 * nsterm.m: Include <ftoastr.h>.
4085 (ns_get_color):
4086 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4087 Prefer snprintf to strncpy.
4088 * nsterm.m (ns_term_init):
4089 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4090 * nsterm.m (ns_term_init):
4091 Avoid the need for strncpy, by using build_string or
4092 make_unibyte_string directly. Use dtoastr, not snprintf.
4093 * process.c (Fmake_network_process): Diagnose service names that
4094 are too long, rather than silently truncating them or creating
4095 non-null-terminated names.
4096 (Fnetwork_interface_info): Likewise, for interface names.
4097 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4098 Prefer sprintf to strncat.
4099 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4100 Prefer vsnprintf to vsprintf + strncpy.
4101
4102 2012-07-10 Glenn Morris <rgm@gnu.org>
4103
4104 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4105 Clarify fallback case.
4106
4107 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4108
4109 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4110 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4111 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4112 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4113 where argument type is known to be a Lisp_Cons.
4114
4115 2012-07-10 Tom Tromey <tromey@redhat.com>
4116
4117 * bytecode.c (BYTE_CODE_THREADED): New macro.
4118 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4119 (enum byte_code_op): New type.
4120 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4121 (exec_byte_code): Use them. Use token threading when applicable.
4122
4123 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4124
4125 Optimize pure C strings initialization.
4126 * lisp.h (make_pure_string): Fix prototype.
4127 (build_pure_c_string): New function, defined as static inline. This
4128 provides a better opportunity to optimize away calls to strlen when
4129 the function is called with compile-time constant argument.
4130 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4131 argument, adjust users accordingly. Use build_pure_c_string where
4132 appropriate.
4133 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4134 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4135 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4136
4137 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4138
4139 Avoid calls to strlen in miscellaneous functions.
4140 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4141 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4142 * lread.c (openp): Likewise.
4143
4144 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4145
4146 Avoid calls to strlen in path processing functions.
4147 * fileio.c (file_name_as_directory): Add comment. Change to add
4148 srclen argument and return the length of result. Adjust users
4149 accordingly.
4150 (directory_file_name): Fix comment. Change to add srclen argument,
4151 swap 1st and 2nd arguments to obey the common convention.
4152 Adjust users accordingly.
4153 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4154
4155 2012-07-10 Glenn Morris <rgm@gnu.org>
4156
4157 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4158 Move PENDING_OUTPUT_COUNT definition to configure.
4159
4160 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4161 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4162 * s/gnu.h (DATA_START): Move definitions to configure.
4163
4164 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4165 We include usg5-4-common.h, which defines them both.
4166
4167 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4168 O_RDONLY already includes it).
4169
4170 Stop ns builds setting the EMACSLOADPATH environment variable.
4171 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4172 Now it does not set EMACSLOADPATH, just returns the load-path string.
4173 * nsterm.h: Update accordingly.
4174 * lread.c [HAVE_NS]: Include nsterm.h.
4175 (init_lread) [HAVE_NS]: Use ns_load_path.
4176 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4177
4178 2012-07-09 Glenn Morris <rgm@gnu.org>
4179
4180 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4181 since the included bsd-common.h does so.
4182
4183 Stop ns builds setting the EMACSPATH environment variable.
4184 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4185 (ns_init_paths): Do not set EMACSPATH.
4186 * nsterm.h (ns_exec_path): Add it.
4187 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4188 Use ns_exec_path.
4189
4190 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4191
4192 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4193
4194 * process.c (wait_reading_process_output): 'waitchannels' was unset
4195 when read_kbd || !NILP (wait_for_cell); fix this.
4196
4197 Add GCC-style 'const' attribute to functions that can use it.
4198 * character.h (char_resolve_modifier_mask):
4199 * keyboard.h (make_ctrl_char):
4200 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4201 (init_character_once, next_almost_prime, init_fns, init_image)
4202 (flush_pending_output, init_sound):
4203 * mem-limits.h (start_of_data):
4204 * menu.h (finish_menu_items):
4205 Add ATTRIBUTE_CONST.
4206 * emacs.c (DEFINE_DUMMY_FUNCTION):
4207 Declare the dummy function with ATTRIBUTE_CONST.
4208 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4209 Add decls with ATTRIBUTE_CONST.
4210
4211 Minor improvements to make_formatted_string.
4212 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4213 where int is good enough, as vsprintf returns an int.
4214 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4215
4216 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4217
4218 Use make_formatted_string to avoid double length calculation.
4219 * lisp.h (make_formatted_string): New prototype.
4220 * alloc.c (make_formatted_string): New function.
4221 * buffer.c (Fgenerate_new_buffer_name): Use it.
4222 * dbus.c (syms_of_dbusbind): Likewise.
4223 * editfns.c (Fcurrent_time_zone): Likewise.
4224 * filelock.c (get_boot_time): Likewise.
4225 * frame.c (make_terminal_frame, set_term_frame_name)
4226 (x_report_frame_params): Likewise.
4227 * image.c (gs_load): Likewise.
4228 * minibuf.c (get_minibuffer): Likewise.
4229 * msdos.c (dos_set_window_size): Likewise.
4230 * process.c (make_process): Likewise.
4231 * xdisp.c (ensure_echo_area_buffers): Likewise.
4232 * xsettings.c (apply_xft_settings): Likewise.
4233
4234 2012-07-09 Glenn Morris <rgm@gnu.org>
4235
4236 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4237 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4238 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4239 * nsterm.h (ns_etc_directory): Add it.
4240 * callproc.c [HAVE_NS]: Include nsterm.h.
4241 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4242
4243 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4244
4245 Move marker debugging code under MARKER_DEBUG.
4246 * marker.c (MARKER_DEBUG): Move marker debugging code under
4247 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4248 for bootstrap with --enable-checking (~3x slowdown reported
4249 by Juanma Barranquero <lekktu@gmail.com>).
4250 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4251
4252 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4253
4254 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4255 See <http://bugs.gnu.org/11825#29>.
4256
4257 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4258
4259 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4260 has no font, use the frame's font. (Bug#11813)
4261 (display_line): Add commentary about displaying truncation glyphs
4262 on GUI frames.
4263 (produce_special_glyphs): Move here from term.c.
4264
4265 * term.c (produce_special_glyphs): Move to xdisp.c.
4266
4267 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4268 section.
4269
4270 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4271
4272 * xdisp.c (display_line): Avoid warning about implicit declaration
4273 of FRAME_FONT.
4274
4275 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4276
4277 * lisp.h: Remove empty conditional.
4278
4279 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4280
4281 * lread.c (load_path_check): Now static.
4282
4283 Fix some minor --with-ns problems found by static checking.
4284 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4285 (x_set_font) [!HAVE_X_WINDOWS]:
4286 * image.c (xpm_load_image) [HAVE_NS]:
4287 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4288 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4289 Remove unused local.
4290 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4291 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4292 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4293 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4294 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4295 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4296 Fix pointer signedness problem.
4297 * xfaces.c (FRAME_X_FONT_TABLE):
4298 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4299
4300 2012-07-07 Glenn Morris <rgm@gnu.org>
4301
4302 * lread.c (load_path_check): New function, split from init_lread.
4303 (init_lread): Reorganize. Motivation:
4304 If EMACSLOADPATH is set, check/warn about that rather than the
4305 defaults, which we are not going to use. Hence we can remove
4306 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4307 Don't warn if site-lisp directories are missing.
4308 If not installed, start from a blank load-path, since
4309 PATH_LOADSEARCH refers to the eventual installation directories.
4310
4311 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4312
4313 Support truncation and continuation glyphs on GUI frames, when
4314 fringes are disabled. (Bug#11832)
4315 * xdisp.c (init_iterator): Get dimensions of truncation and
4316 continuation glyphs even if on GUI frames.
4317 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4318 or both, are absent.
4319 (start_display, move_it_in_display_line_to): Handle the case of a
4320 GUI frame without a fringe to display continuation or truncation
4321 glyphs.
4322 (insert_left_trunc_glyphs): Support GUI frames: make sure
4323 truncation glyphs overwrite enough glyphs from the current line to
4324 have sufficient space in pixels.
4325 (display_line): Support truncation and continuation glyphs on GUI
4326 frames. If some spare pixels are left on the line after inserting
4327 the truncation glyphs, fill that space with a stretch glyph of a
4328 suitably computed width.
4329
4330 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4331 produce_glyphs, to support GUI sessions.
4332
4333 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4334
4335 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4336
4337 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4338
4339 Do not require float-time's arg to fit in time_t (Bug#11825).
4340 This works better on hosts where time_t is unsigned, and where
4341 float-time is applied to the (negative) difference between two times.
4342 * editfns.c (decode_time_components): Last arg is now double *,
4343 not int *, and means to store all the result as a double, without
4344 worrying about whether the seconds part fits in time_t.
4345 All callers changed.
4346 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4347 All callers changed.
4348 (Ffloat_time): Do not fail merely because the specified time falls
4349 outside of time_t range.
4350
4351 2012-07-07 Glenn Morris <rgm@gnu.org>
4352
4353 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4354 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4355 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4356
4357 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4358
4359 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4360 Update dependencies.
4361
4362 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4363
4364 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4365
4366 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4367 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4368 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4369 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4370 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4371 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4372
4373 * xfont.c (compare_font_names): Redo to omit the need for casts.
4374
4375 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4376
4377 * xfns.c (Fx_change_window_property): Doc fix.
4378 * w32fns.c (Fx_change_window_property): Doc fix.
4379
4380 * w32fns.c (Fx_window_property): Accept the same arguments as the
4381 X Windows version. Doc fix.
4382 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4383
4384 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4385 Eli Zaretskii <eliz@gnu.org>
4386
4387 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4388 Windows-specific code from nt/config.nt moved here.
4389 Obsolete settings removed.
4390
4391 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4392
4393 * process.c: Avoid unnecessary calls to gettime.
4394 (wait_reading_process_output): Don't get the time of day
4395 when gobbling data immediately and not waiting, as there's no need
4396 for it in that case. This removes a FIXME.
4397
4398 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4399
4400 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4401 is defined (Bug#11768).
4402
4403 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4404
4405 Fix marker debugging code.
4406 * marker.c (byte_char_debug_check): Do not perform the check
4407 if buffer is not multibyte.
4408 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4409 Call byte_char_debug_check with correct arguments.
4410
4411 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4412
4413 Compile marker debugging code only if ENABLE_CHECKING is defined.
4414 * marker.c (byte_char_debug_check, count_markers):
4415 Use only if ENABLE_CHECKING is defined.
4416 (byte_debug_flag): Remove.
4417 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4418 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4419
4420 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4421
4422 Avoid code repetition in marker-related functions.
4423 * marker.c (attach_marker): New function.
4424 (Fset_marker, set_marker_restricted, set_marker_both)
4425 (set_marker_restricted_both): Use it.
4426 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4427 Consistently rename charno to charpos.
4428 (marker_position): Add eassert.
4429 (marker_byte_position): Convert to eassert.
4430
4431 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 Simplify list operations in unchain_overlay and unchain_marker.
4434 * buffer.c (unchain_overlay): Simplify. Add comment.
4435 * marker.c (unchain_marker): Simplify. Fix comments.
4436
4437 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4438
4439 Introduce fast path for the widely used marker operation.
4440 * alloc.c (build_marker): New function.
4441 * lisp.h (build_marker): New prototype.
4442 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4443 * composite.c (autocmp_chars): Likewise.
4444 * editfns.c (buildmark): Remove.
4445 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4446 (save_restriction_save): Use build_marker.
4447 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4448 * window.c (save_window_save): Likewise.
4449
4450 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4451
4452 Do not use Fdelete_overlay in delete_all_overlays
4453 to avoid redundant calls to unchain_overlay.
4454 * buffer.c (drop_overlay): New function.
4455 (delete_all_overlays, Fdelete_overlay): Use it.
4456 * minibuf.c (get_minibuffer): Fix comment.
4457
4458 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4459
4460 Port to OpenBSD 5.1 amd64.
4461 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4462 This is needed for OpenBSD, and should be harmless on all BSD systems.
4463 Also, include <sys/sysctl.h>, as it should be available on all
4464 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4465 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4466 use p_pid member, not kp_proc.pid.
4467
4468 2012-07-06 Glenn Morris <rgm@gnu.org>
4469
4470 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4471
4472 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4473
4474 More xmalloc and related cleanup.
4475 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4476 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4477 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4478 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4479 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4480 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4481 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4482 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4483 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4484 * xterm.c:
4485 Omit needless casts involving void * pointers and allocation.
4486 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4487 as the former is more robust if P's type is changed.
4488 Prefer xzalloc to xmalloc + memset 0.
4489 Simplify malloc-or-realloc to realloc.
4490 Don't worry about xmalloc returning a null pointer.
4491 Prefer xstrdup to xmalloc + strcpy.
4492 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4493 growing it.
4494 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4495 alloca of a constant.
4496
4497 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4498
4499 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4500 hscroll is larger than the line width. Fixes long and futile
4501 looping inside extend_face_to_end_of_line (on a TTY) producing
4502 glyphs that are not needed and thrown away.
4503
4504 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4505
4506 * marker.c (set_marker_restricted_both): Simplify by using
4507 clip_to_bounds.
4508
4509 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4510
4511 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4512
4513 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4514
4515 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4516 not defined (Bug#11768).
4517 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4518 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4519 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4520 followed by gtk_box_set_homogeneous (Bug#11768).
4521 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4522 (update_theme_scrollbar_width, xg_create_scroll_bar):
4523 Use gtk_scrollbar_new (Bug#11768).
4524 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4525 (is_box_type): New function (Bug#11768).
4526 (xg_tool_item_stale_p): Call is_box_type.
4527 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4528 with default display (Bug#11768).
4529
4530 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4531
4532 * xdisp.c (window_hscroll_limited): New function.
4533 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4534 coordinates when window's hscroll is set to insanely large
4535 values. (Bug#11857)
4536
4537 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4538
4539 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4540 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4541
4542 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4543
4544 Cleanup xmalloc.
4545 * lisp.h (xzalloc): New prototype. Omit needless casts.
4546 * alloc.c (xzalloc): New function. Omit needless casts.
4547 * charset.c: Omit needless casts. Convert all calls to
4548 xmalloc with following memset to xzalloc.
4549 * dispnew.c: Likewise.
4550 * fringe.c: Likewise.
4551 * image.c: Likewise.
4552 * sound.c: Likewise.
4553 * term.c: Likewise.
4554 * w32fns.c: Likewise.
4555 * w32font.c: Likewise.
4556 * w32term.c: Likewise.
4557 * xfaces.c: Likewise.
4558 * xfns.c: Likewise.
4559 * xterm.c: Likewise.
4560 * atimer.c: Omit needless casts.
4561 * buffer.c: Likewise.
4562 * callproc.c: Likewise.
4563 * ccl.c: Likewise.
4564 * coding.c: Likewise.
4565 * composite.c: Likewise.
4566 * doc.c: Likewise.
4567 * doprnt.c: Likewise.
4568 * editfns.c: Likewise.
4569 * emacs.c: Likewise.
4570 * eval.c: Likewise.
4571 * filelock.c: Likewise.
4572 * fns.c: Likewise.
4573 * gtkutil.c: Likewise.
4574 * keyboard.c: Likewise.
4575 * lisp.h: Likewise.
4576 * lread.c: Likewise.
4577 * minibuf.c: Likewise.
4578 * msdos.c: Likewise.
4579 * print.c: Likewise.
4580 * process.c: Likewise.
4581 * region-cache.c: Likewise.
4582 * search.c: Likewise.
4583 * sysdep.c: Likewise.
4584 * termcap.c: Likewise.
4585 * terminal.c: Likewise.
4586 * tparam.c: Likewise.
4587 * w16select.c: Likewise.
4588 * w32.c: Likewise.
4589 * w32reg.c: Likewise.
4590 * w32select.c: Likewise.
4591 * w32uniscribe.c: Likewise.
4592 * widget.c: Likewise.
4593 * xdisp.c: Likewise.
4594 * xmenu.c: Likewise.
4595 * xrdb.c: Likewise.
4596 * xselect.c: Likewise.
4597
4598 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4599
4600 * fileio.c (time_error_value): Check the right error number.
4601 Problem reported by Troels Nielsen in
4602 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4603
4604 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4605
4606 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4607 This should be fixed in a better way; see Eli Zaretskii in
4608 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4609 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4610
4611 * fileio.c (time_error_value): Rename from special_mtime.
4612 The old name's problems were noted by Eli Zaretskii in
4613 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4614
4615 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4616 This variable's comment says Emacs needs at least one GDB-visible
4617 symbol of type enum pvec_type, to work around GDB problems.
4618 The symbol's value doesn't matter.
4619
4620 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4621 that causes compilation to fail on pre-C99 compilers.
4622
4623 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4624
4625 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4626 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4627
4628 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4629
4630 * buffer.c (init_buffer_once): Fix initialization of
4631 headers for buffer_defaults and buffer_local_symbols.
4632 Reported by Juanma Barranquero <lekktu@gmail.com>.
4633
4634 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4635
4636 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4637 * lisp.h (enum pvec_type): Use fewer bits.
4638 (PSEUDOVECTOR_SIZE_BITS): New constant.
4639 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4640 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4641 change in pvec_type.
4642 (PSEUDOVECTOR_TYPEP): New macro.
4643 (TYPED_PSEUDOVECTORP): Use it.
4644 * fns.c (internal_equal): Adapt code to extract pvectype.
4645 * emacs.c (gdb_pvec_type): Update type.
4646 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4647 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4648 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4649 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4650 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4651 abusing vector->header.next.nbytes.
4652 (live_vector_p): Use PVEC_TYPE.
4653 (mark_object): Adapt code to extract pvectype. Use switch.
4654
4655 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4656
4657 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4658 Tighten new eassert a bit.
4659
4660 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4661
4662 Fix compilation with --enable-gcc-warnings and -O1
4663 optimization level.
4664 * doprnt.c (doprnt): Change type of tem to int, initialize
4665 to avoid compiler warning. Add eassert.
4666 * search.c (simple_search): Initialize match_byte to avoid
4667 compiler warning. Add eassert.
4668
4669 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4670
4671 Avoid weird behavior with large horizontal scrolls.
4672 Without this change, for example, large hscroll values would
4673 mess up Emacs's display on Fedora 15 x86, presumably due to
4674 overflows in int calculations in the display code.
4675 Also, if buffers had long lines, Emacs would freeze.
4676 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4677 (set_window_hscroll): New function, containing the old guts of
4678 Fset_window_hscroll. Return the clipped value.
4679 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4680 This avoids the need to check against PTRDIFF_MAX.
4681
4682 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4683
4684 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4685
4686 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4687
4688 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4689
4690 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4691 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4692 since GCC 4.4.6 issues a bogus warning for them.
4693
4694 Fix bugs in file timestamp newness comparisons.
4695 * fileio.c (Ffile_newer_than_file_p):
4696 * lread.c (Fload): Use full timestamp resolution of files,
4697 not just the 1-second resolution, so that files that are only
4698 slightly newer still count as newer.
4699 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4700 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4701
4702 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4703
4704 * fileio.c: Improve handling of file time marker. (Bug#11852)
4705 (special_mtime): New function.
4706 (Finsert_file_contents, Fverify_visited_file_modtime):
4707 Use it to set special mtime values consistently.
4708
4709 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4710
4711 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4712 marker for non-existing file. (Bug#11852)
4713
4714 2012-07-03 Glenn Morris <rgm@gnu.org>
4715
4716 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4717 and did not make it into globals.h).
4718
4719 2012-07-03 Tom Tromey <tromey@redhat.com>
4720
4721 * window.c (Fset_window_margins, Fset_window_fringes)
4722 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4723 * textprop.c (Fprevious_property_change): No longer static.
4724 * syntax.c (Fsyntax_table_p): No longer static.
4725 * process.c (Fget_process, Fprocess_datagram_address): No longer
4726 static.
4727 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4728 * keyboard.c (Fcommand_execute): No longer static.
4729 Remove EXFUN.
4730 * insdel.c (Fcombine_after_change_execute): No longer static.
4731 * image.c (Finit_image_library): No longer static.
4732 * fileio.c (Fmake_symbolic_link): No longer static.
4733 * eval.c (Ffetch_bytecode): No longer static.
4734 * editfns.c (Fuser_full_name): No longer static.
4735 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4736 No longer static.
4737 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4738 static.
4739 * dired.c (Ffile_attributes): No longer static.
4740 * composite.c (Fcomposition_get_gstring): No longer static.
4741 * callproc.c (Fgetenv_internal): No longer static.
4742
4743 * ccl.h: Remove EXFUNs.
4744 * buffer.h: Remove EXFUNs.
4745 * dispextern.h: Remove EXFUNs.
4746 * intervals.h: Remove EXFUNs.
4747 * fontset.h: Remove EXFUN.
4748 * font.h: Remove EXFUNs.
4749 * dosfns.c (system_process_attributes): Remove EXFUN.
4750 * keymap.h: Remove EXFUNs.
4751 * lisp.h: Remove EXFUNs.
4752 * w32term.h: Remove EXFUNs.
4753 * window.h: Remove EXFUNs.
4754 * xsettings.h: Remove EXFUN.
4755 * xterm.h: Remove EXFUN.
4756
4757 2012-07-03 Glenn Morris <rgm@gnu.org>
4758
4759 * lisp.h (Frandom): Make it visible to C.
4760 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4761 buffer for invisible buffers. (Bug#1229)
4762
4763 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4764
4765 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4766 values which aren't power of 2.
4767 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4768 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4769 accordingly.
4770
4771 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4772
4773 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4774
4775 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4776
4777 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4778
4779 * alloc.c (allocate_vector_block): Remove redundant
4780 calls to mallopt if DOUG_LEA_MALLOC is defined.
4781 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4782 avoid calls to mallopt if zero_vector is returned.
4783
4784 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4785
4786 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4787 is enabled, avoid dereferencing NULL current_sblock if
4788 running undumped.
4789
4790 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4791
4792 Cleanup basic buffer management.
4793 * buffer.h (struct buffer): Change layout to use generic vector
4794 marking code. Fix some comments. Change type of 'clip_changed'
4795 to bitfield. Remove unused #ifndef old.
4796 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4797 (GET_OVERLAYS_AT): Fix indentation.
4798 (for_each_per_buffer_object_at): New macro.
4799 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4800 (Fbuffer_local_variables): Use it.
4801 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4802 * alloc.c (allocate_buffer): Adjust to match new layout of
4803 struct buffer. Fix comment.
4804 (mark_overlay): New function.
4805 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4806 Lisp area of struct buffer.
4807 (mark_object): Use it. Adjust marking of misc objects
4808 and related comments.
4809
4810 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4811
4812 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4813 wrapper that is not needed because the wrapped code is a no-op (zero
4814 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4815 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4816
4817 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4818
4819 * alloc.c (mark_buffer): Simplify. Remove prototype.
4820 (mark_object): Add comment. Reorganize marking of vector-like
4821 objects. Use CHECK_LIVE for all vector-like objects except buffers
4822 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4823 Avoid redundant calls to mark_vectorlike for bool vectors.
4824
4825 2012-06-30 Glenn Morris <rgm@gnu.org>
4826
4827 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4828
4829 * epaths.in (PATH_SITELOADSEARCH): New.
4830 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4831 This is rather than relying on --enable-locallisppath elements
4832 having "site-lisp" in their names. (Bug#10208#25, 11658)
4833
4834 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4835
4836 * w32proc.c (sys_select): Accept and ignore one more argument.
4837
4838 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4839
4840 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4841 (pselect) [!MS_DOS]: Redirect to sys_select.
4842
4843 * sysdep.c: Don't include dos.h and dosfns.h.
4844
4845 * process.c (sys_select):
4846 * msdos.c (sys_select): Accept one more argument and ignore it.
4847
4848 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4849 adapt data types and code to that.
4850
4851 * dosfns.c:
4852 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4853 which clashes with the gnulib function of the same name.
4854
4855 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4856
4857 * font.c (font_style_to_value, font_style_symbolic)
4858 (font_prop_validate_style): Add type checks for values in
4859 font_style_table.
4860
4861 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4862 argument.
4863 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4864 uses.
4865
4866 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4867
4868 * xdisp.c (try_window_id): Undo last change.
4869
4870 * w32.c (getwd): Adjust commentary about startup_dir.
4871 (init_environment): Always call sys_access, even in non-MSVC
4872 builds. Don't chdir to the directory of the Emacs executable.
4873 This undoes code from 1997 which was justified by the need to
4874 "avoid conflicts when removing and renaming directories". But its
4875 downside was that every relative file name was being interpreted
4876 relative to the directory of the Emacs executable, which can never
4877 be TRT. In particular, it broke sys_access when called with
4878 relative file names.
4879 (sys_access): Map GetLastError to errno.
4880
4881 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4882
4883 * window.h (struct window): Change type of 'fringes_outside_margins'
4884 to bitfield. Fix comment. Adjust users accordingly.
4885 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4886 Adjust comment.
4887 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4888 to ptrdiff_t.
4889
4890 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4891
4892 * gnutls.c (emacs_gnutls_handshake):
4893 Add QUIT to make the loop interruptible.
4894
4895 2012-06-29 Glenn Morris <rgm@gnu.org>
4896
4897 * charset.c (init_charset): Make lack of etc/charsets fatal.
4898
4899 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4900
4901 * editfns.c (region_limit): Fix type mismatch.
4902
4903 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4904
4905 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4906 undefined. Convert from xassert to eassert.
4907 * nsmenu.m: Convert from xassert to eassert.
4908 * nsterm.m: Likewise.
4909
4910 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4911
4912 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4913
4914 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4915
4916 Avoid integer overflow on scroll-left and scroll-right.
4917 * window.c (HSCROLL_MAX): New macro.
4918 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4919 overflow when requested scroll falls outside ptrdiff_t range.
4920
4921 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4922
4923 * window.h (struct window): Change type of 'hscroll',
4924 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4925 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4926 Adjust users accordingly.
4927 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4928 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4929 from EMACS_INT to ptrdiff_t.
4930 (make_window): Omit redundant initialization.
4931
4932 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4933
4934 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4935
4936 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4937
4938 * window.h (struct window): Change type of 'use_time' and
4939 'sequence_number' from Lisp_Object to int.
4940 * frame.c (make_frame): Adjust users accordingly.
4941 * print.c (print_object): Likewise.
4942 * window.c (select_window, Fwindow_use_time, make_parent_window)
4943 (make_window): Likewise.
4944
4945 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4946
4947 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
4948 enabled with --enable-checking=[all,glyphs] configure option.
4949 Fix GLYPH_DEBUG usage assuming that it may be undefined,
4950 adjust comments accordingly.
4951 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
4952 undefined, adjust comments accordingly.
4953 * image.c: Likewise.
4954 * scroll.c: Likewise.
4955 * w32fns.c: Likewise.
4956 * w32term.c: Likewise.
4957 * xdisp.c: Likewise.
4958 * xfaces.c: Likewise.
4959 * xfns.c: Likewise.
4960 * xterm.c: Likewise.
4961
4962 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4963
4964 Generalize run-time debugging checks.
4965 * dispextern.h (XASSERTS): Remove.
4966 * fontset.c (xassert): Remove.
4967 Convert from xassert to eassert.
4968 * alloc.c: Convert from xassert to eassert.
4969 * bidi.c: Likewise.
4970 * dispnew.c: Likewise.
4971 * fns.c: Likewise.
4972 * fringe.c: Likewise.
4973 * ftfont.c: Likewise.
4974 * gtkutil.c: Likewise.
4975 * image.c: Likewise.
4976 * keyboard.c: Likewise.
4977 * menu.c: Likewise.
4978 * process.c: Likewise.
4979 * scroll.c: Likewise.
4980 * sound.c: Likewise.
4981 * term.c: Likewise.
4982 * w32console.c: Likewise.
4983 * w32fns.c: Likewise.
4984 * w32term.c: Likewise.
4985 * window.c: Likewise.
4986 * xdisp.c: Likewise.
4987 * xfaces.c: Likewise.
4988 * xfns.c: Likewise.
4989 * xselect.c: Likewise.
4990 * xterm.c: Likewise.
4991
4992 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
4993
4994 * fns.c (maybe_resize_hash_table): Output message when growing the
4995 purify-hashtable.
4996
4997 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
4998
4999 * alloc.c (allocate_string_data): Remove dead code.
5000 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5001 avoid GCC warning about unused macro.
5002
5003 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5004
5005 * alloc.c (allocate_string): Omit intervals initialization.
5006 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5007 as in make_pure_string and make_pure_c_string.
5008
5009 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5010
5011 * alloc.c (allocate_string): Fix last change.
5012
5013 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5014
5015 * alloc.c (allocate_string): Remove two redundant calls
5016 to memset, add explicit initialization where appropriate.
5017
5018 2012-06-27 Glenn Morris <rgm@gnu.org>
5019
5020 * lisp.mk (lisp): Remove paths.elc.
5021
5022 2012-06-27 Chong Yidong <cyd@gnu.org>
5023
5024 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5025
5026 2012-06-26 John Wiegley <johnw@newartisans.com>
5027
5028 * unexmacosx.c (copy_data_segment): Add two section names used
5029 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5030
5031 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5032 when building with Clang.
5033
5034 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5035
5036 * eval.c (Fapply): Allow calling it with a single argument.
5037
5038 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5039
5040 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5041 _stricmp and _strnicmp.
5042 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5043
5044 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5045
5046 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5047 allocated window.
5048 (allocate_process): Likewise for new process.
5049 (allocate_terminal): Change to use offsetof.
5050 (allocate_frame): Likewise.
5051 * frame.c (make_frame): Omit redundant initialization.
5052 * window.c (make_parent_window): Use memset.
5053 (make_window): Omit redundant initialization.
5054 * process.c (make_process): Omit redundant initialization.
5055 * terminal.c (create_terminal): Likewise.
5056
5057 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5058
5059 * term.c (delete_tty): Remove redundant call to memset.
5060
5061 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5062
5063 * alloc.c: Remove build_string.
5064 * lisp.h: Define build_string as static inline. This provides
5065 a better opportunity to optimize away calls to strlen when the
5066 function is called with compile-time constant argument.
5067 * image.c (imagemagick_error): Convert to build_string.
5068 * w32proc.c (sys_spawnve): Likewise.
5069 * xterm.c (x_term_init): Likewise.
5070
5071 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5072
5073 Use sprintf return value instead of invoking strlen on result.
5074 In the old days this wasn't portable, since some sprintf
5075 implementations returned char *. But they died out years ago and
5076 Emacs already assumes sprintf returns int.
5077 Similarly for float_to_string.
5078 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5079 * ccl.c (ccl_driver):
5080 * character.c (string_escape_byte8):
5081 * data.c (Fnumber_to_string):
5082 * doprnt.c (doprnt):
5083 * print.c (print_object):
5084 * xdisp.c (message_dolog):
5085 * xfns.c (syms_of_xfns):
5086 Use sprintf or float_to_string result to avoid need to call strlen.
5087 * data.c (Fnumber_to_string):
5088 Use make_unibyte_string, since the string must be ASCII.
5089 * lisp.h, print.c (float_to_string): Now returns int length.
5090 * term.c (produce_glyphless_glyph):
5091 Use sprintf result rather than recomputing it.
5092
5093 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5094 * Makefile.in (ALL_CFLAGS):
5095 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5096 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5097
5098 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5099
5100 * dispextern.h (xstrcasecmp): Define to library function
5101 strcasecmp if available.
5102 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5103
5104 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5105
5106 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5107 Avoid comma operator.
5108 * menu.c (push_submenu_start, push_submenu_end)
5109 (push_left_right_boundary, push_menu_pane): Likewise.
5110 * msdos.c (dos_rawgetc): Likewise.
5111
5112 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5113
5114 * xfns.c (xic_create_fontsetname): Remove redundant calls
5115 to memset.
5116
5117 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5118
5119 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5120 sprintf already null-terminates its output.
5121
5122 * xfns.c (x_window): Remove redundant cast.
5123
5124 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5125
5126 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5127 `const char *' to `char *' to avoid compiler warning.
5128
5129 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5130
5131 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5132 instead of truncating it to 63 (admittedly a generous limit).
5133
5134 * process.c: Fix spelling and caps in comments.
5135
5136 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5137
5138 * emacs.c (setpgrp): Remove definition, unused.
5139 * sysdep.c (setpgrp): Remove definition, not used in this file.
5140
5141 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5142
5143 * makefile.w32-in: Update dependencies.
5144
5145 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5146
5147 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5148 (SYSTIME_H): Add nt/inc/sys/time.h.
5149
5150 * systime.h [WINDOWSNT]: Include sys/time.h.
5151
5152 * s/ms-w32.h (struct timespec): Definition moved from
5153 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5154
5155 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5156
5157 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5158 * buffer.h (buffer_slot_type_mismatch):
5159 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5160 * eval.c (unwind_to_catch):
5161 * image.c (my_png_error, my_error_exit):
5162 * keyboard.c (quit_throw_to_read_char, user_error)
5163 (Fexit_recursive_edit, Fabort_recursive_edit):
5164 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5165 (wrong_type_argument, buffer_overflow, __executable_start)
5166 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5167 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5168 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5169 (fatal):
5170 (child_setup) [!DOS_NT]:
5171 * lread.c (end_of_file_error, invalid_syntax):
5172 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5173 * puresize.h (pure_write_error):
5174 * search.c (matcher_overflow):
5175 * sound.c (sound_perror, alsa_sound_perror):
5176 * sysdep.c, syssignal.h (croak):
5177 * term.c (maybe_fatal, vfatal):
5178 * textprop.c (text_read_only):
5179 * undo.c (user_error):
5180 * unexmacosx.c (unexec_error):
5181 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5182 Use _Noreturn rather than NO_RETURN.
5183 No need for separate decl merely because of _Noreturn.
5184 * sound.c (sound_warning, parse_sound):
5185 Remove unnecessary forward decls.
5186
5187 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5188
5189 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5190 * lisp.h (WAIT_READING_MAX): New macro.
5191 * dispnew.c (Fsleep_for, sit_for):
5192 * keyboard.c (kbd_buffer_get_event):
5193 * process.c (Faccept_process_output):
5194 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5195 This improves on the previous patch, which introduced a bug
5196 when time_t is unsigned and as wide as intmax_t.
5197 See <http://bugs.gnu.org/9000#51>.
5198
5199 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5200
5201 * dispnew.c (sit_for, Fsleep_for):
5202 * keyboard.c (kbd_buffer_get_event):
5203 * process.c (Faccept_process_output): Avoid compiler warnings when
5204 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5205
5206 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5207
5208 * makefile.w32-in: Update dependencies.
5209
5210 * w32.c (ltime): Add return type and declare static.
5211 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5212
5213 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5214
5215 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5216 Privately reported by Herbert J. Skuhra.
5217 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5218 All uses changed.
5219 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5220 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5221
5222 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5223
5224 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5225 last argument of make_unibyte_string.
5226
5227 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5228 language ID in the event parameters.
5229
5230 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5231 event.code, not the obscure "character set ID".
5232
5233 2012-06-23 Chong Yidong <cyd@gnu.org>
5234
5235 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5236
5237 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5238
5239 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5240 * w32.c (fdutimens): New function.
5241
5242 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5243
5244 * s/ms-w32.h (pselect): Redirect to sys_select.
5245
5246 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5247
5248 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5249 in the logic of incrementing and decrementing the value of
5250 use_relocatable_buffers.
5251
5252 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5255 Privately reported by Herbert J. Skuhra.
5256 [__FreeBSD__]: Remove "*/" typo after "#include".
5257 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5258 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5259 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5260 Don't assume EMACS_TIME and struct timeval are the same type.
5261
5262 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5263
5264 Support higher-resolution time stamps (Bug#9000).
5265 The time stamps are only nanosecond-resolution at the C level,
5266 since that's the best that any real-world system supports now.
5267 But they are picosecond-resolution at the Lisp level, as that's
5268 easy, and leaves room for future OS improvements.
5269
5270 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5271 (LIBES): Use it.
5272
5273 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5274 Don't get current time unless it's needed.
5275
5276 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5277 now provides it if it's absent.
5278 (start_atimer): Port to higher-res time stamps.
5279 Check for time stamp overflow. Don't get current time more
5280 often than is needed.
5281
5282 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5283 Include systime.h, not time.h.
5284 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5285
5286 * dired.c: Include stat-time.h.
5287 (Ffile-attributes): File times now have higher resolution.
5288
5289 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5290 (struct image): Timestamp now has higher resolution.
5291
5292 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5293 has at least microseconds now. All uses removed.
5294 (update_frame, update_single_window, update_window, update_frame_1)
5295 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5296 (duration_to_sec_usec): Remove; no longer needed.
5297
5298 * editfns.c (time_overflow): Now extern.
5299 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5300 (float-time, Fformat_time_string, Fcurrent_time_string)
5301 (Fcurrent_time_zone): Accept and generate higher-resolution
5302 time stamps.
5303 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5304 (decode_time_components, lisp_seconds_argument): New functions.
5305 (make_time): Now static.
5306 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5307 Report an error if the time is invalid, rather than having the caller
5308 do that.
5309
5310 * fileio.c: Include <stat-time.h>
5311 (Fcopy_file): Copy higher-resolution time stamps.
5312 Prefer to set the time stamp via a file descriptor if that works.
5313 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5314 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5315 (Fvisited_file_modtime, Fset_visited_file_modtime):
5316 Support higher-resolution time stamps.
5317
5318 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5319
5320 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5321
5322 * image.c (prepare_image_for_display, clear_image_cache)
5323 (lookup_image): Port to higer-resolution time stamps.
5324
5325 * keyboard.c (start_polling, bind_polling_period):
5326 Check for time stamp overflow.
5327 (read_char, kbd_buffer_get_event, timer_start_idle)
5328 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5329 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5330 Port to higher-resolution time stamps. Do not assume time_t is signed.
5331 (decode_timer): New function. Timers are now vectors of length 9,
5332 not 8, to accommodate the picosecond component.
5333 (timer_check_2): Use it.
5334
5335 * nsterm.m (select_timeout, timeval_subtract): Remove.
5336 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5337 as they're a bit more accurate and handle overflow better.
5338 (ns_select): Change prototype to be compatible with pselect.
5339 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5340 * nsterm.h (ns_select): Adjust prototype.
5341
5342 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5343 us-resolution time stamps.
5344 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5345
5346 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5347
5348 * lisp.h (time_overflow): New decl.
5349 (wait_reading_process_output): First arg is now intmax_t, not int,
5350 to accommodate larger waits.
5351
5352 * process.h (struct Lisp_Process.read_output_delay):
5353 Now counts nanoseconds, not microseconds.
5354 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5355 EMACS_HAS_USECS.
5356 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5357 (wait_reading_process_output):
5358 Port to ns-resolution time stamps.
5359 (Faccept_process_output, wait_reading_process_output):
5360 Check for time stamp overflow. Do not assume time_t is signed.
5361 (select_wrapper): Remove; we now use pselect.
5362 (Fprocess_attributes): Now generates ns-resolution time stamps.
5363
5364 * sysdep.c: Include utimens.h. Don't include utime.h
5365 or worry about struct utimbuf; gnulib does that for us now.
5366 (gettimeofday): Remove; gnulib provides a substitute.
5367 (make_timeval): New function.
5368 (set_file_times): Now sets ns-resolution time stamps.
5369 New arg FD; all uses changed.
5370 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5371 (system_process_attributes):
5372 Now returns ns-resolution time stamp. All uses changed.
5373 Check for time stamp overflow.
5374
5375 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5376 provides a substitute now.
5377
5378 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5379 since it guarantees struct timespec.
5380 (EMACS_TIME): Now struct timespec, so that we can support
5381 ns-resolution time stamps.
5382 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5383 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5384 (EMACS_USECS): Remove.
5385 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5386 so multiply the arg by 1000 before storing it.
5387 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5388 New macros.
5389 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5390 Port to ns-resolution time stamps.
5391 (EMACS_TIME_NEG_P): Remove; replaced by....
5392 (EMACS_TIME_SIGN): New macro.
5393 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5394 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5395 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5396 (make_timeval, make_lisp_time, decode_time_components): New decls.
5397 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5398 that it mishandled time_t overflow. You can't compare by subtracting!
5399 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5400 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5401
5402 * term.c: Include <sys/time.h>.
5403 (timeval_to_Time): New function, for proper overflow wraparound.
5404 (term_mouse_position, term_mouse_click): Use it.
5405
5406 * undo.c (record_first_change): Support higher-resolution time stamps
5407 in the undo buffer.
5408 (Fprimitive_undo): Use them when restoring time stamps.
5409
5410 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5411 (w32_get_internal_run_time):
5412 Port to higher-resolution Emacs time stamps.
5413 (ltime): Now accepts single 64-bit integer, as that's more convenient
5414 for callers.
5415
5416 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5417
5418 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5419 for compatibility with pselect. Support ns-resolution time stamps.
5420
5421 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5422
5423 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5424 Check for time stamp overflow, and support ns-resolution time stamps.
5425
5426 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5427 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5428 (timeval_subtract): Remove; no longer needed.
5429 (XTflash, XTring_bell, x_wait_for_event):
5430 Port to ns-resolution time stamps. Don't assume time_t is signed.
5431
5432 2012-06-22 Chong Yidong <cyd@gnu.org>
5433
5434 * xdisp.c (x_consider_frame_title): Revert last change.
5435
5436 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5437
5438 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5439 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5440 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5441 staticidx goes up to 1597 out of 1600 = 0x640.)
5442
5443 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5444
5445 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5446 Otherwise, the umask might be mistakenly 0 while handling input signals.
5447
5448 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5449
5450 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5451
5452 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5453
5454 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5455 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5456 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5457 access to `contents' member of Lisp_Vector objects with AREF and ASET
5458 where appropriate.
5459
5460 2012-06-19 Chong Yidong <cyd@gnu.org>
5461
5462 * frame.c (delete_frame): When selecting a frame on a different
5463 text terminal, do not alter the terminal's top-frame.
5464
5465 * xdisp.c (format_mode_line_unwind_data): Record the target
5466 frame's selected window and its terminal's top-frame.
5467 (unwind_format_mode_line): Restore them.
5468 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5469 Callers changed.
5470 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5471 since tty frames can be explicitly named.
5472 (prepare_menu_bars): Likewise.
5473
5474 * term.c (Ftty_top_frame): New function.
5475
5476 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5477
5478 Port byte-code-meter to modern targets.
5479 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5480 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5481 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5482 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5483 (METER_1, METER_2): Simplify.
5484
5485 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5486
5487 * data.c (Fdefalias): Return `symbol' (bug#11686).
5488
5489 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5490
5491 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5492 gets killed during executing of this function (Bug#11665).
5493 Try to always return Qt when the buffer has been actually killed.
5494 (Vkill_buffer_query_functions): In doc-string say that functions
5495 run by this hook should not change the current buffer.
5496
5497 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 Fix recently-introduced process.c problems found by static checking.
5500 * process.c (write_queue_push, write_queue_pop, send_process):
5501 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5502 (write_queue_pop): Fix pointer signedness problem.
5503 (send_process): Remove unused local.
5504
5505 2012-06-17 Chong Yidong <cyd@gnu.org>
5506
5507 * xdisp.c (redisplay_internal): No need to redisplay terminal
5508 frames that are not on top.
5509
5510 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5511
5512 * process.c (make_process): Initialize write_queue.
5513 (write_queue_push, write_queue_pop): New functions.
5514 (send_process): Use them to maintain correct ordering of process
5515 writes (Bug#10815).
5516
5517 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5518
5519 * lisp.h (eassert): Assume C89 or later.
5520 This removes the need for CHECK.
5521 (CHECK): Remove. Its comments about always evaluating its
5522 argument were confusing, as 'eassert' typically does not evaluate
5523 its argument.
5524
5525 * coding.c (produce_chars): Use ptrdiff_t, not int.
5526
5527 * xterm.c (x_draw_underwave): Check for integer overflow.
5528 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5529
5530 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5531
5532 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5533 referenced (Bug#11583).
5534
5535 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5536
5537 Implement wave-style variant of underlining.
5538 * dispextern.h (face_underline_type): New enum.
5539 (face): Add field for underline type.
5540 * nsterm.m (ns_draw_underwave): New function.
5541 (ns_draw_text_decoration): Use it.
5542 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5543 New functions.
5544 (x_draw_glyph_string): Use them.
5545 * xfaces.c (Qline, Qwave): New Lisp objects.
5546 (check_lface_attrs, merge_face_ref)
5547 (Finternal_set_lisp_face_attribute, realize_x_face):
5548 Handle wave-style underline face attributes.
5549 * xterm.c (x_draw_underwave): New function.
5550 (x_draw_glyph_string): Use it.
5551
5552 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5553
5554 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5555 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5556 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5557 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5558 ($(BLD)/w32select.$(O)): Update dependencies.
5559
5560 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5561
5562 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5563 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5564 * character.c (_fetch_multibyte_char_p): Remove.
5565 * alloc.c: Include "character.h" before "buffer.h".
5566 * bidi.c: Likewise.
5567 * buffer.c: Likewise.
5568 * bytecode.c: Likewise.
5569 * callint.c: Likewise.
5570 * callproc.c: Likewise.
5571 * casefiddle.c: Likewise.
5572 * casetab.c: Likewise.
5573 * category.c: Likewise.
5574 * cmds.c: Likewise.
5575 * coding.c: Likewise.
5576 * composite.c: Likewise.
5577 * dired.c: Likewise.
5578 * dispnew.c: Likewise.
5579 * doc.c: Likewise.
5580 * dosfns.c: Likewise.
5581 * editfns.c: Likewise.
5582 * emacs.c: Likewise.
5583 * fileio.c: Likewise.
5584 * filelock.c: Likewise.
5585 * font.c: Likewise.
5586 * fontset.c: Likewise.
5587 * fringe.c: Likewise.
5588 * indent.c: Likewise.
5589 * insdel.c: Likewise.
5590 * intervals.c: Likewise.
5591 * keyboard.c: Likewise.
5592 * keymap.c: Likewise.
5593 * lread.c: Likewise.
5594 * macros.c: Likewise.
5595 * marker.c: Likewise.
5596 * minibuf.c: Likewise.
5597 * nsfns.m: Likewise.
5598 * nsmenu.m: Likewise.
5599 * print.c: Likewise.
5600 * process.c: Likewise.
5601 * regex.c: Likewise.
5602 * region-cache.c: Likewise.
5603 * search.c: Likewise.
5604 * syntax.c: Likewise.
5605 * term.c: Likewise.
5606 * textprop.c: Likewise.
5607 * undo.c: Likewise.
5608 * unexsol.c: Likewise.
5609 * w16select.c: Likewise.
5610 * w32fns.c: Likewise.
5611 * w32menu.c: Likewise.
5612 * window.c: Likewise.
5613 * xdisp.c: Likewise.
5614 * xfns.c: Likewise.
5615 * xmenu.c: Likewise.
5616 * xml.c: Likewise.
5617 * xselect.c: Likewise.
5618
5619 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5620
5621 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5622 If all the glyphs of the glyph row came from strings, and we have no
5623 cursor positioning clues, put the cursor on the first glyph of the
5624 row.
5625 (handle_face_prop): Use chunk-relative overlay string index when
5626 indexing into it->string_overlays array. (Bug#11653)
5627 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5628 the rightmost. (Bug#11720)
5629
5630 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5631
5632 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5633 (CATEGORY_MEMBER): Enforce 1/0 value.
5634 * category.c (_temp_category_set): Remove.
5635
5636 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5637
5638 * window.c (Fdelete_other_windows_internal)
5639 (Fdelete_window_internal): Don't access frame's mouse highlight
5640 info of the initial frame. (Bug#11677)
5641
5642 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5643
5644 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5645 Assume USE_2_TAGS_FOR_INTS.
5646 (xreload): Adjust $tagmask width to match recent lisp.h change.
5647
5648 Simplify lisp.h in minor ways that should not affect code.
5649 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5650 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5651 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5652 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5653 (INTTYPEBITS): New macro, for clarity.
5654 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5655 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5656 Simplify now that USE_LSB_TAG is always defined.
5657 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5658 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5659
5660 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5661
5662 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5663
5664 2012-06-13 Glenn Morris <rgm@gnu.org>
5665
5666 * s/bsd-common.h (BSD4_3):
5667 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5668
5669 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5670
5671 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5672 instead of union.
5673 (XLI, XIL): Define.
5674 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5675 Use them.
5676 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5677 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5678 * alloc.c (widen_to_Lisp_Object): Remove.
5679 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5680 * frame.c (delete_frame): Remove outdated comment.
5681 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5682 USE_LISP_UNION_TYPE.
5683 (Fw32_unregister_hot_key): Likewise.
5684 (Fw32_toggle_lock_key): Likewise.
5685 * w32menu.c (add_menu_item): Likewise.
5686 (w32_menu_display_help): Use XIL instead of checking
5687 USE_LISP_UNION_TYPE.
5688 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5689 (init_heap): Likewise.
5690 * w32term.c (w32_read_socket): Update comment.
5691
5692 2012-06-13 Glenn Morris <rgm@gnu.org>
5693
5694 * s/usg5-4-common.h, src/s/unixware.h:
5695 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5696
5697 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5698
5699 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5700
5701 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5702 * alloc.c (make_number) [!defined make_number]:
5703 Remove, as lisp.h always defines this now.
5704 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5705 (roundup_size): Verify that it is a power of 2.
5706 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5707 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5708 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5709 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5710 USE_LSB_TAG now is always defined to be either 0 or 1.
5711 All uses changed.
5712 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5713 code works fine either way, and efficiency is not a concern here,
5714 as the union type is for debugging, not for production.
5715 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5716 Use an inline function on all platforms when using the union type,
5717 since this is simpler and 'static inline' can be used portably
5718 within Emacs now.
5719 (LISP_INITIALLY_ZERO): New macro.
5720 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5721 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5722
5723 2012-06-12 Glenn Morris <rgm@gnu.org>
5724
5725 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5726
5727 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5728
5729 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5730 Move BROKEN_SIGIO to configure.
5731
5732 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5733 Move NO_TERMIO to configure.
5734
5735 2012-06-12 Chong Yidong <cyd@gnu.org>
5736
5737 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5738 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5739 MagickExportImagePixels is undefined.
5740
5741 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5742
5743 * image.c (imagemagick_load_image): Remove unused label.
5744
5745 2012-06-11 Glenn Morris <rgm@gnu.org>
5746
5747 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5748 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5749 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5750 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5751
5752 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5753
5754 * alloc.c (make_byte_code): New function.
5755 (Fmake_byte_code): Use it. Don't purify here.
5756 * lread.c (read1): Use it as well to avoid extra allocation.
5757
5758 2012-06-11 Chong Yidong <cyd@gnu.org>
5759
5760 * image.c (imagemagick_load_image): Implement transparency.
5761
5762 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5763
5764 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5765 account for preceding backslashes. (Bug#11663)
5766
5767 2012-06-09 Chong Yidong <cyd@gnu.org>
5768
5769 * term.c: Support italics in capable terminals (Bug#9652).
5770 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5771 (turn_on_face): Output using TS_enter_italic_mode if available.
5772 Don't handle unused blinking and alt-charset cases.
5773 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5774 and tty_alt_charset_p cases.
5775 (tty_capable_p, init_tty): Support italics.
5776
5777 * termchar.h (struct tty_display_info): Add field for italics.
5778 Remove unused blink field.
5779
5780 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5781 Handle slant.
5782
5783 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5784 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5785 tty_alt_charset_p. Add tty_italic_p.
5786
5787 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5788
5789 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5790 dbus_type_is_basic if available.
5791 (xd_extract_signed, xd_extract_unsigned): Rename from
5792 extract_signed and extract_unsigned, respectively. Adapt callers.
5793
5794 2012-06-09 Chong Yidong <cyd@gnu.org>
5795
5796 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5797
5798 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5799 case (Bug#9752).
5800
5801 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5802
5803 * xdisp.c (vmessage): Treat frame message as multibyte.
5804 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5805 would generate the diagnostic "Making \302\247 buffer-local while
5806 let-bound!".
5807
5808 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5809
5810 * dispnew.c (showing_window_margins_p): Undo last change, which
5811 was done due to an inadvertent commit.
5812 (adjust_frame_glyphs_for_frame_redisplay): Do call
5813 showing_window_margins_p.
5814
5815 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5816
5817 * eval.c (Fmake_var_non_special): New primitive.
5818 (syms_of_eval): Defsubr it.
5819 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5820
5821 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5822
5823 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5824 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5825
5826 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5827
5828 * alloc.c (allocate_vectorlike): Fix last change.
5829
5830 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5831
5832 Block-based vector allocation of small vectors.
5833 * lisp.h (struct vectorlike_header): New field `nbytes',
5834 adjust comment accordingly.
5835 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5836 to denote vector blocks. Adjust users (live_vector_p,
5837 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5838 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5839 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5840 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5841 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5842 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5843 (roundup_size): New constant.
5844 (struct vector_block): New data type.
5845 (vector_blocks, vector_free_lists, zero_vector): New variables.
5846 (all_vectors): Rename to `large_vectors'.
5847 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5848 (sweep_vectors): New functions.
5849 (allocate_vectorlike): Return `zero_vector' as the only vector of
5850 0 items. Allocate new vector from block if vector size is less than
5851 or equal to VBLOCK_BYTES_MAX.
5852 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5853 (init_alloc_once): Add call to init_vectors.
5854
5855 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5856
5857 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5858
5859 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5860
5861 * doprnt.c (doprnt): Truncate multibyte char correctly.
5862 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5863 would mishandle a string argument "Xc" if X was a multibyte
5864 character of length 2: it would truncate after X's first byte
5865 rather than including all of X.
5866
5867 2012-06-06 Chong Yidong <cyd@gnu.org>
5868
5869 * buffer.c (word_wrap): Doc fix.
5870
5871 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5874
5875 2012-06-03 Glenn Morris <rgm@gnu.org>
5876
5877 * xdisp.c (tool-bar-style): Doc fix.
5878
5879 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5880
5881 * Makefile.in (PAXCTL): Define.
5882 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5883 binary via PaX flags if the paxctl utility is available.
5884 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5885 Restore PaX flags to their default. (Bug#11398)
5886
5887 2012-06-03 Chong Yidong <cyd@gnu.org>
5888
5889 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5890 buffer (Bug#11226).
5891
5892 2012-06-03 Chong Yidong <cyd@gnu.org>
5893
5894 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5895 (note_mode_line_or_margin_highlight): If there is no help echo,
5896 use mode-line-default-help-echo. Handle the case where the mouse
5897 position is past the end of the mode line string.
5898
5899 * buffer.c (buffer_local_value_1): New function, split from
5900 Fbuffer_local_value; can return Qunbound.
5901 (Fbuffer_local_value): Use it.
5902 (Vmode_line_format): Docstring tweaks.
5903
5904 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5905
5906 * sysdep.c (system_process_attributes): Improve comment.
5907
5908 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5909
5910 * keyboard.c: Export real-this-command to Elisp.
5911 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5912 and DEFVAR it. Update all users.
5913
5914 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5915
5916 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5917
5918 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5919 Convert pctcpu and pctmem to Lisp float properly.
5920 Let the compiler fold better, as 100.0/0x8000 is exact.
5921
5922 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5923
5924 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5925 cons_block.
5926
5927 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5928
5929 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5930
5931 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5932
5933 For a 'struct window', replace some Lisp_Object fields to
5934 bitfields where appropriate, remove unused fields.
5935 * window.h (struct window): Remove unused 'last_mark_x' and
5936 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5937 change it's type from Lisp_Object to bitfield.
5938 Change type of 'force_start', 'optional_new_start',
5939 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5940 fields from Lisp_Object to bitfield. Adjust users accordingly.
5941
5942 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5943
5944 Pacify gcc -Wdouble-precision when using Xaw.
5945 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
5946 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
5947 Use 'float' consistently, rather than 'float' in most places
5948 and 'double' in a couple of places.
5949
5950 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5951
5952 * xdisp.c (handle_stop): Detect whether we have overlay strings
5953 loaded by testing it->current.overlay_string_index to be
5954 non-negative, instead of checking whether n_overlay_strings is
5955 positive. (Bug#11587)
5956
5957 2012-05-31 Chong Yidong <cyd@gnu.org>
5958
5959 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
5960
5961 * doc.c (Fsubstitute_command_keys): Doc fix.
5962
5963 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5964
5965 * search.c (search_buffer): Remove calls to
5966 r_alloc_inhibit_buffer_relocation, as it is now called by
5967 maybe_unify_char, which was the cause of relocation of buffer text
5968 in bug#11519.
5969
5970 2012-05-31 Eli Zaretskii <eliz@gnu.org>
5971
5972 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
5973 for the duration of call to load_charset, to avoid problems with
5974 callers of maybe_unify_char that access buffer text through C
5975 pointers.
5976
5977 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
5978 decrement the inhibition flag, instead of just setting or
5979 resetting it.
5980
5981 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 Remove obsolete '#define static' cruft.
5984 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
5985 This #undef was "temporary" in 2000; it is no longer needed
5986 now that '#define static' has gone away.
5987 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
5988 (gray_bitmap_bits): Remove; no longer needed.
5989 All uses replaced with definiens.
5990 * xterm.c: Include "bitmaps/gray.xbm".
5991
5992 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
5993
5994 Clean up __executable_start, monstartup when --enable-profiling.
5995 The following changes affect the code only when profiling.
5996 * dispnew.c (__executable_start): Rename from safe_bcopy.
5997 Define only on platforms that need it.
5998 * emacs.c: Include <sys/gmon.h> when profiling.
5999 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6000 (__executable_start): Remove decl, since lisp.h does it now.
6001 (safe_bcopy): Remove decl; no longer has that name.
6002 (main): Coalesce #if into single bit of code, for simplicity.
6003 Cast pointers to uintptr_t, since standard libraries want integers
6004 and not pointers.
6005 * lisp.h (__executable_start): New decl.
6006
6007 2012-05-31 Glenn Morris <rgm@gnu.org>
6008
6009 * image.c (Fimagemagick_types): Doc fix.
6010
6011 2012-05-30 Jim Meyering <meyering@redhat.com>
6012
6013 * callproc.c (Fcall_process_region): Include directory component
6014 in mkstemp error message (Bug#11586).
6015
6016 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6017
6018 * alloc.c, lisp.h (make_pure_vector): Now static.
6019
6020 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6021
6022 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6023 Move to byte-run.el.
6024 (Fautoload): Do the hash-doc more carefully.
6025 * data.c (Fdefalias): Purify definition, except for keymaps.
6026 (Qdefun): Move from eval.c.
6027 * lisp.h (Qdefun): Remove.
6028 * lread.c (read1): Tiny simplification.
6029
6030 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6031
6032 Do not create empty overlays with the evaporate property (Bug#9642).
6033 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6034 Bug#9642, but explicitly check that the buffer the overlay would
6035 be moved to is live and rearrange lines to make sure that errors
6036 will not put the overlay in an inconsistent state.
6037 (Fdelete_overlay): Cosmetics.
6038
6039 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6040
6041 * w32term.c (my_bring_window_to_top): New function.
6042 (x_raise_frame): Use handle returned by DeferWindowPos, which
6043 could be different from the original one.
6044 Call my_bring_window_to_top instead of my_set_foreground_window.
6045 (Bug#11513)
6046
6047 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6048 by calling BringWindowToTop.
6049
6050 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6051 (WM_EMACS_END): Increase by one.
6052
6053 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6054
6055 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6056 This avoids undefined behavior that might cause the eassert
6057 to not catch an out-of-range value.
6058
6059 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6060
6061 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6062 Update dependencies.
6063
6064 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6065
6066 * bidi.c (bidi_mirror_char): Fix last change.
6067
6068 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6069
6070 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6071 when referring to sectname field in printf format.
6072
6073 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6074
6075 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6076 Only r_alloc_inhibit_buffer_relocation needed to be added;
6077 the others were already declared.
6078
6079 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6080 before checking whether it's out of range. Put the check inside
6081 eassert. See
6082 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6083
6084 2012-05-27 Ken Brown <kbrown@cornell.edu>
6085
6086 * callproc.c (Fcall_process): Restore a line that was accidentally
6087 commented out in the 2011-02-13 change (bug#11547).
6088
6089 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6090
6091 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6092 defined on ralloc.c.
6093
6094 * buffer.c [REL_ALLOC]: Remove prototypes of
6095 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6096 they are now on lisp.h.
6097
6098 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6099
6100 * search.c (search_buffer): Use it to inhibit relocation of buffer
6101 text while re_search_2 is doing its job, because re_search_2 is
6102 passed C pointers to buffer text. (Bug#11519)
6103
6104 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6105 Update value to 24.
6106
6107 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6108 state after an additional call to move_it_in_display_line_to, keep
6109 the values of it->max_ascent and it->max_descent found for the
6110 entire line.
6111 (pos_visible_p): Revert the comparison against bottom_y to what it
6112 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6113 (Bug#11464)
6114
6115 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6116
6117 Fix coding-related core dumps with gcc -ftrapv.
6118 The code was computing A - B, where A and B are pointers, and B is
6119 random garbage. This can lead to core dumps on platforms that
6120 have special pointer registers, and it also leads to core dumps on
6121 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6122 A - B only when B is initialized properly.
6123 * coding.c (coding_set_source, coding_set_destination): Return void.
6124 (coding_change_source, coding_change_destinations): New functions,
6125 with the old behaviors of coding_set_source and coding_set_destination.
6126 All callers that need an offset changed to use these new functions.
6127
6128 2012-05-26 Glenn Morris <rgm@gnu.org>
6129
6130 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6131
6132 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6133
6134 Extend mouse support on W32 text-mode console.
6135 * xdisp.c (draw_row_with_mouse_face):
6136 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6137
6138 * w32console.c: Include window.h.
6139 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6140 New functions.
6141 (initialize_w32_display): Initialize mouse-highlight data.
6142
6143 * w32inevt.c: Include termchar.h and window.h.
6144 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6145 moves, call note_mouse_highlight. If help_echo changed, call
6146 gen_help_event to produce help-echo message in the echo area.
6147 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6148 highlight info.
6149
6150 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6151
6152 * lread.c (read1): Simplify slightly to avoid an overflow warning
6153 with GCC 4.7.0 on x86-64.
6154
6155 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6156
6157 * bidi.c (bidi_mirror_char): Revert last change: an int is
6158 definitely wide enough here.
6159
6160 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6161
6162 Fix integer width and related bugs (Bug#9874).
6163 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6164 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6165 (string_bytes, check_sblock, allocate_string_data):
6166 (compact_small_strings, Fmake_bool_vector, make_string)
6167 (make_unibyte_string, make_multibyte_string)
6168 (make_string_from_bytes, make_specified_string)
6169 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6170 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6171 (mark_vectorlike):
6172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6173 (allocate_pseudovector):
6174 Use int, not EMACS_INT, where int is wide enough.
6175 (inhibit_garbage_collection, Fgarbage_collect):
6176 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6177 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6178 int might not be wide enough.
6179 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6180 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6181 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6182 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6183 (bidi_level_of_next_char, bidi_move_to_visually_next):
6184 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6185 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6186 (Fkill_buffer, Fset_buffer_major_mode)
6187 (advance_to_char_boundary, Fbuffer_swap_text)
6188 (Fset_buffer_multibyte, overlays_at, overlays_in)
6189 (overlay_touches_p, struct sortvec, record_overlay_string)
6190 (overlay_strings, recenter_overlay_lists)
6191 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6192 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6193 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6194 (Foverlay_recenter, last_overlay_modification_hooks_used)
6195 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6197 (validate_region): Omit unnecessary test for b <= e,
6198 since that's guaranteed by the previous test.
6199 (adjust_overlays_for_delete): Avoid pos + length overflow.
6200 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6201 (report_overlay_modification):
6202 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6203 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6204 Omit pointer cast, which isn't needed anyway, and doesn't work
6205 after the EMACS_INT -> ptrdiff_t change.
6206 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6207 * buffer.h: Adjust decls to match defn changes elsewhere.
6208 (struct buffer_text, struct buffer):
6209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6210 Use EMACS_INT, not int, where int might not be wide enough.
6211 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6212 not int, to avoid needless 32-bit limit on 64-bit hosts.
6213 (exec_byte_code): Use tighter memory-full test, one that checks
6214 for alloca overflow. Don't compute the address of the object just
6215 before an array, as that's not portable. Use EMACS_INT, not
6216 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6217 * callint.c (Fcall_interactively):
6218 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6219 * callproc.c (call_process_kill, Fcall_process):
6220 Don't assume pid_t fits into an Emacs fixnum.
6221 (call_process_cleanup, Fcall_process, child_setup):
6222 Don't assume pid_t fits into int.
6223 (call_process_cleanup, Fcall_process, delete_temp_file)
6224 (Fcall_process_region):
6225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6226 (Fcall_process): Simplify handling of volatile integers.
6227 Use int, not EMACS_INT, where int will do.
6228 * casefiddle.c (casify_object, casify_region, operate_on_word)
6229 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6230 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6231 (casify_object): Avoid integer overflow when overallocating buffer.
6232 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6233 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6234 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6235 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6236 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6237 integers are now checked earlier. All uses replaced with XINT.
6238 (ccl_driver):
6239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6240 For CCL_MapSingle, check that content and value are in int range.
6241 (ccl_driver, Fregister_code_conversion_map):
6242 Check that Vcode_version_map_vector is a vector.
6243 (resolve_symbol_ccl_program): Check that vector header is in range.
6244 Always copy the vector, so that we can check its contents reliably
6245 now rather than having to recheck each instruction as it's being
6246 executed. Check that vector words fit in 'int'.
6247 (ccl_get_compiled_code, Fregister_ccl_program)
6248 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6249 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6250 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6251 contents are in range.
6252 (Fccl_execute_on_string): Check that status is in range.
6253 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6254 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6255 Accept and return EMACS_INT, not int, because callers can pass values
6256 out of 'int' range.
6257 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6258 (multibyte_chars_in_text, parse_str_as_multibyte)
6259 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6260 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6261 (string_escape_byte8, Fget_byte):
6262 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6263 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6264 avoid mishandling large integers.
6265 * character.h: Adjust decls to match defn changes elsewhere.
6266 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6267 (Ffind_charset_region):
6268 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6269 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6270 (load_charset_map_from_vector, Fdefine_charset_internal):
6271 Don't assume fixnum fits in int.
6272 (load_charset_map_from_vector, Fmap_charset_chars):
6273 Remove now-unnecessary CHECK_NATNUMs.
6274 (Fdefine_charset_internal): Check ranges here, more carefully.
6275 Don't rely on undefined behavior with signed left shift overflow.
6276 Don't assume unsigned int fits into fixnum, or that fixnum fits
6277 into unsigned int. Don't require max_code to be a valid fixnum;
6278 that's not true for gb10830 4-byte on a 32-bit host. Allow
6279 invalid_code to be a cons, for the same reason. Require code_offset
6280 to be a character. Avoid int overflow if max_char is close
6281 to INT_MAX.
6282 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6283 this is intended anyway and avoids some undefined behavior.
6284 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6285 INDEX_TO_CODE_POINT, as that's what it expects.
6286 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6287 * charset.h (DECODE_CHAR): Return int, not unsigned;
6288 this is what was intended anyway, and it avoids undefined behavior.
6289 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6290 integer-overflow issues.
6291 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6292 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6293 where the argument is EMACS_INT, and this behavior is not intended.
6294 * chartab.c (Fmake_char_table, Fset_char_table_range)
6295 (uniprop_get_decoder, uniprop_get_encoder):
6296 Don't assume fixnum fits in int.
6297 * cmds.c (move_point): New function, that does the gist of
6298 Fforward_char and Fbackward_char, but does so while checking
6299 for integer overflow more accurately.
6300 (Fforward_char, Fbackward_char): Use it.
6301 (Fforward_line, Fend_of_line, internal_self_insert)
6302 (internal_self_insert):
6303 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6304 Fix a FIXME, by checking for integer overflow when calculating
6305 target_clm and actual_clm.
6306 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6307 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6308 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6309 (coding_alloc_by_making_gap, alloc_destination)
6310 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6311 (encode_coding_utf_16, detect_coding_emacs_mule)
6312 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6313 (detect_coding_iso_2022, decode_coding_iso_2022)
6314 (encode_invocation_designation, encode_designation_at_bol)
6315 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6316 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6317 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6318 (encode_coding_ccl, encode_coding_raw_text)
6319 (detect_coding_charset, decode_coding_charset)
6320 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6321 (produce_composition, produce_charset, produce_annotation)
6322 (decode_coding, handle_composition_annotation)
6323 (handle_charset_annotation, consume_chars, decode_coding_gap)
6324 (decode_coding_object, encode_coding_object, detect_coding_system)
6325 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6326 (code_convert_region, code_convert_string)
6327 (Fdefine_coding_system_internal)
6328 (coding_set_source, coding_set_destination):
6329 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6330 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6331 (Fdefine_coding_system_internal):
6332 Don't assume fixnums fit in int.
6333 (decode_coding_gap, decode_coding_object, encode_coding_object)
6334 (Fread_coding_system, Fdetect_coding_region)
6335 (Funencodable_char_position, Fcheck_coding_systems_region)
6336 (get_translation, handle_composition_annotation, consume_chars):
6337 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6338 (consume_chars): Rewrite to not calculate an address outside buffer.
6339 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6340 Don't access memory outside of the args array.
6341 (Fdefine_coding_system_internal): Check for charset-id overflow.
6342 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6343 result of ENCODE_CHAR.
6344 * coding.h: Adjust decls to match defn changes elsewhere.
6345 (struct coding_system):
6346 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6347 * composite.c (get_composition_id, find_composition)
6348 (run_composition_function, update_compositions)
6349 (compose_text, composition_gstring_put_cache)
6350 (composition_gstring_p, composition_gstring_width)
6351 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6352 (composition_compute_stop_pos, composition_reseat_it)
6353 (composition_update_it, struct position_record)
6354 (find_automatic_composition, composition_adjust_point)
6355 (Fcomposition_get_gstring, Ffind_composition_internal):
6356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6357 (update_compositions):
6358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6359 * composite.h: Adjust decls to match defn changes elsewhere.
6360 (struct composition):
6361 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6362 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6363 Do not attempt to compute the address of the object just before a
6364 buffer; this is not portable.
6365 (Faref, Faset):
6366 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6367 (Faset): Use int, not EMACS_INT, where int is wide enough.
6368 (Fstring_to_number): Don't assume fixnums fit in int.
6369 (Frem): Don't assume arg is nonnegative.
6370 * dbusbind.c (xd_append_arg): Check for integers out of range.
6371 (Fdbus_call_method): Don't overflow the timeout int.
6372 (extract_signed, extract_unsigned): New functions.
6373 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6374 (xd_get_connection_references): Return ptrdiff_t, not int.
6375 All uses changed.
6376 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6377 (xd_read_message_1):
6378 Use int, not unsigned, where the dbus API uses int.
6379 (Fdbus_message_internal): Don't overflow mtype.
6380 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6381 * dired.c (directory_files_internal, file_name_completion, scmp)
6382 (file_name_completion_stat):
6383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6384 (file_name_completion): Don't overflow matchcount.
6385 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6386 * dispextern.h: Adjust decls to match defn changes elsewhere.
6387 (struct text_pos, struct glyph, struct bidi_saved_info)
6388 (struct bidi_string_data, struct bidi_it, struct composition_it)
6389 (struct it):
6390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6391 (struct display_pos, struct composition_it, struct it):
6392 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6393 * dispnew.c (increment_matrix_positions)
6394 (increment_row_positions, mode_line_string)
6395 (marginal_area_string):
6396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6397 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6398 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6399 (duration_to_sec_usec): New function, to check for overflow better.
6400 (Fsleep_for, sit_for): Use it.
6401 * doc.c (get_doc_string, store_function_docstring):
6402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6403 (get_doc_string, Fsnarf_documentation):
6404 Use int, not EMACS_INT, where int is wide enough.
6405 (get_doc_string):
6406 Use SAFE_ALLOCA, not alloca.
6407 Check for overflow when converting EMACS_INT to off_t.
6408 * doprnt.c (doprnt):
6409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6410 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6411 Don't assume uid_t fits into fixnum.
6412 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6413 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6414 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6415 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6416 (general_insert_function)
6417 (Finsert_char, make_buffer_string, make_buffer_string_both)
6418 (update_buffer_properties, Fbuffer_substring)
6419 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6420 (Fsubst_char_in_region, check_translation)
6421 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6422 (transpose_markers, Ftranspose_regions):
6423 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6424 (clip_to_bounds): Move to lisp.h as an inline function).
6425 (Fconstrain_to_field): Don't assume integers are nonnegative.
6426 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6427 (Fsubst_char_in_region, Fsave_restriction):
6428 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6429 (Femacs_pid): Don't assume pid_t fits into fixnum.
6430 (lo_time): Use int, not EMACS_INT, when int suffices.
6431 (lisp_time_argument): Check for usec out of range.
6432 (Fencode_time): Don't assume fixnum fits in int.
6433 (Fuser_login_name, Fuser_full_name): Signal an error
6434 if a uid argument is out of range, rather than relying on
6435 undefined behavior.
6436 (Fformat_time_string): Remove now-unnecessary check.
6437 lisp_time_argument checks for out-of-range usec now.
6438 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6439 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6440 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6441 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6442 (init_cmdargs, Fdump_emacs):
6443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6444 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6445 the bottom (typically) 32 bits of the fixnum.
6446 * eval.c (specpdl_size, call_debugger):
6447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6448 (when_entered_debugger, Fbacktrace_debug):
6449 Don't assume fixnum can fit in int.
6450 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6451 the object just before a buffer; this is not portable.
6452 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6453 (grow_specpdl, unbind_to):
6454 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6455 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6456 (grow_specpdl): Simplify allocation by using xpalloc.
6457 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6458 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6459 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6460 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6461 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6462 (a_write, e_write):
6463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6464 (Fcopy_file, non_regular_nbytes, read_non_regular)
6465 (Finsert_file_contents):
6466 Use int, not EMACS_INT, where int is wide enough.
6467 (READ_BUF_SIZE): Verify that it fits in int.
6468 (Finsert_file_contents): Check that counts are in proper range,
6469 rather than assuming fixnums fit into ptrdiff_t etc.
6470 Don't assume fixnums fit into int.
6471 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6472 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6473 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6474 (string_char_to_byte, string_byte_to_char)
6475 (string_make_multibyte, string_to_multibyte)
6476 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6477 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6478 (substring_both, Fdelete, internal_equal, Ffillarray)
6479 (Fclear_string, mapcar1)
6480 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6481 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6482 (larger_vector, make_hash_table, maybe_resize_hash_table)
6483 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6484 (Fmaphash, secure_hash):
6485 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6486 (concat): Check for string index and length overflow.
6487 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6488 (Frequire):
6489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6490 (larger_vector): New API (vec, incr_min, size_max) replaces old
6491 one (vec, new_size, init). This catches size overflow.
6492 INIT was removed because it was always Qnil.
6493 All callers changed.
6494 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6495 the upper bound on a hash table index size.
6496 (make_hash_table, maybe_resize_hash_table): Use it.
6497 (secure_hash): Computer start_byte and end_byte only after
6498 they're known to be in ptrdiff_t range.
6499 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6500 (Ffont_get_glyphs, Ffont_at):
6501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6502 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6503 (Flist_fonts, Fopen_font):
6504 Don't assume fixnum can fit in int.
6505 (check_gstring): Don't assume index can fit in int.
6506 (font_match_p): Check that fixnum is a character, not a nonnegative
6507 fixnum, since the later code needs to stuff it into an int.
6508 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6509 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6510 conversion overflow issues.
6511 (Fopen_font): Check for integer out of range.
6512 (Ffont_get_glyphs): Don't assume index can fit in int.
6513 * font.h: Adjust decls to match defn changes elsewhere.
6514 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6515 integer overflow.
6516 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6517 printmax_t, where ptrdiff_t is wide enough.
6518 (Finternal_char_font):
6519 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6520 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6521 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6522 (Fset_frame_position, x_set_frame_parameters)
6523 (x_set_line_spacing, x_set_border_width)
6524 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6525 Check that fixnums are in proper range for system types.
6526 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6528 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6529 Use SAFE_ALLOCA_LISP, not alloca.
6530 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6531 intptr_t is wide enough.
6532 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6533 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6534 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6535 Check for fixnum out of range.
6536 * ftfont.c (ftfont_list): Don't assume index fits in int.
6537 Check that fixnums are in proper range for system types.
6538 (ftfont_shape_by_flt):
6539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6540 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6542 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6543 Check that fixnums are in proper range for system types.
6544 * gnutls.h: Adjust decls to match defn changes elsewhere.
6545 * gtkutil.c (xg_dialog_run):
6546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6547 (update_frame_tool_bar):
6548 Check that fixnums are in proper range for system types.
6549 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6550 (lookup_image): Check that fixnums are in range for system types.
6551 * indent.c (last_known_column, last_known_column_point):
6552 (current_column_bol_cache):
6553 (skip_invisible, current_column, check_display_width):
6554 (check_display_width, scan_for_column, current_column_1)
6555 (Findent_to, Fcurrent_indentation, position_indentation)
6556 (indented_beyond_p, Fmove_to_column, compute_motion):
6557 (Fcompute_motion, Fvertical_motion):
6558 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6559 (last_known_column_modified): Use EMACS_INT, not int.
6560 (check_display_width):
6561 (Fcompute_motion):
6562 Check that fixnums and floats are in proper range for system types.
6563 (compute_motion): Don't assume index or fixnum fits in int.
6564 (compute_motion, Fcompute_motion):
6565 Use int, not EMACS_INT, when it is wide enough.
6566 (vmotion): Omit local var start_hpos that is always 0; that way
6567 we don't need to worry about overflow in expressions involving it.
6568 * indent.h: Adjust decls to match defn changes elsewhere.
6569 (struct position):
6570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6571 Use int, not EMACS_INT, where int is wide enough.
6572 Remove unused members ovstring_chars_done and tab_offset;
6573 all uses removed.
6574 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6575 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6576 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6577 (make_gap, copy_text, insert, insert_and_inherit)
6578 (insert_before_markers, insert_before_markers_and_inherit)
6579 (insert_1, count_combining_before, count_combining_after)
6580 (insert_1_both, insert_from_string)
6581 (insert_from_string_before_markers, insert_from_string_1)
6582 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6583 (adjust_after_replace, adjust_after_insert, replace_range)
6584 (replace_range_2, del_range, del_range_1, del_range_byte)
6585 (del_range_both, del_range_2, modify_region)
6586 (prepare_to_modify_buffer, signal_before_change)
6587 (signal_after_change, Fcombine_after_change_execute):
6588 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6589 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6590 (balance_an_interval, split_interval_right, split_interval_left)
6591 (find_interval, next_interval, update_interval)
6592 (adjust_intervals_for_insertion, delete_node, delete_interval)
6593 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6594 (static_offset_intervals, offset_intervals)
6595 (merge_interval_right, merge_interval_left, make_new_interval)
6596 (graft_intervals_into_buffer, temp_set_point_both)
6597 (temp_set_point, set_point, adjust_for_invis_intang)
6598 (set_point_both, move_if_not_intangible, get_property_and_range)
6599 (get_local_map, copy_intervals, copy_intervals_to_string)
6600 (compare_string_intervals, set_intervals_multibyte_1):
6601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6602 * intervals.h: Adjust decls to match defn changes elsewhere.
6603 (struct interval):
6604 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6605 * keyboard.c (this_command_key_count, this_single_command_key_start)
6606 (before_command_key_count, before_command_echo_length, echo_now)
6607 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6608 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6609 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6610 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6611 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6612 (last_non_minibuf_size, last_point_position, echo_truncate)
6613 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6614 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6615 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6616 (stuff_buffered_input):
6617 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6618 (last_auto_save, command_loop_1, read_char):
6619 Use EMACS_INT, not int, to avoid integer overflow.
6620 (record_char): Avoid overflow in total_keys computation.
6621 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6622 * keyboard.h: Adjust decls to match defn changes elsewhere.
6623 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6624 (Fkey_description, Fdescribe_vector, Flookup_key):
6625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6626 (click_position): New function, to check that positions are in range.
6627 (Fcurrent_active_maps):
6628 (describe_command):
6629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6630 (Faccessible_keymaps, Fkey_description):
6631 (preferred_sequence_p):
6632 Don't assume fixnum can fit into int.
6633 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6634 Check for integer overflow in size calculations.
6635 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6636 avoid mishandling large integers.
6637 * lisp.h: Adjust decls to match defn changes elsewhere.
6638 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6639 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6640 (struct Lisp_Marker):
6641 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6642 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6643 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6644 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6645 All callers changed.
6646 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6647 Assume the arg has valid form, since it always does.
6648 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6649 unsigned integer system type.
6650 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6651 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6652 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6653 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6654 (duration_to_sec_usec): New decl.
6655 * lread.c (read_from_string_index, read_from_string_index_byte)
6656 (read_from_string_limit, readchar, unreadchar, openp)
6657 (read_internal_start, read1, oblookup):
6658 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6659 (Fload, readevalloop, Feval_buffer, Feval_region):
6660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6661 (openp): Check for out-of-range argument to 'access'.
6662 (read1): Use int, not EMACS_INT, where int is wide enough.
6663 Don't assume fixnum fits into int.
6664 Fix off-by-one error that can read outside a buffer.
6665 (read_filtered_event): Use duration_to_sec_usec
6666 to do proper overflow checking on durations.
6667 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6668 in size calculation.
6669 (Fexecute_kbd_macro):
6670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6671 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6672 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6673 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6674 (set_marker_both, set_marker_restricted_both, marker_position)
6675 (marker_byte_position, Fbuffer_has_markers_at):
6676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6677 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6678 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6679 It now merely ensures that the menu is large enough, without
6680 necessarily growing it, as this avoids some integer overflow issues.
6681 All callers changed.
6682 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6683 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6684 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6685 Use SAFE_ALLOCA_LISP, not alloca.
6686 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6687 to EMACS_INT. Check that fixnums are in proper range for system types.
6688 * minibuf.c (minibuf_prompt_width, string_to_object)
6689 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6690 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6691 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6692 (get_minibuffer, read_minibuf_unwind):
6693 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6694 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6695 this simplifies overflow checking. All callers changed.
6696 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6697 (Ftest_completion):
6698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6699 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6700 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6701 Check that fixnums are in proper range for system types.
6702 (Fx_create_frame, Fx_show_tip):
6703 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6704 * nsfont.m (ns_findfonts, nsfont_list_family):
6705 Don't assume fixnum fits in long.
6706 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6707 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6708 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6709 wide enough.
6710 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6712 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6713 (PRINTDECLARE, PRINTPREPARE):
6714 (strout, print_string):
6715 (print, print_preprocess, print_check_string_charset_prop)
6716 (print_object):
6717 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6718 (PRINTDECLARE):
6719 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6720 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6721 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6722 (printchar, strout): Use xpalloc to catch size calculation overflow.
6723 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6724 (print_error_message): Use SAFE_ALLOCA, not alloca.
6725 (print_object): Use int, not EMACS_INT, where int is wide enough.
6726 (print_depth, new_backquote_output, print_number_index):
6727 Use ptrdiff_t, not int, where int might not be wide enough.
6728 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6729 (Fset_process_window_size, Fformat_network_address)
6730 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6731 (sigchld_handler):
6732 Check that fixnums are in proper range for system types.
6733 (Fsignal_process): Simplify by avoiding a goto.
6734 Check for process-ids out of pid_t range rather than relying on
6735 undefined behavior.
6736 (process_tick, update_tick): Use EMACS_INT, not int.
6737 (Fformat_network_address, read_process_output, send_process)
6738 (Fprocess_send_region, status_notify):
6739 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6740 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6741 (wait_reading_process_output, read_process_output, exec_sentinel):
6742 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6743 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6744 (Faccept_process_output): Use duration_to_sec_usec to do proper
6745 overflow checking on durations.
6746 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6747 Don't assume pid_t fits in int.
6748 * process.h (struct Lisp_Process): Members tick and update_tick
6749 are now of type EMACS_INT, not int.
6750 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6751 configured --with-wide-int.
6752 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6753 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6754 * search.c (looking_at_1, string_match_1):
6755 (fast_string_match, fast_c_string_match_ignore_case)
6756 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6757 (scan_newline, find_before_next_newline, search_command)
6758 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6759 (set_search_regs, wordify):
6760 (Freplace_match):
6761 (Fmatch_data):
6762 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6763 (string_match_1, search_buffer, set_search_regs):
6764 (Fmatch_data):
6765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6766 (wordify): Check for overflow in size calculation.
6767 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6768 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6769 Check that fixnums are in proper range for system types.
6770 * sound.c (struct sound_device)
6771 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6772 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6773 (Fplay_sound_internal):
6774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6775 * syntax.c (struct lisp_parse_state, find_start_modiff)
6776 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6777 (Fparse_partial_sexp):
6778 Don't assume fixnums can fit in int.
6779 (struct lisp_parse_state, find_start_pos, find_start_value)
6780 (find_start_value_byte, find_start_begv)
6781 (update_syntax_table, char_quoted, dec_bytepos)
6782 (find_defun_start, prev_char_comend_first, back_comment):
6783 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6784 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6785 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6786 (Finternal_describe_syntax_value): Check that match_lisp is a
6787 character, not an integer, since the code stuffs it into int.
6788 (scan_words, scan_sexps_forward):
6789 Check that fixnums are in proper range for system types.
6790 (Fforward_word):
6791 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6792 (scan_sexps_forward):
6793 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6794 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6795 * syntax.h: Adjust decls to match defn changes elsewhere.
6796 (struct gl_state_s):
6797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6798 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6799 MOST_POSITIVE_FIXNUM.
6800 * sysdep.c (wait_for_termination_1, wait_for_termination)
6801 (interruptible_wait_for_termination, mkdir):
6802 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6803 (emacs_read, emacs_write):
6804 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6805 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6806 and double all fit in int.
6807 * term.c (set_tty_color_mode):
6808 Check that fixnums are in proper range for system types.
6809 * termhooks.h (struct input_event):
6810 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6811 * textprop.c (validate_interval_range, interval_of)
6812 (Fadd_text_properties, set_text_properties_1)
6813 (Fremove_text_properties, Fremove_list_of_text_properties)
6814 (Ftext_property_any, Ftext_property_not_all)
6815 (copy_text_properties, text_property_list, extend_property_ranges)
6816 (verify_interval_modification):
6817 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6818 (Fnext_single_char_property_change)
6819 (Fprevious_single_char_property_change):
6820 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6821 (copy_text_properties):
6822 Check for integer overflow in index calculation.
6823 * undo.c (last_boundary_position, record_point, record_insert)
6824 (record_delete, record_marker_adjustment, record_change)
6825 (record_property_change):
6826 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6827 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6829 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6830 (Fx_hide_tip, Fx_file_dialog):
6831 * w32menu.c (set_frame_menubar):
6832 Use ptrdiff_t, not int, for consistency with rest of code.
6833 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6834 (select_window, Fdelete_other_windows_internal)
6835 (window_scroll_pixel_based, window_scroll_line_based)
6836 (Frecenter, Fset_window_configuration):
6837 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6838 (Fset_window_hscroll, run_window_configuration_change_hook)
6839 (set_window_buffer, temp_output_buffer_show, scroll_command)
6840 (Fscroll_other_window, Frecenter):
6841 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6842 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6843 Don't assume fixnum fits in int.
6844 (Fset_window_scroll_bars):
6845 Check that fixnums are in proper range for system types.
6846 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6847 (string_pos, c_string_pos, number_of_chars, init_iterator)
6848 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6849 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6850 (compute_display_string_end, handle_face_prop)
6851 (face_before_or_after_it_pos, handle_invisible_prop)
6852 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6853 (display_prop_intangible_p, string_buffer_position_lim)
6854 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6855 (get_overlay_strings_1, get_overlay_strings)
6856 (iterate_out_of_display_property, forward_to_next_line_start)
6857 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6858 (get_next_display_element, set_iterator_to_next)
6859 (get_visually_first_element, compute_stop_pos_backwards)
6860 (handle_stop_backwards, next_element_from_buffer)
6861 (move_it_in_display_line_to, move_it_in_display_line)
6862 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6863 (add_to_log, message_dolog, message_log_check_duplicate)
6864 (message2, message2_nolog, message3, message3_nolog
6865 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6866 (current_message_1, truncate_echo_area, truncate_message_1)
6867 (set_message, set_message_1, store_mode_line_noprop)
6868 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6869 (text_outside_line_unchanged_p, check_point_in_composition)
6870 (reconsider_clip_changes)
6871 (redisplay_internal, set_cursor_from_row, try_scrolling)
6872 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6873 (redisplay_window, find_last_unchanged_at_beg_row)
6874 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6875 (trailing_whitespace_p, find_row_edges, display_line)
6876 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6877 (display_mode_element, store_mode_line_string)
6878 (pint2str, pint2hrstr, decode_mode_spec)
6879 (display_count_lines, display_string, draw_glyphs)
6880 (x_produce_glyphs, x_insert_glyphs)
6881 (rows_from_pos_range, mouse_face_from_buffer_pos)
6882 (fast_find_string_pos, mouse_face_from_string_pos)
6883 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6884 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6885 (safe_call, init_from_display_pos, handle_fontified_prop)
6886 (handle_single_display_spec, load_overlay_strings)
6887 (with_echo_area_buffer, setup_echo_area_for_printing)
6888 (display_echo_area, echo_area_display)
6889 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6890 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6891 (redisplay_window, dump_glyph_row, display_mode_line)
6892 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6893 (handle_display_spec, display_prop_string_p):
6894 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6895 (handle_single_display_spec, build_desired_tool_bar_string)
6896 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6897 (get_specified_cursor_type):
6898 Check that fixnums are in proper range for system types.
6899 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6900 (Flookup_image_map):
6901 Don't assume fixnums fit in int.
6902 (compare_overlay_entries):
6903 Avoid mishandling comparisons due to subtraction overflow.
6904 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6905 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6906 (handle_tool_bar_click):
6907 Use int, not unsigned, since we prefer signed and the signedness
6908 doesn't matter here.
6909 (get_next_display_element, next_element_from_display_vector):
6910 Use int, not EMACS_INT, when int is wide enough.
6911 (start_hourglass): Use duration_to_sec_usec to do proper
6912 overflow checking on durations.
6913 * xfaces.c (Fbitmap_spec_p):
6914 Check that fixnums are in proper range for system types.
6915 (compare_fonts_by_sort_order):
6916 Avoid mishandling comparisons due to subtraction overflow.
6917 (Fx_family_fonts, realize_basic_faces):
6918 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6919 (Fx_family_fonts):
6920 Don't assume fixnum fits in int.
6921 Use SAFE_ALLOCA_LISP, not alloca.
6922 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6923 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6924 (face_at_buffer_position, face_for_overlay_string)
6925 (face_at_string_position):
6926 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6927 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6928 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6929 (Fx_show_tip):
6930 Check that fixnums are in proper range for system types.
6931 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6932 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6934 (Fx_change_window_property): Don't assume fixnums fit in int.
6935 * xfont.c (xfont_chars_supported):
6936 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6937 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6938 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6939 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6940 * xml.c (parse_region):
6941 * xrdb.c (magic_file_p):
6942 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6943 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6944 (x_get_local_selection, x_reply_selection_request)
6945 (x_handle_selection_request, wait_for_property_change):
6946 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6947 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
6948 short is wide enough.
6949 (x_send_client_event): Don't assume fixnum fits in int.
6950 * xterm.c (x_x_to_emacs_modifiers):
6951 Don't assume EMACS_INT overflows nicely into int.
6952 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
6953 may come from Lisp.
6954 (handle_one_xevent): NATNUMP can eval its arg twice.
6955 (x_connection_closed):
6956 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6957 * xterm.h: Adjust decls to match defn changes elsewhere.
6958 (struct scroll_bar): Use struct vectorlike_header
6959 rather than rolling our own approximation.
6960 (SCROLL_BAR_VEC_SIZE): Remove; not used.
6961
6962 2012-05-25 Glenn Morris <rgm@gnu.org>
6963
6964 * lisp.mk (lisp): Update for more files being compiled now.
6965
6966 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
6967
6968 * lread.c: Remove `read_pure' which makes no difference.
6969 (read_pure): Remove var.
6970 (unreadpure): Remove function.
6971 (readevalloop): Don't call read_list with -1 flag.
6972 (read1, read_vector): Don't test read_pure any more.
6973 (read_list): Simplify.
6974
6975 * fileio.c, character.h: Minor style tweaks.
6976
6977 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
6978
6979 * window.h (clip_changed): Remove useless declaration.
6980
6981 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
6982
6983 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
6984 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
6985
6986 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
6987
6988 Remove src/m/*.
6989 This directory predates autoconf and is no longer needed nowadays.
6990 Move its few remaining bits of functionality to where they're needed.
6991 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
6992 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
6993 * m/template.h: Remove.
6994 * Makefile.in (M_FILE): Remove. All uses removed.
6995 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
6996 * lisp.h (USE_LSB_TAG):
6997 * mem-limits.h (EXCEEDS_LISP_PTR):
6998 Use VAL_MAX, not VALBITS, in #if.
6999 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7000 (EMACS_UINT): Define unconditionally now.
7001 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7002 (BITS_PER_EMACS_INT): New constants, replacing
7003 what used to be in config.h, but not useful in #if.
7004 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7005 define them any more.
7006 (VAL_MAX): New macro.
7007 (VALMASK): Use it.
7008 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7009 BITS_PER_EMACS_INT, in #if.
7010 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7011 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7012 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7013 * s/ms-w32.h (DATA_START):
7014 Move here from removed file m/intel386.h.
7015 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7016 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7017
7018 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7019
7020 Assume C89 or later.
7021 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7022 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7023 (xrealloc):
7024 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7025 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7026 * textprop.c, tparam.c (NULL): Remove.
7027 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7028 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7029 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7030 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7031 * xterm.c (input_signal_count): Assume volatile works.
7032
7033 2012-05-21 Ken Brown <kbrown@cornell.edu>
7034
7035 * xgselect.c (xg_select): Fix first argument in call to 'select'
7036 (bug#11508).
7037
7038 2012-05-20 Ken Brown <kbrown@cornell.edu>
7039
7040 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7041 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7042
7043 2012-05-19 Ken Brown <kbrown@cornell.edu>
7044
7045 * xfns.c (x_in_use): Remove `static' qualifier.
7046 * xterm.h (x_in_use): Declare.
7047 * xgselect.c: Include xterm.h.
7048 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7049 and `display_arg' (bug#9754).
7050
7051 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7052
7053 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7054
7055 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7056 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7057
7058 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7059
7060 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7061
7062 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7063 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7064
7065 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7066 reference to image_cache->refcount.
7067 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7068
7069 2012-05-17 Juri Linkov <juri@jurta.org>
7070
7071 * search.c (Fword_search_regexp, Fword_search_backward)
7072 (Fword_search_forward, Fword_search_backward_lax)
7073 (Fword_search_forward_lax): Move functions to isearch.el
7074 (bug#10145, bug#11381).
7075
7076 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7077
7078 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7079
7080 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7081
7082 * lread.c (init_obarray): Declare Qt and Qnil as special.
7083
7084 2012-05-14 Glenn Morris <rgm@gnu.org>
7085
7086 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7087 Put "libexec" before "bin", for the sake of init_callproc_1.
7088
7089 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7090
7091 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7092
7093 * unexaix.c: Port to more-recent AIX compilers.
7094 (report_error, report_error_1, make_hdr, copy_sym)
7095 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7096 Make arguments const char *, not char *, to avoid violations of C
7097 standard and to fix some AIX warnings reported by Gilles Pion.
7098
7099 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7100
7101 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7102 already have overlays loaded.
7103 (handle_single_display_spec): Before returning without displaying
7104 fringe bitmap, synchronize the bidi iterator with the main display
7105 iterator, by calling iterate_out_of_display_property.
7106 (iterate_out_of_display_property): Detect buffer iteration by
7107 testing that it->string is a Lisp string.
7108 (get_next_display_element): When the current object is exhausted,
7109 and there's something on it->stack, call set_iterator_to_next to
7110 proceed with what's on the stack, instead of returning zero.
7111 (set_iterator_to_next): If called at the end of a Lisp string,
7112 proceed to consider_string_end without incrementing string
7113 position. Don't increment display vector index past the end of
7114 the display vector. (Bug#11417)
7115 (pos_visible_p): Don't report a position visible when move_it_to
7116 stopped at the last line of window, which happens to be scanned
7117 backwards by the bidi iteration. (Bug#11464)
7118
7119 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7120
7121 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7122 and right-margin display specs even if the spec is invalid or we
7123 are on a TTY, and thus unable to display on the fringes.
7124 That's because the text with the property will not be displayed anyway,
7125 so we need to signal to the caller that this is a "replacing"
7126 display spec. This fixes display when the spec is invalid or we
7127 are on a TTY.
7128
7129 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7130
7131 * unexaix.c (make_hdr): Fix typo in prototype.
7132 This bug broke the build on AIX. Problem reported by Gilles Pion.
7133
7134 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7135
7136 * keyboard.c (kbd_buffer_get_event): Read special events also in
7137 batch mode. (Bug#11415)
7138
7139 2012-05-12 Glenn Morris <rgm@gnu.org>
7140
7141 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7142
7143 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7144
7145 * lisp.mk (lisp): Add newcomment.elc.
7146
7147 2012-05-12 Glenn Morris <rgm@gnu.org>
7148
7149 * Makefile.in (MKDIR_P): New, set by configure.
7150 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7151
7152 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7153
7154 Remove unused function hourglass_started.
7155 * dispextern.h (hourglass_started):
7156 * w32fns.c (hourglass_started):
7157 * xdisp.c (hourglass_started): Remove.
7158
7159 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7160
7161 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7162 Update dependencies.
7163
7164 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7165
7166 * xgselect.c (xg_select): Put maxfds+1 into a var.
7167 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7168
7169 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7170
7171 2012-05-10 Dave Abrahams <dave@boostpro.com>
7172
7173 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7174 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7175
7176 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7177
7178 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7179 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7180 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7181 Initialize xd_registered_buses.
7182
7183 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7184
7185 Untag more efficiently if USE_LSB_TAG.
7186 This is based on a proposal by YAMAMOTO Mitsuharu in
7187 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7188 For an admittedly artificial (nth 8000 longlist) benchmark on
7189 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7190 Emacs's overall text size by 1%.
7191 * lisp.h (XUNTAG): New macro.
7192 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7193 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7194 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7195 * eval.c (Fautoload):
7196 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7197 * frame.h (XFRAME): Use XUNTAG.
7198
7199 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7200 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7201 Remove unportable assumptions about print widths of types like
7202 dbus_uint32_t.
7203 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7204 intptr_t when converting between pointer and integer, to avoid GCC
7205 warnings about wrong width.
7206
7207 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7208
7209 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7210 stack for each reader_thread, instead of defaulting to 8MB
7211 determined by the linker. This avoids failures in creating
7212 subprocesses on Windows 7, see the discussion in this thread:
7213 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7214
7215 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7216
7217 Fix up display of the *Minibuf-0* buffer in the mini window.
7218 * keyboard.c (read_char): Don't clear the echo area if there's no
7219 message to clear.
7220 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7221 contents of *Minibuf-0*) if there's no message displayed in its stead.
7222
7223 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7224
7225 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7226 batch mode.
7227
7228 2012-05-06 Chong Yidong <cyd@gnu.org>
7229
7230 * lisp.mk (lisp): Update.
7231
7232 2012-05-05 Jim Meyering <meyering@redhat.com>
7233
7234 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7235
7236 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7237
7238 * data.c (PUT_ERROR): New macro.
7239 (syms_of_data): Use it. Add new error type `user-error'.
7240 * undo.c (user_error): New function.
7241 (Fprimitive_undo): Use it.
7242 * print.c (print_error_message): Adjust print style for `user-error'.
7243 * keyboard.c (user_error): New function.
7244 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7245
7246 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7247
7248 Do not limit current-time-string to years 1000..9999.
7249 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7250 (Fcurrent_time_string): Support any year that is supported by the
7251 underlying localtime representation. Don't use asctime, as it
7252 has undefined behavior for years outside the range -999..9999.
7253
7254 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7255
7256 Fix race conditions involving setenv, gmtime, localtime, asctime.
7257 Without this fix, interrupts could mess up code that uses these
7258 nonreentrant functions, since setting TZ invalidates existing
7259 tm_zone or tzname values, and since most of these functions return
7260 pointers to static storage.
7261 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7262 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7263 Grow the critical sections to include not just invoking
7264 localtime/gmtime, but also accessing these functions' results
7265 including their tm_zone values if any, and any related TZ setting.
7266 (format_time_string): Last arg is now struct tm *, not struct tm **,
7267 so that the struct tm is saved in the critical section.
7268 All callers changed. Simplify allocation of initial buffer, partly
7269 motivated by the fact that memory allocation needs to be outside
7270 the critical section.
7271
7272 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7273
7274 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7275 with RESET_INTERVAL.
7276
7277 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7278 Remove duplicated buffer name initialization.
7279
7280 2012-05-02 Jim Meyering <jim@meyering.net>
7281
7282 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7283
7284 * xfns.c (x_window): Use xstrdup (Bug#11375).
7285
7286 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7287
7288 * xdisp.c (pos_visible_p): If already at a newline from the
7289 display string before the 'while' loop, don't walk back the glyphs
7290 from it3.glyph_row. Solves assertion violation when the display
7291 string begins with a newline (egg.el). (Bug#11367)
7292
7293 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7294
7295 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7296 Move to simple.el.
7297
7298 2012-05-01 Glenn Morris <rgm@gnu.org>
7299
7300 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7301 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7302 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7303 All were removed before 23.1.
7304
7305 * dispnew.c: Remove HAVE_LIBNCURSES test;
7306 it is always true on relevant platforms.
7307
7308 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7309 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7310
7311 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7312
7313 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7314
7315 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7316 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7317 Remove.
7318
7319 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7320
7321 Do not avoid creating empty evaporating overlays (Bug#9642).
7322 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7323 That is, do not delete an evaporating overlay if it becomes
7324 empty after its bounds are adjusted to fit within its buffer.
7325 This fix caused other problems, and I'm reverting it until we get
7326 to the bottom of them.
7327
7328 2012-04-27 Chong Yidong <cyd@gnu.org>
7329
7330 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7331
7332 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7333
7334 * xdisp.c (pos_visible_p): If the window start position is beyond
7335 ZV, start the display from buffer beginning. Prevents assertion
7336 violation in init_iterator when the minibuffer window is scrolled
7337 via the scroll bar.
7338
7339 * window.c (window_scroll_pixel_based): Likewise.
7340
7341 2012-04-27 Chong Yidong <cyd@gnu.org>
7342
7343 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7344
7345 2012-04-27 Glenn Morris <rgm@gnu.org>
7346
7347 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7348 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7349
7350 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7351
7352 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7353 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7354
7355 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7356
7357 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7358 display element, check also the underlying string or buffer
7359 character. (Bug#11341)
7360
7361 * w32menu.c: Include w32heap.h.
7362 (add_menu_item): If the call to AppendMenuW (via
7363 unicode_append_menu) fails, disable Unicode menus only if we are
7364 running on Windows 9X/Me.
7365
7366 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7367
7368 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7369 (xgetint): Add missing shift for LSB tags.
7370
7371 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7372
7373 * keyboard.c (read_char): Don't wipe echo area for select window
7374 events: These might get delayed via `mouse-autoselect-window'
7375 (Bug#11304).
7376
7377 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7378
7379 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7380 manipulation of :loaded-from data.
7381
7382 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7383
7384 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7385 now a cons (bug#11311).
7386
7387 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7388
7389 Do not create empty overlays with the evaporate property (Bug#9642).
7390 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7391 if it becomes empty after its bounds are adjusted to fit within
7392 its buffer. Without this fix, in a nonempty buffer (let ((o
7393 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7394 yields an empty overlay that has the evaporate property, which is
7395 not supposed to happen.
7396
7397 Fix minor GTK3 problems found by static checking.
7398 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7399 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7400 (struct _EmacsFixedClass, emacs_fixed_get_type):
7401 Move decls here from emacsgtkfixed.h, since they needn't be public.
7402 (emacs_fixed_get_type): Now static.
7403 (emacs_fixed_class_init): Omit unused local.
7404 (emacs_fixed_child_type): Remove; unused.
7405 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7406 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7407 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7408 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7409 (EMACS_FIXED_GET_CLASS): Remove; unused.
7410 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7411
7412 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7413 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7414
7415 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7416
7417 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7418 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7419 (__malloc_size_t, __malloc_ptrdiff_t):
7420 Remove. All uses removed, replaced by the definiens if needed,
7421 since we can assume C89 or better now.
7422 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7423 (protect_malloc_state, align, get_contiguous_space)
7424 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7425 (malloc_atfork_handler_child, malloc_enable_thread)
7426 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7427 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7428 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7429 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7430 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7431 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7432 Define using prototypes, not old style.
7433 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7434 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7435 (align): Don't assume that signed integer overflow wraps around.
7436 Omit unused local var.
7437 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7438 (_free_internal_nolock, memalign, mallochook, reallochook):
7439 Omit no-longer-needed casts.
7440 (valloc): Use getpagesize, not __getpagesize.
7441 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7442 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7443
7444 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7445
7446 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7447
7448 Move functions from C to Lisp. Make non-blocking method calls
7449 the default. Implement further D-Bus standard interfaces.
7450
7451 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7452 (QCdbus_request_name_allow_replacement)
7453 (QCdbus_request_name_replace_existing)
7454 (QCdbus_request_name_do_not_queue)
7455 (QCdbus_request_name_reply_primary_owner)
7456 (QCdbus_request_name_reply_in_queue)
7457 (QCdbus_request_name_reply_exists)
7458 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7459 (QCdbus_registered_serial, QCdbus_registered_method)
7460 (QCdbus_registered_signal): New Lisp objects.
7461 (XD_DEBUG_MESSAGE): Use sizeof.
7462 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7463 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7464 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7465 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7466 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7467 (xd_signature, xd_append_arg): Allow float for integer types.
7468 (xd_get_connection_references): New function.
7469 (xd_get_connection_address): Rename from xd_initialize.
7470 Return cached address.
7471 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7472 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7473 level.
7474 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7475 Return number of refcounts.
7476 (Fdbus_get_unique_name): Make stronger parameter check.
7477 (Fdbus_message_internal): New defun.
7478 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7479 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7480 (Fdbus_send_signal, Fdbus_register_service)
7481 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7482 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7483 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7484 (Vdbus_compiled_version, Vdbus_runtime_version)
7485 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7486 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7487 (Vdbus_message_type_signal): New defvars.
7488 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7489 Adapt docstring.
7490
7491 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7492
7493 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7494 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7495 Do not assume ptrdiff_t is the same width as 'int'.
7496
7497 * alloc.c: Handle unusual debugging option combinations.
7498 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7499 since the two debugging options are incompatible.
7500 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7501 is defined.
7502 (mem_init, mem_insert, mem_insert_fixup):
7503 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7504 (NEED_MEM_INSERT): Remove; no longer needed.
7505
7506 2012-04-22 Leo Liu <sdl.web@gmail.com>
7507
7508 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7509
7510 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7511
7512 * sysdep.c [__FreeBSD__]: Minor cleanups.
7513 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7514 Use Emacs indenting style more consistently. Avoid some casts.
7515 Use 'double' consistently rather than mixing 'float' and 'double'.
7516
7517 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7518
7519 * sysdep.c (list_system_processes, system_process_attributes):
7520 Add implementation for FreeBSD (Bug#5243).
7521
7522 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7523
7524 * lisp.mk (lisp): Update.
7525
7526 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7527
7528 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7529 It is never used otherwise.
7530
7531 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7532
7533 * print.c (print_preprocess): Only check print_depth if print-circle
7534 is nil.
7535 (print_object): Check for cycles even when print-circle is nil and
7536 print-gensym is t, but only check print_depth if print-circle is nil.
7537
7538 2012-04-20 Chong Yidong <cyd@gnu.org>
7539
7540 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7541 set the status to "failed" and ensure that sentinel is run.
7542
7543 2012-04-20 Glenn Morris <rgm@gnu.org>
7544
7545 * process.c (Fset_process_inherit_coding_system_flag)
7546 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7547 (Fmake_network_process, Fmake_serial_process): Doc fix.
7548
7549 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7550
7551 * xdisp.c (string_buffer_position_lim): Limit starting position to
7552 BEGV.
7553 (set_cursor_from_row): If called for a mode-line or header-line
7554 row, return zero immediately.
7555 (try_cursor_movement): If inside continuation line, don't back up
7556 farther than the first row after the header line, if any.
7557 Don't consider the header-line row as "partially visible", even if
7558 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7559
7560 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7561
7562 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7563 (bug#11238).
7564
7565 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7566 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 configure: new option --enable-gcc-warnings (Bug#11207)
7569 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7570 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7571 (ALL_CFLAGS): Use new macros rather than old.
7572 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7573 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7574 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7575 -Wunused-result, -Wunused-variable. This should go away once
7576 the Emacs and Gnulib regex code is merged.
7577 (xmalloc, xrealloc): Now static.
7578
7579 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7580
7581 * dired.c (Fsystem_groups): Remove unused local.
7582
7583 2012-04-17 Glenn Morris <rgm@gnu.org>
7584
7585 * dired.c (Fsystem_users): Doc fix.
7586
7587 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7588
7589 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7590 (syms_of_dired): Add them.
7591
7592 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7593
7594 Fix minor alloc.c problems found by static checking.
7595 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7596 New extern decls, to avoid calling undeclared functions.
7597 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7598 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7599 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7600 (NEED_MEM_INSERT): New macro.
7601 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7602 Remove one incorrect comment and fix another.
7603
7604 Fix minor ralloc.c problems found by static checking.
7605 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7606 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7607 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7608 (r_alloc_sbrk): Now static.
7609
7610 Improve ralloc.c interface checking.
7611 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7612 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7613 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7614 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7615 [REL_ALLOC]: ... to here, to check interface.
7616 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7617 Remove decls. This fixes an "It stinks!".
7618
7619 * alloc.c (which_symbols): Fix alignment issue / type clash.
7620
7621 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7622
7623 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7624 (struct Lisp_Misc_Any): Likewise.
7625 (struct Lisp_Free): Likewise.
7626 * alloc.c (union aligned_Lisp_Symbol): Define.
7627 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7628 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7629 (union aligned_Lisp_Misc): Define.
7630 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7631 aligned_Lisp_Misc instead of union Lisp_Misc.
7632 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7633
7634 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7635
7636 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7637 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7638 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7639 * s/netbsd.h, s/sol2-6.h:
7640 Remove definition of GC_MARK_STACK, since the default now works.
7641 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7642 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7643 no longer the default.
7644 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7645
7646 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7647
7648 * lread.c (lisp_file_lexically_bound_p):
7649 Fix hang at ";-*-\n" (bug#11238).
7650
7651 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7652
7653 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7654 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7655
7656 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7657
7658 * nsterm.m (constrainFrameRect): Always constrain when there is only
7659 one screen (Bug#10962).
7660
7661 2012-04-13 Ken Brown <kbrown@cornell.edu>
7662
7663 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7664
7665 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7666
7667 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7668
7669 2012-04-11 Daniel Colascione <dancol@dancol.org>
7670
7671 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7672 against is gone. It's better to use vfork now so that when Cygwin
7673 gains a new, working vfork, we use it automatically (bug#10398).
7674
7675 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7676
7677 * window.c (save_window_save): Obey window-point-insertion-type.
7678
7679 2012-04-11 Glenn Morris <rgm@gnu.org>
7680
7681 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7682
7683 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7684
7685 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7686
7687 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7688
7689 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7690 (force_quit_count): New var.
7691 (handle_interrupt): Use it.
7692
7693 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7694
7695 * w32.c (w32_delayed_load): Record the full path of the library
7696 being loaded (bug#10424).
7697
7698 2012-04-09 Glenn Morris <rgm@gnu.org>
7699
7700 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7701 not just in the obarray, before snarfing them. (Bug#11036)
7702
7703 * Makefile.in ($(leimdir)/leim-list.el):
7704 Pass EMACS rather than BUILT_EMACS.
7705
7706 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7707
7708 * process.c (make_process):
7709 * process.h: Add integer `gnutls_handshakes_tried' member to
7710 process struct.
7711
7712 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7713 Add convenience `GNUTLS_LOG2i' macro.
7714
7715 * gnutls.c (gnutls_log_function2i): Convenience log function.
7716 (emacs_gnutls_read): Use new log functions,
7717 `gnutls_handshakes_tried' process member, and
7718 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7719 attempts per process (connection).
7720
7721 2012-04-09 Chong Yidong <cyd@gnu.org>
7722
7723 * eval.c (Fuser_variable_p, user_variable_p_eh)
7724 (lisp_indirect_variable): Functions deleted.
7725 (Fdefvar): Caller changed.
7726
7727 * callint.c (Finteractive, Fcall_interactively):
7728 * minibuf.c (Fread_variable): Callers changed.
7729
7730 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7731
7732 * xdisp.c (set_cursor_from_row): If the display string appears in
7733 the buffer at position that is closer to point than the position
7734 after the display string, display the cursor on the first glyph of
7735 the display string. Fixes cursor display when a 'display' text
7736 property immediately follows invisible text. (Bug#11094)
7737
7738 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7739
7740 composite.c: use 'double' consistently
7741 * composite.c (get_composition_id): Use 'double' consistently
7742 instead of converting 'float' to 'double' and vice versa; this is
7743 easier to understand and avoids a GCC warning.
7744
7745 2012-04-09 Glenn Morris <rgm@gnu.org>
7746
7747 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7748 preparation for dumping it with emacs. (Bug#4789)
7749 (leimdir): New variable.
7750 ($(leimdir)/leim-list.el): New rule.
7751 (emacs$(EXEEXT)): Depend on leim-list.el.
7752
7753 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7754 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7755 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7756
7757 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7758
7759 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7760 proper alignment.
7761
7762 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7763
7764 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7765 Remove unused local variable.
7766
7767 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7768
7769 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7770 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7771 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7772 objects, as mark_maybe_pointer will catch them otherwise.
7773 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7774 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7775
7776 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7777
7778 Fix typo that broke non-Windows builds.
7779 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7780
7781 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7782
7783 Support building on MS-Windows with libxml2.
7784
7785 * makefile.w32-in (OBJ2): Add xml.$(O).
7786 (GLOBAL_SOURCES): Add xml.c.
7787 ($(BLD)/xml.$(O)): New dependency list.
7788
7789 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7790 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7791 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7792 [!WINDOWSNT]: New macros.
7793 (init_libxml2_functions, libxml2_loaded_p): New functions.
7794 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7795 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7796 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7797 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7798 linked in).
7799 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7800 Call init_libxml2_functions before calling libxml2 functions.
7801 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7802
7803 * emacs.c: Don't include libxml/parser.h.
7804 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7805 xmlCleanupParser directly.
7806
7807 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7808
7809 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7810
7811 * indent.c (Fvertical_motion): If there is a display string at
7812 point, use it.vpos to compute how many lines to backtrack after
7813 move_it_to point. (Bug#11133)
7814
7815 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7816
7817 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7818 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7819 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7820 macros related to unification of CJK characters. For the details,
7821 see the discussion following the message here:
7822 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7823
7824 2012-04-04 Chong Yidong <cyd@gnu.org>
7825
7826 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7827
7828 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7829
7830 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7831 instead of alloca. (Bug#11138)
7832
7833 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7834
7835 * w32menu.c (is_simple_dialog): Properly check lisp types.
7836 (Bug#11141)
7837
7838 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7839
7840 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7841 position we get to after a call to move_it_to fails the
7842 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7843 only if we wind up in a string from display property. (Bug#11063)
7844
7845 * window.c (Fdelete_other_windows_internal): Invalidate the row
7846 and column information about mouse highlight, so that redisplay
7847 restores it after reallocating the glyph matrices. (Bug#7464)
7848
7849 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7850 string comes from a `display' text property, use the buffer
7851 position of that property as if we actually saw that position in
7852 the row's glyphs.
7853 (move_it_by_lines): Remove the assertion that
7854 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7855 violated when there's a before-string at the beginning of a line.
7856 (Bug#11063)
7857
7858 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7859
7860 * xdisp.c (append_space_for_newline): If the default face was
7861 remapped, use the remapped face for the appended newline.
7862 (extend_face_to_end_of_line): Use the remapped default face for
7863 extending the face to the end of the line.
7864 (display_line): Call extend_face_to_end_of_line when the default
7865 face was remapped. (Bug#11068)
7866
7867 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7868
7869 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7870
7871 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7872
7873 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7874
7875 2012-03-27 Glenn Morris <rgm@gnu.org>
7876
7877 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7878 Doc fixes.
7879
7880 2012-03-26 Kenichi Handa <handa@m17n.org>
7881
7882 * dispextern.h (struct glyph): Fix previous change. Change the
7883 bit length of glyphless.ch to 25 (Bug#11082).
7884
7885 2012-03-26 Chong Yidong <cyd@gnu.org>
7886
7887 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7888 (command_loop_1): Use it; inhibit selection update for
7889 handle-select-window too (Bug#8996).
7890
7891 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7892
7893 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7894
7895 2012-03-25 Kenichi Handa <handa@m17n.org>
7896
7897 * dispextern.h (struct glyph): Change the bit length of
7898 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7899
7900 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7901
7902 * s/ms-w32.h (tzname): Include time.h before redirecting to
7903 _tzname. Fixes the MSVC build. (Bug#9960)
7904
7905 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7906
7907 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7908 characters.
7909
7910 * xterm.c (XTread_socket): Only modify handling_signal if
7911 !SYNC_INPUT. (Bug#11080)
7912
7913 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7914
7915 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7916 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7917 when fetching a multibyte character consumes more bytes than
7918 CHAR_BYTES returns, due to unification of CJK characters in
7919 string_char. (Bug#11073)
7920
7921 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7922
7923 * process.c (wait_reading_process_output): Handle pty disconnect
7924 by refraining from sending oneself a SIGCHLD (bug#10933).
7925
7926 2012-03-22 Chong Yidong <cyd@gnu.org>
7927
7928 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7929
7930 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7931 Mark string as coming from a prefix property.
7932 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7933 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7934
7935 2012-03-21 Chong Yidong <cyd@gnu.org>
7936
7937 * xfaces.c (Vface_remapping_alist): Doc fix.
7938
7939 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7940
7941 * w32proc.c (Fw32_set_console_codepage)
7942 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7943 Doc fixes.
7944
7945 2012-03-20 Chong Yidong <cyd@gnu.org>
7946
7947 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
7948 to reflect default non-nil value of redisplay-dont-pause.
7949
7950 2012-03-19 Kenichi Handa <handa@m17n.org>
7951
7952 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
7953 it fit in a valid range (Bug#11003).
7954
7955 2012-03-18 Eli Zaretskii <eliz@gnu.org>
7956
7957 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
7958 that is not from display property, accept the row as a "cursor
7959 row" if one of the string's character has a non-nil `cursor'
7960 property. Fixes cursor positioning when there are newlines in
7961 overlay strings, e.g. in icomplete.el. (Bug#11035)
7962
7963 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
7964
7965 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
7966
7967 2012-03-12 Chong Yidong <cyd@gnu.org>
7968
7969 * eval.c (inhibit_lisp_code): Rename from
7970 inhibit_window_configuration_change_hook; move from window.c.
7971
7972 * xfns.c (unwind_create_frame_1, Fx_create_frame):
7973 * window.c (run_window_configuration_change_hook)
7974 (syms_of_window): Callers changed.
7975
7976 2012-03-11 Chong Yidong <cyd@gnu.org>
7977
7978 * keymap.c (Fkey_description): Doc fix (Bug#9700).
7979
7980 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
7981
7982 2012-03-10 Chong Yidong <cyd@gnu.org>
7983
7984 * frame.c (other_visible_frames): Don't assume the selected frame
7985 is visible (Bug#10955).
7986
7987 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
7988
7989 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
7990
7991 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
7992
7993 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
7994 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
7995 zero (Bug#10954).
7996
7997 2012-03-03 Glenn Morris <rgm@gnu.org>
7998
7999 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8000
8001 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8002
8003 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8004 position past the first glyph_row that ends at ZV. (Bug#10902)
8005 (redisplay_window, next_element_from_string): Fix typos in
8006 comments.
8007 (redisplay_window): Pass to move_it_vertically the margin in
8008 pixels, not in screen lines.
8009
8010 2012-03-02 Glenn Morris <rgm@gnu.org>
8011
8012 * buffer.c (buffer-list-update-hook): Doc fix.
8013
8014 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8015
8016 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8017 push_it before setting up the iterator for the first overlay
8018 string, even if we have an empty string loaded.
8019 (next_overlay_string): If there's an empty string on the iterator
8020 stack, pop the stack. (Bug#10903)
8021
8022 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8023
8024 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8025 Suggested by Stefan Monnier in
8026 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8027 * alloc.c (widen_to_Lisp_Object): New static function.
8028 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8029 and widening them to Lisp_Objects. This would work even if
8030 USE_LSB_TAG is defined and wide integers are used, which might
8031 happen in a future version of Emacs.
8032
8033 2012-02-25 Chong Yidong <cyd@gnu.org>
8034
8035 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8036 Doc fix.
8037
8038 * xselect.c (Fx_selection_exists_p): Doc fix.
8039 (x_clipboard_manager_save_all): Print an informative message
8040 before saving to clipboard manager.
8041
8042 2012-02-24 Chong Yidong <cyd@gnu.org>
8043
8044 * keyboard.c (process_special_events): Handle all X selection
8045 requests in kbd_buffer, not just the next one (Bug#8869).
8046
8047 2012-02-23 Chong Yidong <cyd@gnu.org>
8048
8049 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8050 call when setting menu-bar-lines and tool-bar-lines parameters.
8051 (unwind_create_frame_1): New helper function.
8052
8053 * window.c (inhibit_window_configuration_change_hook): New var.
8054 (run_window_configuration_change_hook): Obey it.
8055 (syms_of_window): Initialize it.
8056
8057 2012-02-22 Chong Yidong <cyd@gnu.org>
8058
8059 * xterm.c (x_draw_image_relief): Add missing type check for
8060 Vtool_bar_button_margin (Bug#10743).
8061
8062 2012-02-21 Chong Yidong <cyd@gnu.org>
8063
8064 * fileio.c (Vfile_name_handler_alist): Doc fix.
8065
8066 * buffer.c (Fget_file_buffer): Protect against invalid file
8067 handler return value.
8068
8069 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8072 when computing $valmask.
8073
8074 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8075 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8076 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8077 It's useless in that case, and it can cause problems on hosts
8078 that allocate halves of EMACS_INT values separately.
8079 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8080 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8081 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8082 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8083 it avoids undefined behavior on hosts where shifting right by more
8084 than the word width has undefined behavior.
8085
8086 2012-02-19 Chong Yidong <cyd@gnu.org>
8087
8088 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8089 (Funhandled_file_name_directory, Ffile_name_as_directory)
8090 (Fdirectory_file_name, Fexpand_file_name)
8091 (Fsubstitute_in_file_name): Protect against invalid file handler
8092 return values (Bug#10845).
8093
8094 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8095
8096 * .gdbinit (pitx): Fix incorrect references to fields of the
8097 iterator stack.
8098
8099 2012-02-17 Chong Yidong <cyd@gnu.org>
8100
8101 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8102
8103 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8104
8105 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8106 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8107
8108 2012-02-15 Chong Yidong <cyd@gnu.org>
8109
8110 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8111 marked as special. Also, starting docstrings with * is obsolete.
8112
8113 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8114
8115 * gnutls.c (emacs_gnutls_write): Fix last change.
8116
8117 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8118
8119 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8120 send_process.
8121
8122 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8123
8124 * keymap.c (Fsingle_key_description): Handle char ranges.
8125
8126 2012-02-12 Chong Yidong <cyd@gnu.org>
8127
8128 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8129 as that creates a dangerous corner case.
8130
8131 * window.c (Fdelete_window_internal): Invalidate the mouse
8132 highlight (Bug#9904).
8133
8134 2012-02-12 Glenn Morris <rgm@gnu.org>
8135
8136 * xselect.c (Fx_own_selection_internal)
8137 (Fx_get_selection_internal, Fx_disown_selection_internal)
8138 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8139 * nsselect.m (Fx_own_selection_internal)
8140 (Fx_disown_selection_internal, Fx_selection_exists_p)
8141 (Fx_selection_owner_p, Fx_get_selection_internal):
8142 Sync docs and argument specs with the xselect.c versions.
8143
8144 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8145
8146 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8147
8148 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8149
8150 * w32select.c (Fx_selection_exists_p): Sync doc string and
8151 argument list with xselect.c. (Bug#10783)
8152
8153 * w16select.c (Fx_selection_exists_p): Sync doc string and
8154 argument list with xselect.c. (Bug#10783)
8155
8156 2012-02-10 Glenn Morris <rgm@gnu.org>
8157
8158 * fns.c (Fsecure_hash): Doc fix.
8159
8160 2012-02-09 Kenichi Handa <handa@m17n.org>
8161
8162 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8163
8164 2012-02-07 Chong Yidong <cyd@gnu.org>
8165
8166 * buffer.c (Fbuffer_local_variables)
8167 (buffer_lisp_local_variables): Handle unbound vars correctly;
8168 don't let Qunbound leak into Lisp.
8169
8170 2012-02-07 Glenn Morris <rgm@gnu.org>
8171
8172 * image.c (Fimagemagick_types): Doc fix.
8173
8174 * image.c (imagemagick-render-type): Change it from a lisp object
8175 to an integer. Move the doc here from the lisp manual.
8176 Treat all values not equal to 0 the same.
8177
8178 2012-02-06 Chong Yidong <cyd@gnu.org>
8179
8180 * doc.c (store_function_docstring): Avoid applying docstring of
8181 alias to base function (Bug#2603).
8182
8183 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8184
8185 * .gdbinit (pp1, pv1): Remove redundant defines.
8186 (pr): Use pp.
8187
8188 2012-02-04 Chong Yidong <cyd@gnu.org>
8189
8190 * nsterm.m: Declare a global (Bug#10694).
8191
8192 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8193
8194 * w32.c (get_emacs_configuration_options):
8195 Include --enable-checking, if specified, in the return value.
8196
8197 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8198
8199 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8200 after rounding frame sizes. (Bug#9723)
8201
8202 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8203
8204 * keyboard.c (adjust_point_for_property): Don't position point
8205 before BEGV. (Bug#10696)
8206
8207 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8208
8209 Handle overflow when computing char display width (Bug#9496).
8210 * character.c (char_width): Return EMACS_INT, not int.
8211 (char_width, c_string_width): Check for overflow when
8212 computing the width; this is possible now that individual
8213 characters can have unbounded width. Problem introduced
8214 by merge from Emacs 23 on 2012-01-19.
8215
8216 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8217
8218 * dbusbind.c (Fdbus_register_method): Mention the return value
8219 :ignore in the docstring.
8220
8221 2012-02-02 Glenn Morris <rgm@gnu.org>
8222
8223 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8224
8225 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8226 Unconditionally set to t. (Bug#10673)
8227 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8228 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8229 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8230
8231 2012-02-02 Kenichi Handa <handa@m17n.org>
8232
8233 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8234 0, do not call append_composite_glyph.
8235
8236 2012-02-02 Kenichi Handa <handa@m17n.org>
8237
8238 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8239 NULL (Bug#6988).
8240 (x_produce_glyphs): If the component of a composition is a null
8241 string, set it->pixel_width to 1 to avoid zero-width glyph.
8242
8243 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8244
8245 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8246 first 2 arguments are identical. This makes inserting large
8247 output from a subprocess an order of magnitude faster on
8248 MS-Windows, where all sbrk'ed memory is always contiguous.
8249
8250 2012-01-31 Glenn Morris <rgm@gnu.org>
8251
8252 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8253 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8254 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8255
8256 2012-01-29 Glenn Morris <rgm@gnu.org>
8257
8258 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8259
8260 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8261
8262 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8263
8264 2012-01-28 Chong Yidong <cyd@gnu.org>
8265
8266 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8267
8268 2012-01-26 Chong Yidong <cyd@gnu.org>
8269
8270 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8271
8272 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8273 repeat counts (Bug#10507).
8274
8275 2012-01-26 Glenn Morris <rgm@gnu.org>
8276
8277 * lread.c (syms_of_lread): Doc fix.
8278
8279 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8280
8281 * coding.c (encode_designation_at_bol): Change return value to
8282 EMACS_INT.
8283
8284 2012-01-25 Chong Yidong <cyd@gnu.org>
8285
8286 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8287
8288 2012-01-21 Chong Yidong <cyd@gnu.org>
8289
8290 * floatfns.c (Fcopysign): Make the second argument non-optional,
8291 since nil is not allowed anyway.
8292
8293 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8294
8295 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8296 (send_process): Likewise.
8297
8298 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8299
8300 * window.c (save_window_save, Fcurrent_window_configuration)
8301 (Vwindow_persistent_parameters): Do not use Qstate.
8302 Rewrite doc-strings.
8303
8304 2012-01-19 Kenichi Handa <handa@m17n.org>
8305
8306 * character.c (char_width): New function.
8307 (Fchar_width, c_string_width, lisp_string_width):
8308 Use char_width (Bug#9496).
8309
8310 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8311
8312 * window.c (Vwindow_persistent_parameters): New variable.
8313 (Fset_window_configuration, save_window_save): Handle persistent
8314 window parameters.
8315
8316 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8317
8318 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8319 thrashing the stack of the thread. (Bug#9087)
8320
8321 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8322
8323 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8324
8325 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8326
8327 * xdisp.c (rows_from_pos_range): Handle the case where the
8328 highlight ends on a newline. (Bug#10464)
8329 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8330 he end column for display of highlight that ends on a newline
8331 before a R2L line.
8332
8333 2012-01-11 Glenn Morris <rgm@gnu.org>
8334
8335 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8336 from load-path also when installation-directory is nil. (Bug#10208)
8337
8338 2012-01-10 Glenn Morris <rgm@gnu.org>
8339
8340 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8341
8342 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8343 Update template values to be closer to their typical values these days.
8344
8345 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8346
8347 * xdisp.c (rows_from_pos_range): Accept additional argument
8348 DISP_STRING, and accept any glyph in a row whose object is that
8349 string as eligible for mouse highlight. Fixes mouse highlight of
8350 display strings from overlays. (Bug#10464)
8351
8352 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8353
8354 emacs: fix an auto-save permissions race condition (Bug#10400)
8355 * fileio.c (auto_saving_dir_umask): New static var.
8356 (Fmake_directory_internal): Use it.
8357 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8358 creating the directory. The old code temporarily assigns
8359 too-generous permissions to the directory.
8360 (do_auto_save_eh): Clear it.
8361 (Fdo_auto_save): Catch all errors, not just file errors, so
8362 that the var is always cleared.
8363
8364 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8365
8366 * search.c (scan_buffer): Pass character positions to
8367 know_region_cache, not byte positions. (Bug#6540)
8368
8369 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8370
8371 * w32.c (sys_rename): Report EXDEV when rename of a directory
8372 fails because the target is on another logical disk. (Bug#10284)
8373
8374 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8375
8376 * xterm.c (x_embed_request_focus): New function.
8377
8378 * xterm.h: Add prototype.
8379
8380 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8381
8382 2012-01-05 Glenn Morris <rgm@gnu.org>
8383
8384 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8385
8386 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8387
8388 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8389 Load gnutls_transport_set_lowat only if GnuTLS version is below
8390 2.11.1.
8391 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8392 GnuTLS versions below 2.11.1.
8393
8394 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8395
8396 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8397 to the doc string advising against its use for altering the way
8398 windows are scrolled.
8399
8400 2011-12-28 Kenichi Handa <handa@m17n.org>
8401
8402 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8403 coding-system ASCII compatible only when it does not produce BOM
8404 on encoding (Bug#10383).
8405
8406 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8407
8408 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8409 can scroll.
8410 (create_and_show_popup_menu): Always use menu_position_func for
8411 Gtk3 (Bug#10361).
8412
8413 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8414
8415 * callint.c (Fcall_interactively): Don't truncate prompt string.
8416
8417 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8418
8419 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8420 property that ends at ZV, so that the bidi iteration could be
8421 resumed from there (after widening). (Bug#10360)
8422
8423 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8424
8425 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8426
8427 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8428
8429 * nsterm.m (x_free_frame_resources):
8430 Release f->output_data.ns->miniimage.
8431 (ns_index_color): Fix indentation. Do not retain
8432 color_table->colors[i].
8433
8434 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8435 before returning.
8436
8437 * nsfns.m (x_set_background_color): Assign return value from
8438 ns_index_color to face-background instead of NSColor*.
8439 (ns_implicitly_set_icon_type): Fix indentation.
8440 Change assignment in for loop to comparison.
8441
8442 * emacs.c (ns_pool): New variable.
8443 (main): Assign ns_pool.
8444 (Fkill_emacs): Call ns_release_autorelease_pool.
8445
8446 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8447 autorelease fdesc, release fdAttrs and tdict.
8448 (ns_get_covering_families): Release charset.
8449 (ns_findfonts): Release NSFontDescriptor created with new.
8450 (ns_uni_to_glyphs): Fix indentation.
8451 (setString): Release attrStr before assigning new value.
8452
8453 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8454
8455 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8456 and NS_IMPL_COCOA.
8457 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8458 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8459
8460 2011-12-18 David Reitter <reitter@cmu.edu>
8461
8462 * nsterm.m (ns_term_init): Subscribe for notifications
8463 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8464 to method trackingNotification in EmacsMenu.
8465
8466 * nsmenu.m (trackingMenu): New variable.
8467 (trackingNotification): New method (from Aquamacs).
8468 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8469 from Aquamacs (Bug#7030).
8470
8471 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8472
8473 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8474 (symbol_to_nsstring): Fix indentation.
8475 (ns_symbol_to_pb): New function.
8476 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8477 (Fns_rotate_cut_buffers_internal): Remove.
8478 (Fns_store_selection_internal): Rename from
8479 Fns_store_cut_buffer_internal.
8480 (ns_get_foreign_selection, Fx_own_selection_internal)
8481 (Fx_disown_selection_internal, Fx_selection_exists_p)
8482 (Fns_get_selection_internal, Fns_store_selection_internal):
8483 Use ns_symbol_to_pb and check if return value is nil.
8484 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8485 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8486 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8487 renamed to Sns_store_selection_internal.
8488 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8489 and remove this function.
8490 (ns_handle_selection_clear): Remove, never used.
8491 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8492 here.
8493
8494 2011-12-17 Ken Brown <kbrown@cornell.edu>
8495
8496 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8497 GID is unknown (Bug#10257).
8498
8499 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8500
8501 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8502 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8503 which caused a build failure on GNU/Linux IA-64. This problem was
8504 introduced by my 2011-10-07 patch.
8505
8506 2011-12-15 Juri Linkov <juri@jurta.org>
8507
8508 * image.c (imagemagick_error): New function. (Bug#10112)
8509 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8510 Use `imagemagick_error' where ImageMagick functions return
8511 `MagickFalse'.
8512 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8513 proper order.
8514
8515 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8516
8517 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8518 fill background (Bug#8992).
8519
8520 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8521
8522 * window.c (Vwindow_combination_resize)
8523 (Vwindow_combination_limit): Use t instead of non-nil in
8524 doc-strings.
8525 (Vrecenter_redisplay): Add first sentence of doc-string on
8526 separate line.
8527 (Frecenter): Fix doc-string typo.
8528
8529 2011-12-11 Kenichi Handa <handa@m17n.org>
8530
8531 * coding.c (Funencodable_char_position): Pay attention to the
8532 buffer text relocation (Bug#9389).
8533
8534 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8535
8536 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8537 gtk_init (Bug#10100).
8538
8539 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8540
8541 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8542 IT->string is nil. (Bug#10263)
8543
8544 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8545
8546 * nsterm.h (x_free_frame_resources): Declare.
8547
8548 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8549 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8550
8551 * nsterm.h (ns_get_defaults_value): Declare.
8552
8553 * nsterm.m (ns_default): Call ns_get_defaults_value.
8554
8555 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8556
8557 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8558 (Bug#10170)
8559
8560 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8561
8562 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8563 that where the value of an _OBJC_* symbol points to is in the .bss
8564 section (Bug#10240).
8565
8566 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8567
8568 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8569 after the loop to call ccl_driver at least once (Bug#8619).
8570
8571 2011-12-08 Kenichi Handa <handa@m17n.org>
8572
8573 * ftfont.c (get_adstyle_property): Fix previous change
8574 (Bug#10233).
8575
8576 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8577
8578 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8579 dirs from the default value of EMACSLOADPATH (bug#10208).
8580
8581 2011-12-07 Glenn Morris <rgm@gnu.org>
8582
8583 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8584 installation and source directories as well. (Bug#10208)
8585
8586 2011-12-06 Chong Yidong <cyd@gnu.org>
8587
8588 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8589
8590 2011-12-06 Glenn Morris <rgm@gnu.org>
8591
8592 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8593 as an error, not just -1. (Bug#10217)
8594
8595 2011-12-05 Chong Yidong <cyd@gnu.org>
8596
8597 * keyboard.c (process_special_events): New function.
8598 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8599
8600 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8601
8602 * coding.c (encode_designation_at_bol): Don't use uninitialized
8603 local variable (Bug#9318).
8604
8605 2011-12-05 Kenichi Handa <handa@m17n.org>
8606
8607 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8608 return Qnil (Bug#8046, Bug#10193).
8609
8610 2011-12-05 Kenichi Handa <handa@m17n.org>
8611
8612 * coding.c (encode_designation_at_bol): New args charbuf_end and
8613 dst. Return the number of produced bytes. Callers changed.
8614 (coding_set_source): Return how many bytes coding->source was
8615 relocated.
8616 (coding_set_destination): Return how many bytes
8617 coding->destination was relocated.
8618 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8619 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8620
8621 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8622
8623 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8624 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8625 macro (Bug#9318).
8626
8627 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8628
8629 The following changes are to fix Bug#9318.
8630
8631 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8632 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8633 (encode_coding_iso_2022, encode_coding_sjis)
8634 (encode_coding_big5, encode_coding_charset): Use the above macros.
8635
8636 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8637
8638 * lisp.h (process_quit_flag): Fix external declaration.
8639
8640 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8641
8642 Don't macro-inline non-performance-critical code.
8643 * eval.c (process_quit_flag): New function.
8644 * lisp.h (QUIT): Use it.
8645
8646 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8647
8648 * nsfns.m (get_geometry_from_preferences): New function.
8649 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8650
8651 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8652
8653 * emacs.c (Qkill_emacs): Define.
8654 (syms_of_emacs): Initialize it.
8655 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8656 Qquit_flag to `kill-emacs' instead.
8657 (quit_throw_to_read_char): Add parameter `from_signal'.
8658 All callers changed. Call Fkill_emacs if requested and safe.
8659 * lisp.h (QUIT): Call Fkill_emacs if requested.
8660
8661 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8662
8663 * widget.c (update_wm_hints): Return if wmshell is null.
8664 (widget_update_wm_size_hints): New function.
8665
8666 * widget.h (widget_update_wm_size_hints): Declare.
8667
8668 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8669 widget_update_wm_size_hints (Bug#10104).
8670
8671 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8672
8673 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8674 before a newline, prepare the bidi iterator for consuming the
8675 newline, and keep the current paragraph direction. (Bug#10183)
8676 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8677
8678 2011-12-02 Juri Linkov <juri@jurta.org>
8679
8680 * search.c (Fword_search_regexp): New Lisp function created from
8681 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8682 (Fword_search_backward, Fword_search_forward)
8683 (Fword_search_backward_lax, Fword_search_forward_lax):
8684 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8685 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8686
8687 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8688
8689 * fileio.c (Finsert_file_contents): Move after-change-function call
8690 to before the "handled:" label, since all "goto handled" appear in
8691 cases where the *-change-functions have already been properly called
8692 (bug#10117).
8693
8694 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8695
8696 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8697 waiting for input. (Bug#10169)
8698
8699 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8700
8701 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8702 verifies glyph row's hash code--we have just reallocated the
8703 glyphs, so their contents can be complete garbage. (Bug#10164)
8704
8705 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8706
8707 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8708
8709 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8710
8711 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8712 attributes are tested _before_ calling verify_row_hash, to protect
8713 against GCC re-ordering of the tests. (Bug#10164)
8714
8715 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8716
8717 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8718
8719 * xterm.c (handle_one_xevent): Only set async_visible and friends
8720 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8721 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8722 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8723
8724 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8725
8726 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8727 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8728 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8729 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8730 All uses changed to use GCPRO1 etc.
8731 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8732 Revert to old implementation (i.e., before 2011-03-11).
8733
8734 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8735
8736 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8737 of scroll runs so as to avoid assigning disabled bogus rows and
8738 unnecessary graphics copy operations.
8739
8740 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8741
8742 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8743 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8744 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8745 (malloc, free, realloc, calloc): Redirect to e_* only when
8746 compiling Emacs.
8747
8748 * lisp.h (GCTYPEBITS): Move before first use.
8749 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8750 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8751 this macro definition.
8752
8753 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8754 _MSC_VER.
8755
8756 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8757
8758 * gtkutil.c (xg_create_frame_widgets):
8759 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8760 present with Gtk+ 2.0.
8761
8762 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8763
8764 * fileio.c (Finsert_file_contents): Undo previous change; see
8765 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8766
8767 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8768
8769 Rename locals to avoid shadowing.
8770 * fileio.c (Finsert_file_contents):
8771 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8772 * process.c (wait_reading_process_output):
8773 Rename inner 'proc' to 'p' to avoid shadowing.
8774 Indent for consistency with usual Emacs style.
8775
8776 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8777
8778 * xdisp.c (redisplay_window): If cursor row is not fully visible
8779 after recentering, and scroll-conservatively is set to a large
8780 number, scroll window by a few more lines to make the cursor fully
8781 visible and out of scroll-margin. (Bug#10105)
8782 (start_display): Don't move to the next line if the display should
8783 start at a newline that is part of a display vector or an overlay
8784 string. (Bug#10119)
8785
8786 2011-11-24 Juri Linkov <juri@jurta.org>
8787
8788 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8789 after the `MagickPingImage' call. (Bug#10112)
8790
8791 2011-11-23 Chong Yidong <cyd@gnu.org>
8792
8793 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8794
8795 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8796
8797 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8798 making another buffer current. (Bug#10114)
8799
8800 2011-11-23 Glenn Morris <rgm@gnu.org>
8801
8802 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8803
8804 2011-11-23 Chong Yidong <cyd@gnu.org>
8805
8806 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8807 using it (Bug#5984).
8808
8809 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8810
8811 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8812 and header-lines, as they don't have one computed for them.
8813 (Bug#10098)
8814
8815 * .gdbinit (prow): Make displayed values more self-explaining.
8816 Add row's hash code.
8817
8818 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8819
8820 * process.c (wait_reading_process_output): Fix asynchrounous
8821 GnuTLS socket handling on some versions of the GnuTLS library.
8822 (wait_reading_process_output): Add comment and URL.
8823
8824 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8825
8826 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8827
8828 2011-11-21 Chong Yidong <cyd@gnu.org>
8829
8830 * window.c (Fnext_window, Fprevious_window): Doc fix.
8831
8832 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8833
8834 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8835
8836 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8837
8838 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8839
8840 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8841
8842 * window.c (Fset_window_combination_limit): Rename argument
8843 STATUS to LIMIT.
8844 (Vwindow_combination_limit): Remove "status" from doc-string.
8845
8846 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8847
8848 * m/ibms390.h: Remove.
8849 * m/ibms390x.h: Don't include "ibms390.h".
8850
8851 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8852
8853 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8854 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8855
8856 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8857
8858 * casetab.c (Fset_case_table):
8859 * charset.c (Fcharset_after): Fix typos.
8860
8861 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8862
8863 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8864 Otherwise, valgrind does not work on some platforms.
8865 Problem reported by Andreas Schwab in
8866 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8867 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8868 is set, removing the need for VIRT_ADDRESS_VARIES.
8869 (PURE_P): Use a more-efficient implementation that needs just one
8870 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8871 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8872 to 4 (xorl, subq, cmpq, setbe).
8873 * alloc.c (pure): Always extern now, since that's the
8874 VIRT_ADDR_VARIES behavior.
8875 (PURE_POINTER_P): Use a single comparison, not two, for
8876 consistency with the new puresize.h.
8877 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8878 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8879 Remove VIRT_ADDR_VARIES no longer needed.
8880
8881 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8882
8883 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8884 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8885 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8886 behave as if the cursor position were at the window margin.
8887
8888 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8889 and the cursor position is out of bounds, behave as if the cursor
8890 position were at the window margin. (Bug#10075)
8891
8892 2011-11-18 Chong Yidong <cyd@gnu.org>
8893
8894 * window.c (Fwindow_combination_limit): Make first argument
8895 non-optional, since it is meaningless for live windows like the
8896 selected window.
8897
8898 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8899
8900 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8901
8902 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8903
8904 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8905 (graft_intervals_into_buffer): Simplify.
8906
8907 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8908
8909 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8910 hash values of the two rows.
8911 (copy_row_except_pointers): Preserve the used[] arrays and the
8912 hash values of the two rows. (Bug#10035)
8913 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8914
8915 * xdisp.c (row_hash): New function, body extracted from
8916 compute_line_metrics.
8917 (compute_line_metrics): Call row_hash, instead of computing the
8918 hash code inline.
8919
8920 * dispnew.c (verify_row_hash): Call row_hash for computing the
8921 hash code of a row, instead of duplicating code from xdisp.c.
8922
8923 * dispextern.h (row_hash): Add prototype.
8924
8925 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8926
8927 * frame.c (delete_frame): Don't delete the terminal when the last
8928 X frame is closed if emacs is built with GTK toolkit.
8929
8930 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8931
8932 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8933
8934 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8935
8936 * window.c (Vwindow_splits): Rename to
8937 Vwindow_combination_resize. Suggested by Juri Linkov.
8938 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8939 of Vwindow_splits.
8940
8941 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8942
8943 * nsfns.m (Fns_font_name):
8944 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8945
8946 2011-11-16 Martin Rudalics <rudalics@gmx.at>
8947
8948 * window.h (window): Rename slot "nest" to "combination_limit".
8949 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
8950 (Fset_window_nest): Rename to Fset_window_combination_limit.
8951 (Vwindow_nest): Rename to Vwindow_combination_limit.
8952 (recombine_windows, make_parent_window, make_window)
8953 (Fsplit_window_internal, saved_window)
8954 (Fset_window_configuration, save_window_save): Rename all
8955 occurrences of window_nest to window_combination_limit.
8956
8957 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
8958
8959 * image.c (imagemagick_load_image): Fix typo.
8960
8961 2011-11-14 Eli Zaretskii <eliz@gnu.org>
8962
8963 * xdisp.c (display_line): Move the call to
8964 highlight_trailing_whitespace before the call to
8965 compute_line_metrics, since the latter needs to see the final
8966 faces of all the glyphs to compute ROW's hash value.
8967 Fixes assertion violations in row_equal_p. (Bug#10035)
8968
8969 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
8970
8971 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
8972 just return (bug#10044).
8973
8974 2011-11-12 Eli Zaretskii <eliz@gnu.org>
8975
8976 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
8977 with user-defined heap size. Bump the default size of the temacs
8978 heap to 27MB, to avoid memory warning when running temacs.
8979 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
8980
8981 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
8982 current_matrix and desired_matrix. (Bug#9990)
8983 (verify_row_hash) [XASSERTS]: New function.
8984 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
8985 that the hash value of glyph rows is correct.
8986
8987 2011-11-12 Martin Rudalics <rudalics@gmx.at>
8988
8989 * window.h (window): Remove splits slot.
8990 * window.c (Fwindow_splits, Fset_window_splits): Remove.
8991 (Fdelete_other_windows_internal, make_parent_window)
8992 (make_window, Fsplit_window_internal, Fdelete_window_internal)
8993 (Fset_window_configuration, save_window_save): Don't deal with
8994 split status of windows.
8995 (saved_window): Remove splits slot.
8996 (Vwindow_splits): Rewrite doc-string.
8997
8998 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
8999
9000 * xfns.c (unwind_create_frame):
9001 * nsfns.m (unwind_create_frame):
9002 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9003 Vframe_list (Bug#9999).
9004
9005 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9006
9007 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9008
9009 2011-11-11 Kenichi Handa <handa@m17n.org>
9010
9011 * callproc.c (Fcall_process): Set the member dst_multibyte of
9012 process_coding.
9013
9014 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9015
9016 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9017 avoid a crash (bug#9496).
9018
9019 2011-11-09 Chong Yidong <cyd@gnu.org>
9020
9021 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9022 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9023
9024 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9025
9026 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9027
9028 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9029
9030 Avoid some portability problems by eschewing 'extern inline' functions.
9031 The trivial performance wins aren't worth the portability hassles; see
9032 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9033 et seq.
9034 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9035 (window_box_width, window_box_left, window_box_left_offset)
9036 (window_box_right, window_box_right_offset): Undo previous change,
9037 by removing the "extern"s.
9038 * intervals.c (adjust_intervals_for_insertion)
9039 (adjust_intervals_for_deletion): Undo previous change,
9040 making these static again.
9041 (offset_intervals, temp_set_point_both, temp_set_point)
9042 (copy_intervals_to_string): No longer inline.
9043 * xdisp.c (window_text_bottom_y, window_box_width)
9044 (window_box_height, window_box_left_offset)
9045 (window_box_right_offset, window_box_left, window_box_right)
9046 (window_box): No longer inline.
9047
9048 2011-11-08 Chong Yidong <cyd@gnu.org>
9049
9050 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9051 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9052 Signal an error if not a live window.
9053 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9054 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9055
9056 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9057
9058 * lisp.h (syms_of_abbrev): Remove declaration.
9059 Reported by CHENG Gao <chenggao@royau.me>.
9060
9061 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9062
9063 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9064 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9065 of temacs in GUI mode.
9066
9067 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9068
9069 * window.h: Declare delete_all_child_windows instead of
9070 delete_all_subwindows.
9071 * window.c (Fwindow_nest, Fset_window_nest)
9072 (Fset_window_new_total, Fset_window_new_normal)
9073 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9074 (delete_all_subwindows): Rename to delete_all_child_windows.
9075 (Fdelete_other_windows_internal, Fset_window_configuration):
9076 Call delete_all_child_windows instead of delete_all_subwindows.
9077 * frame.c (delete_frame): Call delete_all_child_windows instead
9078 of delete_all_subwindows.
9079
9080 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9081
9082 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9083 This is also needed for porting to any host where GC_MARK_STACK is
9084 not GC_MAKE_GCPROS_NOOPS.
9085 (which_symbols): Use it.
9086
9087 2011-11-07 Kenichi Handa <handa@m17n.org>
9088
9089 * coding.c (coding_set_destination): Check coding->src_pos only
9090 when coding->src_object is a buffer (bug#9910).
9091
9092 * process.c (send_process): Set the member src_multibyte of coding
9093 to 0 (bug#9911) when sending a unibyte text.
9094
9095 * callproc.c (Fcall_process): Set the member src_multibyte of
9096 process_coding to 0 (bug#9912).
9097
9098 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9099
9100 * xmenu.c (cleanup_widget_value_tree): New function.
9101 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9102 calling free_menubar_widget_value_tree directly (Bug#9830).
9103
9104 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9105
9106 Fix some portability problems with 'inline'.
9107 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9108 (window_box_width, window_box_left, window_box_left_offset)
9109 (window_box_right, window_box_right_offset): Declare extern.
9110 Otherwise, these inline functions do not conform to C99 and
9111 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9112 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9113 * intervals.c (adjust_intervals_for_insertion)
9114 (adjust_intervals_for_deletion): Now extern, because otherwise the
9115 extern inline functions 'offset_intervals' couldn't refer to it.
9116 (static_offset_intervals): Remove.
9117 (offset_intervals): Rewrite using the old contents of
9118 static_offset_intervals. The old version didn't conform to C99
9119 because an extern inline function contained a reference to an
9120 identifier with static linkage.
9121
9122 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9123
9124 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9125 GC.
9126
9127 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9128
9129 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9130 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9131 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9132 return Qleft_to_right.
9133
9134 2011-11-06 Chong Yidong <cyd@gnu.org>
9135
9136 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9137 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9138 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9139 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9140 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9141 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9142 (Fwindow_vscroll): Doc fix.
9143 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9144 argument, since it makes no sense to pass a live window and for
9145 consistency with window-child.
9146
9147 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9148
9149 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9150 support MSVC.
9151
9152 2011-11-05 Jason Rumney <jasonr@gnu.org>
9153
9154 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9155 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9156 fonts (Bug#6029).
9157 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9158 bitwise arithmetic preventing use of unicode-sip and non-truetype
9159 opentype fonts.
9160
9161 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9162
9163 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9164 "emacs"-only part.
9165
9166 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9167 initialization code to keep similarity to xfns.c after changes
9168 from 2011-11-05.
9169
9170 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9171
9172 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9173 (unwind_create_frame): New function (Bug#9943).
9174 (Fx_create_frame): Restructure code to be more similar to the one in
9175 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9176 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9177 Move terminal->reference_count++ just before making the frame official
9178 (Bug#9943).
9179
9180 * nsterm.m (x_free_frame_resources): New function.
9181 (x_destroy_window): Move code to x_free_frame_resources.
9182
9183 * xfns.c (unwind_create_frame): Fix comment.
9184 (Fx_create_frame, x_create_tip_frame):
9185 Move terminal->reference_count++ just before making the frame
9186 official. Move initialization of image_cache_refcount and
9187 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9188
9189 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9190
9191 Support MSVC build with newer versions of Visual Studio.
9192 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9193 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9194 nt/gmake.defs.
9195
9196 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9197 which are not supported by MSVC.
9198 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9199 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9200 bitfields.
9201 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9202 types in bitfields.
9203 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9204
9205 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9206
9207 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9208
9209 Support MSVC build with newer versions of Visual Studio.
9210 * w32.c: Don't include w32api.h for MSVC.
9211 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9212
9213 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9214 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9215 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9216 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9217 e_* cousins.
9218 (alloca) [_MSC_VER]: Define to _alloca.
9219
9220 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9221
9222 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9223
9224 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9225
9226 * xdisp.c (note_mouse_highlight): If either of
9227 previous/next-single-property-change returns nil, treat that as
9228 the beginning or the end of the buffer. (Bug#9955)
9229
9230 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9231
9232 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9233 label is not null (Bug#9951).
9234 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9235 may be NULL.
9236
9237 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9238
9239 * window.c (Fwindow_body_size): Mention in the doc string that the
9240 return value is in frame's canonical units. (Bug#9949)
9241
9242 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9243
9244 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9245
9246 * w32fns.c (unwind_create_frame): If needed, free the glyph
9247 matrices of the partially constructed frame. (Bug#9943)
9248 * xfns.c (unwind_create_frame): Likewise.
9249
9250 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9251
9252 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9253 Don't stop backward scan on the continuation glyph, even though
9254 its CHARPOS is positive.
9255 (mouse_face_from_buffer_pos, note_mouse_highlight):
9256 Rename cover_string to disp_string.
9257
9258 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9259
9260 * window.c (temp_output_buffer_show): Don't use
9261 Vtemp_buffer_show_specifiers.
9262 (Vtemp_buffer_show_specifiers): Remove unused variable.
9263
9264 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9265
9266 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9267 past the beginning of the current glyph matrix.
9268
9269 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9270
9271 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9272 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9273 HAVE_GTK3 (Bug#9869).
9274
9275 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9276 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9277
9278 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9279
9280 * xterm.c: Declare x_handle_net_wm_state to return int.
9281 (handle_one_xevent): Check if we are iconified but don't have
9282 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9283 (get_current_wm_state): Return non-zero if not hidden,
9284 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9285 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9286 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9287 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9288
9289 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9290
9291 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9292 so that this new function doesn't get optimized away by a
9293 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9294
9295 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9296
9297 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9298
9299 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9300
9301 Fix the `xbytecode' command.
9302 * .gdbinit (xprintbytestr): New command.
9303 (xwhichsymbols): Rename from `which'; all callers changed.
9304 (xbytecode): Print the byte-code string as well.
9305
9306 2011-10-29 Kim Storm <storm@cua.dk>
9307
9308 * alloc.c (which_symbols): New function.
9309
9310 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9311
9312 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9313 line. (Bug#9903)
9314
9315 2011-10-29 Glenn Morris <rgm@gnu.org>
9316
9317 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9318 Not clear what it was for, and it causes various bugs. (Bug#9839)
9319
9320 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9321
9322 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9323 possible random value that matches one of those tested as
9324 condition to clear the mouse face.
9325
9326 2011-10-28 Chong Yidong <cyd@gnu.org>
9327
9328 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9329
9330 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9331
9332 * window.c (make_window): Initialize phys_cursor_on_p.
9333
9334 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9335
9336 * lisp.h (struct Lisp_Symbol): Update comments.
9337
9338 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9339
9340 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9341
9342 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9343
9344 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9345 <oslsachem@gmail.com> for helping to debug this.
9346
9347 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9348 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9349 (g_b_init_get_glyph_outline_w): New static variables.
9350 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9351 (GetGlyphOutlineW_Proc): New typedefs.
9352 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9353 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9354 New functions.
9355 (w32font_open_internal, compute_metrics):
9356 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9357 instead of calling the "wide" APIs directly.
9358
9359 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9360
9361 * w32.h (syms_of_w32font): Add prototype.
9362
9363 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9364
9365 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9366 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9367 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9368 (Fmove_to_window_line): Doc fix.
9369
9370 2011-10-27 Chong Yidong <cyd@gnu.org>
9371
9372 * process.c (make_process): Set gnutls_state to NULL.
9373
9374 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9375 non-NULL, regardless of GNUTLS_INITSTAGE.
9376 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9377 an error. Set process slots as soon as we allocate them.
9378
9379 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9380
9381 2011-10-27 Chong Yidong <cyd@gnu.org>
9382
9383 * gnutls.c (emacs_gnutls_deinit): New function.
9384 Deallocate credentials structures as well as calling gnutls_deinit.
9385 (Fgnutls_deinit, Fgnutls_boot): Use it.
9386
9387 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9388 (deactivate_process): Call emacs_gnutls_deinit.
9389
9390 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9391
9392 * image.c (x_create_x_image_and_pixmap):
9393 * w32.c (sys_rename, w32_delayed_load):
9394 * w32font.c (fill_in_logfont):
9395 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9396
9397 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9398
9399 * w32fns.c (w32_default_color_map): New function,
9400 extracted from Fw32_default_color_map.
9401 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9402
9403 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9404
9405 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9406
9407 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9408
9409 * keyboard.c (test_undefined): New function (bug#9751).
9410 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9411
9412 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9413
9414 * sysdep.c (init_sys_modes): Fix the check for the controlling
9415 terminal (Bug#6649).
9416
9417 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9418
9419 * dispextern.h (struct bidi_it): New member next_en_type.
9420
9421 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9422 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9423 current character, check also for next_en_type being WEAK_EN.
9424 (bidi_resolve_weak): Don't enter the expensive loop if the current
9425 position is before next_en_pos. Record the bidi type of the first
9426 non-ET, non-BN character we find, in addition to its position.
9427 (bidi_level_of_next_char): Invalidate next_en_type when
9428 next_en_pos is over-stepped.
9429
9430 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9431
9432 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9433 * editfns.c: Rewrite current-time-zone so that it invokes
9434 the equivalent of (format-time-string "%Z") to get the time zone name.
9435 This fixes a bug when the time zone name contains characters that
9436 need converting from the system time locale to Emacs internal format.
9437 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9438 that patch fixed format-time-string to do the conversion, but
9439 I forgot to fix current-time-zone.
9440 (format_time_string): New function, containing most of
9441 what Fformat_time_string used to contain.
9442 (Fformat_time_string): Rewrite in terms of format_time_string.
9443 This doesn't change this function's behavior.
9444 (current-time-zone): Rewrite to use format_time_string.
9445 This fixes the bug reported by Michael Schierl in
9446 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9447 Jason Rumney's 2007-06-07 change worked around this bug, but
9448 didn't fix it.
9449 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9450
9451 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9452
9453 * xdisp.c (start_display): If the character at POS is displayed
9454 via a display vector, reset IT->current.dpvec_index to zero.
9455 (try_window_reusing_current_matrix): If a line ends in a display
9456 vector or the next line starts in a display vector, continue
9457 redrawing the window even though the character position of
9458 start_row was reached.
9459 (Bug#9771, part 2)
9460
9461 2011-10-18 Chong Yidong <cyd@gnu.org>
9462
9463 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9464 with nobreak-char-display too.
9465
9466 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9467
9468 Fix part 3 of bug#9771.
9469 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9470 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9471 non-neutral characters if the current character is a paragraph
9472 separator (a.k.a. Newline). This avoids running the same
9473 expensive loop twice, once when we consume the preceding newline
9474 and the other time when the line actually needs to be displayed.
9475 Avoid the loop when we see neutrals on the base embedding level
9476 following a character whose directionality is the same as the
9477 paragraph's. This avoids running the expensive loop when a line
9478 ends in a long sequence of neutrals, like control characters.
9479 Add assertion against STRONG_AL type. Slightly rearrange code
9480 that determines the type of a neutral given the first non-neutral
9481 that follows it.
9482 (bidi_level_of_next_char): Set next_en_pos to zero when
9483 invalidating its info.
9484
9485 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9486
9487 * xdisp.c (push_display_prop): Determine whether to record string
9488 or buffer position by IT->string, not by IT->method. Allow
9489 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9490 (move_it_vertically_backward): Don't look for character position
9491 immediately after the newline when in a continuation line.
9492 (Bug#9771, part 1)
9493
9494 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9495
9496 * window.c (coordinates_in_window): Rewrite and delabelize
9497 vertical border check. (Bug#5357) (Bug#9618)
9498
9499 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9500
9501 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9502 errors in XSetWindowBorder (bug#9310).
9503
9504 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9505
9506 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9507 avoid crash when xmalloc overrun checking is enabled.
9508
9509 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9510
9511 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9512 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9513 cursor motion with <left> and <right> arrow keys.
9514
9515 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9516 some callers set that themselves.
9517
9518 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9519
9520 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9521 display string and the previous row comes from the same string and
9522 is empty. (Bug#9739) (Bug#9738)
9523
9524 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9525
9526 * doc.c (get_doc_string): Encode file name (bug#9735).
9527
9528 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9529
9530 * bidi.c (bidi_level_of_next_char):
9531 * xdisp.c (get_visually_first_element): Remove old incorrect
9532 comments regarding the Unicode Line Separator character.
9533
9534 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9535
9536 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9537
9538 * alloc.c (Fgc_status): Do not access beyond zombies array
9539 boundary if nzombies > MAX_ZOMBIES.
9540 * alloc.c (dump_zombies): Add missing format specifier.
9541
9542 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9543
9544 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9545 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9546
9547 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9548 Some packages use them to denote characters with modifiers.
9549
9550 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9551
9552 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9553 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9554 matching a pp-number. Rename parameter var to var1.
9555
9556 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9557
9558 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9559
9560 2011-10-08 Glenn Morris <rgm@gnu.org>
9561
9562 * callint.c (Fcall_interactively): Give a more explicit error for the
9563 'c' case with a non-character input. (Bug#8479)
9564
9565 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9566
9567 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9568 lines.
9569 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9570 lines that are hscrolled on the left.
9571
9572 * dispnew.c (buffer_posn_from_coords): Account for a possible
9573 presence of header-line. (Bug#4426)
9574
9575 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9576
9577 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9578 Don't advertise functionality which we discourage or doesn't work.
9579
9580 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9581
9582 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9583 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9584 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9585 this makes Emacs dump core during garbage collection on rare
9586 occasions. sizeof is obviously inferior to offsetof here, so
9587 stick with offsetof.
9588 (GC_POINTER_ALIGNMENT): New macro.
9589 (mark_memory): Omit 3rd (offset) arg; caller changed.
9590 Don't assume EMACS_INT alignment is the same as pointer alignment.
9591
9592 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9593
9594 * keyboard.c (read_key_sequence_remapped): New var.
9595 (read_key_sequence): Compute remapping in the right buffer.
9596 (command_loop_1): Use read_key_sequence's remapping directly.
9597
9598 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9599
9600 * dired.c (file_name_completion): Don't expand file name.
9601 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9602 before checking file name handler.
9603
9604 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9605 they've been requested explicitly (bug#9591).
9606
9607 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9608
9609 * keymap.c (Fsingle_key_description): Use make_specified_string
9610 instead of build_string to build string from push_key_description.
9611 (Bug#5193)
9612
9613 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9614
9615 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9616 This fixes a Y2038 bug on 64-bit hosts.
9617 * buffer.c (reset_buffer):
9618 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9619 (Fclear_buffer_auto_save_failure):
9620 Use 0, not -1, to represent an unset failure time, since time_t
9621 might not be signed.
9622
9623 Remove dependency on glibc malloc internals.
9624 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9625 Move back here from lisp.h, but with their new implementations.
9626 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9627 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9628 * charset.c (charset_table_init): New static var.
9629 (syms_of_charset): Use it instead of xmalloc. This removes a
9630 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9631 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9632 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9633 Move back to alloc.c.
9634 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9635 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9636
9637 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9638
9639 * nsterm.m (windowDidResize): Call x_set_window_size only when
9640 ns_in_resize is true. Otherwise set pixelwidth/height and
9641 call change_frame_size (Bug#9628).
9642
9643 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9644
9645 Port --enable-checking=all to Fedora 14 x86-64.
9646 * charset.c (syms_of_charset): Also account for glibc malloc's
9647 internal overhead when calculating the initial malloc maximum.
9648
9649 Port --enable-checking=all to Fedora 14 x86.
9650 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9651 Move to lisp.h.
9652 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9653 (overrun_check_realloc, overrun_check_free):
9654 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9655 That way, xmalloc returns a properly-aligned pointer even if
9656 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9657 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9658 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9659 into account when calculating the initial malloc maximum.
9660 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9661 Move here from alloc.c, so that charset.c can use it too.
9662 Properly align; the old code wasn't right for common 32-bit hosts
9663 when configured with --enable-checking=all.
9664 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9665 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9666
9667 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9668
9669 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9670 use EDOM.
9671
9672 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9673
9674 * xdisp.c (compute_display_string_end): If there's no display
9675 string at CHARPOS, return -1.
9676
9677 * bidi.c (bidi_fetch_char): When compute_display_string_end
9678 returns a negative value, treat the character as a normal
9679 character not covered by a display string. (Bug#9624)
9680
9681 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9682
9683 * lread.c (Fread_from_string): Fix typo in docstring.
9684
9685 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9686
9687 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9688 newline, reseat the iterator instead of bidi-iterating there one
9689 character at a time. (Bug#9610)
9690 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9691 TO_CHARPOS if the bidi iterator is at base embedding level.
9692
9693 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9694
9695 * lread.c (readevalloop): Use correct code for NBSP.
9696 (read1): Likewise. (Bug#9608)
9697
9698 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9699
9700 * dbusbind.c (Fdbus_register_signal): When service is not
9701 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9702
9703 2011-09-25 Glenn Morris <rgm@gnu.org>
9704
9705 * buffer.c (truncate-lines): Doc fix.
9706
9707 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9708
9709 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9710 (Fset_window_next_buffers): Doc fix.
9711
9712 2011-09-24 Glenn Morris <rgm@gnu.org>
9713
9714 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9715
9716 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9717
9718 Fix minor problems found by static checking.
9719 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9720 * indent.c (Fvertical_motion): Fix == vs = typo.
9721
9722 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9723
9724 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9725 Default value is now t. Doc fix.
9726
9727 * indent.c (Fvertical_motion): Compute and apply the overshoot
9728 logic when moving up, not only when moving down. Fix the
9729 confusing name and values of the it_overshoot_expected variable;
9730 logic changes accordingly. (Bug#9254) (Bug#9549)
9731
9732 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9733 CHARPOS is covered by a display string which includes newlines.
9734 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9735 is covered by a display string with embedded newlines.
9736
9737 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9738
9739 * dbusbind.c (Fdbus_register_signal): Add match rule to
9740 Vdbus_registered_objects_table. (Bug#9581)
9741 (Fdbus_register_method, Vdbus_registered_objects_table):
9742 Fix docstring.
9743
9744 2011-09-24 Jim Meyering <meyering@redhat.com>
9745
9746 do not ignore write error for any output size
9747 The previous change was incomplete.
9748 While it makes emacs --batch detect the vast majority of stdout
9749 write failures, errors were still ignored whenever the output size is
9750 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9751 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9752 && echo FAIL: ignored write error
9753 FAIL: ignored write error
9754 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9755 && echo FAIL: ignored write error
9756 FAIL: ignored write error
9757 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9758
9759 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9760
9761 * emacs.c (Fkill_emacs): In noninteractive mode exit
9762 non-successfully if a write error occurred on stdout. (Bug#9574)
9763
9764 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9765
9766 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9767 the xassert test.
9768
9769 * dispextern.h (struct it): Update the comment documenting what
9770 can it->OBJECT be.
9771
9772 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9773
9774 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9775 a display string, extend search for cursor position to end of row.
9776 (find_row_edges): If the row ends in a newline from a display
9777 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9778 Handle the case of a display string with multiple newlines.
9779 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9780 non-empty line. Fixes confusing cursor motion with arrow keys at
9781 the beginning of a line that starts with whitespace.
9782
9783 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9784
9785 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9786 (bug#9493).
9787
9788 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9789
9790 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9791 boolean (Bug#9154).
9792
9793 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9794
9795 * xdisp.c (display_line): Record maximum and minimum buffer
9796 positions even if no glyphs were produced (e.g., by a zero-width
9797 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9798 buffer positions that will be removed from the glyph row because
9799 they don't fit.
9800 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9801 column is beyond frame width: don't subtract 1 "pixel" when
9802 computing width of the stretch.
9803 (reseat_at_next_visible_line_start): Undo the change made on
9804 2011-09-17 that saved paragraph information and restored it after
9805 the call to `reseat'. (Bug#9545)
9806
9807 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9808
9809 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9810 and turn window cursor on if cleared (Bug#9415).
9811
9812 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9813
9814 * search.c (boyer_moore): Take unibyte characters from pattern
9815 literally. (Bug#9458)
9816
9817 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9818
9819 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9820
9821 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9822
9823 Fix minor problem found by static checking.
9824 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9825 initialized, to pacify gcc -Wuninitialized.
9826
9827 * fileio.c: Report proper errno when syscall falls.
9828 (Finsert_file_contents): Save and restore errno,
9829 so that report_file_error outputs the correct diagnostic.
9830 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9831
9832 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9833
9834 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9835
9836 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9837
9838 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9839 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9840
9841 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9842
9843 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9844 about the current paragraph and restore it after the call to reseat.
9845
9846 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9847 (bidi_find_paragraph_start): Search back for paragraph beginning
9848 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9849 (bidi_move_to_visually_next): Only trigger paragraph-related
9850 computations when the last character is a newline or at EOB, not
9851 just any NEUTRAL_B. (Bug#9470)
9852
9853 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9854 truncated lines if point is covered by a display string. (Bug#9524)
9855
9856 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9857
9858 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9859 (cons_to_x_long): New function.
9860 (lisp_data_to_selection_data): Use it. Correct the test for
9861 short-versus-long data; it was negated. Break out of vector
9862 loop, for efficiency, when a long datum is discovered.
9863
9864 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9865
9866 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9867
9868 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9869
9870 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9871 GCC PR/17406) by declaring this function with external scope.
9872
9873 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9874
9875 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9876 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9877
9878 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9879
9880 * editfns.c (Fformat): Correctly handle text properties on "%%".
9881
9882 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9883
9884 * xterm.c (x_draw_composite_glyph_string_foreground):
9885 * w32term.c (x_draw_composite_glyph_string_foreground):
9886 * term.c (encode_terminal_code):
9887 * composite.c (composition_update_it, get_composition_id):
9888 * xdisp.c (get_next_display_element)
9889 (fill_composite_glyph_string): Add comments about special meaning
9890 of TAB characters in a composition.
9891
9892 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9893
9894 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9895 This occurs when processing a multibyte format.
9896 Problem reported by Wolfgang Jenker.
9897
9898 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9899
9900 * xdisp.c (try_cursor_movement): Only check for exact match if
9901 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9902
9903 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9904
9905 Remove unused external symbols.
9906 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9907 * xdisp.c (calc_pixel_width_or_height): Now static.
9908 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9909 * indent.c (check_display_width):
9910 * w32term.c: Fix comment to match code.
9911 * xterm.c, xterm.h (x_catching_errors): Remove.
9912
9913 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9914
9915 * xselect.c: Use signed conversions more consistently (Bug#9498).
9916 (selection_data_to_lisp_data): Assume incoming selection data are
9917 signed integers, not unsigned. This is to be consistent with
9918 outgoing selection data, which was modified to use signed integers
9919 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9920 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9921 expects long, not unsigned long.
9922
9923 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9924
9925 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9926 computation of loop end. Reported by Johan Bockgård
9927 <bojohan@gnu.org>.
9928
9929 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9930
9931 * frame.c (Fother_visible_frames_p): Function deleted.
9932
9933 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9934
9935 * indent.c (compute_motion): Process display vector front to back
9936 rather than the other way around. (Bug#2496)
9937
9938 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9939
9940 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9941
9942 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9943
9944 * minibuf.c (Fread_from_minibuffer): Doc fix.
9945
9946 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9947
9948 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
9949 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
9950
9951 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
9952
9953 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
9954 value for non-existent files.
9955
9956 2011-09-11 Eli Zaretskii <eliz@gnu.org>
9957
9958 * fileio.c (Finsert_file_contents): If the file cannot be opened,
9959 set its "size" to -1. This will set the modtime_size field of
9960 the corresponding buffer to -1, which is what
9961 verify-visited-file-modtime expects for files that do not exist.
9962 (Bug#9139)
9963
9964 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
9965
9966 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
9967 here ...
9968 * lisp.h: ... from here. push_key_description is no longer
9969 defined in keyboard.c, so its declaration should not be in
9970 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
9971 logically belongs with push_key_description.
9972
9973 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
9974
9975 * buffer.h: Include <sys/types.h> instead of <time.h>.
9976 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
9977 Problem reported by Herbert J. Skuhra.
9978
9979 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
9980
9981 * xml.c (parse_region): Make the parsing work for
9982 non-comment-starting XML files again (bug#9144).
9983
9984 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
9985
9986 * image.c (gif_load): Fix calculation of bottom and right corner.
9987 (Bug#9468)
9988
9989 2011-09-10 Eli Zaretskii <eliz@gnu.org>
9990
9991 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
9992 redisplay in small windows.
9993
9994 2011-09-09 Eli Zaretskii <eliz@gnu.org>
9995
9996 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
9997
9998 2011-09-08 Martin Rudalics <rudalics@gmx.at>
9999
10000 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10001 Operate on live windows only.
10002
10003 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10004
10005 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10006
10007 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10008
10009 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10010 only under bidi iteration.
10011
10012 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10013
10014 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10015
10016 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10017
10018 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10019 Without this fix, the command to link temacs failed due to an
10020 undefined symbol __builtin_isnan. This is because
10021 /usr/include/iso/math_c99.h #defines isnan(x) to
10022 __builtin_isnan(x), but the bundled gcc, which identifies itself
10023 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10024 a __builtin_isnan.
10025 * floatfns.c (isnan): #undef, and then #define to a clone of
10026 what's in data.c.
10027 (Fisnan): Always define, since it's always available now.
10028 (syms_of_floatfns): Always define isnan at the Lisp level.
10029
10030 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10031
10032 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10033
10034 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10035
10036 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10037 The previous code assumed that file offsets (off_t values) fit in
10038 EMACS_INT variables, which is not true on typical 32-bit hosts.
10039 The code messed up by falsely reporting buffer overflow in cases
10040 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10041 when "big" contains more than 2**29 bytes, even though this
10042 inserts just one byte and does not overflow the buffer.
10043 (Finsert_file_contents): Store file offsets as off_t
10044 values, not as EMACS_INT values. Check for overflow when
10045 converting between EMACS_INT and off_t. When checking for
10046 buffer overflow or for overlap, take the offsets into account.
10047 Don't use EMACS_INT for small values where int suffices.
10048 When checking for overlap, fix a typo: ZV was used where
10049 ZV_BYTE was intended.
10050 (Fwrite_region): Don't assume off_t fits into 'long'.
10051 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10052
10053 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10054
10055 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10056
10057 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10058
10059 sprintf-related integer and memory overflow issues (Bug#9412).
10060
10061 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10062 (esprintf, exprintf, evxprintf): New functions.
10063 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10064 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10065 (modify_event_symbol): Do not assume that the length of
10066 name_alist_or_stem is safe to alloca and fits in int.
10067 (Fexecute_extended_command): Likewise for function name and binding.
10068 (Frecursion_depth): Wrap around reliably on integer overflow.
10069 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10070 since some callers pass EMACS_INT values.
10071 (Fsingle_key_description): Don't crash if symbol name contains more
10072 than MAX_ALLOCA bytes.
10073 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10074 (get_minibuffer): Arg is now EMACS_INT, not int.
10075 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10076 (esprintf, exprintf, evxprintf): New decls.
10077 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10078
10079 * dbusbind.c (signature_cat): New function.
10080 (xd_signature, Fdbus_register_signal):
10081 Do not overrun buffer; instead, report string overflow.
10082
10083 * dispnew.c (add_window_display_history): Don't overrun buffer.
10084 Truncate instead; this is OK since it's just a log.
10085
10086 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10087 even if the time zone offset is outlandishly large.
10088 Don't mishandle offset == INT_MIN.
10089
10090 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10091 when creating daemon; the previous buffer-overflow check was incorrect.
10092
10093 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10094 which has the guts of the old verror function.
10095
10096 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10097 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10098
10099 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10100 (font_unparse_xlfd): Don't blindly alloca long strings.
10101 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10102 fits in int, when using sprintf. Use single snprintf to count
10103 length of string rather than counting it via multiple sprintfs;
10104 that's simpler and more reliable.
10105 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10106 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10107 sprintf, in case result does not fit in int.
10108
10109 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10110 (fontset_from_font): Print it.
10111
10112 * frame.c (tty_frame_count): Now printmax_t, not int.
10113 (make_terminal_frame, set_term_frame_name): Print it.
10114 (x_report_frame_params): In X, window IDs are unsigned long,
10115 not signed long, so print them as unsigned.
10116 (validate_x_resource_name): Check for implausibly long names,
10117 and don't assume name length fits in 'int'.
10118 (x_get_resource_string): Don't blindly alloca invocation name;
10119 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10120 not fit in int.
10121
10122 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10123 (xg_check_special_colors, xg_set_geometry):
10124 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10125
10126 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10127 Use esprintf, not sprintf, in case result does not fit in int.
10128
10129 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10130 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10131 it as a large positive number.
10132 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10133 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10134
10135 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10136 in case result does not fit in int.
10137
10138 * print.c (float_to_string): Detect width overflow more reliably.
10139 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10140 buffer overrun. Don't assume list length fits in 'int'. Treat
10141 print length of 0 as 0, not as infinity; to be consistent with other
10142 uses of print length in this function. Don't overflow print length
10143 index. Don't assume hash table size fits in 'long', or that
10144 vectorlike size fits in 'unsigned long'.
10145
10146 * process.c (make_process): Use printmax_t, not int, to format
10147 process-name gensyms.
10148
10149 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10150
10151 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10152 to avoid potential buffer overrun.
10153
10154 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10155 if X resource line is longer than 512 bytes.
10156
10157 * xfns.c (x_window): Make sprintf buffer a bit bigger
10158 to avoid potential buffer overrun.
10159
10160 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10161
10162 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10163
10164 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10165
10166 Integer overflow fixes for scrolling, etc.
10167 Without these, Emacs silently mishandles large integers sometimes.
10168 For example, "C-u 4294967297 M-x recenter" was treated as if
10169 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10170
10171 * xdisp.c (try_window_id): Check Emacs fixnum range before
10172 converting to 'int'.
10173
10174 * window.c (window_scroll_line_based, Frecenter):
10175 Check that an Emacs fixnum is in range before assigning it to 'int'.
10176 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10177 values converted from Emacs fixnums.
10178 (Frecenter): Don't wrap around a line count if it is out of 'int'
10179 range; instead, treat it as an extreme value.
10180 (Fset_window_configuration, compare_window_configurations):
10181 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10182
10183 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10184 that can exceed INT_MAX. Check that EMACS_INT value is in range
10185 before assigning it to the (possibly-narrower) index.
10186 (match_limit): Don't assume that a fixnum can fit in 'int'.
10187
10188 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10189 exceed INT_MAX.
10190
10191 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10192 (Fvertical_motion): Don't wrap around LINES values that don't fit
10193 in 'int'. Instead, treat them as extreme values. This is good
10194 enough for windows, which can't have more than INT_MAX lines anyway.
10195
10196 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10197
10198 * Require libxml/parser.h to avoid compilation warning.
10199
10200 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10201
10202 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10203 since this reportedly can destroy thread storage.
10204
10205 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10206
10207 * syntax.c (find_defun_start): Update all cache variables if
10208 exiting early (Bug#9401).
10209
10210 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10211
10212 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10213
10214 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10215 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10216 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10217
10218 * term.c (tty_append_glyph): New function.
10219 (produce_stretch_glyph): Static function and its prototype deleted.
10220
10221 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10222 Add prototypes.
10223
10224 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10225
10226 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10227 when checking :margin (Bug#9390).
10228 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10229 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10230 so that the name doesn't mislead. All uses changed.
10231
10232 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10233
10234 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10235 set_tty_hooks.
10236
10237 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10238
10239 * xdisp.c (move_it_to): Don't bail out early when reaching
10240 position beyond to_charpos, if we are scanning backwards.
10241 (move_it_vertically_backward): When DY == 0, make sure we get to
10242 the first character in the line after the newline.
10243
10244 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10245
10246 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10247 (ccl_driver): Do not generate an out-of-range pointer.
10248 (Fccl_execute_on_string): Remove unnecessary check for
10249 integer overflow, noted by Stefan Monnier in
10250 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10251 Remove a FIXME that didn't need fixing.
10252 Simplify the newly-introduced buffer reallocation code.
10253
10254 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10255
10256 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10257
10258 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10259
10260 Integer and memory overflow issues (Bug#9196).
10261
10262 * doc.c (get_doc_string): Rework so that
10263 get_doc_string_buffer_size is the actual buffer size, rather than
10264 being 1 less than the actual buffer size; this makes xpalloc more
10265 convenient.
10266
10267 * image.c (x_allocate_bitmap_record, cache_image):
10268 * xselect.c (Fx_register_dnd_atom):
10269 Simplify previous changes by using xpalloc.
10270
10271 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10272 since either will do and ptrdiff_t is convenient with xpalloc.
10273
10274 * charset.c (charset_table_size)
10275 (struct charset_sort_data.priority): Now ptrdiff_t.
10276 (charset_compare): Don't overflow if priorities differ greatly.
10277 (Fsort_charsets): Don't assume list length fits in int.
10278 Check for size-calculation overflow when allocating sort data.
10279 (syms_of_charset): Allocate an initial charset table that is
10280 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10281
10282 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10283
10284 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10285 The actual value is always <= INT_MAX, and leaving it unsigned made
10286 overflow checking harder.
10287
10288 * dispextern.h (struct glyph_matrix.rows_allocated)
10289 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10290 with xpalloc. The values are still always <= INT_MAX.
10291
10292 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10293
10294 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10295 (SAFE_NALLOCA): New macro.
10296
10297 * region-cache.c (struct boundary.pos, find_cache_boundary)
10298 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10299 (set_cache_region, invalidate_region_cache)
10300 (revalidate_region_cache, know_region_cache, region_cache_forward)
10301 (region_cache_backward, pp_cache):
10302 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10303 so that ptrdiff_t * can be passed to xpalloc.
10304 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10305 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10306 (pp_cache): Don't assume cache_len fits in int.
10307 * region-cache.h: Adjust extern decls to match.
10308
10309 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10310 EMACS_INT, since either will do, for xpalloc.
10311
10312 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10313 (xnmalloc, xnrealloc, xpalloc): New functions.
10314
10315 * bidi.c (bidi_shelve_header_size): New constant.
10316 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10317 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10318
10319 * bidi.c (bidi_cache_shrink):
10320 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10321 (overlay_strings):
10322 Don't update size of array until after memory allocation succeeds,
10323 because xmalloc/xrealloc may not return.
10324 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10325 now that we have proper integer overflow checking.
10326 (record_overlay_string, overlay_strings): Catch overflows when
10327 calculating size of overlay_str_buf.
10328
10329 * callproc.c (Fcall_process): Check for size overflow when
10330 calculating size of args2.
10331 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10332 Normally we prefer signed values, but sticking with ptrdiff_t would
10333 require adding more-complicated checks.
10334
10335 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10336 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10337 Redo buffer-overflow calculations to avoid integer overflow.
10338 Add a FIXME comment where memory seems to be over-allocated.
10339
10340 * character.c (Fstring): Check for size-calculation overflow.
10341
10342 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10343 unnecessary integer overflow. Check for size overflow.
10344 (encode_coding_object): Don't update size until xmalloc succeeds.
10345
10346 * composite.c (get_composition_id): Check for overflow in glyph
10347 length calculations.
10348
10349 Integer and memory overflow fixes for display code.
10350 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10351 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10352 (scrolling_window): Check for overflow in size calculations.
10353 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10354 Don't assume glyph table len fits in int.
10355 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10356 (row_table_size): Now ptrdiff_t, not int.
10357 (scrolling_window): Avoid overflow in size calculations.
10358 Don't update size until allocation succeeds.
10359 * fns.c (concat): Check for overflow in size calculations.
10360 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10361 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10362 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10363
10364 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10365 (get_doc_string): Check for size calculation overflow.
10366 Don't update size until allocation succeeds.
10367 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10368 EMACS_INT, where ptrdiff_t will do.
10369 (Fsubstitute_command_keys): Check for string overflow.
10370
10371 * editfns.c (set_time_zone_rule): Don't assume environment length
10372 fits in int.
10373 (message_length): Now ptrdiff_t, not int.
10374 (Fmessage_box): Don't update size until allocation succeeds.
10375 Don't assume message length fits in int.
10376 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10377
10378 * emacs.c (main): Do not reallocate argv, since there is a null at
10379 the end that can be overwritten, and this way there's no need to
10380 worry about size-calculation overflow.
10381 (sort_args): Check for size-calculation overflow.
10382
10383 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10384 alloc succeeds.
10385 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10386
10387 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10388 (x_set_scroll_bar_width, x_figure_window_size):
10389 Check for integer overflow.
10390 (x_set_alpha): Do not assume XINT fits in int.
10391
10392 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10393 This is for the members text_lines, text_cols, total_lines, total_cols,
10394 where the system imposes an 'int' limit.
10395
10396 * fringe.c (Fdefine_fringe_bitmap):
10397 Don't update size until alloc works.
10398
10399 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10400 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10401
10402 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10403 Check for size-calculation overflow.
10404 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10405 do, as we prefer signed integers.
10406 (id_to_widget.max_size, id_to_widget.used)
10407 (xg_store_widget_in_map, xg_remove_widget_from_map)
10408 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10409 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10410 Use and return ptrdiff_t, not int.
10411 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10412 * gtkutil.h: Change prototypes to match the above.
10413
10414 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10415 are duplicate now that they've been promoted to lisp.h.
10416 (x_allocate_bitmap_record, x_alloc_image_color)
10417 (make_image_cache, cache_image, xpm_load):
10418 Don't update size until alloc is done.
10419 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10420 (x_detect_edges):
10421 Check for size calculation overflow.
10422 (ct_colors_allocated_max): New constant.
10423 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10424 overflow.
10425
10426 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10427 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10428 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10429 Use ptrdiff_t, not int, to count maps.
10430 (read_char_minibuf_menu_prompt): Check for overflow in size
10431 calculations. Don't update size until allocation succeeds.
10432 Redo calculations to avoid overflow.
10433 * keyboard.h: Change prototypes to match the above.
10434
10435 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10436 to count maps.
10437 (current_minor_maps): Check for size calculation overflow.
10438 * keymap.h: Change prototypes to match the above.
10439
10440 * lread.c (read1, init_obarray): Don't update size until alloc done.
10441
10442 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10443 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10444
10445 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10446 Now ptrdiff_t, not int.
10447 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10448 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10449
10450 * process.c (Fnetwork_interface_list): Check for overflow
10451 in size calculation.
10452
10453 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10454
10455 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10456 overflow. Don't bother calling xmalloc when xrealloc will do.
10457
10458 * search.c (Freplace_match): Check for size calculation overflow.
10459 (Fset_match_data): Don't assume list lengths fit in 'int'.
10460
10461 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10462 for command line length. Do not attempt to address one before the
10463 beginning of an array, as that's not portable.
10464
10465 * term.c (max_frame_lines): Remove; unused.
10466 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10467 not int.
10468 (encode_terminal_code, calculate_costs): Check for size
10469 calculation overflow.
10470 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10471 table lengths and related sizes. Don't update size until alloc
10472 done. Redo calculations to avoid overflow.
10473 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10474
10475 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10476 subtracting pointers.
10477 (gobble_line): Check for overflow more carefully. Don't update size
10478 until alloc done.
10479
10480 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10481 Don't update size until alloc done.
10482 Redo size calculations to avoid overflow.
10483 Check for size calculation overflow.
10484 (main) [DEBUG]: Fix typo in invoking tparam1.
10485
10486 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10487 Use ptrdiff_t, not int, for sizes.
10488 (store_mode_line_noprop_char): Don't update size until alloc done.
10489
10490 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10491 Use ptrdiff_t, not int, for sizes.
10492 (Finternal_make_lisp_face, cache_face):
10493 Check for size calculation overflow.
10494 (cache_face): Treat size calculation overflows as if they were
10495 memory exhaustion (the usual treatment), rather than aborting.
10496
10497 * xfns.c (x_encode_text, x_set_name_internal)
10498 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10499 sizes, since they can exceed INT_MAX in size. Check for size
10500 calculation overflow.
10501
10502 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10503 (xg_select): Check for size calculation overflow.
10504 Don't update size until alloc done.
10505
10506 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10507 as sprintf is limited to int lengths.
10508
10509 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10510 (X_LONG_MIN): New macros.
10511 Use them to make the following changes clearer.
10512 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10513 This change doesn't affect the value now, but it may help remind
10514 future maintainers not to raise the value too much later.
10515 (SELECTION_QUANTUM): Remove, replacing with ...
10516 (selection_quantum): ... new function, which avoids overflow.
10517 All uses changed.
10518 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10519 assumption that selection length fits in 'int'.
10520 (x_reply_selection_request, x_handle_selection_request)
10521 (x_get_window_property, receive_incremental_selection)
10522 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10523 (lisp_data_to_selection_data, clean_local_selection_data):
10524 Use ptrdiff_t, not int, to record length of selection.
10525 (x_reply_selection_request, x_get_window_property)
10526 (receive_incremental_selection, x_property_data_to_lisp):
10527 Redo calculations to avoid overflow.
10528 (x_reply_selection_request): When sending hint, ceiling it at
10529 X_LONG_MAX rather than relying on wraparound overflow to send
10530 something.
10531 (x_get_window_property, receive_incremental_selection)
10532 (lisp_data_to_selection_data, x_property_data_to_lisp):
10533 Check for size-calculation overflow.
10534 (x_get_window_property, receive_incremental_selection)
10535 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10536 Don't store size until memory allocation succeeds.
10537 (x_get_window_property): Plug memory leak on memory exhaustion.
10538 Don't double-block input; malloc is safe here. Don't assume 2**34
10539 - 4 fits in unsigned long. Add an xassert to check
10540 XGetWindowProperty overflow. Be more careful about overflow
10541 calculations, and distinguish size from memory overflow better.
10542 (receive_incremental_selection): When tracing, don't assume
10543 unsigned int is less than INT_MAX.
10544 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10545 harmful) conversions of unsigned short to int.
10546 (lisp_data_to_selection_data): Don't assume that integers
10547 in the range -65535 through -1 fit in an X unsigned short.
10548 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10549 result parameters unless successful. Rely on cons_to_unsigned
10550 to report problems with elements; the old code wasn't right anyway.
10551 (x_check_property_data): Check for int overflow; we cannot use
10552 a wider type due to X limits.
10553 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10554
10555 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10556
10557 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10558 (x_term_init): Check for size calculation overflow.
10559 (x_color_cells): Don't store size until memory allocation succeeds.
10560 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10561 Don't assume alloca size is less than MAX_ALLOCA.
10562 (x_term_init): Don't assume length fits in int (sprintf is limited
10563 to int size).
10564
10565 Use ptrdiff_t for composition IDs.
10566 * character.c (lisp_string_width):
10567 * composite.c (composition_table_size, n_compositions)
10568 (get_composition_id, composition_gstring_from_id):
10569 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10570 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10571 * window.c (Frecenter):
10572 Use ptrdiff_t, not int, for composition IDs.
10573 * composite.c (get_composition_id): Check for integer overflow.
10574 * composite.h: Adjust prototypes to match the above changes.
10575
10576 Use ptrdiff_t for hash table indexes.
10577 * category.c (hash_get_category_set):
10578 * ccl.c (ccl_driver):
10579 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10580 * coding.c (coding_system_charset_list, detect_coding_system):
10581 * coding.h (struct coding_system.id):
10582 * composite.c (get_composition_id, gstring_lookup_cache):
10583 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10584 * image.c (xpm_get_color_table_h):
10585 * lisp.h (hash_lookup, hash_put):
10586 * minibuf.c (Ftest_completion):
10587 Use ptrdiff_t for hash table indexes, not int (which is too
10588 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10589 32-bit --with-wide-int hosts).
10590
10591 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10592 Add a FIXME comment about memory leaks.
10593 (syms_of_charset): Don't assume xmalloc returns.
10594
10595 Don't assume that stated character widths fit in int.
10596 * character.c (Fchar_width, c_string_width, lisp_string_width):
10597 * character.h (CHAR_WIDTH):
10598 * indent.c (MULTIBYTE_BYTES_WIDTH):
10599 Use sanitize_char_width to avoid undefined and/or bad behavior
10600 with outlandish widths.
10601 * character.h (sanitize_tab_width): Rename from sanitize_width,
10602 now that we have two such functions. All uses changed.
10603 (sanitize_char_width): New inline function.
10604
10605 Don't assume that tab-width fits in int.
10606 * character.h (sanitize_width): New inline function.
10607 (SANE_TAB_WIDTH): New macro.
10608 (ASCII_CHAR_WIDTH): Use it.
10609 * indent.c (sane_tab_width): Remove. All uses replaced by
10610 SANE_TAB_WIDTH (current_buffer).
10611 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10612
10613 * fileio.c: Integer overflow issues with file modes.
10614 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10615
10616 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10617 Remove unreachable code.
10618 (read_hex, load_charset_map_from_file): Check for integer overflow.
10619
10620 * xterm.c: Don't go over XClientMessageEvent limit.
10621 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10622 (x_send_scroll_bar_event): Likewise. Check that the size does not
10623 exceed limits imposed by XClientMessageEvent, as well as the usual
10624 ptrdiff_t and size_t limits.
10625
10626 * keyboard.c: Overflow, signedness and related fixes.
10627 (make_lispy_movement): Use same integer type in forward decl
10628 that is used in the definition.
10629 (read_key_sequence, keyremap_step):
10630 Change bufsize argument back to int, undoing my 2011-03-30 change.
10631 We prefer signed types, and int is wide enough here.
10632 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10633 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10634 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10635 length, not size_t. Use ptrdiff_t for index, not int.
10636 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10637 possibility of integer overflow.
10638
10639 Overflow, signedness and related fixes for images.
10640
10641 * dispextern.h (struct it.stack[0].u.image.image_id)
10642 (struct_it.image_id, struct image.id, struct image_cache.size)
10643 (struct image_cache.used, struct image_cache.ref_count):
10644 * gtkutil.c (update_frame_tool_bar):
10645 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10646 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10647 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10648 * nsmenu.m (update_frame_tool_bar):
10649 * xdisp.c (calc_pixel_width_or_height):
10650 * xfns.c (image_cache_refcount):
10651 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10652 on typical 64-bit hosts.
10653
10654 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10655 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10656 Omit unnecessary casts to int.
10657 (parse_image_spec): Check that integers fall into 'int' range
10658 when the callers expect that.
10659 (image_ascent): Redo ascent calculation to avoid int overflow.
10660 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10661 (lookup_image): Remove unnecessary tests.
10662 (xbm_image_p): Locals are now of int, not EMACS_INT,
10663 since parse_image_check makes sure they fit into int.
10664 (png_load, gif_load, svg_load_image):
10665 Prefer int to unsigned where either will do.
10666 (tiff_handler): New function, combining the cores of the
10667 old tiff_error_handler and tiff_warning_handler.
10668 This function is rewritten to use vsnprintf and thereby avoid
10669 stack buffer overflows. It uses only the features of vsnprintf
10670 that are common to both POSIX and native Microsoft.
10671 (tiff_error_handler, tiff_warning_handler): Use it.
10672 (tiff_load, gif_load, imagemagick_load_image):
10673 Don't assume :index value fits in 'int'.
10674 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10675 (imagemagick_load_image): Check that crop parameters fit into
10676 the integer types that MagickCropImage accepts. Don't assume
10677 Vimagemagick_render_type has a nonnegative value. Don't assume
10678 size_t fits in 'long'.
10679 (gs_load): Use printmax_t to print the widest integers possible.
10680 Check for integer overflow when computing image height and width.
10681
10682 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10683
10684 * xdisp.c (redisplay_window): Don't force window start if point
10685 will be invisible in the resulting window. (Bug#9324)
10686
10687 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10688
10689 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10690 the display spec is of the form `(space ...)'.
10691 (handle_display_spec): Return the value returned by
10692 handle_single_display_spec, not just 1 or zero.
10693 (handle_single_display_spec): If the display spec is of the form
10694 `(space ...)', and specifies display in the text area, return 2
10695 rather than 1.
10696 (try_cursor_movement): Check for the need to scroll more
10697 accurately, and prefer exact match for point under bidi.
10698 Don't advance `row' beyond the last row of the window.
10699
10700 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10701 into disp_prop; all users changed.
10702
10703 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10704 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10705 for the text covered by the display property.
10706
10707 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10708
10709 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10710 Change return value to nil.
10711 (Frecord_buffer): Delete unused function.
10712
10713 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10714
10715 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10716 buffers, return left-to-right.
10717 (set_cursor_from_row): Consider candidate row a win if its glyph
10718 represents a newline and point is on that newline. Fixes cursor
10719 positioning on the newline at EOL of R2L text within L2R
10720 paragraph, and vice versa.
10721 (try_cursor_movement): Check continued rows, in addition to
10722 continuation rows. Fixes unwarranted scroll when point enters a
10723 continued line of R2L text within an L2R paragraph, or vice versa.
10724 (cursor_row_p): Consider the case of point being equal to
10725 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10726 from the end of a short line to the beginning of a continued line
10727 of R2L text within L2R paragraph.
10728 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10729 composed characters.
10730
10731 * bidi.c (bidi_check_type): Use xassert.
10732 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10733 members.
10734
10735 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10736
10737 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10738 a character.
10739
10740 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10741
10742 * nsfont.m (ns_otf_to_script): Fix typo.
10743
10744 2011-08-22 Kenichi Handa <handa@m17n.org>
10745
10746 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10747 extra slot even if the purpose is char-code-property-table.
10748
10749 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10750
10751 * xdisp.c (redisplay_window): When computing centering_position,
10752 account for the height of the header line. (Bug#8874)
10753
10754 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10755 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10756 candidate is selected by the mouse, and that candidate has a
10757 composed character under the mouse.
10758
10759 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10760 coordinates reported by pos-visible-in-window-p for a composed
10761 character in column zero.
10762
10763 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10764
10765 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10766
10767 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10768
10769 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10770 consider it a hit if to_charpos is anywhere in the range of the
10771 composed buffer positions.
10772
10773 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10774
10775 * image.c (gif_load): Don't assume that each subimage has the same
10776 dimensions as the base image. Handle disposal method that is
10777 "undefined" by the gif spec (Bug#9335).
10778
10779 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10780
10781 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10782 (Fcondition_case): Document `debug' symbol in error handler.
10783
10784 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10785
10786 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10787 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10788 from an Org mode buffer to a Speedbar frame.
10789
10790 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10791 a composition, take its buffer position from IT->cmp_it.charpos.
10792 Fixes cursor positioning at the beginning of a line that begins
10793 with a composed character.
10794
10795 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10796
10797 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10798 character bidirectional type, use STRONG_L instead. Fixes crashes
10799 in a buffer produced by `describe-categories'.
10800
10801 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10802 members before the level stack, so they would be saved and
10803 restored when copying iterator state. Fixes incorrect reordering
10804 around TABs covered by display properties.
10805
10806 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10807
10808 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10809
10810 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10811
10812 * eval.c (internal_condition_case, internal_condition_case_1)
10813 (internal_condition_case_2, internal_condition_case_n):
10814 Remove unnecessary aborts (Bug#9081).
10815
10816 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10817
10818 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10819 has no `load' handler, try opening the file locally. (Bug#9311)
10820
10821 2011-08-16 Ken Brown <kbrown@cornell.edu>
10822
10823 * gmalloc.c: Expand comment.
10824
10825 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10826
10827 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10828 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10829
10830 2011-08-16 Ken Brown <kbrown@cornell.edu>
10831
10832 Fix memory allocation problems in Cygwin build (Bug#9273).
10833
10834 * unexcw.c ( __malloc_initialized): Declare external variable.
10835 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10836
10837 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10838 New variables.
10839 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10840 dumped emacs.
10841 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10842 in the static heap.
10843 [CYGWIN] (special_realloc): New function.
10844 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10845 requests to realloc storage in the static heap.
10846
10847 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10848
10849 * bidi.c (bidi_initialize): Remove unused local.
10850
10851 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10852
10853 * bidimirror.h:
10854 * biditype.h: Remove file.
10855 * makefile.w32-in ($(BLD)/bidi.$(O)):
10856 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10857
10858 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10859
10860 * chartab.c: Improve commentary for the uniprop_table API.
10861
10862 * bidi.c (bidi_paragraph_init): Support zero value of
10863 bidi_ignore_explicit_marks_for_paragraph_level.
10864 (bidi_initialize): Use uniprop_table instead of including
10865 biditype.h and bidimirror.h.
10866
10867 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10868 coordinates of the iterator when restoring from ppos_it.
10869 (Bug#9296)
10870
10871 2011-08-14 Kenichi Handa <handa@m17n.org>
10872
10873 * process.c (create_process): Call setup_process_coding_systems
10874 after the pid of the process is set to -1 (Bug#8162).
10875
10876 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10877
10878 * xdisp.c (move_it_in_display_line_to): Don't invoke
10879 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10880 ppos_it. Fixes vertical cursor motion when line beginning is
10881 covered by an image. (Bug#9296)
10882
10883 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10884
10885 * nsterm.h (ns_run_ascript): Declare.
10886 (NSAPP_DATA2_RUNASSCRIPT): Define.
10887
10888 * nsfns.m (as_script, as_result, as_status): New static variables.
10889 (ns_run_ascript): New function.
10890 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10891 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10892 the event loop. Get status from as_status (Bug#7276).
10893
10894 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10895 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10896 the event loop (Bug#7276).
10897
10898 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10899
10900 * gnutls.c (QCgnutls_bootprop_priority)
10901 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10902 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10903 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10904 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10905 (QCgnutls_bootprop_verify_hostname_error)
10906 (QCgnutls_bootprop_callbacks_verify): Rename from
10907 Qgnutls_bootprop_..., all uses changed.
10908
10909 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10910 uses changed.
10911
10912 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10913
10914 * xfaces.c (Qframe_set_background_mode): Now static.
10915 * dispextern.h (Qframe_set_background_mode): Remove decl.
10916
10917 * process.c (Fnetwork_interface_info): Declare local only if needed.
10918
10919 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10920
10921 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10922 (Fnetwork_interface_list): Allocate in increments of bytes instead
10923 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10924 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10925 sockaddr.
10926 (struct ifflag_def): notrailers is smart on OSX.
10927 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10928 Get hardware address with getifaddrs if available.
10929
10930 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10931
10932 * xdisp.c (iterate_out_of_display_property): xassert that
10933 IT->position is set to within IT->object's boundaries. Break from
10934 the loop as soon as EOB is reached; avoids infloops in redisplay
10935 when IT->position is set up wrongly due to some bug.
10936 Set IT->current to match the bidi iterator unconditionally.
10937 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10938 entry. Force push_it to save on the stack the current
10939 buffer/string position, to be restored by pop_it. Fix flags in
10940 the iterator structure wrt the object coming from a display
10941 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10942 properties. (Bug#9284)
10943
10944 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10945
10946 * fontset.c (fontset_get_font_group): Add proper type checks.
10947 (Bug#9172)
10948
10949 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10950
10951 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
10952 and LC_VERSION_MIN_MACOSX.
10953 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
10954 (dump_it) [LC_FUNCTION_STARTS]: Use it.
10955
10956 2011-08-08 Eli Zaretskii <eliz@gnu.org>
10957
10958 * xdisp.c (forward_to_next_line_start): Allow to use the
10959 no-display-properties-and-no-overlays under bidi display.
10960 Set disp_pos in the bidi iterator to avoid searches for display
10961 properties and overlays.
10962
10963 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
10964
10965 * editfns.c (Fset_time_zone_rule): Document relationship with the
10966 setenv function.
10967
10968 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
10969 the font entity extracted from the cache (Bug#8109).
10970
10971 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
10972
10973 * composite.c (autocmp_chars): Don't reset point. That is done by
10974 restore_point_unwind (Bug#5984).
10975
10976 2011-08-07 Juri Linkov <juri@jurta.org>
10977
10978 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
10979 to show the arg `TIME' instead of `TIMEVAL'.
10980
10981 2011-08-06 Eli Zaretskii <eliz@gnu.org>
10982
10983 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
10984 display property strides EOL and includes a newline, as in
10985 longlines-mode. (Bug#9254)
10986 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
10987 word-wrap under bidirectional display. (Bug#9224)
10988
10989 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
10990 is non-zero, even if the data buffer is NULL. Fixes a crash in
10991 vertical-motion with longlines-mode. (Bug#9254)
10992
10993 2011-08-05 Eli Zaretskii <eliz@gnu.org>
10994
10995 * bidi.c <bidi_cache_total_alloc>: Now static.
10996 (bidi_initialize): Initialize bidi_cache_total_alloc.
10997
10998 * xdisp.c (display_line): Release buffer allocated for shelved bidi
10999 cache. (Bug#9221)
11000
11001 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11002 amount allocated this far in `bidi_cache_total_alloc'.
11003 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11004 non-zero, only free the data buffer without restoring the cache
11005 contents. All callers changed.
11006
11007 * dispextern.h (bidi_unshelve_cache): Update prototype.
11008
11009 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11010 (move_it_in_display_line, move_it_to)
11011 (move_it_vertically_backward, move_it_by_lines): Replace the call
11012 to xfree to an equivalent call to bidi_unshelve_cache.
11013 (move_it_in_display_line_to): Fix logic of returning
11014 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11015
11016 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11017
11018 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11019 came from a string character with a `cursor' property. (Bug#9229)
11020
11021 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11022
11023 * Makefile.in (LIB_PTHREAD): New variable.
11024 (LIBES): Add LIB_PTHREAD (Bug#9216).
11025
11026 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11027 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11028
11029 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11030
11031 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11032
11033 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11034
11035 * xterm.c (x_find_topmost_parent): New function.
11036 (x_set_frame_alpha): Find topmost parent window with
11037 x_find_topmost_parent and set the property there also (bug#9181).
11038 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11039
11040 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11041
11042 * callproc.c (Fcall_process): Avoid vfork clobbering
11043 the local vars buffer, coding_systems, current_dir.
11044
11045 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11046
11047 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11048
11049 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11050
11051 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11052 so that it is not optimized away.
11053
11054 * xdisp.c (compute_display_string_pos): Remove unused local.
11055
11056 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11057
11058 Fix slow cursor motion and scrolling in large buffers with
11059 selective display, like Org Mode buffers. (Bug#9218)
11060
11061 * dispextern.h (struct bidi_it): New member disp_prop_p.
11062
11063 * xdisp.c: Remove one-slot cache of display string positions.
11064 (compute_display_string_pos): Accept an additional argument
11065 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11066 for a display string or property. If found, set DISP_PROP_P
11067 non-zero.
11068
11069 * bidi.c (bidi_fetch_char): Accept an additional argument
11070 DISP_PROP_P, and pass it to compute_display_string_pos.
11071 Only handle text covered by a display string if DISP_PROP_P is returned
11072 non-zero. All callers of bidi_fetch_char changed.
11073
11074 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11075
11076 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11077
11078 2010-12-03 Don March <don@ohspite.net>
11079
11080 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11081 last character M-[char] is translated to ESC [char] (bug#7541).
11082
11083 2011-08-02 Kenichi Handa <handa@m17n.org>
11084
11085 * lisp.h (uniprop_table): Extern it.
11086
11087 * chartab.c (uniprop_table): Make it non-static.
11088
11089 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11090
11091 * xdisp.c (forward_to_next_line_start): Accept additional argument
11092 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11093 on the newline.
11094 (reseat_at_next_visible_line_start): Use the bidi iterator state
11095 returned by forward_to_next_line_start to restore the state of
11096 it->bidi_it after backing up to previous newline. (Bug#9212)
11097
11098 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11099
11100 * regex.c (re_comp): Protoize.
11101 (re_exec): Fix return type.
11102 (regexec): Fix type of `ret'. (Bug#9203)
11103
11104 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11105
11106 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11107 This is needed if max-image-size is a floating-point number.
11108
11109 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11110
11111 * print.c (print_object): Print empty symbol as ##.
11112
11113 * lread.c (read1): Read ## as empty symbol.
11114
11115 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11116
11117 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11118 setting frame foreground color (Bug#9175).
11119 (x_set_background_color): Likewise.
11120
11121 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11122 contents (Bug#9176).
11123 (EmacsTooltip -init): Remove bezels and add shadows to
11124 tooltip windows.
11125
11126 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11127 or scroll bar (Bug#8470).
11128
11129 * nsfont.m (nsfont_open): Remove assignment to voffset and
11130 unnecessary vars hshink, expand, hd, full_height, min_height.
11131 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11132
11133 * nsterm.h (nsfont_info): Remove voffset field.
11134
11135 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11136
11137 Implement strike-through and overline on NextStep (Bug#8863).
11138
11139 * nsfont.m (nsfont_open): Use underline position provided by font,
11140 instead of hard-coded value of 2.
11141 (nsfont_draw): Call ns_draw_text_decoration instead.
11142
11143 * nsterm.h: Add declaration for ns_draw_text_decoration.
11144
11145 * nsterm.m (ns_draw_text_decoration): New function for drawing
11146 underline, overline, and strike-through.
11147 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11148 ns_draw_text_decoration. Change treatment of cursor drawing to
11149 accommodate underlining, etc.
11150
11151 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11152
11153 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11154 default.
11155
11156 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11157
11158 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11159 Without this fix, if a signal arrives just after memory fills up,
11160 'malloc' might be invoked reentrantly.
11161
11162 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11163 In other words, assume that every image size is allowed, on non-X
11164 hosts. This assumption is probably wrong, but it lets Emacs compile.
11165
11166 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11167
11168 * regex.c (re_iswctype): Convert return values to boolean.
11169
11170 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11171
11172 * xdisp.c (compute_display_string_pos): Don't use cached display
11173 string position if the buffer had its restriction changed.
11174 (Bug#9184)
11175
11176 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11177
11178 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11179
11180 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11181
11182 Integer signedness and overflow and related fixes. (Bug#9079)
11183
11184 * bidi.c: Integer size and overflow fixes.
11185 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11186 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11187 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11188 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11189 (bidi_find_other_level_edge):
11190 Use ptrdiff_t instead of EMACS_INT where either will do.
11191 This works better on 32-bit hosts configured --with-wide-int.
11192 (bidi_cache_ensure_space): Check for size-calculation overflow.
11193 Use % rather than repeated addition, for better worst-case speed.
11194 Don't set bidi_cache_size until after xrealloc returns, because it
11195 might not return.
11196 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11197 (bidi_cache_ensure_space): Also check that the bidi cache size
11198 does not exceed that of the largest Lisp string or buffer. See Eli
11199 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11200
11201 * alloc.c (__malloc_size_t): Remove.
11202 All uses replaced by size_t. See Andreas Schwab's note
11203 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11204
11205 * image.c: Improve checking for integer overflow.
11206 (check_image_size): Assume that f is nonnull, since
11207 it is always nonnull in practice. This is one less thing to
11208 worry about when checking for integer overflow later.
11209 (x_check_image_size): New function, which checks for integer
11210 overflow issues inside X.
11211 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11212 This removes the need for a memory_full check.
11213 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11214 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11215 (xbm_read_bitmap_data): Change locals back to 'int', since
11216 their values must fit in 'int'.
11217 (xpm_load_image, png_load, tiff_load):
11218 Invoke x_create_x_image_and_pixmap earlier,
11219 to avoid much needless work if the image is too large.
11220 (tiff_load): Treat overly large images as if
11221 x_create_x_image_and_pixmap failed, not as malloc failures.
11222 (gs_load): Use x_check_image_size.
11223
11224 * gtkutil.c: Omit integer casts.
11225 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11226 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11227
11228 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11229
11230 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11231 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11232 would wrongly return t on a 64-bit host.
11233
11234 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11235 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11236 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11237 and therefore cause GCC to emit a bogus diagnostic in some cases.
11238
11239 * image.c: Integer signedness and overflow and related fixes.
11240 This is not an exhaustive set of fixes, but it's time to
11241 record what I've got.
11242 (lookup_pixel_color, check_image_size): Remove redundant decls.
11243 (check_image_size): Don't assume that arbitrary EMACS_INT values
11244 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11245 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11246 (tiff_load, imagemagick_load_image):
11247 Check for overflow in size calculations.
11248 (x_create_x_image_and_pixmap): Remove unnecessary test for
11249 xmalloc returning NULL; that can't happen.
11250 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11251 (xpm_color_bucket): Use better integer hashing function.
11252 (xpm_cache_color): Don't possibly over-allocate memory.
11253 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11254 (gif_memory_source):
11255 Use ptrdiff_t, not int or size_t, to record sizes.
11256 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11257 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11258 either works, as we prefer signed integers.
11259 (tiff_read_from_memory, tiff_write_from_memory):
11260 Return tsize_t, not size_t, since that's what the TIFF API wants.
11261 (tiff_read_from_memory): Don't fail simply because the read would
11262 go past EOF; instead, return a short read.
11263 (tiff_load): Omit no-longer-needed casts.
11264 (Fimagemagick_types): Don't assume size fits into 'int'.
11265
11266 Improve hashing quality when configured --with-wide-int.
11267 * fns.c (hash_string): New function, taken from sxhash_string.
11268 Do not discard information about ASCII character case; this
11269 discarding is no longer needed.
11270 (sxhash-string): Use it. Change sig to match it. Caller changed.
11271 * lisp.h: Declare it.
11272 * lread.c (hash_string): Remove, since we now use fns.c's version.
11273 The fns.c version returns a wider integer if --with-wide-int is
11274 specified, so this should help the quality of the hashing a bit.
11275
11276 * emacs.c: Integer overflow minor fix.
11277 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11278 Define only if GNU_LINUX.
11279 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11280
11281 * dispnew.c: Integer signedness and overflow fixes.
11282 Remove unnecessary forward decls, that were a maintenance hassle.
11283 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11284 All uses changed.
11285 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11286 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11287 (prepare_desired_row, line_draw_cost):
11288 Use int, not unsigned, where either works.
11289 (save_current_matrix, restore_current_matrix):
11290 Use ptrdiff_t, not size_t, where either works.
11291 (init_display): Check for overflow more accurately, and without
11292 relying on undefined behavior.
11293
11294 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11295 Remove, replacing with the new symbols in lisp.h. All uses changed.
11296 * fileio.c (make_temp_name):
11297 * filelock.c (lock_file_1, lock_file):
11298 * xdisp.c (message_dolog):
11299 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11300 Use pMd etc. instead.
11301 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11302 replacing the pWIDE etc. symbols removed from editfns.c.
11303
11304 * keyboard.h (num_input_events): Now uintmax_t.
11305 This is (very slightly) less likely to mess up due to wraparound.
11306 All uses changed.
11307
11308 * buffer.c: Integer signedness fixes.
11309 (alloc_buffer_text, enlarge_buffer_text):
11310 Use ptrdiff_t rather than size_t when either will do, as we prefer
11311 signed integers.
11312
11313 * alloc.c: Integer signedness and overflow fixes.
11314 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11315 (__malloc_size_t): Default to size_t, not to int.
11316 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11317 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11318 Prefer ptrdiff_t to size_t when either would do, as we prefer
11319 signed integers.
11320 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11321 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11322 Now const. Initialize with values that are in range even if char
11323 is signed.
11324 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11325 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11326 These functions do the right thing with sizes > 2**32.
11327 (check_depth): Now ptrdiff_t, not int.
11328 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11329 Adjust to new way of storing sizes. Check for size overflow bugs
11330 in rest of code.
11331 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11332 slightly wrong anyway, as it missed one instance of
11333 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11334 (refill_memory_reserve): Omit needless cast to size_t.
11335 (mark_object_loop_halt): Mark as externally visible.
11336
11337 * xselect.c: Integer signedness and overflow fixes.
11338 (Fx_register_dnd_atom, x_handle_dnd_message):
11339 Use ptrdiff_t, not size_t, since we prefer signed.
11340 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11341 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11342 x_dnd_atoms_size and x_dnd_atoms_length.
11343
11344 * doprnt.c: Prefer signed to unsigned when either works.
11345 * eval.c (verror):
11346 * doprnt.c (doprnt):
11347 * lisp.h (doprnt):
11348 * xdisp.c (vmessage):
11349 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11350 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11351 prefer signed arithmetic to avoid comparison confusion.
11352 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11353 but is a bit tricky.
11354
11355 Assume freestanding C89 headers, string.h, stdlib.h.
11356 * data.c, doprnt.c, floatfns.c, print.c:
11357 Include float.h unconditionally.
11358 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11359 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11360 * regex.c: Likewise for stddef.h, string.h.
11361 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11362 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11363 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11364 (STDC_HEADERS): Remove obsolete defines.
11365 * sysdep.c: Include limits.h unconditionally.
11366
11367 Assume support for memcmp, memcpy, memmove, memset.
11368 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11369 * regex.c (memcmp, memcpy):
11370 Remove; we assume C89 now.
11371
11372 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11373 (__malloc_safe_bcopy): Remove; no longer needed.
11374
11375 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11376 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11377 well either way, and we prefer signed to unsigned.
11378
11379 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11380
11381 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11382 closes the connection while we're reading (bug#9182).
11383
11384 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11385
11386 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11387 are specified (Bug#9168).
11388
11389 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11390
11391 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11392 Found by GCC static checking and --with-wide-int on a 32-bit host.
11393
11394 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11395
11396 * xdisp.c (compute_display_string_pos): Fix logic of caching
11397 previous display string position. Initialize cached_prev_pos to
11398 -1. Fixes slow-down at the beginning of a buffer.
11399
11400 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11401
11402 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11403 for attrs[LFACE_FONTSET_INDEX].
11404
11405 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11406
11407 * xml.c (parse_region): Remove unused local
11408 that was recently introduced.
11409
11410 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11411
11412 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11413 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11414
11415 * xdisp.c (move_it_in_display_line_to): Record the best matching
11416 position for TO_CHARPOS while scanning the line, and restore it on
11417 exit if none of the characters scanned was an exact match.
11418 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11419 when exact match is impossible due to invisible text, and the
11420 lines are truncated.
11421
11422 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11423
11424 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11425 for OSX >= 10.7.
11426
11427 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11428
11429 Fix a significant slow-down of cursor motion with C-n, C-p,
11430 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11431 auto-repeat under bidi redisplay in fontified buffers.
11432 * xdisp.c (compute_stop_pos_backwards): New function.
11433 (next_element_from_buffer): Call compute_stop_pos_backwards to
11434 find a suitable prev_stop when we find ourselves before
11435 base_level_stop.
11436 (reseat): Don't look for prev_stop, as that could mean a very long
11437 run.
11438 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11439 <cached_disp_overlay_modiff>: Cache for last found display string
11440 position.
11441 (compute_display_string_pos): Return the cached position if asked
11442 about the same buffer in the same area of character positions, and
11443 the buffer wasn't changed since the time the display string
11444 position was cached.
11445
11446 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11447
11448 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11449 is an integer, which is important for empty lines. (Bug#9149)
11450
11451 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11452
11453 * frame.c (Fmodify_frame_parameters): In tty case, update the
11454 default face if necessary (Bug#4238).
11455
11456 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11457
11458 * editfns.c (Fstring_to_char): No need to explain what a character
11459 is in the docstring (Bug#6576).
11460
11461 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11462
11463 * xml.c (parse_region): Make sure we always return a tree.
11464
11465 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11466
11467 * xml.c (parse_region): If a document contains only comments,
11468 return that, too.
11469
11470 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11471
11472 * xml.c (make_dom): Return comments, too.
11473
11474 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11475
11476 Port to OpenBSD.
11477 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11478 and the surrounding thread.
11479 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11480 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11481 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11482 timer goes off.
11483 * s/openbsd.h (BROKEN_SIGIO): Define.
11484 * unexelf.c (unexec) [__OpenBSD__]:
11485 Don't update the .mdebug section of the Alpha COFF symbol table.
11486
11487 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11488
11489 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11490 (bug#8460).
11491
11492 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11493
11494 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11495 This fixes some race conditions on the permissions of any newly
11496 created file.
11497
11498 * alloc.c (valid_pointer_p): Use pipe, not open.
11499 This fixes some permissions issues when debugging.
11500
11501 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11502 If fchown fails to set both uid and gid, try to set just gid,
11503 as that is sometimes allowed. Adjust the file's mode to eliminate
11504 setuid or setgid bits that are inappropriate if fchown fails.
11505
11506 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11507
11508 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11509 to compare Lisp_Objects.
11510 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11511 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11512 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11513
11514 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11515
11516 * lread.c (read_integer): Unread even EOF character.
11517 (read1): Likewise. Properly record start position of symbol.
11518
11519 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11520 symbol character follows.
11521
11522 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11523
11524 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11525 This works around a problem with the previous change to Fcopy_file.
11526 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11527 and without this change, GCC might complain about discarding
11528 fchown's return value.
11529
11530 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11531
11532 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11533
11534 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11535
11536 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11537
11538 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11539
11540 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11541 it's used from the C level.
11542
11543 * process.c: Use the same condition for POLL_FOR_INPUT in both
11544 keyboard.c and process.c (bug#1858).
11545
11546 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11547
11548 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11549 (Fgnutls_boot): Use it.
11550
11551 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11552
11553 * doc.c (Fsubstitute_command_keys): Revert last change.
11554
11555 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11556
11557 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11558 quotes the next character, and doesn't affect other longer
11559 sequences (bug#8935).
11560
11561 * lread.c (syms_of_lread): Clarify that is isn't only
11562 `eval-buffer' and `eval-defun' that's affected by
11563 `lexical-binding' (bug#8460).
11564
11565 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11566
11567 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11568 bidi redisplay when a line includes both an image and is truncated.
11569
11570 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11571
11572 Fix minor problems found by static checking.
11573 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11574 (elsz): Now a signed constant, not a size_t var. We prefer signed
11575 types to unsigned, to avoid integer comparison confusion. Without
11576 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11577 "cannot optimize loop, the loop counter may overflow", a symptom
11578 of the confusion.
11579 * indent.c (Fvertical_motion): Mark locals as initialized.
11580 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11581
11582 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11583
11584 * search.c (Fre_search_backward): Mention `case-fold-search' in
11585 all the re_search_* functions (bug#8138).
11586
11587 * keyboard.c (Fopen_dribble_file): Document when the file is
11588 closed (bug#8056).
11589
11590 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11591
11592 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11593 bidi_cache_idx.
11594
11595 Support bidi reordering of display and overlay strings.
11596 * xdisp.c (compute_display_string_pos)
11597 (compute_display_string_end): Accept additional argument STRING.
11598 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11599 (reseat_to_string): Initialize bidi_it->string.s and
11600 bidi_it->string.schars.
11601 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11602 NULL (avoids a crash in bidi_paragraph_init).
11603 Initialize itb.string.lstring.
11604 (init_iterator): Call bidi_init_it only of a valid
11605 buffer position was specified. Initialize paragraph_embedding to
11606 L2R.
11607 (reseat_to_string): Initialize the bidi iterator.
11608 (display_string): If we need to ignore text properties of
11609 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11610 original value of -1 will not work with bidi.)
11611 (compute_display_string_pos): First arg is now struct
11612 `text_pos *'; all callers changed. Support display properties on
11613 Lisp strings.
11614 (compute_display_string_end): Support display properties on Lisp
11615 strings.
11616 (init_iterator, reseat_1, reseat_to_string): Initialize the
11617 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11618 when iterating on a string not from display properties).
11619 (compute_display_string_pos, compute_display_string_end):
11620 Fix calculation of the object to scan. Fixes an error when using
11621 arrow keys.
11622 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11623 base_level_stop; instead, set base_level_stop to BEGV.
11624 Fixes crashes in vertical-motion.
11625 (next_element_from_buffer): Improve commentary for when
11626 the iterator is before prev_stop.
11627 (init_iterator): Initialize bidi_p from the default value of
11628 bidi-display-reordering, not from buffer-local value. Use the
11629 buffer-local value only if initializing for buffer iteration.
11630 (handle_invisible_prop): Support invisible properties on strings
11631 that are being bidi-reordered.
11632 (set_iterator_to_next): Support bidi reordering of C strings and
11633 Lisp strings.
11634 (next_element_from_string): Support bidi reordering of Lisp
11635 strings.
11636 (handle_stop_backwards): Support Lisp strings as well.
11637 (display_string): Support display of R2L glyph rows.
11638 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11639 (init_iterator): Don't initialize it->bidi_p for strings
11640 here.
11641 (reseat_to_string): Initialize it->bidi_p for strings here.
11642 (next_element_from_string, next_element_from_c_string)
11643 (next_element_from_buffer): Add xassert's for correspondence
11644 between IT's object being iterated and it->bidi_it.string
11645 structure.
11646 (face_before_or_after_it_pos): Support bidi iteration.
11647 (next_element_from_c_string): Handle the case of the first string
11648 character that is not the first one in the visual order.
11649 (get_visually_first_element): New function, refactored from common
11650 parts of next_element_from_buffer, next_element_from_string, and
11651 next_element_from_c_string.
11652 (tool_bar_lines_needed, redisplay_tool_bar)
11653 (display_menu_bar): Force left-to-right direction. Add a FIXME
11654 comment for making that be controlled by a user option.
11655 (push_it, pop_it): Save and restore the state of the
11656 bidi iterator. Save and restore the bidi_p flag.
11657 (pop_it): Iterate out of display property for string iteration as
11658 well.
11659 (iterate_out_of_display_property): Support iteration over strings.
11660 (handle_single_display_spec): Set up it->bidi_it for iteration
11661 over a display string, and call bidi_init_it.
11662 (handle_single_display_spec, next_overlay_string)
11663 (get_overlay_strings_1, push_display_prop): Set up the bidi
11664 iterator for displaying display or overlay strings.
11665 (forward_to_next_line_start): Don't use the shortcut if
11666 bidi-iterating.
11667 (back_to_previous_visible_line_start): If handle_display_prop
11668 pushed the iterator stack, restore the internal state of the bidi
11669 iterator by calling bidi_pop_it same number of times.
11670 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11671 and we are bidi-iterating, don't decrement the iterator position;
11672 instead, set the first_elt flag in the bidi iterator, to produce
11673 the same effect.
11674 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11675 (push_display_prop): xassert that we are iterating a buffer.
11676 (push_it, pop_it): Save and restore paragraph_embedding member.
11677 (handle_single_display_spec, next_overlay_string)
11678 (get_overlay_strings_1, reseat_1, reseat_to_string)
11679 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11680 correctly. Don't assume unibyte strings are not bidi-reordered.
11681 (compute_display_string_pos)
11682 (compute_display_string_end): Fix handling the case of C string.
11683 (push_it, pop_it): Save and restore from_disp_prop_p.
11684 (handle_single_display_spec, push_display_prop): Set the
11685 from_disp_prop_p flag.
11686 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11687 (pop_it): Call iterate_out_of_display_property only if we are
11688 popping after iteration over a string that came from a display
11689 property. Fix a typo in popping stretch info. Add an assertion
11690 for verifying that the iterator position is in sync with the bidi
11691 iterator.
11692 (handle_single_display_spec, get_overlay_strings_1)
11693 (push_display_prop): Fix initialization of paragraph direction for
11694 string when that of the parent object is not yet determined.
11695 (reseat_1): Call bidi_init_it to resync the bidi
11696 iterator with IT's position. (Bug#7616)
11697 (find_row_edges): If ROW->start.pos gives position
11698 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11699 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11700 Reset the from_disp_prop_p flag.
11701 (SAVE_IT, RESTORE_IT): New macros.
11702 (pos_visible_p, face_before_or_after_it_pos)
11703 (back_to_previous_visible_line_start)
11704 (move_it_in_display_line_to, move_it_in_display_line)
11705 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11706 (try_scrolling, redisplay_window, display_line): Use them when
11707 saving a temporary copy of the iterator and restoring it back.
11708 (back_to_previous_visible_line_start, reseat_1)
11709 (init_iterator): Empty the bidi cache "stack".
11710 (move_it_in_display_line_to): If iterator ended up at
11711 EOL, but we never saw any buffer positions smaller than
11712 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11713 motion in bidi-reordered lines.
11714 (move_it_in_display_line_to): Record prev_method and prev_pos
11715 immediately before the call to set_iterator_to_next. Fixes cursor
11716 motion in bidi-reordered lines with stretch glyphs and strings
11717 displayed in margins. (Bug#8133) (Bug#8867)
11718 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11719 TO_CHARPOS.
11720 (pos_visible_p): Support positions in bidi-reordered lines.
11721 Save and restore bidi cache.
11722
11723 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11724 (bidi_paragraph_info): Delete unused struct.
11725 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11726 (bidi_cache_start): New variable.
11727 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11728 to zero.
11729 (bidi_cache_fetch_state, bidi_cache_search)
11730 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11731 (bidi_cache_find, bidi_peek_at_next_level)
11732 (bidi_level_of_next_char, bidi_find_other_level_edge)
11733 (bidi_move_to_visually_next): Compare cache index with
11734 bidi_cache_start rather than with zero.
11735 (bidi_fetch_char): Accept new argument STRING; all callers
11736 changed. Support iteration over a string. Support strings with
11737 display properties. Support unibyte strings. Fix the type of
11738 `len' according to what STRING_CHAR_AND_LENGTH expects.
11739 (bidi_paragraph_init, bidi_resolve_explicit_1)
11740 (bidi_resolve_explicit, bidi_resolve_weak)
11741 (bidi_level_of_next_char, bidi_move_to_visually_next):
11742 Support iteration over a string.
11743 (bidi_set_sor_type, bidi_resolve_explicit_1)
11744 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11745 can now be zero (for strings); special values 0 and -1 were
11746 changed to -1 and -2, respectively.
11747 (bidi_char_at_pos): New function.
11748 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11749 Call it instead of FETCH_MULTIBYTE_CHAR.
11750 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11751 initialized to valid values.
11752 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11753 values.
11754 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11755 the test for valid cached positions. Fix the logic for looking up
11756 the sentinel state in the cache. GCPRO the Lisp string we are
11757 iterating.
11758 (bidi_push_it, bidi_pop_it): New functions.
11759 (bidi_initialize): Initialize the bidi cache start stack pointer.
11760 (bidi_cache_ensure_space): New function, refactored from part of
11761 bidi_cache_iterator_state. Don't assume the required size is just
11762 one BIDI_CACHE_CHUNK away.
11763 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11764 (bidi_count_bytes, bidi_char_at_pos): New functions.
11765 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11766 always valid if bidi_cache_idx is valid.
11767 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11768 is valid if it's going to be used.
11769 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11770 (bidi_cache_fetch_state, bidi_cache_search)
11771 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11772 (bidi_cache_iterator_state, bidi_cache_find)
11773 (bidi_find_other_level_edge, bidi_cache_start_stack):
11774 All variables related to cache indices are now EMACS_INT.
11775
11776 * dispextern.h (struct bidi_string_data): New structure.
11777 (struct bidi_it): New member `string'. Make flag members be 1-bit
11778 fields, and put them last in the struct.
11779 (compute_display_string_pos, compute_display_string_end):
11780 Update prototypes.
11781 (bidi_push_it, bidi_pop_it): Add prototypes.
11782 (struct iterator_stack_entry): New members bidi_p,
11783 paragraph_embedding, and from_disp_prop_p.
11784 (struct it): Member bidi_p is now a bit field 1 bit wide.
11785 (bidi_shelve_cache, bidi_unshelve_cache):
11786 Declare prototypes.
11787
11788 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11789 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11790 and vector-like objects.
11791
11792 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11793 cache around display iteration.
11794
11795 * window.c (Fwindow_end, window_scroll_pixel_based)
11796 (displayed_window_lines, Frecenter): Save and restore the bidi
11797 cache around display iteration.
11798
11799 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11800
11801 * editfns.c (Fdelete_region): Clarify the use of the named
11802 parameters (bug#6788).
11803
11804 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11805
11806 * indent.c (Fvertical_motion): Set and restore w->pointm when
11807 saving and restoring the window's buffer (Bug#9006).
11808
11809 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11810
11811 * editfns.c (Fstring_to_char): Clarify just what is returned
11812 (bug#6576). Text by Eli Zaretskii.
11813
11814 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11815
11816 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11817
11818 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11819
11820 * buffer.c (mmap_find): Fix a typo.
11821
11822 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11823
11824 Fix execution of x selection hooks.
11825 * xselect.c (Qx_lost_selection_functions)
11826 (Qx_sent_selection_functions): New vars.
11827 (syms_of_xselect): DEFSYM them.
11828 (x_handle_selection_request): Pass Qx_sent_selection_functions
11829 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11830 (x_handle_selection_clear,x_clear_frame_selections):
11831 Pass Qx_lost_selection_functions rather than
11832 Vx_lost_selection_functions to Frun_hook_with_args.
11833
11834 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11835
11836 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11837 The old code sometimes used this field without initializing it.
11838
11839 * alloc.c (gc_sweep): Don't read past end of array.
11840 In theory, the old code could also have corrupted Emacs internals,
11841 though it'd be very unlikely.
11842
11843 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11844
11845 * character.c (Fcharacterp): Don't advertise optional ignored
11846 argument. (Bug#4026)
11847
11848 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11849
11850 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11851 key" (bug#4257).
11852
11853 * window.c (Fset_window_start): Doc fix (bug#4199).
11854 (Fset_window_hscroll): Ditto.
11855
11856 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11857
11858 Fix minor new problems caught by GCC 4.6.1.
11859 * term.c (init_tty): Remove unused local.
11860 * xsettings.c (store_monospaced_changed): Define this function only
11861 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11862 not used otherwise.
11863
11864 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11865
11866 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11867
11868 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11869
11870 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11871 are the mini-buffer and the echo area (bug#3320).
11872
11873 * term.c (init_tty): Remove support for supdup, c10 and perq
11874 terminals, which are no longer supported (bug#1482).
11875
11876 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11877
11878 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11879
11880 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11881
11882 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11883 for non-popups (Bug#3642).
11884
11885 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11886
11887 * alloc.c (reset_malloc_hooks): Protoize.
11888 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11889 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11890 * cm.c (losecursor): Likewise.
11891 * data.c (fmod): Likewise.
11892 * dispnew.c (swap_glyphs_in_rows): Likewise.
11893 * emacs.c (memory_warning_signal): Likewise.
11894 * floatfns.c (float_error): Likewise.
11895 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11896 (otf_open, font_otf_capability, generate_otf_features)
11897 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11898 Likewise.
11899 * image.c (pbm_read_file): Likewise.
11900 * indent.c (string_display_width): Likewise.
11901 * intervals.c (check_for_interval, search_for_interval)
11902 (inc_interval_count, count_intervals, root_interval)
11903 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11904 * lread.c (defalias): Likewise.
11905 * ralloc.c (r_alloc_check): Likewise.
11906 * regex.c (set_image_of_range_1, set_image_of_range)
11907 (regex_grow_registers): Likewise.
11908 * sysdep.c (strerror): Likewise.
11909 * termcap.c (valid_filename_p, tprint, main): Likewise.
11910 * tparam.c (main): Likewise.
11911 * unexhp9k800.c (run_time_remap, save_data_space)
11912 (update_file_ptrs, read_header, write_header, calculate_checksum)
11913 (copy_file, copy_rest, display_header): Likewise.
11914 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11915 Likewise.
11916 * xdisp.c (check_it): Likewise.
11917 * xfaces.c (register_color, unregister_color, unregister_colors):
11918 Likewise.
11919 * xfns.c (print_fontset_result): Likewise.
11920 * xrdb.c (member, fatal, main): Likewise.
11921
11922 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11923
11924 Fix minor problems found by static checking (Bug#9031).
11925 * chartab.c (char_table_set_range, map_sub_char_table):
11926 Remove unused locals.
11927 (uniprop_table): Now static.
11928 * composite.c (_work_char): Remove unused static var.
11929
11930 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11931
11932 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11933
11934 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11935
11936 * gtkutil.c (qttip_cb): Remove code without function.
11937
11938 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11939
11940 * w32.c (pthread_sigmask): New stub.
11941
11942 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11943
11944 Use pthread_sigmask, not sigprocmask (Bug#9010).
11945 sigprocmask is portable only for single-threaded applications, and
11946 Emacs can be multi-threaded when it uses GTK.
11947 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
11948 (LIBES): Use it.
11949 * callproc.c (Fcall_process):
11950 * process.c (create_process):
11951 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
11952 Use pthread_sigmask, not sigprocmask.
11953
11954 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11955
11956 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
11957 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
11958 wrong (Bug#8591).
11959
11960 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11961
11962 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
11963 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
11964 (xg_hide_tooltip): Fix comment.
11965
11966 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
11967 in registerServicesMenuSendTypes.
11968 (validRequestorForSendType): Don't check ns_return_types.
11969
11970 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
11971 ns_return_type.
11972
11973 2011-07-08 Jason Rumney <jasonr@gnu.org>
11974
11975 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
11976 SH_SHOW for hidden windows (Bug#5482).
11977
11978 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
11979 frame struct members of non-existent frames (Bug#6284).
11980
11981 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
11982
11983 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
11984 variable firstTime not needed on OSX >= 10.6.
11985 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
11986 >= 10.5. Use setKnobProportion, setDoubleValue.
11987
11988 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
11989 (MAC_OS_X_VERSION_10_5): Define if not defined.
11990 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
11991 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
11992 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
11993
11994 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
11995 cString and lossyCString on OSX >= 10.4.
11996
11997 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
11998 sizeToFit on OSX >= 10.2.
11999
12000 * nsimage.m (allocInitFromFile): Don't use deprecated method
12001 bestRepresentationForDevice on OSX >= 10.6.
12002
12003 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12004 to avoid warning.
12005
12006 * emacs.c: Declare unexec_init_emacs_zone.
12007
12008 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12009
12010 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12011
12012 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12013 on svcsMenu (Bug#8842).
12014
12015 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12016 ns_return_types.
12017 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12018
12019 * nsterm.m (QUTF8_STRING): Declare.
12020 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12021 (validRequestorForSendType): Return type is (id).
12022 Change indexOfObjectIdenticalTo to indexOfObject.
12023 Check if we have local selection before returning self (Bug#8842).
12024 (writeSelectionToPasteboard): Put local selection into paste board
12025 if we have a local selection (Bug#8842).
12026 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12027
12028 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12029 (ns_get_local_selection): Declare.
12030
12031 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12032
12033 * keymap.c (describe_map_tree): Don't insert a double newline at
12034 the end of the buffer (bug#1169) and return whether we inserted
12035 something.
12036
12037 * callint.c (Fcall_interactively): Change "reading args" to
12038 "providing args" to try to clarify what it does (bug#1010).
12039
12040 2011-07-07 Kenichi Handa <handa@m17n.org>
12041
12042 * composite.c (composition_compute_stop_pos): Ignore a static
12043 composition starting before CHARPOS (Bug#8915).
12044
12045 * xdisp.c (handle_composition_prop): Likewise.
12046
12047 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12048
12049 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12050 (Bug#9015)
12051
12052 2011-07-07 Kenichi Handa <handa@m17n.org>
12053
12054 * character.h (unicode_category_t): New enum type.
12055
12056 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12057 (Qchar_code_property_table): New variable.
12058 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12059 (UNIPROP_COMPRESSED_FORM_P): New macros.
12060 (char_table_ascii): Uncompress the compressed values.
12061 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12062 Uncompress the compressed values.
12063 (sub_char_table_ref_and_range): Likewise.
12064 (char_table_ref_and_range): Uncompress the compressed values.
12065 (sub_char_table_set): New arg is_uniprop. Callers changed.
12066 Uncompress the compressed values.
12067 (sub_char_table_set_range): Args changed. Callers changed.
12068 (char_table_set_range): Adjuted for the above change.
12069 (map_sub_char_table): Delete args default_val and parent. Add arg
12070 top. Give decoded values to a Lisp function.
12071 (map_char_table): Adjust for the above change. Give decoded
12072 values to a Lisp function. Gcpro more variables.
12073 (uniprop_table_uncompress)
12074 (uniprop_decode_value_run_length): New functions.
12075 (uniprop_decoder, uniprop_decoder_count): New variables.
12076 (uniprop_get_decoder, uniprop_encode_value_character)
12077 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12078 New functions.
12079 (uniprop_encoder, uniprop_encoder_count): New variables.
12080 (uniprop_get_encoder, uniprop_table)
12081 (Funicode_property_table_internal, Fget_unicode_property_internal)
12082 (Fput_unicode_property_internal): New functions.
12083 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12084 Sunicode_property_table_internal, Sget_unicode_property_internal,
12085 and Sput_unicode_property_internal. Defvar_lisp
12086 char-code-property-alist.
12087
12088 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12089 Vunicode_category_table.
12090
12091 * font.c (font_range): Adjust for the change of
12092 Vunicode_category_table.
12093
12094 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12095
12096 * m/iris4d.h: Remove file, move contents ...
12097 * s/irix6-5.h: ... here.
12098
12099 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12100
12101 Remove unportable assumption about struct layout (Bug#8884).
12102 * alloc.c (mark_buffer):
12103 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12104 (clone_per_buffer_values): Don't assume that
12105 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12106 This isn't true in general, and it's particularly not true
12107 if Emacs is configured with --with-wide-int.
12108 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12109 New macros, used in the buffer.c change.
12110
12111 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12112
12113 * xsettings.c: Use both GConf and GSettings if both are available.
12114 (store_config_changed_event): Add comment.
12115 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12116 (store_tool_bar_style_changed): New functions.
12117 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12118 (struct xsettings): Move font inside HAVE_XFT.
12119 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12120 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12121 Move inside HAVE_XFT.
12122 (something_changed_gsettingsCB): Rename from something_changedCB.
12123 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12124 also.
12125 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12126 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12127 (something_changed_gconfCB): Rename from something_changedCB.
12128 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12129 (parse_settings): Move check for font inside HAVE_XFT.
12130 (read_settings, apply_xft_settings): Add comment.
12131 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12132 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12133 call store_font_name_changed.
12134 (xft_settings_event): Add comment.
12135 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12136 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12137 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12138 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12139 (xsettings_initialize): Call init_gsettings last.
12140 (xsettings_get_system_font, xsettings_get_system_normal_font):
12141 Add comment.
12142
12143 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12144
12145 Random fixes. E.g., (random) never returned negative values.
12146 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12147 subseconds part to the entropy, as that's a bit more random.
12148 Prefer signed to unsigned, since the signedness doesn't matter and
12149 in general we prefer signed. When given a limit, use a
12150 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12151 latter isn't right if USE_2_TAGS_FOR_INTS.
12152 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12153 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12154
12155 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12156
12157 * textprop.c (text_property_stickiness):
12158 Obey Vtext_property_default_nonsticky.
12159 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12160 * w32fns.c (syms_of_w32fns):
12161 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12162
12163 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12164
12165 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12166 This is more efficient than Ffile_directory_p and avoids a minor race.
12167
12168 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12169
12170 * buffer.c (Foverlay_put): Say what the return value is
12171 (bug#7835).
12172
12173 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12174 is a directory before asking whether to use the file name
12175 (bug#7564).
12176 (barf_or_query_if_file_exists): Make the "File is a directory"
12177 error be more correct.
12178
12179 * fns.c (Frequire): Remove the mention of the .gz files, since
12180 that's installation-specific, but keep the mention of
12181 `get-load-suffixes'.
12182
12183 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12184
12185 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12186 Report string overflow if the output is too long.
12187
12188 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12189
12190 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12191 (syms_of_gnutls): Remove duplicate DEFSYM for
12192 Qgnutls_bootprop_verify_hostname_error, an error for
12193 Qgnutls_bootprop_verify_error (which is no longer used).
12194
12195 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12196 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12197 Also (re)move comments that are misplaced or no longer relevant.
12198
12199 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12200
12201 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12202
12203 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12204
12205 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12206 and background color parameters if they have been changed.
12207
12208 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12209
12210 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12211
12212 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12213
12214 * xsettings.c (SYSTEM_FONT): Define only when used.
12215 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12216
12217 * keymap.c (access_keymap_1): Now static.
12218
12219 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12220
12221 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12222 leave any prefix arg for the up event (Bug#1586).
12223
12224 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12225
12226 * lread.c (syms_of_lread): Mention single symbols defined by
12227 `defvar' or `defconst' (bug#7154).
12228
12229 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12230 (Frequire): Mention get-load-suffixes.
12231
12232 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12233
12234 * window.h (window): Remove clone_number slot.
12235 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12236 Remove.
12237 (make_parent_window, make_window, saved_window)
12238 (Fset_window_configuration, save_window_save): Don't deal with
12239 clone numbers.
12240 * buffer.c (Qclone_number): Remove declaration.
12241 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12242
12243 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12244
12245 Add multiple inheritance to keymaps.
12246 * keymap.c (Fmake_composed_keymap): New function.
12247 (Fset_keymap_parent): Simplify.
12248 (fix_submap_inheritance): Remove.
12249 (access_keymap_1): New function extracted from access_keymap to handle
12250 embedded parents and handle lists of maps.
12251 (access_keymap): Use it.
12252 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12253 (Fcopy_keymap): Handle embedded parents.
12254 (Fcommand_remapping, define_as_prefix): Simplify.
12255 (Fkey_binding): Simplify.
12256 (syms_of_keymap): Move minibuffer-local-completion-map,
12257 minibuffer-local-filename-completion-map,
12258 minibuffer-local-must-match-map, and
12259 minibuffer-local-filename-must-match-map to Elisp.
12260 (syms_of_keymap): Defsubr make-composed-keymap.
12261 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12262 (parse_menu_item): Trivial simplification.
12263
12264 2011-07-01 Glenn Morris <rgm@gnu.org>
12265
12266 * Makefile.in (SETTINGS_LIBS): Fix typo.
12267
12268 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12269
12270 * coding.c (Fencode_coding_string): Record the last coding system
12271 used, as the function doc string says (bug#8738).
12272
12273 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12274
12275 * xsettings.c (store_monospaced_changed): Take new font as arg and
12276 check for change against current_mono_font.
12277 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12278 (emacs_settings_constructor, emacs_settings_get_property)
12279 (emacs_settings_set_property, emacs_settings_class_init)
12280 (emacs_settings_init, gsettings_obj): Remove.
12281 (something_changedCB): New function for HAVE_GSETTINGS.
12282 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12283 with value as argument.
12284 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12285 g_settings_new (Bug#8967). Do not create gsettings_obj.
12286 Remove calls to g_settings_bind. Connect something_changedCB to
12287 "changed".
12288
12289 * xgselect.c: Add defined (HAVE_GSETTINGS).
12290 (xgselect_initialize): Ditto.
12291
12292 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12293 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12294 xg_select.
12295
12296 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12297
12298 * eval.c (struct backtrace): Simplify and port the data structure.
12299 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12300 signed bit field, as this assumption is not portable and it makes
12301 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12302 "char debug_on_exit : 1" as this is not portable either; instead,
12303 use the portable "unsigned int debug_on_exit : 1". Remove unused
12304 member evalargs. Remove obsolete comments about cc bombing out.
12305
12306 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12307
12308 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12309 Let HAVE_GSETTINGS override HAVE_GCONF.
12310 (store_monospaced_changed): New function.
12311 (EMACS_SETTINGS): A new type derived from GObject to handle
12312 GSettings notifications.
12313 (emacs_settings_constructor, emacs_settings_get_property)
12314 (emacs_settings_set_property, emacs_settings_class_init):
12315 New functions.
12316 (gsettings_client, gsettings_obj): New variables.
12317 (GSETTINGS_SCHEMA): New define.
12318 (something_changedCB): Call store_monospaced_changed.
12319 (init_gsettings): New function.
12320 (xsettings_initialize): Call init_gsettings.
12321 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12322 to NULL.
12323
12324 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12325 GCONF_CFLAGS/LIBS.
12326
12327 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12328
12329 * window.c (resize_root_window, grow_mini_window)
12330 (shrink_mini_window): Rename Qresize_root_window to
12331 Qwindow_resize_root_window and Qresize_root_window_vertically to
12332 Qwindow_resize_root_window_vertically.
12333
12334 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12335
12336 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12337
12338 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12339
12340 * makefile.w32-in: Redesign dependencies so they reflect more
12341 clearly which files are directly included by each source file,
12342 and not through other includes.
12343
12344 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12345
12346 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12347 (sort_overlays, overlay_strings): When an overlay's clone number
12348 matches the window's clone number process the overlay even if
12349 the overlay's window property doesn't match the current window.
12350
12351 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12352 (Fwindow_hchild): Rename to Fwindow_left_child.
12353 (Fwindow_next): Rename to Fwindow_next_sibling.
12354 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12355 (resize_window_check): Rename to window_resize_check.
12356 (resize_window_apply): Rename to window_resize_apply.
12357 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12358 (Fdelete_other_windows_internal, resize_frame_windows)
12359 (Fsplit_window_internal, Fdelete_window_internal)
12360 (grow_mini_window, shrink_mini_window)
12361 (Fresize_mini_window_internal): Fix callers accordingly.
12362
12363 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12364
12365 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12366 (emacs_fixed_set_min_size): Remove.
12367 (emacs_fixed_new): Take frame as argument.
12368
12369 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12370 (_EmacsFixedPrivate): Remove minwidth/height.
12371 Add struct frame *f.
12372 (emacs_fixed_init): Initialize priv->f.
12373 (get_parent_class, emacs_fixed_set_min_size): Remove.
12374 (emacs_fixed_new): Set priv->f to argument.
12375 (emacs_fixed_get_preferred_width)
12376 (emacs_fixed_get_preferred_height): Use min_width/height from
12377 frames size_hint to set minimum and natural (Bug#8919).
12378 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12379 and use min_width/height from frames size_hint to set
12380 min_width/height (Bug#8919).
12381
12382 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12383 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12384 Fix indentation.
12385
12386 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12387
12388 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12389 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12390 called at ZV.
12391
12392 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12393
12394 * process.c (wait_reading_process_output): Bypass select if
12395 waiting for a cell while ignoring keyboard input, and input is
12396 pending. Suggested by Jan Djärv (Bug#8869).
12397
12398 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12399
12400 Use gnulib's dup2 module instead of rolling our own.
12401 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12402
12403 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12404
12405 * dispnew.c (scrolling_window): Before scrolling, turn off a
12406 mouse-highlight in the window being scrolled.
12407
12408 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12409
12410 Move DEFSYM to lisp.h and use everywhere.
12411
12412 * character.h (DEFSYM): Move declaration...
12413 * lisp.h (DEFSYM): ...here.
12414
12415 * gnutls.c:
12416 * minibuf.c:
12417 * w32menu.c:
12418 * w32proc.c:
12419 * w32select.c: Don't include character.h.
12420
12421 * alloc.c (syms_of_alloc):
12422 * buffer.c (syms_of_buffer):
12423 * bytecode.c (syms_of_bytecode):
12424 * callint.c (syms_of_callint):
12425 * casefiddle.c (syms_of_casefiddle):
12426 * casetab.c (init_casetab_once):
12427 * category.c (init_category_once, syms_of_category):
12428 * ccl.c (syms_of_ccl):
12429 * cmds.c (syms_of_cmds):
12430 * composite.c (syms_of_composite):
12431 * dbusbind.c (syms_of_dbusbind):
12432 * dired.c (syms_of_dired):
12433 * dispnew.c (syms_of_display):
12434 * doc.c (syms_of_doc):
12435 * editfns.c (syms_of_editfns):
12436 * emacs.c (syms_of_emacs):
12437 * eval.c (syms_of_eval):
12438 * fileio.c (syms_of_fileio):
12439 * fns.c (syms_of_fns):
12440 * frame.c (syms_of_frame):
12441 * fringe.c (syms_of_fringe):
12442 * insdel.c (syms_of_insdel):
12443 * keymap.c (syms_of_keymap):
12444 * lread.c (init_obarray, syms_of_lread):
12445 * macros.c (syms_of_macros):
12446 * msdos.c (syms_of_msdos):
12447 * print.c (syms_of_print):
12448 * process.c (syms_of_process):
12449 * search.c (syms_of_search):
12450 * sound.c (syms_of_sound):
12451 * syntax.c (init_syntax_once, syms_of_syntax):
12452 * terminal.c (syms_of_terminal):
12453 * textprop.c (syms_of_textprop):
12454 * undo.c (syms_of_undo):
12455 * w32.c (globals_of_w32):
12456 * window.c (syms_of_window):
12457 * xdisp.c (syms_of_xdisp):
12458 * xfaces.c (syms_of_xfaces):
12459 * xfns.c (syms_of_xfns):
12460 * xmenu.c (syms_of_xmenu):
12461 * xsettings.c (syms_of_xsettings):
12462 * xterm.c (syms_of_xterm): Use DEFSYM.
12463
12464 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12465
12466 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12467
12468 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12469
12470 Integer and buffer overflow fixes (Bug#8873).
12471
12472 * print.c (printchar, strout): Check for string overflow.
12473 (PRINTPREPARE, printchar, strout):
12474 Don't set size unless allocation succeeds.
12475
12476 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12477 for sizes. Check for string overflow more accurately.
12478 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12479
12480 * macros.c: Integer and buffer overflow fixes.
12481 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12482 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12483 Use ptrdiff_t, not int, for sizes.
12484 Don't increment bufsize until after realloc succeeds.
12485 Check for size-calculation overflow.
12486 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12487
12488 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12489
12490 * lread.c: Integer overflow fixes.
12491 (read_integer): Radix is now EMACS_INT, not int,
12492 to improve quality of diagnostics for out-of-range radices.
12493 Calculate buffer size correctly for out-of-range radices.
12494 (read1): Check for integer overflow in radices, and in
12495 read-circle numbers.
12496 (read_escape): Avoid int overflow.
12497 (Fload, openp, read_buffer_size, read1)
12498 (substitute_object_recurse, read_vector, read_list, map_obarray):
12499 Use ptrdiff_t, not int, for sizes.
12500 (read1): Use EMACS_INT, not int, for sizes.
12501 Check for size overflow.
12502
12503 * image.c (cache_image): Check for size arithmetic overflow.
12504
12505 * lread.c: Integer overflow issues.
12506 (saved_doc_string_size, saved_doc_string_length)
12507 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12508 Now ptrdiff_t, not int.
12509 (read1): Don't assume doc string length fits in int. Check for
12510 out-of-range doc string lengths.
12511 (read_list): Don't assume file position fits in int.
12512 (read_escape): Check for hex character overflow.
12513
12514 2011-06-22 Leo Liu <sdl.web@gmail.com>
12515
12516 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12517 Move to minibuffer.el.
12518
12519 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12520
12521 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12522 The following patches are for when GLYPH_DEBUG && !XASSERT.
12523 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12524 * dispnew.c (flush_stdout):
12525 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12526 Mark as externally visible.
12527 * dispnew.c (check_window_matrix_pointers): Now static.
12528 * dispnew.c (window_to_frame_vpos):
12529 * xfns.c (unwind_create_frame):
12530 * xterm.c (x_check_font): Remove unused local.
12531 * scroll.c (CHECK_BOUNDS):
12532 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12533 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12534 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12535 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12536 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12537 Now static.
12538 (debug_method_add): Use va_list and vsprintf rather than relying
12539 on undefined behavior with wrong number of arguments.
12540 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12541 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12542 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12543 since we're not interested in debugging glyphs with old libraries.
12544 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12545 GCC 4.6.0's static checking.
12546
12547 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12548
12549 Integer overflow and signedness fixes (Bug#8873).
12550 A few related buffer overrun fixes, too.
12551
12552 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12553
12554 * dispextern.h (struct face.stipple):
12555 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12556 (x_bitmap_mask, x_allocate_bitmap_record)
12557 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12558 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12559 (x_create_bitmap_from_xpm_data):
12560 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12561 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12562 (.bitmaps_last):
12563 * xfaces.c (load_pixmap):
12564 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12565 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12566 (.bitmaps_last, struct x_output.icon_bitmap):
12567 Use ptrdiff_t, not int, for bitmap indexes.
12568 (x_allocate_bitmap_record): Check for size overflow.
12569 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12570
12571 Use ptrdiff_t, not int, for overlay counts.
12572 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12573 * editfns.c (overlays_around, get_pos_property):
12574 * textprop.c (get_char_property_and_overlay):
12575 * xdisp.c (next_overlay_change, note_mouse_highlight):
12576 * xfaces.c (face_at_buffer_position):
12577 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12578 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12579 (Fnext_overlay_change, Fprevious_overlay_change)
12580 (mouse_face_overlay_overlaps, Foverlays_in):
12581 Use ptrdiff_t, not int, for sizes.
12582 (overlays_at, overlays_in): Check for size-calculation overflow.
12583
12584 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12585
12586 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12587 (x_session_initialize): Do not assume string length fits in int.
12588
12589 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12590 This is unlikely, but can occur if DPI is outlandish.
12591
12592 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12593 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12594
12595 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12596 * xrdb.c (magic_file_p, search_magic_path):
12597 Omit last arg SUFFIX; it was always 0. All callers changed.
12598 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12599
12600 * xfont.c (xfont_match): Avoid need for strlen.
12601
12602 * xfns.c: Don't assume strlen fits in int.
12603 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12604
12605 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12606 not unsigned long, as we prefer signed integers. All callers changed.
12607 Detect integer overflow in repeat count.
12608 (message_dolog): Don't assume print length fits in 39 bytes.
12609 (display_mode_element): Don't assume strlen fits in int.
12610
12611 * termcap.c: Don't assume sizes fit in int and never overflow.
12612 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12613 (gobble_line): Check for size-calculation overflow.
12614
12615 * minibuf.c (Fread_buffer):
12616 * lread.c (intern, intern_c_string):
12617 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12618 Don't assume string length fits in int.
12619
12620 * keyboard.c (parse_tool_bar_item):
12621 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12622
12623 * font.c: Don't assume string length fits in int.
12624 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12625 Use ptrdiff_t, not int.
12626 (font_intern_prop): Don't assume string length fits in int.
12627 Don't assume integer property fits in fixnum.
12628 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12629
12630 * filelock.c: Fix some buffer overrun and integer overflow issues.
12631 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12632 Reformulate so as not to need the command string.
12633 Invoke gzip -cd rather than gunzip, as it's more portable.
12634 (lock_info_type, lock_file_1, lock_file):
12635 Don't assume pid_t and time_t fit in unsigned long.
12636 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12637 (current_lock_owner): Prefer signed type for sizes.
12638 Use memcpy, not strncpy, where memcpy is what is really wanted.
12639 Don't assume (via atoi) that time_t and pid_t fit in int.
12640 Check for time_t and/or pid_t out of range, e.g., via a network share.
12641 Don't alloca where an auto var works fine.
12642
12643 * fileio.c: Fix some integer overflow issues.
12644 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12645 Don't assume string length fits in int.
12646 (directory_file_name): Don't assume string length fits in long.
12647 (make_temp_name): Don't assume pid fits in int, or that its print
12648 length is less than 20.
12649
12650 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12651
12652 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12653
12654 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12655
12656 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12657 We prefer signed integers, even for size calculations.
12658
12659 * emacs.c: Don't assume string length fits in 'int'.
12660 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12661 (main): Don't invoke strlen when not needed.
12662
12663 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12664 (XD_DEBUG_MESSAGE): Don't waste a byte.
12665
12666 * callproc.c (getenv_internal_1, getenv_internal)
12667 (Fgetenv_internal):
12668 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12669
12670 * lread.c (invalid_syntax): Omit length argument.
12671 All uses changed. This doesn't fix a bug, but it simplifies the
12672 code away from its former Hollerith-constant appearance, and it's
12673 one less 'int' to worry about when looking at integer-overflow issues.
12674 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12675
12676 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12677 This didn't break anything, but it didn't help either.
12678 It's confusing to put a bogus integer in a place where the actual
12679 value does not matter.
12680 (LIST_END_P): Remove unused macro and its bogus comment.
12681 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12682
12683 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12684 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12685 implementation.
12686 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12687 We prefer signed types, and the value cannot exceed the EMACS_INT
12688 range anyway (because otherwise the length would not be representable).
12689 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12690 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12691 This avoids a GCC warning when WIDE_EMACS_INT.
12692
12693 * indent.c (sane_tab_width): New function.
12694 (current_column, scan_for_column, Findent_to, position_indentation)
12695 (compute_motion): Use it. This is just for clarity.
12696 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12697
12698 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12699
12700 * lisp.h (lint_assume): New macro.
12701 * composite.c (composition_gstring_put_cache):
12702 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12703
12704 * editfns.c, insdel.c:
12705 Omit unnecessary forward decls, to simplify future changes.
12706
12707 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12708
12709 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12710
12711 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12712 Use much-faster test for byte-length change.
12713 Don't assume string byte-length fits in 'int'.
12714 Check that character arg fits in 'int'.
12715 (mapcar1): Declare byte as byte, for clarity.
12716
12717 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12718
12719 * fns.c (concat): Catch string overflow earlier.
12720 Do not rely on integer wraparound.
12721
12722 * dispextern.h (struct it.overlay_strings_charpos)
12723 (struct it.selective): Now EMACS_INT, not int.
12724 * xdisp.c (forward_to_next_line_start)
12725 (back_to_previous_visible_line_start)
12726 (reseat_at_next_visible_line_start, next_element_from_buffer):
12727 Don't arbitrarily truncate the value of 'selective' to int.
12728
12729 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12730
12731 * composite.c: Don't truncate sizes to 'int'.
12732 (composition_gstring_p, composition_reseat_it)
12733 (composition_adjust_point): Use EMACS_INT, not int.
12734 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12735 not EMACS_UINT, for indexes.
12736
12737 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12738
12739 * buffer.c: Include <verify.h>.
12740 (struct sortvec.priority, struct sortstr.priority):
12741 Now EMACS_INT, not int.
12742 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12743 (struct sortstr.size, record_overlay_string)
12744 (struct sortstrlist.size, struct sortlist.used):
12745 Don't truncate size to int.
12746 (record_overlay_string): Check for size-calculation overflow.
12747 (init_buffer_once): Check at compile-time, not run-time.
12748
12749 2011-06-22 Jim Meyering <meyering@redhat.com>
12750
12751 Don't leak an XBM-image-sized buffer
12752 * image.c (xbm_load): Free the image buffer after using it.
12753
12754 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12755
12756 Port to Sun C.
12757 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12758 that Sun C diagnosed.
12759 * fns.c (secure_hash): Fix pointer signedness issue.
12760 * intervals.c (static_offset_intervals): New function.
12761 (offset_intervals): Use it.
12762
12763 2011-06-21 Leo Liu <sdl.web@gmail.com>
12764
12765 * deps.mk (fns.o):
12766 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12767 sha512.h.
12768
12769 * fns.c (secure_hash): Rename from crypto_hash_function and change
12770 the first arg to accept symbols.
12771 (Fsecure_hash): New primitive.
12772 (syms_of_fns): New symbols.
12773
12774 2011-06-20 Deniz Dogan <deniz@dogan.se>
12775
12776 * process.c (Fset_process_buffer): Clarify return value in
12777 docstring.
12778
12779 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12780
12781 * dispnew.c (add_window_display_history): Use BVAR.
12782
12783 * xdisp.c (debug_method_add): Use BVAR.
12784 (check_window_end, dump_glyph_matrix, dump_glyph)
12785 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12786
12787 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12788 Likewise.
12789
12790 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12791 check till after the cache is created in init_frame_faces.
12792
12793 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12794
12795 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12796
12797 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12798
12799 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12800 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12801 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12802
12803 Improve buffer-overflow checking (Bug#8873).
12804 * fileio.c (Finsert_file_contents):
12805 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12806 Remove the old (too-loose) buffer overflow checks.
12807 They weren't needed, since make_gap checks for buffer overflow.
12808 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12809 The old code merely checked for Emacs fixnum overflow, and relied
12810 on undefined (wraparound) behavior. The new code avoids undefined
12811 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12812
12813 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12814 Tune. Don't use wider integers than needed. Don't use alloca.
12815 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12816
12817 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12818
12819 * insdel.c, lisp.h (buffer_overflow): New function.
12820 (insert_from_buffer_1, replace_range, replace_range_2):
12821 * insdel.c (make_gap_larger):
12822 * editfns.c (Finsert_char):
12823 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12824
12825 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12826
12827 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12828
12829 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12830
12831 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12832 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12833
12834 * fileio.c: Don't assume EMACS_INT fits in off_t.
12835 (emacs_lseek): New static function.
12836 (Finsert_file_contents, Fwrite_region): Use it.
12837 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12838
12839 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12840
12841 * fns.c: Don't overflow int when computing a list length.
12842 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12843 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12844 truncation on 64-bit hosts. Check for QUIT every
12845 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12846 faster and is responsive enough.
12847 (Flength): Report an error instead of overflowing an integer.
12848 (Fsafe_length): Return a float if the value is not representable
12849 as a fixnum. This shouldn't happen except in contrived situations.
12850 (Fnthcdr, Fsort): Don't assume list length fits in int.
12851 (Fcopy_sequence): Don't assume vector length fits in int.
12852
12853 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12854 (header_size, word_size): New constants.
12855 (allocate_vectorlike): Don't check size overflow here.
12856 (allocate_vector): Check it here instead, since this is the only
12857 caller of allocate_vectorlike that could cause overflow.
12858 Check that the new vector's length is representable as a fixnum.
12859
12860 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12861 The previous code was bogus. For example, next_almost_prime (32)
12862 returned 39, which is undesirable as it is a multiple of 3; and
12863 next_almost_prime (24) returned 25, which is a multiple of 5 so
12864 why was the code bothering to check for multiples of 7?
12865
12866 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12867
12868 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12869
12870 Variadic C functions now count arguments with ptrdiff_t.
12871 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12872 Back then I didn't know that the Emacs coding style prefers signed int.
12873 Also, in the meantime I found a few more instances where arguments
12874 were being counted with int, which may truncate counts on 64-bit
12875 machines, or EMACS_INT, which may be unnecessarily wide.
12876 * lisp.h (struct Lisp_Subr.function.aMANY)
12877 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12878 Arg counts are now ptrdiff_t, not size_t.
12879 All variadic functions and their callers changed accordingly.
12880 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12881 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12882 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12883 * callint.c (Fcall_interactively): Check arg count for overflow,
12884 to avoid potential buffer overrun. Use signed char, not 'int',
12885 for 'varies' array, so that we needn't bother to check its size
12886 calculation for overflow.
12887 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12888 * eval.c (apply_lambda):
12889 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12890 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12891 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12892
12893 * callint.c (Fcall_interactively): Don't use index var as event count.
12894
12895 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12896 * mem-limits.h (SIZE): Remove; no longer used.
12897
12898 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12899
12900 Remove unnecessary casts.
12901 * xterm.c (x_term_init):
12902 * xfns.c (x_set_border_pixel):
12903 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12904 These aren't needed now that we assume ANSI C.
12905
12906 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12907 It's more likely to cause problems (due to unsigned overflow)
12908 than to cure them.
12909
12910 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12911
12912 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12913
12914 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12915
12916 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12917
12918 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12919
12920 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12921
12922 GLYPH_CODE_FACE returns EMACS_INT, not int.
12923 * dispextern.h (merge_faces):
12924 * xfaces.c (merge_faces):
12925 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12926 Don't assume EMACS_INT fits in int.
12927
12928 * character.h (CHAR_VALID_P): Remove unused parameter.
12929 * fontset.c, lisp.h, xdisp.c: All uses changed.
12930
12931 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12932
12933 * fns.c (concat): Minor tuning based on overflow analysis.
12934 This doesn't fix any bugs. Use int to hold character, instead
12935 of constantly refetching from Emacs object. Use XFASTINT, not
12936 XINT, for value known to be a character. Don't bother comparing
12937 a single byte to 0400, as it's always less.
12938
12939 * floatfns.c (Fexpt):
12940 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12941
12942 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12943 for characters.
12944
12945 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
12946
12947 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
12948 Without this fix, on a 64-bit host (aset S 0 4294967386) would
12949 incorrectly succeed when S was a string, because 4294967386 was
12950 truncated before it was used.
12951
12952 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
12953 Otherwise, an out-of-range integer could cause undefined behavior
12954 on a 64-bit host.
12955
12956 * composite.c: Use int, not EMACS_INT, for characters.
12957 (fill_gstring_body, composition_compute_stop_pos): Use int, not
12958 EMACS_INT, for values that are known to be in character range.
12959 This doesn't fix any bugs but is the usual style inside Emacs and
12960 may generate better code on 32-bit machines.
12961
12962 Make sure a 64-bit char is never passed to ENCODE_CHAR.
12963 This is for reasons similar to the recent CHAR_STRING fix.
12964 * charset.c (Fencode_char): Check that character arg is actually
12965 a character. Pass an int to ENCODE_CHAR.
12966 * charset.h (ENCODE_CHAR): Verify that the character argument is no
12967 wider than 'int', as a compile-time check to prevent future regressions
12968 in this area.
12969
12970 * character.c (char_string): Remove unnecessary casts.
12971
12972 Make sure a 64-bit char is never passed to CHAR_STRING.
12973 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
12974 by silently ignoring the top 32 bits, allowing some values
12975 that were far too large to be valid characters.
12976 * character.h: Include <verify.h>.
12977 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
12978 arguments are no wider than unsigned, as a compile-time check
12979 to prevent future regressions in this area.
12980 * data.c (Faset):
12981 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
12982 (Fsubst_char_in_region):
12983 * fns.c (concat):
12984 * xdisp.c (decode_mode_spec_coding):
12985 Adjust to CHAR_STRING's new requirement.
12986 * editfns.c (Finsert_char, Fsubst_char_in_region):
12987 * fns.c (concat): Check that character args are actually
12988 characters. Without this test, these functions did the wrong
12989 thing with wildly out-of-range values on 64-bit hosts.
12990
12991 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
12992 These casts should not be needed on 32-bit hosts, either.
12993 * keyboard.c (read_char):
12994 * lread.c (Fload): Remove casts to unsigned.
12995
12996 * lisp.h (UNSIGNED_CMP): New macro.
12997 This fixes comparison bugs on 64-bit hosts.
12998 (ASCII_CHAR_P): Use it.
12999 * casefiddle.c (casify_object):
13000 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13001 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13002 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13003 * dispextern.h (FACE_FROM_ID):
13004 * keyboard.c (read_char): Use UNSIGNED_CMP.
13005
13006 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13007 not to EMACS_INT, to avoid GCC warning.
13008
13009 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13010
13011 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13012 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13013 isn't needed on 32-bit machines.
13014
13015 * buffer.c (Fgenerate_new_buffer_name):
13016 Use EMACS_INT for count, not int.
13017 (advance_to_char_boundary): Return EMACS_INT, not int.
13018
13019 * data.c (Qcompiled_function): Now static.
13020
13021 * window.c (window_body_lines): Now static.
13022
13023 * image.c (gif_load): Rename local to avoid shadowing.
13024
13025 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13026 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13027 * alloc.c (make_save_value): Integer argument is now of type
13028 ptrdiff_t, not int.
13029 (mark_object): Use ptrdiff_t, not int.
13030 * lisp.h (pD): New macro.
13031 * print.c (print_object): Use it.
13032
13033 * alloc.c: Use EMACS_INT, not int, to count objects.
13034 (total_conses, total_markers, total_symbols, total_vector_size)
13035 (total_free_conses, total_free_markers, total_free_symbols)
13036 (total_free_floats, total_floats, total_free_intervals)
13037 (total_intervals, total_strings, total_free_strings):
13038 Now EMACS_INT, not int. All uses changed.
13039 (Fgarbage_collect): Compute overall total using a double, so that
13040 integer overflow is less likely to be a problem. Check for overflow
13041 when converting back to an integer.
13042 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13043 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13044 These were 'int' variables that could overflow on 64-bit hosts;
13045 they were never used, so remove them instead of repairing them.
13046 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13047 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13048 Previously, this ceilinged at INT_MAX, but that doesn't work on
13049 64-bit machines.
13050 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13051
13052 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13053 (allocate_vectorlike): Check for ptrdiff_t overflow.
13054 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13055 when a (possibly-narrower) signed value would do just as well.
13056 We prefer using signed arithmetic, to avoid comparison confusion.
13057
13058 * alloc.c: Catch some string size overflows that we were missing.
13059 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13060 for convenience in STRING_BYTES_MAX.
13061 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13062 The definition here is exact; the one in lisp.h was approximate.
13063 (allocate_string_data): Check for string overflow. This catches
13064 some instances we weren't catching before. Also, it catches
13065 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13066 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13067 and ptrdiff_t and EMACS_INT are both 64 bits.
13068
13069 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13070 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13071 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13072
13073 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13074
13075 * alloc.c (Fmake_string): Check for out-of-range init.
13076
13077 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13078
13079 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13080
13081 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13082
13083 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13084 xg_get_default_scrollbar_width.
13085
13086 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13087 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13088 (style_changed_cb): Call update_theme_scrollbar_width and call
13089 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13090 all frames (Bug#8505).
13091 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13092 Call gtk_window_set_resizable if HAVE_GTK3.
13093 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13094 and height if HAVE_GTK3 (Bug#8505).
13095 (scroll_bar_width_for_theme): New variable.
13096 (update_theme_scrollbar_width): New function.
13097 (xg_get_default_scrollbar_width): Move code to
13098 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13099 (xg_initialize): Call update_theme_scrollbar_width.
13100
13101 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13102
13103 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13104
13105 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13106
13107 * frame.c (make_frame): Call other_buffer_safely instead of
13108 other_buffer.
13109
13110 * window.c (temp_output_buffer_show): Call display_buffer with
13111 second argument Vtemp_buffer_show_specifiers and reset latter
13112 immediately after the call.
13113 (Vtemp_buffer_show_specifiers): New variable.
13114 (auto_window_vscroll_p, next_screen_context_lines)
13115 (Vscroll_preserve_screen_position): Remove leading asterisks from
13116 doc-strings.
13117
13118 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13119
13120 Fix minor problems found by GCC 4.6.0 static checking.
13121 * buffer.c (Qclone_number): Remove for now, as it's unused.
13122 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13123 (record_buffer): Remove unused local.
13124 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13125 (set_frame_buffer_list): Remove; unused.
13126 * frame.h (other_visible_frames): Remove decl.
13127 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13128 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13129 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13130 if HAVE_GPM.
13131 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13132 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13133 Define only if HAVE_GPM.
13134 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13135 (update_hints_inhibit): Remove; never set. All uses removed.
13136 * widgetprv.h (emacsFrameClassRec): Remove decl.
13137 * window.c (delete_deletable_window): Now returns void, since it
13138 wasn't returning anything.
13139 (compare_window_configurations): Remove unused locals.
13140 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13141 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13142 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13143 the same widths as pointers. This follows up on the 2011-05-06 patch.
13144 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13145 * xterm.h: Likewise.
13146 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13147
13148 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13149
13150 * makefile.w32-in: Update dependencies.
13151 (LISP_H): Add lib/intprops.h.
13152
13153 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13154
13155 * image.c (gif_load): Add animation frame delay to the metadata.
13156 (syms_of_image): Use DEFSYM. New symbol `delay'.
13157
13158 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13159
13160 * window.c (delete_deletable_window): Re-add.
13161 (Fset_window_configuration): Rewrite to handle dead buffers and
13162 consequently deletable windows.
13163 (window_tree, Fwindow_tree): Remove. Supply functionality in
13164 window.el.
13165 (compare_window_configurations): Simplify code.
13166
13167 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13168
13169 * image.c (imagemagick_load_image): Fix type mismatch.
13170 (Fimagemagick_types): Likewise.
13171
13172 * window.h (replace_buffer_in_windows): Declare.
13173
13174 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13175
13176 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13177 Qclone_number. Remove external declaration of Qdelete_window.
13178 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13179 code.
13180 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13181 Run Qbuffer_list_update_hook if allowed.
13182 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13183 buffer list implementation.
13184 (other_buffer_safely): New function.
13185 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13186 calls to replace_buffer_in_windows and
13187 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13188 if allowed.
13189 (record_buffer): Inhibit quitting and rewrite using quittable
13190 functions. Run Qbuffer_list_update_hook if allowed.
13191 (Frecord_buffer, Funrecord_buffer): New functions.
13192 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13193 Move switch-to-buffer to window.el.
13194 (bury-buffer): Move to window.el.
13195 (Vbuffer_list_update_hook): New variable.
13196
13197 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13198 section.
13199
13200 * window.h (resize_frame_windows): Move up in code.
13201 (Fwindow_frame): Remove EXFUN.
13202 (replace_buffer_in_all_windows): Remove prototype.
13203 (replace_buffer_in_windows_safely): Add prototype.
13204
13205 * window.c: Declare Qdelete_window static again. Move down
13206 declaration of select_count.
13207 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13208 (Fother_window): Move to window.el.
13209 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13210 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13211 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13212 window.el.
13213 (replace_buffer_in_windows): Implement by calling
13214 Qreplace_buffer_in_windows.
13215 (replace_buffer_in_all_windows): Remove with some functionality
13216 moved into replace_buffer_in_windows_safely.
13217 (replace_buffer_in_windows_safely): New function.
13218 (select_window_norecord, select_frame_norecord): Move in front
13219 of run_window_configuration_change_hook. Remove now obsolete
13220 declarations.
13221 (Fset_window_buffer): Rewrite doc-string.
13222 Call Qrecord_window_buffer.
13223 (keys_of_window): Move binding for other-window to window.el.
13224
13225 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13226
13227 * dispextern.h (struct image): Replace data member, whose int_val
13228 and ptr_val fields were not used by anything, with a single
13229 lisp_val object.
13230
13231 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13232 (gif_clear_image, gif_load, imagemagick_load_image)
13233 (gs_clear_image, gs_load): Callers changed.
13234
13235 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13236
13237 * buffer.h: Include <time.h>, for time_t.
13238 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13239
13240 Fix minor problems found by static checking.
13241
13242 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13243
13244 Make identifiers static if they are not used in other modules.
13245 * data.c (Qcompiled_function, Qframe, Qvector):
13246 * image.c (QimageMagick, Qsvg):
13247 * minibuf.c (Qmetadata):
13248 * window.c (resize_window_check, resize_root_window): Now static.
13249 * window.h (resize_window_check, resize_root_window): Remove decls.
13250
13251 * window.c (window_deletion_count, delete_deletable_window):
13252 Remove; unused.
13253 (window_body_lines): Now static.
13254 (Fdelete_other_windows_internal): Mark vars as initialized.
13255 Make sure 'resize_failed' is initialized.
13256 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13257 (resize_window_apply): Remove unused local.
13258 * window.h (delete_deletable_window): Remove decl.
13259
13260 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13261 (imagemagick_load_image): Fix pointer signedness problem by changing
13262 last arg from unsigned char * to char *. All uses changed.
13263 Also, fix a local for similar reasons.
13264 Remove unused locals. Remove locals to avoid shadowing.
13265 (fn_rsvg_handle_free): Remove; unused.
13266 (svg_load, svg_load_image): Fix pointer signedness problem.
13267 (imagemagick_load_image): Don't use garbage pointer image_wand.
13268
13269 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13270
13271 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13272
13273 * image.c (gif_load): Fix omitted cast error introduced by
13274 2011-06-06 change.
13275
13276 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13277
13278 * window.h (resize_proportionally, orig_total_lines)
13279 (orig_top_line): Remove from window structure.
13280 (set_window_height, set_window_width, change_window_heights)
13281 (Fdelete_window): Remove prototypes.
13282 (resize_frame_windows): Remove duplicate declaration.
13283
13284 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13285
13286 * window.h (resize_frame_windows, resize_window_check)
13287 (delete_deletable_window, resize_root_window)
13288 (resize_frame_windows): Declare prototypes.
13289
13290 * window.c (resize_window_apply): Make definition be "static" to
13291 match the prototype.
13292
13293 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13294
13295 * window.c: Remove declarations of Qwindow_size_fixed,
13296 window_min_size_1, window_min_size_2, window_min_size,
13297 size_window, window_fixed_size_p, enlarge_window, delete_window.
13298 Remove static from declaration of Qdelete_window, it's
13299 temporarily needed by Fbury_buffer.
13300 (replace_window): Don't assign orig_top_line and
13301 orig_total_lines.
13302 (Fdelete_window, delete_window): Remove. Window deletion is
13303 handled by window.el.
13304 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13305 Replace Fdelete_window calls with calls to Qdelete_window.
13306 (Fdelete_other_windows): Remove. Deleting other windows is
13307 handled by window.el.
13308 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13309 handled in window.el.
13310 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13311 Window minimum sizes are handled in window.el.
13312 (shrink_windows, size_window, set_window_height)
13313 (set_window_width, change_window_heights, window_height)
13314 (window_width, CURBEG, CURSIZE, enlarge_window)
13315 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13316 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13317 handled in window.el.
13318 (make_dummy_parent): Rename to make_parent_window and give it a
13319 second argument horflag.
13320 (make_window): Don't set resize_proportionally any more.
13321 (Fsplit_window): Remove. Windows are split in window.el.
13322 (save_restore_action, save_restore_orig_size)
13323 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13324 Resize mini windows in window.el.
13325 (grow_mini_window, shrink_mini_window): Implement by calling
13326 Qresize_root_window_vertically, resize_window_check and
13327 resize_window_apply.
13328 (saved_window, Fset_window_configuration, save_window_save):
13329 Do not handle orig_top_line, orig_total_lines, and
13330 resize_proportionally.
13331 (window_min_height, window_min_width): Move to window.el.
13332 (keys_of_window): Move bindings for delete-other-windows,
13333 split-window, delete-window and enlarge-window to window.el.
13334
13335 * buffer.c: Temporarily extern Qdelete_window.
13336 (Fbury_buffer): Temporarily call Qdelete_window instead of
13337 Fdelete_window (Fbury_buffer will move to window.el soon).
13338
13339 * frame.c (set_menu_bar_lines_1): Remove code handling
13340 orig_top_line and orig_total_lines.
13341
13342 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13343 set_window_height but set heights directly.
13344 (change_frame_size_1): Use resize_frame_windows.
13345
13346 * xdisp.c (init_xdisp): Don't use set_window_height but set
13347 heights directly.
13348
13349 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13350 Use resize_frame_windows instead of change_window_heights and run
13351 run_window_configuration_change_hook.
13352
13353 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13354 instead of change_window_heights and run
13355 run_window_configuration_change_hook.
13356
13357 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13358
13359 * window.c (replace_window): Rename second argument REPLACEMENT to
13360 NEW. New third argument SETFLAG. Rewrite.
13361 (delete_window, make_dummy_parent): Call replace_window with
13362 third argument 1.
13363 (window_list_1): Move down in code.
13364 (run_window_configuration_change_hook): Move set_buffer part
13365 before select_frame_norecord part in order to unwind correctly.
13366 Rename count1 to count.
13367 (recombine_windows, delete_deletable_window, resize_root_window)
13368 (Fdelete_other_windows_internal)
13369 (Frun_window_configuration_change_hook, make_parent_window)
13370 (resize_window_check, resize_window_apply, Fresize_window_apply)
13371 (resize_frame_windows, Fsplit_window_internal)
13372 (Fdelete_window_internal, Fresize_mini_window_internal):
13373 New functions.
13374 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13375
13376 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13377
13378 * window.h (window): Add some new members to window structure -
13379 normal_lines, normal_cols, new_total, new_normal, clone_number,
13380 splits, nest, prev_buffers, next_buffers.
13381 (WINDOW_TOTAL_SIZE): Move here from window.c.
13382 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13383
13384 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13385 Remove.
13386 (make_dummy_parent): Set new members of windows structure.
13387 (make_window): Move down in code. Handle new members of window
13388 structure.
13389 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13390 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13391 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13392 (Fset_window_prev_buffers, Fwindow_next_buffers)
13393 (Fset_window_next_buffers, Fset_window_clone_number):
13394 New functions.
13395 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13396 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13397 Doc-string fixes.
13398 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13399 Argument WINDOW can be now internal window too.
13400 (Fwindow_use_time): Move up in code.
13401 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13402 Rewrite doc-string.
13403 (Fset_window_configuration, saved_window)
13404 (Fcurrent_window_configuration, save_window_save): Handle new
13405 members of window structure.
13406 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13407 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13408 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13409 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13410 Qget_mru_window, Qresize_root_window,
13411 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13412 Qauto_buffer_name; staticpro them.
13413
13414 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13415
13416 * window.c (Fwindow_total_size, Fwindow_left_column)
13417 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13418 (Fwindow_list_1): New functions.
13419 (window_box_text_cols): Replace with window_body_cols.
13420 (Fwindow_width, Fscroll_left, Fscroll_right):
13421 Use window_body_cols instead of window_box_text_cols.
13422 (delete_window, Fset_window_configuration):
13423 Call delete_all_subwindows with window as argument.
13424 (delete_all_subwindows): Take a window as argument and not a
13425 structure. Rewrite.
13426 (window_loop): Remove handling of GET_LRU_WINDOW and
13427 GET_LARGEST_WINDOW.
13428 (Fget_lru_window, Fget_largest_window): Move to window.el.
13429
13430 * window.h: Extern window_body_cols instead of
13431 window_box_text_cols. delete_all_subwindows now takes a
13432 Lisp_Object as argument.
13433
13434 * indent.c (compute_motion, Fcompute_motion):
13435 Use window_body_cols instead of window_box_text_cols.
13436
13437 * frame.c (delete_frame): Call delete_all_subwindows with root
13438 window as argument.
13439
13440 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13441
13442 * fns.c (Fputhash): Document return value.
13443
13444 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13445
13446 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13447
13448 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13449
13450 Cons<->int and similar integer overflow fixes (Bug#8794).
13451
13452 Check for overflow when converting integer to cons and back.
13453 * charset.c (Fdefine_charset_internal, Fdecode_char):
13454 Use cons_to_unsigned to catch overflow.
13455 (Fencode_char): Use INTEGER_TO_CONS.
13456 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13457 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13458 * data.c (long_to_cons, cons_to_long): Remove.
13459 (cons_to_unsigned, cons_to_signed): New functions.
13460 These signal an error for invalid or out-of-range values.
13461 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13462 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13463 * font.c (Ffont_variation_glyphs):
13464 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13465 * lisp.h: Include <intprops.h>.
13466 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13467 (cons_to_signed, cons_to_unsigned): New decls.
13468 (long_to_cons, cons_to_long): Remove decls.
13469 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13470 (Fprimitive_undo): Use CONS_TO_INTEGER.
13471 * xfns.c (Fx_window_property): Likewise.
13472 * xselect.c: Include <limits.h>.
13473 (x_own_selection, selection_data_to_lisp_data):
13474 Use INTEGER_TO_CONS.
13475 (x_handle_selection_request, x_handle_selection_clear)
13476 (x_get_foreign_selection, Fx_disown_selection_internal)
13477 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13478 (lisp_data_to_selection_data): Use cons_to_unsigned.
13479 (x_fill_property_data): Use cons_to_signed.
13480 Report values out of range.
13481
13482 Check for buffer and string overflow more precisely.
13483 * buffer.h (BUF_BYTES_MAX): New macro.
13484 * lisp.h (STRING_BYTES_MAX): New macro.
13485 * alloc.c (Fmake_string):
13486 * character.c (string_escape_byte8):
13487 * coding.c (coding_alloc_by_realloc):
13488 * doprnt.c (doprnt):
13489 * editfns.c (Fformat):
13490 * eval.c (verror):
13491 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13492 since they may not be the same number.
13493 * editfns.c (Finsert_char):
13494 * fileio.c (Finsert_file_contents):
13495 Likewise for BUF_BYTES_MAX.
13496
13497 * image.c: Use ptrdiff_t, not int, for sizes.
13498 (slurp_file): Switch from int to ptrdiff_t.
13499 All uses changed.
13500 (slurp_file): Check that file size fits in both size_t (for
13501 malloc) and ptrdiff_t (for sanity and safety).
13502
13503 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13504 if b->modtime has its maximal value.
13505
13506 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13507
13508 Don't assume time_t can fit into int.
13509 * buffer.h (struct buffer.modtime): Now time_t, not int.
13510 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13511 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13512
13513 Minor fixes for signed vs unsigned integers.
13514 * character.h (MAYBE_UNIFY_CHAR):
13515 * charset.c (maybe_unify_char):
13516 * keyboard.c (read_char, reorder_modifiers):
13517 XINT -> XFASTINT, since the integer must be nonnegative.
13518 * ftfont.c (ftfont_spec_pattern):
13519 * keymap.c (access_keymap, silly_event_symbol_error):
13520 XUINT -> XFASTINT, since the integer must be nonnegative.
13521 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13522 since it makes no difference and we prefer signed.
13523 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13524 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13525 nonnegative.
13526
13527 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13528
13529 * window.h (Fwindow_frame): Declare.
13530
13531 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13532
13533 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13534 (SPARE_MEMORY): Always define.
13535 (LARGE_REQUEST): Remove.
13536 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13537
13538 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13539
13540 * lisp.h: Move EXFUNS for Fframe_root_window,
13541 Fframe_first_window and Fset_frame_selected_window to window.h.
13542
13543 * window.h: Move EXFUNS for Fframe_root_window,
13544 Fframe_first_window and Fset_frame_selected_window here from
13545 lisp.h.
13546
13547 * frame.c (Fwindow_frame, Fframe_first_window)
13548 (Fframe_root_window, Fframe_selected_window)
13549 (Fset_frame_selected_window): Move to window.c.
13550 (Factive_minibuffer_window): Move to minibuf.c.
13551 (Fother_visible_frames_p): New function.
13552
13553 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13554
13555 * window.c (decode_window, decode_any_window): Move up in code.
13556 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13557 (inhibit_frame_unsplittable): Remove unused variable.
13558 (Fwindow_buffer): Move up and rewrite doc-string.
13559 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13560 (Fwindow_prev): New functions.
13561 (Fwindow_frame): Move here from frame.c. Accept any window as
13562 argument.
13563 (Fframe_root_window, Fframe_first_window)
13564 (Fframe_selected_window): Move here from frame.c. Accept frame
13565 or arbitrary window as argument. Update doc-strings.
13566 (Fminibuffer_window): Move up in code.
13567 (Fwindow_minibuffer_p): Move up in code and simplify.
13568 (Fset_frame_selected_window): Move here from frame.c.
13569 Marginal rewrite.
13570 (Fselected_window, select_window, Fselect_window): Move up in
13571 code. Minor doc-string fixes.
13572
13573 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13574
13575 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13576 Do not assume that spare memory exists; that assumption is valid
13577 only if SYSTEM_MALLOC.
13578 (LARGE_REQUEST): New macro, so that the issue of large requests
13579 is separated from the issue of spare memory.
13580
13581 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13582
13583 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13584 format. (Bug#8806)
13585
13586 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13587
13588 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13589 before statements.
13590
13591 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13592
13593 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13594
13595 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13596
13597 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13598 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13599
13600 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13601
13602 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13603
13604 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13605
13606 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13607 (x_clipboard_manager_save): Add return value.
13608 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13609 New error handlers.
13610 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13611 Obey Vx_select_enable_clipboard_manager. Catch errors in
13612 x_clipboard_manager_save (Bug#8779).
13613 (Vx_select_enable_clipboard_manager): New variable.
13614 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13615
13616 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13617
13618 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13619
13620 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13621
13622 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13623 in the current matrix if keep_current_p is non-zero.
13624
13625 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13626
13627 * bidi.c (bidi_level_of_next_char): Fix last change.
13628
13629 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13630
13631 Support bidi reordering of text covered by display properties.
13632
13633 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13634 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13635 (bidi_cache_search, bidi_cache_iterator_state)
13636 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13637 (bidi_level_of_next_char, bidi_move_to_visually_next):
13638 Support character positions inside a run of characters covered by a
13639 display string.
13640 (bidi_paragraph_init, bidi_resolve_explicit_1)
13641 (bidi_level_of_next_char): Call bidi_fetch_char and
13642 bidi_fetch_char_advance instead of FETCH_CHAR and
13643 FETCH_CHAR_ADVANCE.
13644 (bidi_init_it): Initialize new members.
13645 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13646 definitions.
13647 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13648 instead of using explicit *_CHAR codes.
13649 (bidi_resolve_explicit, bidi_resolve_weak):
13650 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13651 bidirectional text is supported only in multibyte buffers.
13652 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13653 it to initialize the frame_window_p member of struct bidi_it.
13654 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13655 (bidi_resolve_explicit, bidi_resolve_weak)
13656 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13657 bidi_it->nchars is non-positive.
13658 (bidi_level_of_next_char): Don't try to lookup the cache for the
13659 next/previous character if nothing is cached there yet, or if we
13660 were just reseat()'ed to a new position.
13661
13662 * xdisp.c (set_cursor_from_row): Set start and stop points
13663 according to the row's direction when priming the loop that looks
13664 for the glyph on which to display cursor.
13665 (single_display_spec_intangible_p): Function deleted.
13666 (display_prop_intangible_p): Reimplement to call
13667 handle_display_spec instead of single_display_spec_intangible_p.
13668 Accept 3 additional arguments needed by handle_display_spec.
13669 This fixes incorrect cursor motion across display property with complex
13670 values: lists, `(when COND...)' forms, etc.
13671 (single_display_spec_string_p): Support property values that are
13672 lists with the argument STRING its top-level element.
13673 (display_prop_string_p): Fix the condition for processing a
13674 property that is a list to be consistent with handle_display_spec.
13675 (handle_display_spec): New function, refactored from the
13676 last portion of handle_display_prop.
13677 (compute_display_string_pos): Accept additional argument
13678 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13679 value of a `display' property is a "replacing spec".
13680 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13681 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13682 the display property, but just return a value indicating whether
13683 the display property will replace the characters it covers.
13684 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13685 frame_window_p members of struct bidi_it.
13686 (compute_display_string_pos, compute_display_string_end):
13687 New functions.
13688 (push_it): Accept second argument POSITION, where pop_it should
13689 jump to continue iteration.
13690 (reseat_1): Initialize bidi_it.disp_pos.
13691
13692 * keyboard.c (adjust_point_for_property): Adjust the call to
13693 display_prop_intangible_p to its new signature.
13694
13695 * dispextern.h (struct bidi_it): New member frame_window_p.
13696 (bidi_init_it): Update prototypes.
13697 (display_prop_intangible_p): Update prototype.
13698 (compute_display_string_pos, compute_display_string_end):
13699 Declare prototypes.
13700 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13701 EMACS_INT.
13702
13703 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13704
13705 Malloc failure behavior now depends on size of allocation.
13706 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13707 * lisp.h: Change signatures accordingly.
13708 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13709 All callers changed. (Bug#8762)
13710
13711 * gnutls.c: Use Emacs's memory allocators.
13712 Without this change, the gnutls library would invoke malloc etc.
13713 directly, which causes problems on non-SYNC_INPUT hosts, and which
13714 runs afoul of improving memory_full behavior. (Bug#8761)
13715 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13716 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13717 xfree instead of the default malloc, realloc, free.
13718 (Fgnutls_boot): No need to check for memory allocation failure,
13719 since xmalloc does that for us.
13720
13721 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13722 * category.c (hash_get_category_set):
13723 * ccl.c (ccl_driver):
13724 * charset.c (Fdefine_charset_internal):
13725 * charset.h (struct charset.hash_index):
13726 * composite.c (get_composition_id, gstring_lookup_cache)
13727 (composition_gstring_put_cache):
13728 * composite.h (struct composition.hash_index):
13729 * dispextern.h (struct image.hash):
13730 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13731 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13732 (hashfn_equal, hashfn_user_defined, make_hash_table)
13733 (maybe_resize_hash_table, hash_lookup, hash_put)
13734 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13735 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13736 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13737 * image.c (make_image, search_image_cache, lookup_image)
13738 (xpm_put_color_table_h):
13739 * lisp.h (struct Lisp_Hash_Table):
13740 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13741 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13742 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13743 * alloc.c (allocate_vectorlike):
13744 Check for overflow in vector size calculations.
13745 * ccl.c (ccl_driver):
13746 Check for overflow when converting EMACS_INT to int.
13747 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13748 need to be updated by these changes.
13749 * fns.c (make_hash_table, maybe_resize_hash_table):
13750 Check for integer overflow with large hash tables.
13751 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13752 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13753 (SXHASH_REDUCE): New macro.
13754 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13755 Use it instead of discarding useful hash info with large hash values.
13756 (sxhash_float): New function.
13757 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13758 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13759 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13760 Rewrite to use FIXNUM_BITS, as this simplifies things.
13761 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13762 Adjust signatures to match updated version of code.
13763 (consing_since_gc): Now EMACS_INT, since a single hash table can
13764 use more than INT_MAX bytes.
13765
13766 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13767
13768 Make it possible to build with GCC-4.6+ -O2 -flto.
13769
13770 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13771
13772 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13773
13774 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13775 Call minibuffer-inactive-mode.
13776
13777 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13778
13779 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13780 Update dependencies.
13781
13782 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13783
13784 * data.c (init_data): Remove code for UTS, this system is not
13785 supported anymore.
13786
13787 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13788
13789 Don't force ./temacs to start in terminal mode.
13790
13791 * frame.c (make_initial_frame): Initialize faces in all cases, not
13792 only when CANNOT_DUMP is defined.
13793 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13794
13795 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13796
13797 * dispnew.c (add_window_display_history): Use const for the string
13798 pointer. Remove declaration, not needed.
13799
13800 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13801
13802 Use 'inline', not 'INLINE'.
13803 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13804 * alloc.c, fontset.c (INLINE): Remove.
13805 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13806 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13807 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13808 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13809 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13810
13811 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13812
13813 Make it possible to run ./temacs.
13814
13815 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13816 syms_of_callproc does the same thing. Remove test for
13817 "initialized", do it in the caller.
13818 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13819
13820 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13821
13822 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13823 (read_minibuf): Use get_minibuffer.
13824 (syms_of_minibuf): Use DEFSYM.
13825 (Qmetadata): New var.
13826 * data.c (Qbuffer): Don't make it static.
13827 (syms_of_data): Use DEFSYM.
13828
13829 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13830
13831 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13832 (CCL_CODE_MIN): New macro.
13833
13834 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13835
13836 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13837
13838 * eval.c (Qdebug): Now static.
13839 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13840 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13841 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13842
13843 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13844
13845 * image.c: Various fixes to ImageMagick code comments.
13846 (Fimagemagick_types): Doc fix.
13847
13848 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13849
13850 Minor fixes prompted by GCC 4.6.0 warnings.
13851
13852 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13853
13854 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13855 (x_clipboard_manager_save_all): Move extern decl to ...
13856 * xterm.h: ... here, so that it can be checked for consistency.
13857
13858 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13859
13860 * xselect.c (x_clipboard_manager_save_frame)
13861 (x_clipboard_manager_save_all): New functions.
13862 (Fx_clipboard_manager_save): Lisp function deleted.
13863
13864 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13865 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13866
13867 * xterm.h: Update prototype.
13868
13869 2011-05-28 William Xu <william.xwl@gmail.com>
13870
13871 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13872 exiting (Bug#8239).
13873
13874 2011-05-28 Jim Meyering <meyering@redhat.com>
13875
13876 Avoid a sign-extension bug in crypto_hash_function.
13877 * fns.c (to_uchar): Define.
13878 (crypto_hash_function): Use it to convert some newly-signed
13879 variables to unsigned, to avoid sign-extension bugs. For example,
13880 without this change, (md5 "truc") would evaluate to
13881 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13882 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13883 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13884
13885 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13886
13887 Integer overflow fixes.
13888
13889 * dbusbind.c: Serial number integer overflow fixes.
13890 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13891 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13892 to hold a serial number that is too large for a fixnum.
13893 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13894 Check for serial numbers out of range. Decode any serial number
13895 that was so large that it became a float. (Bug#8722)
13896
13897 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13898 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13899 Use XFASTINT rather than XUINT when numbers are nonnegative.
13900 (xd_append_arg, Fdbus_method_return_internal):
13901 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13902 arguments, check that Lisp number is nonnegative, rather than
13903 silently wrapping negative numbers around. (Bug#8722)
13904 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13905 (Bug#8722)
13906
13907 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13908
13909 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13910
13911 ccl: Add integer overflow checks.
13912 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13913 (IN_INT_RANGE): New macros.
13914 (ccl_driver): Use them to check for integer overflow when
13915 decoding a CCL program. Many of the new checks are whether XINT (x)
13916 fits in int; it doesn't always, on 64-bit hosts. The new version
13917 doesn't catch all possible integer overflows, but it's an
13918 improvement. (Bug#8719)
13919
13920 * alloc.c (make_event_array): Use XINT, not XUINT.
13921 There's no need for unsigned here.
13922
13923 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13924 This follows up to the 2011-05-06 change that substituted uintptr_t
13925 for EMACS_INT. This case wasn't caught back then.
13926
13927 Rework Fformat to avoid integer overflow issues.
13928 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13929 now (part of C89). Include <verify.h>.
13930 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13931 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13932 (Fformat): Avoid the prepass trying to compute sizes; it was only
13933 approximate and thus did not catch overflow reliably. Instead, walk
13934 through the format just once, formatting and computing sizes as we go,
13935 checking for integer overflow at every step, and allocating a larger
13936 buffer as needed. Keep track separately whether the format is
13937 multibyte. Keep only the most-recently calculated precision, rather
13938 than them all. Record whether each argument has been converted to
13939 string. Use EMACS_INT, not int, for byte and char and arg counts.
13940 Support field widths and precisions larger than INT_MAX. Avoid
13941 sprintf's undefined behavior with conversion specifications such as %#d
13942 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13943 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13944 formatting out-of-range floating point numbers with int
13945 formats. (Bug#8668)
13946
13947 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
13948
13949 * data.c: Avoid integer truncation in expressions involving floats.
13950 * data.c: Include <intprops.h>.
13951 (arith_driver): When there's an integer overflow in an expression
13952 involving floating point, convert the integers to floating point
13953 so that the resulting value does not suffer from catastrophic
13954 integer truncation. For example, on a 64-bit host (* 4
13955 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
13956 Do not rely on undefined behavior after integer overflow.
13957
13958 merge count_size_as_multibyte, parse_str_to_multibyte
13959 * character.c, character.h (count_size_as_multibyte):
13960 Rename from parse_str_to_multibyte; all uses changed.
13961 Check for integer overflow.
13962 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
13963 since it's now a duplicate of the other. This is more of
13964 a character than a buffer op, so better that it's in character.c.
13965 * fns.c, print.c: Adjust to above changes.
13966
13967 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
13968
13969 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
13970
13971 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13972
13973 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13974 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
13975 (x_clipboard_manager_save): Now static.
13976 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
13977
13978 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
13979 (crypto_hash_function): Now static.
13980 Fix pointer signedness problems. Avoid unnecessary initializations.
13981
13982 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
13983
13984 * termhooks.h (Vselection_alist): Make it terminal-local.
13985
13986 * terminal.c (create_terminal): Initialize it.
13987
13988 * xselect.c: Support for clipboard managers.
13989 (Vselection_alist): Move to termhooks.h as terminal-local var.
13990 (LOCAL_SELECTION): New macro.
13991 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
13992 (symbol_to_x_atom): Remove gratuitous arg.
13993 (x_handle_selection_request, lisp_data_to_selection_data)
13994 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
13995 (x_own_selection, x_get_local_selection, x_convert_selection):
13996 New arg, specifying work frame. Use terminal-local Vselection_alist.
13997 (some_frame_on_display): Delete unused function.
13998 (Fx_own_selection_internal, Fx_get_selection_internal)
13999 (Fx_disown_selection_internal, Fx_selection_owner_p)
14000 (Fx_selection_exists_p): New optional frame arg.
14001 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14002 (x_handle_selection_clear): Don't treat other terminals with the
14003 same keyboard specially. Use the terminal-local Vselection_alist.
14004 (x_clear_frame_selections): Use Frun_hook_with_args.
14005
14006 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14007
14008 * xterm.h: Add support for those atoms.
14009
14010 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14011
14012 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14013 (converted_selections, conversion_fail_tag): New global variables.
14014 (x_selection_request_lisp_error): Free the above.
14015 (x_get_local_selection): Remove unnecessary code.
14016 (x_reply_selection_request): Args changed; handle arbitrary array
14017 of converted selections stored in converted_selections.
14018 Separate the XChangeProperty and SelectionNotify steps.
14019 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14020 (x_convert_selection): New function.
14021 (x_handle_selection_event): Simplify.
14022 (x_get_foreign_selection): Don't ignore incoming requests while
14023 waiting for an answer; this will fail when we implement
14024 SAVE_TARGETS, and seems unnecessary anyway.
14025 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14026 (Vx_sent_selection_functions): Doc fix.
14027
14028 2011-05-26 Leo Liu <sdl.web@gmail.com>
14029
14030 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14031
14032 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14033
14034 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14035
14036 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14037 for fringe update if it has periodic bitmap.
14038 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14039 and fringe_bitmap_periodic_p.
14040
14041 * fringe.c (get_fringe_bitmap_data): New function.
14042 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14043 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14044 row. Mark glyph row for fringe update if periodicity changed.
14045
14046 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14047 for fringe update unless it has periodic bitmap.
14048
14049 2011-05-25 Kenichi Handa <handa@m17n.org>
14050
14051 * xdisp.c (get_next_display_element): Set correct it->face_id for
14052 a static composition.
14053
14054 2011-05-24 Leo Liu <sdl.web@gmail.com>
14055
14056 * deps.mk (fns.o):
14057 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14058
14059 * fns.c (crypto_hash_function, Fsha1): New function.
14060 (Fmd5): Use crypto_hash_function.
14061 (syms_of_fns): Add Ssha1.
14062
14063 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14064
14065 * gnutls.c: Remove unused macros.
14066 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14067 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14068 Remove macros that are defined and never used.
14069 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14070
14071 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14072
14073 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14074 (Fx_get_selection_internal): Minor cleanup.
14075 (Fx_own_selection_internal): Rename arguments for consistency with
14076 select.el.
14077
14078 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14079
14080 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14081
14082 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14083
14084 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14085
14086 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14087
14088 * dispnew.c (scrolling_window): Don't exclude the case that the
14089 last enabled row in the desired matrix touches the bottom boundary.
14090
14091 2011-05-21 Glenn Morris <rgm@gnu.org>
14092
14093 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14094 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14095 and add some more files.
14096
14097 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14098
14099 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14100 report_file_error introduced by the change from 2011-05-07.
14101
14102 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14103
14104 * systime.h (Time): Define only if emacs is defined.
14105 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14106 where the include path doesn't have X11/X.h by default. See
14107 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14108
14109 2011-05-20 Kenichi Handa <handa@m17n.org>
14110
14111 * composite.c (find_automatic_composition): Fix previous change.
14112
14113 2011-05-20 Glenn Morris <rgm@gnu.org>
14114
14115 * lisp.mk: New file, split from Makefile.in.
14116 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14117 (shortlisp): Remove.
14118 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14119
14120 2011-05-19 Glenn Morris <rgm@gnu.org>
14121
14122 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14123 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14124 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14125 (lisp): Set the order to that of loadup.el.
14126 (shortlisp): Make it a copy of $lisp.
14127 (SOME_MACHINE_LISP): Remove.
14128 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14129 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14130
14131 2011-05-18 Kenichi Handa <handa@m17n.org>
14132
14133 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14134 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14135 (find_automatic_composition): Mostly rewrite for efficiency.
14136
14137 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14138
14139 * makefile.w32-in: Update dependencies.
14140
14141 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14142
14143 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14144 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14145
14146 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14147
14148 Fix some integer overflow issues, such as string length overflow.
14149
14150 * insdel.c (count_size_as_multibyte): Check for string overflow.
14151
14152 * character.c (lisp_string_width): Check for string overflow.
14153 Use EMACS_INT, not int, for string indexes and lengths; in
14154 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14155 the resulting string length overflows an EMACS_INT; instead,
14156 report a string overflow if no precision given. When checking for
14157 precision exhaustion, use a check that cannot possibly have
14158 integer overflow. (Bug#8675)
14159 * character.h (lisp_string_width): Adjust to new signature.
14160
14161 * alloc.c (string_overflow): New function.
14162 (Fmake_string): Use it. This doesn't change behavior, but saves
14163 a few bytes and will simplify future changes.
14164 * character.c (string_escape_byte8): Likewise.
14165 * lisp.h (string_overflow): New decl.
14166
14167 Fixups, following up to the user-interface timestamp change.
14168 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14169 for UI timestamps, instead of unsigned long.
14170 * msdos.c (mouse_get_pos): Likewise.
14171 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14172 * w32gui.h (Time): Define by including "systime.h" rather than by
14173 declaring it ourselves. (Bug#8664)
14174
14175 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14176 * image.c (clear_image_cache): Likewise.
14177
14178 * term.c (term_mouse_position): Don't assume time_t wraparound.
14179
14180 Be more systematic about user-interface timestamps.
14181 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14182 and sometimes 'EMACS_UINT', to represent these timestamps.
14183 This change causes it to use 'Time' uniformly, as that's what X uses.
14184 This makes the code easier to follow, and makes it easier to catch
14185 integer overflow bugs such as Bug#8664.
14186 * frame.c (Fmouse_position, Fmouse_pixel_position):
14187 Use Time, not unsigned long, for user-interface timestamps.
14188 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14189 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14190 * keyboard.h (last_event_timestamp): Likewise.
14191 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14192 * menu.h (xmenu_show): Likewise.
14193 * term.c (term_mouse_position): Likewise.
14194 * termhooks.h (struct input_event.timestamp): Likewise.
14195 (struct terminal.mouse_position_hook): Likewise.
14196 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14197 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14198 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14199 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14200 what it was before.
14201 * menu.h, termhooks.h: Include "systime.h", for Time.
14202
14203 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14204 Don't assume that the difference between two unsigned long values
14205 can fit into an integer. At this point, we know button_down_time
14206 <= event->timestamp, so the difference must be nonnegative, so
14207 there's no need to cast the result if double-click-time is
14208 nonnegative, as it should be; check that it's nonnegative, just in
14209 case. This bug is triggered when events are more than 2**31 ms
14210 apart (about 25 days). (Bug#8664)
14211
14212 * xselect.c (last_event_timestamp): Remove duplicate decl.
14213 (x_own_selection): Remove needless cast to unsigned long.
14214
14215 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14216 that always fit in int. Use a sentinel instead of a counter, to
14217 avoid a temp and to allay GCC's concerns about possible int overflow.
14218 * frame.h (struct frame): Use int for menu_bar_items_used
14219 instead of EMACS_INT, since it always fits in int.
14220
14221 * menu.c (grow_menu_items): Check for int overflow.
14222
14223 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14224
14225 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14226 Before, the code was not consistent. These values cannot exceed
14227 2**31 - 1 so there's no need to make them unsigned.
14228 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14229 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14230 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14231 as modifiers.
14232 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14233
14234 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14235 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14236 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14237 presumably because the widths might not match.
14238
14239 * window.c (size_window): Avoid needless test at loop start.
14240
14241 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14242
14243 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14244
14245 2011-05-12 Drew Adams <drew.adams@oracle.com>
14246
14247 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14248
14249 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14250
14251 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14252 `width' to `bar_area_x' and `bar_area_width', respectively.
14253 (x_scroll_run): Take account of fringe background extension.
14254
14255 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14256 Rename local vars `left' and `width' to `bar_area_x' and
14257 `bar_area_width', respectively.
14258 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14259 background extension.
14260
14261 2011-05-10 Jim Meyering <meyering@redhat.com>
14262
14263 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14264
14265 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14266
14267 * image.c (Finit_image_library): Return t for built-in image types,
14268 like pbm and xbm. (Bug#8640)
14269
14270 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14271
14272 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14273
14274 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14275
14276 * w32console.c (Fset_screen_color): Doc fix.
14277 (Fget_screen_color): New function.
14278 (syms_of_ntterm): Defsubr it.
14279
14280 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14281 unlink the temporary file if Fcall_process didn't create it in the
14282 first place.
14283 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14284 child process will be redirected to a file specified with `:file'.
14285 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14286 cue to call_process_cleanup not to close that handle.
14287
14288 2011-05-07 Ben Key <bkey76@gmail.com>
14289
14290 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14291 one of two shell specific rules, either bootstrap-temacs-CMD or
14292 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14293 to the previous implementation of the bootstrap-temacs rule.
14294 The bootstrap-temacs-CMD rule is similar to the previous
14295 implementation of the bootstrap-temacs rule except that it
14296 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14297 variable.
14298
14299 These changes, along with some changes to nt/configure.bat,
14300 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14301 earlier fix to add support for --cflags and --ldflags options
14302 that include quotes so that it works whether make uses cmd or
14303 sh as the shell.
14304
14305 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14306
14307 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14308 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14309 is a constant.
14310 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14311 a string. Handle both cases.
14312 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14313 (Fdbus_register_method): Use Qinvalid_function.
14314
14315 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14316
14317 * makefile.w32-in: Update dependencies.
14318 (LISP_H): Add inttypes.h and stdin.h.
14319 (PROCESS_H): Add unistd.h.
14320
14321 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14322
14323 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14324 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14325
14326 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14327
14328 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14329
14330 * term.c (vfatal): Remove stray call to va_end.
14331 It's not needed and the C Standard doesn't allow it here anyway.
14332
14333 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14334 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14335
14336 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14337 bytes.
14338
14339 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14340
14341 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14342
14343 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14344
14345 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14346
14347 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14348
14349 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14350 * charset.c (Fdefine_charset_internal): Don't initialize
14351 charset.code_space[15]. The value was garbage, on hosts with
14352 32-bit int (Bug#8600).
14353
14354 * lread.c (read_integer): Be more consistent with string-to-number.
14355 Use string_to_number to do the actual conversion; this avoids
14356 rounding errors and fixes some other screwups. Without this fix,
14357 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14358 (digit_to_number): Move earlier, for benefit of read_integer.
14359 Return -1 if the digit is out of range for the base, -2 if it is
14360 not a digit in any supported base. (Bug#8602)
14361
14362 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14363
14364 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14365 to match comment at start of function. This also removes a
14366 GCC warning about overflow in a 32+64-bit port.
14367
14368 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14369
14370 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14371 Reported by Stefan Monnier in
14372 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14373 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14374 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14375
14376 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14377 (EMACS_UINTPTR): Likewise, with uintptr_t.
14378
14379 * lisp.h: Prefer 64-bit EMACS_INT if available.
14380 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14381 on 32-bit hosts that have 64-bit int, so that they can access
14382 large files.
14383 However, temporarily disable this change unless the temporary
14384 symbol WIDE_EMACS_INT is defined.
14385
14386 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14387
14388 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14389 This removes an assumption that EMACS_INT and long are the same
14390 width as pointers. The assumption is true for Emacs porting targets
14391 now, but we want to make other targets possible.
14392 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14393 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14394 In the rest of the code, change types of integers that hold casted
14395 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14396 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14397 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14398 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14399 No need to cast type when ORing.
14400 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14401 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14402 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14403 assume EMACS_INT is the same width as char *.
14404 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14405 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14406 Remove no-longer-needed casts.
14407 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14408 (xg_tool_bar_help_callback, xg_make_tool_item):
14409 Use EMACS_INTPTR to hold an integer
14410 that will be cast to void *; this can avoid a GCC warning
14411 if EMACS_INT is not the same width as void *.
14412 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14413 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14414 (current_message_1, set_message_1):
14415 Use a local to convert to proper width without a cast.
14416 * xmenu.c (dialog_selection_callback): Likewise.
14417
14418 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14419 Also, don't assume VALBITS / RAND_BITS is less than 5,
14420 and don't rely on undefined behavior when shifting a 1 left into
14421 the sign bit.
14422 * lisp.h (get_random): Change signature to match.
14423
14424 * lread.c (hash_string): Use size_t, not int, for hash computation.
14425 Normally we prefer signed values; but hashing is special, because
14426 it's better to use unsigned division on hash table sizes so that
14427 the remainder is nonnegative. Also, size_t is the natural width
14428 for hashing into memory. The previous code used 'int', which doesn't
14429 retain enough info to hash well into very large tables.
14430 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14431
14432 * dbusbind.c: Don't possibly lose pointer info when converting.
14433 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14434 Use XPNTR rather than XHASH, so that the high-order bits of
14435 the pointer aren't lost when converting through void *.
14436
14437 * eval.c (Fautoload): Don't double-shift a pointer.
14438
14439 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14440
14441 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14442
14443 * gnutls.c (DEF_GNUTLS_FN):
14444 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14445
14446 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14447
14448 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14449 marker. (Bug#8610)
14450
14451 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14452
14453 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14454 New version that can reserve upto 2GB of heap space.
14455
14456 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14457
14458 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14459
14460 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14461
14462 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14463 `gnutls_certificate_set_x509_key_file'.
14464
14465 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14466
14467 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14468 Update dependencies.
14469
14470 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14471
14472 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14473 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14474 Remove unused parameter `fildes'.
14475 * process.c (read_process_output, send_process): Don't pass it.
14476
14477 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14478
14479 Fix previous change: the library cache is defined in w32.c.
14480 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14481 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14482
14483 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14484
14485 Implement dynamic loading of GnuTLS on Windows.
14486
14487 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14488 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14489 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14490 Declare.
14491
14492 * gnutls.c (Qgnutls_dll): Define.
14493 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14494 (gnutls_*): Declare function pointers.
14495 (init_gnutls_functions): New function to initialize function pointers.
14496 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14497 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14498 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14499 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14500 (emacs_gnutls_write, emacs_gnutls_read)
14501 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14502 (Fgnutls_available_p): New function.
14503 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14504 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14505 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14506
14507 * image.c: Include w32.h.
14508 (Vimage_type_cache): Delete.
14509 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14510 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14511 (w32_delayed_load): Move to w32.c.
14512
14513 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14514
14515 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14516 (w32_delayed_load): Move from image.c. When loading a library, record
14517 its filename in the :loaded-from property of the library id.
14518 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14519 Initialize and staticpro them.
14520 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14521
14522 * process.c: Include lisp.h before w32.h, not after.
14523 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14524 instead of gnutls_record_check_pending.
14525
14526 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14527
14528 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14529
14530 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14531 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14532 as passed in.
14533
14534 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14535
14536 * xterm.c (x_set_frame_alpha): Do not set property on anything
14537 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14538
14539 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14540
14541 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14542
14543 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14544
14545 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14546 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14547 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14548 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14549 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14550 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14551 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14552 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14553 (Qgnutls_bootprop_callbacks_verify): Make static.
14554
14555 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14556
14557 * callproc.c: Indentation fixup.
14558
14559 * sysdep.c (wait_for_termination_1): Make static.
14560 (wait_for_termination, interruptible_wait_for_termination):
14561 Move after wait_for_termination_1.
14562
14563 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14564
14565 * sysdep.c (interruptible_wait_for_termination): New function
14566 which is like wait_for_termination, but allows keyboard
14567 interruptions.
14568
14569 * callproc.c (Fcall_process): Add (:file "file") as an option for
14570 the STDOUT buffer.
14571 (Fcall_process_region): Ditto.
14572
14573 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14574
14575 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14576 rather than `XVECTOR (FOO)->size'.
14577
14578 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14579 inttypes.h, as a gnulib replacement is used if it not available in
14580 system headers.
14581
14582 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14583
14584 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14585 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14586 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14587
14588 * coding.c (coding_alloc_by_realloc): Error out if destination
14589 will grow beyond MOST_POSITIVE_FIXNUM.
14590 (decode_coding_emacs_mule): Abort if there isn't enough place in
14591 charbuf for the composition carryover bytes. Reserve an extra
14592 space for up to 2 characters produced in a loop.
14593 (decode_coding_iso_2022): Abort if there isn't enough place in
14594 charbuf for the composition carryover bytes.
14595
14596 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14597
14598 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14599 aborting when %lld or %lll format is passed.
14600 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14601 %llo or %llx format is passed. (Bug#8545)
14602
14603 * window.c (window_scroll_line_based): Use a marker instead of
14604 simple variables to record original value of point. (Bug#7952)
14605
14606 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14607 produced by %s or %c overflows available buffer space. (Bug#8545)
14608
14609 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14610
14611 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14612 (SIZE_MAX): Move defn after all includes, as they might #define it.
14613
14614 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14615
14616 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14617
14618 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14619
14620 * keyboard.c (Qdelayed_warnings_hook): Define.
14621 (command_loop_1): Run `delayed-warnings-hook'
14622 if Vdelayed_warnings_list is non-nil.
14623 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14624 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14625
14626 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14627
14628 * doprnt.c (doprnt): Don't return value smaller than the buffer
14629 size if the message was truncated. (Bug#8545).
14630
14631 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14632
14633 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14634 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14635
14636 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14637
14638 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14639
14640 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14641
14642 * makefile.w32-in: Update dependencies.
14643
14644 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14645
14646 Improve `doprnt' and its usage. (Bug#8545)
14647 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14648 `format_end'. Remove support for %l as a conversion specifier.
14649 Don't use xrealloc. Improve diagnostics when the %l size modifier
14650 is used. Update the commentary.
14651
14652 * eval.c (verror): Simplify calculation of size_t.
14653
14654 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14655 messages.
14656
14657 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14658
14659 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14660 change.
14661
14662 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14663
14664 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14665 This makes this file independent of the recent pseudovector change.
14666
14667 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14668
14669 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14670
14671 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14672 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14673 Remove unused local.
14674 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14675
14676 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14677 GCC 4.6.0 optimizes based on type-based alias analysis.
14678 For example, if b is of type struct buffer * and v of type struct
14679 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14680 != &v->size, and therefore "v->size = 1; b->size = 2; return
14681 v->size;" must therefore return 1. This assumption is incorrect
14682 for Emacs, since it type-puns struct Lisp_Vector * with many other
14683 types. To fix this problem, this patch adds a new type struct
14684 vectorlike_header that documents the constraints on layout of vectors
14685 and pseudovectors, and helps optimizing compilers not get fooled
14686 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14687 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14688 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14689 the size member.
14690 (XSETPVECTYPE): Rewrite in terms of new macro.
14691 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14692 This is a bit clearer, and further avoids the possibility of
14693 undesirable aliasing.
14694 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14695 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14696 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14697 since Lisp_Subr is a special case (no "next" field).
14698 (ASIZE): Now uses header.size rather than size.
14699 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14700 to avoid the hassle of writing XVECTOR (foo)->header.size.
14701 (struct vectorlike_header): New type.
14702 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14703 object, to help avoid aliasing.
14704 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14705 (SUBRP): Likewise, since Lisp_Subr is a special case.
14706 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14707 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14708 (struct Lisp_Hash_Table): Combine first two members into a single
14709 struct vectorlike_header member. All uses of "size" and "next" members
14710 changed to be "header.size" and "header.next".
14711 * buffer.h (struct buffer): Likewise.
14712 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14713 * frame.h (struct frame): Likewise.
14714 * process.h (struct Lisp_Process): Likewise.
14715 * termhooks.h (struct terminal): Likewise.
14716 * window.c (struct save_window_data, struct saved_window): Likewise.
14717 * window.h (struct window): Likewise.
14718 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14719 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14720 * buffer.c (init_buffer_once): Likewise.
14721 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14722 special case.
14723 * process.c (Fformat_network_address): Use local var for size,
14724 for brevity.
14725
14726 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14727
14728 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14729 * data.c (atof): Remove decl; no longer used or needed.
14730 (digit_to_number): Move to lread.c.
14731 (Fstring_to_number): Use new string_to_number function, to be
14732 consistent with how the Lisp reader treats infinities and NaNs.
14733 Do not assume that floating-point numbers represent EMACS_INT
14734 without losing information; this is not true on most 64-bit hosts.
14735 Avoid double-rounding errors, by insisting on integers when
14736 parsing non-base-10 numbers, as the documentation specifies.
14737 * lisp.h (string_to_number): New decl, replacing ...
14738 (isfloat_string): Remove.
14739 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14740 (read1): Do not accept +. and -. as integers; this
14741 appears to have been a coding error. Similarly, do not accept
14742 strings like +-1e0 as floating point numbers. Do not report
14743 overflow for integer overflows unless the base is not 10 which
14744 means we have no simple and reliable way to continue.
14745 Break out the floating-point parsing into a new
14746 function string_to_number, so that Fstring_to_number parses
14747 floating point numbers consistently with the Lisp reader.
14748 (digit_to_number): Move here from data.c. Make it static inline.
14749 (E_CHAR, EXP_INT): Remove, replacing with ...
14750 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14751 (string_to_number): New function, replacing isfloat_string.
14752 This function checks for valid syntax and produces the resulting
14753 Lisp float number too. Rework it so that string-to-number
14754 no longer mishandles examples like "1.0e+". Use strtoumax,
14755 so that overflow for non-base-10 numbers is reported only when
14756 there's no portable and simple way to convert to floating point.
14757
14758 * textprop.c (set_text_properties_1): Rewrite for clarity,
14759 and to avoid GCC warning about integer overflow.
14760
14761 * intervals.h (struct interval): Use EMACS_INT for members
14762 where EMACS_UINT might cause problems. See
14763 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14764 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14765 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14766 All uses changed.
14767 (offset_intervals): Tell GCC not to worry about length overflow
14768 when negating a negative length.
14769
14770 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14771 (overrun_check_free): Likewise.
14772
14773 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14774 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14775 word size.
14776
14777 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14778 (gnutls_make_error): Rename local to avoid shadowing.
14779 (gnutls_emacs_global_deinit): ifdef out; not used.
14780 (Fgnutls_boot): Use const for pointer to readonly storage.
14781 Comment out unused local. Fix pointer signedness problems.
14782
14783 * lread.c (openp): Don't stuff size_t into an 'int'.
14784 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14785 about possible signed overflow.
14786
14787 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14788 (GDK_KEY_g): Don't define if already defined.
14789 (xg_prepare_tooltip): Avoid pointer signedness problem.
14790 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14791
14792 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14793 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14794
14795 * xfns.c (Fx_window_property): Simplify a bit,
14796 to make a bit faster and to avoid GCC 4.6.0 warning.
14797 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14798
14799 * fns.c (internal_equal): Don't assume size_t fits in int.
14800
14801 * alloc.c (compact_small_strings): Tighten assertion a little.
14802
14803 Replace pEd with more-general pI, and fix some printf arg casts.
14804 * lisp.h (pI): New macro, generalizing old pEd macro to other
14805 conversion specifiers. For example, use "...%"pI"d..." rather
14806 than "...%"pEd"...".
14807 (pEd): Remove. All uses replaced with similar uses of pI.
14808 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14809 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14810 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14811 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14812 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14813 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14814 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14815 64-bit hosts.
14816 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14817 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14818 * print.c (safe_debug_print, print_object): Likewise.
14819 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14820 to int.
14821 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14822 avoiding the 0 flag, which is not portable.
14823 * process.c (Fmake_network_process): Use pI to avoid cast.
14824 * region-cache.c (pp_cache): Likewise.
14825 * xdisp.c (decode_mode_spec): Likewise.
14826 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14827 behavior on 64-bit hosts with printf arg.
14828 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14829 (x_stop_queuing_selection_requests): Likewise.
14830 (x_get_window_property): Don't truncate byte count to an 'int'
14831 when tracing.
14832
14833 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14834 here, since it parses constructs like leading '-' and spaces,
14835 which are not wanted; and it overflows with large numbers.
14836 Instead, simply match F[0-9]+, which is what is wanted anyway.
14837
14838 * alloc.c: Remove unportable assumptions about struct layout.
14839 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14840 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14841 (allocate_vectorlike, make_pure_vector): Use the new macros,
14842 plus offsetof, to remove unportable assumptions about struct layout.
14843 These assumptions hold on all porting targets that I know of, but
14844 they are not guaranteed, they're easy to remove, and removing them
14845 makes further changes easier.
14846
14847 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14848 This doesn't fix a bug but makes the code clearer.
14849 (string_overrun_cookie): Now const. Use initializers that
14850 don't formally overflow signed char, to avoid warnings.
14851 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14852 can cause Emacs to crash when string overrun checking is enabled.
14853 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14854 multiple of sizeof (EMACS_INT); it need not be, if
14855 alignof(EMACS_INT) < sizeof (EMACS_INT).
14856 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14857
14858 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14859
14860 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14861
14862 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14863
14864 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14865 supposed to be handshaking. (Bug#8556)
14866 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14867
14868 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14869
14870 * lisp.h (Qdebug): List symbol.
14871 * eval.c (Qdebug): Restore global linkage.
14872 * keyboard.c (debug-on-event): New variable.
14873 (handle_user_signal): Break into debugger when debug-on-event
14874 matches the current signal symbol.
14875
14876 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14877
14878 * alloc.c (check_sblock, check_string_bytes)
14879 (check_string_free_list): Convert to standard C.
14880
14881 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14882
14883 * w32.c (emacs_gnutls_push): Fix typo.
14884
14885 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14886
14887 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14888 "cast to pointer from integer of different size".
14889
14890 Improve doprnt and its use in verror. (Bug#8545)
14891 * doprnt.c (doprnt): Document the set of format control sequences
14892 supported by the function. Use SAFE_ALLOCA instead of always
14893 using `alloca'.
14894
14895 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14896 is one byte too soon. Don't use xrealloc; instead xfree and
14897 xmalloc anew.
14898
14899 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14900
14901 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14902 callbacks stage.
14903
14904 * gnutls.c: Renamed global_initialized to
14905 gnutls_global_initialized. Added internals for the
14906 :verify-hostname-error, :verify-error, and :verify-flags
14907 parameters of `gnutls-boot' and documented those parameters in the
14908 docstring. Start callback support.
14909 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14910 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14911 on error. Return error code.
14912 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14913 (emacs_gnutls_read): Likewise.
14914 (Fgnutls_boot): Return handshake error code.
14915 (emacs_gnutls_handle_error): New function.
14916 (wsaerror_to_errno): Likewise.
14917
14918 * w32.h (emacs_gnutls_pull): Add prototype.
14919 (emacs_gnutls_push): Likewise.
14920
14921 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14922 (emacs_gnutls_push): Likewise.
14923
14924 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14925
14926 * process.c (wait_reading_process_output): Check if GnuTLS
14927 buffered some data internally if no FDs are set for TLS
14928 connections.
14929
14930 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14931 (LIBS): Link to USER_LIBS.
14932 ($(BLD)/gnutls.$(0)): New target.
14933
14934 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14935
14936 * xdisp.c (handle_single_display_spec): Rename the
14937 display_replaced_before_p argument into display_replaced_p, to
14938 make it consistent with the commentary. Fix typos in the
14939 commentary.
14940
14941 * textprop.c (syms_of_textprop): Remove dead code.
14942 (copy_text_properties): Delete obsolete commentary about an
14943 interface that was deleted long ago. Fix typos in the description
14944 of arguments.
14945
14946 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
14947 to changes in oldXMenu/XMenu.h from 2011-04-16.
14948 <menu_help_message, prev_menu_help_message>: Constify.
14949 (IT_menu_make_room): menu->help_text is now `const char **';
14950 adjust.
14951
14952 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
14953 to changes in oldXMenu/XMenu.h from 2011-04-16.
14954 (struct XMenu): Declare `help_text' `const char **'.
14955
14956 * xfaces.c <Qunspecified>: Make extern again.
14957
14958 * syntax.c: Include sys/types.h before including regex.h, as
14959 required by POSIX.
14960
14961 * doc.c (get_doc_string): Improve the format passed to `error'.
14962
14963 * doprnt.c (doprnt): Improve commentary.
14964
14965 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
14966
14967 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
14968 them with etags.
14969
14970 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
14971 changes in globals.h immediately force recompilation.
14972 (TAGS): Depend on $(CURDIR)/m/intel386.h and
14973 $(CURDIR)/s/ms-w32.h.
14974 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
14975
14976 * character.c (Fchar_direction): Function deleted.
14977 (syms_of_character): Don't defsubr it.
14978 <char-direction-table>: Deleted.
14979
14980 2011-04-23 Eli Zaretskii <eliz@gnu.org>
14981
14982 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
14983 * doprnt.c: Include limits.h.
14984 (SIZE_MAX): New macro.
14985 (doprnt): Return a size_t value. 2nd arg is now size_t.
14986 Many local variables are now size_t instead of int or unsigned.
14987 Improve overflow protection. Support `l' modifier for integer
14988 conversions. Support %l conversion. Don't assume an EMACS_INT
14989 argument for integer conversions and for %c.
14990
14991 * lisp.h (doprnt): Restore prototype.
14992
14993 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
14994 $(SRC)/character.h.
14995
14996 * Makefile.in (base_obj): Add back doprnt.o.
14997
14998 * deps.mk (doprnt.o): Add back prerequisites.
14999 (callint.o): Depend on character.h.
15000
15001 * eval.c (internal_lisp_condition_case): Include the handler
15002 representation in the error message.
15003 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15004 when breaking from the loop.
15005
15006 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15007
15008 * callint.c (Fcall_interactively): When displaying error message
15009 about invalid control letter, pass the character's codepoint, not
15010 a pointer to its multibyte form. Improve display of the character
15011 in octal and display also its hex code.
15012
15013 * character.c (char_string): Use %x to display the (unsigned)
15014 codepoint of an invalid character, to avoid displaying a bogus
15015 negative value.
15016
15017 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15018 `error', not SYMBOL_NAME itself.
15019
15020 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15021 character arguments to `error'.
15022
15023 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15024 to `error' in error message about FINAL_CHAR argument. Make sure
15025 FINAL_CHAR is a character, and use %c when it is passed as
15026 argument to `error'.
15027
15028 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15029
15030 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15031
15032 * w32.c: Include <time.h>.
15033 (sys_localtime): New function.
15034
15035 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15036
15037 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15038
15039 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15040
15041 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15042
15043 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15044 zombies (Bug#8467).
15045
15046 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15047
15048 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15049 gl_state.e_property when gl_state.object is Qt.
15050
15051 * insdel.c (make_gap_larger): Remove limitation of buffer size
15052 to <= INT_MAX.
15053
15054 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15055
15056 * xdisp.c (lookup_glyphless_char_display)
15057 (produce_glyphless_glyph): Handle cons cell entry in
15058 glyphless-char-display.
15059 (Vglyphless_char_display): Document it.
15060
15061 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15062 glyphless-char-display.
15063
15064 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15065
15066 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15067
15068 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15069
15070 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15071 definition for no-X builds.
15072
15073 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15074
15075 Static checks with GCC 4.6.0 and non-default toolkits.
15076
15077 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15078
15079 * process.c (keyboard_bit_set): Define only if SIGIO.
15080 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15081 (send_process): Repair possible setjmp clobbering.
15082
15083 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15084
15085 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15086
15087 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15088
15089 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15090 Define only if needed.
15091
15092 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15093 by pacifying GCC about it. Maybe it's time to retire it?
15094 * xfaces.c (USG, __TIMEVAL__): Likewise.
15095
15096 * dispextern.h (struct redisplay_interface): Rename param
15097 to avoid shadowing.
15098 * termhooks.h (struct terminal): Likewise.
15099 * xterm.c (xembed_send_message): Likewise.
15100
15101 * insdel.c (make_gap_smaller): Define only if
15102 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15103
15104 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15105 it.
15106
15107 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15108 so that we aren't warned about unused symbols.
15109
15110 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15111
15112 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15113
15114 * xfns.c (x_real_positions): Mark locals as initialized.
15115
15116 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15117
15118 * xterm.c: Fix problems found by static analysis with other toolkits.
15119 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15120 (x_dispatch_event): Declare static if USE_GTK, and
15121 define if USE_GTK || USE_X_TOOLKIT.
15122 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15123 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15124 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15125 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15126
15127 * xmenu.c (menu_help_callback): Pointer type fixes.
15128 Use const pointers when pointing at readonly data. Avoid pointer
15129 signedness clashes.
15130 (FALSE): Remove unused macro.
15131 (update_frame_menubar): Remove unused decl.
15132
15133 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15134
15135 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15136 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15137 (single_menu_item): Rename local to avoid shadowing.
15138
15139 * keyboard.c (make_lispy_event): Remove unused local var.
15140
15141 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15142 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15143
15144 * bitmaps: Change bitmaps from unsigned char back to the X11
15145 compatible char. Avoid the old compiler warnings about
15146 out-of-range initializers by using, for example, '\xab' rather
15147 than 0xab.
15148
15149 * xgselect.c (xgselect_initialize): Check vs interface
15150 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15151
15152 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15153
15154 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15155 to read-only memory.
15156
15157 * fns.c (vector): Remove; this old hack is no longer needed.
15158
15159 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15160 Remove unused var.
15161 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15162
15163 * xrdb.c (x_load_resources): Omit unused local.
15164
15165 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15166 (x_window): Rename locals to avoid shadowing.
15167 (USG): Use the kludged USG macro, to pacify gcc.
15168
15169 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15170 (x_term_init): Remove local to avoid shadowing.
15171
15172 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15173
15174 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15175 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15176
15177 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15178
15179 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15180
15181 Fix regex.c, syntax.c and friends for buffers > 2GB.
15182 * syntax.h (struct gl_state_s): Declare character position members
15183 EMACS_INT.
15184
15185 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15186
15187 * textprop.c (verify_interval_modification, interval_of):
15188 Declare arguments EMACS_INT.
15189
15190 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15191 EMACS_INT.
15192
15193 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15194
15195 * indent.c (Fvertical_motion): Local variable it_start is now
15196 EMACS_INT.
15197
15198 * regex.c (re_match, re_match_2, re_match_2_internal)
15199 (bcmp_translate, regcomp, regexec, print_double_string)
15200 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15201 (re_compile_pattern, re_exec): Declare arguments and local
15202 variables `size_t' and `ssize_t' and return values `regoff_t', as
15203 appropriate.
15204 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15205 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15206 <compile_stack_type>: `size' and `avail' are now `size_t'.
15207
15208 * regex.h <regoff_t>: Use ssize_t, not int.
15209 (re_search, re_search_2, re_match, re_match_2): Arguments that
15210 specify buffer/string position and length are now ssize_t and
15211 size_t. Return type is regoff_t.
15212
15213 2011-04-16 Ben Key <bkey76@gmail.com>
15214
15215 * nsfont.m: Fixed bugs in ns_get_family and
15216 ns_descriptor_to_entity that were caused by using free to
15217 deallocate memory blocks that were allocated by xmalloc (via
15218 xstrdup). This caused Emacs to crash when compiled with
15219 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15220 --enable-checking=xmallocoverrun). xfree is now used to
15221 deallocate these memory blocks.
15222
15223 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15224
15225 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15226
15227 emacs_write: Accept and return EMACS_INT for sizes.
15228 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15229 et seq.
15230 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15231 Accept and return EMACS_INT.
15232 (emacs_gnutls_write): Return the number of bytes written on
15233 partial writes.
15234 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15235 (emacs_read, emacs_write): Remove check for negative size, as the
15236 Emacs source code has been audited now.
15237 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15238 (emacs_read, emacs_write): Use it.
15239 * process.c (send_process): Adjust to the new signatures of
15240 emacs_write and emacs_gnutls_write. Do not attempt to store
15241 a byte offset into an 'int'; it might overflow.
15242 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15243
15244 * sound.c: Don't assume sizes fit in 'int'.
15245 (struct sound_device.period_size, alsa_period_size):
15246 Return EMACS_INT, not int.
15247 (struct sound_device.write, vox_write, alsa_write):
15248 Accept EMACS_INT, not int.
15249 (wav_play, au_play): Use EMACS_INT to store sizes and to
15250 record read return values.
15251
15252 2011-04-15 Ben Key <bkey76@gmail.com>
15253
15254 * keyboard.c (Qundefined): Don't declare static since it is used
15255 in nsfns.m.
15256 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15257 static since they are used in nsfont.m.
15258
15259 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15260
15261 * process.c (Qprocessp): Don't declare static.
15262 * lisp.h (Qprocessp): Declare again.
15263
15264 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15265
15266 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15267
15268 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15269
15270 Improve C-level modularity by making more things 'static'.
15271
15272 Don't publish debugger-only interfaces to other modules.
15273 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15274 (verify_bytepos, count_markers): Move decls to the only modules
15275 that need them.
15276 * region-cache.h (pp_cache): Likewise.
15277 * window.h (check_all_windows): Likewise.
15278 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15279
15280 * sysdep.c (croak): Now static, if
15281 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15282 * syssignal.h (croak): Declare only if not static.
15283
15284 * alloc.c (refill_memory_reserve): Now static if
15285 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15286 * lisp.h (refill_memory_reserve): Declare only if not static.
15287
15288 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15289 Define only if USE_LUCID.
15290
15291 * xrdb.c (x_customization_string, x_rm_string): Now static.
15292
15293 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15294 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15295
15296 * xdisp.c (draw_row_with_mouse_face): Now static.
15297 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15298
15299 * window.h (check_all_windows): Mark externally visible.
15300
15301 * window.c (window_deletion_count): Now static.
15302
15303 * undo.c: Make symbols static if they're not exported.
15304 (last_undo_buffer, last_boundary_position, pending_boundary):
15305 Now static.
15306
15307 * textprop.c (interval_insert_behind_hooks): Now static.
15308 (interval_insert_in_front_hooks): Likewise.
15309
15310 * term.c: Make symbols static if they're not exported.
15311 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15312 (max_frame_lines, tty_set_terminal_modes):
15313 (tty_reset_terminal_modes, tty_turn_off_highlight):
15314 (get_tty_terminal): Now static.
15315 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15316 * termhooks.h (term_mouse_moveto): Do not declare if
15317 HAVE_WINDOW_SYSTEM.
15318 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15319 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15320
15321 * sysdep.c: Make symbols static if they're not exported.
15322 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15323 Now static.
15324 (sigprocmask_set, full_mask): Remove; unused.
15325 (wait_debugging): Mark as visible.
15326 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15327 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15328
15329 * syntax.c (syntax_temp): Define only if !__GNUC__.
15330
15331 * sound.c (current_sound_device, current_sound): Now static.
15332
15333 * search.c (searchbufs, searchbuf_head): Now static.
15334
15335 * scroll.c (scroll_cost): Remove; unused.
15336 * dispextern.h (scroll_cost): Remove decl.
15337
15338 * region-cache.h (pp_cache): Mark as externally visible.
15339
15340 * process.c: Make symbols static if they're not exported.
15341 (process_tick, update_tick, create_process, chan_process):
15342 (Vprocess_alist, proc_buffered_char, datagram_access):
15343 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15344 (deactivate_process): Mark defn as static, as well as decl.
15345 * lisp.h (create_process): Remove decl.
15346 * process.h (chan_process, Vprocess_alist): Remove decls.
15347
15348 * print.c: Make symbols static if they're not exported.
15349 (print_depth, new_backquote_output, being_printed, print_buffer):
15350 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15351 (print_interval, print_number_index, initial_stderr_stream):
15352 Now static.
15353 * lisp.h (Fprinc): Remove decl.
15354 (debug_output_compilation_hack): Mark as externally visible.
15355
15356 * sysdep.c (croak): Move decl from here to syssignal.h.
15357 * syssignal.h (croak): Put it here, so the API can be checked when
15358 'croak' is called from dissociate_if_controlling_tty.
15359
15360 * minibuf.c: Make symbols static if they're not exported.
15361 (minibuf_save_list, choose_minibuf_frame): Now static.
15362 * lisp.h (choose_minibuf_frame): Remove decl.
15363
15364 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15365
15366 * lread.c: Make symbols static if they're not exported.
15367 (read_objects, initial_obarray, oblookup_last_bucket_number):
15368 Now static.
15369 (make_symbol): Remove; unused.
15370 * lisp.h (initial_obarray, make_symbol): Remove decls.
15371
15372 * keyboard.c: Make symbols static if they're not exported.
15373 (single_kboard, recent_keys_index, total_keys, recent_keys):
15374 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15375 (this_single_command_key_start, echoing, last_auto_save):
15376 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15377 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15378 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15379 (Vlispy_mouse_stem, double_click_count):
15380 Now static.
15381 (force_auto_save_soon): Define only if SIGDANGER.
15382 (ignore_mouse_drag_p): Now static if
15383 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15384 (print_help): Remove; unused.
15385 (stop_character, last_timer_event): Mark as externally visible.
15386 * keyboard.h (ignore_mouse_drag_p): Declare only if
15387 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15388 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15389 * lisp.h (echoing): Remove decl.
15390 (force_auto_save_soon): Declare only if SIGDANGER.
15391 * xdisp.c (redisplay_window): Simplify code, to make it more
15392 obvious that ignore_mouse_drag_p is not accessed if !defined
15393 USE_GTK && !defined HAVE_NS.
15394
15395 * intervals.c: Make symbols static if they're not exported.
15396 (merge_properties_sticky, merge_interval_right, delete_interval):
15397 Now static.
15398 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15399
15400 * insdel.c: Make symbols static if they're not exported.
15401 However, leave prepare_to_modify_buffer alone. It's never
15402 called from outside this function, but that appears to be a bug.
15403 (combine_after_change_list, combine_after_change_buffer):
15404 (adjust_after_replace, signal_before_change): Now static.
15405 (adjust_after_replace_noundo): Remove; unused.
15406 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15407 (signal_before_change): Remove decls.
15408
15409 * indent.c (val_compute_motion, val_vmotion): Now static.
15410
15411 * image.c: Make symbols static if they're not exported.
15412 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15413 if USE_GTK.
15414 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15415 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15416
15417 * fringe.c (standard_bitmaps): Now static.
15418 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15419
15420 * frame.c: Make symbols static if they're not exported.
15421 (x_report_frame_params, make_terminal_frame): Now static.
15422 (get_frame_param): Now static, unless HAVE_NS.
15423 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15424 (x_get_resource_string): Remove; not used.
15425 * frame.h (make_terminal_frame, x_report_frame_params):
15426 (x_get_resource_string); Remove decls.
15427 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15428 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15429
15430 * font.c, fontset.c: Make symbols static if they're not exported.
15431 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15432 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15433 * font.c (font_close_object): Now static.
15434 * font.h (font_close_object): Remove.
15435 * fontset.c (FONTSET_OBJLIST): Remove.
15436 (free_realized_fontset) #if-0 the body, which does nothing.
15437 (face_suitable_for_char_p): #if-0, as it's never called.
15438 * fontset.h (face_suitable_for_char_p): Remove decl.
15439 * xfaces.c (face_at_string_position):
15440 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15441 since 0 is always ASCII.
15442
15443 * fns.c (weak_hash_tables): Now static.
15444
15445 * fileio.c: Make symbols static if they're not exported.
15446 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15447 (Vwrite_region_annotation_buffers): Now static.
15448
15449 * eval.c: Make symbols static if they're not exported.
15450 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15451 * lisp.h (backtrace_list): Remove decl.
15452
15453 * emacs.c: Make symbols static if they're not exported.
15454 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15455 (fatal_error_code, fatal_error_signal_hook, standard_args):
15456 Now static.
15457 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15458 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15459 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15460 * lisp.h (fatal_error_signal_hook): Remove decl.
15461 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15462
15463 * editfns.c: Move a (normally-unused) function to its only use.
15464 * editfns.c, lisp.h (get_operating_system_release): Remove.
15465 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15466 worth the hassle of breaking this out.
15467
15468 * xterm.c: Make symbols static if they're not exported.
15469 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15470 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15471 (x_destroy_window, x_delete_display):
15472 Now static.
15473 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15474 (x_mouse_leave): Remove; unused.
15475 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15476 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15477 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15478 Remove decls.
15479 (x_mouse_leave): Declare only if WINDOWSNT.
15480 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15481 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15482 USE_X_TOOLKIT.
15483
15484 * ftxfont.c: Make symbols static if they're not exported.
15485 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15486 HAVE_FREETYPE.
15487 * font.h (ftxfont_driver): Likewise.
15488
15489 * xfns.c: Make symbols static if they're not exported.
15490 (x_last_font_name, x_display_info_for_name):
15491 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15492 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15493 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15494 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15495 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15496 (last_show_tip_args): Now static.
15497 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15498 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15499 (x_screen_planes): Remove; unused.
15500 * dispextern.h (x_screen_planes): Remove decl.
15501
15502 * dispnew.c: Make symbols static if they're not exported.
15503 * dispextern.h (redraw_garbaged_frames, scrolling):
15504 (increment_row_positions): Remove.
15505 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15506 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15507 Now static.
15508 (redraw_garbaged_frames): Remove; unused.
15509
15510 * xfaces.c: Make symbols static if they're not exported.
15511 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15512 Remove decls.
15513 * xterm.h (defined_color): Remove decls.
15514 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15515 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15516 (menu_face_changed_default, defined_color, free_realized_face):
15517 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15518 (ascii_face_of_lisp_face): Remove; unused.
15519
15520 * xdisp.c: Make symbols static if they're not exported.
15521 * dispextern.h (scratch_glyph_row, window_box_edges):
15522 (glyph_to_pixel_coords, set_cursor_from_row):
15523 (get_next_display_element, set_iterator_to_next):
15524 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15525 (show_mouse_face): Remove decls
15526 * frame.h (message_buf_print): Likewise.
15527 * lisp.h (pop_message, set_message, check_point_in_composition):
15528 Likewise.
15529 * xterm.h (set_vertical_scroll_bar): Likewise.
15530 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15531 (message_buf_print, scratch_glyph_row, displayed_buffer):
15532 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15533 (get_next_display_element, show_mouse_face, window_box_edges):
15534 (frame_to_window_pixel_xy, check_point_in_composition):
15535 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15536 (glyph_to_pixel_coords): Remove; unused.
15537
15538 * dired.c (file_name_completion): Now static.
15539
15540 * dbusbind.c (xd_in_read_queued_messages): Now static.
15541
15542 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15543 * data.c (circular_list_error): Remove.
15544
15545 * commands.h (last_point_position, last_point_position_buffer):
15546 (last_point_position_window): Remove decls.
15547 * keyboard.c: Make these variables static.
15548
15549 * coding.h (coding, code_convert_region, encode_coding_gap):
15550 Remove decls.
15551 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15552 (iso_code_class, detect_coding, code_convert_region): Now static.
15553 (encode_coding_gap): Remove; unused.
15554
15555 * chartab.c (chartab_chars, chartab_bits): Now static.
15556
15557 * charset.h (charset_iso_8859_1): Remove decl.
15558 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15559 Now static.
15560
15561 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15562 * ccl.c (Vccl_program_table): Now static.
15563 (check_ccl_update): Remove; unused.
15564
15565 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15566 * category.h: ... from here.
15567 * category.c (check_category_table, set_category_set): Now static.
15568
15569 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15570 * lisp.h: Remove these decls.
15571
15572 * buffer.c (buffer_count): Remove unused var.
15573
15574 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15575 so that it's not optimized away.
15576 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15577 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15578 exported only to the debugger.
15579
15580 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15581 * atimer.h (run_all_atimers): Remove; not exported.
15582
15583 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15584 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15585 was inaccessible from Lisp.
15586 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15587 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15588
15589 alloc.c: Import and export fewer symbols, and remove unused items.
15590 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15591 is defined.
15592 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15593 it's not optimized away by whole-program optimization.
15594 (message_enable_multibyte, free_misc): Remove.
15595 (catchlist, handlerlist, mark_backtrace):
15596 Declare only if BYTE_MARK_STACK.
15597 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15598 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15599 (message_enable_multibyte): Remove decl.
15600 (free_misc, interval_free_list, float_block, float_block_index):
15601 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15602 (cons_free_list, last_marked_index):
15603 Now static.
15604 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15605 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15606 (mark_backtrace): Define only if BYTE_MARK_STACK.
15607 * xdisp.c (message_enable_multibyte): Now static.
15608
15609 Declare Lisp_Object Q* variables to be 'static' if not exported.
15610 This makes it easier for human readers (and static analyzers)
15611 to see whether these variables are used from other modules.
15612 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15613 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15614 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15615 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15616 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15617 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15618 * xmenu.c, xselect.c:
15619 Declare Q* vars static if they are not used in other modules.
15620 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15621 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15622 Remove decls of unexported vars.
15623 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15624
15625 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15626
15627 Make Emacs functions such as Fatom 'static' by default.
15628 This makes it easier for human readers (and static analyzers)
15629 to see whether these functions can be called from other modules.
15630 DEFUN now defines a static function. To make the function external
15631 so that it can be used in other C modules, use the new macro DEFUE.
15632 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15633 (Finit_image_library):
15634 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15635 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15636 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15637 Remove decls, since these functions are now static.
15638 (Funintern, Fget_internal_run_time): New decls, since these functions
15639 were already external.
15640
15641 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15642 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15643 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15644 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15645 * keyboard.c, keymap.c, lread.c:
15646 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15647 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15648 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15649 Mark functions with DEFUE instead of DEFUN,
15650 if they are used in other modules.
15651 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15652 decls for now-static functions.
15653 * buffer.h (Fdelete_overlay): Remove decl.
15654 * callproc.c (Fgetenv_internal): Mark as internal.
15655 * composite.c (Fremove_list_of_text_properties): Remove decl.
15656 (Fcomposition_get_gstring): New forward static decl.
15657 * composite.h (Fcomposite_get_gstring): Remove decl.
15658 * dired.c (Ffile_attributes): New forward static decl.
15659 * doc.c (Fdocumntation_property): New forward static decl.
15660 * eval.c (Ffetch_bytecode): New forward static decl.
15661 (Funintern): Remove extern decl; now in .h file where it belongs.
15662 * fileio.c (Fmake_symbolic_link): New forward static decl.
15663 * image.c (Finit_image_library): New forward static decl.
15664 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15665 * intervals.h (Fprevious_property_change):
15666 (Fremove_list_of_text_properties): Remove decls.
15667 * keyboard.c (Fthis_command_keys): Remove decl.
15668 (Fcommand_execute): New forward static decl.
15669 * keymap.c (Flookup_key): New forward static decl.
15670 (Fcopy_keymap): Now static.
15671 * keymap.h (Flookup_key): Remove decl.
15672 * process.c (Fget_process): New forward static decl.
15673 (Fprocess_datagram_address): Mark as internal.
15674 * syntax.c (Fsyntax_table_p): New forward static decl.
15675 (skip_chars): Remove duplicate decl.
15676 * textprop.c (Fprevious_property_change): New forward static decl.
15677 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15678 Now internal.
15679 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15680 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15681
15682 * editfns.c (Fformat): Remove unreachable code.
15683
15684 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15685
15686 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15687 change. (Bug#8496)
15688
15689 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15690
15691 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15692 when at ZV. (Bug#8487)
15693
15694 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15695
15696 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15697 (Bug#8437)
15698 * keyboard.c (parse_tool_bar_item): Likewise.
15699 * sound.c (sound_cleanup, alsa_close): Likewise.
15700 * termcap.c (tgetent): Likewise.
15701 * xfns.c (x_default_font_parameter): Likewise.
15702 * xsettings.c (read_and_apply_settings): Likewise.
15703
15704 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15705 (overrun_check_free): Protoize.
15706
15707 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15708
15709 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15710 since callers should never pass a negative size.
15711 Change the signature to match that of plain 'read' and 'write'; see
15712 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15713 * lisp.h: Update prototypes of emacs_write and emacs_read.
15714
15715 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15716
15717 * xdisp.c (redisplay_window): Don't try to determine the character
15718 position of the scroll margin if the window start point w->startp
15719 is outside the buffer's accessible region. (Bug#8468)
15720
15721 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15722
15723 Fix write-region and its subroutines for buffers > 2GB.
15724 * fileio.c (a_write, e_write): Modify declaration of arguments and
15725 local variables to support buffers larger than 2GB.
15726 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15727
15728 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15729 argument, local variables, and return value.
15730
15731 * lisp.h: Update prototypes of emacs_write and emacs_read.
15732
15733 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15734
15735 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15736
15737 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15738
15739 Fix more problems found by GCC 4.6.0's static checks.
15740
15741 * xdisp.c (vmessage): Use a better test for character truncation.
15742
15743 * charset.c (load_charset_map): <, not <=, for optimization,
15744 and to avoid potential problems with integer overflow.
15745 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15746 * casetab.c (set_identity, shuffle): Likewise.
15747 * editfns.c (Fformat): Likewise.
15748 * syntax.c (skip_chars): Likewise.
15749
15750 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15751 This also lets GCC 4.6.0 generate slightly better loop code.
15752
15753 * callint.c (Fcall_interactively): <, not <=, for optimization.
15754 (Fcall_interactively): Count the number of arguments produced,
15755 not the number of arguments given. This is simpler and lets GCC
15756 4.6.0 generate slightly better code.
15757
15758 * ftfont.c: Distingish more carefully between FcChar8 and char.
15759 The previous code passed unsigned char * to a functions like
15760 strlen and xstrcasecmp that expect char *, which does not
15761 conform to the C standard.
15762 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15763 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15764 char * when the C standard requires it.
15765
15766 * keyboard.c (read_char): Remove unused var.
15767
15768 * eval.c: Port to Windows vsnprintf (Bug#8435).
15769 Include <limits.h>.
15770 (SIZE_MAX): Define if the headers do not.
15771 (verror): Do not give up if vsnprintf returns a negative count.
15772 Instead, grow the buffer. This ports to Windows vsnprintf, which
15773 does not conform to C99. Problem reported by Eli Zaretskii.
15774 Also, simplify the allocation scheme, by avoiding the need for
15775 calling realloc, and removing the ALLOCATED variable.
15776
15777 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15778
15779 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15780 But keep the doprint source code for now, as we might revamp it
15781 and use it again (Bug#8435).
15782 * lisp.h (doprnt): Remove.
15783 * Makefile.in (base_obj): Remove doprnt.o.
15784 * deps.mk (doprnt.o): Remove.
15785
15786 error: Print 32- and 64-bit integers portably (Bug#8435).
15787 Without this change, on typical 64-bit hosts error ("...%d...", N)
15788 was used to print both 32- and 64-bit integers N, which relied on
15789 undefined behavior.
15790 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15791 * lisp.h (error, verror): Mark as printf-like functions.
15792 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15793 Report overflow in size calculations when allocating printf buffer.
15794 Do not truncate output string at its first null byte.
15795 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15796 Truncate the output at a character boundary, since vsnprintf does not
15797 do that.
15798 * charset.c (check_iso_charset_parameter): Convert internal
15799 character to string before calling 'error', since %c now has the
15800 printf meaning.
15801 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15802 overflow when computing char to be passed to 'error'. Do not
15803 pass Lisp_Object to 'error'; pass the integer instead.
15804 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15805 formatted with plain %d.
15806
15807 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15808
15809 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15810
15811 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15812
15813 * xterm.c (x_catch_errors): Remove duplicate declaration.
15814
15815 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15816
15817 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15818
15819 2011-04-10 Jim Meyering <meyering@redhat.com>
15820
15821 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15822 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15823 return ssize_t not "int", and use size_t as the buffer length.
15824 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15825 * gnutls.h: Update declarations.
15826 * process.c (read_process_output): Use ssize_t, to match.
15827 (send_process): Likewise.
15828
15829 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15830
15831 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15832
15833 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15834
15835 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15836 Use unsigned char, to match FcChar8 type definition.
15837
15838 * xterm.c (handle_one_xevent):
15839 * xmenu.c (create_and_show_popup_menu):
15840 * xselect.c (x_decline_selection_request)
15841 (x_reply_selection_request): Avoid type-punned deref of X events.
15842
15843 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15844
15845 Fix some uses of `int' instead of EMACS_INT.
15846 * search.c (string_match_1, fast_string_match)
15847 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15848 (scan_buffer, find_next_newline_no_quit)
15849 (find_before_next_newline, search_command, Freplace_match)
15850 (Fmatch_data): Make some `int' variables be EMACS_INT.
15851
15852 * xdisp.c (display_count_lines): 3rd argument and return value now
15853 EMACS_INT. All callers changed.
15854 (pint2hrstr): Last argument is now EMACS_INT.
15855
15856 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15857 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15858 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15859 (decode_coding_utf_16, decode_coding_emacs_mule)
15860 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15861 (decode_coding_ccl, decode_coding_charset)
15862 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15863 (decode_coding_iso_2022, decode_coding_emacs_mule)
15864 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15865 <char_offset, last_offset>: Declare EMACS_INT.
15866 (encode_coding_utf_8, encode_coding_utf_16)
15867 (encode_coding_emacs_mule, encode_invocation_designation)
15868 (encode_designation_at_bol, encode_coding_iso_2022)
15869 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15870 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15871 Declare EMACS_INT.
15872 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15873 (encode_invocation_designation): Last argument P_NCHARS is now
15874 EMACS_INT.
15875 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15876 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15877
15878 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15879 All users changed.
15880
15881 * ccl.c (Fccl_execute_on_string): Declare some variables
15882 EMACS_INT.
15883
15884 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15885
15886 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15887
15888 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15889
15890 * process.c (Fformat_network_address): Doc fix.
15891
15892 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15893
15894 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15895
15896 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15897
15898 * keyboard.c (read_char): Call Lisp function help-form-show,
15899 instead of using internal_with_output_to_temp_buffer.
15900 (Qhelp_form_show): New var.
15901 (syms_of_keyboard): Use DEFSYM macro.
15902
15903 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15904
15905 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15906
15907 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15908
15909 * process.c (Flist_processes): Remove to Lisp.
15910 (list_processes_1): Delete.
15911
15912 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15913
15914 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15915
15916 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15917
15918 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15919
15920 Fix more problems found by GCC 4.6.0's static checks.
15921
15922 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15923
15924 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15925
15926 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15927
15928 * xdisp.c (vmessage): Mark as a printf-like function.
15929
15930 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15931
15932 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15933
15934 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15935 printf-like functions.
15936 (tiff_load): Add casts to remove these marks before passing them
15937 to system-supplied API.
15938
15939 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15940
15941 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15942 This avoids several warnings with gcc -Wstrict-overflow.
15943 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15944 directly, rather than having caller test rule sign. This avoids
15945 some unnecessary tests.
15946 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
15947 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
15948 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
15949
15950 * xfont.c (xfont_text_extents): Remove var that was set but not used.
15951 (xfont_open): Avoid unnecessary tests.
15952
15953 * composite.c (composition_gstring_put_cache): Use unsigned integer.
15954
15955 * composite.h, composite.c (composition_gstring_put_cache):
15956 Use EMACS_INT, not int, for length.
15957
15958 * composite.h (COMPOSITION_DECODE_REFS): New macro,
15959 breaking out part of COMPOSITION_DECODE_RULE.
15960 (COMPOSITION_DECODE_RULE): Use it.
15961 * composite.c (get_composition_id): Remove unused local vars,
15962 by using the new macro.
15963
15964 * textprop.c (set_text_properties_1): Change while to do-while,
15965 since the condition is always true at first.
15966
15967 * intervals.c (graft_intervals_into_buffer): Mark var as used.
15968 (interval_deletion_adjustment): Return unsigned value.
15969 All uses changed.
15970
15971 * process.c (list_processes_1, create_pty, read_process_output):
15972 (exec_sentinel): Remove vars that were set but not used.
15973 (create_pty): Remove unnecessary "volatile"s.
15974 (Fnetwork_interface_info): Avoid possibility of int overflow.
15975 (read_process_output): Do adaptive read buffering even if carryover.
15976 (read_process_output): Simplify nbytes computation if buffered.
15977
15978 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
15979
15980 * syntax.c (scan_words): Remove var that was set but not used.
15981 (update_syntax_table): Use unsigned instead of int.
15982
15983 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
15984 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
15985 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
15986
15987 * print.c (print_error_message): Avoid int overflow.
15988
15989 * font.c (font_list_entities): Redo for clarity,
15990 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
15991
15992 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
15993 (font_score): Avoid potential overflow in diff calculation.
15994
15995 * fns.c (substring_both): Remove var that is set but not used.
15996 (sxhash): Redo loop for clarity and to avoid wraparound warning.
15997
15998 * eval.c (funcall_lambda): Rename local to avoid shadowing.
15999
16000 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16001 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16002 can always succeed if overflow has undefined behavior.
16003
16004 * search.c (boyer_moore, wordify): Remove vars set but not used.
16005 (wordify): Omit three unnecessary tests.
16006
16007 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16008 All callers changed. This avoids the need for an unused var.
16009
16010 * casefiddle.c (casify_region): Remove var that is set but not used.
16011
16012 * dired.c (file_name_completion): Remove var that is set but not used.
16013
16014 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16015
16016 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16017 (Finsert_file_contents): Remove unnecessary code checking fd.
16018
16019 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16020 Check for integer overflow on size calculations.
16021
16022 * buffer.c (Fprevious_overlay_change): Remove var that is set
16023 but not used.
16024
16025 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16026 Remove vars that are set but not used.
16027 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16028 (timer_check_2): Mark vars as initialized.
16029
16030 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16031
16032 * image.c (lookup_image): Remove var that is set but not used.
16033 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16034
16035 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16036 that are set but not used.
16037
16038 * xfns.c (make_invisible_cursor): Don't return garbage
16039 if XCreateBitmapFromData fails (Bug#8410).
16040
16041 * xselect.c (x_get_local_selection, x_handle_property_notify):
16042 Remove vars that are set but not used.
16043
16044 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16045 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16046
16047 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16048 Remove var that is set but not used.
16049 (scroll_bar_windows_size): Now size_t, not int.
16050 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16051 Check for overflow.
16052
16053 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16054 (map_tty_color) [!defined MSDOS]: Likewise.
16055
16056 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16057
16058 * coding.c: Remove vars that are set but not used.
16059 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16060 All callers changed.
16061 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16062 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16063 (decode_coding_charset): Remove vars that are set but not used.
16064
16065 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16066 that is set but not used.
16067
16068 * print.c (print_object): Remove var that is set but not used.
16069
16070 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16071 The gnulib version avoids calling malloc in the usual case,
16072 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16073 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16074 * filelock.c (current_lock_owner): Likewise.
16075 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16076 * sysdep.c: Include allocator.h, careadlinkat.h.
16077 (emacs_no_realloc_allocator): New static constant.
16078 (emacs_readlink): New function.
16079 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16080 ../lib/careadlinkat.h.
16081
16082 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16083
16084 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16085 first non-nil return value).
16086
16087 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16088
16089 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16090 if not defined (Bug#8403).
16091
16092 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16093
16094 * xdisp.c (display_count_lines): Remove parameter `start',
16095 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16096 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16097 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16098 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16099 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16100 and thereabouts. All callers changed.
16101 (get_per_char_metric): Remove parameter `f', unused since
16102 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16103
16104 2011-04-02 Jim Meyering <meyering@redhat.com>
16105
16106 do not dereference NULL upon failed strdup
16107 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16108 (ns_get_family): Likewise.
16109
16110 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16111
16112 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16113
16114 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16115
16116 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16117 later (Bug#8403).
16118
16119 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16120
16121 Add lexical binding.
16122
16123 * window.c (Ftemp_output_buffer_show): New fun.
16124 (Fsave_window_excursion):
16125 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16126
16127 * lread.c (lisp_file_lexically_bound_p): New function.
16128 (Fload): Bind Qlexical_binding.
16129 (readevalloop): Remove `evalfun' arg.
16130 Bind Qinternal_interpreter_environment.
16131 (Feval_buffer): Bind Qlexical_binding.
16132 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16133 Mark as dynamic.
16134 (syms_of_lread): Declare `lexical-binding'.
16135
16136 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16137
16138 * keyboard.c (eval_dyn): New fun.
16139 (menu_item_eval_property): Use it.
16140
16141 * image.c (parse_image_spec): Use Ffunctionp.
16142
16143 * fns.c (concat, mapcar1): Accept byte-code-functions.
16144
16145 * eval.c (Fsetq): Handle lexical vars.
16146 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16147 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16148 (FletX, Flet): Obey lexical binding.
16149 (Fcommandp): Handle closures.
16150 (Feval): New `lexical' arg.
16151 (eval_sub): New function extracted from Feval. Use it almost
16152 everywhere where Feval was used. Look up vars in lexical env.
16153 Handle closures.
16154 (Ffunctionp): Move from subr.el.
16155 (Ffuncall): Handle closures.
16156 (apply_lambda): Remove `eval_flags'.
16157 (funcall_lambda): Handle closures and new byte-code-functions.
16158 (Fspecial_variable_p): New function.
16159 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16160 but without exporting it to Lisp.
16161
16162 * doc.c (Fdocumentation, store_function_docstring):
16163 * data.c (Finteractive_form): Handle closures.
16164
16165 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16166 interactive spec.
16167
16168 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16169 New byte-codes.
16170 (exec_byte_code): New function extracted from Fbyte_code to handle new
16171 calling convention for byte-code-functions. Add new byte-codes.
16172
16173 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16174
16175 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16176
16177 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16178
16179 * xdisp.c (redisplay_internal): Fix prototype.
16180
16181 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16182
16183 * xdisp.c (SCROLL_LIMIT): New macro.
16184 (try_scrolling): Use it when setting scroll_limit.
16185 Limit scrolling to 100 screen lines.
16186 (redisplay_window): Even when falling back on "recentering",
16187 position point in the window according to scroll-conservatively,
16188 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16189
16190 (try_scrolling): When point is above the window, allow searching
16191 as far as scroll_max, or one screenful, to compute vertical
16192 distance from PT to the scroll margin position. This prevents
16193 try_scrolling from unnecessarily failing when
16194 scroll-conservatively is set to a value slightly larger than the
16195 window height. Clean up the case of PT below the margin at bottom
16196 of window: scroll_max can no longer be INT_MAX. When aggressive
16197 scrolling is in use, don't let point enter the opposite scroll
16198 margin as result of the scroll.
16199 (syms_of_xdisp) <scroll-conservatively>: Document the
16200 threshold of 100 lines for never-recentering scrolling.
16201
16202 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16203
16204 * dispextern.h (move_it_by_lines):
16205 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16206 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16207 (message_log_check_duplicate): Remove parameters `prev_bol' and
16208 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16209 (redisplay_internal): Remove parameter `preserve_echo_area',
16210 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16211
16212 * indent.c (Fvertical_motion):
16213 * window.c (window_scroll_pixel_based, Frecenter):
16214 Don't pass `need_y_p' to `move_it_by_lines'.
16215
16216 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16217
16218 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16219 steal a few bits to be more compact.
16220 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16221 Remove unneeded casts.
16222
16223 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16224
16225 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16226
16227 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16228 binding" message (bug#7967).
16229
16230 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16231
16232 Fix more problems found by GCC 4.6.0's static checks.
16233
16234 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16235 Remove unused local var.
16236
16237 * editfns.c (Fmessage_box): Remove unused local var.
16238
16239 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16240 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16241 Omit unused local vars.
16242 * window.c (shrink_windows): Omit unused local var.
16243 * menu.c (digest_single_submenu): Omit unused local var.
16244 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16245 Omit unused local var.
16246
16247 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16248 Don't assume string length fits in int.
16249 (keyremap_step, read_key_sequence): Use size_t for sizes.
16250 (read_key_sequence): Don't check last_real_key_start redundantly.
16251
16252 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16253 instead of alloca (Bug#8344).
16254
16255 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16256 (Fbacktrace_frame): Don't assume nframes fits in int.
16257
16258 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16259
16260 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16261 concerns.
16262
16263 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16264
16265 * cm.c (calccost): Turn while-do into do-while, for clarity.
16266
16267 * keyboard.c (syms_of_keyboard): Use the same style as later
16268 in this function when indexing through an array. This also
16269 works around GCC bug 48267.
16270
16271 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16272
16273 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16274
16275 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16276 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16277
16278 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16279 This avoids undefined behavior on integer overflow, and is a bit
16280 more convenient anyway since it is compared to a size_t variable.
16281
16282 Variadic C functions now count arguments with size_t, not int.
16283 This avoids an unnecessary limitation on 64-bit machines, which
16284 caused (substring ...) to crash on large vectors (Bug#8344).
16285 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16286 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16287 All variadic functions and their callers changed accordingly.
16288 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16289 * data.c (arith_driver, float_arith_driver): Likewise.
16290 * editfns.c (general_insert_function): Likewise.
16291 * eval.c (struct backtrace.nargs, interactive_p)
16292 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16293 (funcall_lambda, mark_backtrace): Likewise.
16294 * fns.c (concat): Likewise.
16295 * frame.c (x_set_frame_parameters): Likewise.
16296 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16297 0 if not found, not -1. All callers changed.
16298
16299 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16300 (stack_copy_size): Now size_t, not int.
16301 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16302
16303 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16304
16305 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16306 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16307 All callers changed.
16308
16309 * lisp.h (multibyte_char_to_unibyte):
16310 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16311 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16312 * character.h (CHAR_TO_BYTE8):
16313 * cmds.c (internal_self_insert):
16314 * editfns.c (general_insert_function):
16315 * keymap.c (push_key_description):
16316 * search.c (Freplace_match):
16317 * xdisp.c (message_dolog, set_message_1): All callers changed.
16318
16319 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16320
16321 * keyboard.c (safe_run_hook_funcall): New function.
16322 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16323 don't set the hook to nil, but remove the offending function instead.
16324 (Qcommand_hook_internal): Remove, unused.
16325 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16326 Vcommand_hook_internal.
16327
16328 * eval.c (enum run_hooks_condition): Remove.
16329 (funcall_nil, funcall_not): New functions.
16330 (run_hook_with_args): Call each function through a `funcall' argument.
16331 Remove `cond' argument, now redundant.
16332 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16333 (Frun_hook_with_args_until_failure): Adjust accordingly.
16334 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16335
16336 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16337
16338 * dispextern.h (string_buffer_position): Remove declaration.
16339
16340 * print.c (strout): Remove parameter `multibyte', unused since
16341 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16342
16343 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16344 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16345 All callers changed.
16346
16347 * w32.c (_wsa_errlist): Use braces for struct initializers.
16348
16349 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16350 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16351 All callers changed.
16352 (string_buffer_position): Likewise. Also, make static (it's never
16353 used outside xdisp.c).
16354 (cursor_row_p): Remove parameter `w', unused since
16355 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16356 (decode_mode_spec): Remove parameter `precision', introduced during
16357 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16358 All callers changed.
16359
16360 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16361
16362 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16363
16364 2011-03-27 Anders Lindgren <andlind@gmail.com>
16365
16366 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16367 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16368 (ns_update_auto_hide_menu_bar): New functions.
16369 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16370 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16371 ns_constrain_all_frames.
16372 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16373 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16374
16375 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16376
16377 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16378
16379 2011-03-27 Glenn Morris <rgm@gnu.org>
16380
16381 * syssignal.h: Replace RETSIGTYPE with void.
16382 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16383 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16384 Replace SIGTYPE with void everywhere.
16385 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16386 * s/template.h (SIGTYPE): Remove commented out definition.
16387
16388 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16389
16390 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16391 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16392
16393 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16394
16395 * w32.c (read_unc_volume): Use parameter `henum', instead of
16396 global variable `wget_enum_handle'.
16397
16398 * keymap.c (describe_vector): Remove parameters `indices' and
16399 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16400 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16401
16402 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16403
16404 * keyboard.c (timer_check): Remove parameter `do_it_now',
16405 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16406 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16407 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16408
16409 * keyboard.c (read_char):
16410 * w32menu.c (w32_menu_display_help):
16411 * xmenu.c (show_help_event, menu_help_callback):
16412 Adjust calls to `show_help_echo'.
16413
16414 * gtkutil.c (xg_maybe_add_timer):
16415 * keyboard.c (readable_events):
16416 * process.c (wait_reading_process_output):
16417 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16418
16419 * insdel.c (adjust_markers_gap_motion):
16420 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16421 (gap_left, gap_right): Don't call it.
16422
16423 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16424
16425 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16426 incurred during fontification.
16427
16428 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16429
16430 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16431 (DEFVAR_PER_BUFFER): Don't pass it.
16432
16433 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16434 (scrolling_window): Don't pass it.
16435
16436 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16437
16438 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16439
16440 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16441 and `suffix'.
16442 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16443 of variables specific to SELinux and computation of `encoded_absname'.
16444
16445 * image.c (XPutPixel): Remove unused variable `height'.
16446
16447 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16448
16449 * unexw32.c (get_section_info): Remove unused variable `section'.
16450
16451 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16452 (system_process_attributes): Remove unused variable `sess'.
16453 (sys_read): Remove unused variable `err'.
16454
16455 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16456 (w32_wnd_proc): Remove unused variable `isdead'.
16457 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16458 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16459 (x_create_tip_frame): Remove unused variable `tem'.
16460
16461 * w32inevt.c (w32_console_read_socket):
16462 Remove unused variable `no_events'.
16463
16464 * w32term.c (x_draw_composite_glyph_string_foreground):
16465 Remove unused variable `width'.
16466
16467 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16468
16469 * w32term.c (x_set_glyph_string_clipping):
16470 Don't pass uninitialized region to CombineRgn.
16471
16472 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16473
16474 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16475 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16476 (Fx_close_connection): Remove unused variable `i'.
16477
16478 * w32font.c (w32font_draw): Return number of glyphs.
16479 (w32font_open_internal): Remove unused variable `i'.
16480 (w32font_driver): Add missing initializer.
16481
16482 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16483 (fill_in_menu): Remove unused variable `items_added'.
16484
16485 * w32term.c (last_mouse_press_frame): Remove static global variable.
16486 (w32_clip_to_row): Remove unused variable `f'.
16487 (x_delete_terminal): Remove unused variable `i'.
16488
16489 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16490 (NOTHING): Remove unused static global variable.
16491 (uniscribe_check_otf): Remove unused variable `table'.
16492 (uniscribe_font_driver): Add missing initializers.
16493
16494 2011-03-23 Julien Danjou <julien@danjou.info>
16495
16496 * term.c (Fsuspend_tty, Fresume_tty):
16497 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16498 * window.c (temp_output_buffer_show):
16499 * insdel.c (signal_before_change):
16500 * frame.c (Fhandle_switch_frame):
16501 * fileio.c (Fdo_auto_save):
16502 * emacs.c (Fkill_emacs):
16503 * editfns.c (save_excursion_restore):
16504 * cmds.c (internal_self_insert):
16505 * callint.c (Fcall_interactively):
16506 * buffer.c (Fkill_all_local_variables):
16507 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16508 Use Frun_hooks.
16509 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16510 unconditionally since it does the check itself.
16511
16512 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16513
16514 Fix more problems found by GCC 4.5.2's static checks.
16515
16516 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16517 the first time through the loop, since we know p0 < p1 then.
16518 This also avoids a gcc -Wstrict-overflow warning.
16519
16520 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16521 leading to a memory leak, possible in functions like
16522 load_charset_map_from_file that can allocate an unbounded number
16523 of objects (Bug#8318).
16524
16525 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16526 that could (at least in theory) be that large.
16527
16528 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16529 This is less likely to overflow, and avoids undefined behavior if
16530 overflow does occur. All callers changed. Use strtoul to scan
16531 for the unsigned long integer.
16532 (pint2hrstr): Simplify and tune code slightly.
16533 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16534
16535 * scroll.c (do_scrolling): Work around GCC bug 48228.
16536 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16537
16538 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16539 This also avoids a warning with gcc -Wstrict-overflow.
16540 (validate_x_resource_name): Simplify count usage.
16541 This also avoids a warning with gcc -Wstrict-overflow.
16542
16543 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16544 fail (Bug#8306).
16545
16546 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16547
16548 * process.c (Fmake_network_process): Use socklen_t, not int,
16549 where POSIX says socklen_t is required in portable programs.
16550 This fixes a porting bug on hosts like 64-bit HP-UX, where
16551 socklen_t is wider than int (Bug#8277).
16552 (Fmake_network_process, server_accept_connection):
16553 (wait_reading_process_output, read_process_output):
16554 Likewise.
16555
16556 * process.c: Rename or move locals to avoid shadowing.
16557 (list_processes_1, Fmake_network_process):
16558 (read_process_output_error_handler, exec_sentinel_error_handler):
16559 Rename or move locals.
16560 (Fmake_network_process): Define label "retry_connect" only if needed.
16561 (Fnetwork_interface_info): Fix pointer signedness.
16562 (process_send_signal): Add cast to avoid pointer signedness problem.
16563 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16564 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16565
16566 Make tparam.h and terminfo.c consistent.
16567 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16568 Include tparam.h instead, since it declares them.
16569 * cm.h (PC): Remove extern decl; tparam.h now does this.
16570 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16571 * terminfo.c: Include tparam.h, to check interfaces.
16572 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16573 (tparam): Adjust signature to match interface in tparam.h;
16574 this removes some undefined behavior. Check that outstring and len
16575 are zero, which they always are with Emacs.
16576 * tparam.h (PC, BC, UP): New extern decls.
16577
16578 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16579 (xftfont_open): Rename locals to avoid shadowing.
16580
16581 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16582 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16583 (OTF_TAG_SYM): Omit macro if not needed.
16584 (ftfont_list): Remove unused local.
16585 (get_adstyle_property, ftfont_pattern_entity):
16586 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16587 Rename locals to avoid shadowing.
16588
16589 * xfont.c (xfont_list_family): Mark var as initialized.
16590
16591 * xml.c (make_dom): Now static.
16592
16593 * composite.c (composition_compute_stop_pos): Rename local to
16594 avoid shadowing.
16595 (composition_reseat_it): Remove unused locals.
16596 (find_automatic_composition, composition_adjust_point): Likewise.
16597 (composition_update_it): Mark var as initialized.
16598 (find_automatic_composition): Mark vars as initialized,
16599 with a FIXME (Bug#8290).
16600
16601 character.h: Rename locals to avoid shadowing.
16602 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16603 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16604 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16605 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16606 to avoid shadowing.
16607
16608 * textprop.c (property_change_between_p): Remove; unused.
16609
16610 * intervals.c (interval_start_pos): Now static.
16611
16612 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16613
16614 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16615 Rename locals to avoid shadowing.
16616
16617 * sound.c (wav_play, au_play, Fplay_sound_internal):
16618 Fix pointer signedness.
16619 (alsa_choose_format): Remove unused local var.
16620 (wav_play): Initialize a variable to 0, to prevent undefined
16621 behavior (Bug#8278).
16622
16623 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16624
16625 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16626
16627 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16628 clobbering (Bug#8298).
16629 * sysdep.c (sys_subshell): Likewise.
16630 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16631
16632 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16633 This should get cleaned up, so that child_setup has the
16634 same signature on all platforms.
16635
16636 * callproc.c (call_process_cleanup): Now static.
16637 (relocate_fd): Rename locals to avoid shadowing.
16638
16639 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16640
16641 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16642 not to be necessary, and produces flickering.
16643
16644 2011-03-20 Glenn Morris <rgm@gnu.org>
16645
16646 * config.in: Remove file.
16647
16648 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16649
16650 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16651 are now in src/globals.h.
16652 (syms_of_minibuf): Remove spurious & from previous change.
16653
16654 2011-03-20 Leo Liu <sdl.web@gmail.com>
16655
16656 * minibuf.c (completing-read-function): New variable.
16657 (completing-read-default): Rename from completing-read.
16658 (completing-read): Call completing-read-function.
16659
16660 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16661
16662 * xfaces.c (Fx_load_color_file):
16663 Read color file from absolute filename (bug#8250).
16664
16665 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16666
16667 * makefile.w32-in: Update dependencies.
16668
16669 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16670
16671 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16672
16673 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16674
16675 Fix more problems found by GCC 4.5.2's static checks.
16676
16677 * process.c (make_serial_process_unwind, send_process_trap):
16678 (sigchld_handler): Now static.
16679
16680 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16681 That way, the code declares only the vars that it needs.
16682 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16683 * s/cygwin.h (PTY_ITERATION): Likewise.
16684 * s/darwin.h (PTY_ITERATION): Likewise.
16685 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16686
16687 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16688 * process.c (allocate_pty): Don't declare stb unless it's needed.
16689
16690 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16691 (CONSTANTLIM): Remove; unused.
16692 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16693 Define only if needed.
16694
16695 * unexelf.c (unexec): Name an expression,
16696 to avoid gcc -Wbad-function-cast warning.
16697 Use a different way to cause a compilation error if anyone uses
16698 n rather than nn, a way that does not involve shadowing.
16699 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16700
16701 * deps.mk (unexalpha.o): Remove; unused.
16702
16703 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16704 * unexec.h: New file.
16705 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16706 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16707 Depend on unexec.h.
16708 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16709 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16710 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16711 Change as necessary to match prototype in unexec.h.
16712
16713 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16714 shadowing.
16715 (back_comment, skip_chars): Mark vars as initialized.
16716
16717 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16718 Rename locals to avoid shadowing.
16719
16720 * lread.c (read1): Rewrite so as not to use empty "else".
16721 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16722
16723 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16724
16725 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16726 warning when compiling print.c.
16727
16728 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16729 instead of using an uninitialized var.
16730 (font_sort_entities): Mark var as initialized.
16731
16732 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16733
16734 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16735 pointers to constants.
16736 (font_parse_fcname): Remove unused vars.
16737 (font_delete_unmatched): Now static.
16738 (font_get_spec): Remove; unused.
16739 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16740 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16741 Rename or move locals to avoid shadowing.
16742
16743 * fns.c (require_nesting_list, require_unwind): Now static.
16744 (Ffillarray): Rename locals to avoid shadowing.
16745
16746 * floatfns.c (domain_error2): Define only if needed.
16747 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16748
16749 * alloc.c (mark_backtrace): Move decl from here ...
16750 * lisp.h: ... to here, so that it can be checked.
16751
16752 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16753 (Fdefvar): Rewrite so as not to use empty "else".
16754 (lisp_indirect_variable): Name an expression,
16755 to avoid gcc -Wbad-function-cast warning.
16756 (Fdefvar): Rename locals to avoid shadowing.
16757
16758 * callint.c (quotify_arg, quotify_args): Now static.
16759 (Fcall_interactively): Rename locals to avoid shadowing.
16760 Use const pointer when appropriate.
16761
16762 * lisp.h (get_system_name, get_operating_system_release):
16763 Move decls here, to check interfaces.
16764 * process.c (get_operating_system_release): Move decl to lisp.h.
16765 * xrdb.c (get_system_name): Likewise.
16766 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16767 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16768 some of which prompt warnings from gcc -Wbad-function-cast.
16769 (Fformat_time_string, Fencode_time, Finsert_char):
16770 (Ftranslate_region_internal, Fformat):
16771 Rename or remove local vars to avoid shadowing.
16772 (Ftranslate_region_internal): Mark var as initialized.
16773
16774 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16775 avoid shadowing.
16776
16777 * lisp.h (eassert): Check that the argument compiles, even if
16778 ENABLE_CHECKING is not defined.
16779
16780 * data.c (Findirect_variable): Name an expression, to avoid
16781 gcc -Wbad-function-cast warning.
16782 (default_value, arithcompare, arith_driver, arith_error): Now static.
16783 (store_symval_forwarding): Rename local to avoid shadowing.
16784 (Fmake_variable_buffer_local, Fmake_local_variable):
16785 Mark variables as initialized.
16786 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16787
16788 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16789 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16790 Rename locals to avoid shadowing.
16791 (mark_stack): Move local variables into the #ifdef region where
16792 they're used.
16793 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16794 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16795 needed otherwise.
16796 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16797 (GC_STRING_CHARS): Remove; not used.
16798 (Fmemory_limit): Cast sbrk's returned value to char *.
16799
16800 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16801 avoids undefined behavior in theory.
16802
16803 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16804
16805 Use functions, not macros, for up- and down-casing (Bug#8254).
16806 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16807 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16808 to use the following functions instead of these macros.
16809 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16810 EMACS_INT, since callers assume the returned value fits in int.
16811 (upcase1): Likewise, for UPCASE_TABLE.
16812 (uppercasep, lowercasep, upcase): New static inline functions.
16813 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16814 the race-condition problem in the old DOWNCASE.
16815
16816 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16817 Rename locals to avoid shadowing.
16818 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16819 (regex_compile, re_search_2, re_match_2_internal):
16820 Remove unused local vars.
16821 (FREE_VAR): Rewrite so as not to use empty "else",
16822 which gcc can warn about.
16823 (regex_compile, re_match_2_internal): Mark locals as initialized.
16824 (RETALLOC_IF): Define only if needed.
16825 (WORDCHAR_P): Likewise. This one is never needed, but is used
16826 only in a comment talking about a compiler bug, so put inside
16827 the #if 0 of that comment.
16828 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16829 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16830 Remove; unused.
16831
16832 * search.c (boyer_moore): Rename locals to avoid shadowing.
16833 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16834 (PREV_CHAR_BOUNDARY): Likewise.
16835
16836 * search.c (simple_search): Remove unused var.
16837
16838 * dired.c (compile_pattern): Move decl from here ...
16839 * lisp.h: ... to here, so that it can be checked.
16840 (struct re_registers): New forward decl.
16841
16842 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16843
16844 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16845 All uses changed.
16846 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16847 Rename locals to avoid shadowing.
16848 (Fvertical_motion): Mark locals as initialized.
16849
16850 * casefiddle.c (casify_object, casify_region): Now static.
16851 (casify_region): Mark local as initialized.
16852
16853 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16854
16855 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16856 New macros, so that the caller can use some names other than
16857 gcpro1, gcpro2, etc.
16858 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16859 of the new macros.
16860 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16861 argument, for consistency with GCPRO2_VAR, etc: it is now the
16862 prefix of the variable, not the variable itself. All uses
16863 changed.
16864 * dired.c (directory_files_internal, file_name_completion):
16865 Rename locals to avoid shadowing.
16866
16867 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16868 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16869 dired.c's scmp function, had undefined behavior.
16870 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16871 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16872 * buffer.h: ... to here, because these macros use current_buffer,
16873 and the new implementation with inline functions needs to have
16874 current_buffer in scope now, rather than later when the macros
16875 are used.
16876 (downcase, upcase1): New static inline functions.
16877 (DOWNCASE, UPCASE1): Reimplement using these functions.
16878 This avoids undefined behavior in expressions like
16879 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16880 from race conditions in accessing the global variables
16881 case_temp1 and case_temp2.
16882 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16883 * lisp.h (case_temp1, case_temp2): Remove their decls.
16884 * character.h (ASCII_CHAR_P): Move from here ...
16885 * lisp.h: ... to here, so that the inline functions mentioned
16886 above can use them.
16887
16888 * dired.c (directory_files_internal_unwind): Now static.
16889
16890 * fileio.c (file_name_as_directory, directory_file_name):
16891 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16892 Now static.
16893 (file_name_as_directory): Use const pointers when appropriate.
16894 (Fexpand_file_name): Likewise. In particular, newdir might
16895 point at constant storage, so make it a const pointer.
16896 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16897 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16898 signedness issues.
16899 (Fset_file_times, Finsert_file_contents, auto_save_error):
16900 Rename locals to avoid shadowing.
16901
16902 * minibuf.c (choose_minibuf_frame_1): Now static.
16903 (Ftry_completion, Fall_completions): Rename or remove locals
16904 to avoid shadowing.
16905
16906 * marker.c (bytepos_to_charpos): Remove; unused.
16907
16908 * lisp.h (verify_bytepos, count_markers): New decls,
16909 so that gcc does not warn that these functions aren't declared.
16910
16911 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16912 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16913 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16914 (copy_text): Remove unused local var.
16915
16916 * filelock.c (within_one_second): Now static.
16917 (lock_file_1): Rename local to avoid shadowing.
16918
16919 * buffer.c (fix_overlays_before): Mark locals as initialized.
16920 (fix_start_end_in_overlays): Likewise. This function should be
16921 simplified by using pointers-to-pointers, but that's a different
16922 matter.
16923 (switch_to_buffer_1): Now static.
16924 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16925 (report_overlay_modification): Rename locals to avoid shadowing.
16926
16927 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16928 Fix pointer signedness issue.
16929 (sys_subshell): Mark local as volatile if checking for lint,
16930 to suppress a gcc -Wclobbered warning that does not seem to be right.
16931 (MAXPATHLEN): Define only if needed.
16932
16933 * process.c (serial_open, serial_configure): Move decls from here ...
16934 * systty.h: ... to here, so that they can be checked.
16935
16936 * fns.c (get_random, seed_random): Move extern decls from here ...
16937 * lisp.h: ... to here, so that they can be checked.
16938
16939 * sysdep.c (reset_io): Now static.
16940 (wait_for_termination_signal): Remove; unused.
16941
16942 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16943 (copy_keymap_item, append_key, push_text_char_description):
16944 Now static.
16945 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
16946 (DENSE_TABLE_SIZE): Remove; unused.
16947 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
16948 (describe_map_tree):
16949 Rename locals to avoid shadowing.
16950
16951 * keyboard.c: Declare functions static if they are not used elsewhere.
16952 (echo_char, echo_dash, cmd_error, top_level_2):
16953 (poll_for_input, handle_async_input): Now static.
16954 (read_char, kbd_buffer_get_event, make_lispy_position):
16955 (make_lispy_event, make_lispy_movement, apply_modifiers):
16956 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
16957 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
16958 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
16959 (read_key_sequence, read_char): Mark locals as initialized.
16960 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
16961
16962 * keyboard.h (make_ctrl_char): New decl.
16963 (mark_kboards): Move decl here ...
16964 * alloc.c (mark_kboards): ... from here.
16965
16966 * lisp.h (force_auto_save_soon): New decl.
16967
16968 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
16969 (DEFINE_DUMMY_FUNCTION): New macro.
16970 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
16971 Use it.
16972 (main): Add casts to avoid warnings
16973 if GCC considers string literals to be constants.
16974
16975 * lisp.h (fatal_error_signal): Add decl, since it's exported.
16976
16977 * dbusbind.c: Pointer signedness fixes.
16978 (xd_signature, xd_append_arg, xd_initialize):
16979 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16980 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16981 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
16982 (Fdbus_register_signal): Use SSDATA when the context wants char *.
16983
16984 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
16985 if GCC considers string literals to be constants.
16986 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
16987
16988 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
16989
16990 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
16991 (print_preprocess, print_object): New macro to fix last change.
16992
16993 * print.c (print_preprocess): Don't forget font objects.
16994
16995 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
16996
16997 * emacs.c (USAGE3): Doc fixes.
16998
16999 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17000
17001 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17002 structure.
17003
17004 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17005
17006 * lisp.h (VWindow_system, Qfile_name_history):
17007 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17008 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17009 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17010
17011 * w32select.c: Don't #include "keyboard.h".
17012 (run_protected): Add extern declaration for waiting_for_input.
17013
17014 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17015 * w32console.c (detect_input_pending, read_input_pending)
17016 (encode_terminal_code):
17017 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17018 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17019 (w32_system_caret_y, Qfile_name_history):
17020 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17021 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17022 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17023 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17024 * w32proc.c (Qlocal, report_file_error):
17025 * w32term.c (Vwindow_system, updating_frame):
17026 * w32uniscribe.c (initialized, uniscribe_font_driver):
17027 Remove unneeded extern declarations.
17028
17029 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17030
17031 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17032
17033 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17034
17035 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17036 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17037 These macros can no longer be used for assignment.
17038
17039 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17040 Assign struct members directly, instead of using BUF_BEGV etc.
17041 (record_buffer_markers, fetch_buffer_markers): New functions for
17042 recording and fetching special buffer markers.
17043 (set_buffer_internal_1, set_buffer_temp): Use them.
17044
17045 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17046
17047 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17048
17049 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17050 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17051
17052 * xdisp.c (hscroll_window_tree):
17053 (reconsider_clip_changes): Use PT instead of BUF_PT.
17054
17055 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17056
17057 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17058 $(EMACS_ROOT)/lib/intprops.h.
17059
17060 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17061
17062 Fix more problems found by GCC 4.5.2's static checks.
17063
17064 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17065 to unsigned char * to avoid compiler diagnostic.
17066 (xg_free_frame_widgets): Make it clear that a local variable is
17067 needed only if USE_GTK_TOOLTIP.
17068 (gdk_window_get_screen): Make it clear that this macro is needed
17069 only if USE_GTK_TOOLTIP.
17070 (int_gtk_range_get_value): New function, which avoids a diagnostic
17071 from gcc -Wbad-function-cast.
17072 (xg_set_toolkit_scroll_bar_thumb): Use it.
17073 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17074 diagnostic from gcc -Wbad-function-cast.
17075 (get_utf8_string, xg_get_file_with_chooser):
17076 Rename locals to avoid shadowing.
17077 (create_dialog): Move locals to avoid shadowing.
17078
17079 * xgselect.c (xg_select): Remove unused var.
17080
17081 * image.c (four_corners_best): Mark locals as initialized.
17082 (gif_load): Initialize transparent_p to zero (Bug#8238).
17083 Mark another local as initialized.
17084 (my_png_error, my_error_exit): Mark with NO_RETURN.
17085
17086 * image.c (clear_image_cache): Now static.
17087 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17088 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17089 (x_edge_detection): Remove unnecessary cast that
17090 gcc -Wbad-function-cast diagnoses.
17091 (gif_load): Fix pointer signedness.
17092 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17093 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17094
17095 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17096
17097 Improve quality of tests for time stamp overflow.
17098 For example, without this patch (encode-time 0 0 0 1 1
17099 1152921504606846976) returns the obviously-bogus value (-948597
17100 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17101 reports time overflow. See
17102 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17103 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17104 * editfns.c: Include limits.h and intprops.h.
17105 (TIME_T_MIN, TIME_T_MAX): New macros.
17106 (time_overflow): Move earlier, to before first use.
17107 (hi_time, lo_time): New functions, for an accurate test for
17108 out-of-range times.
17109 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17110 (Fget_internal_run_time): Don't assume time_t fits in int.
17111 (make_time): Use list2 instead of Fcons twice.
17112 (Fdecode_time): More accurate test for out-of-range times.
17113 (check_tm_member): New function.
17114 (Fencode_time): Use it, to test for out-of-range times.
17115 (lisp_time_argument): Don't rely on undefined left-shift and
17116 right-shift behavior when checking for time stamp overflow.
17117
17118 * editfns.c (time_overflow): New function, refactoring common code.
17119 (Fformat_time_string, Fdecode_time, Fencode_time):
17120 (Fcurrent_time_string): Use it.
17121
17122 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17123 * dired.c (make_time): Move to ...
17124 * editfns.c (make_time): ... here.
17125 * systime.h: Note the move.
17126
17127 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17128
17129 * fringe.c (update_window_fringes): Remove unused variables.
17130
17131 * unexmacosx.c (copy_data_segment): Also copy __got section.
17132 (Bug#8223)
17133
17134 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17135
17136 * termcap.c [MSDOS]: Include "msdos.h".
17137 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17138 Constify `char *' arguments and their references according to
17139 prototypes in tparam.h.
17140
17141 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17142
17143 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17144 Adapt all references accordingly.
17145
17146 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17147
17148 2011-03-11 Tom Tromey <tromey@redhat.com>
17149
17150 * buffer.c (syms_of_buffer): Remove obsolete comment.
17151
17152 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17153
17154 * termhooks.h (encode_terminal_code): Declare prototype.
17155
17156 * msdos.c (encode_terminal_code): Don't declare prototype.
17157
17158 * term.c (encode_terminal_code): Now external again, used by
17159 w32console.c and msdos.c.
17160
17161 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17162 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17163
17164 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17165
17166 Fix some minor problems found by GCC 4.5.2's static checks.
17167
17168 * fringe.c (update_window_fringes): Mark locals as initialized
17169 (Bug#8227).
17170 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17171
17172 * alloc.c (mark_fringe_data): Move decl from here ...
17173 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17174 to check its interface.
17175 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17176
17177 * fontset.c (free_realized_fontset): Now static.
17178 (Fset_fontset_font): Rename local to avoid shadowing.
17179 (fontset_font): Mark local as initialized.
17180 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17181
17182 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17183
17184 * xselect.c (x_disown_buffer_selections): Remove; not used.
17185 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17186 (x_own_selection, Fx_disown_selection_internal): Rename locals
17187 to avoid shadowing.
17188 (x_handle_dnd_message): Remove local to avoid shadowing.
17189
17190 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17191 so that the caller can use some name other than gcpro1.
17192 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17193 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17194 (Fx_backspace_delete_keys_p):
17195 Use them to avoid shadowing, and rename vars to avoid shadowing.
17196 (x_decode_color, x_set_name, x_window): Now static.
17197 (Fx_create_frame): Add braces to silence GCC warning.
17198 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17199 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17200 Remove unused locals.
17201 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17202 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17203 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17204 macros.
17205
17206 * xterm.h (x_mouse_leave): New decl.
17207
17208 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17209 Remove unused functions.
17210 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17211 (x_calc_absolute_position): Now static.
17212 (XTread_socket): Don't define label "out" unless it's used.
17213 Don't declare local "event" unless it's used.
17214 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17215 unless they are used.
17216 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17217 (x_fatal_error_signal): Remove; not used.
17218 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17219 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17220 (x_error_catcher, x_connection_closed, x_error_handler):
17221 (x_error_quitter, xembed_send_message, x_iconify_frame):
17222 (my_log_handler): Rename locals to avoid shadowing.
17223 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17224 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17225
17226 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17227 Rename or move locals to avoid shadowing.
17228 (tty_defined_color, merge_face_heights): Now static.
17229 (free_realized_faces_for_fontset): Remove; not used.
17230 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17231 does not deduce is never used uninitialized.
17232 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17233 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17234
17235 * terminal.c (store_terminal_param): Now static.
17236
17237 * xmenu.c (menu_highlight_callback): Now static.
17238 (set_frame_menubar): Remove unused local.
17239 (xmenu_show): Rename parameter to avoid shadowing.
17240 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17241 since they might point to immutable storage.
17242 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17243 since it's unused otherwise.
17244
17245 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17246 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17247 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17248 avoids a gcc -Wuninitialized diagnostic.
17249 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17250 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17251 does not deduce are never used uninitialized.
17252
17253 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17254
17255 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17256 * window.c (window_loop, size_window):
17257 (run_window_configuration_change_hook, enlarge_window): Likewise.
17258
17259 * window.c (display_buffer): Now static.
17260 (size_window): Mark variables that gcc -Wuninitialized
17261 does not deduce are never used uninitialized.
17262 * window.h (check_all_windows): New decl, to forestall
17263 gcc -Wmissing-prototypes diagnostic.
17264 * dispextern.h (bidi_dump_cached_states): Likewise.
17265
17266 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17267 shadowing.
17268 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17269 Include <limits.h>.
17270 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17271 and to avoid gcc -Wuninitialized warning.
17272 (load_charset_map): Mark variables that gcc -Wuninitialized
17273 does not deduce are never used uninitialized.
17274 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17275
17276 * coding.c (coding_set_source, coding_set_destination):
17277 Use "else { /* comment */ }" rather than "else /* comment */;"
17278 for clarity, and to avoid gcc -Wempty-body warning.
17279 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17280 a block, when the outer 'i' will do.
17281 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17282 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17283 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17284 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17285 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17286 Rename locals to avoid shadowing.
17287 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17288 * coding.c (emacs_mule_char, encode_invocation_designation):
17289 Now static, since they're not used elsewhere.
17290 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17291 (decode_coding_object, encode_coding_object, detect_coding_system):
17292 (decode_coding_emacs_mule): Mark variables that gcc
17293 -Wuninitialized does not deduce are never used uninitialized.
17294 (detect_coding_iso_2022): Initialize a local variable that might
17295 be used uninitialized. Leave a FIXME because it's not clear that
17296 this initialization is needed. (Bug#8211)
17297 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17298 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17299 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17300 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17301 Remove unused macros.
17302
17303 * category.c (hash_get_category_set): Remove unused local var.
17304 (copy_category_table): Now static, since it's not used elsewhere.
17305 * character.c (string_count_byte8): Likewise.
17306
17307 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17308 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17309
17310 * chartab.c (copy_sub_char_table): Now static, since it's not used
17311 elsewhere.
17312 (sub_char_table_ref_and_range, char_table_ref_and_range):
17313 Rename locals to avoid shadowing.
17314 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17315
17316 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17317 (BIDI_BOB): Remove unused macro.
17318
17319 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17320 deduce are never used uninitialized.
17321 * term.c (encode_terminal_code): Likewise.
17322
17323 * term.c (encode_terminal_code): Now static. Remove unused local.
17324
17325 * tparam.h: New file.
17326 * term.c, tparam.h: Include it.
17327 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17328 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17329 Move these decls to tparam.h, and make them agree with what
17330 is actually in tparam.c. The previous trick of using incompatible
17331 decls in different modules does not conform to the C standard.
17332 All callers of tparam changed to use tparam's actual API.
17333 * tparam.c (tparam1, tparam, tgoto):
17334 Use const pointers where appropriate.
17335
17336 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17337 * cm.h (struct cm): Likewise.
17338 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17339 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17340 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17341 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17342 (turn_on_face, init_tty): Likewise.
17343 * termchar.h (struct tty_display_info): Likewise.
17344
17345 * term.c (term_mouse_position): Rename local to avoid shadowing.
17346
17347 * alloc.c (mark_ttys): Move decl from here ...
17348 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17349
17350 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17351
17352 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17353
17354 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17355
17356 * search.c (compile_pattern_1): Remove argument regp, unused since
17357 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17358 (compile_pattern): Don't pass it.
17359
17360 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17361
17362 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17363 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17364 for ! HAVE_GTK3.
17365 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17366
17367 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17368
17369 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17370 gdk_window_get_screen, gdk_window_get_geometry,
17371 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17372 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17373 (xg_get_pixbuf_from_pixmap): New function.
17374 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17375 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17376 Call xg_get_pixbuf_from_pixmap instead of
17377 gdk_pixbuf_get_from_drawable.
17378 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17379 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17380 (xg_check_special_colors): Use GtkStyleContext and its functions
17381 for HAVE_GTK3.
17382 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17383 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17384 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17385 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17386 Call gtk_widget_get_preferred_size.
17387 (xg_frame_resized): gdk_window_get_geometry only takes 5
17388 parameters.
17389 (xg_win_to_widget, xg_event_is_for_menubar):
17390 Call gdk_x11_window_lookup_for_display.
17391 (xg_set_widget_bg): New function.
17392 (delete_cb): New function.
17393 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17394 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17395 (xg_set_background_color): Call xg_set_widget_bg.
17396 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17397 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17398 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17399 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17400 if ! HAVE_GTK3.
17401 (update_frame_tool_bar): Call gtk_widget_hide.
17402 (xg_initialize): Use GDK_KEY_g.
17403
17404 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17405 if ! HAVE_GTK3
17406 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17407
17408 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17409 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17410 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17411
17412 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17413
17414 * w32xfns.c (select_palette): Check success of RealizePalette against
17415 GDI_ERROR, not zero.
17416
17417 See ChangeLog.11 for earlier changes.
17418
17419 ;; Local Variables:
17420 ;; coding: utf-8
17421 ;; End:
17422
17423 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17424
17425 This file is part of GNU Emacs.
17426
17427 GNU Emacs is free software: you can redistribute it and/or modify
17428 it under the terms of the GNU General Public License as published by
17429 the Free Software Foundation, either version 3 of the License, or
17430 (at your option) any later version.
17431
17432 GNU Emacs is distributed in the hope that it will be useful,
17433 but WITHOUT ANY WARRANTY; without even the implied warranty of
17434 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17435 GNU General Public License for more details.
17436
17437 You should have received a copy of the GNU General Public License
17438 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.