Fix list duplication error in define_image_type.
[bpt/emacs.git] / src / ChangeLog
1 2012-09-21 Chong Yidong <cyd@gnu.org>
2
3 * image.c (define_image_type): Avoid adding duplicate types to
4 image_types (Bug#12463). Suggested by Jörg Walter.
5
6 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7
8 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
9 (print_load_command_name): Add case LC_DATA_IN_CODE.
10 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
11
12 2012-09-21 Glenn Morris <rgm@gnu.org>
13
14 * eval.c (Frun_hook_with_args_until_success)
15 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
16
17 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
18
19 * fileio.c (Ffile_selinux_context): Only call freecon when
20 lgetfilecon succeeded.
21 (Fset_file_selinux_context): Likewise. (Bug#12444)
22
23 2012-09-21 Eli Zaretskii <eliz@gnu.org>
24
25 * xdisp.c (try_window_reusing_current_matrix): Under bidi
26 reordering, locate the cursor by calling set_cursor_from_row; if
27 that fails, clear the desired glyph matrix before returning a
28 failure indication to the caller. Fixes leaving garbled display
29 when fast scrolling with a down-key. (Bug#12403)
30 (compute_stop_pos_backwards): Fix a typo that caused crashes while
31 scrolling through multibyte text.
32
33 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
34
35 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
36 calling mark_vectorlike since that's the one that marks the window.
37 (mark_discard_killed_buffers): Mark the final cdr.
38 * window.h (struct window): Move prev/next_buffers to the
39 non-standard fields.
40 * window.c (make_window): Initialize prev/next_buffers manually.
41
42 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
43
44 Omit unused arg EXPECTED from socket hooks.
45 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
46 * nsterm.m (ns_term_init):
47 * termhooks.h (struct terminal.read_socket_hook):
48 * w32inevt.c (w32_console_read_socket):
49 * w32term.c (w32_read_socket):
50 * xterm.c (XTread_socket):
51 Omit unused arg EXPECTED. All callers changed.
52 (store_user_signal_events): Return void, not int, since callers no
53 longer care about the return value. All uses changed.
54
55 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
56
57 * w32gui.h (XParseGeometry): Do not declare.
58
59 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
60
61 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
62 Ignore 'expected'. See Eli Zaretskii in
63 <http://bugs.gnu.org/12471#8> (last line).
64
65 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
66 (XParseGeometry): Now static. Substitute extremal values for
67 values that are out of range.
68
69 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
70
71 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
72
73 * nsfns.m (XParseGeometry): Remove.
74 (Fx_create_frame): Call x_set_offset to correctly interpret
75 top_pos in geometry.
76
77 * frame.c (read_integer, XParseGeometry): Moved from w32xfns.c.
78 (Fx_parse_geometry): If there is a space in string, call
79 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
80
81 2012-09-17 Eli Zaretskii <eliz@gnu.org>
82
83 * search.c (scan_buffer): Use character positions in calls to
84 region_cache_forward and region_cache_backward, not byte
85 positions. (Bug#12196)
86
87 * w32term.c (w32_read_socket): Set pending_signals to 1, like
88 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
89
90 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
91 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
92 emacs_blocked_malloc, now deleted.
93
94 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
95
96 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
97 The workaround was for improving performance on Solaris 2.4, but
98 is getting in the way now. Emacs will still work if someone is
99 still running Solaris 2.4 in a museum somewhere; Sun dropped
100 support for Solaris 2.4 in 2003.
101 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
102 * process.c (create_process) [HAVE_WORKING_VFORK]:
103 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
104 since Emacs no longer uses vfork on that platform.
105
106 2012-09-17 Glenn Morris <rgm@gnu.org>
107
108 * emacs.c: Use COPYRIGHT.
109
110 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
111
112 Remove configure's --without-sync-input option (Bug#12450).
113 When auditing signal-handling in preparation for cleaning it up,
114 I found that SYNC_INPUT has race conditions and would be a real
115 pain to fix. Since it's an undocumented and deprecated
116 configure-time option, now seems like a good time to remove it.
117 Also see <http://bugs.gnu.org/11080#16>.
118 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
119 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
120 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
121 (malloc_hysteresis):
122 (check_depth) [XMALLOC_OVERRUN_CHECK]:
123 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
124 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
125 (dont_register_blocks, bytes_used_when_reconsidered)
126 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
127 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
128 [!SYSTEM_MALLOC && !SYNC_INPUT]:
129 Remove. All uses removed.
130 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
131 implementation, one that depends on whether the new macro
132 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
133 is defined.
134 * atimer.c (run_timers, handle_alarm_signal):
135 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
136 (handle_async_input, process_pending_signals)
137 (handle_input_available_signal, init_keyboard):
138 * nsterm.m (ns_read_socket):
139 * process.c (wait_reading_process_output):
140 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
141 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
142 (emacs_write):
143 * xterm.c (XTread_socket):
144 Assume SYNC_INPUT.
145 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
146 * eval.c (handling_signal): Remove. All uses removed.
147 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
148 All uses replaced with the SYNC_INPUT version.
149 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
150 Remove decls.
151 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
152 Now static.
153
154 * font.c (Ffont_shape_gstring): Remove unused local.
155
156 2012-09-16 Glenn Morris <rgm@gnu.org>
157
158 * Makefile.in (clean): No longer run nextstep's clean.
159
160 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
161 (ns_frag): Remove.
162 (ns-app): Move here from ns.mk, and simplify.
163 (clean): Simplify nextstep entry.
164 * ns.mk: Remove file.
165
166 2012-09-16 Kenichi Handa <handa@gnu.org>
167
168 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
169 not covert the last few charactes.
170
171 2012-09-16 Kenichi Handa <handa@gnu.org>
172
173 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
174 here, but just check the validity of glyphs in the glyph-string.
175
176 2012-09-16 Martin Rudalics <rudalics@gmx.at>
177
178 * window.c (Fwindow_parameter, Fset_window_parameter): Accept
179 any window as argument (Bug#12452).
180
181 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
182
183 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
184 to ns_term_init to avoid memory leak.
185
186 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
187 explicit retain/release.
188 (ns_term_init): Only allow one display. Initialize outerpool and
189 ns_*_types.
190
191 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
192
193 Port _setjmp fix to POSIXish hosts as well as Microsoft.
194 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
195 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
196 the Microsoft problem in a different way, by altering ../nt/config.nt.
197
198 2012-09-15 Eli Zaretskii <eliz@gnu.org>
199
200 * w32xfns.c:
201 * w32uniscribe.c:
202 * w32term.c:
203 * w32select.c:
204 * w32reg.c:
205 * w32proc.c:
206 * w32menu.c:
207 * w32inevt.c:
208 * w32heap.c:
209 * w32font.c:
210 * w32fns.c:
211 * w32console.c:
212 * w32.c:
213 * w16select.c: Remove inclusion of setjmp.h, as it is now included
214 by lisp.h. This completes removal of setjmp.h inclusion
215 erroneously announced in the previous commit. (Bug#12446)
216
217 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
218 more accurate.
219
220 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
221 not defined as a macro. The latter happens on MS-Windows.
222 (Bug#12446)
223
224 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
225
226 Port better to POSIX hosts lacking _setjmp (Bug#12446).
227 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
228 Some instances of '#include <setjmp.h>' removed, if the
229 only reason for the instance was because "lisp.h" was included.
230 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
231 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
232 and _longjmp with the new symbols. Emacs already uses _setjmp if
233 available, so this change affects only POSIXish hosts that have
234 sigsetjmp but not _setjmp, such as some versions of Solaris and
235 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
236 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
237 (png_load_body) [HAVE_PNG]:
238 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
239 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
240 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
241 since PNG requires jmp_buf. This is the only exception to the
242 general rule that we now use sys_setjmp and sys_longjmp.
243 This exception is OK since this code does not change the signal
244 mask or longjmp out of a signal handler.
245
246 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
247
248 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
249 Include "syssignal.h", for 'main_thread'.
250
251 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
252
253 Avoid out-of-range marker position (Bug#12426).
254 * insdel.c (replace_range, replace_range_2): Adjust
255 markers before overlays, as suggested by comments.
256 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
257 Remove redundant check before calling offset_intervals.
258
259 2012-09-14 Martin Rudalics <rudalics@gmx.at>
260
261 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
262 current buffer (Bug#12387).
263
264 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
265
266 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
267
268 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
269
270 Use a more backwards-compatible timer format (Bug#12430).
271 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
272 vector element, not from the 4th, since PSECS is now at the end.
273 (Fcurrent_idle_time): Doc fix.
274
275 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
276
277 Function to mark objects and remove killed buffers at once.
278 * alloc.c (discard_killed_buffers): Rename to ...
279 (mark_discard_killed buffers) ... new name. Add marking
280 of remaining objects. Fix comment. Adjust users.
281 (mark_object): Do not touch frame buffer lists here.
282 * frame.c (delete_frame): Reset frame buffer lists here.
283
284 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
285
286 Better workaround for GNOME bug when --enable-gcc-warnings.
287 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
288 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
289 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
290
291 Simplify SIGIO usage (Bug#12408).
292 The code that dealt with SIGIO was crufty and confusing, e.g., it
293 played tricks like "#undef SIGIO" but these tricks were not used
294 consistently. Simplify mostly by not #undeffing standard symbols,
295 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
296 or not as we please) rather than "defined SIGIO" (standard symbol
297 that we probably shouldn't #undef).
298 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
299 Modules that need it can include it.
300 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
301 * dispextern.h (ignore_sigio): New decl.
302 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
303 unconditionally, since it's now a no-op if !USABLE_SIGIO.
304 * emacs.c (shut_down_emacs):
305 * keyboard.c (kbd_buffer_store_event_hold):
306 Use ignore_sigio rather than invoking 'signal' directly.
307 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
308 for FIONREAD.
309 (FIONREAD, SIGIO): Do not #undef.
310 (tty_read_avail_input): Use #error rather than a syntax error.
311 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
312 for I_PIPE, used by SETUP_SLAVE_PTY.
313 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
314 * sysdep.c (croak): Remove; no longer needed. This bit of
315 temporary code, with Fred N. Fish's comment that it's temporary,
316 has been in Emacs since at least 1992!
317 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
318 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
319 * syssignal.h (croak): Remove decl.
320 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
321 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
322 now that we're termios-only.
323 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
324 * term.c (dissociate_if_controlling_tty): Use #error rather than
325 a run-time error.
326
327 Work around GCC and GNOME bugs when --enable-gcc-warnings.
328 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
329 to work around GNOME bug 683906.
330 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
331 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
332 This works around GCC bug 54561.
333
334 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
335
336 More fixes for 'volatile' and setjmp/longjmp.
337 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
338 * image.c (struct png_load_context) [HAVE_PNG]: New type.
339 (png_load_body) [HAVE_PNG]:
340 (jpeg_load_body) [HAVE_JPEG]:
341 New function, with most of the old parent function's body.
342 (png_load) [HAVE_PNG]:
343 (jpeg_load) [HAVE_JPEG]:
344 Invoke the new function, to avoid longjmp munging our locals.
345 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
346 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
347 longjmp is passed 2, as the C standard doesn't guarantee this.
348 Instead, store the failure code into mgr->failure_code.
349
350 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
351
352 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
353 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
354 (syms_of_keyboard): Remove support for unread-command-char.
355
356 2012-09-12 Eli Zaretskii <eliz@gnu.org>
357
358 * w32proc.c (sys_kill): If PID is our process ID and the signal is
359 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
360 violation. (Bug#12426)
361
362 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
363
364 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
365
366 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
367
368 * eval.c: Add `inhibit-debugger'.
369 (Qinhibit_debugger): New symbol.
370 (call_debugger): Bind it instead of Qdebug_on_error.
371 (maybe_call_debugger): Test Vinhibit_debugger.
372 (syms_of_eval): Define inhibit-debugger.
373 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
374 (syms_of_xdisp): Remove inhibit-debug-on-message.
375
376 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
377
378 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
379 If a nonvolatile local variable is written before a _longjmp to
380 the frame containing the variable, and is read after the _longjmp,
381 the value read is indeterminate. Some local variables of type
382 'struct handler' and 'struct catchtag' are used in this way, so
383 mark each of their slots as volatile if the slot can be set before
384 _longjmp and read afterwards.
385 * lisp.h (struct handler): var and chosen_clause are now volatile.
386 (struct catchtag): val, next, and pdlcount are now volatile.
387
388 * bidi.c (bidi_push_it, bidi_pop_it):
389 * fns.c (copy_hash_table):
390 * image.c (define_image_type):
391 * keyboard.c (kbd_buffer_store_event_hold):
392 * process.c (Fprocess_send_eof):
393 * xfaces.c (x_create_gc) [HAVE_NS]:
394 * xgselect.c (xg_select):
395 Prefer assignment to memcpy when either will do.
396
397 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
398 Use pointer-to-a-pointer to simplify and avoid a NILP check each
399 time an item is removed. No need to mark this function 'inline';
400 the compiler knows better than we do.
401
402 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
403
404 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
405 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
406 to change_frame_size (Bug#12388).
407 (windowDidResize:): Pass YES to updateFrameSize.
408
409 * nsterm.h: Add delay parameter to updateFrameSize.
410
411 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
412
413 Discard killed buffers from deleted window and frame objects.
414 This reduces an amount of references to killed buffers and
415 helps GC to reclaim them faster.
416 * alloc.c (discard_killed_buffers): New function.
417 (mark_object): Use it for deleted windows and frames.
418 (mark_object): If symbol's value is set up for a killed buffer
419 or deleted frame, restore it's global binding.
420 * data.c (swap_in_global_binding): Add GC notice.
421 (swap_in_symval_forwarding): Use convenient set_blv_where.
422 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
423 * window.h: ... to here.
424
425 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
426
427 Convenient macro to check whether the buffer is live.
428 * buffer.h (BUFFER_LIVE_P): New macro.
429 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
430 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
431
432 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
433
434 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
435 composition cases (Bug#12364).
436
437 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
438 overhang of succeeding glyphs overlapping box cursor.
439
440 * w32term.c (x_draw_glyph_string): Likewise.
441
442 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
443
444 Simplify, document, and port floating-point (Bug#12381).
445 The porting part of this patch fixes bugs on non-IEEE platforms
446 with frexp, ldexp, logb.
447 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
448 Now static.
449 * floatfns.c: Simplify discussion of functions that Emacs doesn't
450 support, by removing commented-out code and briefly listing the
451 C89 functions excluded. The commented-out stuff was confusing
452 maintenance, e.g., we thought we needed cbrt but it was commented out.
453 (logb): Remove decl; no longer needed.
454 (isfinite): New macro, if not already supplied.
455 (isnan): Don't replace any existing macro.
456 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
457 are present on all C89 platforms.
458 (Ffrexp): Do not special-case zero, as frexp does the right thing
459 for that case.
460 (Flogb): Do not use logb, as it doesn't have the desired meaning
461 on hosts that use non-base-2 floating point. Instead, stick with
462 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
463 frexp, to avoid getting an unspecified result.
464
465 * xdisp.c (Qinhibit_debug_on_message): Now static.
466
467 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
468
469 * nsterm.m (ns_update_begin): Set clip path to whole view by using
470 NSBezierPath (Bug#12131).
471
472 2012-09-10 Chong Yidong <cyd@gnu.org>
473
474 * fns.c (Fdelq, Fdelete): Doc fix.
475
476 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
477
478 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
479 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
480
481 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
482
483 * lisp.h (make_lisp_ptr): New macro to replace XSET.
484 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
485 Use it.
486
487 2012-09-09 Eli Zaretskii <eliz@gnu.org>
488
489 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
490 left fringe if the window has a left margin. This avoids leaving
491 traces of the cursor because its leftmost pixel is not drawn over.
492
493 * dispnew.c (update_window_line): When the left margin area of a
494 screen line is updated, set the redraw_fringe_bitmaps_p flag of
495 that screen line. (Bug#12277)
496
497 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
498
499 Assume C89 or later for math functions (Bug#12381).
500 This simplifies the code, and makes it a bit smaller and faster,
501 and (most important) makes it easier to clean up signal handling
502 since we can stop worring about floating-point exceptions in
503 library code. That was a problem before C89, but the problem
504 went away many years ago on all practical Emacs targets.
505 * data.c, image.c, lread.c, print.c:
506 Don't include <math.h>; no longer needed.
507 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
508 might be autoconfigured, as that never happens.
509 * data.c (fmod):
510 * doprnt.c (DBL_MAX_10_EXP):
511 * print.c (DBL_DIG):
512 Remove. C89 or later always defines these.
513 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
514 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
515 (arith_error, domain_error, domain_error2):
516 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
517 no longer needed -- we simply return what C returns. All uses removed.
518 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
519 the wrapped code.
520 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
521 Remove. All uses expanded, as these macros are no longer used
522 more than once and are now more trouble than they're worth.
523 (Ftan): Use tan, not sin / cos.
524 (Flogb): Assume C89 frexp.
525 (fmod_float): Assume C89 fmod.
526 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
527 (init_floatfns): Remove. All uses removed.
528
529 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
530
531 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
532 compositeToPoint for OSX < 10.6 (Bug#12390).
533
534 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
535
536 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
537 This produces more-accurate results.
538
539 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
540
541 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
542 changes (Bug#12088).
543
544 2012-09-08 Chong Yidong <cyd@gnu.org>
545
546 * syntax.c (Fstring_to_syntax): Doc fix.
547
548 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
549
550 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
551 in the internal border.
552 (x_set_window_size): Remove static variables and their usage.
553 (ns_redraw_scroll_bars): Fix NSTRACE arg.
554 (ns_after_update_window_line, ns_draw_fringe_bitmap): Remove
555 fringe/internal border adjustment (Bug#11052).
556 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
557 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
558 (ns_fix_rect_ibw): Remove.
559 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
560 (ns_dumpglyphs_box_or_relief): Ditto.
561 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
562 adjustment.
563 (ns_dumpglyphs_image): Ditto.
564 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
565 border adjustment.
566 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
567 their usage. Add fringe_extended_p and its use as in other terms.
568 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
569 scroll bar was removed.
570 (updateFrameSize): New function.
571 (windowDidResize): Move code to updateFrameSize and call it.
572
573 * nsterm.h (EmacsView): Add updateFrameSize.
574
575 2012-09-07 Chong Yidong <cyd@gnu.org>
576
577 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
578
579 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
580
581 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
582
583 More signal-handler cleanup (Bug#12327).
584 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
585 Problem introduced when merging patches. Noted by Eli Zaretskii in
586 <http://bugs.gnu.org/12327#67>.
587 * floatfns.c: Comment fix.
588 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
589 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
590 and anyway the declaration is harmless even if SIGDANGER is not defined.
591 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
592 defined BROKEN_FIONREAD). systty.h formerly did this, but other
593 source files not surprisingly expected syssignal.h to define, or
594 not define, SIGIO, and it's cleaner to do it that way, for consistency.
595 Include <sys/ioctl.h>, for FIONREAD.
596 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
597 This eliminates a problem whereby other files mysteriously had
598 to include "syssignal.h" before including "systty.h" if they
599 wanted to use "#ifdef SIGIO".
600
601 2012-09-07 Eli Zaretskii <eliz@gnu.org>
602
603 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
604
605 * w32.c (sigemptyset): Empty the set.
606 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
607
608 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
609
610 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
611
612 * alloc.c (mark_buffer): Revert unsafe marking optimization.
613 (mark_object): Likewise for frame objects.
614
615 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
616
617 * syssignal.h (handle_on_main_thread): Always declare,
618 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
619 This ports to platforms without HAVE_PTHREAD.
620
621 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
622
623 Signal-handler cleanup (Bug#12327).
624 Emacs's signal handlers were written in the old 4.2BSD style with
625 sigblock and sigmask and so forth, and this led to some
626 inefficiencies and confusion. Rewrite these to use
627 pthread_sigmask etc. without copying signal sets around. Also,
628 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
629 'signal', and instead use functions that do not attempt to take
630 over the system name space. This patch causes Emacs's text
631 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
632 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
633 Do not include <signal.h> or "syssignal.h", as these
634 modules do not use signals.
635 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
636 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
637 Do not include <signal.h>, as "syssignal.h" does that for us now.
638 * atimer.c (sigmask_atimers): New function.
639 (block_atimers, unblock_atimers): New functions,
640 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
641 All uses replaced.
642 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
643 no longer needed here.
644 * emacs.c (main): Inspect existing signal handler with sigaction,
645 so that there's no need to block and unblock SIGHUP.
646 * sysdep.c (struct save_signal): New member 'action', replacing
647 old member 'handler'.
648 (save_signal_handlers, restore_signal_handlers):
649 Use sigaction instead of 'signal' to save and restore.
650 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
651 New function. All users of 'signal' modified to use set_sighandler
652 if they're writeonly, and to use sys_signal if they're read+write.
653 (emacs_sigaction_init, forwarded_signal): New functions.
654 (sys_signal): Remove. All uses replaced by calls to sigaction
655 and emacs_sigaction_init, or by direct calls to 'signal'.
656 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
657 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
658 all uses replaced by pthread_sigmask etc. calls.
659 * syssignal.h: Include <signal.h>.
660 (emacs_sigaction_init, forwarded_signal): New decls.
661 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
662 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
663 (sigmask, sys_sigmask): Remove; no longer needed.
664 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
665 (sigblock, sigunblock, sigfree):
666 (sigsetmask) [!defined sigsetmask]:
667 Remove. All uses replaced by pthread_sigmask.
668 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
669 no longer need to be replaced, and its typical old uses
670 are now done via emacs_sigaction_init and sigaction.
671 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
672 (sys_sigdel): Remove; unused.
673 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
674
675 2012-09-06 Eli Zaretskii <eliz@gnu.org>
676
677 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
678 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
679
680 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
681
682 Explicitly mark buffer_defaults and buffer_local_symbols.
683 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
684 mark_local_symbols here.
685 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
686 since special buffers aren't marked here any more.
687 (allocate_buffer): Chain new buffer with all_buffers here...
688 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
689 not here.
690 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
691 (syms_of_buffer): Remove staticpro of the above.
692 (init_buffer_once): Set names for buffer_defaults and
693 buffer_local_symbols.
694
695 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
696
697 Use bool for booleans in font-related modules.
698 * font.c (font_intern_prop, font_style_to_value)
699 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
700 (generate_otf_features, font_check_otf_features, font_check_otf)
701 (font_match_p, font_list_entities, font_at):
702 * fontset.c (fontset_id_valid_p, reorder_font_vector
703 (fontset_find_font, Fset_fontset_font)
704 (face_suitable_for_char_p) [0]:
705 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
706 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
707 (m17n_flt_initialized, ftfont_shape_by_flt):
708 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
709 * nsfont.m (nsfont_draw):
710 * w32font.c (w32font_draw):
711 * w32term.c (x_draw_glyphless_glyph_string_foreground):
712 Use bool for booleans.
713 * font.h: Adjust to above API changes.
714 (struct font, struct font_driver, struct font_driver_list):
715 Use bool for booleans.
716 (struct font): Remove useless member encoding_type.
717 All users removed.
718 * fontset.c, xftfont.c: Omit unnecessary static decls.
719
720 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
721
722 * alloc.c (mark_object): Revert window marking code
723 since it's unsafe for the Fset_window_configuration.
724
725 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
726
727 Fix race conditions with signal handlers and errno (Bug#12327).
728 Be more systematic about preserving errno whenever a signal
729 handler returns, even if it's not in the main thread. Do this by
730 renaming signal handlers to distinguish between signal delivery
731 and signal handling. All uses changed.
732 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
733 * data.c (deliver_arith_signal): Rename from arith_error.
734 * dispnew.c (deliver_window_change_signal): Rename from
735 window_change_signal.
736 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
737 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
738 * keyboard.c (deliver_input_available_signal): Rename from
739 input_available_signal.
740 (deliver_user_signal): Rename from handle_user_signal.
741 (deliver_interrupt_signal): Rename from interrupt_signal.
742 * process.c (deliver_pipe_signal): Rename from send_process_trap.
743 (deliver_child_signal): Rename from sigchld_handler.
744 * atimer.c (handle_alarm_signal):
745 * data.c (handle_arith_signal):
746 * dispnew.c (handle_window_change_signal):
747 * emacs.c (handle_fatal_signal, handle_danger_signal):
748 * keyboard.c (handle_input_available_signal):
749 * keyboard.c (handle_user_signal, handle_interrupt_signal):
750 * process.c (handle_pipe_signal, handle_child_signal):
751 New functions, with the actual signal-handling code taken from the
752 original respective signal handlers, sans the sporadic attempts to
753 preserve errno, since that's now done by handle_on_main_thread.
754 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
755 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
756 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
757 Move to sysdep.c.
758 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
759 Move initialization of main_thread to sysdep.c's init_signals.
760 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
761 our usage, and simplifies the mainline code.
762 (record_child_status_change): New static function, as a helper
763 for handle_child_signal, and with most of the old child handler's
764 contents.
765 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
766 (handle_child_signal): Use the above.
767 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
768 Moved here from emacs.c.
769 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
770 code moved here from emacs.c's main function.
771 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
772 replacing the old SIGNAL_THREAD_CHECK. All uses changed. This
773 lets callers save and restore errno properly.
774
775 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
776
777 Remove redundant or unused things here and there.
778 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
779 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
780 * editfns.c (Fcompare_buffer_substrings): Likewise.
781 * frame.h (struct terminal, struct font_driver_list):
782 Remove redundant declarations.
783 * window.h (Qleft, Qright): Likewise.
784
785 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
786
787 Do not mark objects from deleted buffers, windows and frames.
788 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
789 (mark_object): Likewise for windows and frames.
790
791 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
792
793 * alloc.c (valid_lisp_object_p): Treat killed buffers,
794 buffer_defaults and buffer_local_symbols as valid objects.
795 Return special value to denote them.
796
797 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
798
799 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
800 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
801 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
802 (file_name_absolute_p, Fsubstitute_in_file_name):
803 (check_executable, check_writable, Ffile_accessible_directory_p)
804 (Fset_file_selinux_context, Fdefault_file_modes)
805 (Finsert_file_contents, choose_write_coding_system)
806 (Fwrite_region, build_annotations, a_write, e_write)
807 (Fdo_auto_save):
808 * filelock.c (boot_time_initialized, get_boot_time)
809 (get_boot_time_1, lock_file_1, within_one_second):
810 * floatfns.c (in_float):
811 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
812 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
813 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
814 * lisp.h (struct Lisp_Hash_Table.cmpfn):
815 * window.c (compare_window_configurations):
816 Use bool for booleans.
817 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
818 (Fdefault_file_modes): Now mode_t, not int, for modes.
819 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
820 (internal_delete_file): Now returns void, not a (boolean) int,
821 since nobody was looking at the return value.
822 * lisp.h, window.h: Adjust to above API changes.
823
824 * xdisp.c (set_message): Simplify and reindent last change.
825
826 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
827
828 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
829
830 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
831
832 * eval.c (call_debugger): Make the function non-static so that we
833 can call it from set_message.
834
835 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
836 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
837
838 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
839
840 Give more-useful info on a fatal error (Bug#12328).
841 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
842 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
843 of doing the work ourselves.
844 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
845 do most of the work.
846 (fatal_error_backtrace): New function, taken from the guts
847 of the old fatal_error_signal, but with a new option to output
848 a backtrace.
849 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
850 info about the signal than just its number.
851 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
852 * sysdep.c: Include <execinfo.h>
853 (emacs_backtrace): New function, taken partly from the previous
854 code of the 'die' function.
855 (emacs_abort): Call fatal_error_backtrace rather than abort.
856
857 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
858
859 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
860 eager (load-time) macro-expansion.
861 * lisp.mk (lisp): Add macroexp.
862
863 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
864
865 Simplify redefinition of 'abort' (Bug#12316).
866 Do not try to redefine the 'abort' function. Instead, redo
867 the code so that it calls 'emacs_abort' rather than 'abort'.
868 This removes the need for the NO_ABORT configure-time macro
869 and makes it easier to change the abort code to do a backtrace.
870 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
871 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
872 Remove; sysdep.c's emacs_abort now takes its place.
873 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
874 'abort' changed to use 'emacs_abort'.
875 * msdos.c (dos_abort) [defined abort]: Remove; not used.
876 (abort) [!defined abort]: Rename to ...
877 (emacs_abort): ... new name.
878 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
879 the place of the old 'abort' in emacs.c.
880 * w32.c, w32fns.c (abort): Do not #undef.
881 * w32.c (emacs_abort): Rename from w32_abort.
882
883 2012-09-04 Eli Zaretskii <eliz@gnu.org>
884
885 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
886 offsets[j].dv, since the y axis of the screen coordinates points
887 down, while the y axis of the font definition coordinates points
888 up. This fixes display of Arabic diacritics such as KASRA and
889 KASRATAN. (Bug#11860)
890
891 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
892
893 Be more systematic about _setjmp vs setjmp.
894 * alloc.c (test_setjmp, mark_stack):
895 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
896 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
897 (png_load, my_error_exit, jpeg_load):
898 * process.c (send_process_trap, send_process):
899 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
900 The underscored versions are up to 30x faster on some hosts.
901 Formerly, the code used setjmp+longjmp sometimes and
902 _setjmp+_longjmp at other times, with no particular reason to
903 prefer setjmp+longjmp.
904
905 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
906
907 Fix minor problem found by static checking.
908 * buffer.c (Fdelete_all_overlays): Return nil.
909
910 2012-09-03 Martin Rudalics <rudalics@gmx.at>
911
912 * buffer.c (Fdelete_all_overlays): New function.
913
914 2012-09-03 Chong Yidong <cyd@gnu.org>
915
916 * gtkutil.c: Add extern decl for Qxft.
917
918 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
919
920 * emacs.c, eval.c: Use bool for boolean.
921 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
922 (malloc_using_checking) [DOUG_LEA_MALLOC]:
923 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
924 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
925 (main, decode_env_path, Fdaemon_initialized):
926 * eval.c (call_debugger, Finteractive_p, interactive_p):
927 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
928 (maybe_call_debugger, Fbacktrace):
929 * process.c (read_process_output, exec_sentinel):
930 Use bool for booleans.
931 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
932 All callers changed.
933 * eval.c (interactive_p): Omit always-true boolean argument
934 EXCLUDE_SUBRS_P. All callers changed.
935 * dispextern.h, lisp.h: Reflect above API changes.
936 * firstfile.c (dummy): Use the address of 'main', whose signature
937 won't change, instead of the address of 'initialize', whose
938 signature just changed from int to bool.
939 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
940 * msdos.c (fatal_error_in_progress): ... from here.
941 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
942 of incrementing it.
943 (redisplay_internal, unwind_redisplay): Simply clear
944 REDISPLAYING_P when unwinding, instead of saving its previous,
945 always-false value and then restoring it.
946
947 Clean up some extern decls.
948 Mostly, this hoists extern decls out of .c files and into .h files.
949 That way, we're more likely to catch errors if the interfaces change.
950 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
951 declare xg_mark_data.
952 * dispextern.h (x_frame_parm_handlers):
953 * font.h (Qxft):
954 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
955 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
956 (Qultra_bold, Qoblique, Qitalic):
957 Move extern decl here from .c file.
958 * alloc.c (xg_mark_data) [USE_GTK]:
959 * doc.c (Qclosure):
960 * eval.c (Qlexical_binding):
961 * fns.c (time) [!HAVE_UNISTD_H]:
962 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
963 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
964 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
965 * lread.c (Qinternal_interpreter_environment):
966 * minibuf.c (Qbuffer):
967 * process.c (QCfamily, QCfilter):
968 * widget.c (free_frame_faces):
969 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
970 * xfont.c (x_clear_errors):
971 * xterm.c (x_frame_parm_handlers):
972 Remove now-redundant extern decls.
973 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
974 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
975 Now static.
976 * xfaces.c: Remove unnecessary static decls.
977 * xterm.c (updating_frame): Remove decl of nonexistent object.
978
979 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
980 when building globals.h, as the objects that are not built on
981 this host are not needed to compile C files on this host.
982
983 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
984
985 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
986
987 * frame.h: Add missing prototype for x_wm_set_size_hint.
988
989 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
990
991 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
992 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
993 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
994 (Fsubstitute_command_keys):
995 * editfns.c (region_limit, find_field, Fconstrain_to_field)
996 (save_excursion_save, save_excursion_restore)
997 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
998 (format_time_string, general_insert_function)
999 (make_buffer_string, make_buffer_string_both)
1000 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
1001 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
1002 (copy_text, insert_1, insert_1_both, insert_from_string)
1003 (insert_from_string_before_markers, insert_from_string_1)
1004 (insert_from_buffer, insert_from_buffer_1, replace_range)
1005 (replace_range_2, del_range_1, del_range_byte, del_range_both)
1006 (del_range_2, modify_region):
1007 * intervals.c (intervals_equal, balance_possible_root_interval)
1008 (adjust_intervals_for_insertion, merge_properties_sticky)
1009 (graft_intervals_into_buffer, lookup_char_property)
1010 (adjust_for_invis_intang, set_point_both)
1011 (get_property_and_range, compare_string_intervals)
1012 (set_intervals_multibyte_1, set_intervals_multibyte):
1013 * keyboard.c (decode_timer):
1014 Use bool for boolean.
1015 * intervals.h, lisp.h, systime.h: Reflect above API changes.
1016 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
1017
1018 2012-09-02 Chong Yidong <cyd@gnu.org>
1019
1020 * keymap.c (push_key_description): Print M-TAB as C-M-i
1021 (Bug#11758).
1022
1023 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
1024
1025 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
1026 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
1027 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
1028 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
1029 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
1030 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
1031 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1032
1033 2012-09-01 Eli Zaretskii <eliz@gnu.org>
1034
1035 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
1036 more than one grapheme cluster passed to the shaper: compute the
1037 offset adjustment values separately for each cluster. (Bug#11860)
1038
1039 * image.c: Restore mistakenly removed inclusion of w32.h. Without
1040 it, GCC doesn't see prototypes of w32_delayed_load, and complains
1041 about implicit conversions from integer to pointer.
1042
1043 2012-09-01 Daniel Colascione <dancol@dancol.org>
1044
1045 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
1046 system used too early.
1047
1048 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
1049
1050 Better seed support for (random).
1051 * emacs.c (main): Call init_random.
1052 * fns.c (Frandom): Set the seed from a string argument, if given.
1053 Remove long-obsolete Gentzel cruft.
1054 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
1055 (init_random): New function.
1056
1057 2012-09-01 Daniel Colascione <dancol@dancol.org>
1058
1059 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
1060 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
1061 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
1062 x_wm_set_size_hint, x_query_colors, x_real_positions,
1063 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
1064 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
1065 all of which have been moved to common code.
1066
1067 * xfaces.c: Include TERM_HEADER instead of listing all possible
1068 window-system headers.
1069
1070 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
1071 to match header.
1072
1073 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
1074 directly accessing frame internals.
1075
1076 * w32font.h: Include font.h. Define syms_of_w32font and
1077 globals_of_w32font.
1078
1079 * process.c: Include TERM_HEADER instead of listing all possible
1080 window-system headers.
1081
1082 * nsterm.h: Remove declarations now in frame.h. Define
1083 FRAME_X_SCREEN, FRAME_X_VISUAL.
1084
1085 * menu.c: Include TERM_HEADER instead of listing all possible
1086 window-system headers.
1087
1088 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
1089 window system.
1090
1091 * keyboard.c: Include TERM_HEADER instead of listing all possible
1092 window-system headers.
1093
1094 * image.c: Include TERM_HEADER instead of listing all possible
1095 window-system headers. Declare Vlibrary_cache when compiling for
1096 Windows.
1097
1098 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
1099 window system declarations.
1100
1101 * frame.h: Move common functions here: set_frame_menubar,
1102 x_set_window_size, x_sync, x_get_focus_frame,
1103 x_set_mouse_position, x_set_mouse_pixel_position,
1104 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
1105 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
1106 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
1107 x_activate_menubar, x_real_positions, x_bitmap_icon,
1108 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
1109 and x_query_colors.
1110
1111 * frame.c: Include TERM_HEADER instead of listing all possible
1112 window-system headers.
1113
1114 * font.c: Include TERM_HEADER instead of listing all possible
1115 window-system headers.
1116
1117 * emacs.c: Include TERM_HEADER.
1118
1119 * dispnew.c: Include TERM_HEADER instead of listing all possible
1120 window-system headers.
1121
1122 * ccl.h: Include character.h.
1123
1124 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
1125 the current window system; include in list of objects to link into
1126 Emacs.
1127
1128 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1129
1130 Remove mark_ttys function and fix tty_display_info initialization.
1131 * lisp.h (mark_ttys): Remove prototype.
1132 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
1133 to mark_ttys because all possible values of 'top_frame' slot are
1134 the frames which are reachable from Vframe_list.
1135 * term.c (mark_ttys): Remove.
1136 (init_tty): Safely initialize 'top_frame' slot with Qnil.
1137
1138 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1139
1140 Change struct frame bitfields from unsigned char to unsigned.
1141 * frame.h (struct frame): Change type of 'display_preempted',
1142 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
1143 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
1144 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
1145 bitfields from unsigned char to unsigned.
1146
1147 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
1148
1149 Remove unused member of struct x_output and struct w32_output.
1150 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
1151 * w32term.h (struct w32_output): Likewise.
1152
1153 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
1154
1155 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
1156 does not become zero (Bug#12234).
1157
1158 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
1159
1160 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
1161 for GCC 4.7.1 x86-64.
1162
1163 2012-08-30 Glenn Morris <rgm@gnu.org>
1164
1165 * lread.c (init_lread): For out-of-tree builds, only add the
1166 source directory's site-lisp dir to the load-path if it exists,
1167 consistent with in-tree builds. (Bug#12302)
1168
1169 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
1170
1171 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1172 button_values to NULL. Call setStykeMask so dialogs get a close button.
1173 (windowShouldClose:): Set window_closed.
1174 (dealloc): New member, free button_values.
1175 (process_dialog:): Make member function. Remove window argument,
1176 replace window with self. Count buttons and allocate and store values
1177 in button_values.
1178 (addButton:value:row:): value is int with the name tag. Call setTag
1179 with tag. Remove return self, declare return value as void.
1180 (addString:row:): Remove return self, declare return value as void.
1181 (addSplit): Remove return self, declare return value as void.
1182 (clicked:): Remove return self, declare return value as void.
1183 Set dialog_return to button_values[seltag]. Code formatting change.
1184 (initFromContents:isQuestion:): Adjust call to process_dialog.
1185 Code formatting change.
1186 (timeout_handler:): Set timer_fired to YES.
1187 (runDialogAt:): Set timer_fired to NO.
1188 Handle click on close button as quit.
1189
1190 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
1191 Add window_closed and button_values. Add void as return value for
1192 add(Button|String|Split). addButton takes int instead of Lisp_Object.
1193 Add process_dialog as new member.
1194
1195 2012-08-28 Eli Zaretskii <eliz@gnu.org>
1196
1197 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
1198 is not one of the heaps we manage. (Bug#12242)
1199
1200 2012-08-28 Glenn Morris <rgm@gnu.org>
1201
1202 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
1203
1204 2012-08-28 Martin Rudalics <rudalics@gmx.at>
1205
1206 * window.c (Fset_window_configuration): Remove handling of
1207 auto-buffer-name window parameter. Install revision of reverted
1208 fix.
1209
1210 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1211
1212 Do not allow to set major mode for a dead buffer.
1213 * buffer.c (Fset_buffer_major_mode): Signal an error
1214 if the buffer is dead.
1215 (Fother_buffer, other_buffer_safely): Remove redundant
1216 nested declaration.
1217
1218 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1219
1220 Always use set_buffer_if_live to restore original buffer at unwind.
1221 * buffer.h (record_unwind_current_buffer): New function.
1222 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
1223 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
1224 * undo.c, window.c: Adjust users.
1225 * buffer.c (set_buffer_if_live): Fix comment.
1226
1227 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
1228
1229 Fix usage of set_buffer_internal.
1230 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
1231 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
1232 * coding.c (decode_coding): Omit redundant test.
1233 * fileio.c (decide_coding_unwind): Likewise.
1234 * fns.c (secure_hash): Likewise.
1235 * insdel.c (modify_region): Likewise.
1236 * keyboard.c (command_loop_1): Likewise.
1237 * print.c (PRINTFINISH): Likewise.
1238 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
1239
1240 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1241
1242 * dispnew.c: Use bool for boolean.
1243 (frame_garbaged, display_completed, delayed_size_change)
1244 (fonts_changed_p, add_window_display_history)
1245 (add_frame_display_history, verify_row_hash)
1246 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
1247 (row_equal_p, realloc_glyph_pool)
1248 (allocate_matrices_for_frame_redisplay)
1249 (showing_window_margins_p)
1250 (adjust_frame_glyphs_for_frame_redisplay)
1251 (build_frame_matrix_from_leaf_window, make_current)
1252 (mirrored_line_dance, mirror_line_dance, update_frame)
1253 (update_window_tree, update_single_window)
1254 (check_current_matrix_flags, update_window, update_text_area)
1255 (update_window_line, set_window_update_flags, scrolling_window)
1256 (update_frame_1, scrolling, buffer_posn_from_coords)
1257 (do_pending_window_change, change_frame_size)
1258 (change_frame_size_1, sit_for):
1259 Use bool for boolean.
1260 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
1261 and remove last int (actually boolean) argument, which was always 0.
1262 All callers changed.
1263 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
1264 * dispextern.h (struct composition_it): Use bool for boolean.
1265 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
1266 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
1267 * dired.c (file_name_completion):
1268 Use bool for boolean. (This was missed in an earlier change.)
1269
1270 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1271
1272 * window.c (Fset_window_configuration): Revert first part of
1273 last change.
1274
1275 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
1276
1277 * nsterm.h (NSPanel): New class variable dialog_return.
1278
1279 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
1280 dialog_return.
1281 (windowShouldClose:): Use stop instead of stopModalWithCode.
1282 (clicked:): Ditto, and also set dialog_return (Bug#12258).
1283 (timeout_handler:): Use stop instead of abortModal. Send a dummy
1284 event.
1285 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
1286 modal loop returns.
1287
1288 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
1289
1290 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
1291 * composite.c (find_composition, composition_gstring_p)
1292 (composition_reseat_it, find_automatic_composition):
1293 * data.c (let_shadows_buffer_binding_p)
1294 (let_shadows_global_binding_p, set_internal, make_blv)
1295 (Fmake_variable_buffer_local, Fmake_local_variable)
1296 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
1297 (cons_to_signed, arith_driver):
1298 * dbusbind.c (xd_in_read_queued_messages):
1299 * dired.c (directory_files_internal, file_name_completion):
1300 Use bool for booleans.
1301 * dired.c (file_name_completion):
1302 * process.h (fd_callback):
1303 Omit int (actually boolean) argument. It wasn't being used.
1304 All uses changed.
1305 * composite.h, lisp.h: Reflect above API changes.
1306
1307 * cmds.c, coding.c: Use bool for booleans.
1308 * cmds.c (move_point, Fself_insert_command):
1309 * coding.h (struct composition status, struct coding_system):
1310 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
1311 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
1312 (emacs_mule_char, decode_coding_emacs_mule)
1313 (encode_coding_emacs_mule, detect_coding_iso_2022)
1314 (decode_coding_iso_2022, encode_invocation_designation)
1315 (encode_designation_at_bol, encode_coding_iso_2022)
1316 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
1317 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
1318 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
1319 (encode_coding_raw_text, detect_coding_charset)
1320 (decode_coding_charset, encode_coding_charset, detect_eol)
1321 (detect_coding, get_translation_table, produce_chars)
1322 (consume_chars, reused_workbuf_in_use)
1323 (make_conversion_work_buffer, code_conversion_save)
1324 (decode_coding_object, encode_coding_object)
1325 (detect_coding_system, char_encodable_p)
1326 (Funencodable_char_position, code_convert_region)
1327 (code_convert_string, code_convert_string_norecord)
1328 (Fset_coding_system_priority):
1329 * fileio.c (Finsert_file_contents):
1330 Use bool for booleans.
1331 * coding.h, lisp.h: Reflect above API changes.
1332 * coding.c: Remove unnecessary static function decls.
1333 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
1334 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
1335 not a boolean 'int', since callers never look at the return value.
1336 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
1337 * coding.h (decoding_buffer_size, encoding_buffer_size)
1338 (emacs_mule_string_char): Remove unused extern decls.
1339 (struct iso_2022_spec, struct coding_system):
1340 Use 'unsigned int : 1' for boolean fields, since there's more than one.
1341 (struct emacs_mule_spec): Remove unused field 'full_support'.
1342 All initializations removed.
1343 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
1344
1345 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1346
1347 Fix spare memory change (Bug#12286).
1348 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
1349 (valid_lisp_object_p): Likewise.
1350
1351 2012-08-27 Martin Rudalics <rudalics@gmx.at>
1352
1353 * window.c (Fset_window_configuration): Record any window's old
1354 buffer if it's replaced (see Bug#8789). If the new current
1355 buffer doesn't appear in the selected window, go to its old
1356 point (Bug#12208).
1357
1358 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
1359
1360 Special MEM_TYPE_SPARE to denote reserved memory.
1361 * alloc.c (enum mem_type): New memory type.
1362 (refill_memory_reserve): Use new type for spare memory.
1363 This prevents live_cons_p and live_string_p from incorrect
1364 detection of uninitialized objects from spare memory as live.
1365
1366 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
1367
1368 Spelling fixes.
1369 * Makefile.in (.PHONY): versioclean -> versionclean.
1370
1371 Remove unused external symbols.
1372 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
1373 * window.c (Qwindow_valid_p, decode_valid_window):
1374 Now static, not extern.
1375 * data.c (Qinterval): Remove; unused.
1376 (syms_of_data): Do not define 'interval'.
1377 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
1378 * window.h (decode_valid_window):
1379 Remove decls.
1380
1381 * character.c, charset.c, chartab.c: Use bool for booleans.
1382 * character.c (lisp_string_width, string_count_byte8)
1383 (string_escape_byte8):
1384 * charset.c (charset_map_loaded, load_charset_map, read_hex):
1385 (load_charset_map_from_file, map_charset_chars)
1386 (Fdefine_charset_internal, define_charset_internal)
1387 (Fdeclare_equiv_charset, find_charsets_in_text)
1388 (Ffind_charset_region, char_charset, Fiso_charset):
1389 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
1390 (sub_char_table_set, sub_char_table_set_range)
1391 (char_table_set_range, optimize_sub_char_table)
1392 (map_sub_char_table):
1393 Use bool for boolean.
1394 * character.c (str_to_unibyte): Omit last boolean argument; it was
1395 always 0. All callers changed.
1396 * character.h, charset.h: Adjust to match previous changes.
1397 * character.h (char_printable_p): Remove decl of nonexistent function.
1398 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
1399 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
1400 are all boolean, so make them single-bit bitfields.
1401
1402 * lisp.h (ASET): Remove attempt to detect side effects.
1403 It was meant to be temporary and it often doesn't work,
1404 because when IDX has side effects the behavior of IDX==IDX
1405 is undefined. See Stefan Monnier in
1406 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
1407
1408 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
1409
1410 * lisp.h (functionp): New function (extracted from Ffunctionp).
1411 (FUNCTIONP): Use it.
1412 * eval.c (Ffunctionp): Use it.
1413
1414 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1415
1416 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
1417 as that's faster and simpler than static storage. Don't bother
1418 with the g_main_context_query overhead if g_main_context_pending
1419 says no events are pending.
1420 (gfds, gfds_size): Remove these static vars.
1421 (xgselect_initialize): Remove; no longer needed.
1422 All uses and decls removed.
1423
1424 * emacs.c (fatal_error_signal_hook): Remove.
1425 All uses removed. This leftover from old code was always 0.
1426
1427 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
1428 * casefiddle.c (casify_object, casify_region):
1429 * casetab.c (set_case_table):
1430 * category.c, category.h (word_boundary_p):
1431 * category.h (CHAR_HAS_CATEGORY):
1432 Use bool for booleans, instead of int.
1433
1434 2012-08-25 Eli Zaretskii <eliz@gnu.org>
1435
1436 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
1437
1438 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
1439
1440 On assertion failure, print backtrace if available.
1441 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
1442 (die) [ENABLE_CHECKING]: Print a backtrace if available.
1443 * Makefile.in (LIB_EXECINFO): New macro.
1444 (LIBES): Use it.
1445
1446 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
1447 * bytecode.c (exec_byte_code):
1448 * callint.c (check_mark, Fcall_interactively):
1449 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
1450 (getenv_internal, sync_process_alive, call_process_exited):
1451 * lisp.h (USE_SAFE_ALLOCA):
1452 Use bool for booleans, instead of int.
1453 * lisp.h, process.h: Adjust prototypes to match above changes.
1454 * callint.c (Fcall_interactively): Don't assume the mark's
1455 offset fits in 'int'.
1456
1457 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
1458
1459 * buffer.c, buffer.h: Use bool for boolean.
1460 * buffer.c (reset_buffer_local_variables)
1461 (buffer_lisp_local_variables, Fset_buffer_modified_p)
1462 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
1463 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
1464 (overlay_touches_p, overlay_strings, Foverlay_put)
1465 (report_overlay_modification, call_overlay_mod_hooks):
1466 (mmap_enlarge, mmap_set_vars):
1467 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
1468 Use bool for booleans, instead of int.
1469 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
1470 since the 1-or-0 return value is always ignored anyway.
1471 (mmap_initialized_p):
1472 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
1473 * buffer.h, lisp.h: Adjust prototypes to match above changes.
1474
1475 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1476
1477 * bidi.c: Use bool for boolean.
1478 This is a bit more readable, and makes the text segment of bidi.o
1479 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
1480 Presumably it's faster too.
1481 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
1482 Now bool.
1483 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1484 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
1485 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
1486 (bidi_explicit_dir_char, bidi_level_of_next_char)
1487 (bidi_find_other_level_edge, bidi_move_to_visually_next):
1488 Use bool for booleans, instead of int.
1489 * dispextern.h (bidi_init_it, bidi_paragraph_init)
1490 (bidi_unshelve_cache): Adjust decls to match code.
1491
1492 2012-08-23 Martin Rudalics <rudalics@gmx.at>
1493
1494 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
1495 argument.
1496
1497 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
1498
1499 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
1500 * atimer.h: Include <stdbool.h>.
1501
1502 2012-08-22 Dan Nicolaescu <dann@gnu.org>
1503
1504 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
1505 compile time tests instead of run time tests on systems that do
1506 not use them.
1507 (FRAME_MAC_P): Remove leftover from deleted code.
1508 * frame.c (syms_of_frame): Remove leftover from deleted code.
1509
1510 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
1511
1512 * nsterm.m (insertText:): Don't clear modifiers if code is space.
1513
1514 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
1515
1516 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
1517 Otherwise, the compiler complains about (A?B:C) where B is void
1518 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
1519 (fontset_add): Return void, for FONTSET_ADD.
1520
1521 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1522
1523 * alloc.c: Use bool for booleans.
1524 (gc_in_progress, abort_on_gc)
1525 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1526 (dont_register_blocks) [GC_MALLOC_CHECK]:
1527 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
1528 (check_string_bytes, make_specified_string, memory_full)
1529 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
1530 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
1531 (mark_stack, valid_pointer_p, make_pure_string)
1532 (Fgarbage_collect, survives_gc_p, gc_sweep):
1533 Use bool for booleans, instead of int.
1534 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
1535 Remove unused local.
1536 * alloc.c (PURE_POINTER_P):
1537 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
1538 * editfns.c (Fformat):
1539 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
1540 (Fdo_auto_save):
1541 * fns.c (sweep_weak_table):
1542 * lisp.h (suppress_checking, push_message, survives_gc_p)
1543 (make_pure_string, gc_in_progress, abort_on_gc):
1544 * lread.c (readchar, read1):
1545 * print.c (Fprin1_to_string):
1546 * xdisp.c (push_message):
1547 Use bool for booleans affected directly or indirectly by
1548 alloc.c's changes.
1549
1550 Make recently-introduced setters macros.
1551 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
1552 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
1553 (set_fontset_default, set_fontset_fallback): Rename from their
1554 upper-case counterparts, and make them functions rather than macros.
1555 This is more consistent with the other recently-introduced setters.
1556 These don't need to be inline, since they're local.
1557
1558 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
1559
1560 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
1561 the loop (Bug#12247).
1562
1563 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1564
1565 * lisp.h (vcopy): Use memcpy rather than our own loop.
1566 This fixes a performance regression introduced by the recent
1567 addition of vcopy. This means 'vcopy' will need to be modified
1568 for a copying collector, but that's OK. Also, tighten the
1569 checking in the assertion.
1570
1571 2012-08-21 Eli Zaretskii <eliz@gnu.org>
1572
1573 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
1574 components for RTL text (Bug#11860). Adjust X-OFFSET of each
1575 non-base glyph for the width of the base character, according to
1576 what x_draw_composite_glyph_string_foreground expects.
1577 Generate WADJUST value according to composition_gstring_width's
1578 expectations, to produce correct width of the composed character.
1579 Reverse the sign of the DU offset produced by ScriptPlace.
1580
1581 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
1582
1583 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
1584
1585 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1586
1587 Avoid direct writes to contents member of struct Lisp_Vector.
1588 * lisp.h (vcopy): New function to copy data into vector.
1589 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
1590 * fns.c (Ffillarray): Use ASET.
1591 * keyboard.c (timer_check_2): Use AREF and ASET.
1592 (append_tool_bar_item, Frecent_keys): Use vcopy.
1593 * lread.c (read_vector): Use ASET.
1594 * msdos.c (Frecent_doskeys): Use vcopy.
1595 * xface.c (Finternal_copy_lisp_face): Use vcopy.
1596 (Finternal_merge_in_global_face): Use ASET and vcopy.
1597 * xfont.c (xfont_list_pattern): Likewise.
1598
1599 2012-08-21 Martin Rudalics <rudalics@gmx.at>
1600
1601 * window.c (Fwindow_point): For the selected window always return
1602 the position of its buffer's point.
1603 (Fset_window_point): For the selected window always go in its
1604 buffer to the specified position.
1605
1606 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
1607
1608 Setter macros for fontsets.
1609 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
1610 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
1611 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
1612 Adjust users.
1613
1614 2012-08-20 Glenn Morris <rgm@gnu.org>
1615
1616 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1617 Don't assume that `ln -f' works.
1618
1619 2012-08-20 Eli Zaretskii <eliz@gnu.org>
1620
1621 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
1622 and later about non-assignments with no effect. See discussion at
1623 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
1624 details.
1625
1626 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1627
1628 Inline setter functions for Lisp_Objects slots of struct specbinding.
1629 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
1630 Adjust users.
1631
1632 2012-08-20 Martin Rudalics <rudalics@gmx.at>
1633
1634 * window.c (select_window): Always make selected window's buffer
1635 current.
1636
1637 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1638
1639 Use AREF and ASET for docstrings of category tables.
1640 * category.h (CATEGORY_DOCSTRING): Use AREF.
1641 (SET_CATEGORY_DOCSTRING): Use ASET.
1642 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
1643
1644 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1645
1646 Inline setter functions for hash table members.
1647 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
1648 (set_hash_hash, set_hash_index): Rename with _slot suffix.
1649 (set_hash_key_and_value, set_hash_index, set_hash_next)
1650 (set_hash_hash): New functions.
1651 * charset.c, fns.c: Adjust users.
1652
1653 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
1654
1655 Inline getter and setter functions for per-buffer values.
1656 * buffer.h (per_buffer_default, set_per_buffer_default)
1657 (per_buffer_value, set_per_buffer_value): New functions.
1658 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
1659 * buffer.c, data.c: Adjust users.
1660
1661 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
1662
1663 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
1664
1665 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
1666
1667 Rely on <config.h> + <unistd.h> to declare 'environ',
1668 as gnulib does this if the system doesn't.
1669 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
1670 Remove declaration. MS-Windows declares it on stdlib.h which is
1671 included by conf_post.h.
1672 * emacs.c (environ) [DOUG_LEA_MALLOC]:
1673 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
1674 * vm-limit.c: Include <unistd.h>, for 'environ'.
1675
1676 * unexaix.c, unexcoff.c: Include "mem-limits.h".
1677 (start_of_data): Remove decl; mem-limits.h provides it.
1678
1679 * xdisp.c (handle_invisible_prop): Make it a bit faster
1680 and avoid a gcc -Wmaybe-uninitialized diagnostic.
1681
1682 2012-08-19 Chong Yidong <cyd@gnu.org>
1683
1684 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
1685 ends (Bug#3874).
1686
1687 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
1688
1689 * .gdbinit: Use call instead of set when calling a function in the
1690 inferior.
1691
1692 * data.c (set_internal): Don't use set_blv_found.
1693 (Fkill_local_variable): Likewise.
1694
1695 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
1696
1697 * nsfont.m (ns_ascii_average_width): Ensure the string
1698 ascii_printable is initialized with a null-terminated character
1699 array. Otherwise, it can contain undesired extra characters.
1700
1701 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1702
1703 port new setting code to Sun C 5.8 2005/10/13
1704 * chartab.c, lisp.h (char_table_set, char_table_set_range):
1705 Return void, not Lisp_Object. Otherwise, the compiler
1706 complains about (A?B:C) where B is void and C is Lisp_Object
1707 when compiling CHAR_TABLE_SET, due to the recent change to
1708 the API of sub_char_table_set_contents.
1709
1710 2012-08-18 Chong Yidong <cyd@gnu.org>
1711
1712 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
1713 for the string case (Bug#3874).
1714
1715 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
1716
1717 * buffer.h (BSET): Remove (Bug#12215).
1718 Replace all uses with calls to new setter functions.
1719 (bset_bidi_paragraph_direction, bset_case_canon_table)
1720 (bset_case_eqv_table, bset_directory, bset_display_count)
1721 (bset_display_time, bset_downcase_table)
1722 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
1723 (bset_last_selected_window, bset_local_var_alist)
1724 (bset_mark_active, bset_point_before_scroll, bset_read_only)
1725 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
1726 (bset_width_table):
1727 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1728 (bset_auto_fill_function, bset_auto_save_file_format)
1729 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1730 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1731 (bset_cache_long_line_scans, bset_case_fold_search)
1732 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1733 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1734 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1735 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1736 (bset_header_line_format, bset_indicate_buffer_boundaries)
1737 (bset_indicate_empty_lines, bset_invisibility_spec)
1738 (bset_left_fringe_width, bset_major_mode, bset_mark)
1739 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1740 (bset_name, bset_overwrite_mode, bset_pt_marker)
1741 (bset_right_fringe_width, bset_save_length)
1742 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1743 (bset_scroll_up_aggressively, bset_selective_display)
1744 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1745 (bset_word_wrap, bset_zv_marker):
1746 * category.c (bset_category_table):
1747 * syntax.c (bset_syntax_table):
1748 New setter functions.
1749
1750 * process.h (PSET): Remove (Bug#12215).
1751 Replace all uses with calls to new setter functions.
1752 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1753 (PROCESS_INLINE): New macro.
1754 (pset_childp): New setter function.
1755 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
1756 * process.c (PROCESS_INLINE):
1757 Define to EXTERN_INLINE, so that the corresponding functions
1758 are compiled into code.
1759 (pset_buffer, pset_command, pset_decode_coding_system)
1760 (pset_decoding_buf, pset_encode_coding_system)
1761 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
1762 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
1763 (pset_type, pset_write_queue): New setter functions.
1764
1765 * window.h (WSET): Remove (Bug#12215).
1766 Replace all uses with calls to new setter functions.
1767 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1768 (WINDOW_INLINE): New macro.
1769 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
1770 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
1771 (wset_total_lines, wset_vertical_scroll_bar)
1772 (wset_window_end_pos, wset_window_end_valid)
1773 (wset_window_end_vpos): New setter functions.
1774 * window.c (WINDOW_INLINE):
1775 Define to EXTERN_INLINE, so that the corresponding functions
1776 are compiled into code.
1777 (wset_combination_limit, wset_dedicated, wset_display_table)
1778 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
1779 (wset_new_normal, wset_new_total, wset_next_buffers)
1780 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1781 (wset_prev_buffers, wset_right_fringe_width)
1782 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
1783 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
1784 (wset_window_parameters):
1785 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1786 (wset_column_number_displayed, wset_region_showing):
1787 New setter functions.
1788
1789 * termhooks.h (TSET): Remove (Bug#12215).
1790 Replace all uses with calls to new setter functions.
1791 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1792 (TERMHOOKS_INLINE): New macro.
1793 (tset_charset_list, tset_selection_alist): New setter functions.
1794 * terminal.c (TERMHOOKS_INLINE):
1795 Define to EXTERN_INLINE, so that the corresponding functions
1796 are compiled into code.
1797 (tset_param_alist): New setter function.
1798
1799 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1800
1801 * keyboard.h (KSET): Remove (Bug#12215).
1802 Replace all uses with calls to new setter functions.
1803 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1804 (KEYBOARD_INLINE): New macro.
1805 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
1806 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
1807 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
1808 New setter functions.
1809 * keyboard.c (KEYBOARD_INLINE):
1810 Define to EXTERN_INLINE, so that the corresponding functions
1811 are compiled into code.
1812 (kset_echo_string, kset_kbd_queue)
1813 (kset_keyboard_translate_table, kset_last_prefix_arg)
1814 (kset_last_repeatable_command, kset_local_function_key_map)
1815 (kset_overriding_terminal_local_map, kset_real_last_command)
1816 (kset_system_key_syms): New setter functions.
1817
1818 * frame.h (FSET): Remove (Bug#12215).
1819 Replace all uses with calls to new setter functions.
1820 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1821 (FRAME_INLINE): New macro.
1822 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
1823 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
1824 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
1825 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
1826 (fset_param_alist, fset_root_window, fset_scroll_bars)
1827 (fset_selected_window, fset_title, fset_tool_bar_items)
1828 (fset_tool_bar_position, fset_tool_bar_window): New functions.
1829 * frame.c (FRAME_INLINE):
1830 Define to EXTERN_INLINE, so that the corresponding functions
1831 are compiled into code.
1832 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
1833
1834 A few more naming-convention fixes for getters and setters.
1835 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
1836 and rename from buffer_overlays_set_before.
1837 (set_buffer_overlays_after): Move here from buffer.h, and rename
1838 from buffer_overlays_set_after.
1839 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
1840 All uses changed.
1841 (set_buffer_intervals): Rename from buffer_set_intervals.
1842 * intervals.c (set_interval_object): Move here from intervals.h,
1843 and rename from interval_set_object.
1844 (set_interval_left): Move here from intervals.h, and rename from
1845 interval_set_left.
1846 (set_interval_right): Move here from intervals.h, and rename from
1847 interval_set_right.
1848 (copy_interval_parent): Move here from intervals.h, and rename from
1849 interval_copy_parent.
1850 * intervals.h (set_interval_parent): Rename from interval_set_parent.
1851 (set_interval_plist): Rename from interval_set_plist.
1852 Return void, not Lisp_Object, since no caller uses the result.
1853 * lisp.h (string_intervals): Rename from string_get_intervals.
1854 (set_string_intervals): Rename from string_set_intervals.
1855
1856 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
1857 (set_char_table_contents): Rename from char_table_set_contents.
1858 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
1859 All uses changed. See the end of
1860 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
1861
1862 * lisp.h (CSET): Remove (Bug#12215).
1863 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
1864 (set_char_table_purpose): New functions,
1865 replacing CSET. All uses changed. For example, replace
1866 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
1867 "set_char_table_parent (char_table, parent);".
1868 The old version was confusing because it used the same name
1869 'parent' for two different things.
1870
1871 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1872
1873 Functions to get and set Lisp_Object fields of buffer-local variables.
1874 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
1875 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
1876 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
1877 * data.c, eval.c, frame.c: Adjust users.
1878
1879 2012-08-17 Chong Yidong <cyd@gnu.org>
1880
1881 * xfaces.c (merge_face_vectors): If the target font specfies a
1882 font spec, make the font's attributes take precedence over
1883 directly-specified attributes.
1884 (merge_face_ref): Recognize :font.
1885
1886 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
1887
1888 Do not use memcpy for copying intervals.
1889 * intervals.c (reproduce_interval): New function.
1890 (reproduce_tree, reproduce_tree_obj): Use it.
1891 (reproduce_tree_obj): Remove prototype.
1892
1893 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
1894
1895 * lisp.h (duration_to_sec_usec): Remove unused decl.
1896
1897 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
1898
1899 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
1900 to an allocated instance of NSString, not to the class itself.
1901
1902 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
1903
1904 * makefile.w32-in (C_CTYPE_H): New macro.
1905 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
1906 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
1907 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
1908
1909 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
1910
1911 Use ASCII tests for character types.
1912 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
1913 * xfns.c, xterm.c:
1914 Don't include <ctype.h>; was not needed.
1915 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
1916 * sysdep.c, xfaces.c:
1917 Include <c-ctype.h> instead of <ctype.h>.
1918 * nsterm.m: Include <c-ctype.h>.
1919 * charset.c (read_hex):
1920 * doc.c (Fsnarf_documentation):
1921 * fileio.c (IS_DRIVE) [WINDOWSNT]:
1922 (DRIVE_LETTER) [DOS_NT]:
1923 (Ffile_name_directory, Fexpand_file_name)
1924 (Fsubstitute_in_file_name):
1925 * font.c (font_parse_xlfd, font_parse_fcname):
1926 * frame.c (x_set_font_backend):
1927 * gtkutil.c (xg_get_font):
1928 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
1929 * nsimage.m (hexchar):
1930 * nsterm.m (ns_xlfd_to_fontname):
1931 * sysdep.c (system_process_attributes):
1932 * xfaces.c (hash_string_case_insensitive):
1933 Use C-locale tests instead of locale-specific tests for character
1934 types, since we want the ASCII interpretation here, not the
1935 interpretation suitable for whatever happens to be the current locale.
1936
1937 2012-08-16 Martin Rudalics <rudalics@gmx.at>
1938
1939 Consistently check windows for validity/liveness
1940 (Bug#11984, Bug#12025, Bug#12026).
1941 * lisp.h (CHECK_VALID_WINDOW): New macro.
1942 * window.c (decode_window): Rename to decode_live_window.
1943 (decode_valid_window, Fwindow_valid_p): New functions.
1944 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
1945 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
1946 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
1947 (Fwindow_prev_sibling, Fwindow_combination_limit)
1948 (Fset_window_combination_limit, Fwindow_use_time)
1949 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
1950 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
1951 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
1952 (Fwindow_hscroll, Fset_window_hscroll)
1953 (Fwindow_redisplay_end_trigger)
1954 (Fset_window_redisplay_end_trigger, Fwindow_edges)
1955 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
1956 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1957 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
1958 (Fwindow_end, Fset_window_point, Fset_window_start)
1959 (Fpos_visible_in_window_p, Fwindow_line_height)
1960 (Fwindow_dedicated_p, Fset_window_dedicated_p)
1961 (Fwindow_prev_buffers, Fset_window_prev_buffers)
1962 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
1963 (Fset_window_parameter, Fwindow_display_table)
1964 (Fset_window_display_table, Fdelete_other_windows_internal)
1965 (Fset_window_buffer, Fset_window_new_total)
1966 (Fset_window_new_normal, Fdelete_window_internal)
1967 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
1968 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
1969 (Fwindow_scroll_bars): Check whether argument window is a valid or
1970 live window. Update doc-strings.
1971 (syms_of_window): New symbol Qwindow_valid_p.
1972 * keyboard.c (Fposn_at_x_y): Check whether argument
1973 frame_or_window denotes a valid window.
1974
1975 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1976
1977 Fix previous char table change.
1978 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
1979 * chartab.c (optimize_sub_char_table): Likewise.
1980
1981 2012-08-16 Chong Yidong <cyd@gnu.org>
1982
1983 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
1984
1985 * xfont.c (xfont_open):
1986 * xftfont.c (xftfont_open): Set the font's max_width field.
1987
1988 * nsfont.m (nsfont_open): Similar to the Xft backend, set
1989 min_width to space_width and average_width to the average over
1990 printable ASCII characters.
1991 (ns_char_width): Code cleanup.
1992 (ns_ascii_average_width): New utility function.
1993
1994 * font.h (struct font): Update comments.
1995
1996 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
1997
1998 Simple interface to set Lisp_Object fields of character tables.
1999 * lisp.h (CSET): New macro.
2000 (char_table_set_extras, char_table_set_contents)
2001 (sub_char_table_set_contents): New function.
2002 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
2003 * syntax.c: Adjust users.
2004
2005 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
2006
2007 * eval.c (eval_sub): Bind lexical-binding.
2008 * lread.c (Qlexical_binding): Make non-static.
2009
2010 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
2011
2012 * nsmenu.m (popupSession): Remove.
2013 (pop_down_menu): Remove endModalSession.
2014 (timeout_handler:): New method.
2015 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
2016 Call runModalForWindow. Check timer_fired when it returns.
2017 If not set, cancel timer and break out of loop.
2018 Otherwise loop again, with a new timeout.
2019
2020 * nsterm.m: Include fcntl.h if present.
2021 (fd_entry, t_readfds, inNsSelect): Remove.
2022 (select_writefds, select_valid, select_timeout, selfds)
2023 (select_mutex, apploopnr): Add.
2024 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
2025 Otherwise call kbd_buffer_store_event.
2026 (ns_send_appdefined): Remove release of fd_entry.
2027 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
2028 Increment and decrement apploopnr.
2029 (ns_select): If no file descriptors, just do a NSTimer.
2030 Otherwise copy read/write masks and start select thread (fd_handler).
2031 Start main loop and wait for application defined event.
2032 Inform select thread to stop selecting after main loop is exited.
2033 (ns_term_init): Create selfds pipe and set non-blocking.
2034 Initialize select_mutex. Start the select thread (fd_handler).
2035 (fd_handler:): Loop forever, wait for info from the main thread
2036 to either start or stop selecting. When select returns, send
2037 and appdefined event.
2038 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
2039 If not call kbd_buffer_store_event.
2040
2041 * nsterm.h (EmacsApp): fd_handler takes id argument.
2042 (EmacsDialogPanel): Add timer_fired and timeout_handler.
2043
2044 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
2045
2046 2012-08-15 Eli Zaretskii <eliz@gnu.org>
2047
2048 * region-cache.c (move_cache_gap): Update gap_len using the actual
2049 growth of the boundaries array. Do not change cache_len.
2050 (Bug#12196)
2051
2052 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2053
2054 Generalize and cleanup font subsystem checks.
2055 * font.h (FONT_DEBUG, font_assert): Remove.
2056 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
2057 Change font_assert to eassert. Use eassert where appropriate.
2058
2059 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2060
2061 * gtkutil.c (xg_get_font): Use pango_units_to_double.
2062
2063 2012-08-15 Chong Yidong <cyd@gnu.org>
2064
2065 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
2066 When using the new font chooser, use gtk_font_chooser_get_font_desc to
2067 extract the font descriptor instead of just the font name.
2068 In that case, return a font spec instead of a string.
2069 (x_last_font_name): Move to this file from xfns.c.
2070
2071 * xfns.c (Fx_select_font): The return value can also be a font
2072 spec. Move x_last_font_name management to gtkutil.c.
2073
2074 * xfaces.c: Make font weight and style symbols non-static.
2075
2076 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
2077
2078 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
2079 (bug#12117).
2080
2081 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2082
2083 * alloc.c (Fgarbage_collect): Use plural form consistently.
2084
2085 2012-08-14 Eli Zaretskii <eliz@gnu.org>
2086
2087 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
2088 iteration through the command loop. Fixes a problem whereby mouse
2089 movements are ignored until the first mouse click.
2090
2091 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2092
2093 Use bool, not int, for Lisp booleans.
2094 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
2095 makes Emacs a bit smaller and presumably a bit faster.
2096 * lisp.h: Include <stdbool.h>.
2097 (struct Lisp_Boolfwd, defvar_bool):
2098 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
2099 * regex.c [!emacs]: Include <stdbool.h>.
2100 (false, true): Remove; <stdbool.h> does this for us now.
2101
2102 2012-08-14 Chong Yidong <cyd@gnu.org>
2103
2104 * character.c (Fcharacterp): Doc fix (Bug#12076).
2105
2106 * data.c (Findirect_variable): Doc fix (Bug#11040).
2107
2108 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
2109
2110 * editfns.c (Fformat): Doc fix (Bug#12059).
2111 (Fsave_current_buffer): Doc fix (Bug#11542).
2112
2113 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2114
2115 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
2116 (bug#12022).
2117
2118 2012-08-14 Martin Rudalics <rudalics@gmx.at>
2119
2120 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
2121 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
2122 * minibuf.c (choose_minibuf_frame, read_minibuf):
2123 * w32fns.c (x_create_tip_frame):
2124 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
2125 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
2126
2127 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2128
2129 * intervals.c (offset_intervals): Remove obsolete comment.
2130
2131 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
2132
2133 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
2134
2135 2012-08-14 Gergely Risko <gergely@risko.hu>
2136
2137 * coding.c (decode_coding): Record buffer modification before
2138 disabling undo_list (Bug#11773).
2139
2140 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2141
2142 Revert and cleanup some recent overlay changes.
2143 * buffer.h (enum overlay_type): Remove.
2144 (buffer_get_overlays, buffer_set_overlays): Likewise.
2145 (buffer_set_overlays_before, buffer_set_overlays_after):
2146 New function. Adjust users.
2147 (unchain_both): Add eassert.
2148
2149 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
2150
2151 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
2152
2153 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
2154
2155 * gtkutil.c (xg_mark_data): Don't assume C99.
2156
2157 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
2158
2159 * gtkutil.c (xg_frame_tb_info): New struct.
2160 (TB_INFO_KEY): New define.
2161 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
2162 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
2163 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
2164 if not present.
2165 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
2166 is up to date. Otherwise store new data.
2167 (free_frame_tool_bar): Free xg_frame_tb_info if present.
2168
2169 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2170
2171 Use KSET for write access to Lisp_Object members of struct kboard.
2172 * keyboard.h (KSET): New macro.
2173 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
2174 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
2175 * xterm.c: Adjust users.
2176
2177 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2178
2179 Use BSET for write access to Lisp_Object members of struct buffer.
2180 * buffer.h (BSET): New macro.
2181 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
2182 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
2183 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
2184 * window.c, xdisp.c, xfns.c: Adjust users.
2185
2186 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
2187
2188 * lread.c (syms_of_lread): Initialize Vlexical_binding.
2189
2190 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
2191
2192 * nsterm.m (not_in_argv): New function.
2193 (application:openFile, application:openTempFile:):
2194 (application:openFileWithoutUI:, application:openFiles:): Open file
2195 if not_in_argv returns non-zero (bug#12171).
2196
2197 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
2198 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
2199 Define for Gtk+ versions less than 3.2.
2200 (xg_get_font_name): Use those functions/macros here.
2201 Reported by Frans Oilinki <moilinki@gmail.com>.
2202
2203 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2204
2205 * unexmacosx.c (copy_data_segment): Copy initialized data in
2206 statically linked libraries from input file rather than memory.
2207
2208 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
2209 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
2210 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
2211
2212 2012-08-10 Glenn Morris <rgm@gnu.org>
2213
2214 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
2215 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
2216
2217 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2218
2219 Fix last change to allow compilation with low optimization levels.
2220 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
2221 Reported by Jan Djärv <jan.h.d@swipnet.se>.
2222
2223 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2224
2225 Use common inline syntax in intervals.h.
2226 * intervals.h (INTERVALS_INLINE): New macro.
2227 Change all users from LISP_INLINE.
2228
2229 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2230
2231 Define Qnone once for all platforms.
2232 * frame.c (Qnone): Define here.
2233 (syms_of_frame): DEFSYM it.
2234 * lisp.h (Qnone): New declaration.
2235 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
2236 * xfns.c: Remove duplication. Adjust users.
2237
2238 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
2239
2240 Remove unused macros from intervals.h.
2241 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
2242 * intervals.c: Adjust comment.
2243
2244 2012-08-10 Eli Zaretskii <eliz@gnu.org>
2245
2246 * w32fns.c <w32_unicode_gui>: New static variable.
2247 (globals_of_w32fns): Initialize it according to os_subtype.
2248 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
2249 testing os_subtype.
2250
2251 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
2252 Eli Zaretskii <eliz@gnu.org>
2253
2254 Fix bug #10299 with Unicode characters sent by customized
2255 keyboards created by MSKLC.
2256 * w32fns.c (INIT_WINDOW_CLASS): New macro.
2257 (w32_init_class): Use it to initialize the Emacs class with either
2258 ANSI or Unicode API calls.
2259 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
2260 later.
2261 (w32_wnd_proc): If the character code sent by WM_CHAR or
2262 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
2263 original message. Call DefWindowProcW on NT and later.
2264
2265 2012-08-10 Glenn Morris <rgm@gnu.org>
2266
2267 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
2268
2269 * lisp.h (DIRECTORY_SEP): Let configure set it.
2270
2271 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
2272
2273 Use TSET for write access to Lisp_Object slots of struct terminal.
2274 * termhooks.h (TSET): New macro.
2275 * coding.c, terminal.c, xselect.c: Adjust users.
2276
2277 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
2278
2279 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
2280 the failing expression, include them in the error message.
2281 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
2282 * lisp.h (internal_condition_case_n): Update declaration.
2283
2284 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2285
2286 Inline functions to examine and change buffer overlays.
2287 * buffer.c (unchain_both): New function.
2288 * buffer.h (buffer_get_overlays, buffer_set_overlays):
2289 (buffer_has_overlays): New function.
2290 (enum overlay_type): New enum.
2291 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
2292 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
2293
2294 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2295
2296 Inline functions to examine and change buffer intervals.
2297 * alloc.c (mark_interval_tree): Remove.
2298 (MARK_INTERVAL_TREE): Simplify.
2299 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
2300 * intervals.c (buffer_balance_intervals): New function.
2301 (graft_intervals_into_buffer): Adjust indentation.
2302 (set_intervals_multibyte): Simplify.
2303 * buffer.h (BUF_INTERVALS): Remove.
2304 (buffer_get_intervals, buffer_set_intervals): New function.
2305 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
2306 * intervals.c, textprop.c: Adjust users.
2307
2308 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2309
2310 Inline functions to examine and change string intervals.
2311 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
2312 (string_get_intervals, string_set_intervals): New function.
2313 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2314 * lread.c, print.c, textprop.c: Adjust users.
2315
2316 2012-08-08 Glenn Morris <rgm@gnu.org>
2317
2318 * lisp.mk (lisp): Remove language/persian.elc.
2319
2320 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2321
2322 Cleanup intervals.
2323 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
2324 (NULL_INTERVAL_P): Likewise. Adjust users.
2325 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
2326 Adjust comment. Move under #if 0.
2327 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
2328 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
2329
2330 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
2331
2332 Check total length of intervals with eassert.
2333 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
2334 * intervals.c: Change all users to eassert.
2335
2336 2012-08-07 Eli Zaretskii <eliz@gnu.org>
2337
2338 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
2339 Rename fields to match removal of FGET and WGET and disuse of
2340 INTERNAL_FIELD in Lisp_Cons.
2341
2342 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2343
2344 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
2345 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
2346 name since all xname users are fixed long time ago. Do not
2347 use INTERNAL_FIELD.
2348 (set_symbol_name, set_symbol_function, set_symbol_plist):
2349 (set_symbol_next, set_overlay_plist): New function.
2350 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
2351 (struct Lisp_Overlay): Likewise.
2352 (CVAR, MVAR, SVAR): Remove.
2353 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
2354 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
2355 * xterm.c: Adjust users.
2356 * .gdbinit: Change to use name field of struct Lisp_Symbol
2357 where appropriate.
2358
2359 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2360
2361 Basic functions to set Lisp_Object and pointer slots of intervals.
2362 * intervals.h (interval_set_parent, interval_set_object):
2363 (interval_set_left, interval_set_right, interval_set_plist):
2364 (interval_copy_parent): New function.
2365 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
2366 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
2367 Adjust indentation.
2368 (INTERVAL_SIZE): Remove. Adjust users.
2369 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
2370
2371 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2372
2373 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
2374 * process.h (PGET): Remove.
2375 (struct Lisp_Process): Do not use INTERNAL_FIELD.
2376 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2377
2378 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2379
2380 Drop WGET and revert read access to Lisp_Objects slots of struct window.
2381 * window.h (WGET): Remove.
2382 (struct window): Do not use INTERNAL_FIELD.
2383 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2384 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2385 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2386 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2387 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2388 Adjust users.
2389
2390 2012-08-07 Chong Yidong <cyd@gnu.org>
2391
2392 * window.c (Fwindow_edges, Fwindow_pixel_edges)
2393 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
2394 (Fdelete_window_internal): Signal an error if the window is not on
2395 a live frame (Bug#12025).
2396
2397 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
2398
2399 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
2400 * frame.h (FGET): Remove.
2401 (struct frame): Do not use INTERNAL_FIELD.
2402 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2403 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2404 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2405 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2406
2407 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
2408
2409 * w32.c: Silence compiler warnings.
2410 (map_w32_filename): Remove unused variable `is_fat'.
2411 (chase_symlinks): Add parentheses around expression.
2412
2413 2012-08-06 Glenn Morris <rgm@gnu.org>
2414
2415 * sysdep.c: Respect BROKEN_GETWD.
2416
2417 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
2418 Let configure handle it.
2419 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
2420
2421 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2422
2423 Use GCALIGNMENT where appropriate.
2424 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
2425 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
2426 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
2427
2428 2012-08-06 Eli Zaretskii <eliz@gnu.org>
2429
2430 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
2431 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
2432
2433 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
2434
2435 * buffer.h (struct buffer): Revert `indirections' to a simple int;
2436 that should be sufficient for everyone.
2437
2438 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2439
2440 * keyboard.c (timer_check_2): Add break so timer_check returns next
2441 timeout.
2442
2443 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2444
2445 Fix Windows build errors introduced after converting to WGET and WSET.
2446 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
2447 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2448
2449 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
2450
2451 * nsterm.m (ns_frame_rehighlight): Use FSET.
2452
2453 * nsmenu.m (ns_update_menubar): Use FSET.
2454
2455 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2456
2457 Separate read and write access to Lisp_Object slots of Lisp_Process.
2458 * process.h (PGET, PSET): New macros similar to AREF and ASET.
2459 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
2460
2461 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2462
2463 Separate read and write access to Lisp_Object slots of struct window.
2464 * window.h (WGET, WSET): New macros similar to AREF and ASET.
2465 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2466 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2467 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
2468 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
2469 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
2470 Adjust users.
2471
2472 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2473
2474 Fix Windows build errors introduced after converting to FGET and FSET.
2475 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
2476 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
2477 (w32_judge_scroll_bars): Change to use FSET.
2478 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
2479
2480 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2481
2482 Fix replacement typo.
2483 * window.c (replace_window): Set root_window instead of
2484 selected_window. This fixes a total window subsystem
2485 malfunction reported by Bastien Guerry <bzg@gnu.org>.
2486
2487 2012-08-06 Glenn Morris <rgm@gnu.org>
2488
2489 * lisp.mk (lisp): Add language/persian.elc.
2490
2491 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
2492
2493 Separate read and write access to Lisp_Object slots of struct frame.
2494 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
2495 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
2496 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
2497 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2498 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
2499
2500 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
2501
2502 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
2503
2504 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
2505
2506 Generalize common compile-time constants.
2507 * lisp.h (header_size, bool_header_size, word_size): Now here.
2508 (struct Lisp_Vector): Add comment.
2509 (struct Lisp_Bool_Vector): Move up to define handy constants.
2510 (VECSIZE, PSEUDOVECSIZE): Simplify.
2511 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
2512 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
2513 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
2514 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
2515 * xfont.c, xmenu.c: Use word_size where appropriate.
2516
2517 2012-08-05 Lawrence Mitchell <wence@gmx.li>
2518
2519 * search.c (Freplace_match): Treat \? in the replacement text
2520 literally (Bug#8161).
2521
2522 2012-08-05 Chong Yidong <cyd@gnu.org>
2523
2524 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
2525 * frame.c (Vdelete_frame_functions):
2526 * emacs.c (Vkill_emacs_hook): Doc fix.
2527
2528 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2529
2530 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
2531 --with-x-toolkit=no builds.
2532 Reported by Carsten Mattner <carstenmattner@gmail.com>.
2533
2534 2012-08-04 Chong Yidong <cyd@gnu.org>
2535
2536 * syntax.c (Fmodify_syntax_entry): Doc fix.
2537
2538 2012-08-04 Eli Zaretskii <eliz@gnu.org>
2539
2540 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
2541 * w32.c (init_environment): Change the default values of many
2542 environment variables in dflt_envvars[] to NULL, to avoid pushing
2543 them into environment when they were not already defined.
2544 Remove the code that deletes site-lisp subdirectories from the default
2545 value of EMACSLOADPATH, as it is no longer needed.
2546 (check_windows_init_file): Now external, not static.
2547 Use Vload_path as is, without adding anything, as this function is now
2548 called when Vload_path is already set up.
2549
2550 * w32.h (check_windows_init_file): Add prototype.
2551
2552 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
2553 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
2554 compatibility with Posix platforms.
2555 (main): Move the call to check_windows_init_file to here from
2556 w32.c.
2557 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
2558 any, in the DEFALT argument into the root of the Emacs build or
2559 installation tree, as appropriate.
2560
2561 * callproc.c (init_callproc_1): Call decode_env_path instead of
2562 doing its equivalent by hand.
2563 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
2564 the code that sets Vexec_path run on MS-Windows.
2565
2566 * lread.c (init_lread): Add comments to #ifdef's.
2567
2568 * msdos.c (dos_set_window_size, IT_update_begin)
2569 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
2570 instead of direct references.
2571
2572 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
2573
2574 Export DEFAULT_REHASH_* to GDB.
2575 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
2576 Now constants, not macros.
2577
2578 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
2579
2580 Remove unnecessary casts involving pointers.
2581 These casts are no longer needed now that we assume C89 or later,
2582 since they involve casting to or from void *.
2583 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
2584 (make_pure_float, make_pure_vector):
2585 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
2586 * macros.c (Fstart_kbd_macro):
2587 * menu.c (find_and_return_menu_selection):
2588 * minibuf.c (read_minibuf_noninteractive):
2589 * sysdep.c (closedir):
2590 * xdisp.c (x_produce_glyphs):
2591 * xfaces.c (compare_fonts_by_sort_order):
2592 * xfns.c (x_real_positions, select_visual):
2593 * xselect.c (x_stop_queuing_selection_requests)
2594 (x_get_window_property, x_get_window_property_as_lisp_data):
2595 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
2596 Remove unnecessary pointer casts.
2597 * alloc.c (record_xmalloc): New function.
2598 * lisp.h (record_xmalloc): New decl.
2599 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
2600 more like a function. This is because the pointer cast is not
2601 needed. All uses changed.
2602 * print.c (print_string, print_error_message): Avoid length recalc.
2603
2604 Improve fix for macroexp crash with debugging (Bug#12118).
2605 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
2606 ARRAY_MARK_FLAG when checking subscripts, because ASET is
2607 not supposed to be invoked from the garbage collector.
2608 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
2609 (gc_aset): New function, which is like ASET but can be
2610 used in the garbage collector.
2611 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2612 (set_hash_index): Use it instead of ASET.
2613
2614 2012-08-03 Eli Zaretskii <eliz@gnu.org>
2615
2616 Support symlinks on latest versions of MS-Windows.
2617 * w32.c: Include winioctl.h and aclapi.h.
2618 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
2619 (revert_to_self): Forward declarations of static functions.
2620 <static BOOL g_b_init_get_security_info>:
2621 <g_b_init_create_symbolic_link>: New static flags.
2622 (globals_of_w32): Initialize them to zero.
2623 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
2624 (map_w32_filename): Improve commentary. Simplify switch.
2625 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
2626 headers (most versions of MinGW w32api don't).
2627 (get_security_info, create_symbolic_link)
2628 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
2629 New functions.
2630 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
2631 in the argument file name.
2632 (sys_access): Call unc_volume_file_attributes only if
2633 GetFileAttributes fails with network-related error codes.
2634 (sys_rename): Diagnose renaming of a symlink when the user doesn't
2635 have the required privileges.
2636 (get_file_security_desc_by_name): Rename from
2637 get_file_security_desc.
2638 (stat_worker): New function, with most of the guts of 'stat', and
2639 with addition of handling of symlinks and support for 'lstat'.
2640 If possible, get file's attributes and security information by
2641 handle, not by name. Produce S_IFLNK bit for symlinks, when
2642 called from 'lstat'.
2643 (stat, lstat): New functions, call 'stat_worker'.
2644 (symlink, readlink, careadlinkat): Rewritten to create and resolve
2645 symlinks when the underlying filesystem supports them.
2646
2647 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2648
2649 Fix macroexp crash on Windows with debugging (Bug#12118).
2650 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
2651 checking subscripts; problem introduced with the recent
2652 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
2653 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
2654 since it's used in non-static inline functions now.
2655
2656 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
2657 Don't assume buffer size fits in 'int'. Remove unused local.
2658
2659 Use C99-style 'extern inline' if available.
2660 * buffer.h (BUFFER_INLINE):
2661 * category.h (CATEGORY_INLINE):
2662 * character.h (CHARACTER_INLINE):
2663 * charset.h (CHARSET_INLINE):
2664 * composite.h (COMPOSITE_INLINE):
2665 * dispextern.h (DISPEXTERN_INLINE):
2666 * lisp.h (LISP_INLINE):
2667 * systime.h (SYSTIME_INLINE):
2668 New macro, replacing 'static inline' in this header.
2669 * buffer.h, category.h, character.h, charset.h, composite.h:
2670 * dispextern.h, lisp.h, systime.h:
2671 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2672 * alloc.c (LISP_INLINE):
2673 * buffer.c (BUFFER_INLINE):
2674 * category.c (CATEGORY_INLINE):
2675 * character.c (CHARACTER_INLINE):
2676 * charset.c (CHARSET_INLINE):
2677 * composite.c (COMPOSITE_INLINE):
2678 * dispnew.c (DISPEXTERN_INLINE):
2679 * sysdep.c (SYSTIME_INLINE):
2680 Define to EXTERN_INLINE, so that the corresponding functions
2681 are compiled into code.
2682 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
2683 (INLINE_HEADER_END): New macros.
2684 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
2685 since it's used in non-static inline functions now.
2686 (VALMASK) [!USE_LSB_TAG]: Likewise.
2687
2688 2012-08-02 Glenn Morris <rgm@gnu.org>
2689
2690 * s/: Remove empty directory.
2691
2692 * s/ms-w32.h: Move to ../nt/inc.
2693 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
2694 Update for new ms-w32.h location.
2695
2696 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
2697
2698 Port to Solaris 8.
2699 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
2700
2701 2012-08-02 Glenn Morris <rgm@gnu.org>
2702
2703 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
2704 hard-coding the path separator.
2705
2706 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2707
2708 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
2709 This how ASET and AREF are supposed to work, and makes
2710 it easier to think about future improvements. See
2711 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
2712 * charset.h (set_charset_attr): New function.
2713 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
2714 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
2715 (aref_addr): New function. All uses of &AREF(...) changed.
2716 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
2717 (set_hash_index): New functions. All lvalue-style uses of
2718 HASH_KEY etc. changed.
2719 * keyboard.c (set_prop): New function. All lvalue-style uses
2720 of PROP changed.
2721
2722 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
2723
2724 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
2725 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
2726 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
2727 * nsfns.m (ns_set_name_as_filename): Likewise.
2728 * nsmenu.m (ns_update_menubar): Likewise.
2729 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
2730
2731 2012-08-01 Eli Zaretskii <eliz@gnu.org>
2732
2733 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
2734 Adapt to latest changes in field names of the corresponding Lisp
2735 objects.
2736
2737 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
2738
2739 2012-08-01 Glenn Morris <rgm@gnu.org>
2740
2741 * s/msdos.h: Remove file.
2742 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
2743 * Makefile.in (S_FILE): Remove.
2744 (config_h): Remove S_FILE.
2745
2746 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2747
2748 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
2749 Remove; moved to nt/config.nt.
2750
2751 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2752
2753 Use INTERNAL_FIELD for conses and overlays.
2754 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
2755 Remove obsolete comment.
2756 (MVAR): New macro.
2757 (struct Lisp_Overlay): Use INTERNAL_FIELD.
2758 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
2759
2760 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2761
2762 Use INTERNAL_FIELD for symbols.
2763 * lisp.h (SVAR): New macro. Adjust users.
2764 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
2765 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
2766
2767 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2768
2769 Use INTERNAL_FIELD for processes.
2770 * process.h (PVAR): New macro. Adjust style.
2771 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
2772 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
2773
2774 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
2775
2776 Use INTERNAL_FIELD for windows.
2777 * window.h (WVAR): New macro.
2778 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
2779 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
2780 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
2781 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
2782 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
2783 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2784
2785 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
2786
2787 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
2788
2789 2012-08-01 Glenn Morris <rgm@gnu.org>
2790
2791 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
2792 Move to configure.ac.
2793
2794 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
2795
2796 * makefile.w32-in (CONFIG_H): Update dependencies.
2797 (CONF_POST_H): New macro.
2798
2799 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
2800
2801 2012-07-31 Glenn Morris <rgm@gnu.org>
2802
2803 * Makefile.in (S_FILE): No longer set by configure.
2804
2805 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
2806 is available.
2807 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
2808
2809 * process.h (NULL_DEVICE):
2810 * emacs.c (SEPCHAR):
2811 * editfns.c (USER_FULL_NAME): Let configure set them.
2812
2813 * s/README, s/template.h: Remove files.
2814
2815 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
2816
2817 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
2818 Move to configure.ac.
2819
2820 2012-07-31 Eli Zaretskii <eliz@gnu.org>
2821
2822 * .gdbinit (xframe): Adapt to introduction of FVAR and the
2823 resulting renaming of 'struct frame' members.
2824
2825 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
2826
2827 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
2828 after introduction of FVAR.
2829
2830 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2831
2832 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
2833
2834 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
2835 instead of compositeToPoint.
2836 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
2837
2838 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
2839
2840 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2841
2842 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
2843 * lisp.h (INTERNAL_FIELD): New macro.
2844 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
2845 (BVAR): Change to use INTERNAL_FIELD.
2846 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
2847 (KVAR): Change to use INTERNAL_FIELD.
2848 * frame.h (FVAR): New macro.
2849 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
2850 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
2851 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
2852 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
2853 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
2854
2855 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
2856
2857 Miscellaneous fixes for non-default X toolkits.
2858 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
2859 * xterm.c (x_frame_of_widget): Remove redundant prototype.
2860 Move under #ifdef USE_LUCID.
2861 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
2862 definition and usage to avoid warnings.
2863
2864 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
2865
2866 * nsterm.m (openFiles): Fix previous checkin.
2867
2868 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
2869
2870 * indent.c (compute_motion): Remove unused local.
2871
2872 2012-07-31 Glenn Morris <rgm@gnu.org>
2873
2874 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
2875
2876 * conf_post.h [USG5_4]:
2877 Move remaining contents of s/usg5-4-common.h here.
2878 * s/usg5-4-common.h: Remove file.
2879
2880 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
2881 * s/irix6-5.h: Remove file.
2882
2883 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
2884 * s/darwin.h: Remove file.
2885
2886 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
2887 * s/hpux10-20.h: Remove file, which is now empty.
2888
2889 2012-07-30 Glenn Morris <rgm@gnu.org>
2890
2891 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
2892 * Makefile.in (config_h): Add conf_post.h.
2893 * makefile.w32-in (CONFIG_H): Add conf_post.h.
2894
2895 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
2896
2897 * nsterm.m (ns_do_open_file): New variable.
2898 (ns_term_init): Set ns_do_open_file to YES after run returns.
2899 (openFile, openTempFile, openFileWithoutUI, openFiles):
2900 Open files only if ns_do_open_file.
2901
2902 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2903
2904 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
2905 This no-op macro hasn't been needed for many years.
2906 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
2907
2908 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
2909 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
2910 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
2911 gdb_make_enums_visible.
2912 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
2913 (DIRECTORY_SEP): Now a constant, not a macro.
2914
2915 2012-07-30 Eli Zaretskii <eliz@gnu.org>
2916
2917 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
2918 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
2919
2920 * w32term.c <w32_keyboard_codepage>: Renamed from
2921 keyboard_codepage and now external. All users changed.
2922
2923 * w32term.h: Add declaration of w32_keyboard_codepage.
2924
2925 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
2926 the codepage to translate keys to Unicode. If this argument is
2927 -1, use the value returned by GetConsoleCP. All callers changed.
2928
2929 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2930
2931 Update .PHONY listings in makefiles.
2932 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
2933 bootstrap-clean, distclean, maintainer-clean, versioclean,
2934 extraclean, frc.
2935
2936 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
2937 This is a bit clearer. Fix some commentary typos.
2938
2939 2012-07-30 Glenn Morris <rgm@gnu.org>
2940
2941 * s/netbsd.h: Let configure include signal.h if needed.
2942 Remove file, which is now empty.
2943
2944 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
2945 Let configure set them.
2946 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
2947 No more need to undefine.
2948
2949 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
2950
2951 * keymap.c (Fkey_description): Don't remove 0x80 bit from
2952 non-single-byte char when adding meta modifier. (Bug#12090)
2953
2954 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2955
2956 Convert safe_call to use variable number of arguments.
2957 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
2958 (safe_call2): Fix comment.
2959 * lisp.h (safe_call): Adjust prototype.
2960 * coding.c (encode_coding_object): Change to use safe_call2.
2961 * xfaces.c (merge_face_heights): Change to use safe_call1.
2962
2963 2012-07-30 Glenn Morris <rgm@gnu.org>
2964
2965 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
2966 does that unconditionally. Remove file, which is now empty.
2967
2968 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
2969 Remove empty files.
2970
2971 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
2972
2973 Export to GDB most of lisp.h's remaining object-like macros.
2974 * lisp.h (min, max): Move earlier, because they're used earlier now.
2975 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
2976 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
2977 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
2978 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
2979 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
2980 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
2981 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
2982 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
2983 Now constants, for GDB. They need not be macros.
2984 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
2985 Now constants, for GDB, as well as macros, for static initializers.
2986 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
2987 Move to after the definition of struct Lisp_Char_Table,
2988 since the former now needs that type defined.
2989 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
2990 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
2991 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
2992 New enums, for gdb_make_enums_visible.
2993 (GLYPH_MODE_LINE_FACE): Remove; unused.
2994 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
2995 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
2996 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
2997 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
2998 enum maxargs, enum MAX_ALLOCA.
2999 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
3000 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
3001 no longer needed, now that they are done in lisp.h.
3002
3003 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
3004
3005 Cleanup string bytes checking.
3006 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
3007 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
3008 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
3009 (check_sblock, compact_small_strings): Simplify.
3010
3011 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3012
3013 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
3014 These macros are confusing and no longer need to be defined, as
3015 the enum values now suffice. All uses replaced with definiens.
3016 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
3017
3018 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
3019
3020 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
3021 ($(BLD)/w32console.$(O)): Update dependencies.
3022
3023 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3024
3025 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
3026 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
3027 time. Adjust users.
3028 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
3029
3030 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
3031
3032 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
3033 setting sitelisp (Bug#12010).
3034
3035 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3036
3037 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
3038
3039 * w32heap.c (cache_system_info):
3040 * w32.c (sys_rename):
3041 * w32proc.c (find_child_console, sys_kill): All users changed.
3042
3043 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3044
3045 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
3046
3047 2012-07-29 Eli Zaretskii <eliz@gnu.org>
3048
3049 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
3050
3051 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3052
3053 Cleanup statistics calculation in Fgarbage_collect.
3054 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
3055 Fix zombies percentage calculation. Simplify elapsed time calculation.
3056
3057 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
3058
3059 Generalize marker debugging code under MARKER_DEBUG and use eassert.
3060 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
3061 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
3062 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
3063 (replace_range, replace_range_2, del_range_2): Change to eassert.
3064 * marker.c (byte_char_debug_check): Adjust style.
3065
3066 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
3067
3068 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
3069 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
3070 long-ago-commented-out code that talks about "WIN32".
3071 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
3072 All uses changed.
3073
3074 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
3075
3076 Use Gnulib stdalign module (Bug#9772, Bug#9960).
3077 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
3078 Simplify by using alignof.
3079 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
3080 * lisp.h: Include <stdalign.h>.
3081 (GCALIGNMENT): New macro and constant.
3082 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
3083 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
3084 (stdalign): New macro, if not already defined.
3085
3086 2012-07-28 Eli Zaretskii <eliz@gnu.org>
3087
3088 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
3089 * w32inevt.c: Include w32inevt.h.
3090 (w32_read_console_input): New inline function, calls either
3091 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
3092 w32_console_unicode_input.
3093 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
3094 (w32_kbd_patch_key, key_event): Use the codepage returned by
3095 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
3096 (key_event): use uChar.UnicodeChar only if
3097 w32_console_unicode_input is non-zero.
3098
3099 * w32console.c: Include w32heap.h.
3100 <w32_console_unicode_input>: New global variable.
3101 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
3102 family of Windows, zero otherwise.
3103
3104 * w32inevt.h: Declare w32_console_unicode_input.
3105
3106 * xdisp.c (init_iterator): Don't reference tip_frame in a build
3107 --without-x. (Bug#11742)
3108
3109 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3110
3111 Adjust GDB to reflect pvec_type changes (Bug#12036).
3112 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
3113 2012-07-04 changes to pseudovector representation.
3114 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
3115
3116 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
3117
3118 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
3119 bus address.
3120 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
3121
3122 2012-07-27 Eli Zaretskii <eliz@gnu.org>
3123
3124 * alloc.c (listn): Fix the order the arguments are consed onto the
3125 list.
3126
3127 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
3128 enumeration constants, as PURE and HEAP are too general, and clash
3129 with other headers and sources, such as gmalloc.c and the
3130 MS-Windows system headers. All users changed.
3131
3132 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3133
3134 Revert last save_excursion_save and save_excursion_restore changes.
3135 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
3136 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
3137
3138 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3139
3140 Fix recently-introduced typos in Windows port.
3141 Reported by Martin Rudalics <rudalics@gmx.at>.
3142 * w32.c (init_environment): Replace comma with semicolon.
3143 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
3144
3145 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 Improve GDB symbol export (Bug#12036).
3148 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
3149 arms of an 'if', not using conditional expressions; otherwise GDB
3150 complains about the types in the unevaluated arm when the argument
3151 is an integer literal.
3152 (xgetint): Simplify expression.
3153 * alloc.c (gdb_make_enums_visible): New constant. This ports to
3154 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
3155 Zaretskii in <http://bugs.gnu.org/12036#13>.
3156 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
3157 needed now that we have gdb_make_enums_visible.
3158 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
3159 (enum enum_USE_LSB_TAG):
3160 New enum types, packaging up enums that need to be exported to GDB.
3161
3162 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3163
3164 Utility function to make a list from specified amount of objects.
3165 * lisp.h (enum constype): New datatype.
3166 (listn): New prototype.
3167 * alloc.c (listn): New function.
3168 (Fmemory_use_count, syms_of_alloc): Use it.
3169 * buffer.c (syms_of_buffer): Likewise.
3170 * callint.c (syms_of_callint): Likewise.
3171 * charset.c (define_charset_internal): Likewise.
3172 * coding.c (syms_of_coding): Likewise.
3173 * keymap.c (syms_of_keymap): Likewise.
3174 * search.c (syms_of_search): Likewise.
3175 * syntax.c (syms_of_syntax): Likewise.
3176 * w32.c (init_environment): Likewise.
3177 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
3178 * xdisp.c (syms_of_xdisp): Likewise.
3179 * xfns.c (syms_of_xfns): Likewise.
3180
3181 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
3182
3183 Fast save_excursion_save and save_excursion_restore.
3184 * lisp.h (struct Lisp_Excursion): New data type.
3185 (PVEC_EXCURSION): New pseudovector type.
3186 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
3187 to deal with it. Adjust comments.
3188 (init_marker, attach_marker): New prototype.
3189 (unchain_marker): Adjust prototype.
3190 * marker.c (attach_marker): Change to global.
3191 (init_marker): New function.
3192 * alloc.c (Fmake_marker, build_marker): Use it.
3193 (build_marker): More easserts.
3194 (mark_object): Handle struct Lisp_Excursion.
3195 * editfns.c (save_excursion_save, save_excursion_restore):
3196 Reimplement to use struct Lisp_Excursion. Add comments.
3197
3198 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3199
3200 Fix export of symbols to GDB (Bug#12036).
3201 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
3202 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
3203 emacs.c, as this is a more-suitable home. Had this been done earlier
3204 the fix for 12036 would have avoided some of the problems noted in
3205 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
3206 would have been more obvious.
3207 * emacs.c: Do not include <verify.h>; no longer needed.
3208 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
3209 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
3210 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3211 Remove; now done in lisp.h.
3212 * lisp.h (PUBLISH_TO_GDB): New macro.
3213 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
3214 (DATA_SEG_BITS): Use it.
3215 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
3216 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
3217 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
3218 not be usable in #if. This simplifies things.
3219
3220 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
3221
3222 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
3223
3224 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
3225
3226 Simplify export of symbols to GDB (Bug#12036).
3227 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
3228 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
3229 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
3230 Adjust to changes in lisp.h and emacs.c, by using
3231 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
3232 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
3233 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
3234 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
3235 instead of gdb_valbits.
3236 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
3237 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
3238 instead of gdb_array_mark_flag.
3239 (xboolvector): Get size from $->size, not $->header.size.
3240 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
3241 (xreload, hook-run, hookpost-run): Remove.
3242 * emacs.c: Include <verify.h>.
3243 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
3244 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
3245 Remove.
3246 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
3247 (gdb_USE_LSB_TAG): New enum constants.
3248 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
3249 Also define these as enum constants, so they're visible to GDB.
3250 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
3251 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
3252 as constants, so they're visible to GDB.
3253 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
3254 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
3255 Now enum constants, not macros, so they're visible to GDB.
3256 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
3257 more convenient now. All uses changed.
3258 (VALMASK) [USE_LSB_TAG]: Also define in this case.
3259 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
3260
3261 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
3262
3263 Explicitly free restriction data that are not needed anymore.
3264 * editfns.c (save_restriction_restore): Free restriction data.
3265
3266 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
3267
3268 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
3269 add argument, tune behavior, and adjust all callers.
3270
3271 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
3272
3273 Use typedef for EMACS_INT, EMACS_UINT.
3274 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
3275 than macros. This simplifies debugging in the usual case, since
3276 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
3277 and it allows expressions involving EMACS_INT casts.
3278 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
3279
3280 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
3281
3282 * nsterm.m (ns_read_socket): Return early if there is a modal
3283 window (Bug#12043).
3284
3285 2012-07-25 Martin Rudalics <rudalics@gmx.at>
3286
3287 * frame.c (Fredirect_frame_focus): In doc-string don't mention
3288 that FOCUS-FRAME can be omitted.
3289
3290 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
3291
3292 Adjust buffer text indirection counters at the end of Fkill_buffer.
3293 * buffer.c (Fkill_buffer): Adjust indirection counters when the
3294 buffer is definitely dead. This should really fix an issue reported
3295 by Christoph Scholtes again. (Bug#12007).
3296 (init_buffer_once): Initialize indirection counters of
3297 buffer_defaults and buffer_local_symbols (for sanity and safety).
3298
3299 2012-07-24 Eli Zaretskii <eliz@gnu.org>
3300
3301 * xdisp.c (init_iterator): Don't compute dimensions of truncation
3302 and continuation glyphs on tooltip frames, leave them at zero.
3303 Avoids continued lines in tooltips. (Bug#11832)
3304
3305 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
3306
3307 Simplify copy_overlay.
3308 * buffer.c (copy_overlay): Simplify. Use build_marker.
3309 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
3310
3311 2012-07-23 Eli Zaretskii <eliz@gnu.org>
3312
3313 * print.c (print_object): Don't crash when a frame's name is nil
3314 or invalid. (Bug#12025)
3315
3316 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
3317 it signals an error when a tooltip frame is being created.
3318
3319 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3320
3321 Cleanup miscellaneous objects allocation and initialization.
3322 * alloc.c (allocate_misc): Change to static. Add argument to
3323 specify the subtype. Adjust comment and users.
3324 (build_overlay): New function.
3325 * buffer.c (copy_overlays, Fmake_overlay): Use it.
3326 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
3327 (allocate_misc): Remove prototype.
3328 (build_overlay): Add prototype.
3329
3330 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
3331
3332 Swap buffer text indirection counters in Fbuffer_swap_text.
3333 * buffer.c (Fbuffer_swap_text): Swap indirections too.
3334 This avoids crash reported by Christoph Scholtes at
3335 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
3336
3337 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
3338
3339 * nsmenu.m (Popdown_data): New struct.
3340 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
3341 free Popdown_data.
3342 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
3343 (initWithContentRect): Make imgView and contentView non-static
3344 and autorelease them. Also autorelease img and matrix (Bug#12005).
3345 (dealloc): Remove (Bug#12005).
3346
3347 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3348
3349 Adjust consing_since_gc when objects are explicitly freed.
3350 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
3351 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
3352 (free_cons, free_misc): Subtract object size from consing_since_gc.
3353
3354 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
3355
3356 Simplify and cleanup markers positioning code.
3357 * marker.c (attach_marker): More useful eassert.
3358 (live_buffer, set_marker_internal): New function.
3359 (Fset_marker, set_marker_restricted): Use set_marker_internal.
3360 (set_marker_both, set_marker_restricted_both): Use live_buffer.
3361
3362 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
3363
3364 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
3365 as it's limited by the amount of memory, not by INT_MAX.
3366
3367 2012-07-21 Eli Zaretskii <eliz@gnu.org>
3368
3369 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
3370 in special-event-map. See the discussion at
3371 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
3372 for the reasons.
3373
3374 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
3375 info.dwItemData. Fixes crashes on 64-bit Windows.
3376 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3377
3378 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
3379
3380 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
3381 (conversationIdentifier): Return value is NSInteger.
3382 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
3383
3384 2012-07-21 Chong Yidong <cyd@gnu.org>
3385
3386 * window.c (decode_any_window): Signal an error if the window is
3387 on a dead frame (Bug#11984).
3388
3389 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3390
3391 Add indirection counting to speed up Fkill_buffer.
3392 * buffer.h (struct buffer): New member.
3393 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
3394 (Fmake_indirect_buffer): Set indirection counter to -1, increment
3395 base buffer indirection counter.
3396 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
3397 (Fkill_buffer): Adjust indirection counters as needed, don't walk
3398 through buffer list if indirection counter is 0.
3399
3400 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3401
3402 Extend the value returned by Fgarbage_collect with heap statistics.
3403 * alloc.c (Qheap): New symbol.
3404 (syms_of_alloc): DEFSYM it.
3405 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
3406 (Fmemory_free): Remove.
3407 (syms_of_alloc): Don't defsubr it.
3408 * buffer.c (Fcompact_buffer): Remove.
3409 (syms_of_buffer): Don't defsubr it.
3410
3411 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3412
3413 Make maybe_gc inline.
3414 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
3415 * lisp.h (consing_since_gc, gc_relative_threshold)
3416 (memory_full_cons_threshold): Revert declaration.
3417 (maybe_gc): Remove prototype, define as inline.
3418 * alloc.c: Remove old commented-out code.
3419 (consing_since_gc, gc_relative_threshold)
3420 (memory_full_cons_threshold): Revert to global.
3421 (maybe_gc): Remove.
3422
3423 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3424
3425 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
3426 * lisp.h (build_unibyte_string): New function.
3427 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
3428 * sysdep.c, w32fns.c, xfns.c: Use it.
3429 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
3430 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
3431 Adjust users accordingly.
3432 * font.h (font_open_by_name): Adjust prototype.
3433
3434 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
3435
3436 Cleanup calls to Fgarbage_collect.
3437 * lisp.h (maybe_gc): New prototype.
3438 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3439 Remove declarations.
3440 * alloc.c (maybe_gc): New function.
3441 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
3442 Make them static.
3443 * bytecode.c (MAYBE_GC): Use maybe_gc.
3444 * eval.c (eval_sub, Ffuncall): Likewise.
3445 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
3446 to avoid dependency from auto-save feature.
3447
3448 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
3449
3450 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
3451 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
3452 'for_each_per_buffer_object_at'.
3453 All uses changed. It's better to use upper-case for macros that
3454 cannot be implemented as functions, to give the reader a clue
3455 that they're special.
3456
3457 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
3458
3459 * alloc.c (Fgarbage_collect): Tweak docstring.
3460
3461 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3462
3463 Tweak the value returned from Fgarbage_collect again.
3464 * alloc.c (Fgarbage_collect): New return value, as confirmed in
3465 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
3466 Adjust documentation.
3467 (total_vector_bytes): Rename to total_vector_slots, adjust
3468 accounting.
3469 (total_free_vector_bytes): Rename to total_free_vector_slots,
3470 adjust accounting.
3471 (Qstring_bytes, Qvector_slots): New symbols.
3472 (syms_of_alloc): DEFSYM them.
3473
3474 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3475
3476 Buffer compaction primitive which may be used from Lisp.
3477 * buffer.c (compact_buffer, Fcompact_buffer): New function.
3478 (syms_of_buffer): Register Fcompact_buffer.
3479 * alloc.c (Fgarbage_collect): Use compact_buffer.
3480 * buffer.h (compact_buffer): New prototype.
3481 (struct buffer_text): New member.
3482
3483 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
3484
3485 New macro to iterate over all buffers, miscellaneous cleanups.
3486 * lisp.h (all_buffers): Remove declaration.
3487 * buffer.h (all_buffers): Add declaration, with comment.
3488 (for_each_buffer): New macro.
3489 * alloc.c (Fgarbage_collect, mark_object): Use it.
3490 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
3491 (init_buffer): Likewise.
3492 * data.c (Fset_default): Likewise.
3493 * coding.c (code_conversion_restore): Remove redundant check
3494 for dead buffer.
3495 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
3496
3497 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3498
3499 Fix bug that created negative-length intervals.
3500 * intervals.c (merge_interval_right, merge_interval_left):
3501 Do not zero out this interval if it is absorbed by its children,
3502 as this interval's total length doesn't change in that case. See
3503 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
3504
3505 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
3506
3507 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
3508 when invoking (make-bool-vector N t) and N is a positive
3509 multiple of 8 -- the last 8 bits were mistakenly cleared.
3510
3511 Remove some struct layout assumptions in bool vectors.
3512 * alloc.c (bool_header_size): New constant.
3513 (header_size, word_size): Move earlier, as they're now used earlier.
3514 Use 'word_size' in a few more places, where it's appropriate.
3515 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
3516 padding before the data member of a bool vector.
3517 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
3518 than doing the check by hand with an abort ().
3519
3520 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
3521
3522 * eval.c (Fdefvar): Don't check constants since we only set the var if
3523 it's not yet defined anyway (bug#11904).
3524
3525 * lisp.h (last_undo_boundary): Declare new var.
3526 * keyboard.c (command_loop_1): Set it.
3527 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
3528 were auto-added by the command loop (bug#11774).
3529
3530 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
3531
3532 * w32font.c (Qsymbol): Remove local definition.
3533 (syms_of_w32font): Don't DEFSYM it.
3534
3535 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3536
3537 Fix sweep_vectors to handle large bool vectors correctly.
3538 * alloc.c (sweep_vectors): Account total_vector_bytes for
3539 bool vectors larger than VBLOCK_BYTES_MAX.
3540
3541 2012-07-18 Chong Yidong <cyd@gnu.org>
3542
3543 * frame.c (x_set_frame_parameters): Revert bogus change introduced
3544 in 2012-05-25 commit by Paul Eggert (Bug#11738).
3545
3546 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
3547
3548 Return more descriptive data from Fgarbage_collect.
3549 Suggested by Stefan Monnier in
3550 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
3551 * alloc.c (bounded_number): New function.
3552 (total_buffers, total_vectors): New variable.
3553 (total_string_size): Rename to total_string_bytes, adjust users.
3554 (total_vector_size): Rename to total_vector_bytes, adjust users.
3555 (sweep_vectors): Account total_vectors and total_vector_bytes.
3556 (Fgarbage_collect): New return value. Adjust documentation.
3557 (gc_sweep): Account total_buffers.
3558 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
3559 (VECTOR_SIZE): Remove.
3560 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
3561 (Qinterval, Qmisc): New symbols.
3562 (syms_of_data): Initialize them.
3563 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
3564 (Qcons, Qbuffer): New declarations.
3565
3566 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3567
3568 * alloc.c (Fmemory_free): Account for memory-free's own storage.
3569 Round up, not down. Improve doc.
3570
3571 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3572
3573 Restore old code in allocate_string_data to avoid Faset breakage.
3574 Reported by Julien Danjou <julien@danjou.info> in
3575 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
3576 * alloc.c (allocate_string_data): Restore old code with minor
3577 adjustments, fix comment to explain this subtle issue.
3578
3579 2012-07-17 Eli Zaretskii <eliz@gnu.org>
3580
3581 Remove FILE_SYSTEM_CASE.
3582 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
3583
3584 * fileio.c (FILE_SYSTEM_CASE): Don't define.
3585 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
3586 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
3587 call-process-region passes it through expand-file-name.
3588
3589 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
3590
3591 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3592
3593 Fix crash when creating indirect buffer (Bug#11917)
3594 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
3595 Don't handle unbound variables specially if non-zero.
3596 (Fbuffer_local_variables): Pass zero.
3597 (clone_per_buffer_values): Pass non-zero.
3598
3599 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3600
3601 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
3602 to make the loop interruptible.
3603
3604 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
3605
3606 * gnutls.c (emacs_gnutls_handshake): Only retry if
3607 GNUTLS_E_INTERRUPTED.
3608
3609 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3610
3611 Cleanup and convert miscellaneous checks to eassert.
3612 * alloc.c (mark_interval): Fix comment, partially rephrase
3613 old comment from intervals.h (see below).
3614 * intervals.c (find_interval, adjust_intervals_for_insertion)
3615 (delete_interval, adjust_intervals_for_deletion)
3616 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
3617 Convert to eassert.
3618 (adjust_intervals_for_insertion, make_new_interval):
3619 Remove obsolete and unused code.
3620 * intervals.h (struct interval): Remove obsolete comment.
3621 * textprotp.c (erase_properties): Remove unused code.
3622 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
3623 (Fremove_list_of_text_properties): Convert to eassert.
3624
3625 2012-07-17 Chong Yidong <cyd@gnu.org>
3626
3627 * editfns.c (Finsert_char): Doc fix.
3628
3629 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3630
3631 Fix previous change to make Fmemory_free always accurate.
3632 * alloc.c (make_interval): Update total_free_intervals.
3633 (make_float): Likewise for total_free_floats.
3634 (free_cons, Fcons): Likewise for total_free_conses.
3635 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
3636 Likewise for total_free_vector_bytes.
3637 (Fmake_symbol): Likewise for total_free_symbols.
3638 (bytes_free): Remove.
3639
3640 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3641
3642 Simple free memory accounting feature.
3643 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
3644 (sweep_vectors): Accumulate size of free vectors.
3645 (Fgarbage_collect): Setup bytes_free.
3646 (Fmemory_free): New function.
3647 (syms_of_alloc): Register it.
3648
3649 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
3650
3651 Cleanup overlays checking.
3652 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
3653 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
3654 eassert and OVERLAYP.
3655 (sort_overlays): Change to use OVERLAYP.
3656
3657 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
3658
3659 * editfns.c (Finsert_char): Make it interactive, and make the
3660 second arg optional. Copy interactive spec and docstring from
3661 ucs-insert.
3662
3663 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
3664
3665 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
3666 Unlike the other wrapped functions, fabs has an unspecified
3667 effect on errno.
3668
3669 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
3670
3671 * nsterm.m (keyDown): Interpret flags without left/right bits
3672 as the left key (Bug#11670).
3673
3674 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3675
3676 Remove empty and useless init functions.
3677 * lisp.h (init_character_once, init_fns, init_image)
3678 (init_filelock, init_sound): Remove prototype.
3679 * character.c (init_character_once): Remove.
3680 * filelock.c (init_filelock): Likewise.
3681 * fns.c (init_fns): Likewise.
3682 * image.c (init_image): Likewise.
3683 * sound.c (init_sound): Likewise.
3684 * emacs.c (main): Adjust accordingly.
3685
3686 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
3687
3688 * gtkutil.h: Tiny cleanups.
3689 (use_old_gtk_file_dialog): Remove useless declaration.
3690 (xg_uses_old_file_dialog): Add suggested const attribute.
3691
3692 2012-07-15 Eli Zaretskii <eliz@gnu.org>
3693
3694 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
3695 (bidi_paragraph_init): Use it to limit search forward for a strong
3696 directional character in abnormally large paragraphs full of
3697 neutral or weak characters. (Bug#11943)
3698
3699 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
3700
3701 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
3702 the toolbar (Bug#9451).
3703 (xg_make_tool_item): Give the widget event box a transparent
3704 background.
3705
3706 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3707
3708 Cleanup basic allocation variables and functions.
3709 * alloc.c (ignore_warnings, init_intervals, init_float)
3710 (init_cons, init_symbol, init_marker): Remove.
3711 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
3712 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
3713 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
3714 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
3715 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
3716 (staticidx, init_alloc_once, init_strings, free_ablock):
3717 Remove redundant initialization.
3718 * fns.c (init_weak_hash_tables): Remove.
3719 * lisp.h (init_weak_hash_tables): Remove prototype.
3720
3721 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
3722
3723 Use zero_vector where appropriate.
3724 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
3725 accordingly.
3726 * lisp.h (zero_vector): New declaration.
3727 * font.c (null_vector): Remove.
3728 (syms_of_font): Remove initialization and staticpro.
3729 (font_list_entities, font_find_for_lface): Change to use zero_vector.
3730 * keymap.c (Faccessible_keymaps): Likewise.
3731
3732 2012-07-15 Leo Liu <sdl.web@gmail.com>
3733
3734 * fringe.c: Fix typo in comments.
3735
3736 2012-07-14 Leo Liu <sdl.web@gmail.com>
3737
3738 * fringe.c: Add a new bitmap exclamation-mark.
3739
3740 2012-07-14 Eli Zaretskii <eliz@gnu.org>
3741
3742 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
3743
3744 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
3745 (HAVE_MENUS): Don't define, defined by editing config.in with
3746 msdos/sed2v2.inp.
3747 (GMALLOC_INHIBIT_VALLOC): Don't define.
3748 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
3749
3750 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
3751
3752 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
3753
3754 2012-07-14 Glenn Morris <rgm@gnu.org>
3755
3756 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
3757 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
3758 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
3759
3760 2012-07-13 Glenn Morris <rgm@gnu.org>
3761
3762 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
3763
3764 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
3765 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
3766
3767 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
3768
3769 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
3770 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
3771 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
3772 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
3773 where appropriate.
3774 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
3775 as boolean expression.
3776 (x_set_window_size): Remove unused variable toolbar.
3777 (ns_get_color_default, ns_mod_to_lisp): Remove.
3778 (ns_mouse_position): Remove unused variables xchar and ychar.
3779 (ns_compute_glyph_string_overhangs): Remove unused variable face.
3780 (ns_set_vertical_scroll_bar): Remove unused variable count.
3781 (ns_delete_terminal): Remove unused variable i.
3782 (ns_term_init): Remove unused variables r, g and b.
3783 (mouseDown): Remove unused variable window.
3784 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
3785 (initFrameFromEmacs): Remove unused variable vbextra.
3786 (mouseEntered): Remove unused variables p and dpyinfo.
3787 (mouseExited): Remove unused variables p and r.
3788 (ns_define_frame_cursor, ns_clear_frame_area)
3789 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
3790 (menuDown): Assign [sender tag] to variable and cast the variable.
3791
3792 * nsterm.h (menuDown): Add id as type to argument sender.
3793 (ns_display_info_for_name): Add Lisp_Object argument.
3794 (ns_term_init): Add Lisp_Object argument.
3795 (ns_map_event_to_object): Add void argument.
3796 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
3797 prototype with arguments and only declare if __OBJC__.
3798 (nxatoms_of_nsselect): Add void argument.
3799 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
3800 (ns_alloc_autorelease_pool): Add void argument.
3801 (ns_release_autorelease_pool): Add void* argument.
3802 (ns_get_defaults_value): Add const char* argument.
3803
3804 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
3805 (initFromContents): Use SSDATA where appropriate.
3806 (ns_update_menubar): Add braces to ambigous if-else.
3807 (initWithTitle): Put () around assignment in if statement.
3808 (ns_menu_show): Remove unused variables window and keymap.
3809 (update_frame_tool_bar): Remove unused variable selected_p.
3810 (initWithContentRect): Remove unused variable this_cmd_name.
3811
3812 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
3813 appropriate.
3814 (setXBMColor): Remove unused variable len.
3815 (setPixmapData): Put () around assignment in loop statement.
3816
3817 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
3818 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
3819 where appropriate.
3820 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
3821 around assignment in loop statement.
3822 (nsfont_open): Remove unused variable i.
3823 (nsfont_open): Remove unused variable len.
3824 (nsfont_draw): Remove unused variable cs.
3825
3826 * nsfns.m (x_set_icon_name, ns_set_name_internal)
3827 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
3828 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
3829 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
3830 (Fns_font_name, Fns_perform_service)
3831 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
3832 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
3833 (ns_set_name): Remove unused variable view.
3834 (x_set_menu_bar_lines): Remove unused variable olines.
3835 (x_set_tool_bar_lines): Remove unused variable root_window.
3836 (Fns_list_colors): Put () around assignment in while statement.
3837 (Fns_perform_service): Remove unused variable len.
3838 (Fns_display_usable_bounds): Remove unused variable top.
3839 (syms_of_nsfns): Remove unused variable i.
3840
3841 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
3842 memcpy (Bug#11907).
3843
3844 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
3845
3846 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
3847 and free it with DestroyExceptionInfo (Bug#11558).
3848
3849 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
3850
3851 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
3852 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
3853 Set here, not in nt/config.nt.
3854
3855 2012-07-13 Eli Zaretskii <eliz@gnu.org>
3856
3857 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
3858 cursor overflow into the last glyph on display line when the right
3859 fringe is off. (Bug#11832)
3860
3861 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
3862
3863 * xdisp.c (produce_special_glyphs): Now static.
3864 * dispextern.h (produce_special_glyphs): Remove decl.
3865
3866 2012-07-13 Glenn Morris <rgm@gnu.org>
3867
3868 * s/bsd-common.h, s/cygwin.h: Remove empty files.
3869 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
3870
3871 * s/usg5-4-common.h (USG, USG5):
3872 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
3873 * s/sol2-6.h (SOLARIS2):
3874 * s/irix6-5.h (IRIX6_5):
3875 * s/hpux10-20.h (USG, USG5, HPUX):
3876 * s/gnu-linux.h (USG, GNU_LINUX):
3877 * s/freebsd.h (BSD_SYSTEM):
3878 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
3879 * s/cygwin.h (CYGWIN):
3880 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
3881 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
3882
3883 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
3884
3885 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
3886
3887 2012-07-13 Glenn Morris <rgm@gnu.org>
3888
3889 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
3890
3891 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
3892
3893 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
3894 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
3895
3896 2012-07-12 Glenn Morris <rgm@gnu.org>
3897
3898 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
3899
3900 * process.c (init_process_emacs): Rename from init_process.
3901 The old name is also the name of a Mach system call.
3902 * lisp.h, emacs.c: Update for this name change.
3903 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
3904 longer needed.
3905
3906 2012-07-12 Eli Zaretskii <eliz@gnu.org>
3907
3908 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
3909 memmove call that removes glyphs covered by the left truncation
3910 glyph. Improve commentary.
3911 (display_line): Fix display of continuation glyphs on GUI frames
3912 when the right fringe is turned off and variable-size fonts are
3913 used in the window. Move the code that appends a stretch glyph to
3914 produce_special_glyphs, so that it could be used for truncation
3915 and continuation glyphs alike.
3916 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
3917 glyph of a suitably computed width, to align the special glyphs at
3918 the window margin. Code moved from display_line. (Bug#11832)
3919
3920 2012-07-12 Glenn Morris <rgm@gnu.org>
3921
3922 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
3923
3924 * s/gnu-linux.h, s/hpux10-20.h:
3925 Do not unconditionally define HAVE_XRMSETDATABASE.
3926
3927 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
3928
3929 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
3930
3931 Fix typos that broke OS X build.
3932 Reported by Randal L. Schwartz in
3933 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
3934 * nsterm.m (ns_timeout): Add missing local decl.
3935 (ns_get_color): snprintf -> sprintf, to fix typo.
3936
3937 2012-07-12 Glenn Morris <rgm@gnu.org>
3938
3939 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
3940 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
3941 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
3942 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
3943
3944 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
3945 Move PTY_OPEN to configure.
3946
3947 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3948 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
3949 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
3950
3951 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
3952
3953 Use empty_unibyte_string where applicable.
3954 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
3955 * lread.c (read1): Likewise.
3956 * xsettings.c (syms_of_xsettings): Likewise.
3957
3958 2012-07-12 Glenn Morris <rgm@gnu.org>
3959
3960 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
3961 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
3962 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
3963 * s/hpux10-20.h (RUN_TIME_REMAP):
3964 * s/bsd-common.h (TABDLY): Move to configure.
3965
3966 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
3967
3968 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
3969
3970 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3971 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
3972
3973 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
3974
3975 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
3976 * s/template.h: Move NARROWPROTO to configure.
3977
3978 2012-07-11 Glenn Morris <rgm@gnu.org>
3979
3980 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
3981 unused since 2011-01-17 change to systty.h.
3982
3983 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
3984 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
3985 Move HAVE_PTYS and HAVE_SOCKETS to configure.
3986
3987 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
3988
3989 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
3990
3991 2012-07-11 Glenn Morris <rgm@gnu.org>
3992
3993 * s/darwin.h, s/gnu-linux.h, s/template.h:
3994 Move INTERRUPT_INPUT to configure.
3995
3996 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
3997
3998 Minor adjustments to interning code.
3999 * lisp.h (intern, intern_c_string): Redefine as static inline
4000 wrappers for intern_1 and intern_c_string_1, respectively.
4001 (intern_1, intern_c_string_1): Rename prototypes.
4002 * lread.c (intern_1, intern_c_string_1, oblookup):
4003 Simplify Vobarray checking.
4004 * font.c (font_intern_prop): Likewise. Adjust comment.
4005 * w32font.c (intern_font_name): Likewise.
4006
4007 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
4008
4009 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
4010
4011 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
4012 of Fcar/Fcdr if possible.
4013 * font.c (check_otf_features): Likewise.
4014 * fontset.c (Fnew_fontset): Likewise.
4015 * gnutls.c (Fgnutls_boot): Likewise.
4016 * minibuf.c (read_minibuf): Likewise.
4017 * msdos.c (IT_set_frame_parameters): Likewise.
4018 * xmenu.c (Fx_popup_dialog): Likewise.
4019 * w32menu.c (Fx_popup_dialog): Likewise.
4020
4021 2012-07-11 Glenn Morris <rgm@gnu.org>
4022
4023 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
4024 since nothing has defined it on these platforms.
4025
4026 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
4027 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
4028
4029 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4030 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
4031 Move CLASH_DETECTION to configure.
4032
4033 * s/gnu.h: Remove file, which is now empty.
4034
4035 * s/gnu.h, s/gnu-linux.h:
4036 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
4037
4038 2012-07-11 John Wiegley <johnw@newartisans.com>
4039
4040 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
4041 function attribute, so we only use it if it exists in the
4042 compiler.
4043
4044 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4045
4046 Avoid call to strlen in fast_c_string_match_ignore_case.
4047 * search.c (fast_c_string_match_ignore_case): Change to use
4048 length argument. Adjust users accordingly.
4049 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
4050
4051 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
4052
4053 Assume mkdir, rmdir.
4054 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
4055 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
4056
4057 Assume rename.
4058 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
4059
4060 Assume perror.
4061 * s/hpux10-20.h (HAVE_PERROR): Remove.
4062 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
4063 Remove dummy definition, as this problem was obsolete long ago.
4064
4065 Assume strerror.
4066 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
4067
4068 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
4069
4070 Avoid calls to strlen in font processing functions.
4071 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
4072 (font_open_by_name): Change to use length argument.
4073 Adjust users accordingly.
4074 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
4075 Adjust prototypes.
4076 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
4077 Change to return ptrdiff_t.
4078 (xfont_list_pattern, xfont_match): Use length returned by
4079 xfont_decode_coding_xlfd.
4080 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
4081
4082 2012-07-11 Glenn Morris <rgm@gnu.org>
4083
4084 * s/darwin.h, s/freebsd.h, s/netbsd.h:
4085 Move DONT_REOPEN_PTY to configure.
4086
4087 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
4088 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
4089
4090 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
4091
4092 Remove "#define unix" that is no longer needed (Bug#11905).
4093 * s/aix4-2.h (unix): Remove; no longer needed.
4094
4095 EMACS_TIME simplification (Bug#11875).
4096 This replaces macros (which typically do not work in GDB)
4097 with functions, typedefs and enums, making the code easier to debug.
4098 The functional style also makes code easier to read and maintain.
4099 * systime.h: Include <sys/time.h> on all hosts, not just if
4100 WINDOWSNT, since 'struct timeval' is needed in general.
4101 (EMACS_TIME): Now a typedef, not a macro.
4102 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
4103 not macros.
4104 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
4105 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
4106 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
4107 (EMACS_TIME_LE): Now functions, not macros.
4108 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
4109 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
4110 which are not functions. All uses rewritten to use:
4111 (make_emacs_time): New function.
4112 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
4113 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
4114 not functions. All uses rewritten to use the following, respectively:
4115 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
4116 (add_emacs_time, sub_emacs_time): New functions.
4117 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
4118 * fileio.c (Fcopy_file):
4119 * xterm.c (XTflash): Get the current time closer to when it's used.
4120 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
4121
4122 * bytecode.c (targets): Suppress -Woverride-init warnings.
4123
4124 Simplify by avoiding confusing use of strncpy etc.
4125 * doc.c (Fsnarf_documentation):
4126 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
4127 * frame.c (Fmake_terminal_frame):
4128 * gtkutil.c (get_utf8_string):
4129 * lread.c (openp):
4130 * nsmenu.m (ns_update_menubar):
4131 * regex.c (regerror):
4132 Prefer memcpy to strncpy and strncat when either will do.
4133 * fileio.c (Fsubstitute_in_file_name):
4134 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
4135 (menu_separator_name_p):
4136 * nsmenu.m (ns_update_menubar):
4137 Prefer memcmp to strncmp when either will do.
4138 * nsterm.m: Include <ftoastr.h>.
4139 (ns_get_color):
4140 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
4141 Prefer snprintf to strncpy.
4142 * nsterm.m (ns_term_init):
4143 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
4144 * nsterm.m (ns_term_init):
4145 Avoid the need for strncpy, by using build_string or
4146 make_unibyte_string directly. Use dtoastr, not snprintf.
4147 * process.c (Fmake_network_process): Diagnose service names that
4148 are too long, rather than silently truncating them or creating
4149 non-null-terminated names.
4150 (Fnetwork_interface_info): Likewise, for interface names.
4151 * sysdep.c (system_process_attributes) [GNU_LINUX]:
4152 Prefer sprintf to strncat.
4153 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
4154 Prefer vsnprintf to vsprintf + strncpy.
4155
4156 2012-07-10 Glenn Morris <rgm@gnu.org>
4157
4158 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
4159 Clarify fallback case.
4160
4161 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4162
4163 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
4164 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
4165 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
4166 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
4167 where argument type is known to be a Lisp_Cons.
4168
4169 2012-07-10 Tom Tromey <tromey@redhat.com>
4170
4171 * bytecode.c (BYTE_CODE_THREADED): New macro.
4172 (BYTE_CODES): New macro. Replaces all old byte-code defines.
4173 (enum byte_code_op): New type.
4174 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
4175 (exec_byte_code): Use them. Use token threading when applicable.
4176
4177 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4178
4179 Optimize pure C strings initialization.
4180 * lisp.h (make_pure_string): Fix prototype.
4181 (build_pure_c_string): New function, defined as static inline. This
4182 provides a better opportunity to optimize away calls to strlen when
4183 the function is called with compile-time constant argument.
4184 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
4185 argument, adjust users accordingly. Use build_pure_c_string where
4186 appropriate.
4187 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
4188 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
4189 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
4190
4191 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4192
4193 Avoid calls to strlen in miscellaneous functions.
4194 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
4195 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
4196 * lread.c (openp): Likewise.
4197
4198 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
4199
4200 Avoid calls to strlen in path processing functions.
4201 * fileio.c (file_name_as_directory): Add comment. Change to add
4202 srclen argument and return the length of result. Adjust users
4203 accordingly.
4204 (directory_file_name): Fix comment. Change to add srclen argument,
4205 swap 1st and 2nd arguments to obey the common convention.
4206 Adjust users accordingly.
4207 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
4208
4209 2012-07-10 Glenn Morris <rgm@gnu.org>
4210
4211 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
4212 Move PENDING_OUTPUT_COUNT definition to configure.
4213
4214 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
4215 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
4216 * s/gnu.h (DATA_START): Move definitions to configure.
4217
4218 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
4219 We include usg5-4-common.h, which defines them both.
4220
4221 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
4222 O_RDONLY already includes it).
4223
4224 Stop ns builds setting the EMACSLOADPATH environment variable.
4225 * nsterm.m (ns_load_path): Rename from ns_init_paths.
4226 Now it does not set EMACSLOADPATH, just returns the load-path string.
4227 * nsterm.h: Update accordingly.
4228 * lread.c [HAVE_NS]: Include nsterm.h.
4229 (init_lread) [HAVE_NS]: Use ns_load_path.
4230 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
4231
4232 2012-07-09 Glenn Morris <rgm@gnu.org>
4233
4234 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
4235 since the included bsd-common.h does so.
4236
4237 Stop ns builds setting the EMACSPATH environment variable.
4238 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
4239 (ns_init_paths): Do not set EMACSPATH.
4240 * nsterm.h (ns_exec_path): Add it.
4241 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
4242 Use ns_exec_path.
4243
4244 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
4245
4246 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
4247
4248 * process.c (wait_reading_process_output): 'waitchannels' was unset
4249 when read_kbd || !NILP (wait_for_cell); fix this.
4250
4251 Add GCC-style 'const' attribute to functions that can use it.
4252 * character.h (char_resolve_modifier_mask):
4253 * keyboard.h (make_ctrl_char):
4254 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
4255 (init_character_once, next_almost_prime, init_fns, init_image)
4256 (flush_pending_output, init_sound):
4257 * mem-limits.h (start_of_data):
4258 * menu.h (finish_menu_items):
4259 Add ATTRIBUTE_CONST.
4260 * emacs.c (DEFINE_DUMMY_FUNCTION):
4261 Declare the dummy function with ATTRIBUTE_CONST.
4262 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
4263 Add decls with ATTRIBUTE_CONST.
4264
4265 Minor improvements to make_formatted_string.
4266 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
4267 where int is good enough, as vsprintf returns an int.
4268 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
4269
4270 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4271
4272 Use make_formatted_string to avoid double length calculation.
4273 * lisp.h (make_formatted_string): New prototype.
4274 * alloc.c (make_formatted_string): New function.
4275 * buffer.c (Fgenerate_new_buffer_name): Use it.
4276 * dbus.c (syms_of_dbusbind): Likewise.
4277 * editfns.c (Fcurrent_time_zone): Likewise.
4278 * filelock.c (get_boot_time): Likewise.
4279 * frame.c (make_terminal_frame, set_term_frame_name)
4280 (x_report_frame_params): Likewise.
4281 * image.c (gs_load): Likewise.
4282 * minibuf.c (get_minibuffer): Likewise.
4283 * msdos.c (dos_set_window_size): Likewise.
4284 * process.c (make_process): Likewise.
4285 * xdisp.c (ensure_echo_area_buffers): Likewise.
4286 * xsettings.c (apply_xft_settings): Likewise.
4287
4288 2012-07-09 Glenn Morris <rgm@gnu.org>
4289
4290 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
4291 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
4292 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
4293 * nsterm.h (ns_etc_directory): Add it.
4294 * callproc.c [HAVE_NS]: Include nsterm.h.
4295 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
4296
4297 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
4298
4299 Move marker debugging code under MARKER_DEBUG.
4300 * marker.c (MARKER_DEBUG): Move marker debugging code under
4301 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
4302 for bootstrap with --enable-checking (~3x slowdown reported
4303 by Juanma Barranquero <lekktu@gmail.com>).
4304 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
4305
4306 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
4307
4308 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
4309 See <http://bugs.gnu.org/11825#29>.
4310
4311 2012-07-08 Eli Zaretskii <eliz@gnu.org>
4312
4313 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
4314 has no font, use the frame's font. (Bug#11813)
4315 (display_line): Add commentary about displaying truncation glyphs
4316 on GUI frames.
4317 (produce_special_glyphs): Move here from term.c.
4318
4319 * term.c (produce_special_glyphs): Move to xdisp.c.
4320
4321 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
4322 section.
4323
4324 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
4325
4326 * xdisp.c (display_line): Avoid warning about implicit declaration
4327 of FRAME_FONT.
4328
4329 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
4330
4331 * lisp.h: Remove empty conditional.
4332
4333 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4334
4335 * lread.c (load_path_check): Now static.
4336
4337 Fix some minor --with-ns problems found by static checking.
4338 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
4339 (x_set_font) [!HAVE_X_WINDOWS]:
4340 * image.c (xpm_load_image) [HAVE_NS]:
4341 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
4342 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
4343 Remove unused local.
4344 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
4345 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
4346 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
4347 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
4348 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
4349 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
4350 Fix pointer signedness problem.
4351 * xfaces.c (FRAME_X_FONT_TABLE):
4352 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
4353
4354 2012-07-07 Glenn Morris <rgm@gnu.org>
4355
4356 * lread.c (load_path_check): New function, split from init_lread.
4357 (init_lread): Reorganize. Motivation:
4358 If EMACSLOADPATH is set, check/warn about that rather than the
4359 defaults, which we are not going to use. Hence we can remove
4360 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
4361 Don't warn if site-lisp directories are missing.
4362 If not installed, start from a blank load-path, since
4363 PATH_LOADSEARCH refers to the eventual installation directories.
4364
4365 2012-07-07 Eli Zaretskii <eliz@gnu.org>
4366
4367 Support truncation and continuation glyphs on GUI frames, when
4368 fringes are disabled. (Bug#11832)
4369 * xdisp.c (init_iterator): Get dimensions of truncation and
4370 continuation glyphs even if on GUI frames.
4371 Adjust it->last_visible_x on GUI frames when the left or right fringes,
4372 or both, are absent.
4373 (start_display, move_it_in_display_line_to): Handle the case of a
4374 GUI frame without a fringe to display continuation or truncation
4375 glyphs.
4376 (insert_left_trunc_glyphs): Support GUI frames: make sure
4377 truncation glyphs overwrite enough glyphs from the current line to
4378 have sufficient space in pixels.
4379 (display_line): Support truncation and continuation glyphs on GUI
4380 frames. If some spare pixels are left on the line after inserting
4381 the truncation glyphs, fill that space with a stretch glyph of a
4382 suitably computed width.
4383
4384 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
4385 produce_glyphs, to support GUI sessions.
4386
4387 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
4388
4389 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
4390
4391 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
4392
4393 Do not require float-time's arg to fit in time_t (Bug#11825).
4394 This works better on hosts where time_t is unsigned, and where
4395 float-time is applied to the (negative) difference between two times.
4396 * editfns.c (decode_time_components): Last arg is now double *,
4397 not int *, and means to store all the result as a double, without
4398 worrying about whether the seconds part fits in time_t.
4399 All callers changed.
4400 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
4401 All callers changed.
4402 (Ffloat_time): Do not fail merely because the specified time falls
4403 outside of time_t range.
4404
4405 2012-07-07 Glenn Morris <rgm@gnu.org>
4406
4407 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
4408 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
4409 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
4410
4411 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
4412
4413 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
4414 Update dependencies.
4415
4416 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
4417
4418 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4419
4420 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
4421 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
4422 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
4423 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
4424 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
4425 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
4426
4427 * xfont.c (compare_font_names): Redo to omit the need for casts.
4428
4429 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
4430
4431 * xfns.c (Fx_change_window_property): Doc fix.
4432 * w32fns.c (Fx_change_window_property): Doc fix.
4433
4434 * w32fns.c (Fx_window_property): Accept the same arguments as the
4435 X Windows version. Doc fix.
4436 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
4437
4438 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
4439 Eli Zaretskii <eliz@gnu.org>
4440
4441 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
4442 Windows-specific code from nt/config.nt moved here.
4443 Obsolete settings removed.
4444
4445 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4446
4447 * process.c: Avoid unnecessary calls to gettime.
4448 (wait_reading_process_output): Don't get the time of day
4449 when gobbling data immediately and not waiting, as there's no need
4450 for it in that case. This removes a FIXME.
4451
4452 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
4453
4454 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
4455 is defined (Bug#11768).
4456
4457 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4458
4459 Fix marker debugging code.
4460 * marker.c (byte_char_debug_check): Do not perform the check
4461 if buffer is not multibyte.
4462 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4463 Call byte_char_debug_check with correct arguments.
4464
4465 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4466
4467 Compile marker debugging code only if ENABLE_CHECKING is defined.
4468 * marker.c (byte_char_debug_check, count_markers):
4469 Use only if ENABLE_CHECKING is defined.
4470 (byte_debug_flag): Remove.
4471 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
4472 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
4473
4474 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4475
4476 Avoid code repetition in marker-related functions.
4477 * marker.c (attach_marker): New function.
4478 (Fset_marker, set_marker_restricted, set_marker_both)
4479 (set_marker_restricted_both): Use it.
4480 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
4481 Consistently rename charno to charpos.
4482 (marker_position): Add eassert.
4483 (marker_byte_position): Convert to eassert.
4484
4485 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4486
4487 Simplify list operations in unchain_overlay and unchain_marker.
4488 * buffer.c (unchain_overlay): Simplify. Add comment.
4489 * marker.c (unchain_marker): Simplify. Fix comments.
4490
4491 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4492
4493 Introduce fast path for the widely used marker operation.
4494 * alloc.c (build_marker): New function.
4495 * lisp.h (build_marker): New prototype.
4496 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
4497 * composite.c (autocmp_chars): Likewise.
4498 * editfns.c (buildmark): Remove.
4499 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
4500 (save_restriction_save): Use build_marker.
4501 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
4502 * window.c (save_window_save): Likewise.
4503
4504 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
4505
4506 Do not use Fdelete_overlay in delete_all_overlays
4507 to avoid redundant calls to unchain_overlay.
4508 * buffer.c (drop_overlay): New function.
4509 (delete_all_overlays, Fdelete_overlay): Use it.
4510 * minibuf.c (get_minibuffer): Fix comment.
4511
4512 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
4513
4514 Port to OpenBSD 5.1 amd64.
4515 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
4516 This is needed for OpenBSD, and should be harmless on all BSD systems.
4517 Also, include <sys/sysctl.h>, as it should be available on all
4518 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
4519 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
4520 use p_pid member, not kp_proc.pid.
4521
4522 2012-07-06 Glenn Morris <rgm@gnu.org>
4523
4524 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
4525
4526 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 More xmalloc and related cleanup.
4529 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
4530 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
4531 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
4532 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
4533 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
4534 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
4535 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
4536 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
4537 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
4538 * xterm.c:
4539 Omit needless casts involving void * pointers and allocation.
4540 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
4541 as the former is more robust if P's type is changed.
4542 Prefer xzalloc to xmalloc + memset 0.
4543 Simplify malloc-or-realloc to realloc.
4544 Don't worry about xmalloc returning a null pointer.
4545 Prefer xstrdup to xmalloc + strcpy.
4546 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
4547 growing it.
4548 * keyboard.c (apply_modifiers_uncached): Prefer local array to
4549 alloca of a constant.
4550
4551 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4552
4553 * xdisp.c (display_line): Fix horizontal pixel coordinates when
4554 hscroll is larger than the line width. Fixes long and futile
4555 looping inside extend_face_to_end_of_line (on a TTY) producing
4556 glyphs that are not needed and thrown away.
4557
4558 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4559
4560 * marker.c (set_marker_restricted_both): Simplify by using
4561 clip_to_bounds.
4562
4563 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4564
4565 * editfns.c (region_limit): Simplify by using clip_to_bounds.
4566
4567 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
4568
4569 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
4570 not defined (Bug#11768).
4571 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
4572 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
4573 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
4574 followed by gtk_box_set_homogeneous (Bug#11768).
4575 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
4576 (update_theme_scrollbar_width, xg_create_scroll_bar):
4577 Use gtk_scrollbar_new (Bug#11768).
4578 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
4579 (is_box_type): New function (Bug#11768).
4580 (xg_tool_item_stale_p): Call is_box_type.
4581 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
4582 with default display (Bug#11768).
4583
4584 2012-07-05 Eli Zaretskii <eliz@gnu.org>
4585
4586 * xdisp.c (window_hscroll_limited): New function.
4587 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
4588 coordinates when window's hscroll is set to insanely large
4589 values. (Bug#11857)
4590
4591 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
4592
4593 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
4594 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
4595
4596 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
4597
4598 Cleanup xmalloc.
4599 * lisp.h (xzalloc): New prototype. Omit needless casts.
4600 * alloc.c (xzalloc): New function. Omit needless casts.
4601 * charset.c: Omit needless casts. Convert all calls to
4602 xmalloc with following memset to xzalloc.
4603 * dispnew.c: Likewise.
4604 * fringe.c: Likewise.
4605 * image.c: Likewise.
4606 * sound.c: Likewise.
4607 * term.c: Likewise.
4608 * w32fns.c: Likewise.
4609 * w32font.c: Likewise.
4610 * w32term.c: Likewise.
4611 * xfaces.c: Likewise.
4612 * xfns.c: Likewise.
4613 * xterm.c: Likewise.
4614 * atimer.c: Omit needless casts.
4615 * buffer.c: Likewise.
4616 * callproc.c: Likewise.
4617 * ccl.c: Likewise.
4618 * coding.c: Likewise.
4619 * composite.c: Likewise.
4620 * doc.c: Likewise.
4621 * doprnt.c: Likewise.
4622 * editfns.c: Likewise.
4623 * emacs.c: Likewise.
4624 * eval.c: Likewise.
4625 * filelock.c: Likewise.
4626 * fns.c: Likewise.
4627 * gtkutil.c: Likewise.
4628 * keyboard.c: Likewise.
4629 * lisp.h: Likewise.
4630 * lread.c: Likewise.
4631 * minibuf.c: Likewise.
4632 * msdos.c: Likewise.
4633 * print.c: Likewise.
4634 * process.c: Likewise.
4635 * region-cache.c: Likewise.
4636 * search.c: Likewise.
4637 * sysdep.c: Likewise.
4638 * termcap.c: Likewise.
4639 * terminal.c: Likewise.
4640 * tparam.c: Likewise.
4641 * w16select.c: Likewise.
4642 * w32.c: Likewise.
4643 * w32reg.c: Likewise.
4644 * w32select.c: Likewise.
4645 * w32uniscribe.c: Likewise.
4646 * widget.c: Likewise.
4647 * xdisp.c: Likewise.
4648 * xmenu.c: Likewise.
4649 * xrdb.c: Likewise.
4650 * xselect.c: Likewise.
4651
4652 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
4653
4654 * fileio.c (time_error_value): Check the right error number.
4655 Problem reported by Troels Nielsen in
4656 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
4657
4658 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4659
4660 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
4661 This should be fixed in a better way; see Eli Zaretskii in
4662 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
4663 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
4664
4665 * fileio.c (time_error_value): Rename from special_mtime.
4666 The old name's problems were noted by Eli Zaretskii in
4667 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
4668
4669 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
4670 This variable's comment says Emacs needs at least one GDB-visible
4671 symbol of type enum pvec_type, to work around GDB problems.
4672 The symbol's value doesn't matter.
4673
4674 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
4675 that causes compilation to fail on pre-C99 compilers.
4676
4677 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
4678
4679 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
4680 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
4681
4682 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4683
4684 * buffer.c (init_buffer_once): Fix initialization of
4685 headers for buffer_defaults and buffer_local_symbols.
4686 Reported by Juanma Barranquero <lekktu@gmail.com>.
4687
4688 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
4689
4690 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
4691 * lisp.h (enum pvec_type): Use fewer bits.
4692 (PSEUDOVECTOR_SIZE_BITS): New constant.
4693 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
4694 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
4695 change in pvec_type.
4696 (PSEUDOVECTOR_TYPEP): New macro.
4697 (TYPED_PSEUDOVECTORP): Use it.
4698 * fns.c (internal_equal): Adapt code to extract pvectype.
4699 * emacs.c (gdb_pvec_type): Update type.
4700 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
4701 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
4702 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
4703 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
4704 (sweep_vectors): Use it. Use local var `total_bytes' instead of
4705 abusing vector->header.next.nbytes.
4706 (live_vector_p): Use PVEC_TYPE.
4707 (mark_object): Adapt code to extract pvectype. Use switch.
4708
4709 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4710
4711 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
4712 Tighten new eassert a bit.
4713
4714 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4715
4716 Fix compilation with --enable-gcc-warnings and -O1
4717 optimization level.
4718 * doprnt.c (doprnt): Change type of tem to int, initialize
4719 to avoid compiler warning. Add eassert.
4720 * search.c (simple_search): Initialize match_byte to avoid
4721 compiler warning. Add eassert.
4722
4723 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4724
4725 Avoid weird behavior with large horizontal scrolls.
4726 Without this change, for example, large hscroll values would
4727 mess up Emacs's display on Fedora 15 x86, presumably due to
4728 overflows in int calculations in the display code.
4729 Also, if buffers had long lines, Emacs would freeze.
4730 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
4731 (set_window_hscroll): New function, containing the old guts of
4732 Fset_window_hscroll. Return the clipped value.
4733 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
4734 This avoids the need to check against PTRDIFF_MAX.
4735
4736 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
4737
4738 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
4739
4740 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
4741
4742 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
4743
4744 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
4745 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
4746 since GCC 4.4.6 issues a bogus warning for them.
4747
4748 Fix bugs in file timestamp newness comparisons.
4749 * fileio.c (Ffile_newer_than_file_p):
4750 * lread.c (Fload): Use full timestamp resolution of files,
4751 not just the 1-second resolution, so that files that are only
4752 slightly newer still count as newer.
4753 * fileio.c (Ffile_newer_than_file_p): Don't assume file
4754 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
4755
4756 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
4757
4758 * fileio.c: Improve handling of file time marker. (Bug#11852)
4759 (special_mtime): New function.
4760 (Finsert_file_contents, Fverify_visited_file_modtime):
4761 Use it to set special mtime values consistently.
4762
4763 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
4764
4765 * fileio.c (Finsert_file_contents): Properly handle st_mtime
4766 marker for non-existing file. (Bug#11852)
4767
4768 2012-07-03 Glenn Morris <rgm@gnu.org>
4769
4770 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
4771 and did not make it into globals.h).
4772
4773 2012-07-03 Tom Tromey <tromey@redhat.com>
4774
4775 * window.c (Fset_window_margins, Fset_window_fringes)
4776 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
4777 * textprop.c (Fprevious_property_change): No longer static.
4778 * syntax.c (Fsyntax_table_p): No longer static.
4779 * process.c (Fget_process, Fprocess_datagram_address): No longer
4780 static.
4781 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
4782 * keyboard.c (Fcommand_execute): No longer static.
4783 Remove EXFUN.
4784 * insdel.c (Fcombine_after_change_execute): No longer static.
4785 * image.c (Finit_image_library): No longer static.
4786 * fileio.c (Fmake_symbolic_link): No longer static.
4787 * eval.c (Ffetch_bytecode): No longer static.
4788 * editfns.c (Fuser_full_name): No longer static.
4789 * doc.c (Fdocumentation_property, Fsnarf_documentation):
4790 No longer static.
4791 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
4792 static.
4793 * dired.c (Ffile_attributes): No longer static.
4794 * composite.c (Fcomposition_get_gstring): No longer static.
4795 * callproc.c (Fgetenv_internal): No longer static.
4796
4797 * ccl.h: Remove EXFUNs.
4798 * buffer.h: Remove EXFUNs.
4799 * dispextern.h: Remove EXFUNs.
4800 * intervals.h: Remove EXFUNs.
4801 * fontset.h: Remove EXFUN.
4802 * font.h: Remove EXFUNs.
4803 * dosfns.c (system_process_attributes): Remove EXFUN.
4804 * keymap.h: Remove EXFUNs.
4805 * lisp.h: Remove EXFUNs.
4806 * w32term.h: Remove EXFUNs.
4807 * window.h: Remove EXFUNs.
4808 * xsettings.h: Remove EXFUN.
4809 * xterm.h: Remove EXFUN.
4810
4811 2012-07-03 Glenn Morris <rgm@gnu.org>
4812
4813 * lisp.h (Frandom): Make it visible to C.
4814 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
4815 buffer for invisible buffers. (Bug#1229)
4816
4817 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4818
4819 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
4820 values which aren't power of 2.
4821 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
4822 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
4823 accordingly.
4824
4825 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
4826
4827 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
4828
4829 * alloc.c (mark_object): Revert part of last patch to use `switch'.
4830
4831 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4832
4833 * alloc.c (allocate_vector_block): Remove redundant
4834 calls to mallopt if DOUG_LEA_MALLOC is defined.
4835 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
4836 avoid calls to mallopt if zero_vector is returned.
4837
4838 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4839
4840 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
4841 is enabled, avoid dereferencing NULL current_sblock if
4842 running undumped.
4843
4844 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
4845
4846 Cleanup basic buffer management.
4847 * buffer.h (struct buffer): Change layout to use generic vector
4848 marking code. Fix some comments. Change type of 'clip_changed'
4849 to bitfield. Remove unused #ifndef old.
4850 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
4851 (GET_OVERLAYS_AT): Fix indentation.
4852 (for_each_per_buffer_object_at): New macro.
4853 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
4854 (Fbuffer_local_variables): Use it.
4855 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
4856 * alloc.c (allocate_buffer): Adjust to match new layout of
4857 struct buffer. Fix comment.
4858 (mark_overlay): New function.
4859 (mark_buffer): Use it. Use mark_vectorlike to mark normal
4860 Lisp area of struct buffer.
4861 (mark_object): Use it. Adjust marking of misc objects
4862 and related comments.
4863
4864 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
4865
4866 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
4867 wrapper that is not needed because the wrapped code is a no-op (zero
4868 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
4869 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
4870
4871 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
4872
4873 * alloc.c (mark_buffer): Simplify. Remove prototype.
4874 (mark_object): Add comment. Reorganize marking of vector-like
4875 objects. Use CHECK_LIVE for all vector-like objects except buffers
4876 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
4877 Avoid redundant calls to mark_vectorlike for bool vectors.
4878
4879 2012-06-30 Glenn Morris <rgm@gnu.org>
4880
4881 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
4882
4883 * epaths.in (PATH_SITELOADSEARCH): New.
4884 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
4885 This is rather than relying on --enable-locallisppath elements
4886 having "site-lisp" in their names. (Bug#10208#25, 11658)
4887
4888 2012-06-30 Eli Zaretskii <eliz@gnu.org>
4889
4890 * w32proc.c (sys_select): Accept and ignore one more argument.
4891
4892 * w32.c (emacs_gnutls_pull): Call select with one more argument.
4893
4894 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4895 (pselect) [!MS_DOS]: Redirect to sys_select.
4896
4897 * sysdep.c: Don't include dos.h and dosfns.h.
4898
4899 * process.c (sys_select):
4900 * msdos.c (sys_select): Accept one more argument and ignore it.
4901
4902 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
4903 adapt data types and code to that.
4904
4905 * dosfns.c:
4906 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
4907 which clashes with the gnulib function of the same name.
4908
4909 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
4910
4911 * font.c (font_style_to_value, font_style_symbolic)
4912 (font_prop_validate_style): Add type checks for values in
4913 font_style_table.
4914
4915 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
4916 argument.
4917 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
4918 uses.
4919
4920 2012-06-29 Eli Zaretskii <eliz@gnu.org>
4921
4922 * xdisp.c (try_window_id): Undo last change.
4923
4924 * w32.c (getwd): Adjust commentary about startup_dir.
4925 (init_environment): Always call sys_access, even in non-MSVC
4926 builds. Don't chdir to the directory of the Emacs executable.
4927 This undoes code from 1997 which was justified by the need to
4928 "avoid conflicts when removing and renaming directories". But its
4929 downside was that every relative file name was being interpreted
4930 relative to the directory of the Emacs executable, which can never
4931 be TRT. In particular, it broke sys_access when called with
4932 relative file names.
4933 (sys_access): Map GetLastError to errno.
4934
4935 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4936
4937 * window.h (struct window): Change type of 'fringes_outside_margins'
4938 to bitfield. Fix comment. Adjust users accordingly.
4939 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
4940 Adjust comment.
4941 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
4942 to ptrdiff_t.
4943
4944 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
4945
4946 * gnutls.c (emacs_gnutls_handshake):
4947 Add QUIT to make the loop interruptible.
4948
4949 2012-06-29 Glenn Morris <rgm@gnu.org>
4950
4951 * charset.c (init_charset): Make lack of etc/charsets fatal.
4952
4953 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4954
4955 * editfns.c (region_limit): Fix type mismatch.
4956
4957 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
4958
4959 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
4960 undefined. Convert from xassert to eassert.
4961 * nsmenu.m: Convert from xassert to eassert.
4962 * nsterm.m: Likewise.
4963
4964 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
4965
4966 * editfns.c (region_limit): Clip to narrowing (bug#11770).
4967
4968 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
4969
4970 Avoid integer overflow on scroll-left and scroll-right.
4971 * window.c (HSCROLL_MAX): New macro.
4972 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
4973 overflow when requested scroll falls outside ptrdiff_t range.
4974
4975 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4976
4977 * window.h (struct window): Change type of 'hscroll',
4978 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
4979 'last_modified' and 'last_overlay_modified' to EMACS_INT.
4980 Adjust users accordingly.
4981 * xdisp.c (try_cursor_movement): Replace type check with eassert.
4982 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
4983 from EMACS_INT to ptrdiff_t.
4984 (make_window): Omit redundant initialization.
4985
4986 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
4987
4988 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
4989
4990 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
4991
4992 * window.h (struct window): Change type of 'use_time' and
4993 'sequence_number' from Lisp_Object to int.
4994 * frame.c (make_frame): Adjust users accordingly.
4995 * print.c (print_object): Likewise.
4996 * window.c (select_window, Fwindow_use_time, make_parent_window)
4997 (make_window): Likewise.
4998
4999 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5000
5001 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
5002 enabled with --enable-checking=[all,glyphs] configure option.
5003 Fix GLYPH_DEBUG usage assuming that it may be undefined,
5004 adjust comments accordingly.
5005 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
5006 undefined, adjust comments accordingly.
5007 * image.c: Likewise.
5008 * scroll.c: Likewise.
5009 * w32fns.c: Likewise.
5010 * w32term.c: Likewise.
5011 * xdisp.c: Likewise.
5012 * xfaces.c: Likewise.
5013 * xfns.c: Likewise.
5014 * xterm.c: Likewise.
5015
5016 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
5017
5018 Generalize run-time debugging checks.
5019 * dispextern.h (XASSERTS): Remove.
5020 * fontset.c (xassert): Remove.
5021 Convert from xassert to eassert.
5022 * alloc.c: Convert from xassert to eassert.
5023 * bidi.c: Likewise.
5024 * dispnew.c: Likewise.
5025 * fns.c: Likewise.
5026 * fringe.c: Likewise.
5027 * ftfont.c: Likewise.
5028 * gtkutil.c: Likewise.
5029 * image.c: Likewise.
5030 * keyboard.c: Likewise.
5031 * menu.c: Likewise.
5032 * process.c: Likewise.
5033 * scroll.c: Likewise.
5034 * sound.c: Likewise.
5035 * term.c: Likewise.
5036 * w32console.c: Likewise.
5037 * w32fns.c: Likewise.
5038 * w32term.c: Likewise.
5039 * window.c: Likewise.
5040 * xdisp.c: Likewise.
5041 * xfaces.c: Likewise.
5042 * xfns.c: Likewise.
5043 * xselect.c: Likewise.
5044 * xterm.c: Likewise.
5045
5046 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
5047
5048 * fns.c (maybe_resize_hash_table): Output message when growing the
5049 purify-hashtable.
5050
5051 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5052
5053 * alloc.c (allocate_string_data): Remove dead code.
5054 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
5055 avoid GCC warning about unused macro.
5056
5057 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5058
5059 * alloc.c (allocate_string): Omit intervals initialization.
5060 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5061 as in make_pure_string and make_pure_c_string.
5062
5063 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5064
5065 * alloc.c (allocate_string): Fix last change.
5066
5067 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
5068
5069 * alloc.c (allocate_string): Remove two redundant calls
5070 to memset, add explicit initialization where appropriate.
5071
5072 2012-06-27 Glenn Morris <rgm@gnu.org>
5073
5074 * lisp.mk (lisp): Remove paths.elc.
5075
5076 2012-06-27 Chong Yidong <cyd@gnu.org>
5077
5078 * doc.c (Fsubstitute_command_keys): Fix punctuation.
5079
5080 2012-06-26 John Wiegley <johnw@newartisans.com>
5081
5082 * unexmacosx.c (copy_data_segment): Add two section names used
5083 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5084
5085 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
5086 when building with Clang.
5087
5088 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
5089
5090 * eval.c (Fapply): Allow calling it with a single argument.
5091
5092 2012-06-26 Eli Zaretskii <eliz@gnu.org>
5093
5094 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
5095 _stricmp and _strnicmp.
5096 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
5097
5098 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5099
5100 * alloc.c (allocate_window): Zero out non-Lisp part of newly
5101 allocated window.
5102 (allocate_process): Likewise for new process.
5103 (allocate_terminal): Change to use offsetof.
5104 (allocate_frame): Likewise.
5105 * frame.c (make_frame): Omit redundant initialization.
5106 * window.c (make_parent_window): Use memset.
5107 (make_window): Omit redundant initialization.
5108 * process.c (make_process): Omit redundant initialization.
5109 * terminal.c (create_terminal): Likewise.
5110
5111 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5112
5113 * term.c (delete_tty): Remove redundant call to memset.
5114
5115 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
5116
5117 * alloc.c: Remove build_string.
5118 * lisp.h: Define build_string as static inline. This provides
5119 a better opportunity to optimize away calls to strlen when the
5120 function is called with compile-time constant argument.
5121 * image.c (imagemagick_error): Convert to build_string.
5122 * w32proc.c (sys_spawnve): Likewise.
5123 * xterm.c (x_term_init): Likewise.
5124
5125 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
5126
5127 Use sprintf return value instead of invoking strlen on result.
5128 In the old days this wasn't portable, since some sprintf
5129 implementations returned char *. But they died out years ago and
5130 Emacs already assumes sprintf returns int.
5131 Similarly for float_to_string.
5132 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
5133 * ccl.c (ccl_driver):
5134 * character.c (string_escape_byte8):
5135 * data.c (Fnumber_to_string):
5136 * doprnt.c (doprnt):
5137 * print.c (print_object):
5138 * xdisp.c (message_dolog):
5139 * xfns.c (syms_of_xfns):
5140 Use sprintf or float_to_string result to avoid need to call strlen.
5141 * data.c (Fnumber_to_string):
5142 Use make_unibyte_string, since the string must be ASCII.
5143 * lisp.h, print.c (float_to_string): Now returns int length.
5144 * term.c (produce_glyphless_glyph):
5145 Use sprintf result rather than recomputing it.
5146
5147 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
5148 * Makefile.in (ALL_CFLAGS):
5149 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
5150 * gmalloc.c, regex.c: Include <config.h> unconditionally.
5151
5152 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5153
5154 * dispextern.h (xstrcasecmp): Define to library function
5155 strcasecmp if available.
5156 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
5157
5158 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
5159
5160 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
5161 Avoid comma operator.
5162 * menu.c (push_submenu_start, push_submenu_end)
5163 (push_left_right_boundary, push_menu_pane): Likewise.
5164 * msdos.c (dos_rawgetc): Likewise.
5165
5166 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5167
5168 * xfns.c (xic_create_fontsetname): Remove redundant calls
5169 to memset.
5170
5171 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
5172
5173 * gtkutil.c (get_utf8_string): Remove redundant assignment.
5174 sprintf already null-terminates its output.
5175
5176 * xfns.c (x_window): Remove redundant cast.
5177
5178 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
5179
5180 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
5181 `const char *' to `char *' to avoid compiler warning.
5182
5183 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5184
5185 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
5186 instead of truncating it to 63 (admittedly a generous limit).
5187
5188 * process.c: Fix spelling and caps in comments.
5189
5190 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
5191
5192 * emacs.c (setpgrp): Remove definition, unused.
5193 * sysdep.c (setpgrp): Remove definition, not used in this file.
5194
5195 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
5196
5197 * makefile.w32-in: Update dependencies.
5198
5199 2012-06-24 Eli Zaretskii <eliz@gnu.org>
5200
5201 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
5202 (SYSTIME_H): Add nt/inc/sys/time.h.
5203
5204 * systime.h [WINDOWSNT]: Include sys/time.h.
5205
5206 * s/ms-w32.h (struct timespec): Definition moved from
5207 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
5208
5209 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5210
5211 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
5212 * buffer.h (buffer_slot_type_mismatch):
5213 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5214 * eval.c (unwind_to_catch):
5215 * image.c (my_png_error, my_error_exit):
5216 * keyboard.c (quit_throw_to_read_char, user_error)
5217 (Fexit_recursive_edit, Fabort_recursive_edit):
5218 * lisp.h (die, args_out_of_range, args_out_of_range_3)
5219 (wrong_type_argument, buffer_overflow, __executable_start)
5220 (memory_full, buffer_memory_full, string_overflow, Fthrow)
5221 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
5222 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
5223 (fatal):
5224 (child_setup) [!DOS_NT]:
5225 * lread.c (end_of_file_error, invalid_syntax):
5226 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
5227 * puresize.h (pure_write_error):
5228 * search.c (matcher_overflow):
5229 * sound.c (sound_perror, alsa_sound_perror):
5230 * sysdep.c, syssignal.h (croak):
5231 * term.c (maybe_fatal, vfatal):
5232 * textprop.c (text_read_only):
5233 * undo.c (user_error):
5234 * unexmacosx.c (unexec_error):
5235 * xterm.c (x_ins_del_lines, x_delete_glyphs):
5236 Use _Noreturn rather than NO_RETURN.
5237 No need for separate decl merely because of _Noreturn.
5238 * sound.c (sound_warning, parse_sound):
5239 Remove unnecessary forward decls.
5240
5241 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
5242
5243 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
5244 * lisp.h (WAIT_READING_MAX): New macro.
5245 * dispnew.c (Fsleep_for, sit_for):
5246 * keyboard.c (kbd_buffer_get_event):
5247 * process.c (Faccept_process_output):
5248 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
5249 This improves on the previous patch, which introduced a bug
5250 when time_t is unsigned and as wide as intmax_t.
5251 See <http://bugs.gnu.org/9000#51>.
5252
5253 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5254
5255 * dispnew.c (sit_for, Fsleep_for):
5256 * keyboard.c (kbd_buffer_get_event):
5257 * process.c (Faccept_process_output): Avoid compiler warnings when
5258 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
5259
5260 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
5261
5262 * makefile.w32-in: Update dependencies.
5263
5264 * w32.c (ltime): Add return type and declare static.
5265 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
5266
5267 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5268
5269 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
5270 Privately reported by Herbert J. Skuhra.
5271 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
5272 All uses changed.
5273 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
5274 not make_lisp_timeval, when the argument is of type EMACS_TIME.
5275
5276 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5277
5278 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
5279 last argument of make_unibyte_string.
5280
5281 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
5282 language ID in the event parameters.
5283
5284 * w32term.c (w32_read_socket): Put the new keyboard codepage into
5285 event.code, not the obscure "character set ID".
5286
5287 2012-06-23 Chong Yidong <cyd@gnu.org>
5288
5289 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
5290
5291 2012-06-23 Eli Zaretskii <eliz@gnu.org>
5292
5293 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
5294 * w32.c (fdutimens): New function.
5295
5296 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
5297
5298 * s/ms-w32.h (pselect): Redirect to sys_select.
5299
5300 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
5301
5302 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
5303 in the logic of incrementing and decrementing the value of
5304 use_relocatable_buffers.
5305
5306 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
5307
5308 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
5309 Privately reported by Herbert J. Skuhra.
5310 [__FreeBSD__]: Remove "*/" typo after "#include".
5311 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
5312 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
5313 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
5314 Don't assume EMACS_TIME and struct timeval are the same type.
5315
5316 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
5317
5318 Support higher-resolution time stamps (Bug#9000).
5319 The time stamps are only nanosecond-resolution at the C level,
5320 since that's the best that any real-world system supports now.
5321 But they are picosecond-resolution at the Lisp level, as that's
5322 easy, and leaves room for future OS improvements.
5323
5324 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
5325 (LIBES): Use it.
5326
5327 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
5328 Don't get current time unless it's needed.
5329
5330 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
5331 now provides it if it's absent.
5332 (start_atimer): Port to higher-res time stamps.
5333 Check for time stamp overflow. Don't get current time more
5334 often than is needed.
5335
5336 * buffer.h (struct buffer): Buffer modtime now has high resolution.
5337 Include systime.h, not time.h.
5338 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
5339
5340 * dired.c: Include stat-time.h.
5341 (Ffile-attributes): File times now have higher resolution.
5342
5343 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
5344 (struct image): Timestamp now has higher resolution.
5345
5346 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
5347 has at least microseconds now. All uses removed.
5348 (update_frame, update_single_window, update_window, update_frame_1)
5349 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
5350 (duration_to_sec_usec): Remove; no longer needed.
5351
5352 * editfns.c (time_overflow): Now extern.
5353 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
5354 (float-time, Fformat_time_string, Fcurrent_time_string)
5355 (Fcurrent_time_zone): Accept and generate higher-resolution
5356 time stamps.
5357 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
5358 (decode_time_components, lisp_seconds_argument): New functions.
5359 (make_time): Now static.
5360 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
5361 Report an error if the time is invalid, rather than having the caller
5362 do that.
5363
5364 * fileio.c: Include <stat-time.h>
5365 (Fcopy_file): Copy higher-resolution time stamps.
5366 Prefer to set the time stamp via a file descriptor if that works.
5367 (Fset_file_times, Finsert_file_contents, Fwrite_region)
5368 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
5369 (Fvisited_file_modtime, Fset_visited_file_modtime):
5370 Support higher-resolution time stamps.
5371
5372 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
5373
5374 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
5375
5376 * image.c (prepare_image_for_display, clear_image_cache)
5377 (lookup_image): Port to higer-resolution time stamps.
5378
5379 * keyboard.c (start_polling, bind_polling_period):
5380 Check for time stamp overflow.
5381 (read_char, kbd_buffer_get_event, timer_start_idle)
5382 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
5383 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
5384 Port to higher-resolution time stamps. Do not assume time_t is signed.
5385 (decode_timer): New function. Timers are now vectors of length 9,
5386 not 8, to accommodate the picosecond component.
5387 (timer_check_2): Use it.
5388
5389 * nsterm.m (select_timeout, timeval_subtract): Remove.
5390 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
5391 as they're a bit more accurate and handle overflow better.
5392 (ns_select): Change prototype to be compatible with pselect.
5393 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
5394 * nsterm.h (ns_select): Adjust prototype.
5395
5396 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
5397 us-resolution time stamps.
5398 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
5399
5400 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
5401
5402 * lisp.h (time_overflow): New decl.
5403 (wait_reading_process_output): First arg is now intmax_t, not int,
5404 to accommodate larger waits.
5405
5406 * process.h (struct Lisp_Process.read_output_delay):
5407 Now counts nanoseconds, not microseconds.
5408 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
5409 EMACS_HAS_USECS.
5410 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
5411 (wait_reading_process_output):
5412 Port to ns-resolution time stamps.
5413 (Faccept_process_output, wait_reading_process_output):
5414 Check for time stamp overflow. Do not assume time_t is signed.
5415 (select_wrapper): Remove; we now use pselect.
5416 (Fprocess_attributes): Now generates ns-resolution time stamps.
5417
5418 * sysdep.c: Include utimens.h. Don't include utime.h
5419 or worry about struct utimbuf; gnulib does that for us now.
5420 (gettimeofday): Remove; gnulib provides a substitute.
5421 (make_timeval): New function.
5422 (set_file_times): Now sets ns-resolution time stamps.
5423 New arg FD; all uses changed.
5424 (time_from_jiffies, ltime_from_jiffies, get_up_time)
5425 (system_process_attributes):
5426 Now returns ns-resolution time stamp. All uses changed.
5427 Check for time stamp overflow.
5428
5429 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
5430 provides a substitute now.
5431
5432 * systime.h: Include timespec.h rather than sys/time.h and time.h,
5433 since it guarantees struct timespec.
5434 (EMACS_TIME): Now struct timespec, so that we can support
5435 ns-resolution time stamps.
5436 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
5437 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
5438 (EMACS_USECS): Remove.
5439 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
5440 so multiply the arg by 1000 before storing it.
5441 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
5442 New macros.
5443 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
5444 Port to ns-resolution time stamps.
5445 (EMACS_TIME_NEG_P): Remove; replaced by....
5446 (EMACS_TIME_SIGN): New macro.
5447 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
5448 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
5449 (set_file_times, make_time, lisp_time_argument): Adjust signature.
5450 (make_timeval, make_lisp_time, decode_time_components): New decls.
5451 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
5452 that it mishandled time_t overflow. You can't compare by subtracting!
5453 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
5454 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
5455
5456 * term.c: Include <sys/time.h>.
5457 (timeval_to_Time): New function, for proper overflow wraparound.
5458 (term_mouse_position, term_mouse_click): Use it.
5459
5460 * undo.c (record_first_change): Support higher-resolution time stamps
5461 in the undo buffer.
5462 (Fprimitive_undo): Use them when restoring time stamps.
5463
5464 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
5465 (w32_get_internal_run_time):
5466 Port to higher-resolution Emacs time stamps.
5467 (ltime): Now accepts single 64-bit integer, as that's more convenient
5468 for callers.
5469
5470 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
5471
5472 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
5473 for compatibility with pselect. Support ns-resolution time stamps.
5474
5475 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
5476
5477 * xselect.c (wait_for_property_change, x_get_foreign_selection):
5478 Check for time stamp overflow, and support ns-resolution time stamps.
5479
5480 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
5481 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
5482 (timeval_subtract): Remove; no longer needed.
5483 (XTflash, XTring_bell, x_wait_for_event):
5484 Port to ns-resolution time stamps. Don't assume time_t is signed.
5485
5486 2012-06-22 Chong Yidong <cyd@gnu.org>
5487
5488 * xdisp.c (x_consider_frame_title): Revert last change.
5489
5490 2012-06-22 Eli Zaretskii <eliz@gnu.org>
5491
5492 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
5493 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
5494 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
5495 staticidx goes up to 1597 out of 1600 = 0x640.)
5496
5497 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
5498
5499 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
5500 Otherwise, the umask might be mistakenly 0 while handling input signals.
5501
5502 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
5503
5504 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
5505
5506 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
5507
5508 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
5509 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
5510 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
5511 access to `contents' member of Lisp_Vector objects with AREF and ASET
5512 where appropriate.
5513
5514 2012-06-19 Chong Yidong <cyd@gnu.org>
5515
5516 * frame.c (delete_frame): When selecting a frame on a different
5517 text terminal, do not alter the terminal's top-frame.
5518
5519 * xdisp.c (format_mode_line_unwind_data): Record the target
5520 frame's selected window and its terminal's top-frame.
5521 (unwind_format_mode_line): Restore them.
5522 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
5523 Callers changed.
5524 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
5525 since tty frames can be explicitly named.
5526 (prepare_menu_bars): Likewise.
5527
5528 * term.c (Ftty_top_frame): New function.
5529
5530 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5531
5532 Port byte-code-meter to modern targets.
5533 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
5534 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
5535 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
5536 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
5537 (METER_1, METER_2): Simplify.
5538
5539 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
5540
5541 * data.c (Fdefalias): Return `symbol' (bug#11686).
5542
5543 2012-06-18 Martin Rudalics <rudalics@gmx.at>
5544
5545 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
5546 gets killed during executing of this function (Bug#11665).
5547 Try to always return Qt when the buffer has been actually killed.
5548 (Vkill_buffer_query_functions): In doc-string say that functions
5549 run by this hook should not change the current buffer.
5550
5551 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
5552
5553 Fix recently-introduced process.c problems found by static checking.
5554 * process.c (write_queue_push, write_queue_pop, send_process):
5555 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
5556 (write_queue_pop): Fix pointer signedness problem.
5557 (send_process): Remove unused local.
5558
5559 2012-06-17 Chong Yidong <cyd@gnu.org>
5560
5561 * xdisp.c (redisplay_internal): No need to redisplay terminal
5562 frames that are not on top.
5563
5564 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
5565
5566 * process.c (make_process): Initialize write_queue.
5567 (write_queue_push, write_queue_pop): New functions.
5568 (send_process): Use them to maintain correct ordering of process
5569 writes (Bug#10815).
5570
5571 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
5572
5573 * lisp.h (eassert): Assume C89 or later.
5574 This removes the need for CHECK.
5575 (CHECK): Remove. Its comments about always evaluating its
5576 argument were confusing, as 'eassert' typically does not evaluate
5577 its argument.
5578
5579 * coding.c (produce_chars): Use ptrdiff_t, not int.
5580
5581 * xterm.c (x_draw_underwave): Check for integer overflow.
5582 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
5583
5584 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
5585
5586 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
5587 referenced (Bug#11583).
5588
5589 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
5590
5591 Implement wave-style variant of underlining.
5592 * dispextern.h (face_underline_type): New enum.
5593 (face): Add field for underline type.
5594 * nsterm.m (ns_draw_underwave): New function.
5595 (ns_draw_text_decoration): Use it.
5596 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
5597 New functions.
5598 (x_draw_glyph_string): Use them.
5599 * xfaces.c (Qline, Qwave): New Lisp objects.
5600 (check_lface_attrs, merge_face_ref)
5601 (Finternal_set_lisp_face_attribute, realize_x_face):
5602 Handle wave-style underline face attributes.
5603 * xterm.c (x_draw_underwave): New function.
5604 (x_draw_glyph_string): Use it.
5605
5606 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
5607
5608 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
5609 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
5610 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
5611 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
5612 ($(BLD)/w32select.$(O)): Update dependencies.
5613
5614 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5615
5616 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
5617 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
5618 * character.c (_fetch_multibyte_char_p): Remove.
5619 * alloc.c: Include "character.h" before "buffer.h".
5620 * bidi.c: Likewise.
5621 * buffer.c: Likewise.
5622 * bytecode.c: Likewise.
5623 * callint.c: Likewise.
5624 * callproc.c: Likewise.
5625 * casefiddle.c: Likewise.
5626 * casetab.c: Likewise.
5627 * category.c: Likewise.
5628 * cmds.c: Likewise.
5629 * coding.c: Likewise.
5630 * composite.c: Likewise.
5631 * dired.c: Likewise.
5632 * dispnew.c: Likewise.
5633 * doc.c: Likewise.
5634 * dosfns.c: Likewise.
5635 * editfns.c: Likewise.
5636 * emacs.c: Likewise.
5637 * fileio.c: Likewise.
5638 * filelock.c: Likewise.
5639 * font.c: Likewise.
5640 * fontset.c: Likewise.
5641 * fringe.c: Likewise.
5642 * indent.c: Likewise.
5643 * insdel.c: Likewise.
5644 * intervals.c: Likewise.
5645 * keyboard.c: Likewise.
5646 * keymap.c: Likewise.
5647 * lread.c: Likewise.
5648 * macros.c: Likewise.
5649 * marker.c: Likewise.
5650 * minibuf.c: Likewise.
5651 * nsfns.m: Likewise.
5652 * nsmenu.m: Likewise.
5653 * print.c: Likewise.
5654 * process.c: Likewise.
5655 * regex.c: Likewise.
5656 * region-cache.c: Likewise.
5657 * search.c: Likewise.
5658 * syntax.c: Likewise.
5659 * term.c: Likewise.
5660 * textprop.c: Likewise.
5661 * undo.c: Likewise.
5662 * unexsol.c: Likewise.
5663 * w16select.c: Likewise.
5664 * w32fns.c: Likewise.
5665 * w32menu.c: Likewise.
5666 * window.c: Likewise.
5667 * xdisp.c: Likewise.
5668 * xfns.c: Likewise.
5669 * xmenu.c: Likewise.
5670 * xml.c: Likewise.
5671 * xselect.c: Likewise.
5672
5673 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5674
5675 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
5676 If all the glyphs of the glyph row came from strings, and we have no
5677 cursor positioning clues, put the cursor on the first glyph of the
5678 row.
5679 (handle_face_prop): Use chunk-relative overlay string index when
5680 indexing into it->string_overlays array. (Bug#11653)
5681 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
5682 the rightmost. (Bug#11720)
5683
5684 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
5685
5686 * category.h (CHAR_HAS_CATEGORY): Define as inline.
5687 (CATEGORY_MEMBER): Enforce 1/0 value.
5688 * category.c (_temp_category_set): Remove.
5689
5690 2012-06-16 Eli Zaretskii <eliz@gnu.org>
5691
5692 * window.c (Fdelete_other_windows_internal)
5693 (Fdelete_window_internal): Don't access frame's mouse highlight
5694 info of the initial frame. (Bug#11677)
5695
5696 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
5697
5698 * .gdbinit (xgetint): Fix recently-introduced paren typo.
5699 Assume USE_2_TAGS_FOR_INTS.
5700 (xreload): Adjust $tagmask width to match recent lisp.h change.
5701
5702 Simplify lisp.h in minor ways that should not affect code.
5703 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
5704 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
5705 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
5706 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
5707 (INTTYPEBITS): New macro, for clarity.
5708 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
5709 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
5710 Simplify now that USE_LSB_TAG is always defined.
5711 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
5712 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
5713
5714 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
5715
5716 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
5717
5718 2012-06-13 Glenn Morris <rgm@gnu.org>
5719
5720 * s/bsd-common.h (BSD4_3):
5721 * s/usg5-4-common.h (USG5_4): No longer define; unused.
5722
5723 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
5724
5725 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
5726 instead of union.
5727 (XLI, XIL): Define.
5728 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
5729 Use them.
5730 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
5731 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
5732 * alloc.c (widen_to_Lisp_Object): Remove.
5733 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
5734 * frame.c (delete_frame): Remove outdated comment.
5735 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
5736 USE_LISP_UNION_TYPE.
5737 (Fw32_unregister_hot_key): Likewise.
5738 (Fw32_toggle_lock_key): Likewise.
5739 * w32menu.c (add_menu_item): Likewise.
5740 (w32_menu_display_help): Use XIL instead of checking
5741 USE_LISP_UNION_TYPE.
5742 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
5743 (init_heap): Likewise.
5744 * w32term.c (w32_read_socket): Update comment.
5745
5746 2012-06-13 Glenn Morris <rgm@gnu.org>
5747
5748 * s/usg5-4-common.h, src/s/unixware.h:
5749 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
5750
5751 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
5752
5753 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
5754
5755 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
5756 * alloc.c (make_number) [!defined make_number]:
5757 Remove, as lisp.h always defines this now.
5758 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
5759 (roundup_size): Verify that it is a power of 2.
5760 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
5761 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
5762 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
5763 -DUSE_LSB_TAG=0, to override the automatically-selected default.
5764 USE_LSB_TAG now is always defined to be either 0 or 1.
5765 All uses changed.
5766 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
5767 code works fine either way, and efficiency is not a concern here,
5768 as the union type is for debugging, not for production.
5769 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
5770 Use an inline function on all platforms when using the union type,
5771 since this is simpler and 'static inline' can be used portably
5772 within Emacs now.
5773 (LISP_INITIALLY_ZERO): New macro.
5774 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
5775 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
5776
5777 2012-06-12 Glenn Morris <rgm@gnu.org>
5778
5779 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
5780
5781 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
5782
5783 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
5784 Move BROKEN_SIGIO to configure.
5785
5786 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
5787 Move NO_TERMIO to configure.
5788
5789 2012-06-12 Chong Yidong <cyd@gnu.org>
5790
5791 * image.c (imagemagick_load_image): Use MagickFlattenImage if
5792 MagickMergeImageLayers is undefined. Use pixel pusher loop if
5793 MagickExportImagePixels is undefined.
5794
5795 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
5796
5797 * image.c (imagemagick_load_image): Remove unused label.
5798
5799 2012-06-11 Glenn Morris <rgm@gnu.org>
5800
5801 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5802 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
5803 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
5804 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
5805
5806 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
5807
5808 * alloc.c (make_byte_code): New function.
5809 (Fmake_byte_code): Use it. Don't purify here.
5810 * lread.c (read1): Use it as well to avoid extra allocation.
5811
5812 2012-06-11 Chong Yidong <cyd@gnu.org>
5813
5814 * image.c (imagemagick_load_image): Implement transparency.
5815
5816 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
5817
5818 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
5819 account for preceding backslashes. (Bug#11663)
5820
5821 2012-06-09 Chong Yidong <cyd@gnu.org>
5822
5823 * term.c: Support italics in capable terminals (Bug#9652).
5824 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
5825 (turn_on_face): Output using TS_enter_italic_mode if available.
5826 Don't handle unused blinking and alt-charset cases.
5827 (turn_off_face): Handle italic case; discard unused tty_blinking_p
5828 and tty_alt_charset_p cases.
5829 (tty_capable_p, init_tty): Support italics.
5830
5831 * termchar.h (struct tty_display_info): Add field for italics.
5832 Remove unused blink field.
5833
5834 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
5835 Handle slant.
5836
5837 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
5838 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
5839 tty_alt_charset_p. Add tty_italic_p.
5840
5841 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
5842
5843 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
5844 dbus_type_is_basic if available.
5845 (xd_extract_signed, xd_extract_unsigned): Rename from
5846 extract_signed and extract_unsigned, respectively. Adapt callers.
5847
5848 2012-06-09 Chong Yidong <cyd@gnu.org>
5849
5850 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
5851
5852 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
5853 case (Bug#9752).
5854
5855 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
5856
5857 * xdisp.c (vmessage): Treat frame message as multibyte.
5858 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
5859 would generate the diagnostic "Making \302\247 buffer-local while
5860 let-bound!".
5861
5862 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5863
5864 * dispnew.c (showing_window_margins_p): Undo last change, which
5865 was done due to an inadvertent commit.
5866 (adjust_frame_glyphs_for_frame_redisplay): Do call
5867 showing_window_margins_p.
5868
5869 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5870
5871 * eval.c (Fmake_var_non_special): New primitive.
5872 (syms_of_eval): Defsubr it.
5873 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
5874
5875 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
5876
5877 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
5878 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
5879
5880 2012-06-08 Eli Zaretskii <eliz@gnu.org>
5881
5882 * alloc.c (allocate_vectorlike): Fix last change.
5883
5884 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
5885
5886 Block-based vector allocation of small vectors.
5887 * lisp.h (struct vectorlike_header): New field `nbytes',
5888 adjust comment accordingly.
5889 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
5890 to denote vector blocks. Adjust users (live_vector_p,
5891 mark_maybe_pointer, valid_lisp_object_p) accordingly.
5892 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
5893 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
5894 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
5895 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
5896 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
5897 (roundup_size): New constant.
5898 (struct vector_block): New data type.
5899 (vector_blocks, vector_free_lists, zero_vector): New variables.
5900 (all_vectors): Rename to `large_vectors'.
5901 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
5902 (sweep_vectors): New functions.
5903 (allocate_vectorlike): Return `zero_vector' as the only vector of
5904 0 items. Allocate new vector from block if vector size is less than
5905 or equal to VBLOCK_BYTES_MAX.
5906 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
5907 (init_alloc_once): Add call to init_vectors.
5908
5909 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
5910
5911 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
5912
5913 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 * doprnt.c (doprnt): Truncate multibyte char correctly.
5916 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
5917 would mishandle a string argument "Xc" if X was a multibyte
5918 character of length 2: it would truncate after X's first byte
5919 rather than including all of X.
5920
5921 2012-06-06 Chong Yidong <cyd@gnu.org>
5922
5923 * buffer.c (word_wrap): Doc fix.
5924
5925 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
5926
5927 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
5928
5929 2012-06-03 Glenn Morris <rgm@gnu.org>
5930
5931 * xdisp.c (tool-bar-style): Doc fix.
5932
5933 2012-06-03 Ulrich Müller <ulm@gentoo.org>
5934
5935 * Makefile.in (PAXCTL): Define.
5936 (temacs$(EXEEXT)): Disable memory randomization for the temacs
5937 binary via PaX flags if the paxctl utility is available.
5938 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
5939 Restore PaX flags to their default. (Bug#11398)
5940
5941 2012-06-03 Chong Yidong <cyd@gnu.org>
5942
5943 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
5944 buffer (Bug#11226).
5945
5946 2012-06-03 Chong Yidong <cyd@gnu.org>
5947
5948 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
5949 (note_mode_line_or_margin_highlight): If there is no help echo,
5950 use mode-line-default-help-echo. Handle the case where the mouse
5951 position is past the end of the mode line string.
5952
5953 * buffer.c (buffer_local_value_1): New function, split from
5954 Fbuffer_local_value; can return Qunbound.
5955 (Fbuffer_local_value): Use it.
5956 (Vmode_line_format): Docstring tweaks.
5957
5958 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5959
5960 * sysdep.c (system_process_attributes): Improve comment.
5961
5962 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
5963
5964 * keyboard.c: Export real-this-command to Elisp.
5965 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
5966 and DEFVAR it. Update all users.
5967
5968 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
5969
5970 * minibuf.c (Fassoc_string): Remove duplicate declaration.
5971
5972 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
5973 Convert pctcpu and pctmem to Lisp float properly.
5974 Let the compiler fold better, as 100.0/0x8000 is exact.
5975
5976 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
5977
5978 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
5979 cons_block.
5980
5981 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
5984
5985 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
5986
5987 For a 'struct window', replace some Lisp_Object fields to
5988 bitfields where appropriate, remove unused fields.
5989 * window.h (struct window): Remove unused 'last_mark_x' and
5990 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
5991 change it's type from Lisp_Object to bitfield.
5992 Change type of 'force_start', 'optional_new_start',
5993 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
5994 fields from Lisp_Object to bitfield. Adjust users accordingly.
5995
5996 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
5997
5998 Pacify gcc -Wdouble-precision when using Xaw.
5999 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
6000 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
6001 Use 'float' consistently, rather than 'float' in most places
6002 and 'double' in a couple of places.
6003
6004 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6005
6006 * xdisp.c (handle_stop): Detect whether we have overlay strings
6007 loaded by testing it->current.overlay_string_index to be
6008 non-negative, instead of checking whether n_overlay_strings is
6009 positive. (Bug#11587)
6010
6011 2012-05-31 Chong Yidong <cyd@gnu.org>
6012
6013 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
6014
6015 * doc.c (Fsubstitute_command_keys): Doc fix.
6016
6017 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6018
6019 * search.c (search_buffer): Remove calls to
6020 r_alloc_inhibit_buffer_relocation, as it is now called by
6021 maybe_unify_char, which was the cause of relocation of buffer text
6022 in bug#11519.
6023
6024 2012-05-31 Eli Zaretskii <eliz@gnu.org>
6025
6026 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
6027 for the duration of call to load_charset, to avoid problems with
6028 callers of maybe_unify_char that access buffer text through C
6029 pointers.
6030
6031 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
6032 decrement the inhibition flag, instead of just setting or
6033 resetting it.
6034
6035 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
6036
6037 Remove obsolete '#define static' cruft.
6038 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
6039 This #undef was "temporary" in 2000; it is no longer needed
6040 now that '#define static' has gone away.
6041 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
6042 (gray_bitmap_bits): Remove; no longer needed.
6043 All uses replaced with definiens.
6044 * xterm.c: Include "bitmaps/gray.xbm".
6045
6046 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6047
6048 Clean up __executable_start, monstartup when --enable-profiling.
6049 The following changes affect the code only when profiling.
6050 * dispnew.c (__executable_start): Rename from safe_bcopy.
6051 Define only on platforms that need it.
6052 * emacs.c: Include <sys/gmon.h> when profiling.
6053 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
6054 (__executable_start): Remove decl, since lisp.h does it now.
6055 (safe_bcopy): Remove decl; no longer has that name.
6056 (main): Coalesce #if into single bit of code, for simplicity.
6057 Cast pointers to uintptr_t, since standard libraries want integers
6058 and not pointers.
6059 * lisp.h (__executable_start): New decl.
6060
6061 2012-05-31 Glenn Morris <rgm@gnu.org>
6062
6063 * image.c (Fimagemagick_types): Doc fix.
6064
6065 2012-05-30 Jim Meyering <meyering@redhat.com>
6066
6067 * callproc.c (Fcall_process_region): Include directory component
6068 in mkstemp error message (Bug#11586).
6069
6070 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
6071
6072 * alloc.c, lisp.h (make_pure_vector): Now static.
6073
6074 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
6075
6076 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
6077 Move to byte-run.el.
6078 (Fautoload): Do the hash-doc more carefully.
6079 * data.c (Fdefalias): Purify definition, except for keymaps.
6080 (Qdefun): Move from eval.c.
6081 * lisp.h (Qdefun): Remove.
6082 * lread.c (read1): Tiny simplification.
6083
6084 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
6085
6086 Do not create empty overlays with the evaporate property (Bug#9642).
6087 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
6088 Bug#9642, but explicitly check that the buffer the overlay would
6089 be moved to is live and rearrange lines to make sure that errors
6090 will not put the overlay in an inconsistent state.
6091 (Fdelete_overlay): Cosmetics.
6092
6093 2012-05-28 Eli Zaretskii <eliz@gnu.org>
6094
6095 * w32term.c (my_bring_window_to_top): New function.
6096 (x_raise_frame): Use handle returned by DeferWindowPos, which
6097 could be different from the original one.
6098 Call my_bring_window_to_top instead of my_set_foreground_window.
6099 (Bug#11513)
6100
6101 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
6102 by calling BringWindowToTop.
6103
6104 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
6105 (WM_EMACS_END): Increase by one.
6106
6107 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
6108
6109 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
6110 This avoids undefined behavior that might cause the eassert
6111 to not catch an out-of-range value.
6112
6113 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
6114
6115 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
6116 Update dependencies.
6117
6118 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6119
6120 * bidi.c (bidi_mirror_char): Fix last change.
6121
6122 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
6123
6124 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
6125 when referring to sectname field in printf format.
6126
6127 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
6128
6129 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
6130 Only r_alloc_inhibit_buffer_relocation needed to be added;
6131 the others were already declared.
6132
6133 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
6134 before checking whether it's out of range. Put the check inside
6135 eassert. See
6136 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
6137
6138 2012-05-27 Ken Brown <kbrown@cornell.edu>
6139
6140 * callproc.c (Fcall_process): Restore a line that was accidentally
6141 commented out in the 2011-02-13 change (bug#11547).
6142
6143 2012-05-27 Eli Zaretskii <eliz@gnu.org>
6144
6145 * lisp.h [REL_ALLOC]: Add prototypes for external functions
6146 defined on ralloc.c.
6147
6148 * buffer.c [REL_ALLOC]: Remove prototypes of
6149 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
6150 they are now on lisp.h.
6151
6152 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
6153
6154 * search.c (search_buffer): Use it to inhibit relocation of buffer
6155 text while re_search_2 is doing its job, because re_search_2 is
6156 passed C pointers to buffer text. (Bug#11519)
6157
6158 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
6159 Update value to 24.
6160
6161 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
6162 state after an additional call to move_it_in_display_line_to, keep
6163 the values of it->max_ascent and it->max_descent found for the
6164 entire line.
6165 (pos_visible_p): Revert the comparison against bottom_y to what it
6166 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
6167 (Bug#11464)
6168
6169 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6170
6171 Fix coding-related core dumps with gcc -ftrapv.
6172 The code was computing A - B, where A and B are pointers, and B is
6173 random garbage. This can lead to core dumps on platforms that
6174 have special pointer registers, and it also leads to core dumps on
6175 x86-64 when compiled with gcc -ftrapv. The fix is to compute
6176 A - B only when B is initialized properly.
6177 * coding.c (coding_set_source, coding_set_destination): Return void.
6178 (coding_change_source, coding_change_destinations): New functions,
6179 with the old behaviors of coding_set_source and coding_set_destination.
6180 All callers that need an offset changed to use these new functions.
6181
6182 2012-05-26 Glenn Morris <rgm@gnu.org>
6183
6184 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
6185
6186 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6187
6188 Extend mouse support on W32 text-mode console.
6189 * xdisp.c (draw_row_with_mouse_face):
6190 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
6191
6192 * w32console.c: Include window.h.
6193 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
6194 New functions.
6195 (initialize_w32_display): Initialize mouse-highlight data.
6196
6197 * w32inevt.c: Include termchar.h and window.h.
6198 (do_mouse_event): Support mouse-autoselect-window. When the mouse
6199 moves, call note_mouse_highlight. If help_echo changed, call
6200 gen_help_event to produce help-echo message in the echo area.
6201 Call clear_mouse_face if mouse_face_hidden is set in the mouse
6202 highlight info.
6203
6204 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
6205
6206 * lread.c (read1): Simplify slightly to avoid an overflow warning
6207 with GCC 4.7.0 on x86-64.
6208
6209 2012-05-26 Eli Zaretskii <eliz@gnu.org>
6210
6211 * bidi.c (bidi_mirror_char): Revert last change: an int is
6212 definitely wide enough here.
6213
6214 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
6215
6216 Fix integer width and related bugs (Bug#9874).
6217 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
6218 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
6219 (string_bytes, check_sblock, allocate_string_data):
6220 (compact_small_strings, Fmake_bool_vector, make_string)
6221 (make_unibyte_string, make_multibyte_string)
6222 (make_string_from_bytes, make_specified_string)
6223 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
6224 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
6225 (mark_vectorlike):
6226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6227 (allocate_pseudovector):
6228 Use int, not EMACS_INT, where int is wide enough.
6229 (inhibit_garbage_collection, Fgarbage_collect):
6230 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6231 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
6232 int might not be wide enough.
6233 (bidi_cache_search, bidi_cache_find, bidi_init_it)
6234 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6235 (bidi_at_paragraph_end, bidi_find_paragraph_start)
6236 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6237 (bidi_level_of_next_char, bidi_move_to_visually_next):
6238 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6239 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
6240 (Fkill_buffer, Fset_buffer_major_mode)
6241 (advance_to_char_boundary, Fbuffer_swap_text)
6242 (Fset_buffer_multibyte, overlays_at, overlays_in)
6243 (overlay_touches_p, struct sortvec, record_overlay_string)
6244 (overlay_strings, recenter_overlay_lists)
6245 (adjust_overlays_for_insert, adjust_overlays_for_delete)
6246 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
6247 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
6248 (Foverlay_recenter, last_overlay_modification_hooks_used)
6249 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
6250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6251 (validate_region): Omit unnecessary test for b <= e,
6252 since that's guaranteed by the previous test.
6253 (adjust_overlays_for_delete): Avoid pos + length overflow.
6254 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
6255 (report_overlay_modification):
6256 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6257 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
6258 Omit pointer cast, which isn't needed anyway, and doesn't work
6259 after the EMACS_INT -> ptrdiff_t change.
6260 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
6261 * buffer.h: Adjust decls to match defn changes elsewhere.
6262 (struct buffer_text, struct buffer):
6263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6264 Use EMACS_INT, not int, where int might not be wide enough.
6265 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
6266 not int, to avoid needless 32-bit limit on 64-bit hosts.
6267 (exec_byte_code): Use tighter memory-full test, one that checks
6268 for alloca overflow. Don't compute the address of the object just
6269 before an array, as that's not portable. Use EMACS_INT, not
6270 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
6271 * callint.c (Fcall_interactively):
6272 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6273 * callproc.c (call_process_kill, Fcall_process):
6274 Don't assume pid_t fits into an Emacs fixnum.
6275 (call_process_cleanup, Fcall_process, child_setup):
6276 Don't assume pid_t fits into int.
6277 (call_process_cleanup, Fcall_process, delete_temp_file)
6278 (Fcall_process_region):
6279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6280 (Fcall_process): Simplify handling of volatile integers.
6281 Use int, not EMACS_INT, where int will do.
6282 * casefiddle.c (casify_object, casify_region, operate_on_word)
6283 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
6284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6285 (casify_object): Avoid integer overflow when overallocating buffer.
6286 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
6287 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
6288 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
6289 * category.h (CATEGORYP): Don't assume arg is nonnegative.
6290 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
6291 integers are now checked earlier. All uses replaced with XINT.
6292 (ccl_driver):
6293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6294 For CCL_MapSingle, check that content and value are in int range.
6295 (ccl_driver, Fregister_code_conversion_map):
6296 Check that Vcode_version_map_vector is a vector.
6297 (resolve_symbol_ccl_program): Check that vector header is in range.
6298 Always copy the vector, so that we can check its contents reliably
6299 now rather than having to recheck each instruction as it's being
6300 executed. Check that vector words fit in 'int'.
6301 (ccl_get_compiled_code, Fregister_ccl_program)
6302 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
6303 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
6304 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
6305 contents are in range.
6306 (Fccl_execute_on_string): Check that status is in range.
6307 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
6308 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
6309 Accept and return EMACS_INT, not int, because callers can pass values
6310 out of 'int' range.
6311 (c_string_width, strwidth, lisp_string_width, chars_in_text)
6312 (multibyte_chars_in_text, parse_str_as_multibyte)
6313 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
6314 (str_as_unibyte, str_to_unibyte, string_count_byte8)
6315 (string_escape_byte8, Fget_byte):
6316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6317 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
6318 avoid mishandling large integers.
6319 * character.h: Adjust decls to match defn changes elsewhere.
6320 * charset.c (load_charset_map_from_file, find_charsets_in_text)
6321 (Ffind_charset_region):
6322 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6323 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
6324 (load_charset_map_from_vector, Fdefine_charset_internal):
6325 Don't assume fixnum fits in int.
6326 (load_charset_map_from_vector, Fmap_charset_chars):
6327 Remove now-unnecessary CHECK_NATNUMs.
6328 (Fdefine_charset_internal): Check ranges here, more carefully.
6329 Don't rely on undefined behavior with signed left shift overflow.
6330 Don't assume unsigned int fits into fixnum, or that fixnum fits
6331 into unsigned int. Don't require max_code to be a valid fixnum;
6332 that's not true for gb10830 4-byte on a 32-bit host. Allow
6333 invalid_code to be a cons, for the same reason. Require code_offset
6334 to be a character. Avoid int overflow if max_char is close
6335 to INT_MAX.
6336 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
6337 this is intended anyway and avoids some undefined behavior.
6338 (load_charset_map): Pass unsigned, not int, as 2nd arg of
6339 INDEX_TO_CODE_POINT, as that's what it expects.
6340 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
6341 * charset.h (DECODE_CHAR): Return int, not unsigned;
6342 this is what was intended anyway, and it avoids undefined behavior.
6343 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
6344 integer-overflow issues.
6345 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
6346 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
6347 where the argument is EMACS_INT, and this behavior is not intended.
6348 * chartab.c (Fmake_char_table, Fset_char_table_range)
6349 (uniprop_get_decoder, uniprop_get_encoder):
6350 Don't assume fixnum fits in int.
6351 * cmds.c (move_point): New function, that does the gist of
6352 Fforward_char and Fbackward_char, but does so while checking
6353 for integer overflow more accurately.
6354 (Fforward_char, Fbackward_char): Use it.
6355 (Fforward_line, Fend_of_line, internal_self_insert)
6356 (internal_self_insert):
6357 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6358 Fix a FIXME, by checking for integer overflow when calculating
6359 target_clm and actual_clm.
6360 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
6361 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
6362 (ASSURE_DESTINATION, coding_alloc_by_realloc)
6363 (coding_alloc_by_making_gap, alloc_destination)
6364 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
6365 (encode_coding_utf_16, detect_coding_emacs_mule)
6366 (decode_coding_emacs_mule, encode_coding_emacs_mule)
6367 (detect_coding_iso_2022, decode_coding_iso_2022)
6368 (encode_invocation_designation, encode_designation_at_bol)
6369 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
6370 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
6371 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
6372 (encode_coding_ccl, encode_coding_raw_text)
6373 (detect_coding_charset, decode_coding_charset)
6374 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
6375 (produce_composition, produce_charset, produce_annotation)
6376 (decode_coding, handle_composition_annotation)
6377 (handle_charset_annotation, consume_chars, decode_coding_gap)
6378 (decode_coding_object, encode_coding_object, detect_coding_system)
6379 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
6380 (code_convert_region, code_convert_string)
6381 (Fdefine_coding_system_internal)
6382 (coding_set_source, coding_set_destination):
6383 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6384 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
6385 (Fdefine_coding_system_internal):
6386 Don't assume fixnums fit in int.
6387 (decode_coding_gap, decode_coding_object, encode_coding_object)
6388 (Fread_coding_system, Fdetect_coding_region)
6389 (Funencodable_char_position, Fcheck_coding_systems_region)
6390 (get_translation, handle_composition_annotation, consume_chars):
6391 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6392 (consume_chars): Rewrite to not calculate an address outside buffer.
6393 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
6394 Don't access memory outside of the args array.
6395 (Fdefine_coding_system_internal): Check for charset-id overflow.
6396 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
6397 result of ENCODE_CHAR.
6398 * coding.h: Adjust decls to match defn changes elsewhere.
6399 (struct coding_system):
6400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6401 * composite.c (get_composition_id, find_composition)
6402 (run_composition_function, update_compositions)
6403 (compose_text, composition_gstring_put_cache)
6404 (composition_gstring_p, composition_gstring_width)
6405 (fill_gstring_header, fill_gstring_body, autocmp_chars)
6406 (composition_compute_stop_pos, composition_reseat_it)
6407 (composition_update_it, struct position_record)
6408 (find_automatic_composition, composition_adjust_point)
6409 (Fcomposition_get_gstring, Ffind_composition_internal):
6410 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6411 (update_compositions):
6412 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6413 * composite.h: Adjust decls to match defn changes elsewhere.
6414 (struct composition):
6415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6416 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
6417 Do not attempt to compute the address of the object just before a
6418 buffer; this is not portable.
6419 (Faref, Faset):
6420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6421 (Faset): Use int, not EMACS_INT, where int is wide enough.
6422 (Fstring_to_number): Don't assume fixnums fit in int.
6423 (Frem): Don't assume arg is nonnegative.
6424 * dbusbind.c (xd_append_arg): Check for integers out of range.
6425 (Fdbus_call_method): Don't overflow the timeout int.
6426 (extract_signed, extract_unsigned): New functions.
6427 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
6428 (xd_get_connection_references): Return ptrdiff_t, not int.
6429 All uses changed.
6430 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
6431 (xd_read_message_1):
6432 Use int, not unsigned, where the dbus API uses int.
6433 (Fdbus_message_internal): Don't overflow mtype.
6434 (syms_of_dbusbind): Allocate right-sized buffer for integers.
6435 * dired.c (directory_files_internal, file_name_completion, scmp)
6436 (file_name_completion_stat):
6437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6438 (file_name_completion): Don't overflow matchcount.
6439 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
6440 * dispextern.h: Adjust decls to match defn changes elsewhere.
6441 (struct text_pos, struct glyph, struct bidi_saved_info)
6442 (struct bidi_string_data, struct bidi_it, struct composition_it)
6443 (struct it):
6444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6445 (struct display_pos, struct composition_it, struct it):
6446 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6447 * dispnew.c (increment_matrix_positions)
6448 (increment_row_positions, mode_line_string)
6449 (marginal_area_string):
6450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6451 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
6452 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6453 (duration_to_sec_usec): New function, to check for overflow better.
6454 (Fsleep_for, sit_for): Use it.
6455 * doc.c (get_doc_string, store_function_docstring):
6456 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6457 (get_doc_string, Fsnarf_documentation):
6458 Use int, not EMACS_INT, where int is wide enough.
6459 (get_doc_string):
6460 Use SAFE_ALLOCA, not alloca.
6461 Check for overflow when converting EMACS_INT to off_t.
6462 * doprnt.c (doprnt):
6463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6464 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
6465 Don't assume uid_t fits into fixnum.
6466 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
6467 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
6468 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
6469 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
6470 (general_insert_function)
6471 (Finsert_char, make_buffer_string, make_buffer_string_both)
6472 (update_buffer_properties, Fbuffer_substring)
6473 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
6474 (Fsubst_char_in_region, check_translation)
6475 (Ftranslate_region_internal, save_restriction_restore, Fformat)
6476 (transpose_markers, Ftranspose_regions):
6477 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6478 (clip_to_bounds): Move to lisp.h as an inline function).
6479 (Fconstrain_to_field): Don't assume integers are nonnegative.
6480 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
6481 (Fsubst_char_in_region, Fsave_restriction):
6482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6483 (Femacs_pid): Don't assume pid_t fits into fixnum.
6484 (lo_time): Use int, not EMACS_INT, when int suffices.
6485 (lisp_time_argument): Check for usec out of range.
6486 (Fencode_time): Don't assume fixnum fits in int.
6487 (Fuser_login_name, Fuser_full_name): Signal an error
6488 if a uid argument is out of range, rather than relying on
6489 undefined behavior.
6490 (Fformat_time_string): Remove now-unnecessary check.
6491 lisp_time_argument checks for out-of-range usec now.
6492 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
6493 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
6494 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
6495 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
6496 (init_cmdargs, Fdump_emacs):
6497 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6498 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
6499 the bottom (typically) 32 bits of the fixnum.
6500 * eval.c (specpdl_size, call_debugger):
6501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6502 (when_entered_debugger, Fbacktrace_debug):
6503 Don't assume fixnum can fit in int.
6504 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
6505 the object just before a buffer; this is not portable.
6506 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
6507 (grow_specpdl, unbind_to):
6508 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6509 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
6510 (grow_specpdl): Simplify allocation by using xpalloc.
6511 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
6512 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
6513 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
6514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6515 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
6516 (a_write, e_write):
6517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6518 (Fcopy_file, non_regular_nbytes, read_non_regular)
6519 (Finsert_file_contents):
6520 Use int, not EMACS_INT, where int is wide enough.
6521 (READ_BUF_SIZE): Verify that it fits in int.
6522 (Finsert_file_contents): Check that counts are in proper range,
6523 rather than assuming fixnums fit into ptrdiff_t etc.
6524 Don't assume fixnums fit into int.
6525 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
6526 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
6527 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
6528 (string_char_to_byte, string_byte_to_char)
6529 (string_make_multibyte, string_to_multibyte)
6530 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
6531 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
6532 (substring_both, Fdelete, internal_equal, Ffillarray)
6533 (Fclear_string, mapcar1)
6534 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
6535 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
6536 (larger_vector, make_hash_table, maybe_resize_hash_table)
6537 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
6538 (Fmaphash, secure_hash):
6539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6540 (concat): Check for string index and length overflow.
6541 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
6542 (Frequire):
6543 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6544 (larger_vector): New API (vec, incr_min, size_max) replaces old
6545 one (vec, new_size, init). This catches size overflow.
6546 INIT was removed because it was always Qnil.
6547 All callers changed.
6548 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
6549 the upper bound on a hash table index size.
6550 (make_hash_table, maybe_resize_hash_table): Use it.
6551 (secure_hash): Computer start_byte and end_byte only after
6552 they're known to be in ptrdiff_t range.
6553 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
6554 (Ffont_get_glyphs, Ffont_at):
6555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6556 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
6557 (Flist_fonts, Fopen_font):
6558 Don't assume fixnum can fit in int.
6559 (check_gstring): Don't assume index can fit in int.
6560 (font_match_p): Check that fixnum is a character, not a nonnegative
6561 fixnum, since the later code needs to stuff it into an int.
6562 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
6563 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
6564 conversion overflow issues.
6565 (Fopen_font): Check for integer out of range.
6566 (Ffont_get_glyphs): Don't assume index can fit in int.
6567 * font.h: Adjust decls to match defn changes elsewhere.
6568 * fontset.c (reorder_font_vector): Redo score calculation to avoid
6569 integer overflow.
6570 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
6571 printmax_t, where ptrdiff_t is wide enough.
6572 (Finternal_char_font):
6573 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6574 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
6575 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
6576 (Fset_frame_position, x_set_frame_parameters)
6577 (x_set_line_spacing, x_set_border_width)
6578 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
6579 Check that fixnums are in proper range for system types.
6580 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
6581 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6582 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
6583 Use SAFE_ALLOCA_LISP, not alloca.
6584 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
6585 intptr_t is wide enough.
6586 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
6587 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
6588 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
6589 Check for fixnum out of range.
6590 * ftfont.c (ftfont_list): Don't assume index fits in int.
6591 Check that fixnums are in proper range for system types.
6592 (ftfont_shape_by_flt):
6593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6594 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
6595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6596 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
6597 Check that fixnums are in proper range for system types.
6598 * gnutls.h: Adjust decls to match defn changes elsewhere.
6599 * gtkutil.c (xg_dialog_run):
6600 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6601 (update_frame_tool_bar):
6602 Check that fixnums are in proper range for system types.
6603 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
6604 (lookup_image): Check that fixnums are in range for system types.
6605 * indent.c (last_known_column, last_known_column_point):
6606 (current_column_bol_cache):
6607 (skip_invisible, current_column, check_display_width):
6608 (check_display_width, scan_for_column, current_column_1)
6609 (Findent_to, Fcurrent_indentation, position_indentation)
6610 (indented_beyond_p, Fmove_to_column, compute_motion):
6611 (Fcompute_motion, Fvertical_motion):
6612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6613 (last_known_column_modified): Use EMACS_INT, not int.
6614 (check_display_width):
6615 (Fcompute_motion):
6616 Check that fixnums and floats are in proper range for system types.
6617 (compute_motion): Don't assume index or fixnum fits in int.
6618 (compute_motion, Fcompute_motion):
6619 Use int, not EMACS_INT, when it is wide enough.
6620 (vmotion): Omit local var start_hpos that is always 0; that way
6621 we don't need to worry about overflow in expressions involving it.
6622 * indent.h: Adjust decls to match defn changes elsewhere.
6623 (struct position):
6624 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6625 Use int, not EMACS_INT, where int is wide enough.
6626 Remove unused members ovstring_chars_done and tab_offset;
6627 all uses removed.
6628 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
6629 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
6630 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
6631 (make_gap, copy_text, insert, insert_and_inherit)
6632 (insert_before_markers, insert_before_markers_and_inherit)
6633 (insert_1, count_combining_before, count_combining_after)
6634 (insert_1_both, insert_from_string)
6635 (insert_from_string_before_markers, insert_from_string_1)
6636 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
6637 (adjust_after_replace, adjust_after_insert, replace_range)
6638 (replace_range_2, del_range, del_range_1, del_range_byte)
6639 (del_range_both, del_range_2, modify_region)
6640 (prepare_to_modify_buffer, signal_before_change)
6641 (signal_after_change, Fcombine_after_change_execute):
6642 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6643 * intervals.c (traverse_intervals, rotate_right, rotate_left)
6644 (balance_an_interval, split_interval_right, split_interval_left)
6645 (find_interval, next_interval, update_interval)
6646 (adjust_intervals_for_insertion, delete_node, delete_interval)
6647 (interval_deletion_adjustment, adjust_intervals_for_deletion)
6648 (static_offset_intervals, offset_intervals)
6649 (merge_interval_right, merge_interval_left, make_new_interval)
6650 (graft_intervals_into_buffer, temp_set_point_both)
6651 (temp_set_point, set_point, adjust_for_invis_intang)
6652 (set_point_both, move_if_not_intangible, get_property_and_range)
6653 (get_local_map, copy_intervals, copy_intervals_to_string)
6654 (compare_string_intervals, set_intervals_multibyte_1):
6655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6656 * intervals.h: Adjust decls to match defn changes elsewhere.
6657 (struct interval):
6658 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6659 * keyboard.c (this_command_key_count, this_single_command_key_start)
6660 (before_command_key_count, before_command_echo_length, echo_now)
6661 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
6662 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
6663 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
6664 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
6665 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6666 (last_non_minibuf_size, last_point_position, echo_truncate)
6667 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
6668 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
6669 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
6670 (stuff_buffered_input):
6671 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6672 (last_auto_save, command_loop_1, read_char):
6673 Use EMACS_INT, not int, to avoid integer overflow.
6674 (record_char): Avoid overflow in total_keys computation.
6675 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
6676 * keyboard.h: Adjust decls to match defn changes elsewhere.
6677 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
6678 (Fkey_description, Fdescribe_vector, Flookup_key):
6679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6680 (click_position): New function, to check that positions are in range.
6681 (Fcurrent_active_maps):
6682 (describe_command):
6683 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6684 (Faccessible_keymaps, Fkey_description):
6685 (preferred_sequence_p):
6686 Don't assume fixnum can fit into int.
6687 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
6688 Check for integer overflow in size calculations.
6689 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
6690 avoid mishandling large integers.
6691 * lisp.h: Adjust decls to match defn changes elsewhere.
6692 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
6693 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
6694 (struct Lisp_Marker):
6695 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6696 (clip_to_bounds): Now an inline function, moved here from editfns.c.
6697 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
6698 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
6699 All callers changed.
6700 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
6701 Assume the arg has valid form, since it always does.
6702 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
6703 unsigned integer system type.
6704 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
6705 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
6706 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6707 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
6708 (duration_to_sec_usec): New decl.
6709 * lread.c (read_from_string_index, read_from_string_index_byte)
6710 (read_from_string_limit, readchar, unreadchar, openp)
6711 (read_internal_start, read1, oblookup):
6712 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6713 (Fload, readevalloop, Feval_buffer, Feval_region):
6714 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6715 (openp): Check for out-of-range argument to 'access'.
6716 (read1): Use int, not EMACS_INT, where int is wide enough.
6717 Don't assume fixnum fits into int.
6718 Fix off-by-one error that can read outside a buffer.
6719 (read_filtered_event): Use duration_to_sec_usec
6720 to do proper overflow checking on durations.
6721 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
6722 in size calculation.
6723 (Fexecute_kbd_macro):
6724 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6725 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
6726 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
6727 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
6728 (set_marker_both, set_marker_restricted_both, marker_position)
6729 (marker_byte_position, Fbuffer_has_markers_at):
6730 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6731 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
6732 * menu.c (ensure_menu_items): Rename from grow_menu_items.
6733 It now merely ensures that the menu is large enough, without
6734 necessarily growing it, as this avoids some integer overflow issues.
6735 All callers changed.
6736 (keymap_panes, parse_single_submenu, Fx_popup_menu):
6737 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6738 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
6739 Use SAFE_ALLOCA_LISP, not alloca.
6740 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
6741 to EMACS_INT. Check that fixnums are in proper range for system types.
6742 * minibuf.c (minibuf_prompt_width, string_to_object)
6743 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
6744 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
6745 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6746 (get_minibuffer, read_minibuf_unwind):
6747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6748 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
6749 this simplifies overflow checking. All callers changed.
6750 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
6751 (Ftest_completion):
6752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6753 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
6754 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
6755 Check that fixnums are in proper range for system types.
6756 (Fx_create_frame, Fx_show_tip):
6757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6758 * nsfont.m (ns_findfonts, nsfont_list_family):
6759 Don't assume fixnum fits in long.
6760 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
6761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6762 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
6763 wide enough.
6764 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
6765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6766 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
6767 (PRINTDECLARE, PRINTPREPARE):
6768 (strout, print_string):
6769 (print, print_preprocess, print_check_string_charset_prop)
6770 (print_object):
6771 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6772 (PRINTDECLARE):
6773 (temp_output_buffer_setup, Fprin1_to_string, print_object):
6774 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6775 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
6776 (printchar, strout): Use xpalloc to catch size calculation overflow.
6777 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
6778 (print_error_message): Use SAFE_ALLOCA, not alloca.
6779 (print_object): Use int, not EMACS_INT, where int is wide enough.
6780 (print_depth, new_backquote_output, print_number_index):
6781 Use ptrdiff_t, not int, where int might not be wide enough.
6782 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
6783 (Fset_process_window_size, Fformat_network_address)
6784 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
6785 (sigchld_handler):
6786 Check that fixnums are in proper range for system types.
6787 (Fsignal_process): Simplify by avoiding a goto.
6788 Check for process-ids out of pid_t range rather than relying on
6789 undefined behavior.
6790 (process_tick, update_tick): Use EMACS_INT, not int.
6791 (Fformat_network_address, read_process_output, send_process)
6792 (Fprocess_send_region, status_notify):
6793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6794 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
6795 (wait_reading_process_output, read_process_output, exec_sentinel):
6796 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6797 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
6798 (Faccept_process_output): Use duration_to_sec_usec to do proper
6799 overflow checking on durations.
6800 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
6801 Don't assume pid_t fits in int.
6802 * process.h (struct Lisp_Process): Members tick and update_tick
6803 are now of type EMACS_INT, not int.
6804 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
6805 configured --with-wide-int.
6806 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
6807 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
6808 * search.c (looking_at_1, string_match_1):
6809 (fast_string_match, fast_c_string_match_ignore_case)
6810 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
6811 (scan_newline, find_before_next_newline, search_command)
6812 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
6813 (set_search_regs, wordify):
6814 (Freplace_match):
6815 (Fmatch_data):
6816 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6817 (string_match_1, search_buffer, set_search_regs):
6818 (Fmatch_data):
6819 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6820 (wordify): Check for overflow in size calculation.
6821 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
6822 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
6823 Check that fixnums are in proper range for system types.
6824 * sound.c (struct sound_device)
6825 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
6826 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6827 (Fplay_sound_internal):
6828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6829 * syntax.c (struct lisp_parse_state, find_start_modiff)
6830 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
6831 (Fparse_partial_sexp):
6832 Don't assume fixnums can fit in int.
6833 (struct lisp_parse_state, find_start_pos, find_start_value)
6834 (find_start_value_byte, find_start_begv)
6835 (update_syntax_table, char_quoted, dec_bytepos)
6836 (find_defun_start, prev_char_comend_first, back_comment):
6837 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
6838 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
6839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6840 (Finternal_describe_syntax_value): Check that match_lisp is a
6841 character, not an integer, since the code stuffs it into int.
6842 (scan_words, scan_sexps_forward):
6843 Check that fixnums are in proper range for system types.
6844 (Fforward_word):
6845 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6846 (scan_sexps_forward):
6847 Use CHARACTERP, not INTEGERP, since the value must fit into int.
6848 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
6849 * syntax.h: Adjust decls to match defn changes elsewhere.
6850 (struct gl_state_s):
6851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6852 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
6853 MOST_POSITIVE_FIXNUM.
6854 * sysdep.c (wait_for_termination_1, wait_for_termination)
6855 (interruptible_wait_for_termination, mkdir):
6856 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
6857 (emacs_read, emacs_write):
6858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6859 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
6860 and double all fit in int.
6861 * term.c (set_tty_color_mode):
6862 Check that fixnums are in proper range for system types.
6863 * termhooks.h (struct input_event):
6864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6865 * textprop.c (validate_interval_range, interval_of)
6866 (Fadd_text_properties, set_text_properties_1)
6867 (Fremove_text_properties, Fremove_list_of_text_properties)
6868 (Ftext_property_any, Ftext_property_not_all)
6869 (copy_text_properties, text_property_list, extend_property_ranges)
6870 (verify_interval_modification):
6871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6872 (Fnext_single_char_property_change)
6873 (Fprevious_single_char_property_change):
6874 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6875 (copy_text_properties):
6876 Check for integer overflow in index calculation.
6877 * undo.c (last_boundary_position, record_point, record_insert)
6878 (record_delete, record_marker_adjustment, record_change)
6879 (record_property_change):
6880 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6881 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
6882 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6883 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6884 (Fx_hide_tip, Fx_file_dialog):
6885 * w32menu.c (set_frame_menubar):
6886 Use ptrdiff_t, not int, for consistency with rest of code.
6887 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
6888 (select_window, Fdelete_other_windows_internal)
6889 (window_scroll_pixel_based, window_scroll_line_based)
6890 (Frecenter, Fset_window_configuration):
6891 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6892 (Fset_window_hscroll, run_window_configuration_change_hook)
6893 (set_window_buffer, temp_output_buffer_show, scroll_command)
6894 (Fscroll_other_window, Frecenter):
6895 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6896 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
6897 Don't assume fixnum fits in int.
6898 (Fset_window_scroll_bars):
6899 Check that fixnums are in proper range for system types.
6900 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
6901 (string_pos, c_string_pos, number_of_chars, init_iterator)
6902 (in_ellipses_for_invisible_text_p, init_from_display_pos)
6903 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
6904 (compute_display_string_end, handle_face_prop)
6905 (face_before_or_after_it_pos, handle_invisible_prop)
6906 (handle_display_prop, handle_display_spec, handle_single_display_spec)
6907 (display_prop_intangible_p, string_buffer_position_lim)
6908 (string_buffer_position, handle_composition_prop, load_overlay_strings)
6909 (get_overlay_strings_1, get_overlay_strings)
6910 (iterate_out_of_display_property, forward_to_next_line_start)
6911 (back_to_previous_visible_line_start, reseat, reseat_to_string)
6912 (get_next_display_element, set_iterator_to_next)
6913 (get_visually_first_element, compute_stop_pos_backwards)
6914 (handle_stop_backwards, next_element_from_buffer)
6915 (move_it_in_display_line_to, move_it_in_display_line)
6916 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6917 (add_to_log, message_dolog, message_log_check_duplicate)
6918 (message2, message2_nolog, message3, message3_nolog
6919 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
6920 (current_message_1, truncate_echo_area, truncate_message_1)
6921 (set_message, set_message_1, store_mode_line_noprop)
6922 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
6923 (text_outside_line_unchanged_p, check_point_in_composition)
6924 (reconsider_clip_changes)
6925 (redisplay_internal, set_cursor_from_row, try_scrolling)
6926 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
6927 (redisplay_window, find_last_unchanged_at_beg_row)
6928 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
6929 (trailing_whitespace_p, find_row_edges, display_line)
6930 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
6931 (display_mode_element, store_mode_line_string)
6932 (pint2str, pint2hrstr, decode_mode_spec)
6933 (display_count_lines, display_string, draw_glyphs)
6934 (x_produce_glyphs, x_insert_glyphs)
6935 (rows_from_pos_range, mouse_face_from_buffer_pos)
6936 (fast_find_string_pos, mouse_face_from_string_pos)
6937 (note_mode_line_or_margin_highlight, note_mouse_highlight):
6938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6939 (safe_call, init_from_display_pos, handle_fontified_prop)
6940 (handle_single_display_spec, load_overlay_strings)
6941 (with_echo_area_buffer, setup_echo_area_for_printing)
6942 (display_echo_area, echo_area_display)
6943 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
6944 (update_tool_bar, hscroll_window_tree, redisplay_internal)
6945 (redisplay_window, dump_glyph_row, display_mode_line)
6946 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
6947 (handle_display_spec, display_prop_string_p):
6948 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6949 (handle_single_display_spec, build_desired_tool_bar_string)
6950 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
6951 (get_specified_cursor_type):
6952 Check that fixnums are in proper range for system types.
6953 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
6954 (Flookup_image_map):
6955 Don't assume fixnums fit in int.
6956 (compare_overlay_entries):
6957 Avoid mishandling comparisons due to subtraction overflow.
6958 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
6959 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
6960 (handle_tool_bar_click):
6961 Use int, not unsigned, since we prefer signed and the signedness
6962 doesn't matter here.
6963 (get_next_display_element, next_element_from_display_vector):
6964 Use int, not EMACS_INT, when int is wide enough.
6965 (start_hourglass): Use duration_to_sec_usec to do proper
6966 overflow checking on durations.
6967 * xfaces.c (Fbitmap_spec_p):
6968 Check that fixnums are in proper range for system types.
6969 (compare_fonts_by_sort_order):
6970 Avoid mishandling comparisons due to subtraction overflow.
6971 (Fx_family_fonts, realize_basic_faces):
6972 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6973 (Fx_family_fonts):
6974 Don't assume fixnum fits in int.
6975 Use SAFE_ALLOCA_LISP, not alloca.
6976 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
6977 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
6978 (face_at_buffer_position, face_for_overlay_string)
6979 (face_at_string_position):
6980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6981 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
6982 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
6983 (Fx_show_tip):
6984 Check that fixnums are in proper range for system types.
6985 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
6986 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
6987 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6988 (Fx_change_window_property): Don't assume fixnums fit in int.
6989 * xfont.c (xfont_chars_supported):
6990 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6991 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
6992 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
6993 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
6994 * xml.c (parse_region):
6995 * xrdb.c (magic_file_p):
6996 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
6997 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
6998 (x_get_local_selection, x_reply_selection_request)
6999 (x_handle_selection_request, wait_for_property_change):
7000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7001 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
7002 short is wide enough.
7003 (x_send_client_event): Don't assume fixnum fits in int.
7004 * xterm.c (x_x_to_emacs_modifiers):
7005 Don't assume EMACS_INT overflows nicely into int.
7006 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
7007 may come from Lisp.
7008 (handle_one_xevent): NATNUMP can eval its arg twice.
7009 (x_connection_closed):
7010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
7011 * xterm.h: Adjust decls to match defn changes elsewhere.
7012 (struct scroll_bar): Use struct vectorlike_header
7013 rather than rolling our own approximation.
7014 (SCROLL_BAR_VEC_SIZE): Remove; not used.
7015
7016 2012-05-25 Glenn Morris <rgm@gnu.org>
7017
7018 * lisp.mk (lisp): Update for more files being compiled now.
7019
7020 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
7021
7022 * lread.c: Remove `read_pure' which makes no difference.
7023 (read_pure): Remove var.
7024 (unreadpure): Remove function.
7025 (readevalloop): Don't call read_list with -1 flag.
7026 (read1, read_vector): Don't test read_pure any more.
7027 (read_list): Simplify.
7028
7029 * fileio.c, character.h: Minor style tweaks.
7030
7031 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
7032
7033 * window.h (clip_changed): Remove useless declaration.
7034
7035 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
7036
7037 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
7038 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
7039
7040 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
7041
7042 Remove src/m/*.
7043 This directory predates autoconf and is no longer needed nowadays.
7044 Move its few remaining bits of functionality to where they're needed.
7045 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
7046 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
7047 * m/template.h: Remove.
7048 * Makefile.in (M_FILE): Remove. All uses removed.
7049 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
7050 * lisp.h (USE_LSB_TAG):
7051 * mem-limits.h (EXCEEDS_LISP_PTR):
7052 Use VAL_MAX, not VALBITS, in #if.
7053 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
7054 (EMACS_UINT): Define unconditionally now.
7055 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
7056 (BITS_PER_EMACS_INT): New constants, replacing
7057 what used to be in config.h, but not useful in #if.
7058 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
7059 define them any more.
7060 (VAL_MAX): New macro.
7061 (VALMASK): Use it.
7062 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
7063 BITS_PER_EMACS_INT, in #if.
7064 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
7065 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
7066 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
7067 * s/ms-w32.h (DATA_START):
7068 Move here from removed file m/intel386.h.
7069 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
7070 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
7071
7072 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
7073
7074 Assume C89 or later.
7075 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
7076 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
7077 (xrealloc):
7078 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
7079 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
7080 * textprop.c, tparam.c (NULL): Remove.
7081 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
7082 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
7083 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
7084 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
7085 * xterm.c (input_signal_count): Assume volatile works.
7086
7087 2012-05-21 Ken Brown <kbrown@cornell.edu>
7088
7089 * xgselect.c (xg_select): Fix first argument in call to 'select'
7090 (bug#11508).
7091
7092 2012-05-20 Ken Brown <kbrown@cornell.edu>
7093
7094 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
7095 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
7096
7097 2012-05-19 Ken Brown <kbrown@cornell.edu>
7098
7099 * xfns.c (x_in_use): Remove `static' qualifier.
7100 * xterm.h (x_in_use): Declare.
7101 * xgselect.c: Include xterm.h.
7102 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
7103 and `display_arg' (bug#9754).
7104
7105 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
7106
7107 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
7108
7109 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
7110 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
7111
7112 2012-05-18 Eli Zaretskii <eliz@gnu.org>
7113
7114 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
7115
7116 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
7117 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
7118
7119 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
7120 reference to image_cache->refcount.
7121 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
7122
7123 2012-05-17 Juri Linkov <juri@jurta.org>
7124
7125 * search.c (Fword_search_regexp, Fword_search_backward)
7126 (Fword_search_forward, Fword_search_backward_lax)
7127 (Fword_search_forward_lax): Move functions to isearch.el
7128 (bug#10145, bug#11381).
7129
7130 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
7131
7132 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
7133
7134 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
7135
7136 * lread.c (init_obarray): Declare Qt and Qnil as special.
7137
7138 2012-05-14 Glenn Morris <rgm@gnu.org>
7139
7140 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
7141 Put "libexec" before "bin", for the sake of init_callproc_1.
7142
7143 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7144
7145 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
7146
7147 * unexaix.c: Port to more-recent AIX compilers.
7148 (report_error, report_error_1, make_hdr, copy_sym)
7149 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
7150 Make arguments const char *, not char *, to avoid violations of C
7151 standard and to fix some AIX warnings reported by Gilles Pion.
7152
7153 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7154
7155 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
7156 already have overlays loaded.
7157 (handle_single_display_spec): Before returning without displaying
7158 fringe bitmap, synchronize the bidi iterator with the main display
7159 iterator, by calling iterate_out_of_display_property.
7160 (iterate_out_of_display_property): Detect buffer iteration by
7161 testing that it->string is a Lisp string.
7162 (get_next_display_element): When the current object is exhausted,
7163 and there's something on it->stack, call set_iterator_to_next to
7164 proceed with what's on the stack, instead of returning zero.
7165 (set_iterator_to_next): If called at the end of a Lisp string,
7166 proceed to consider_string_end without incrementing string
7167 position. Don't increment display vector index past the end of
7168 the display vector. (Bug#11417)
7169 (pos_visible_p): Don't report a position visible when move_it_to
7170 stopped at the last line of window, which happens to be scanned
7171 backwards by the bidi iteration. (Bug#11464)
7172
7173 2012-05-14 Eli Zaretskii <eliz@gnu.org>
7174
7175 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
7176 and right-margin display specs even if the spec is invalid or we
7177 are on a TTY, and thus unable to display on the fringes.
7178 That's because the text with the property will not be displayed anyway,
7179 so we need to signal to the caller that this is a "replacing"
7180 display spec. This fixes display when the spec is invalid or we
7181 are on a TTY.
7182
7183 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
7184
7185 * unexaix.c (make_hdr): Fix typo in prototype.
7186 This bug broke the build on AIX. Problem reported by Gilles Pion.
7187
7188 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
7189
7190 * keyboard.c (kbd_buffer_get_event): Read special events also in
7191 batch mode. (Bug#11415)
7192
7193 2012-05-12 Glenn Morris <rgm@gnu.org>
7194
7195 * ns.mk: Update for ns_appbindir no longer having trailing "/".
7196
7197 2012-05-12 Eli Zaretskii <eliz@gnu.org>
7198
7199 * lisp.mk (lisp): Add newcomment.elc.
7200
7201 2012-05-12 Glenn Morris <rgm@gnu.org>
7202
7203 * Makefile.in (MKDIR_P): New, set by configure.
7204 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
7205
7206 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
7207
7208 Remove unused function hourglass_started.
7209 * dispextern.h (hourglass_started):
7210 * w32fns.c (hourglass_started):
7211 * xdisp.c (hourglass_started): Remove.
7212
7213 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
7214
7215 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
7216 Update dependencies.
7217
7218 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
7219
7220 * xgselect.c (xg_select): Put maxfds+1 into a var.
7221 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
7222
7223 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
7224
7225 2012-05-10 Dave Abrahams <dave@boostpro.com>
7226
7227 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
7228 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
7229
7230 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
7231
7232 * dbusbind.c (xd_registered_buses): New internal Lisp object.
7233 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
7234 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
7235 Initialize xd_registered_buses.
7236
7237 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
7238
7239 Untag more efficiently if USE_LSB_TAG.
7240 This is based on a proposal by YAMAMOTO Mitsuharu in
7241 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
7242 For an admittedly artificial (nth 8000 longlist) benchmark on
7243 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
7244 Emacs's overall text size by 1%.
7245 * lisp.h (XUNTAG): New macro.
7246 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
7247 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
7248 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
7249 * eval.c (Fautoload):
7250 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
7251 * frame.h (XFRAME): Use XUNTAG.
7252
7253 Port recent dbusbind.c changes to 32-bit --with-wide-int.
7254 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
7255 Remove unportable assumptions about print widths of types like
7256 dbus_uint32_t.
7257 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
7258 intptr_t when converting between pointer and integer, to avoid GCC
7259 warnings about wrong width.
7260
7261 2012-05-09 Eli Zaretskii <eliz@gnu.org>
7262
7263 * w32proc.c (new_child): Force Windows to reserve only 64KB of
7264 stack for each reader_thread, instead of defaulting to 8MB
7265 determined by the linker. This avoids failures in creating
7266 subprocesses on Windows 7, see the discussion in this thread:
7267 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
7268
7269 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
7270
7271 Fix up display of the *Minibuf-0* buffer in the mini window.
7272 * keyboard.c (read_char): Don't clear the echo area if there's no
7273 message to clear.
7274 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
7275 contents of *Minibuf-0*) if there's no message displayed in its stead.
7276
7277 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
7278
7279 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
7280 batch mode.
7281
7282 2012-05-06 Chong Yidong <cyd@gnu.org>
7283
7284 * lisp.mk (lisp): Update.
7285
7286 2012-05-05 Jim Meyering <meyering@redhat.com>
7287
7288 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
7289
7290 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
7291
7292 * data.c (PUT_ERROR): New macro.
7293 (syms_of_data): Use it. Add new error type `user-error'.
7294 * undo.c (user_error): New function.
7295 (Fprimitive_undo): Use it.
7296 * print.c (print_error_message): Adjust print style for `user-error'.
7297 * keyboard.c (user_error): New function.
7298 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
7299
7300 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
7301
7302 Do not limit current-time-string to years 1000..9999.
7303 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
7304 (Fcurrent_time_string): Support any year that is supported by the
7305 underlying localtime representation. Don't use asctime, as it
7306 has undefined behavior for years outside the range -999..9999.
7307
7308 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
7309
7310 Fix race conditions involving setenv, gmtime, localtime, asctime.
7311 Without this fix, interrupts could mess up code that uses these
7312 nonreentrant functions, since setting TZ invalidates existing
7313 tm_zone or tzname values, and since most of these functions return
7314 pointers to static storage.
7315 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
7316 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
7317 Grow the critical sections to include not just invoking
7318 localtime/gmtime, but also accessing these functions' results
7319 including their tm_zone values if any, and any related TZ setting.
7320 (format_time_string): Last arg is now struct tm *, not struct tm **,
7321 so that the struct tm is saved in the critical section.
7322 All callers changed. Simplify allocation of initial buffer, partly
7323 motivated by the fact that memory allocation needs to be outside
7324 the critical section.
7325
7326 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
7327
7328 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
7329 with RESET_INTERVAL.
7330
7331 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
7332 Remove duplicated buffer name initialization.
7333
7334 2012-05-02 Jim Meyering <jim@meyering.net>
7335
7336 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
7337
7338 * xfns.c (x_window): Use xstrdup (Bug#11375).
7339
7340 2012-05-02 Eli Zaretskii <eliz@gnu.org>
7341
7342 * xdisp.c (pos_visible_p): If already at a newline from the
7343 display string before the 'while' loop, don't walk back the glyphs
7344 from it3.glyph_row. Solves assertion violation when the display
7345 string begins with a newline (egg.el). (Bug#11367)
7346
7347 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
7348
7349 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
7350 Move to simple.el.
7351
7352 2012-05-01 Glenn Morris <rgm@gnu.org>
7353
7354 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
7355 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
7356 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
7357 All were removed before 23.1.
7358
7359 * dispnew.c: Remove HAVE_LIBNCURSES test;
7360 it is always true on relevant platforms.
7361
7362 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
7363 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
7364
7365 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
7366
7367 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
7368
7369 * .gdbinit (xpr): Remove checks for no longer existing misc types.
7370 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
7371 Remove.
7372
7373 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
7374
7375 Do not avoid creating empty evaporating overlays (Bug#9642).
7376 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
7377 That is, do not delete an evaporating overlay if it becomes
7378 empty after its bounds are adjusted to fit within its buffer.
7379 This fix caused other problems, and I'm reverting it until we get
7380 to the bottom of them.
7381
7382 2012-04-27 Chong Yidong <cyd@gnu.org>
7383
7384 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
7385
7386 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7387
7388 * xdisp.c (pos_visible_p): If the window start position is beyond
7389 ZV, start the display from buffer beginning. Prevents assertion
7390 violation in init_iterator when the minibuffer window is scrolled
7391 via the scroll bar.
7392
7393 * window.c (window_scroll_pixel_based): Likewise.
7394
7395 2012-04-27 Chong Yidong <cyd@gnu.org>
7396
7397 * keymap.c (where_is_internal): Doc fix (Bug#10872).
7398
7399 2012-04-27 Glenn Morris <rgm@gnu.org>
7400
7401 * fileio.c (Fcopy_file, Fset_file_selinux_context):
7402 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
7403
7404 2012-04-27 Eli Zaretskii <eliz@gnu.org>
7405
7406 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
7407 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
7408
7409 2012-04-26 Eli Zaretskii <eliz@gnu.org>
7410
7411 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
7412 display element, check also the underlying string or buffer
7413 character. (Bug#11341)
7414
7415 * w32menu.c: Include w32heap.h.
7416 (add_menu_item): If the call to AppendMenuW (via
7417 unicode_append_menu) fails, disable Unicode menus only if we are
7418 running on Windows 9X/Me.
7419
7420 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
7421
7422 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
7423 (xgetint): Add missing shift for LSB tags.
7424
7425 2012-04-24 Martin Rudalics <rudalics@gmx.at>
7426
7427 * keyboard.c (read_char): Don't wipe echo area for select window
7428 events: These might get delayed via `mouse-autoselect-window'
7429 (Bug#11304).
7430
7431 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
7432
7433 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
7434 manipulation of :loaded-from data.
7435
7436 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
7437
7438 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
7439 now a cons (bug#11311).
7440
7441 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
7442
7443 Do not create empty overlays with the evaporate property (Bug#9642).
7444 * buffer.c (Fmove_overlay): Delete an evaporating overlay
7445 if it becomes empty after its bounds are adjusted to fit within
7446 its buffer. Without this fix, in a nonempty buffer (let ((o
7447 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
7448 yields an empty overlay that has the evaporate property, which is
7449 not supposed to happen.
7450
7451 Fix minor GTK3 problems found by static checking.
7452 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7453 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7454 (struct _EmacsFixedClass, emacs_fixed_get_type):
7455 Move decls here from emacsgtkfixed.h, since they needn't be public.
7456 (emacs_fixed_get_type): Now static.
7457 (emacs_fixed_class_init): Omit unused local.
7458 (emacs_fixed_child_type): Remove; unused.
7459 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
7460 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
7461 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
7462 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
7463 (EMACS_FIXED_GET_CLASS): Remove; unused.
7464 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
7465
7466 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
7467 Problem reported by Juanma Barranquero for Windows -Wunused-function.
7468
7469 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7470
7471 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
7472 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
7473 (__malloc_size_t, __malloc_ptrdiff_t):
7474 Remove. All uses removed, replaced by the definiens if needed,
7475 since we can assume C89 or better now.
7476 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
7477 (protect_malloc_state, align, get_contiguous_space)
7478 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
7479 (malloc_atfork_handler_child, malloc_enable_thread)
7480 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
7481 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
7482 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
7483 (special_realloc, _realloc_internal_nolock, _realloc_internal)
7484 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
7485 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
7486 Define using prototypes, not old style.
7487 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
7488 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
7489 (align): Don't assume that signed integer overflow wraps around.
7490 Omit unused local var.
7491 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
7492 (_free_internal_nolock, memalign, mallochook, reallochook):
7493 Omit no-longer-needed casts.
7494 (valloc): Use getpagesize, not __getpagesize.
7495 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
7496 (struct hdr): The 'magic' member is now size_t, not unsigned long.
7497
7498 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
7499
7500 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
7501
7502 Move functions from C to Lisp. Make non-blocking method calls
7503 the default. Implement further D-Bus standard interfaces.
7504
7505 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
7506 (QCdbus_request_name_allow_replacement)
7507 (QCdbus_request_name_replace_existing)
7508 (QCdbus_request_name_do_not_queue)
7509 (QCdbus_request_name_reply_primary_owner)
7510 (QCdbus_request_name_reply_in_queue)
7511 (QCdbus_request_name_reply_exists)
7512 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
7513 (QCdbus_registered_serial, QCdbus_registered_method)
7514 (QCdbus_registered_signal): New Lisp objects.
7515 (XD_DEBUG_MESSAGE): Use sizeof.
7516 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
7517 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
7518 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
7519 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
7520 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
7521 (xd_signature, xd_append_arg): Allow float for integer types.
7522 (xd_get_connection_references): New function.
7523 (xd_get_connection_address): Rename from xd_initialize.
7524 Return cached address.
7525 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
7526 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
7527 level.
7528 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
7529 Return number of refcounts.
7530 (Fdbus_get_unique_name): Make stronger parameter check.
7531 (Fdbus_message_internal): New defun.
7532 (Fdbus_call_method, Fdbus_call_method_asynchronously)
7533 (Fdbus_method_return_internal, Fdbus_method_error_internal)
7534 (Fdbus_send_signal, Fdbus_register_service)
7535 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
7536 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
7537 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
7538 (Vdbus_compiled_version, Vdbus_runtime_version)
7539 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
7540 (Vdbus_message_type_method_return, Vdbus_message_type_error)
7541 (Vdbus_message_type_signal): New defvars.
7542 (Vdbus_registered_buses, Vdbus_registered_objects_table):
7543 Adapt docstring.
7544
7545 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7546
7547 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
7548 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
7549 Do not assume ptrdiff_t is the same width as 'int'.
7550
7551 * alloc.c: Handle unusual debugging option combinations.
7552 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
7553 since the two debugging options are incompatible.
7554 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
7555 is defined.
7556 (mem_init, mem_insert, mem_insert_fixup):
7557 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
7558 (NEED_MEM_INSERT): Remove; no longer needed.
7559
7560 2012-04-22 Leo Liu <sdl.web@gmail.com>
7561
7562 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
7563
7564 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
7565
7566 * sysdep.c [__FreeBSD__]: Minor cleanups.
7567 (list_system_processes, system_process_attributes) [__FreeBSD__]:
7568 Use Emacs indenting style more consistently. Avoid some casts.
7569 Use 'double' consistently rather than mixing 'float' and 'double'.
7570
7571 2012-04-21 Eduard Wiebe <usenet@pusto.de>
7572
7573 * sysdep.c (list_system_processes, system_process_attributes):
7574 Add implementation for FreeBSD (Bug#5243).
7575
7576 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
7577
7578 * lisp.mk (lisp): Update.
7579
7580 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
7581
7582 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
7583 It is never used otherwise.
7584
7585 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
7586
7587 * print.c (print_preprocess): Only check print_depth if print-circle
7588 is nil.
7589 (print_object): Check for cycles even when print-circle is nil and
7590 print-gensym is t, but only check print_depth if print-circle is nil.
7591
7592 2012-04-20 Chong Yidong <cyd@gnu.org>
7593
7594 * process.c (wait_reading_process_output): If EIO occurs on a pty,
7595 set the status to "failed" and ensure that sentinel is run.
7596
7597 2012-04-20 Glenn Morris <rgm@gnu.org>
7598
7599 * process.c (Fset_process_inherit_coding_system_flag)
7600 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
7601 (Fmake_network_process, Fmake_serial_process): Doc fix.
7602
7603 2012-04-20 Eli Zaretskii <eliz@gnu.org>
7604
7605 * xdisp.c (string_buffer_position_lim): Limit starting position to
7606 BEGV.
7607 (set_cursor_from_row): If called for a mode-line or header-line
7608 row, return zero immediately.
7609 (try_cursor_movement): If inside continuation line, don't back up
7610 farther than the first row after the header line, if any.
7611 Don't consider the header-line row as "partially visible", even if
7612 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
7613
7614 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7615
7616 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
7617 (bug#11238).
7618
7619 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
7620 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
7621
7622 configure: new option --enable-gcc-warnings (Bug#11207)
7623 * Makefile.in (C_WARNINGS_SWITCH): Remove.
7624 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
7625 (ALL_CFLAGS): Use new macros rather than old.
7626 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
7627 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
7628 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
7629 -Wunused-result, -Wunused-variable. This should go away once
7630 the Emacs and Gnulib regex code is merged.
7631 (xmalloc, xrealloc): Now static.
7632
7633 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 * dired.c (Fsystem_groups): Remove unused local.
7636
7637 2012-04-17 Glenn Morris <rgm@gnu.org>
7638
7639 * dired.c (Fsystem_users): Doc fix.
7640
7641 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
7642
7643 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
7644 (syms_of_dired): Add them.
7645
7646 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
7647
7648 Fix minor alloc.c problems found by static checking.
7649 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
7650 New extern decls, to avoid calling undeclared functions.
7651 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
7652 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
7653 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
7654 (NEED_MEM_INSERT): New macro.
7655 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
7656 Remove one incorrect comment and fix another.
7657
7658 Fix minor ralloc.c problems found by static checking.
7659 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7660 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
7661 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
7662 (r_alloc_sbrk): Now static.
7663
7664 Improve ralloc.c interface checking.
7665 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
7666 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
7667 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
7668 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
7669 [REL_ALLOC]: ... to here, to check interface.
7670 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
7671 Remove decls. This fixes an "It stinks!".
7672
7673 * alloc.c (which_symbols): Fix alignment issue / type clash.
7674
7675 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
7676
7677 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
7678 (struct Lisp_Misc_Any): Likewise.
7679 (struct Lisp_Free): Likewise.
7680 * alloc.c (union aligned_Lisp_Symbol): Define.
7681 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
7682 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
7683 (union aligned_Lisp_Misc): Define.
7684 (MARKER_BLOCK_SIZE, struct marker_block): Use union
7685 aligned_Lisp_Misc instead of union Lisp_Misc.
7686 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
7687
7688 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
7689
7690 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
7691 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
7692 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
7693 * s/netbsd.h, s/sol2-6.h:
7694 Remove definition of GC_MARK_STACK, since the default now works.
7695 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
7696 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
7697 no longer the default.
7698 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
7699
7700 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
7701
7702 * lread.c (lisp_file_lexically_bound_p):
7703 Fix hang at ";-*-\n" (bug#11238).
7704
7705 2012-04-14 Eli Zaretskii <eliz@gnu.org>
7706
7707 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
7708 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
7709
7710 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
7711
7712 * nsterm.m (constrainFrameRect): Always constrain when there is only
7713 one screen (Bug#10962).
7714
7715 2012-04-13 Ken Brown <kbrown@cornell.edu>
7716
7717 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
7718
7719 2012-04-13 Reuben Thomas <rrt@sc3d.org>
7720
7721 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
7722
7723 2012-04-11 Daniel Colascione <dancol@dancol.org>
7724
7725 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
7726 against is gone. It's better to use vfork now so that when Cygwin
7727 gains a new, working vfork, we use it automatically (bug#10398).
7728
7729 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7730
7731 * window.c (save_window_save): Obey window-point-insertion-type.
7732
7733 2012-04-11 Glenn Morris <rgm@gnu.org>
7734
7735 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
7736
7737 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
7738
7739 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
7740
7741 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
7742
7743 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
7744 (force_quit_count): New var.
7745 (handle_interrupt): Use it.
7746
7747 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
7748
7749 * w32.c (w32_delayed_load): Record the full path of the library
7750 being loaded (bug#10424).
7751
7752 2012-04-09 Glenn Morris <rgm@gnu.org>
7753
7754 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
7755 not just in the obarray, before snarfing them. (Bug#11036)
7756
7757 * Makefile.in ($(leimdir)/leim-list.el):
7758 Pass EMACS rather than BUILT_EMACS.
7759
7760 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
7761
7762 * process.c (make_process):
7763 * process.h: Add integer `gnutls_handshakes_tried' member to
7764 process struct.
7765
7766 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
7767 Add convenience `GNUTLS_LOG2i' macro.
7768
7769 * gnutls.c (gnutls_log_function2i): Convenience log function.
7770 (emacs_gnutls_read): Use new log functions,
7771 `gnutls_handshakes_tried' process member, and
7772 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
7773 attempts per process (connection).
7774
7775 2012-04-09 Chong Yidong <cyd@gnu.org>
7776
7777 * eval.c (Fuser_variable_p, user_variable_p_eh)
7778 (lisp_indirect_variable): Functions deleted.
7779 (Fdefvar): Caller changed.
7780
7781 * callint.c (Finteractive, Fcall_interactively):
7782 * minibuf.c (Fread_variable): Callers changed.
7783
7784 2012-04-09 Eli Zaretskii <eliz@gnu.org>
7785
7786 * xdisp.c (set_cursor_from_row): If the display string appears in
7787 the buffer at position that is closer to point than the position
7788 after the display string, display the cursor on the first glyph of
7789 the display string. Fixes cursor display when a 'display' text
7790 property immediately follows invisible text. (Bug#11094)
7791
7792 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
7793
7794 composite.c: use 'double' consistently
7795 * composite.c (get_composition_id): Use 'double' consistently
7796 instead of converting 'float' to 'double' and vice versa; this is
7797 easier to understand and avoids a GCC warning.
7798
7799 2012-04-09 Glenn Morris <rgm@gnu.org>
7800
7801 * Makefile.in: Generate leim-list with bootstrap-emacs, in
7802 preparation for dumping it with emacs. (Bug#4789)
7803 (leimdir): New variable.
7804 ($(leimdir)/leim-list.el): New rule.
7805 (emacs$(EXEEXT)): Depend on leim-list.el.
7806
7807 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
7808 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
7809 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
7810
7811 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
7812
7813 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
7814 proper alignment.
7815
7816 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
7817
7818 * xml.c (init_libxml2_functions) [WINDOWSNT]:
7819 Remove unused local variable.
7820
7821 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7822
7823 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
7824 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
7825 (mark_memory): Mark Lisp_Objects only if pointers might hide in
7826 objects, as mark_maybe_pointer will catch them otherwise.
7827 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
7828 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
7829
7830 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 Fix typo that broke non-Windows builds.
7833 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
7834
7835 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7836
7837 Support building on MS-Windows with libxml2.
7838
7839 * makefile.w32-in (OBJ2): Add xml.$(O).
7840 (GLOBAL_SOURCES): Add xml.c.
7841 ($(BLD)/xml.$(O)): New dependency list.
7842
7843 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
7844 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
7845 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
7846 [!WINDOWSNT]: New macros.
7847 (init_libxml2_functions, libxml2_loaded_p): New functions.
7848 (parse_region): Call fn_xmlCheckVersion instead of using the macro
7849 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
7850 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
7851 Calls xmlCleanupParser only if libxml2 was loaded (or statically
7852 linked in).
7853 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
7854 Call init_libxml2_functions before calling libxml2 functions.
7855 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
7856
7857 * emacs.c: Don't include libxml/parser.h.
7858 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
7859 xmlCleanupParser directly.
7860
7861 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
7862
7863 2012-04-07 Eli Zaretskii <eliz@gnu.org>
7864
7865 * indent.c (Fvertical_motion): If there is a display string at
7866 point, use it.vpos to compute how many lines to backtrack after
7867 move_it_to point. (Bug#11133)
7868
7869 2012-04-06 Eli Zaretskii <eliz@gnu.org>
7870
7871 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
7872 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
7873 about subtle differences between FETCH_CHAR* and STRING_CHAR*
7874 macros related to unification of CJK characters. For the details,
7875 see the discussion following the message here:
7876 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
7877
7878 2012-04-04 Chong Yidong <cyd@gnu.org>
7879
7880 * keyboard.c (Vdelayed_warnings_list): Doc fix.
7881
7882 2012-04-01 Eli Zaretskii <eliz@gnu.org>
7883
7884 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
7885 instead of alloca. (Bug#11138)
7886
7887 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
7888
7889 * w32menu.c (is_simple_dialog): Properly check lisp types.
7890 (Bug#11141)
7891
7892 2012-03-31 Eli Zaretskii <eliz@gnu.org>
7893
7894 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
7895 position we get to after a call to move_it_to fails the
7896 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
7897 only if we wind up in a string from display property. (Bug#11063)
7898
7899 * window.c (Fdelete_other_windows_internal): Invalidate the row
7900 and column information about mouse highlight, so that redisplay
7901 restores it after reallocating the glyph matrices. (Bug#7464)
7902
7903 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
7904 string comes from a `display' text property, use the buffer
7905 position of that property as if we actually saw that position in
7906 the row's glyphs.
7907 (move_it_by_lines): Remove the assertion that
7908 "it->current_x == 0 && it->hpos == 0" which can be legitimately
7909 violated when there's a before-string at the beginning of a line.
7910 (Bug#11063)
7911
7912 2012-03-30 Eli Zaretskii <eliz@gnu.org>
7913
7914 * xdisp.c (append_space_for_newline): If the default face was
7915 remapped, use the remapped face for the appended newline.
7916 (extend_face_to_end_of_line): Use the remapped default face for
7917 extending the face to the end of the line.
7918 (display_line): Call extend_face_to_end_of_line when the default
7919 face was remapped. (Bug#11068)
7920
7921 2012-03-29 Eli Zaretskii <eliz@gnu.org>
7922
7923 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
7924
7925 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7926
7927 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
7928
7929 2012-03-27 Glenn Morris <rgm@gnu.org>
7930
7931 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
7932 Doc fixes.
7933
7934 2012-03-26 Kenichi Handa <handa@m17n.org>
7935
7936 * dispextern.h (struct glyph): Fix previous change. Change the
7937 bit length of glyphless.ch to 25 (Bug#11082).
7938
7939 2012-03-26 Chong Yidong <cyd@gnu.org>
7940
7941 * keyboard.c (Vselection_inhibit_update_commands): New variable.
7942 (command_loop_1): Use it; inhibit selection update for
7943 handle-select-window too (Bug#8996).
7944
7945 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
7946
7947 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
7948
7949 2012-03-25 Kenichi Handa <handa@m17n.org>
7950
7951 * dispextern.h (struct glyph): Change the bit length of
7952 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
7953
7954 2012-03-24 Eli Zaretskii <eliz@gnu.org>
7955
7956 * s/ms-w32.h (tzname): Include time.h before redirecting to
7957 _tzname. Fixes the MSVC build. (Bug#9960)
7958
7959 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
7960
7961 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
7962 characters.
7963
7964 * xterm.c (XTread_socket): Only modify handling_signal if
7965 !SYNC_INPUT. (Bug#11080)
7966
7967 2012-03-23 Eli Zaretskii <eliz@gnu.org>
7968
7969 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
7970 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
7971 when fetching a multibyte character consumes more bytes than
7972 CHAR_BYTES returns, due to unification of CJK characters in
7973 string_char. (Bug#11073)
7974
7975 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
7976
7977 * process.c (wait_reading_process_output): Handle pty disconnect
7978 by refraining from sending oneself a SIGCHLD (bug#10933).
7979
7980 2012-03-22 Chong Yidong <cyd@gnu.org>
7981
7982 * dispextern.h (struct it): New member string_from_prefix_prop_p.
7983
7984 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
7985 Mark string as coming from a prefix property.
7986 (handle_face_prop): Use default face for prefix strings (Bug#4281).
7987 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
7988
7989 2012-03-21 Chong Yidong <cyd@gnu.org>
7990
7991 * xfaces.c (Vface_remapping_alist): Doc fix.
7992
7993 2012-03-20 Eli Zaretskii <eliz@gnu.org>
7994
7995 * w32proc.c (Fw32_set_console_codepage)
7996 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
7997 Doc fixes.
7998
7999 2012-03-20 Chong Yidong <cyd@gnu.org>
8000
8001 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
8002 to reflect default non-nil value of redisplay-dont-pause.
8003
8004 2012-03-19 Kenichi Handa <handa@m17n.org>
8005
8006 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
8007 it fit in a valid range (Bug#11003).
8008
8009 2012-03-18 Eli Zaretskii <eliz@gnu.org>
8010
8011 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
8012 that is not from display property, accept the row as a "cursor
8013 row" if one of the string's character has a non-nil `cursor'
8014 property. Fixes cursor positioning when there are newlines in
8015 overlay strings, e.g. in icomplete.el. (Bug#11035)
8016
8017 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
8018
8019 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
8020
8021 2012-03-12 Chong Yidong <cyd@gnu.org>
8022
8023 * eval.c (inhibit_lisp_code): Rename from
8024 inhibit_window_configuration_change_hook; move from window.c.
8025
8026 * xfns.c (unwind_create_frame_1, Fx_create_frame):
8027 * window.c (run_window_configuration_change_hook)
8028 (syms_of_window): Callers changed.
8029
8030 2012-03-11 Chong Yidong <cyd@gnu.org>
8031
8032 * keymap.c (Fkey_description): Doc fix (Bug#9700).
8033
8034 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
8035
8036 2012-03-10 Chong Yidong <cyd@gnu.org>
8037
8038 * frame.c (other_visible_frames): Don't assume the selected frame
8039 is visible (Bug#10955).
8040
8041 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
8042
8043 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
8044
8045 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
8046
8047 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
8048 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
8049 zero (Bug#10954).
8050
8051 2012-03-03 Glenn Morris <rgm@gnu.org>
8052
8053 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
8054
8055 2012-03-02 Eli Zaretskii <eliz@gnu.org>
8056
8057 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
8058 position past the first glyph_row that ends at ZV. (Bug#10902)
8059 (redisplay_window, next_element_from_string): Fix typos in
8060 comments.
8061 (redisplay_window): Pass to move_it_vertically the margin in
8062 pixels, not in screen lines.
8063
8064 2012-03-02 Glenn Morris <rgm@gnu.org>
8065
8066 * buffer.c (buffer-list-update-hook): Doc fix.
8067
8068 2012-02-29 Eli Zaretskii <eliz@gnu.org>
8069
8070 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
8071 push_it before setting up the iterator for the first overlay
8072 string, even if we have an empty string loaded.
8073 (next_overlay_string): If there's an empty string on the iterator
8074 stack, pop the stack. (Bug#10903)
8075
8076 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
8077
8078 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
8079 Suggested by Stefan Monnier in
8080 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
8081 * alloc.c (widen_to_Lisp_Object): New static function.
8082 (mark_memory): Also mark Lisp_Objects by fetching pointer words
8083 and widening them to Lisp_Objects. This would work even if
8084 USE_LSB_TAG is defined and wide integers are used, which might
8085 happen in a future version of Emacs.
8086
8087 2012-02-25 Chong Yidong <cyd@gnu.org>
8088
8089 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
8090 Doc fix.
8091
8092 * xselect.c (Fx_selection_exists_p): Doc fix.
8093 (x_clipboard_manager_save_all): Print an informative message
8094 before saving to clipboard manager.
8095
8096 2012-02-24 Chong Yidong <cyd@gnu.org>
8097
8098 * keyboard.c (process_special_events): Handle all X selection
8099 requests in kbd_buffer, not just the next one (Bug#8869).
8100
8101 2012-02-23 Chong Yidong <cyd@gnu.org>
8102
8103 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
8104 call when setting menu-bar-lines and tool-bar-lines parameters.
8105 (unwind_create_frame_1): New helper function.
8106
8107 * window.c (inhibit_window_configuration_change_hook): New var.
8108 (run_window_configuration_change_hook): Obey it.
8109 (syms_of_window): Initialize it.
8110
8111 2012-02-22 Chong Yidong <cyd@gnu.org>
8112
8113 * xterm.c (x_draw_image_relief): Add missing type check for
8114 Vtool_bar_button_margin (Bug#10743).
8115
8116 2012-02-21 Chong Yidong <cyd@gnu.org>
8117
8118 * fileio.c (Vfile_name_handler_alist): Doc fix.
8119
8120 * buffer.c (Fget_file_buffer): Protect against invalid file
8121 handler return value.
8122
8123 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
8124
8125 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
8126 when computing $valmask.
8127
8128 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
8129 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
8130 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
8131 It's useless in that case, and it can cause problems on hosts
8132 that allocate halves of EMACS_INT values separately.
8133 Reported by Dan Horák. Diagnosed by Andreas Schwab in
8134 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
8135 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
8136 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
8137 it avoids undefined behavior on hosts where shifting right by more
8138 than the word width has undefined behavior.
8139
8140 2012-02-19 Chong Yidong <cyd@gnu.org>
8141
8142 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
8143 (Funhandled_file_name_directory, Ffile_name_as_directory)
8144 (Fdirectory_file_name, Fexpand_file_name)
8145 (Fsubstitute_in_file_name): Protect against invalid file handler
8146 return values (Bug#10845).
8147
8148 2012-02-18 Eli Zaretskii <eliz@gnu.org>
8149
8150 * .gdbinit (pitx): Fix incorrect references to fields of the
8151 iterator stack.
8152
8153 2012-02-17 Chong Yidong <cyd@gnu.org>
8154
8155 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
8156
8157 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
8158
8159 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
8160 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
8161
8162 2012-02-15 Chong Yidong <cyd@gnu.org>
8163
8164 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
8165 marked as special. Also, starting docstrings with * is obsolete.
8166
8167 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
8168
8169 * gnutls.c (emacs_gnutls_write): Fix last change.
8170
8171 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
8172
8173 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
8174 send_process.
8175
8176 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
8177
8178 * keymap.c (Fsingle_key_description): Handle char ranges.
8179
8180 2012-02-12 Chong Yidong <cyd@gnu.org>
8181
8182 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
8183 as that creates a dangerous corner case.
8184
8185 * window.c (Fdelete_window_internal): Invalidate the mouse
8186 highlight (Bug#9904).
8187
8188 2012-02-12 Glenn Morris <rgm@gnu.org>
8189
8190 * xselect.c (Fx_own_selection_internal)
8191 (Fx_get_selection_internal, Fx_disown_selection_internal)
8192 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
8193 * nsselect.m (Fx_own_selection_internal)
8194 (Fx_disown_selection_internal, Fx_selection_exists_p)
8195 (Fx_selection_owner_p, Fx_get_selection_internal):
8196 Sync docs and argument specs with the xselect.c versions.
8197
8198 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
8199
8200 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
8201
8202 2012-02-11 Eli Zaretskii <eliz@gnu.org>
8203
8204 * w32select.c (Fx_selection_exists_p): Sync doc string and
8205 argument list with xselect.c. (Bug#10783)
8206
8207 * w16select.c (Fx_selection_exists_p): Sync doc string and
8208 argument list with xselect.c. (Bug#10783)
8209
8210 2012-02-10 Glenn Morris <rgm@gnu.org>
8211
8212 * fns.c (Fsecure_hash): Doc fix.
8213
8214 2012-02-09 Kenichi Handa <handa@m17n.org>
8215
8216 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
8217
8218 2012-02-07 Chong Yidong <cyd@gnu.org>
8219
8220 * buffer.c (Fbuffer_local_variables)
8221 (buffer_lisp_local_variables): Handle unbound vars correctly;
8222 don't let Qunbound leak into Lisp.
8223
8224 2012-02-07 Glenn Morris <rgm@gnu.org>
8225
8226 * image.c (Fimagemagick_types): Doc fix.
8227
8228 * image.c (imagemagick-render-type): Change it from a lisp object
8229 to an integer. Move the doc here from the lisp manual.
8230 Treat all values not equal to 0 the same.
8231
8232 2012-02-06 Chong Yidong <cyd@gnu.org>
8233
8234 * doc.c (store_function_docstring): Avoid applying docstring of
8235 alias to base function (Bug#2603).
8236
8237 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
8238
8239 * .gdbinit (pp1, pv1): Remove redundant defines.
8240 (pr): Use pp.
8241
8242 2012-02-04 Chong Yidong <cyd@gnu.org>
8243
8244 * nsterm.m: Declare a global (Bug#10694).
8245
8246 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8247
8248 * w32.c (get_emacs_configuration_options):
8249 Include --enable-checking, if specified, in the return value.
8250
8251 2012-02-04 Martin Rudalics <rudalics@gmx.at>
8252
8253 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
8254 after rounding frame sizes. (Bug#9723)
8255
8256 2012-02-04 Eli Zaretskii <eliz@gnu.org>
8257
8258 * keyboard.c (adjust_point_for_property): Don't position point
8259 before BEGV. (Bug#10696)
8260
8261 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
8262
8263 Handle overflow when computing char display width (Bug#9496).
8264 * character.c (char_width): Return EMACS_INT, not int.
8265 (char_width, c_string_width): Check for overflow when
8266 computing the width; this is possible now that individual
8267 characters can have unbounded width. Problem introduced
8268 by merge from Emacs 23 on 2012-01-19.
8269
8270 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
8271
8272 * dbusbind.c (Fdbus_register_method): Mention the return value
8273 :ignore in the docstring.
8274
8275 2012-02-02 Glenn Morris <rgm@gnu.org>
8276
8277 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
8278
8279 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8280 Unconditionally set to t. (Bug#10673)
8281 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8282 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8283 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
8284
8285 2012-02-02 Kenichi Handa <handa@m17n.org>
8286
8287 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
8288 0, do not call append_composite_glyph.
8289
8290 2012-02-02 Kenichi Handa <handa@m17n.org>
8291
8292 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
8293 NULL (Bug#6988).
8294 (x_produce_glyphs): If the component of a composition is a null
8295 string, set it->pixel_width to 1 to avoid zero-width glyph.
8296
8297 2012-02-01 Eli Zaretskii <eliz@gnu.org>
8298
8299 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
8300 first 2 arguments are identical. This makes inserting large
8301 output from a subprocess an order of magnitude faster on
8302 MS-Windows, where all sbrk'ed memory is always contiguous.
8303
8304 2012-01-31 Glenn Morris <rgm@gnu.org>
8305
8306 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
8307 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
8308 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
8309
8310 2012-01-29 Glenn Morris <rgm@gnu.org>
8311
8312 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
8313
8314 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
8315
8316 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
8317
8318 2012-01-28 Chong Yidong <cyd@gnu.org>
8319
8320 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
8321
8322 2012-01-26 Chong Yidong <cyd@gnu.org>
8323
8324 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
8325
8326 * search.c (Fsearch_forward, Fsearch_backward): Document negative
8327 repeat counts (Bug#10507).
8328
8329 2012-01-26 Glenn Morris <rgm@gnu.org>
8330
8331 * lread.c (syms_of_lread): Doc fix.
8332
8333 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
8334
8335 * coding.c (encode_designation_at_bol): Change return value to
8336 EMACS_INT.
8337
8338 2012-01-25 Chong Yidong <cyd@gnu.org>
8339
8340 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
8341
8342 2012-01-21 Chong Yidong <cyd@gnu.org>
8343
8344 * floatfns.c (Fcopysign): Make the second argument non-optional,
8345 since nil is not allowed anyway.
8346
8347 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
8348
8349 * process.c (read_process_output): Use p instead of XPROCESS (proc).
8350 (send_process): Likewise.
8351
8352 2012-01-19 Martin Rudalics <rudalics@gmx.at>
8353
8354 * window.c (save_window_save, Fcurrent_window_configuration)
8355 (Vwindow_persistent_parameters): Do not use Qstate.
8356 Rewrite doc-strings.
8357
8358 2012-01-19 Kenichi Handa <handa@m17n.org>
8359
8360 * character.c (char_width): New function.
8361 (Fchar_width, c_string_width, lisp_string_width):
8362 Use char_width (Bug#9496).
8363
8364 2012-01-16 Martin Rudalics <rudalics@gmx.at>
8365
8366 * window.c (Vwindow_persistent_parameters): New variable.
8367 (Fset_window_configuration, save_window_save): Handle persistent
8368 window parameters.
8369
8370 2012-01-14 Eli Zaretskii <eliz@gnu.org>
8371
8372 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
8373 thrashing the stack of the thread. (Bug#9087)
8374
8375 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
8376
8377 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
8378
8379 2012-01-11 Eli Zaretskii <eliz@gnu.org>
8380
8381 * xdisp.c (rows_from_pos_range): Handle the case where the
8382 highlight ends on a newline. (Bug#10464)
8383 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
8384 he end column for display of highlight that ends on a newline
8385 before a R2L line.
8386
8387 2012-01-11 Glenn Morris <rgm@gnu.org>
8388
8389 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
8390 from load-path also when installation-directory is nil. (Bug#10208)
8391
8392 2012-01-10 Glenn Morris <rgm@gnu.org>
8393
8394 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
8395
8396 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
8397 Update template values to be closer to their typical values these days.
8398
8399 2012-01-09 Eli Zaretskii <eliz@gnu.org>
8400
8401 * xdisp.c (rows_from_pos_range): Accept additional argument
8402 DISP_STRING, and accept any glyph in a row whose object is that
8403 string as eligible for mouse highlight. Fixes mouse highlight of
8404 display strings from overlays. (Bug#10464)
8405
8406 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
8407
8408 emacs: fix an auto-save permissions race condition (Bug#10400)
8409 * fileio.c (auto_saving_dir_umask): New static var.
8410 (Fmake_directory_internal): Use it.
8411 (do_auto_save_make_dir): Set it, instead of invoking chmod after
8412 creating the directory. The old code temporarily assigns
8413 too-generous permissions to the directory.
8414 (do_auto_save_eh): Clear it.
8415 (Fdo_auto_save): Catch all errors, not just file errors, so
8416 that the var is always cleared.
8417
8418 2012-01-07 Eli Zaretskii <eliz@gnu.org>
8419
8420 * search.c (scan_buffer): Pass character positions to
8421 know_region_cache, not byte positions. (Bug#6540)
8422
8423 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
8424
8425 * w32.c (sys_rename): Report EXDEV when rename of a directory
8426 fails because the target is on another logical disk. (Bug#10284)
8427
8428 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
8429
8430 * xterm.c (x_embed_request_focus): New function.
8431
8432 * xterm.h: Add prototype.
8433
8434 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
8435
8436 2012-01-05 Glenn Morris <rgm@gnu.org>
8437
8438 * emacs.c (emacs_copyright): Update short copyright year to 2012.
8439
8440 2012-01-01 Eli Zaretskii <eliz@gnu.org>
8441
8442 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
8443 Load gnutls_transport_set_lowat only if GnuTLS version is below
8444 2.11.1.
8445 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
8446 GnuTLS versions below 2.11.1.
8447
8448 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
8449
8450 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
8451 to the doc string advising against its use for altering the way
8452 windows are scrolled.
8453
8454 2011-12-28 Kenichi Handa <handa@m17n.org>
8455
8456 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
8457 coding-system ASCII compatible only when it does not produce BOM
8458 on encoding (Bug#10383).
8459
8460 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
8461
8462 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
8463 can scroll.
8464 (create_and_show_popup_menu): Always use menu_position_func for
8465 Gtk3 (Bug#10361).
8466
8467 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
8468
8469 * callint.c (Fcall_interactively): Don't truncate prompt string.
8470
8471 2011-12-23 Eli Zaretskii <eliz@gnu.org>
8472
8473 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
8474 property that ends at ZV, so that the bidi iteration could be
8475 resumed from there (after widening). (Bug#10360)
8476
8477 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
8478
8479 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
8480
8481 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
8482
8483 * nsterm.m (x_free_frame_resources):
8484 Release f->output_data.ns->miniimage.
8485 (ns_index_color): Fix indentation. Do not retain
8486 color_table->colors[i].
8487
8488 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
8489 before returning.
8490
8491 * nsfns.m (x_set_background_color): Assign return value from
8492 ns_index_color to face-background instead of NSColor*.
8493 (ns_implicitly_set_icon_type): Fix indentation.
8494 Change assignment in for loop to comparison.
8495
8496 * emacs.c (ns_pool): New variable.
8497 (main): Assign ns_pool.
8498 (Fkill_emacs): Call ns_release_autorelease_pool.
8499
8500 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
8501 autorelease fdesc, release fdAttrs and tdict.
8502 (ns_get_covering_families): Release charset.
8503 (ns_findfonts): Release NSFontDescriptor created with new.
8504 (ns_uni_to_glyphs): Fix indentation.
8505 (setString): Release attrStr before assigning new value.
8506
8507 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8508
8509 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
8510 and NS_IMPL_COCOA.
8511 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
8512 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
8513
8514 2011-12-18 David Reitter <reitter@cmu.edu>
8515
8516 * nsterm.m (ns_term_init): Subscribe for notifications
8517 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
8518 to method trackingNotification in EmacsMenu.
8519
8520 * nsmenu.m (trackingMenu): New variable.
8521 (trackingNotification): New method (from Aquamacs).
8522 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
8523 from Aquamacs (Bug#7030).
8524
8525 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
8526
8527 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
8528 (symbol_to_nsstring): Fix indentation.
8529 (ns_symbol_to_pb): New function.
8530 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
8531 (Fns_rotate_cut_buffers_internal): Remove.
8532 (Fns_store_selection_internal): Rename from
8533 Fns_store_cut_buffer_internal.
8534 (ns_get_foreign_selection, Fx_own_selection_internal)
8535 (Fx_disown_selection_internal, Fx_selection_exists_p)
8536 (Fns_get_selection_internal, Fns_store_selection_internal):
8537 Use ns_symbol_to_pb and check if return value is nil.
8538 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
8539 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
8540 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
8541 renamed to Sns_store_selection_internal.
8542 (ns_handle_selection_request): Move code to Fx_own_selection_internal
8543 and remove this function.
8544 (ns_handle_selection_clear): Remove, never used.
8545 (Fx_own_selection_internal): Move code from ns_handle_selection_request
8546 here.
8547
8548 2011-12-17 Ken Brown <kbrown@cornell.edu>
8549
8550 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
8551 GID is unknown (Bug#10257).
8552
8553 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
8554
8555 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
8556 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
8557 which caused a build failure on GNU/Linux IA-64. This problem was
8558 introduced by my 2011-10-07 patch.
8559
8560 2011-12-15 Juri Linkov <juri@jurta.org>
8561
8562 * image.c (imagemagick_error): New function. (Bug#10112)
8563 (imagemagick_load_image): Comment out `MagickSetResolution' call.
8564 Use `imagemagick_error' where ImageMagick functions return
8565 `MagickFalse'.
8566 (Fimagemagick_types): Add `Fnreverse' to return the list in the
8567 proper order.
8568
8569 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8570
8571 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
8572 fill background (Bug#8992).
8573
8574 2011-12-13 Martin Rudalics <rudalics@gmx.at>
8575
8576 * window.c (Vwindow_combination_resize)
8577 (Vwindow_combination_limit): Use t instead of non-nil in
8578 doc-strings.
8579 (Vrecenter_redisplay): Add first sentence of doc-string on
8580 separate line.
8581 (Frecenter): Fix doc-string typo.
8582
8583 2011-12-11 Kenichi Handa <handa@m17n.org>
8584
8585 * coding.c (Funencodable_char_position): Pay attention to the
8586 buffer text relocation (Bug#9389).
8587
8588 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8589
8590 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
8591 gtk_init (Bug#10100).
8592
8593 2011-12-10 Eli Zaretskii <eliz@gnu.org>
8594
8595 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
8596 IT->string is nil. (Bug#10263)
8597
8598 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
8599
8600 * nsterm.h (x_free_frame_resources): Declare.
8601
8602 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
8603 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
8604
8605 * nsterm.h (ns_get_defaults_value): Declare.
8606
8607 * nsterm.m (ns_default): Call ns_get_defaults_value.
8608
8609 2011-12-09 Eli Zaretskii <eliz@gnu.org>
8610
8611 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
8612 (Bug#10170)
8613
8614 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8615
8616 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
8617 that where the value of an _OBJC_* symbol points to is in the .bss
8618 section (Bug#10240).
8619
8620 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8621
8622 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
8623 after the loop to call ccl_driver at least once (Bug#8619).
8624
8625 2011-12-08 Kenichi Handa <handa@m17n.org>
8626
8627 * ftfont.c (get_adstyle_property): Fix previous change
8628 (Bug#10233).
8629
8630 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
8631
8632 * w32.c (init_environment): If no_site_lisp, remove site-lisp
8633 dirs from the default value of EMACSLOADPATH (bug#10208).
8634
8635 2011-12-07 Glenn Morris <rgm@gnu.org>
8636
8637 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
8638 installation and source directories as well. (Bug#10208)
8639
8640 2011-12-06 Chong Yidong <cyd@gnu.org>
8641
8642 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
8643
8644 2011-12-06 Glenn Morris <rgm@gnu.org>
8645
8646 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
8647 as an error, not just -1. (Bug#10217)
8648
8649 2011-12-05 Chong Yidong <cyd@gnu.org>
8650
8651 * keyboard.c (process_special_events): New function.
8652 (swallow_events, Finput_pending_p): Use it (Bug#10195).
8653
8654 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
8655
8656 * coding.c (encode_designation_at_bol): Don't use uninitialized
8657 local variable (Bug#9318).
8658
8659 2011-12-05 Kenichi Handa <handa@m17n.org>
8660
8661 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
8662 return Qnil (Bug#8046, Bug#10193).
8663
8664 2011-12-05 Kenichi Handa <handa@m17n.org>
8665
8666 * coding.c (encode_designation_at_bol): New args charbuf_end and
8667 dst. Return the number of produced bytes. Callers changed.
8668 (coding_set_source): Return how many bytes coding->source was
8669 relocated.
8670 (coding_set_destination): Return how many bytes
8671 coding->destination was relocated.
8672 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
8673 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
8674
8675 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
8676
8677 * coding.c (CODING_CHAR_CHARSET_P): New macro.
8678 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
8679 macro (Bug#9318).
8680
8681 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
8682
8683 The following changes are to fix Bug#9318.
8684
8685 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
8686 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
8687 (encode_coding_iso_2022, encode_coding_sjis)
8688 (encode_coding_big5, encode_coding_charset): Use the above macros.
8689
8690 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
8691
8692 * lisp.h (process_quit_flag): Fix external declaration.
8693
8694 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
8695
8696 Don't macro-inline non-performance-critical code.
8697 * eval.c (process_quit_flag): New function.
8698 * lisp.h (QUIT): Use it.
8699
8700 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
8701
8702 * nsfns.m (get_geometry_from_preferences): New function.
8703 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
8704
8705 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
8706
8707 * emacs.c (Qkill_emacs): Define.
8708 (syms_of_emacs): Initialize it.
8709 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
8710 Qquit_flag to `kill-emacs' instead.
8711 (quit_throw_to_read_char): Add parameter `from_signal'.
8712 All callers changed. Call Fkill_emacs if requested and safe.
8713 * lisp.h (QUIT): Call Fkill_emacs if requested.
8714
8715 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
8716
8717 * widget.c (update_wm_hints): Return if wmshell is null.
8718 (widget_update_wm_size_hints): New function.
8719
8720 * widget.h (widget_update_wm_size_hints): Declare.
8721
8722 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
8723 widget_update_wm_size_hints (Bug#10104).
8724
8725 2011-12-03 Eli Zaretskii <eliz@gnu.org>
8726
8727 * xdisp.c (handle_invisible_prop): If the invisible text ends just
8728 before a newline, prepare the bidi iterator for consuming the
8729 newline, and keep the current paragraph direction. (Bug#10183)
8730 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
8731
8732 2011-12-02 Juri Linkov <juri@jurta.org>
8733
8734 * search.c (Fword_search_regexp): New Lisp function created from
8735 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
8736 (Fword_search_backward, Fword_search_forward)
8737 (Fword_search_backward_lax, Fword_search_forward_lax):
8738 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
8739 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
8740
8741 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
8742
8743 * fileio.c (Finsert_file_contents): Move after-change-function call
8744 to before the "handled:" label, since all "goto handled" appear in
8745 cases where the *-change-functions have already been properly called
8746 (bug#10117).
8747
8748 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
8749
8750 * keyboard.c (interrupt_signal): Don't call kill-emacs when
8751 waiting for input. (Bug#10169)
8752
8753 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8754
8755 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
8756 verifies glyph row's hash code--we have just reallocated the
8757 glyphs, so their contents can be complete garbage. (Bug#10164)
8758
8759 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
8760
8761 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
8762
8763 2011-11-30 Eli Zaretskii <eliz@gnu.org>
8764
8765 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
8766 attributes are tested _before_ calling verify_row_hash, to protect
8767 against GCC re-ordering of the tests. (Bug#10164)
8768
8769 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
8770
8771 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
8772
8773 * xterm.c (handle_one_xevent): Only set async_visible and friends
8774 if net_wm_state_hidden_seen is non-zero (Bug#10002)
8775 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
8776 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
8777
8778 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
8779
8780 Remove GCPRO-related macros that exist only to avoid shadowing locals.
8781 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
8782 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
8783 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8784 All uses changed to use GCPRO1 etc.
8785 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
8786 Revert to old implementation (i.e., before 2011-03-11).
8787
8788 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8789
8790 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
8791 of scroll runs so as to avoid assigning disabled bogus rows and
8792 unnecessary graphics copy operations.
8793
8794 2011-11-27 Eli Zaretskii <eliz@gnu.org>
8795
8796 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
8797 (snprintf) [_MSC_VER]: Redirect to _snprintf.
8798 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
8799 (malloc, free, realloc, calloc): Redirect to e_* only when
8800 compiling Emacs.
8801
8802 * lisp.h (GCTYPEBITS): Move before first use.
8803 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
8804 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
8805 this macro definition.
8806
8807 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
8808 _MSC_VER.
8809
8810 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
8811
8812 * gtkutil.c (xg_create_frame_widgets):
8813 Call gtk_window_set_has_resize_grip (FALSE) if that function is
8814 present with Gtk+ 2.0.
8815
8816 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8817
8818 * fileio.c (Finsert_file_contents): Undo previous change; see
8819 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
8820
8821 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
8822
8823 Rename locals to avoid shadowing.
8824 * fileio.c (Finsert_file_contents):
8825 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
8826 * process.c (wait_reading_process_output):
8827 Rename inner 'proc' to 'p' to avoid shadowing.
8828 Indent for consistency with usual Emacs style.
8829
8830 2011-11-25 Eli Zaretskii <eliz@gnu.org>
8831
8832 * xdisp.c (redisplay_window): If cursor row is not fully visible
8833 after recentering, and scroll-conservatively is set to a large
8834 number, scroll window by a few more lines to make the cursor fully
8835 visible and out of scroll-margin. (Bug#10105)
8836 (start_display): Don't move to the next line if the display should
8837 start at a newline that is part of a display vector or an overlay
8838 string. (Bug#10119)
8839
8840 2011-11-24 Juri Linkov <juri@jurta.org>
8841
8842 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
8843 after the `MagickPingImage' call. (Bug#10112)
8844
8845 2011-11-23 Chong Yidong <cyd@gnu.org>
8846
8847 * window.c (Fcoordinates_in_window_p): Accept only live windows.
8848
8849 2011-11-23 Martin Rudalics <rudalics@gmx.at>
8850
8851 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
8852 making another buffer current. (Bug#10114)
8853
8854 2011-11-23 Glenn Morris <rgm@gnu.org>
8855
8856 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
8857
8858 2011-11-23 Chong Yidong <cyd@gnu.org>
8859
8860 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
8861 using it (Bug#5984).
8862
8863 2011-11-22 Eli Zaretskii <eliz@gnu.org>
8864
8865 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
8866 and header-lines, as they don't have one computed for them.
8867 (Bug#10098)
8868
8869 * .gdbinit (prow): Make displayed values more self-explaining.
8870 Add row's hash code.
8871
8872 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
8873
8874 * process.c (wait_reading_process_output): Fix asynchrounous
8875 GnuTLS socket handling on some versions of the GnuTLS library.
8876 (wait_reading_process_output): Add comment and URL.
8877
8878 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
8879
8880 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
8881
8882 2011-11-21 Chong Yidong <cyd@gnu.org>
8883
8884 * window.c (Fnext_window, Fprevious_window): Doc fix.
8885
8886 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8887
8888 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
8889
8890 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8891
8892 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
8893
8894 2011-11-20 Martin Rudalics <rudalics@gmx.at>
8895
8896 * window.c (Fset_window_combination_limit): Rename argument
8897 STATUS to LIMIT.
8898 (Vwindow_combination_limit): Remove "status" from doc-string.
8899
8900 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
8901
8902 * m/ibms390.h: Remove.
8903 * m/ibms390x.h: Don't include "ibms390.h".
8904
8905 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
8906
8907 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
8908 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
8909
8910 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
8911
8912 * casetab.c (Fset_case_table):
8913 * charset.c (Fcharset_after): Fix typos.
8914
8915 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
8916
8917 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
8918 Otherwise, valgrind does not work on some platforms.
8919 Problem reported by Andreas Schwab in
8920 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
8921 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
8922 is set, removing the need for VIRT_ADDRESS_VARIES.
8923 (PURE_P): Use a more-efficient implementation that needs just one
8924 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
8925 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
8926 to 4 (xorl, subq, cmpq, setbe).
8927 * alloc.c (pure): Always extern now, since that's the
8928 VIRT_ADDR_VARIES behavior.
8929 (PURE_POINTER_P): Use a single comparison, not two, for
8930 consistency with the new puresize.h.
8931 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
8932 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
8933 Remove VIRT_ADDR_VARIES no longer needed.
8934
8935 2011-11-19 Eli Zaretskii <eliz@gnu.org>
8936
8937 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
8938 (erase_phys_cursor, update_window_cursor, show_mouse_face)
8939 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
8940 behave as if the cursor position were at the window margin.
8941
8942 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
8943 and the cursor position is out of bounds, behave as if the cursor
8944 position were at the window margin. (Bug#10075)
8945
8946 2011-11-18 Chong Yidong <cyd@gnu.org>
8947
8948 * window.c (Fwindow_combination_limit): Make first argument
8949 non-optional, since it is meaningless for live windows like the
8950 selected window.
8951
8952 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
8953
8954 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
8955
8956 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
8957
8958 * intervals.c: Fix grafting over the whole buffer (bug#10071).
8959 (graft_intervals_into_buffer): Simplify.
8960
8961 2011-11-18 Eli Zaretskii <eliz@gnu.org>
8962
8963 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
8964 hash values of the two rows.
8965 (copy_row_except_pointers): Preserve the used[] arrays and the
8966 hash values of the two rows. (Bug#10035)
8967 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
8968
8969 * xdisp.c (row_hash): New function, body extracted from
8970 compute_line_metrics.
8971 (compute_line_metrics): Call row_hash, instead of computing the
8972 hash code inline.
8973
8974 * dispnew.c (verify_row_hash): Call row_hash for computing the
8975 hash code of a row, instead of duplicating code from xdisp.c.
8976
8977 * dispextern.h (row_hash): Add prototype.
8978
8979 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
8980
8981 * frame.c (delete_frame): Don't delete the terminal when the last
8982 X frame is closed if emacs is built with GTK toolkit.
8983
8984 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
8985
8986 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
8987
8988 2011-11-17 Martin Rudalics <rudalics@gmx.at>
8989
8990 * window.c (Vwindow_splits): Rename to
8991 Vwindow_combination_resize. Suggested by Juri Linkov.
8992 (Fsplit_window_internal): Use Vwindow_combination_resize instead
8993 of Vwindow_splits.
8994
8995 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
8996
8997 * nsfns.m (Fns_font_name):
8998 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
8999
9000 2011-11-16 Martin Rudalics <rudalics@gmx.at>
9001
9002 * window.h (window): Rename slot "nest" to "combination_limit".
9003 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
9004 (Fset_window_nest): Rename to Fset_window_combination_limit.
9005 (Vwindow_nest): Rename to Vwindow_combination_limit.
9006 (recombine_windows, make_parent_window, make_window)
9007 (Fsplit_window_internal, saved_window)
9008 (Fset_window_configuration, save_window_save): Rename all
9009 occurrences of window_nest to window_combination_limit.
9010
9011 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
9012
9013 * image.c (imagemagick_load_image): Fix typo.
9014
9015 2011-11-14 Eli Zaretskii <eliz@gnu.org>
9016
9017 * xdisp.c (display_line): Move the call to
9018 highlight_trailing_whitespace before the call to
9019 compute_line_metrics, since the latter needs to see the final
9020 faces of all the glyphs to compute ROW's hash value.
9021 Fixes assertion violations in row_equal_p. (Bug#10035)
9022
9023 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
9024
9025 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
9026 just return (bug#10044).
9027
9028 2011-11-12 Eli Zaretskii <eliz@gnu.org>
9029
9030 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
9031 with user-defined heap size. Bump the default size of the temacs
9032 heap to 27MB, to avoid memory warning when running temacs.
9033 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
9034
9035 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
9036 current_matrix and desired_matrix. (Bug#9990)
9037 (verify_row_hash) [XASSERTS]: New function.
9038 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
9039 that the hash value of glyph rows is correct.
9040
9041 2011-11-12 Martin Rudalics <rudalics@gmx.at>
9042
9043 * window.h (window): Remove splits slot.
9044 * window.c (Fwindow_splits, Fset_window_splits): Remove.
9045 (Fdelete_other_windows_internal, make_parent_window)
9046 (make_window, Fsplit_window_internal, Fdelete_window_internal)
9047 (Fset_window_configuration, save_window_save): Don't deal with
9048 split status of windows.
9049 (saved_window): Remove splits slot.
9050 (Vwindow_splits): Rewrite doc-string.
9051
9052 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
9053
9054 * xfns.c (unwind_create_frame):
9055 * nsfns.m (unwind_create_frame):
9056 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
9057 Vframe_list (Bug#9999).
9058
9059 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
9060
9061 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
9062
9063 2011-11-11 Kenichi Handa <handa@m17n.org>
9064
9065 * callproc.c (Fcall_process): Set the member dst_multibyte of
9066 process_coding.
9067
9068 2011-11-11 Johan Bockgård <bojohan@gnu.org>
9069
9070 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
9071 avoid a crash (bug#9496).
9072
9073 2011-11-09 Chong Yidong <cyd@gnu.org>
9074
9075 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
9076 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
9077
9078 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9079
9080 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
9081
9082 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
9083
9084 Avoid some portability problems by eschewing 'extern inline' functions.
9085 The trivial performance wins aren't worth the portability hassles; see
9086 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
9087 et seq.
9088 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9089 (window_box_width, window_box_left, window_box_left_offset)
9090 (window_box_right, window_box_right_offset): Undo previous change,
9091 by removing the "extern"s.
9092 * intervals.c (adjust_intervals_for_insertion)
9093 (adjust_intervals_for_deletion): Undo previous change,
9094 making these static again.
9095 (offset_intervals, temp_set_point_both, temp_set_point)
9096 (copy_intervals_to_string): No longer inline.
9097 * xdisp.c (window_text_bottom_y, window_box_width)
9098 (window_box_height, window_box_left_offset)
9099 (window_box_right_offset, window_box_left, window_box_right)
9100 (window_box): No longer inline.
9101
9102 2011-11-08 Chong Yidong <cyd@gnu.org>
9103
9104 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
9105 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
9106 Signal an error if not a live window.
9107 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
9108 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
9109
9110 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
9111
9112 * lisp.h (syms_of_abbrev): Remove declaration.
9113 Reported by CHENG Gao <chenggao@royau.me>.
9114
9115 2011-11-07 Eli Zaretskii <eliz@gnu.org>
9116
9117 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
9118 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
9119 of temacs in GUI mode.
9120
9121 2011-11-07 Martin Rudalics <rudalics@gmx.at>
9122
9123 * window.h: Declare delete_all_child_windows instead of
9124 delete_all_subwindows.
9125 * window.c (Fwindow_nest, Fset_window_nest)
9126 (Fset_window_new_total, Fset_window_new_normal)
9127 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
9128 (delete_all_subwindows): Rename to delete_all_child_windows.
9129 (Fdelete_other_windows_internal, Fset_window_configuration):
9130 Call delete_all_child_windows instead of delete_all_subwindows.
9131 * frame.c (delete_frame): Call delete_all_child_windows instead
9132 of delete_all_subwindows.
9133
9134 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
9137 This is also needed for porting to any host where GC_MARK_STACK is
9138 not GC_MAKE_GCPROS_NOOPS.
9139 (which_symbols): Use it.
9140
9141 2011-11-07 Kenichi Handa <handa@m17n.org>
9142
9143 * coding.c (coding_set_destination): Check coding->src_pos only
9144 when coding->src_object is a buffer (bug#9910).
9145
9146 * process.c (send_process): Set the member src_multibyte of coding
9147 to 0 (bug#9911) when sending a unibyte text.
9148
9149 * callproc.c (Fcall_process): Set the member src_multibyte of
9150 process_coding to 0 (bug#9912).
9151
9152 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9153
9154 * xmenu.c (cleanup_widget_value_tree): New function.
9155 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
9156 calling free_menubar_widget_value_tree directly (Bug#9830).
9157
9158 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
9159
9160 Fix some portability problems with 'inline'.
9161 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
9162 (window_box_width, window_box_left, window_box_left_offset)
9163 (window_box_right, window_box_right_offset): Declare extern.
9164 Otherwise, these inline functions do not conform to C99 and
9165 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
9166 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
9167 * intervals.c (adjust_intervals_for_insertion)
9168 (adjust_intervals_for_deletion): Now extern, because otherwise the
9169 extern inline functions 'offset_intervals' couldn't refer to it.
9170 (static_offset_intervals): Remove.
9171 (offset_intervals): Rewrite using the old contents of
9172 static_offset_intervals. The old version didn't conform to C99
9173 because an extern inline function contained a reference to an
9174 identifier with static linkage.
9175
9176 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
9177
9178 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
9179 GC.
9180
9181 2011-11-06 Eli Zaretskii <eliz@gnu.org>
9182
9183 * xdisp.c (init_iterator, reseat_to_string): Don't set the
9184 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
9185 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
9186 return Qleft_to_right.
9187
9188 2011-11-06 Chong Yidong <cyd@gnu.org>
9189
9190 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
9191 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
9192 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
9193 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
9194 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
9195 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
9196 (Fwindow_vscroll): Doc fix.
9197 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
9198 argument, since it makes no sense to pass a live window and for
9199 consistency with window-child.
9200
9201 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
9202
9203 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
9204 support MSVC.
9205
9206 2011-11-05 Jason Rumney <jasonr@gnu.org>
9207
9208 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
9209 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
9210 fonts (Bug#6029).
9211 (add_font_entity_to_list): Fix logic errors in mixed boolean and
9212 bitwise arithmetic preventing use of unicode-sip and non-truetype
9213 opentype fonts.
9214
9215 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9216
9217 * s/ms-w32.h (fstat, stat, utime): Move redirections to
9218 "emacs"-only part.
9219
9220 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
9221 initialization code to keep similarity to xfns.c after changes
9222 from 2011-11-05.
9223
9224 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
9225
9226 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
9227 (unwind_create_frame): New function (Bug#9943).
9228 (Fx_create_frame): Restructure code to be more similar to the one in
9229 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
9230 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
9231 Move terminal->reference_count++ just before making the frame official
9232 (Bug#9943).
9233
9234 * nsterm.m (x_free_frame_resources): New function.
9235 (x_destroy_window): Move code to x_free_frame_resources.
9236
9237 * xfns.c (unwind_create_frame): Fix comment.
9238 (Fx_create_frame, x_create_tip_frame):
9239 Move terminal->reference_count++ just before making the frame
9240 official. Move initialization of image_cache_refcount and
9241 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
9242
9243 2011-11-05 Eli Zaretskii <eliz@gnu.org>
9244
9245 Support MSVC build with newer versions of Visual Studio.
9246 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
9247 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
9248 nt/gmake.defs.
9249
9250 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
9251 which are not supported by MSVC.
9252 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
9253 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
9254 bitfields.
9255 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
9256 types in bitfields.
9257 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
9258
9259 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
9260
9261 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
9262
9263 Support MSVC build with newer versions of Visual Studio.
9264 * w32.c: Don't include w32api.h for MSVC.
9265 (init_environment) [_MSC_VER]: Call sys_access, not _access.
9266
9267 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
9268 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
9269 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
9270 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
9271 e_* cousins.
9272 (alloca) [_MSC_VER]: Define to _alloca.
9273
9274 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
9275
9276 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
9277
9278 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9279
9280 * xdisp.c (note_mouse_highlight): If either of
9281 previous/next-single-property-change returns nil, treat that as
9282 the beginning or the end of the buffer. (Bug#9955)
9283
9284 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
9285
9286 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
9287 label is not null (Bug#9951).
9288 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
9289 may be NULL.
9290
9291 2011-11-04 Eli Zaretskii <eliz@gnu.org>
9292
9293 * window.c (Fwindow_body_size): Mention in the doc string that the
9294 return value is in frame's canonical units. (Bug#9949)
9295
9296 2011-11-03 Eli Zaretskii <eliz@gnu.org>
9297
9298 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
9299
9300 * w32fns.c (unwind_create_frame): If needed, free the glyph
9301 matrices of the partially constructed frame. (Bug#9943)
9302 * xfns.c (unwind_create_frame): Likewise.
9303
9304 2011-11-01 Eli Zaretskii <eliz@gnu.org>
9305
9306 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
9307 Don't stop backward scan on the continuation glyph, even though
9308 its CHARPOS is positive.
9309 (mouse_face_from_buffer_pos, note_mouse_highlight):
9310 Rename cover_string to disp_string.
9311
9312 2011-11-01 Martin Rudalics <rudalics@gmx.at>
9313
9314 * window.c (temp_output_buffer_show): Don't use
9315 Vtemp_buffer_show_specifiers.
9316 (Vtemp_buffer_show_specifiers): Remove unused variable.
9317
9318 2011-10-30 Eli Zaretskii <eliz@gnu.org>
9319
9320 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
9321 past the beginning of the current glyph matrix.
9322
9323 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
9324
9325 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
9326 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
9327 HAVE_GTK3 (Bug#9869).
9328
9329 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
9330 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
9331
9332 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
9333
9334 * xterm.c: Declare x_handle_net_wm_state to return int.
9335 (handle_one_xevent): Check if we are iconified but don't have
9336 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
9337 (get_current_wm_state): Return non-zero if not hidden,
9338 check for _NET_WM_STATE_HIDDEN (Bug#9893).
9339 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
9340 (x_handle_net_wm_state): Return what get_current_wm_state returns.
9341 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
9342
9343 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
9344
9345 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
9346 so that this new function doesn't get optimized away by a
9347 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
9348
9349 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9350
9351 * frame.h (MOUSE_HL_INFO): Remove excess parens.
9352
9353 2011-10-29 Eli Zaretskii <eliz@gnu.org>
9354
9355 Fix the `xbytecode' command.
9356 * .gdbinit (xprintbytestr): New command.
9357 (xwhichsymbols): Rename from `which'; all callers changed.
9358 (xbytecode): Print the byte-code string as well.
9359
9360 2011-10-29 Kim Storm <storm@cua.dk>
9361
9362 * alloc.c (which_symbols): New function.
9363
9364 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
9365
9366 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
9367 line. (Bug#9903)
9368
9369 2011-10-29 Glenn Morris <rgm@gnu.org>
9370
9371 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
9372 Not clear what it was for, and it causes various bugs. (Bug#9839)
9373
9374 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9375
9376 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
9377 possible random value that matches one of those tested as
9378 condition to clear the mouse face.
9379
9380 2011-10-28 Chong Yidong <cyd@gnu.org>
9381
9382 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
9383
9384 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
9385
9386 * window.c (make_window): Initialize phys_cursor_on_p.
9387
9388 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
9389
9390 * lisp.h (struct Lisp_Symbol): Update comments.
9391
9392 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
9393
9394 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
9395
9396 2011-10-28 Eli Zaretskii <eliz@gnu.org>
9397
9398 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
9399 <oslsachem@gmail.com> for helping to debug this.
9400
9401 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
9402 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
9403 (g_b_init_get_glyph_outline_w): New static variables.
9404 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
9405 (GetGlyphOutlineW_Proc): New typedefs.
9406 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9407 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
9408 New functions.
9409 (w32font_open_internal, compute_metrics):
9410 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
9411 instead of calling the "wide" APIs directly.
9412
9413 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
9414
9415 * w32.h (syms_of_w32font): Add prototype.
9416
9417 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9418
9419 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
9420 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
9421 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
9422 (Fmove_to_window_line): Doc fix.
9423
9424 2011-10-27 Chong Yidong <cyd@gnu.org>
9425
9426 * process.c (make_process): Set gnutls_state to NULL.
9427
9428 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
9429 non-NULL, regardless of GNUTLS_INITSTAGE.
9430 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
9431 an error. Set process slots as soon as we allocate them.
9432
9433 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
9434
9435 2011-10-27 Chong Yidong <cyd@gnu.org>
9436
9437 * gnutls.c (emacs_gnutls_deinit): New function.
9438 Deallocate credentials structures as well as calling gnutls_deinit.
9439 (Fgnutls_deinit, Fgnutls_boot): Use it.
9440
9441 * process.c (make_process): Initialize GnuTLS credentials to NULL.
9442 (deactivate_process): Call emacs_gnutls_deinit.
9443
9444 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
9445
9446 * image.c (x_create_x_image_and_pixmap):
9447 * w32.c (sys_rename, w32_delayed_load):
9448 * w32font.c (fill_in_logfont):
9449 * w32reg.c (x_get_string_resource): Silence compiler warnings.
9450
9451 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
9452
9453 * w32fns.c (w32_default_color_map): New function,
9454 extracted from Fw32_default_color_map.
9455 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
9456
9457 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
9458
9459 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
9460
9461 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
9462
9463 * keyboard.c (test_undefined): New function (bug#9751).
9464 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
9465
9466 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
9467
9468 * sysdep.c (init_sys_modes): Fix the check for the controlling
9469 terminal (Bug#6649).
9470
9471 2011-10-20 Eli Zaretskii <eliz@gnu.org>
9472
9473 * dispextern.h (struct bidi_it): New member next_en_type.
9474
9475 * bidi.c (bidi_line_init): Initialize the next_en_type member.
9476 (bidi_resolve_explicit_1): When next_en_pos is valid for the
9477 current character, check also for next_en_type being WEAK_EN.
9478 (bidi_resolve_weak): Don't enter the expensive loop if the current
9479 position is before next_en_pos. Record the bidi type of the first
9480 non-ET, non-BN character we find, in addition to its position.
9481 (bidi_level_of_next_char): Invalidate next_en_type when
9482 next_en_pos is over-stepped.
9483
9484 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
9485
9486 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
9487 * editfns.c: Rewrite current-time-zone so that it invokes
9488 the equivalent of (format-time-string "%Z") to get the time zone name.
9489 This fixes a bug when the time zone name contains characters that
9490 need converting from the system time locale to Emacs internal format.
9491 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
9492 that patch fixed format-time-string to do the conversion, but
9493 I forgot to fix current-time-zone.
9494 (format_time_string): New function, containing most of
9495 what Fformat_time_string used to contain.
9496 (Fformat_time_string): Rewrite in terms of format_time_string.
9497 This doesn't change this function's behavior.
9498 (current-time-zone): Rewrite to use format_time_string.
9499 This fixes the bug reported by Michael Schierl in
9500 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
9501 Jason Rumney's 2007-06-07 change worked around this bug, but
9502 didn't fix it.
9503 * systime.h (tzname, timezone): Remove no-longer-used declarations.
9504
9505 2011-10-19 Eli Zaretskii <eliz@gnu.org>
9506
9507 * xdisp.c (start_display): If the character at POS is displayed
9508 via a display vector, reset IT->current.dpvec_index to zero.
9509 (try_window_reusing_current_matrix): If a line ends in a display
9510 vector or the next line starts in a display vector, continue
9511 redrawing the window even though the character position of
9512 start_row was reached.
9513 (Bug#9771, part 2)
9514
9515 2011-10-18 Chong Yidong <cyd@gnu.org>
9516
9517 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
9518 with nobreak-char-display too.
9519
9520 2011-10-18 Eli Zaretskii <eliz@gnu.org>
9521
9522 Fix part 3 of bug#9771.
9523 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
9524 (bidi_resolve_neutral): Don't enter the expensive loop looking for
9525 non-neutral characters if the current character is a paragraph
9526 separator (a.k.a. Newline). This avoids running the same
9527 expensive loop twice, once when we consume the preceding newline
9528 and the other time when the line actually needs to be displayed.
9529 Avoid the loop when we see neutrals on the base embedding level
9530 following a character whose directionality is the same as the
9531 paragraph's. This avoids running the expensive loop when a line
9532 ends in a long sequence of neutrals, like control characters.
9533 Add assertion against STRONG_AL type. Slightly rearrange code
9534 that determines the type of a neutral given the first non-neutral
9535 that follows it.
9536 (bidi_level_of_next_char): Set next_en_pos to zero when
9537 invalidating its info.
9538
9539 2011-10-17 Eli Zaretskii <eliz@gnu.org>
9540
9541 * xdisp.c (push_display_prop): Determine whether to record string
9542 or buffer position by IT->string, not by IT->method. Allow
9543 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
9544 (move_it_vertically_backward): Don't look for character position
9545 immediately after the newline when in a continuation line.
9546 (Bug#9771, part 1)
9547
9548 2011-10-15 Martin Rudalics <rudalics@gmx.at>
9549
9550 * window.c (coordinates_in_window): Rewrite and delabelize
9551 vertical border check. (Bug#5357) (Bug#9618)
9552
9553 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
9554
9555 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
9556 errors in XSetWindowBorder (bug#9310).
9557
9558 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
9559
9560 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
9561 avoid crash when xmalloc overrun checking is enabled.
9562
9563 2011-10-13 Eli Zaretskii <eliz@gnu.org>
9564
9565 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
9566 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
9567 cursor motion with <left> and <right> arrow keys.
9568
9569 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
9570 some callers set that themselves.
9571
9572 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9573
9574 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
9575 display string and the previous row comes from the same string and
9576 is empty. (Bug#9739) (Bug#9738)
9577
9578 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
9579
9580 * doc.c (get_doc_string): Encode file name (bug#9735).
9581
9582 2011-10-12 Eli Zaretskii <eliz@gnu.org>
9583
9584 * bidi.c (bidi_level_of_next_char):
9585 * xdisp.c (get_visually_first_element): Remove old incorrect
9586 comments regarding the Unicode Line Separator character.
9587
9588 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
9589
9590 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
9591
9592 * alloc.c (Fgc_status): Do not access beyond zombies array
9593 boundary if nzombies > MAX_ZOMBIES.
9594 * alloc.c (dump_zombies): Add missing format specifier.
9595
9596 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
9597
9598 * xdisp.c (set_cursor_from_row): Simplify conditionals,
9599 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
9600
9601 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
9602 Some packages use them to denote characters with modifiers.
9603
9604 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
9605
9606 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
9607 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
9608 matching a pp-number. Rename parameter var to var1.
9609
9610 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
9611
9612 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
9613
9614 2011-10-08 Glenn Morris <rgm@gnu.org>
9615
9616 * callint.c (Fcall_interactively): Give a more explicit error for the
9617 'c' case with a non-character input. (Bug#8479)
9618
9619 2011-10-08 Eli Zaretskii <eliz@gnu.org>
9620
9621 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
9622 lines.
9623 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
9624 lines that are hscrolled on the left.
9625
9626 * dispnew.c (buffer_posn_from_coords): Account for a possible
9627 presence of header-line. (Bug#4426)
9628
9629 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
9630
9631 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
9632 Don't advertise functionality which we discourage or doesn't work.
9633
9634 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
9635
9636 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
9637 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
9638 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
9639 this makes Emacs dump core during garbage collection on rare
9640 occasions. sizeof is obviously inferior to offsetof here, so
9641 stick with offsetof.
9642 (GC_POINTER_ALIGNMENT): New macro.
9643 (mark_memory): Omit 3rd (offset) arg; caller changed.
9644 Don't assume EMACS_INT alignment is the same as pointer alignment.
9645
9646 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
9647
9648 * keyboard.c (read_key_sequence_remapped): New var.
9649 (read_key_sequence): Compute remapping in the right buffer.
9650 (command_loop_1): Use read_key_sequence's remapping directly.
9651
9652 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
9653
9654 * dired.c (file_name_completion): Don't expand file name.
9655 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
9656 before checking file name handler.
9657
9658 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
9659 they've been requested explicitly (bug#9591).
9660
9661 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
9662
9663 * keymap.c (Fsingle_key_description): Use make_specified_string
9664 instead of build_string to build string from push_key_description.
9665 (Bug#5193)
9666
9667 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9668
9669 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
9670 This fixes a Y2038 bug on 64-bit hosts.
9671 * buffer.c (reset_buffer):
9672 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
9673 (Fclear_buffer_auto_save_failure):
9674 Use 0, not -1, to represent an unset failure time, since time_t
9675 might not be signed.
9676
9677 Remove dependency on glibc malloc internals.
9678 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9679 Move back here from lisp.h, but with their new implementations.
9680 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9681 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
9682 * charset.c (charset_table_init): New static var.
9683 (syms_of_charset): Use it instead of xmalloc. This removes a
9684 dependency on glibc malloc internals. See Eli Zaretskii's comment in
9685 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
9686 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9687 Move back to alloc.c.
9688 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9689 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
9690
9691 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
9692
9693 * nsterm.m (windowDidResize): Call x_set_window_size only when
9694 ns_in_resize is true. Otherwise set pixelwidth/height and
9695 call change_frame_size (Bug#9628).
9696
9697 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
9698
9699 Port --enable-checking=all to Fedora 14 x86-64.
9700 * charset.c (syms_of_charset): Also account for glibc malloc's
9701 internal overhead when calculating the initial malloc maximum.
9702
9703 Port --enable-checking=all to Fedora 14 x86.
9704 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9705 Move to lisp.h.
9706 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
9707 (overrun_check_realloc, overrun_check_free):
9708 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
9709 That way, xmalloc returns a properly-aligned pointer even if
9710 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
9711 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
9712 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
9713 into account when calculating the initial malloc maximum.
9714 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
9715 Move here from alloc.c, so that charset.c can use it too.
9716 Properly align; the old code wasn't right for common 32-bit hosts
9717 when configured with --enable-checking=all.
9718 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
9719 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
9720
9721 2011-09-29 Eli Zaretskii <eliz@gnu.org>
9722
9723 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
9724 use EDOM.
9725
9726 2011-09-28 Eli Zaretskii <eliz@gnu.org>
9727
9728 * xdisp.c (compute_display_string_end): If there's no display
9729 string at CHARPOS, return -1.
9730
9731 * bidi.c (bidi_fetch_char): When compute_display_string_end
9732 returns a negative value, treat the character as a normal
9733 character not covered by a display string. (Bug#9624)
9734
9735 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
9736
9737 * lread.c (Fread_from_string): Fix typo in docstring.
9738
9739 2011-09-27 Eli Zaretskii <eliz@gnu.org>
9740
9741 * xdisp.c (handle_invisible_prop): If invisible text ends on a
9742 newline, reseat the iterator instead of bidi-iterating there one
9743 character at a time. (Bug#9610)
9744 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
9745 TO_CHARPOS if the bidi iterator is at base embedding level.
9746
9747 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
9748
9749 * lread.c (readevalloop): Use correct code for NBSP.
9750 (read1): Likewise. (Bug#9608)
9751
9752 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
9753
9754 * dbusbind.c (Fdbus_register_signal): When service is not
9755 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
9756
9757 2011-09-25 Glenn Morris <rgm@gnu.org>
9758
9759 * buffer.c (truncate-lines): Doc fix.
9760
9761 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
9762
9763 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
9764 (Fset_window_next_buffers): Doc fix.
9765
9766 2011-09-24 Glenn Morris <rgm@gnu.org>
9767
9768 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
9769
9770 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
9771
9772 Fix minor problems found by static checking.
9773 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
9774 * indent.c (Fvertical_motion): Fix == vs = typo.
9775
9776 2011-09-24 Eli Zaretskii <eliz@gnu.org>
9777
9778 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
9779 Default value is now t. Doc fix.
9780
9781 * indent.c (Fvertical_motion): Compute and apply the overshoot
9782 logic when moving up, not only when moving down. Fix the
9783 confusing name and values of the it_overshoot_expected variable;
9784 logic changes accordingly. (Bug#9254) (Bug#9549)
9785
9786 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
9787 CHARPOS is covered by a display string which includes newlines.
9788 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
9789 is covered by a display string with embedded newlines.
9790
9791 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
9792
9793 * dbusbind.c (Fdbus_register_signal): Add match rule to
9794 Vdbus_registered_objects_table. (Bug#9581)
9795 (Fdbus_register_method, Vdbus_registered_objects_table):
9796 Fix docstring.
9797
9798 2011-09-24 Jim Meyering <meyering@redhat.com>
9799
9800 do not ignore write error for any output size
9801 The previous change was incomplete.
9802 While it makes emacs --batch detect the vast majority of stdout
9803 write failures, errors were still ignored whenever the output size is
9804 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
9805 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
9806 && echo FAIL: ignored write error
9807 FAIL: ignored write error
9808 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
9809 && echo FAIL: ignored write error
9810 FAIL: ignored write error
9811 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
9812
9813 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
9814
9815 * emacs.c (Fkill_emacs): In noninteractive mode exit
9816 non-successfully if a write error occurred on stdout. (Bug#9574)
9817
9818 2011-09-21 Eli Zaretskii <eliz@gnu.org>
9819
9820 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
9821 the xassert test.
9822
9823 * dispextern.h (struct it): Update the comment documenting what
9824 can it->OBJECT be.
9825
9826 2011-09-20 Eli Zaretskii <eliz@gnu.org>
9827
9828 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
9829 a display string, extend search for cursor position to end of row.
9830 (find_row_edges): If the row ends in a newline from a display
9831 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
9832 Handle the case of a display string with multiple newlines.
9833 (Fcurrent_bidi_paragraph_direction): Fix search for previous
9834 non-empty line. Fixes confusing cursor motion with arrow keys at
9835 the beginning of a line that starts with whitespace.
9836
9837 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
9838
9839 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
9840 (bug#9493).
9841
9842 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
9843
9844 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
9845 boolean (Bug#9154).
9846
9847 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9848
9849 * xdisp.c (display_line): Record maximum and minimum buffer
9850 positions even if no glyphs were produced (e.g., by a zero-width
9851 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
9852 buffer positions that will be removed from the glyph row because
9853 they don't fit.
9854 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
9855 column is beyond frame width: don't subtract 1 "pixel" when
9856 computing width of the stretch.
9857 (reseat_at_next_visible_line_start): Undo the change made on
9858 2011-09-17 that saved paragraph information and restored it after
9859 the call to `reseat'. (Bug#9545)
9860
9861 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9862
9863 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
9864 and turn window cursor on if cleared (Bug#9415).
9865
9866 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
9867
9868 * search.c (boyer_moore): Take unibyte characters from pattern
9869 literally. (Bug#9458)
9870
9871 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9872
9873 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
9874
9875 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
9876
9877 Fix minor problem found by static checking.
9878 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
9879 initialized, to pacify gcc -Wuninitialized.
9880
9881 * fileio.c: Report proper errno when syscall falls.
9882 (Finsert_file_contents): Save and restore errno,
9883 so that report_file_error outputs the correct diagnostic.
9884 (Fwrite_region) [CLASH_DETECTION]: Likewise.
9885
9886 2011-09-18 Eli Zaretskii <eliz@gnu.org>
9887
9888 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
9889
9890 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9891
9892 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
9893 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
9894
9895 2011-09-17 Eli Zaretskii <eliz@gnu.org>
9896
9897 * xdisp.c (reseat_at_next_visible_line_start): Keep information
9898 about the current paragraph and restore it after the call to reseat.
9899
9900 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
9901 (bidi_find_paragraph_start): Search back for paragraph beginning
9902 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
9903 (bidi_move_to_visually_next): Only trigger paragraph-related
9904 computations when the last character is a newline or at EOB, not
9905 just any NEUTRAL_B. (Bug#9470)
9906
9907 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
9908 truncated lines if point is covered by a display string. (Bug#9524)
9909
9910 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
9911
9912 * xselect.c: Relax test for outgoing X longs (Bug#9498).
9913 (cons_to_x_long): New function.
9914 (lisp_data_to_selection_data): Use it. Correct the test for
9915 short-versus-long data; it was negated. Break out of vector
9916 loop, for efficiency, when a long datum is discovered.
9917
9918 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
9919
9920 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
9921
9922 2011-09-16 Eli Zaretskii <eliz@gnu.org>
9923
9924 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
9925 GCC PR/17406) by declaring this function with external scope.
9926
9927 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9928
9929 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
9930 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
9931
9932 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
9933
9934 * editfns.c (Fformat): Correctly handle text properties on "%%".
9935
9936 2011-09-15 Eli Zaretskii <eliz@gnu.org>
9937
9938 * xterm.c (x_draw_composite_glyph_string_foreground):
9939 * w32term.c (x_draw_composite_glyph_string_foreground):
9940 * term.c (encode_terminal_code):
9941 * composite.c (composition_update_it, get_composition_id):
9942 * xdisp.c (get_next_display_element)
9943 (fill_composite_glyph_string): Add comments about special meaning
9944 of TAB characters in a composition.
9945
9946 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
9947
9948 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
9949 This occurs when processing a multibyte format.
9950 Problem reported by Wolfgang Jenker.
9951
9952 2011-09-15 Johan Bockgård <bojohan@gnu.org>
9953
9954 * xdisp.c (try_cursor_movement): Only check for exact match if
9955 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
9956
9957 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9958
9959 Remove unused external symbols.
9960 * dispextern.h (calc_pixel_width_or_height): Remove decl.
9961 * xdisp.c (calc_pixel_width_or_height): Now static.
9962 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
9963 * indent.c (check_display_width):
9964 * w32term.c: Fix comment to match code.
9965 * xterm.c, xterm.h (x_catching_errors): Remove.
9966
9967 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
9968
9969 * xselect.c: Use signed conversions more consistently (Bug#9498).
9970 (selection_data_to_lisp_data): Assume incoming selection data are
9971 signed integers, not unsigned. This is to be consistent with
9972 outgoing selection data, which was modified to use signed integers
9973 in as part of the fix to Bug#9196 in response to Jan D.'s comment
9974 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9975 expects long, not unsigned long.
9976
9977 2011-09-14 Eli Zaretskii <eliz@gnu.org>
9978
9979 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
9980 computation of loop end. Reported by Johan Bockgård
9981 <bojohan@gnu.org>.
9982
9983 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
9984
9985 * frame.c (Fother_visible_frames_p): Function deleted.
9986
9987 2011-09-12 Eli Zaretskii <eliz@gnu.org>
9988
9989 * indent.c (compute_motion): Process display vector front to back
9990 rather than the other way around. (Bug#2496)
9991
9992 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
9993
9994 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
9995
9996 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
9997
9998 * minibuf.c (Fread_from_minibuffer): Doc fix.
9999
10000 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10001
10002 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
10003 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
10004
10005 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10006
10007 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
10008 value for non-existent files.
10009
10010 2011-09-11 Eli Zaretskii <eliz@gnu.org>
10011
10012 * fileio.c (Finsert_file_contents): If the file cannot be opened,
10013 set its "size" to -1. This will set the modtime_size field of
10014 the corresponding buffer to -1, which is what
10015 verify-visited-file-modtime expects for files that do not exist.
10016 (Bug#9139)
10017
10018 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
10019
10020 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
10021 here ...
10022 * lisp.h: ... from here. push_key_description is no longer
10023 defined in keyboard.c, so its declaration should not be in
10024 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
10025 logically belongs with push_key_description.
10026
10027 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
10028
10029 * buffer.h: Include <sys/types.h> instead of <time.h>.
10030 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
10031 Problem reported by Herbert J. Skuhra.
10032
10033 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
10034
10035 * xml.c (parse_region): Make the parsing work for
10036 non-comment-starting XML files again (bug#9144).
10037
10038 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
10039
10040 * image.c (gif_load): Fix calculation of bottom and right corner.
10041 (Bug#9468)
10042
10043 2011-09-10 Eli Zaretskii <eliz@gnu.org>
10044
10045 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
10046 redisplay in small windows.
10047
10048 2011-09-09 Eli Zaretskii <eliz@gnu.org>
10049
10050 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
10051
10052 2011-09-08 Martin Rudalics <rudalics@gmx.at>
10053
10054 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
10055 Operate on live windows only.
10056
10057 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
10058
10059 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
10060
10061 2011-09-07 Eli Zaretskii <eliz@gnu.org>
10062
10063 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
10064 only under bidi iteration.
10065
10066 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
10067
10068 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
10069
10070 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10071
10072 isnan: Fix porting problem to Solaris 10 with bundled gcc.
10073 Without this fix, the command to link temacs failed due to an
10074 undefined symbol __builtin_isnan. This is because
10075 /usr/include/iso/math_c99.h #defines isnan(x) to
10076 __builtin_isnan(x), but the bundled gcc, which identifies itself
10077 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
10078 a __builtin_isnan.
10079 * floatfns.c (isnan): #undef, and then #define to a clone of
10080 what's in data.c.
10081 (Fisnan): Always define, since it's always available now.
10082 (syms_of_floatfns): Always define isnan at the Lisp level.
10083
10084 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10085
10086 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
10087
10088 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
10089
10090 * fileio.c: Fix bugs with large file offsets (Bug#9428).
10091 The previous code assumed that file offsets (off_t values) fit in
10092 EMACS_INT variables, which is not true on typical 32-bit hosts.
10093 The code messed up by falsely reporting buffer overflow in cases
10094 such as (insert-file-contents "big" nil 1 2) into an empty buffer
10095 when "big" contains more than 2**29 bytes, even though this
10096 inserts just one byte and does not overflow the buffer.
10097 (Finsert_file_contents): Store file offsets as off_t
10098 values, not as EMACS_INT values. Check for overflow when
10099 converting between EMACS_INT and off_t. When checking for
10100 buffer overflow or for overlap, take the offsets into account.
10101 Don't use EMACS_INT for small values where int suffices.
10102 When checking for overlap, fix a typo: ZV was used where
10103 ZV_BYTE was intended.
10104 (Fwrite_region): Don't assume off_t fits into 'long'.
10105 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
10106
10107 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
10108
10109 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
10110
10111 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10112
10113 sprintf-related integer and memory overflow issues (Bug#9412).
10114
10115 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
10116 (esprintf, exprintf, evxprintf): New functions.
10117 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
10118 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
10119 (modify_event_symbol): Do not assume that the length of
10120 name_alist_or_stem is safe to alloca and fits in int.
10121 (Fexecute_extended_command): Likewise for function name and binding.
10122 (Frecursion_depth): Wrap around reliably on integer overflow.
10123 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
10124 since some callers pass EMACS_INT values.
10125 (Fsingle_key_description): Don't crash if symbol name contains more
10126 than MAX_ALLOCA bytes.
10127 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
10128 (get_minibuffer): Arg is now EMACS_INT, not int.
10129 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
10130 (esprintf, exprintf, evxprintf): New decls.
10131 * window.h (command_loop_level, minibuf_level): Reflect API changes.
10132
10133 * dbusbind.c (signature_cat): New function.
10134 (xd_signature, Fdbus_register_signal):
10135 Do not overrun buffer; instead, report string overflow.
10136
10137 * dispnew.c (add_window_display_history): Don't overrun buffer.
10138 Truncate instead; this is OK since it's just a log.
10139
10140 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
10141 even if the time zone offset is outlandishly large.
10142 Don't mishandle offset == INT_MIN.
10143
10144 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
10145 when creating daemon; the previous buffer-overflow check was incorrect.
10146
10147 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
10148 which has the guts of the old verror function.
10149
10150 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
10151 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
10152
10153 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
10154 (font_unparse_xlfd): Don't blindly alloca long strings.
10155 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
10156 fits in int, when using sprintf. Use single snprintf to count
10157 length of string rather than counting it via multiple sprintfs;
10158 that's simpler and more reliable.
10159 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
10160 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
10161 sprintf, in case result does not fit in int.
10162
10163 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
10164 (fontset_from_font): Print it.
10165
10166 * frame.c (tty_frame_count): Now printmax_t, not int.
10167 (make_terminal_frame, set_term_frame_name): Print it.
10168 (x_report_frame_params): In X, window IDs are unsigned long,
10169 not signed long, so print them as unsigned.
10170 (validate_x_resource_name): Check for implausibly long names,
10171 and don't assume name length fits in 'int'.
10172 (x_get_resource_string): Don't blindly alloca invocation name;
10173 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
10174 not fit in int.
10175
10176 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
10177 (xg_check_special_colors, xg_set_geometry):
10178 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
10179
10180 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
10181 Use esprintf, not sprintf, in case result does not fit in int.
10182
10183 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10184 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
10185 it as a large positive number.
10186 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
10187 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
10188
10189 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
10190 in case result does not fit in int.
10191
10192 * print.c (float_to_string): Detect width overflow more reliably.
10193 (print_object): Make sprintf buffer a bit bigger, to avoid potential
10194 buffer overrun. Don't assume list length fits in 'int'. Treat
10195 print length of 0 as 0, not as infinity; to be consistent with other
10196 uses of print length in this function. Don't overflow print length
10197 index. Don't assume hash table size fits in 'long', or that
10198 vectorlike size fits in 'unsigned long'.
10199
10200 * process.c (make_process): Use printmax_t, not int, to format
10201 process-name gensyms.
10202
10203 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
10204
10205 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
10206 to avoid potential buffer overrun.
10207
10208 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
10209 if X resource line is longer than 512 bytes.
10210
10211 * xfns.c (x_window): Make sprintf buffer a bit bigger
10212 to avoid potential buffer overrun.
10213
10214 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
10215
10216 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
10217
10218 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
10219
10220 Integer overflow fixes for scrolling, etc.
10221 Without these, Emacs silently mishandles large integers sometimes.
10222 For example, "C-u 4294967297 M-x recenter" was treated as if
10223 it were "C-u 1 M-x recenter" on a typical 64-bit host.
10224
10225 * xdisp.c (try_window_id): Check Emacs fixnum range before
10226 converting to 'int'.
10227
10228 * window.c (window_scroll_line_based, Frecenter):
10229 Check that an Emacs fixnum is in range before assigning it to 'int'.
10230 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
10231 values converted from Emacs fixnums.
10232 (Frecenter): Don't wrap around a line count if it is out of 'int'
10233 range; instead, treat it as an extreme value.
10234 (Fset_window_configuration, compare_window_configurations):
10235 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
10236
10237 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
10238 that can exceed INT_MAX. Check that EMACS_INT value is in range
10239 before assigning it to the (possibly-narrower) index.
10240 (match_limit): Don't assume that a fixnum can fit in 'int'.
10241
10242 * print.c (print_object): Use ptrdiff_t, not int, for index that can
10243 exceed INT_MAX.
10244
10245 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
10246 (Fvertical_motion): Don't wrap around LINES values that don't fit
10247 in 'int'. Instead, treat them as extreme values. This is good
10248 enough for windows, which can't have more than INT_MAX lines anyway.
10249
10250 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10251
10252 * Require libxml/parser.h to avoid compilation warning.
10253
10254 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
10255
10256 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
10257 since this reportedly can destroy thread storage.
10258
10259 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
10260
10261 * syntax.c (find_defun_start): Update all cache variables if
10262 exiting early (Bug#9401).
10263
10264 2011-08-30 Eli Zaretskii <eliz@gnu.org>
10265
10266 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
10267
10268 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
10269 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
10270 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
10271
10272 * term.c (tty_append_glyph): New function.
10273 (produce_stretch_glyph): Static function and its prototype deleted.
10274
10275 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
10276 Add prototypes.
10277
10278 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
10279
10280 * image.c (parse_image_spec): Check for nonnegative, not for positive,
10281 when checking :margin (Bug#9390).
10282 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
10283 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
10284 so that the name doesn't mislead. All uses changed.
10285
10286 2011-08-28 Johan Bockgård <bojohan@gnu.org>
10287
10288 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
10289 set_tty_hooks.
10290
10291 2011-08-27 Eli Zaretskii <eliz@gnu.org>
10292
10293 * xdisp.c (move_it_to): Don't bail out early when reaching
10294 position beyond to_charpos, if we are scanning backwards.
10295 (move_it_vertically_backward): When DY == 0, make sure we get to
10296 the first character in the line after the newline.
10297
10298 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
10299
10300 * ccl.c: Improve and simplify overflow checking (Bug#9196).
10301 (ccl_driver): Do not generate an out-of-range pointer.
10302 (Fccl_execute_on_string): Remove unnecessary check for
10303 integer overflow, noted by Stefan Monnier in
10304 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
10305 Remove a FIXME that didn't need fixing.
10306 Simplify the newly-introduced buffer reallocation code.
10307
10308 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
10309
10310 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
10311
10312 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
10313
10314 Integer and memory overflow issues (Bug#9196).
10315
10316 * doc.c (get_doc_string): Rework so that
10317 get_doc_string_buffer_size is the actual buffer size, rather than
10318 being 1 less than the actual buffer size; this makes xpalloc more
10319 convenient.
10320
10321 * image.c (x_allocate_bitmap_record, cache_image):
10322 * xselect.c (Fx_register_dnd_atom):
10323 Simplify previous changes by using xpalloc.
10324
10325 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
10326 since either will do and ptrdiff_t is convenient with xpalloc.
10327
10328 * charset.c (charset_table_size)
10329 (struct charset_sort_data.priority): Now ptrdiff_t.
10330 (charset_compare): Don't overflow if priorities differ greatly.
10331 (Fsort_charsets): Don't assume list length fits in int.
10332 Check for size-calculation overflow when allocating sort data.
10333 (syms_of_charset): Allocate an initial charset table that is
10334 just under 64 KiB, to avoid problems with glibc malloc and mmap.
10335
10336 * cmds.c (internal_self_insert): Check for size-calculation overflow.
10337
10338 * composite.h (struct composition.glyph_len): Now int, not unsigned.
10339 The actual value is always <= INT_MAX, and leaving it unsigned made
10340 overflow checking harder.
10341
10342 * dispextern.h (struct glyph_matrix.rows_allocated)
10343 (struct face_cache.size): Now ptrdiff_t, for convenience in use
10344 with xpalloc. The values are still always <= INT_MAX.
10345
10346 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
10347
10348 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
10349 (SAFE_NALLOCA): New macro.
10350
10351 * region-cache.c (struct boundary.pos, find_cache_boundary)
10352 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
10353 (set_cache_region, invalidate_region_cache)
10354 (revalidate_region_cache, know_region_cache, region_cache_forward)
10355 (region_cache_backward, pp_cache):
10356 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
10357 so that ptrdiff_t * can be passed to xpalloc.
10358 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
10359 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
10360 (pp_cache): Don't assume cache_len fits in int.
10361 * region-cache.h: Adjust extern decls to match.
10362
10363 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
10364 EMACS_INT, since either will do, for xpalloc.
10365
10366 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
10367 (xnmalloc, xnrealloc, xpalloc): New functions.
10368
10369 * bidi.c (bidi_shelve_header_size): New constant.
10370 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
10371 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
10372
10373 * bidi.c (bidi_cache_shrink):
10374 * buffer.c (overlays_at, overlays_in, record_overlay_string)
10375 (overlay_strings):
10376 Don't update size of array until after memory allocation succeeds,
10377 because xmalloc/xrealloc may not return.
10378 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
10379 now that we have proper integer overflow checking.
10380 (record_overlay_string, overlay_strings): Catch overflows when
10381 calculating size of overlay_str_buf.
10382
10383 * callproc.c (Fcall_process): Check for size overflow when
10384 calculating size of args2.
10385 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
10386 Normally we prefer signed values, but sticking with ptrdiff_t would
10387 require adding more-complicated checks.
10388
10389 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
10390 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
10391 Redo buffer-overflow calculations to avoid integer overflow.
10392 Add a FIXME comment where memory seems to be over-allocated.
10393
10394 * character.c (Fstring): Check for size-calculation overflow.
10395
10396 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
10397 unnecessary integer overflow. Check for size overflow.
10398 (encode_coding_object): Don't update size until xmalloc succeeds.
10399
10400 * composite.c (get_composition_id): Check for overflow in glyph
10401 length calculations.
10402
10403 Integer and memory overflow fixes for display code.
10404 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
10405 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
10406 (scrolling_window): Check for overflow in size calculations.
10407 (line_draw_cost, realloc_glyph_pool, add_row_entry):
10408 Don't assume glyph table len fits in int.
10409 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
10410 (row_table_size): Now ptrdiff_t, not int.
10411 (scrolling_window): Avoid overflow in size calculations.
10412 Don't update size until allocation succeeds.
10413 * fns.c (concat): Check for overflow in size calculations.
10414 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
10415 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10416 (NEXT_ALMOST_PRIME_LIMIT): New constant.
10417
10418 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
10419 (get_doc_string): Check for size calculation overflow.
10420 Don't update size until allocation succeeds.
10421 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
10422 EMACS_INT, where ptrdiff_t will do.
10423 (Fsubstitute_command_keys): Check for string overflow.
10424
10425 * editfns.c (set_time_zone_rule): Don't assume environment length
10426 fits in int.
10427 (message_length): Now ptrdiff_t, not int.
10428 (Fmessage_box): Don't update size until allocation succeeds.
10429 Don't assume message length fits in int.
10430 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
10431
10432 * emacs.c (main): Do not reallocate argv, since there is a null at
10433 the end that can be overwritten, and this way there's no need to
10434 worry about size-calculation overflow.
10435 (sort_args): Check for size-calculation overflow.
10436
10437 * eval.c (init_eval_once, grow_specpdl): Don't update size until
10438 alloc succeeds.
10439 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
10440
10441 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
10442 (x_set_scroll_bar_width, x_figure_window_size):
10443 Check for integer overflow.
10444 (x_set_alpha): Do not assume XINT fits in int.
10445
10446 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
10447 This is for the members text_lines, text_cols, total_lines, total_cols,
10448 where the system imposes an 'int' limit.
10449
10450 * fringe.c (Fdefine_fringe_bitmap):
10451 Don't update size until alloc works.
10452
10453 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
10454 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
10455
10456 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
10457 Check for size-calculation overflow.
10458 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
10459 do, as we prefer signed integers.
10460 (id_to_widget.max_size, id_to_widget.used)
10461 (xg_store_widget_in_map, xg_remove_widget_from_map)
10462 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
10463 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
10464 Use and return ptrdiff_t, not int.
10465 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
10466 * gtkutil.h: Change prototypes to match the above.
10467
10468 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
10469 are duplicate now that they've been promoted to lisp.h.
10470 (x_allocate_bitmap_record, x_alloc_image_color)
10471 (make_image_cache, cache_image, xpm_load):
10472 Don't update size until alloc is done.
10473 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
10474 (x_detect_edges):
10475 Check for size calculation overflow.
10476 (ct_colors_allocated_max): New constant.
10477 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
10478 overflow.
10479
10480 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
10481 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
10482 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
10483 Use ptrdiff_t, not int, to count maps.
10484 (read_char_minibuf_menu_prompt): Check for overflow in size
10485 calculations. Don't update size until allocation succeeds.
10486 Redo calculations to avoid overflow.
10487 * keyboard.h: Change prototypes to match the above.
10488
10489 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
10490 to count maps.
10491 (current_minor_maps): Check for size calculation overflow.
10492 * keymap.h: Change prototypes to match the above.
10493
10494 * lread.c (read1, init_obarray): Don't update size until alloc done.
10495
10496 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
10497 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
10498
10499 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
10500 Now ptrdiff_t, not int.
10501 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
10502 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
10503
10504 * process.c (Fnetwork_interface_list): Check for overflow
10505 in size calculation.
10506
10507 * region-cache.c (move_cache_gap): Check for size calculation overflow.
10508
10509 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
10510 overflow. Don't bother calling xmalloc when xrealloc will do.
10511
10512 * search.c (Freplace_match): Check for size calculation overflow.
10513 (Fset_match_data): Don't assume list lengths fit in 'int'.
10514
10515 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
10516 for command line length. Do not attempt to address one before the
10517 beginning of an array, as that's not portable.
10518
10519 * term.c (max_frame_lines): Remove; unused.
10520 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
10521 not int.
10522 (encode_terminal_code, calculate_costs): Check for size
10523 calculation overflow.
10524 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
10525 table lengths and related sizes. Don't update size until alloc
10526 done. Redo calculations to avoid overflow.
10527 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
10528
10529 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
10530 subtracting pointers.
10531 (gobble_line): Check for overflow more carefully. Don't update size
10532 until alloc done.
10533
10534 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
10535 Don't update size until alloc done.
10536 Redo size calculations to avoid overflow.
10537 Check for size calculation overflow.
10538 (main) [DEBUG]: Fix typo in invoking tparam1.
10539
10540 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
10541 Use ptrdiff_t, not int, for sizes.
10542 (store_mode_line_noprop_char): Don't update size until alloc done.
10543
10544 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
10545 Use ptrdiff_t, not int, for sizes.
10546 (Finternal_make_lisp_face, cache_face):
10547 Check for size calculation overflow.
10548 (cache_face): Treat size calculation overflows as if they were
10549 memory exhaustion (the usual treatment), rather than aborting.
10550
10551 * xfns.c (x_encode_text, x_set_name_internal)
10552 (Fx_change_window_property): Use ptrdiff_t, not int, to count
10553 sizes, since they can exceed INT_MAX in size. Check for size
10554 calculation overflow.
10555
10556 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
10557 (xg_select): Check for size calculation overflow.
10558 Don't update size until alloc done.
10559
10560 * xrdb.c (get_environ_db): Don't assume path length fits in int,
10561 as sprintf is limited to int lengths.
10562
10563 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
10564 (X_LONG_MIN): New macros.
10565 Use them to make the following changes clearer.
10566 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
10567 This change doesn't affect the value now, but it may help remind
10568 future maintainers not to raise the value too much later.
10569 (SELECTION_QUANTUM): Remove, replacing with ...
10570 (selection_quantum): ... new function, which avoids overflow.
10571 All uses changed.
10572 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
10573 assumption that selection length fits in 'int'.
10574 (x_reply_selection_request, x_handle_selection_request)
10575 (x_get_window_property, receive_incremental_selection)
10576 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
10577 (lisp_data_to_selection_data, clean_local_selection_data):
10578 Use ptrdiff_t, not int, to record length of selection.
10579 (x_reply_selection_request, x_get_window_property)
10580 (receive_incremental_selection, x_property_data_to_lisp):
10581 Redo calculations to avoid overflow.
10582 (x_reply_selection_request): When sending hint, ceiling it at
10583 X_LONG_MAX rather than relying on wraparound overflow to send
10584 something.
10585 (x_get_window_property, receive_incremental_selection)
10586 (lisp_data_to_selection_data, x_property_data_to_lisp):
10587 Check for size-calculation overflow.
10588 (x_get_window_property, receive_incremental_selection)
10589 (lisp_data_to_selection_data, Fx_register_dnd_atom):
10590 Don't store size until memory allocation succeeds.
10591 (x_get_window_property): Plug memory leak on memory exhaustion.
10592 Don't double-block input; malloc is safe here. Don't assume 2**34
10593 - 4 fits in unsigned long. Add an xassert to check
10594 XGetWindowProperty overflow. Be more careful about overflow
10595 calculations, and distinguish size from memory overflow better.
10596 (receive_incremental_selection): When tracing, don't assume
10597 unsigned int is less than INT_MAX.
10598 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
10599 harmful) conversions of unsigned short to int.
10600 (lisp_data_to_selection_data): Don't assume that integers
10601 in the range -65535 through -1 fit in an X unsigned short.
10602 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
10603 result parameters unless successful. Rely on cons_to_unsigned
10604 to report problems with elements; the old code wasn't right anyway.
10605 (x_check_property_data): Check for int overflow; we cannot use
10606 a wider type due to X limits.
10607 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
10608
10609 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
10610
10611 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
10612 (x_term_init): Check for size calculation overflow.
10613 (x_color_cells): Don't store size until memory allocation succeeds.
10614 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
10615 Don't assume alloca size is less than MAX_ALLOCA.
10616 (x_term_init): Don't assume length fits in int (sprintf is limited
10617 to int size).
10618
10619 Use ptrdiff_t for composition IDs.
10620 * character.c (lisp_string_width):
10621 * composite.c (composition_table_size, n_compositions)
10622 (get_composition_id, composition_gstring_from_id):
10623 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
10624 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
10625 * window.c (Frecenter):
10626 Use ptrdiff_t, not int, for composition IDs.
10627 * composite.c (get_composition_id): Check for integer overflow.
10628 * composite.h: Adjust prototypes to match the above changes.
10629
10630 Use ptrdiff_t for hash table indexes.
10631 * category.c (hash_get_category_set):
10632 * ccl.c (ccl_driver):
10633 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
10634 * coding.c (coding_system_charset_list, detect_coding_system):
10635 * coding.h (struct coding_system.id):
10636 * composite.c (get_composition_id, gstring_lookup_cache):
10637 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
10638 * image.c (xpm_get_color_table_h):
10639 * lisp.h (hash_lookup, hash_put):
10640 * minibuf.c (Ftest_completion):
10641 Use ptrdiff_t for hash table indexes, not int (which is too
10642 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
10643 32-bit --with-wide-int hosts).
10644
10645 * charset.c (Fdefine_charset_internal): Check for integer overflow.
10646 Add a FIXME comment about memory leaks.
10647 (syms_of_charset): Don't assume xmalloc returns.
10648
10649 Don't assume that stated character widths fit in int.
10650 * character.c (Fchar_width, c_string_width, lisp_string_width):
10651 * character.h (CHAR_WIDTH):
10652 * indent.c (MULTIBYTE_BYTES_WIDTH):
10653 Use sanitize_char_width to avoid undefined and/or bad behavior
10654 with outlandish widths.
10655 * character.h (sanitize_tab_width): Rename from sanitize_width,
10656 now that we have two such functions. All uses changed.
10657 (sanitize_char_width): New inline function.
10658
10659 Don't assume that tab-width fits in int.
10660 * character.h (sanitize_width): New inline function.
10661 (SANE_TAB_WIDTH): New macro.
10662 (ASCII_CHAR_WIDTH): Use it.
10663 * indent.c (sane_tab_width): Remove. All uses replaced by
10664 SANE_TAB_WIDTH (current_buffer).
10665 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
10666
10667 * fileio.c: Integer overflow issues with file modes.
10668 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
10669
10670 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
10671 Remove unreachable code.
10672 (read_hex, load_charset_map_from_file): Check for integer overflow.
10673
10674 * xterm.c: Don't go over XClientMessageEvent limit.
10675 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
10676 (x_send_scroll_bar_event): Likewise. Check that the size does not
10677 exceed limits imposed by XClientMessageEvent, as well as the usual
10678 ptrdiff_t and size_t limits.
10679
10680 * keyboard.c: Overflow, signedness and related fixes.
10681 (make_lispy_movement): Use same integer type in forward decl
10682 that is used in the definition.
10683 (read_key_sequence, keyremap_step):
10684 Change bufsize argument back to int, undoing my 2011-03-30 change.
10685 We prefer signed types, and int is wide enough here.
10686 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
10687 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
10688 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
10689 length, not size_t. Use ptrdiff_t for index, not int.
10690 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
10691 possibility of integer overflow.
10692
10693 Overflow, signedness and related fixes for images.
10694
10695 * dispextern.h (struct it.stack[0].u.image.image_id)
10696 (struct_it.image_id, struct image.id, struct image_cache.size)
10697 (struct image_cache.used, struct image_cache.ref_count):
10698 * gtkutil.c (update_frame_tool_bar):
10699 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
10700 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
10701 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
10702 * nsmenu.m (update_frame_tool_bar):
10703 * xdisp.c (calc_pixel_width_or_height):
10704 * xfns.c (image_cache_refcount):
10705 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
10706 on typical 64-bit hosts.
10707
10708 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
10709 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
10710 Omit unnecessary casts to int.
10711 (parse_image_spec): Check that integers fall into 'int' range
10712 when the callers expect that.
10713 (image_ascent): Redo ascent calculation to avoid int overflow.
10714 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
10715 (lookup_image): Remove unnecessary tests.
10716 (xbm_image_p): Locals are now of int, not EMACS_INT,
10717 since parse_image_check makes sure they fit into int.
10718 (png_load, gif_load, svg_load_image):
10719 Prefer int to unsigned where either will do.
10720 (tiff_handler): New function, combining the cores of the
10721 old tiff_error_handler and tiff_warning_handler.
10722 This function is rewritten to use vsnprintf and thereby avoid
10723 stack buffer overflows. It uses only the features of vsnprintf
10724 that are common to both POSIX and native Microsoft.
10725 (tiff_error_handler, tiff_warning_handler): Use it.
10726 (tiff_load, gif_load, imagemagick_load_image):
10727 Don't assume :index value fits in 'int'.
10728 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
10729 (imagemagick_load_image): Check that crop parameters fit into
10730 the integer types that MagickCropImage accepts. Don't assume
10731 Vimagemagick_render_type has a nonnegative value. Don't assume
10732 size_t fits in 'long'.
10733 (gs_load): Use printmax_t to print the widest integers possible.
10734 Check for integer overflow when computing image height and width.
10735
10736 2011-08-26 Eli Zaretskii <eliz@gnu.org>
10737
10738 * xdisp.c (redisplay_window): Don't force window start if point
10739 will be invisible in the resulting window. (Bug#9324)
10740
10741 2011-08-25 Eli Zaretskii <eliz@gnu.org>
10742
10743 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
10744 the display spec is of the form `(space ...)'.
10745 (handle_display_spec): Return the value returned by
10746 handle_single_display_spec, not just 1 or zero.
10747 (handle_single_display_spec): If the display spec is of the form
10748 `(space ...)', and specifies display in the text area, return 2
10749 rather than 1.
10750 (try_cursor_movement): Check for the need to scroll more
10751 accurately, and prefer exact match for point under bidi.
10752 Don't advance `row' beyond the last row of the window.
10753
10754 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
10755 into disp_prop; all users changed.
10756
10757 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
10758 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
10759 for the text covered by the display property.
10760
10761 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
10762
10763 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
10764 Change return value to nil.
10765 (Frecord_buffer): Delete unused function.
10766
10767 2011-08-24 Eli Zaretskii <eliz@gnu.org>
10768
10769 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10770 buffers, return left-to-right.
10771 (set_cursor_from_row): Consider candidate row a win if its glyph
10772 represents a newline and point is on that newline. Fixes cursor
10773 positioning on the newline at EOL of R2L text within L2R
10774 paragraph, and vice versa.
10775 (try_cursor_movement): Check continued rows, in addition to
10776 continuation rows. Fixes unwarranted scroll when point enters a
10777 continued line of R2L text within an L2R paragraph, or vice versa.
10778 (cursor_row_p): Consider the case of point being equal to
10779 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
10780 from the end of a short line to the beginning of a continued line
10781 of R2L text within L2R paragraph.
10782 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
10783 composed characters.
10784
10785 * bidi.c (bidi_check_type): Use xassert.
10786 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
10787 members.
10788
10789 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10790
10791 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
10792 a character.
10793
10794 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
10795
10796 * nsfont.m (ns_otf_to_script): Fix typo.
10797
10798 2011-08-22 Kenichi Handa <handa@m17n.org>
10799
10800 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
10801 extra slot even if the purpose is char-code-property-table.
10802
10803 2011-08-23 Eli Zaretskii <eliz@gnu.org>
10804
10805 * xdisp.c (redisplay_window): When computing centering_position,
10806 account for the height of the header line. (Bug#8874)
10807
10808 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
10809 instead of CHAR_TO_BYTE. Fixes a crash when a completion
10810 candidate is selected by the mouse, and that candidate has a
10811 composed character under the mouse.
10812
10813 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
10814 coordinates reported by pos-visible-in-window-p for a composed
10815 character in column zero.
10816
10817 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10818
10819 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
10820
10821 2011-08-22 Eli Zaretskii <eliz@gnu.org>
10822
10823 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
10824 consider it a hit if to_charpos is anywhere in the range of the
10825 composed buffer positions.
10826
10827 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
10828
10829 * image.c (gif_load): Don't assume that each subimage has the same
10830 dimensions as the base image. Handle disposal method that is
10831 "undefined" by the gif spec (Bug#9335).
10832
10833 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
10834
10835 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
10836 (Fcondition_case): Document `debug' symbol in error handler.
10837
10838 2011-08-19 Eli Zaretskii <eliz@gnu.org>
10839
10840 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
10841 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
10842 from an Org mode buffer to a Speedbar frame.
10843
10844 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
10845 a composition, take its buffer position from IT->cmp_it.charpos.
10846 Fixes cursor positioning at the beginning of a line that begins
10847 with a composed character.
10848
10849 2011-08-18 Eli Zaretskii <eliz@gnu.org>
10850
10851 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
10852 character bidirectional type, use STRONG_L instead. Fixes crashes
10853 in a buffer produced by `describe-categories'.
10854
10855 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
10856 members before the level stack, so they would be saved and
10857 restored when copying iterator state. Fixes incorrect reordering
10858 around TABs covered by display properties.
10859
10860 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
10861
10862 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
10863
10864 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
10865
10866 * eval.c (internal_condition_case, internal_condition_case_1)
10867 (internal_condition_case_2, internal_condition_case_n):
10868 Remove unnecessary aborts (Bug#9081).
10869
10870 2011-08-17 Eli Zaretskii <eliz@gnu.org>
10871
10872 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
10873 has no `load' handler, try opening the file locally. (Bug#9311)
10874
10875 2011-08-16 Ken Brown <kbrown@cornell.edu>
10876
10877 * gmalloc.c: Expand comment.
10878
10879 2011-08-16 Eli Zaretskii <eliz@gnu.org>
10880
10881 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
10882 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
10883
10884 2011-08-16 Ken Brown <kbrown@cornell.edu>
10885
10886 Fix memory allocation problems in Cygwin build (Bug#9273).
10887
10888 * unexcw.c ( __malloc_initialized): Declare external variable.
10889 (fixup_executable): Force the dumped emacs to reinitialize malloc.
10890
10891 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
10892 New variables.
10893 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
10894 dumped emacs.
10895 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
10896 in the static heap.
10897 [CYGWIN] (special_realloc): New function.
10898 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
10899 requests to realloc storage in the static heap.
10900
10901 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
10902
10903 * bidi.c (bidi_initialize): Remove unused local.
10904
10905 2011-08-15 Eli Zaretskii <eliz@gnu.org>
10906
10907 * bidimirror.h:
10908 * biditype.h: Remove file.
10909 * makefile.w32-in ($(BLD)/bidi.$(O)):
10910 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
10911
10912 * dispextern.h: Fix a typo in the comment to bidi_type_t.
10913
10914 * chartab.c: Improve commentary for the uniprop_table API.
10915
10916 * bidi.c (bidi_paragraph_init): Support zero value of
10917 bidi_ignore_explicit_marks_for_paragraph_level.
10918 (bidi_initialize): Use uniprop_table instead of including
10919 biditype.h and bidimirror.h.
10920
10921 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
10922 coordinates of the iterator when restoring from ppos_it.
10923 (Bug#9296)
10924
10925 2011-08-14 Kenichi Handa <handa@m17n.org>
10926
10927 * process.c (create_process): Call setup_process_coding_systems
10928 after the pid of the process is set to -1 (Bug#8162).
10929
10930 2011-08-14 Eli Zaretskii <eliz@gnu.org>
10931
10932 * xdisp.c (move_it_in_display_line_to): Don't invoke
10933 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
10934 ppos_it. Fixes vertical cursor motion when line beginning is
10935 covered by an image. (Bug#9296)
10936
10937 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
10938
10939 * nsterm.h (ns_run_ascript): Declare.
10940 (NSAPP_DATA2_RUNASSCRIPT): Define.
10941
10942 * nsfns.m (as_script, as_result, as_status): New static variables.
10943 (ns_run_ascript): New function.
10944 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
10945 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
10946 the event loop. Get status from as_status (Bug#7276).
10947
10948 * nsterm.m (sendEvent): If event is NSApplicationDefined and
10949 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
10950 the event loop (Bug#7276).
10951
10952 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
10953
10954 * gnutls.c (QCgnutls_bootprop_priority)
10955 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
10956 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
10957 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
10958 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
10959 (QCgnutls_bootprop_verify_hostname_error)
10960 (QCgnutls_bootprop_callbacks_verify): Rename from
10961 Qgnutls_bootprop_..., all uses changed.
10962
10963 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
10964 uses changed.
10965
10966 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
10967
10968 * xfaces.c (Qframe_set_background_mode): Now static.
10969 * dispextern.h (Qframe_set_background_mode): Remove decl.
10970
10971 * process.c (Fnetwork_interface_info): Declare local only if needed.
10972
10973 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
10974
10975 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
10976 (Fnetwork_interface_list): Allocate in increments of bytes instead
10977 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
10978 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
10979 sockaddr.
10980 (struct ifflag_def): notrailers is smart on OSX.
10981 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
10982 Get hardware address with getifaddrs if available.
10983
10984 2011-08-12 Eli Zaretskii <eliz@gnu.org>
10985
10986 * xdisp.c (iterate_out_of_display_property): xassert that
10987 IT->position is set to within IT->object's boundaries. Break from
10988 the loop as soon as EOB is reached; avoids infloops in redisplay
10989 when IT->position is set up wrongly due to some bug.
10990 Set IT->current to match the bidi iterator unconditionally.
10991 (push_display_prop): Allow GET_FROM_STRING as IT->method on
10992 entry. Force push_it to save on the stack the current
10993 buffer/string position, to be restored by pop_it. Fix flags in
10994 the iterator structure wrt the object coming from a display
10995 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
10996 properties. (Bug#9284)
10997
10998 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
10999
11000 * fontset.c (fontset_get_font_group): Add proper type checks.
11001 (Bug#9172)
11002
11003 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11004
11005 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
11006 and LC_VERSION_MIN_MACOSX.
11007 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
11008 (dump_it) [LC_FUNCTION_STARTS]: Use it.
11009
11010 2011-08-08 Eli Zaretskii <eliz@gnu.org>
11011
11012 * xdisp.c (forward_to_next_line_start): Allow to use the
11013 no-display-properties-and-no-overlays under bidi display.
11014 Set disp_pos in the bidi iterator to avoid searches for display
11015 properties and overlays.
11016
11017 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
11018
11019 * editfns.c (Fset_time_zone_rule): Document relationship with the
11020 setenv function.
11021
11022 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
11023 the font entity extracted from the cache (Bug#8109).
11024
11025 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
11026
11027 * composite.c (autocmp_chars): Don't reset point. That is done by
11028 restore_point_unwind (Bug#5984).
11029
11030 2011-08-07 Juri Linkov <juri@jurta.org>
11031
11032 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
11033 to show the arg `TIME' instead of `TIMEVAL'.
11034
11035 2011-08-06 Eli Zaretskii <eliz@gnu.org>
11036
11037 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
11038 display property strides EOL and includes a newline, as in
11039 longlines-mode. (Bug#9254)
11040 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
11041 word-wrap under bidirectional display. (Bug#9224)
11042
11043 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
11044 is non-zero, even if the data buffer is NULL. Fixes a crash in
11045 vertical-motion with longlines-mode. (Bug#9254)
11046
11047 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11048
11049 * bidi.c <bidi_cache_total_alloc>: Now static.
11050 (bidi_initialize): Initialize bidi_cache_total_alloc.
11051
11052 * xdisp.c (display_line): Release buffer allocated for shelved bidi
11053 cache. (Bug#9221)
11054
11055 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
11056 amount allocated this far in `bidi_cache_total_alloc'.
11057 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
11058 non-zero, only free the data buffer without restoring the cache
11059 contents. All callers changed.
11060
11061 * dispextern.h (bidi_unshelve_cache): Update prototype.
11062
11063 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
11064 (move_it_in_display_line, move_it_to)
11065 (move_it_vertically_backward, move_it_by_lines): Replace the call
11066 to xfree to an equivalent call to bidi_unshelve_cache.
11067 (move_it_in_display_line_to): Fix logic of returning
11068 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
11069
11070 2011-08-05 Eli Zaretskii <eliz@gnu.org>
11071
11072 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
11073 came from a string character with a `cursor' property. (Bug#9229)
11074
11075 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11076
11077 * Makefile.in (LIB_PTHREAD): New variable.
11078 (LIBES): Add LIB_PTHREAD (Bug#9216).
11079
11080 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
11081 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
11082
11083 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
11084
11085 * regex.c (re_iswctype): Remove some redundant boolean conversions.
11086
11087 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
11088
11089 * xterm.c (x_find_topmost_parent): New function.
11090 (x_set_frame_alpha): Find topmost parent window with
11091 x_find_topmost_parent and set the property there also (bug#9181).
11092 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
11093
11094 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
11095
11096 * callproc.c (Fcall_process): Avoid vfork clobbering
11097 the local vars buffer, coding_systems, current_dir.
11098
11099 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
11100
11101 * keymap.c (Fmake_composed_keymap): Move to subr.el.
11102
11103 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
11104
11105 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
11106 so that it is not optimized away.
11107
11108 * xdisp.c (compute_display_string_pos): Remove unused local.
11109
11110 2011-08-02 Eli Zaretskii <eliz@gnu.org>
11111
11112 Fix slow cursor motion and scrolling in large buffers with
11113 selective display, like Org Mode buffers. (Bug#9218)
11114
11115 * dispextern.h (struct bidi_it): New member disp_prop_p.
11116
11117 * xdisp.c: Remove one-slot cache of display string positions.
11118 (compute_display_string_pos): Accept an additional argument
11119 DISP_PROP_P; callers changed. Scan at most 5K characters forward
11120 for a display string or property. If found, set DISP_PROP_P
11121 non-zero.
11122
11123 * bidi.c (bidi_fetch_char): Accept an additional argument
11124 DISP_PROP_P, and pass it to compute_display_string_pos.
11125 Only handle text covered by a display string if DISP_PROP_P is returned
11126 non-zero. All callers of bidi_fetch_char changed.
11127
11128 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
11129
11130 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
11131
11132 2010-12-03 Don March <don@ohspite.net>
11133
11134 * keymap.c (Fdefine_key): Fix non-prefix key error message when
11135 last character M-[char] is translated to ESC [char] (bug#7541).
11136
11137 2011-08-02 Kenichi Handa <handa@m17n.org>
11138
11139 * lisp.h (uniprop_table): Extern it.
11140
11141 * chartab.c (uniprop_table): Make it non-static.
11142
11143 2011-08-01 Eli Zaretskii <eliz@gnu.org>
11144
11145 * xdisp.c (forward_to_next_line_start): Accept additional argument
11146 BIDI_IT_PREV, and store into it the state of the bidi iterator had
11147 on the newline.
11148 (reseat_at_next_visible_line_start): Use the bidi iterator state
11149 returned by forward_to_next_line_start to restore the state of
11150 it->bidi_it after backing up to previous newline. (Bug#9212)
11151
11152 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
11153
11154 * regex.c (re_comp): Protoize.
11155 (re_exec): Fix return type.
11156 (regexec): Fix type of `ret'. (Bug#9203)
11157
11158 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11159
11160 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
11161 This is needed if max-image-size is a floating-point number.
11162
11163 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11164
11165 * print.c (print_object): Print empty symbol as ##.
11166
11167 * lread.c (read1): Read ## as empty symbol.
11168
11169 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11170
11171 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
11172 setting frame foreground color (Bug#9175).
11173 (x_set_background_color): Likewise.
11174
11175 * nsmenu.m (-setText): Size tooltip dimensions precisely to
11176 contents (Bug#9176).
11177 (EmacsTooltip -init): Remove bezels and add shadows to
11178 tooltip windows.
11179
11180 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
11181 or scroll bar (Bug#8470).
11182
11183 * nsfont.m (nsfont_open): Remove assignment to voffset and
11184 unnecessary vars hshink, expand, hd, full_height, min_height.
11185 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
11186
11187 * nsterm.h (nsfont_info): Remove voffset field.
11188
11189 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
11190
11191 Implement strike-through and overline on NextStep (Bug#8863).
11192
11193 * nsfont.m (nsfont_open): Use underline position provided by font,
11194 instead of hard-coded value of 2.
11195 (nsfont_draw): Call ns_draw_text_decoration instead.
11196
11197 * nsterm.h: Add declaration for ns_draw_text_decoration.
11198
11199 * nsterm.m (ns_draw_text_decoration): New function for drawing
11200 underline, overline, and strike-through.
11201 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
11202 ns_draw_text_decoration. Change treatment of cursor drawing to
11203 accommodate underlining, etc.
11204
11205 2011-07-28 Eli Zaretskii <eliz@gnu.org>
11206
11207 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
11208 default.
11209
11210 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11211
11212 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
11213 Without this fix, if a signal arrives just after memory fills up,
11214 'malloc' might be invoked reentrantly.
11215
11216 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
11217 In other words, assume that every image size is allowed, on non-X
11218 hosts. This assumption is probably wrong, but it lets Emacs compile.
11219
11220 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
11221
11222 * regex.c (re_iswctype): Convert return values to boolean.
11223
11224 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
11225
11226 * xdisp.c (compute_display_string_pos): Don't use cached display
11227 string position if the buffer had its restriction changed.
11228 (Bug#9184)
11229
11230 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11231
11232 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
11233
11234 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
11235
11236 Integer signedness and overflow and related fixes. (Bug#9079)
11237
11238 * bidi.c: Integer size and overflow fixes.
11239 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
11240 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
11241 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11242 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
11243 (bidi_find_other_level_edge):
11244 Use ptrdiff_t instead of EMACS_INT where either will do.
11245 This works better on 32-bit hosts configured --with-wide-int.
11246 (bidi_cache_ensure_space): Check for size-calculation overflow.
11247 Use % rather than repeated addition, for better worst-case speed.
11248 Don't set bidi_cache_size until after xrealloc returns, because it
11249 might not return.
11250 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
11251 (bidi_cache_ensure_space): Also check that the bidi cache size
11252 does not exceed that of the largest Lisp string or buffer. See Eli
11253 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
11254
11255 * alloc.c (__malloc_size_t): Remove.
11256 All uses replaced by size_t. See Andreas Schwab's note
11257 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
11258
11259 * image.c: Improve checking for integer overflow.
11260 (check_image_size): Assume that f is nonnull, since
11261 it is always nonnull in practice. This is one less thing to
11262 worry about when checking for integer overflow later.
11263 (x_check_image_size): New function, which checks for integer
11264 overflow issues inside X.
11265 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
11266 This removes the need for a memory_full check.
11267 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
11268 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
11269 (xbm_read_bitmap_data): Change locals back to 'int', since
11270 their values must fit in 'int'.
11271 (xpm_load_image, png_load, tiff_load):
11272 Invoke x_create_x_image_and_pixmap earlier,
11273 to avoid much needless work if the image is too large.
11274 (tiff_load): Treat overly large images as if
11275 x_create_x_image_and_pixmap failed, not as malloc failures.
11276 (gs_load): Use x_check_image_size.
11277
11278 * gtkutil.c: Omit integer casts.
11279 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
11280 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
11281
11282 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
11283
11284 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
11285 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
11286 would wrongly return t on a 64-bit host.
11287
11288 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
11289 The plain *_OVERFLOW macros run afoul of GCC bug 49705
11290 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
11291 and therefore cause GCC to emit a bogus diagnostic in some cases.
11292
11293 * image.c: Integer signedness and overflow and related fixes.
11294 This is not an exhaustive set of fixes, but it's time to
11295 record what I've got.
11296 (lookup_pixel_color, check_image_size): Remove redundant decls.
11297 (check_image_size): Don't assume that arbitrary EMACS_INT values
11298 fit in 'int', or that arbitrary 'double' values fit in 'int'.
11299 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
11300 (tiff_load, imagemagick_load_image):
11301 Check for overflow in size calculations.
11302 (x_create_x_image_and_pixmap): Remove unnecessary test for
11303 xmalloc returning NULL; that can't happen.
11304 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
11305 (xpm_color_bucket): Use better integer hashing function.
11306 (xpm_cache_color): Don't possibly over-allocate memory.
11307 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
11308 (gif_memory_source):
11309 Use ptrdiff_t, not int or size_t, to record sizes.
11310 (png_load): Don't assume values greater than 2**31 fit in 'int'.
11311 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
11312 either works, as we prefer signed integers.
11313 (tiff_read_from_memory, tiff_write_from_memory):
11314 Return tsize_t, not size_t, since that's what the TIFF API wants.
11315 (tiff_read_from_memory): Don't fail simply because the read would
11316 go past EOF; instead, return a short read.
11317 (tiff_load): Omit no-longer-needed casts.
11318 (Fimagemagick_types): Don't assume size fits into 'int'.
11319
11320 Improve hashing quality when configured --with-wide-int.
11321 * fns.c (hash_string): New function, taken from sxhash_string.
11322 Do not discard information about ASCII character case; this
11323 discarding is no longer needed.
11324 (sxhash-string): Use it. Change sig to match it. Caller changed.
11325 * lisp.h: Declare it.
11326 * lread.c (hash_string): Remove, since we now use fns.c's version.
11327 The fns.c version returns a wider integer if --with-wide-int is
11328 specified, so this should help the quality of the hashing a bit.
11329
11330 * emacs.c: Integer overflow minor fix.
11331 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
11332 Define only if GNU_LINUX.
11333 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
11334
11335 * dispnew.c: Integer signedness and overflow fixes.
11336 Remove unnecessary forward decls, that were a maintenance hassle.
11337 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
11338 All uses changed.
11339 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
11340 (scrolling_window): Use ptrdiff_t, not int, for byte count.
11341 (prepare_desired_row, line_draw_cost):
11342 Use int, not unsigned, where either works.
11343 (save_current_matrix, restore_current_matrix):
11344 Use ptrdiff_t, not size_t, where either works.
11345 (init_display): Check for overflow more accurately, and without
11346 relying on undefined behavior.
11347
11348 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
11349 Remove, replacing with the new symbols in lisp.h. All uses changed.
11350 * fileio.c (make_temp_name):
11351 * filelock.c (lock_file_1, lock_file):
11352 * xdisp.c (message_dolog):
11353 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
11354 Use pMd etc. instead.
11355 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
11356 replacing the pWIDE etc. symbols removed from editfns.c.
11357
11358 * keyboard.h (num_input_events): Now uintmax_t.
11359 This is (very slightly) less likely to mess up due to wraparound.
11360 All uses changed.
11361
11362 * buffer.c: Integer signedness fixes.
11363 (alloc_buffer_text, enlarge_buffer_text):
11364 Use ptrdiff_t rather than size_t when either will do, as we prefer
11365 signed integers.
11366
11367 * alloc.c: Integer signedness and overflow fixes.
11368 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
11369 (__malloc_size_t): Default to size_t, not to int.
11370 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
11371 (Fgarbage_collect, mark_object_loop_halt, mark_object):
11372 Prefer ptrdiff_t to size_t when either would do, as we prefer
11373 signed integers.
11374 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
11375 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
11376 Now const. Initialize with values that are in range even if char
11377 is signed.
11378 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
11379 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
11380 These functions do the right thing with sizes > 2**32.
11381 (check_depth): Now ptrdiff_t, not int.
11382 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
11383 Adjust to new way of storing sizes. Check for size overflow bugs
11384 in rest of code.
11385 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
11386 slightly wrong anyway, as it missed one instance of
11387 XMALLOC_OVERRUN_CHECK_OVERHEAD.
11388 (refill_memory_reserve): Omit needless cast to size_t.
11389 (mark_object_loop_halt): Mark as externally visible.
11390
11391 * xselect.c: Integer signedness and overflow fixes.
11392 (Fx_register_dnd_atom, x_handle_dnd_message):
11393 Use ptrdiff_t, not size_t, since we prefer signed.
11394 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
11395 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
11396 x_dnd_atoms_size and x_dnd_atoms_length.
11397
11398 * doprnt.c: Prefer signed to unsigned when either works.
11399 * eval.c (verror):
11400 * doprnt.c (doprnt):
11401 * lisp.h (doprnt):
11402 * xdisp.c (vmessage):
11403 Use ptrdiff_t, not size_t, when using or implementing doprnt,
11404 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
11405 prefer signed arithmetic to avoid comparison confusion.
11406 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
11407 but is a bit tricky.
11408
11409 Assume freestanding C89 headers, string.h, stdlib.h.
11410 * data.c, doprnt.c, floatfns.c, print.c:
11411 Include float.h unconditionally.
11412 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
11413 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
11414 * regex.c: Likewise for stddef.h, string.h.
11415 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
11416 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
11417 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
11418 (STDC_HEADERS): Remove obsolete defines.
11419 * sysdep.c: Include limits.h unconditionally.
11420
11421 Assume support for memcmp, memcpy, memmove, memset.
11422 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
11423 * regex.c (memcmp, memcpy):
11424 Remove; we assume C89 now.
11425
11426 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
11427 (__malloc_safe_bcopy): Remove; no longer needed.
11428
11429 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
11430 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
11431 well either way, and we prefer signed to unsigned.
11432
11433 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
11434
11435 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
11436 closes the connection while we're reading (bug#9182).
11437
11438 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
11439
11440 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
11441 are specified (Bug#9168).
11442
11443 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
11444
11445 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
11446 Found by GCC static checking and --with-wide-int on a 32-bit host.
11447
11448 2011-07-25 Eli Zaretskii <eliz@gnu.org>
11449
11450 * xdisp.c (compute_display_string_pos): Fix logic of caching
11451 previous display string position. Initialize cached_prev_pos to
11452 -1. Fixes slow-down at the beginning of a buffer.
11453
11454 2011-07-24 Eli Zaretskii <eliz@gnu.org>
11455
11456 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
11457 for attrs[LFACE_FONTSET_INDEX].
11458
11459 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
11460
11461 * xml.c (parse_region): Remove unused local
11462 that was recently introduced.
11463
11464 2011-07-23 Eli Zaretskii <eliz@gnu.org>
11465
11466 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
11467 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
11468
11469 * xdisp.c (move_it_in_display_line_to): Record the best matching
11470 position for TO_CHARPOS while scanning the line, and restore it on
11471 exit if none of the characters scanned was an exact match.
11472 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
11473 when exact match is impossible due to invisible text, and the
11474 lines are truncated.
11475
11476 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
11477
11478 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
11479 for OSX >= 10.7.
11480
11481 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11482
11483 Fix a significant slow-down of cursor motion with C-n, C-p,
11484 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
11485 auto-repeat under bidi redisplay in fontified buffers.
11486 * xdisp.c (compute_stop_pos_backwards): New function.
11487 (next_element_from_buffer): Call compute_stop_pos_backwards to
11488 find a suitable prev_stop when we find ourselves before
11489 base_level_stop.
11490 (reseat): Don't look for prev_stop, as that could mean a very long
11491 run.
11492 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
11493 <cached_disp_overlay_modiff>: Cache for last found display string
11494 position.
11495 (compute_display_string_pos): Return the cached position if asked
11496 about the same buffer in the same area of character positions, and
11497 the buffer wasn't changed since the time the display string
11498 position was cached.
11499
11500 2011-07-22 Eli Zaretskii <eliz@gnu.org>
11501
11502 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
11503 is an integer, which is important for empty lines. (Bug#9149)
11504
11505 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
11506
11507 * frame.c (Fmodify_frame_parameters): In tty case, update the
11508 default face if necessary (Bug#4238).
11509
11510 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
11511
11512 * editfns.c (Fstring_to_char): No need to explain what a character
11513 is in the docstring (Bug#6576).
11514
11515 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11516
11517 * xml.c (parse_region): Make sure we always return a tree.
11518
11519 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
11520
11521 * xml.c (parse_region): If a document contains only comments,
11522 return that, too.
11523
11524 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
11525
11526 * xml.c (make_dom): Return comments, too.
11527
11528 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
11529
11530 Port to OpenBSD.
11531 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
11532 and the surrounding thread.
11533 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
11534 rather than fgets, and retry after EINTR. Otherwise, 'emacs
11535 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
11536 timer goes off.
11537 * s/openbsd.h (BROKEN_SIGIO): Define.
11538 * unexelf.c (unexec) [__OpenBSD__]:
11539 Don't update the .mdebug section of the Alpha COFF symbol table.
11540
11541 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11542
11543 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
11544 (bug#8460).
11545
11546 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
11547
11548 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
11549 This fixes some race conditions on the permissions of any newly
11550 created file.
11551
11552 * alloc.c (valid_pointer_p): Use pipe, not open.
11553 This fixes some permissions issues when debugging.
11554
11555 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11556 If fchown fails to set both uid and gid, try to set just gid,
11557 as that is sometimes allowed. Adjust the file's mode to eliminate
11558 setuid or setgid bits that are inappropriate if fchown fails.
11559
11560 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
11561
11562 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
11563 to compare Lisp_Objects.
11564 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
11565 global_gnutls_log_level, don't mistake it for a Lisp_Object.
11566 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
11567
11568 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
11569
11570 * lread.c (read_integer): Unread even EOF character.
11571 (read1): Likewise. Properly record start position of symbol.
11572
11573 * lread.c (read1): Read `#:' as empty uninterned symbol if no
11574 symbol character follows.
11575
11576 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
11577
11578 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
11579 This works around a problem with the previous change to Fcopy_file.
11580 Recent glibc declares fchown with __attribute__((warn_unused_result)),
11581 and without this change, GCC might complain about discarding
11582 fchown's return value.
11583
11584 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
11585
11586 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
11587
11588 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
11589
11590 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
11591
11592 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
11593
11594 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
11595 it's used from the C level.
11596
11597 * process.c: Use the same condition for POLL_FOR_INPUT in both
11598 keyboard.c and process.c (bug#1858).
11599
11600 2011-07-09 Lawrence Mitchell <wence@gmx.li>
11601
11602 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
11603 (Fgnutls_boot): Use it.
11604
11605 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
11606
11607 * doc.c (Fsubstitute_command_keys): Revert last change.
11608
11609 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
11610
11611 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
11612 quotes the next character, and doesn't affect other longer
11613 sequences (bug#8935).
11614
11615 * lread.c (syms_of_lread): Clarify that is isn't only
11616 `eval-buffer' and `eval-defun' that's affected by
11617 `lexical-binding' (bug#8460).
11618
11619 2011-07-15 Eli Zaretskii <eliz@gnu.org>
11620
11621 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
11622 bidi redisplay when a line includes both an image and is truncated.
11623
11624 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
11625
11626 Fix minor problems found by static checking.
11627 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
11628 (elsz): Now a signed constant, not a size_t var. We prefer signed
11629 types to unsigned, to avoid integer comparison confusion. Without
11630 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
11631 "cannot optimize loop, the loop counter may overflow", a symptom
11632 of the confusion.
11633 * indent.c (Fvertical_motion): Mark locals as initialized.
11634 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
11635
11636 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11637
11638 * search.c (Fre_search_backward): Mention `case-fold-search' in
11639 all the re_search_* functions (bug#8138).
11640
11641 * keyboard.c (Fopen_dribble_file): Document when the file is
11642 closed (bug#8056).
11643
11644 2011-07-14 Eli Zaretskii <eliz@gnu.org>
11645
11646 * bidi.c (bidi_dump_cached_states): Fix format of displaying
11647 bidi_cache_idx.
11648
11649 Support bidi reordering of display and overlay strings.
11650 * xdisp.c (compute_display_string_pos)
11651 (compute_display_string_end): Accept additional argument STRING.
11652 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
11653 (reseat_to_string): Initialize bidi_it->string.s and
11654 bidi_it->string.schars.
11655 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
11656 NULL (avoids a crash in bidi_paragraph_init).
11657 Initialize itb.string.lstring.
11658 (init_iterator): Call bidi_init_it only of a valid
11659 buffer position was specified. Initialize paragraph_embedding to
11660 L2R.
11661 (reseat_to_string): Initialize the bidi iterator.
11662 (display_string): If we need to ignore text properties of
11663 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
11664 original value of -1 will not work with bidi.)
11665 (compute_display_string_pos): First arg is now struct
11666 `text_pos *'; all callers changed. Support display properties on
11667 Lisp strings.
11668 (compute_display_string_end): Support display properties on Lisp
11669 strings.
11670 (init_iterator, reseat_1, reseat_to_string): Initialize the
11671 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
11672 when iterating on a string not from display properties).
11673 (compute_display_string_pos, compute_display_string_end):
11674 Fix calculation of the object to scan. Fixes an error when using
11675 arrow keys.
11676 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
11677 base_level_stop; instead, set base_level_stop to BEGV.
11678 Fixes crashes in vertical-motion.
11679 (next_element_from_buffer): Improve commentary for when
11680 the iterator is before prev_stop.
11681 (init_iterator): Initialize bidi_p from the default value of
11682 bidi-display-reordering, not from buffer-local value. Use the
11683 buffer-local value only if initializing for buffer iteration.
11684 (handle_invisible_prop): Support invisible properties on strings
11685 that are being bidi-reordered.
11686 (set_iterator_to_next): Support bidi reordering of C strings and
11687 Lisp strings.
11688 (next_element_from_string): Support bidi reordering of Lisp
11689 strings.
11690 (handle_stop_backwards): Support Lisp strings as well.
11691 (display_string): Support display of R2L glyph rows.
11692 Use IT_STRING_CHARPOS when displaying from a Lisp string.
11693 (init_iterator): Don't initialize it->bidi_p for strings
11694 here.
11695 (reseat_to_string): Initialize it->bidi_p for strings here.
11696 (next_element_from_string, next_element_from_c_string)
11697 (next_element_from_buffer): Add xassert's for correspondence
11698 between IT's object being iterated and it->bidi_it.string
11699 structure.
11700 (face_before_or_after_it_pos): Support bidi iteration.
11701 (next_element_from_c_string): Handle the case of the first string
11702 character that is not the first one in the visual order.
11703 (get_visually_first_element): New function, refactored from common
11704 parts of next_element_from_buffer, next_element_from_string, and
11705 next_element_from_c_string.
11706 (tool_bar_lines_needed, redisplay_tool_bar)
11707 (display_menu_bar): Force left-to-right direction. Add a FIXME
11708 comment for making that be controlled by a user option.
11709 (push_it, pop_it): Save and restore the state of the
11710 bidi iterator. Save and restore the bidi_p flag.
11711 (pop_it): Iterate out of display property for string iteration as
11712 well.
11713 (iterate_out_of_display_property): Support iteration over strings.
11714 (handle_single_display_spec): Set up it->bidi_it for iteration
11715 over a display string, and call bidi_init_it.
11716 (handle_single_display_spec, next_overlay_string)
11717 (get_overlay_strings_1, push_display_prop): Set up the bidi
11718 iterator for displaying display or overlay strings.
11719 (forward_to_next_line_start): Don't use the shortcut if
11720 bidi-iterating.
11721 (back_to_previous_visible_line_start): If handle_display_prop
11722 pushed the iterator stack, restore the internal state of the bidi
11723 iterator by calling bidi_pop_it same number of times.
11724 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
11725 and we are bidi-iterating, don't decrement the iterator position;
11726 instead, set the first_elt flag in the bidi iterator, to produce
11727 the same effect.
11728 (reseat_1): Remove redundant setting of string_from_display_prop_p.
11729 (push_display_prop): xassert that we are iterating a buffer.
11730 (push_it, pop_it): Save and restore paragraph_embedding member.
11731 (handle_single_display_spec, next_overlay_string)
11732 (get_overlay_strings_1, reseat_1, reseat_to_string)
11733 (push_display_prop): Set up the `unibyte' member of bidi_it.string
11734 correctly. Don't assume unibyte strings are not bidi-reordered.
11735 (compute_display_string_pos)
11736 (compute_display_string_end): Fix handling the case of C string.
11737 (push_it, pop_it): Save and restore from_disp_prop_p.
11738 (handle_single_display_spec, push_display_prop): Set the
11739 from_disp_prop_p flag.
11740 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
11741 (pop_it): Call iterate_out_of_display_property only if we are
11742 popping after iteration over a string that came from a display
11743 property. Fix a typo in popping stretch info. Add an assertion
11744 for verifying that the iterator position is in sync with the bidi
11745 iterator.
11746 (handle_single_display_spec, get_overlay_strings_1)
11747 (push_display_prop): Fix initialization of paragraph direction for
11748 string when that of the parent object is not yet determined.
11749 (reseat_1): Call bidi_init_it to resync the bidi
11750 iterator with IT's position. (Bug#7616)
11751 (find_row_edges): If ROW->start.pos gives position
11752 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
11753 (handle_stop, back_to_previous_visible_line_start, reseat_1):
11754 Reset the from_disp_prop_p flag.
11755 (SAVE_IT, RESTORE_IT): New macros.
11756 (pos_visible_p, face_before_or_after_it_pos)
11757 (back_to_previous_visible_line_start)
11758 (move_it_in_display_line_to, move_it_in_display_line)
11759 (move_it_to, move_it_vertically_backward, move_it_by_lines)
11760 (try_scrolling, redisplay_window, display_line): Use them when
11761 saving a temporary copy of the iterator and restoring it back.
11762 (back_to_previous_visible_line_start, reseat_1)
11763 (init_iterator): Empty the bidi cache "stack".
11764 (move_it_in_display_line_to): If iterator ended up at
11765 EOL, but we never saw any buffer positions smaller than
11766 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
11767 motion in bidi-reordered lines.
11768 (move_it_in_display_line_to): Record prev_method and prev_pos
11769 immediately before the call to set_iterator_to_next. Fixes cursor
11770 motion in bidi-reordered lines with stretch glyphs and strings
11771 displayed in margins. (Bug#8133) (Bug#8867)
11772 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
11773 TO_CHARPOS.
11774 (pos_visible_p): Support positions in bidi-reordered lines.
11775 Save and restore bidi cache.
11776
11777 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
11778 (bidi_paragraph_info): Delete unused struct.
11779 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
11780 (bidi_cache_start): New variable.
11781 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
11782 to zero.
11783 (bidi_cache_fetch_state, bidi_cache_search)
11784 (bidi_cache_find_level_change, bidi_cache_iterator_state)
11785 (bidi_cache_find, bidi_peek_at_next_level)
11786 (bidi_level_of_next_char, bidi_find_other_level_edge)
11787 (bidi_move_to_visually_next): Compare cache index with
11788 bidi_cache_start rather than with zero.
11789 (bidi_fetch_char): Accept new argument STRING; all callers
11790 changed. Support iteration over a string. Support strings with
11791 display properties. Support unibyte strings. Fix the type of
11792 `len' according to what STRING_CHAR_AND_LENGTH expects.
11793 (bidi_paragraph_init, bidi_resolve_explicit_1)
11794 (bidi_resolve_explicit, bidi_resolve_weak)
11795 (bidi_level_of_next_char, bidi_move_to_visually_next):
11796 Support iteration over a string.
11797 (bidi_set_sor_type, bidi_resolve_explicit_1)
11798 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
11799 can now be zero (for strings); special values 0 and -1 were
11800 changed to -1 and -2, respectively.
11801 (bidi_char_at_pos): New function.
11802 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
11803 Call it instead of FETCH_MULTIBYTE_CHAR.
11804 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
11805 initialized to valid values.
11806 (bidi_init_it): Don't initialize charpos and bytepos with invalid
11807 values.
11808 (bidi_level_of_next_char): Allow the sentinel "position" to pass
11809 the test for valid cached positions. Fix the logic for looking up
11810 the sentinel state in the cache. GCPRO the Lisp string we are
11811 iterating.
11812 (bidi_push_it, bidi_pop_it): New functions.
11813 (bidi_initialize): Initialize the bidi cache start stack pointer.
11814 (bidi_cache_ensure_space): New function, refactored from part of
11815 bidi_cache_iterator_state. Don't assume the required size is just
11816 one BIDI_CACHE_CHUNK away.
11817 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
11818 (bidi_count_bytes, bidi_char_at_pos): New functions.
11819 (bidi_cache_search): Don't assume bidi_cache_last_idx is
11820 always valid if bidi_cache_idx is valid.
11821 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
11822 is valid if it's going to be used.
11823 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
11824 (bidi_cache_fetch_state, bidi_cache_search)
11825 (bidi_cache_find_level_change, bidi_cache_ensure_space)
11826 (bidi_cache_iterator_state, bidi_cache_find)
11827 (bidi_find_other_level_edge, bidi_cache_start_stack):
11828 All variables related to cache indices are now EMACS_INT.
11829
11830 * dispextern.h (struct bidi_string_data): New structure.
11831 (struct bidi_it): New member `string'. Make flag members be 1-bit
11832 fields, and put them last in the struct.
11833 (compute_display_string_pos, compute_display_string_end):
11834 Update prototypes.
11835 (bidi_push_it, bidi_pop_it): Add prototypes.
11836 (struct iterator_stack_entry): New members bidi_p,
11837 paragraph_embedding, and from_disp_prop_p.
11838 (struct it): Member bidi_p is now a bit field 1 bit wide.
11839 (bidi_shelve_cache, bidi_unshelve_cache):
11840 Declare prototypes.
11841
11842 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
11843 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
11844 and vector-like objects.
11845
11846 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
11847 cache around display iteration.
11848
11849 * window.c (Fwindow_end, window_scroll_pixel_based)
11850 (displayed_window_lines, Frecenter): Save and restore the bidi
11851 cache around display iteration.
11852
11853 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
11854
11855 * editfns.c (Fdelete_region): Clarify the use of the named
11856 parameters (bug#6788).
11857
11858 2011-07-14 Martin Rudalics <rudalics@gmx.at>
11859
11860 * indent.c (Fvertical_motion): Set and restore w->pointm when
11861 saving and restoring the window's buffer (Bug#9006).
11862
11863 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
11864
11865 * editfns.c (Fstring_to_char): Clarify just what is returned
11866 (bug#6576). Text by Eli Zaretskii.
11867
11868 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
11869
11870 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
11871
11872 2011-07-13 Eli Zaretskii <eliz@gnu.org>
11873
11874 * buffer.c (mmap_find): Fix a typo.
11875
11876 2011-07-13 Johan Bockgård <bojohan@gnu.org>
11877
11878 Fix execution of x selection hooks.
11879 * xselect.c (Qx_lost_selection_functions)
11880 (Qx_sent_selection_functions): New vars.
11881 (syms_of_xselect): DEFSYM them.
11882 (x_handle_selection_request): Pass Qx_sent_selection_functions
11883 rather than Vx_sent_selection_functions to Frun_hook_with_args.
11884 (x_handle_selection_clear,x_clear_frame_selections):
11885 Pass Qx_lost_selection_functions rather than
11886 Vx_lost_selection_functions to Frun_hook_with_args.
11887
11888 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
11889
11890 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
11891 The old code sometimes used this field without initializing it.
11892
11893 * alloc.c (gc_sweep): Don't read past end of array.
11894 In theory, the old code could also have corrupted Emacs internals,
11895 though it'd be very unlikely.
11896
11897 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
11898
11899 * character.c (Fcharacterp): Don't advertise optional ignored
11900 argument. (Bug#4026)
11901
11902 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
11903
11904 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
11905 key" (bug#4257).
11906
11907 * window.c (Fset_window_start): Doc fix (bug#4199).
11908 (Fset_window_hscroll): Ditto.
11909
11910 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
11911
11912 Fix minor new problems caught by GCC 4.6.1.
11913 * term.c (init_tty): Remove unused local.
11914 * xsettings.c (store_monospaced_changed): Define this function only
11915 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
11916 not used otherwise.
11917
11918 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
11919
11920 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
11921
11922 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11923
11924 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
11925 are the mini-buffer and the echo area (bug#3320).
11926
11927 * term.c (init_tty): Remove support for supdup, c10 and perq
11928 terminals, which are no longer supported (bug#1482).
11929
11930 2011-07-10 Johan Bockgård <bojohan@gnu.org>
11931
11932 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
11933
11934 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
11935
11936 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
11937 for non-popups (Bug#3642).
11938
11939 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
11940
11941 * alloc.c (reset_malloc_hooks): Protoize.
11942 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
11943 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
11944 * cm.c (losecursor): Likewise.
11945 * data.c (fmod): Likewise.
11946 * dispnew.c (swap_glyphs_in_rows): Likewise.
11947 * emacs.c (memory_warning_signal): Likewise.
11948 * floatfns.c (float_error): Likewise.
11949 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
11950 (otf_open, font_otf_capability, generate_otf_features)
11951 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
11952 Likewise.
11953 * image.c (pbm_read_file): Likewise.
11954 * indent.c (string_display_width): Likewise.
11955 * intervals.c (check_for_interval, search_for_interval)
11956 (inc_interval_count, count_intervals, root_interval)
11957 (adjust_intervals_for_insertion, make_new_interval): Likewise.
11958 * lread.c (defalias): Likewise.
11959 * ralloc.c (r_alloc_check): Likewise.
11960 * regex.c (set_image_of_range_1, set_image_of_range)
11961 (regex_grow_registers): Likewise.
11962 * sysdep.c (strerror): Likewise.
11963 * termcap.c (valid_filename_p, tprint, main): Likewise.
11964 * tparam.c (main): Likewise.
11965 * unexhp9k800.c (run_time_remap, save_data_space)
11966 (update_file_ptrs, read_header, write_header, calculate_checksum)
11967 (copy_file, copy_rest, display_header): Likewise.
11968 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
11969 Likewise.
11970 * xdisp.c (check_it): Likewise.
11971 * xfaces.c (register_color, unregister_color, unregister_colors):
11972 Likewise.
11973 * xfns.c (print_fontset_result): Likewise.
11974 * xrdb.c (member, fatal, main): Likewise.
11975
11976 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
11977
11978 Fix minor problems found by static checking (Bug#9031).
11979 * chartab.c (char_table_set_range, map_sub_char_table):
11980 Remove unused locals.
11981 (uniprop_table): Now static.
11982 * composite.c (_work_char): Remove unused static var.
11983
11984 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
11985
11986 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
11987
11988 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
11989
11990 * gtkutil.c (qttip_cb): Remove code without function.
11991
11992 2011-07-09 Eli Zaretskii <eliz@gnu.org>
11993
11994 * w32.c (pthread_sigmask): New stub.
11995
11996 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
11997
11998 Use pthread_sigmask, not sigprocmask (Bug#9010).
11999 sigprocmask is portable only for single-threaded applications, and
12000 Emacs can be multi-threaded when it uses GTK.
12001 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
12002 (LIBES): Use it.
12003 * callproc.c (Fcall_process):
12004 * process.c (create_process):
12005 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
12006 Use pthread_sigmask, not sigprocmask.
12007
12008 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12009
12010 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
12011 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
12012 wrong (Bug#8591).
12013
12014 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12015
12016 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
12017 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
12018 (xg_hide_tooltip): Fix comment.
12019
12020 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
12021 in registerServicesMenuSendTypes.
12022 (validRequestorForSendType): Don't check ns_return_types.
12023
12024 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
12025 ns_return_type.
12026
12027 2011-07-08 Jason Rumney <jasonr@gnu.org>
12028
12029 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
12030 SH_SHOW for hidden windows (Bug#5482).
12031
12032 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
12033 frame struct members of non-existent frames (Bug#6284).
12034
12035 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
12036
12037 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
12038 variable firstTime not needed on OSX >= 10.6.
12039 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
12040 >= 10.5. Use setKnobProportion, setDoubleValue.
12041
12042 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
12043 (MAC_OS_X_VERSION_10_5): Define if not defined.
12044 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
12045 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
12046 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
12047
12048 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
12049 cString and lossyCString on OSX >= 10.4.
12050
12051 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
12052 sizeToFit on OSX >= 10.2.
12053
12054 * nsimage.m (allocInitFromFile): Don't use deprecated method
12055 bestRepresentationForDevice on OSX >= 10.6.
12056
12057 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
12058 to avoid warning.
12059
12060 * emacs.c: Declare unexec_init_emacs_zone.
12061
12062 * nsgui.h: Fix compiler warning about gnulib redefining verify.
12063
12064 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
12065
12066 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
12067 on svcsMenu (Bug#8842).
12068
12069 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
12070 ns_return_types.
12071 (Fns_list_services): Just return Qnil on 10.6, code not working there.
12072
12073 * nsterm.m (QUTF8_STRING): Declare.
12074 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
12075 (validRequestorForSendType): Return type is (id).
12076 Change indexOfObjectIdenticalTo to indexOfObject.
12077 Check if we have local selection before returning self (Bug#8842).
12078 (writeSelectionToPasteboard): Put local selection into paste board
12079 if we have a local selection (Bug#8842).
12080 (syms_of_nsterm): DEFSYM QUTF8_STRING.
12081
12082 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
12083 (ns_get_local_selection): Declare.
12084
12085 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
12086
12087 * keymap.c (describe_map_tree): Don't insert a double newline at
12088 the end of the buffer (bug#1169) and return whether we inserted
12089 something.
12090
12091 * callint.c (Fcall_interactively): Change "reading args" to
12092 "providing args" to try to clarify what it does (bug#1010).
12093
12094 2011-07-07 Kenichi Handa <handa@m17n.org>
12095
12096 * composite.c (composition_compute_stop_pos): Ignore a static
12097 composition starting before CHARPOS (Bug#8915).
12098
12099 * xdisp.c (handle_composition_prop): Likewise.
12100
12101 2011-07-07 Eli Zaretskii <eliz@gnu.org>
12102
12103 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
12104 (Bug#9015)
12105
12106 2011-07-07 Kenichi Handa <handa@m17n.org>
12107
12108 * character.h (unicode_category_t): New enum type.
12109
12110 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
12111 (Qchar_code_property_table): New variable.
12112 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
12113 (UNIPROP_COMPRESSED_FORM_P): New macros.
12114 (char_table_ascii): Uncompress the compressed values.
12115 (sub_char_table_ref): New arg is_uniprop. Callers changed.
12116 Uncompress the compressed values.
12117 (sub_char_table_ref_and_range): Likewise.
12118 (char_table_ref_and_range): Uncompress the compressed values.
12119 (sub_char_table_set): New arg is_uniprop. Callers changed.
12120 Uncompress the compressed values.
12121 (sub_char_table_set_range): Args changed. Callers changed.
12122 (char_table_set_range): Adjuted for the above change.
12123 (map_sub_char_table): Delete args default_val and parent. Add arg
12124 top. Give decoded values to a Lisp function.
12125 (map_char_table): Adjust for the above change. Give decoded
12126 values to a Lisp function. Gcpro more variables.
12127 (uniprop_table_uncompress)
12128 (uniprop_decode_value_run_length): New functions.
12129 (uniprop_decoder, uniprop_decoder_count): New variables.
12130 (uniprop_get_decoder, uniprop_encode_value_character)
12131 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
12132 New functions.
12133 (uniprop_encoder, uniprop_encoder_count): New variables.
12134 (uniprop_get_encoder, uniprop_table)
12135 (Funicode_property_table_internal, Fget_unicode_property_internal)
12136 (Fput_unicode_property_internal): New functions.
12137 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
12138 Sunicode_property_table_internal, Sget_unicode_property_internal,
12139 and Sput_unicode_property_internal. Defvar_lisp
12140 char-code-property-alist.
12141
12142 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
12143 Vunicode_category_table.
12144
12145 * font.c (font_range): Adjust for the change of
12146 Vunicode_category_table.
12147
12148 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
12149
12150 * m/iris4d.h: Remove file, move contents ...
12151 * s/irix6-5.h: ... here.
12152
12153 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
12154
12155 Remove unportable assumption about struct layout (Bug#8884).
12156 * alloc.c (mark_buffer):
12157 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
12158 (clone_per_buffer_values): Don't assume that
12159 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
12160 This isn't true in general, and it's particularly not true
12161 if Emacs is configured with --with-wide-int.
12162 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
12163 New macros, used in the buffer.c change.
12164
12165 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
12166
12167 * xsettings.c: Use both GConf and GSettings if both are available.
12168 (store_config_changed_event): Add comment.
12169 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
12170 (store_tool_bar_style_changed): New functions.
12171 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
12172 (struct xsettings): Move font inside HAVE_XFT.
12173 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
12174 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
12175 Move inside HAVE_XFT.
12176 (something_changed_gsettingsCB): Rename from something_changedCB.
12177 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
12178 also.
12179 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
12180 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
12181 (something_changed_gconfCB): Rename from something_changedCB.
12182 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
12183 (parse_settings): Move check for font inside HAVE_XFT.
12184 (read_settings, apply_xft_settings): Add comment.
12185 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
12186 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
12187 call store_font_name_changed.
12188 (xft_settings_event): Add comment.
12189 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
12190 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
12191 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
12192 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
12193 (xsettings_initialize): Call init_gsettings last.
12194 (xsettings_get_system_font, xsettings_get_system_normal_font):
12195 Add comment.
12196
12197 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
12198
12199 Random fixes. E.g., (random) never returned negative values.
12200 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
12201 subseconds part to the entropy, as that's a bit more random.
12202 Prefer signed to unsigned, since the signedness doesn't matter and
12203 in general we prefer signed. When given a limit, use a
12204 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
12205 latter isn't right if USE_2_TAGS_FOR_INTS.
12206 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
12207 not 0..VALMASK. Don't discard "excess" bits that random () returns.
12208
12209 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
12210
12211 * textprop.c (text_property_stickiness):
12212 Obey Vtext_property_default_nonsticky.
12213 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
12214 * w32fns.c (syms_of_w32fns):
12215 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
12216
12217 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12218
12219 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
12220 This is more efficient than Ffile_directory_p and avoids a minor race.
12221
12222 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
12223
12224 * buffer.c (Foverlay_put): Say what the return value is
12225 (bug#7835).
12226
12227 * fileio.c (barf_or_query_if_file_exists): Check first if the file
12228 is a directory before asking whether to use the file name
12229 (bug#7564).
12230 (barf_or_query_if_file_exists): Make the "File is a directory"
12231 error be more correct.
12232
12233 * fns.c (Frequire): Remove the mention of the .gz files, since
12234 that's installation-specific, but keep the mention of
12235 `get-load-suffixes'.
12236
12237 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
12238
12239 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
12240 Report string overflow if the output is too long.
12241
12242 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
12243
12244 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
12245 (syms_of_gnutls): Remove duplicate DEFSYM for
12246 Qgnutls_bootprop_verify_hostname_error, an error for
12247 Qgnutls_bootprop_verify_error (which is no longer used).
12248
12249 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
12250 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
12251 Also (re)move comments that are misplaced or no longer relevant.
12252
12253 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12254
12255 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
12256
12257 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
12258
12259 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
12260 and background color parameters if they have been changed.
12261
12262 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12263
12264 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
12265
12266 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
12267
12268 * xsettings.c (SYSTEM_FONT): Define only when used.
12269 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
12270
12271 * keymap.c (access_keymap_1): Now static.
12272
12273 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
12274
12275 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
12276 leave any prefix arg for the up event (Bug#1586).
12277
12278 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
12279
12280 * lread.c (syms_of_lread): Mention single symbols defined by
12281 `defvar' or `defconst' (bug#7154).
12282
12283 * fns.c (Frequire): Mention .el.gz files (bug#7314).
12284 (Frequire): Mention get-load-suffixes.
12285
12286 2011-07-02 Martin Rudalics <rudalics@gmx.at>
12287
12288 * window.h (window): Remove clone_number slot.
12289 * window.c (Fwindow_clone_number, Fset_window_clone_number):
12290 Remove.
12291 (make_parent_window, make_window, saved_window)
12292 (Fset_window_configuration, save_window_save): Don't deal with
12293 clone numbers.
12294 * buffer.c (Qclone_number): Remove declaration.
12295 (sort_overlays, overlay_strings): Don't deal with clone numbers.
12296
12297 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
12298
12299 Add multiple inheritance to keymaps.
12300 * keymap.c (Fmake_composed_keymap): New function.
12301 (Fset_keymap_parent): Simplify.
12302 (fix_submap_inheritance): Remove.
12303 (access_keymap_1): New function extracted from access_keymap to handle
12304 embedded parents and handle lists of maps.
12305 (access_keymap): Use it.
12306 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
12307 (Fcopy_keymap): Handle embedded parents.
12308 (Fcommand_remapping, define_as_prefix): Simplify.
12309 (Fkey_binding): Simplify.
12310 (syms_of_keymap): Move minibuffer-local-completion-map,
12311 minibuffer-local-filename-completion-map,
12312 minibuffer-local-must-match-map, and
12313 minibuffer-local-filename-must-match-map to Elisp.
12314 (syms_of_keymap): Defsubr make-composed-keymap.
12315 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
12316 (parse_menu_item): Trivial simplification.
12317
12318 2011-07-01 Glenn Morris <rgm@gnu.org>
12319
12320 * Makefile.in (SETTINGS_LIBS): Fix typo.
12321
12322 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
12323
12324 * coding.c (Fencode_coding_string): Record the last coding system
12325 used, as the function doc string says (bug#8738).
12326
12327 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
12328
12329 * xsettings.c (store_monospaced_changed): Take new font as arg and
12330 check for change against current_mono_font.
12331 (EMACS_TYPE_SETTINGS): Remove this and related defines.
12332 (emacs_settings_constructor, emacs_settings_get_property)
12333 (emacs_settings_set_property, emacs_settings_class_init)
12334 (emacs_settings_init, gsettings_obj): Remove.
12335 (something_changedCB): New function for HAVE_GSETTINGS.
12336 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
12337 with value as argument.
12338 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
12339 g_settings_new (Bug#8967). Do not create gsettings_obj.
12340 Remove calls to g_settings_bind. Connect something_changedCB to
12341 "changed".
12342
12343 * xgselect.c: Add defined (HAVE_GSETTINGS).
12344 (xgselect_initialize): Ditto.
12345
12346 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
12347 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
12348 xg_select.
12349
12350 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
12351
12352 * eval.c (struct backtrace): Simplify and port the data structure.
12353 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
12354 signed bit field, as this assumption is not portable and it makes
12355 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
12356 "char debug_on_exit : 1" as this is not portable either; instead,
12357 use the portable "unsigned int debug_on_exit : 1". Remove unused
12358 member evalargs. Remove obsolete comments about cc bombing out.
12359
12360 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
12361
12362 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
12363 Let HAVE_GSETTINGS override HAVE_GCONF.
12364 (store_monospaced_changed): New function.
12365 (EMACS_SETTINGS): A new type derived from GObject to handle
12366 GSettings notifications.
12367 (emacs_settings_constructor, emacs_settings_get_property)
12368 (emacs_settings_set_property, emacs_settings_class_init):
12369 New functions.
12370 (gsettings_client, gsettings_obj): New variables.
12371 (GSETTINGS_SCHEMA): New define.
12372 (something_changedCB): Call store_monospaced_changed.
12373 (init_gsettings): New function.
12374 (xsettings_initialize): Call init_gsettings.
12375 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
12376 to NULL.
12377
12378 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
12379 GCONF_CFLAGS/LIBS.
12380
12381 2011-06-29 Martin Rudalics <rudalics@gmx.at>
12382
12383 * window.c (resize_root_window, grow_mini_window)
12384 (shrink_mini_window): Rename Qresize_root_window to
12385 Qwindow_resize_root_window and Qresize_root_window_vertically to
12386 Qwindow_resize_root_window_vertically.
12387
12388 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
12389
12390 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
12391
12392 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
12393
12394 * makefile.w32-in: Redesign dependencies so they reflect more
12395 clearly which files are directly included by each source file,
12396 and not through other includes.
12397
12398 2011-06-27 Martin Rudalics <rudalics@gmx.at>
12399
12400 * buffer.c (Qclone_number): Declare static and DEFSYM it.
12401 (sort_overlays, overlay_strings): When an overlay's clone number
12402 matches the window's clone number process the overlay even if
12403 the overlay's window property doesn't match the current window.
12404
12405 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
12406 (Fwindow_hchild): Rename to Fwindow_left_child.
12407 (Fwindow_next): Rename to Fwindow_next_sibling.
12408 (Fwindow_prev): Rename to Fwindow_prev_sibling.
12409 (resize_window_check): Rename to window_resize_check.
12410 (resize_window_apply): Rename to window_resize_apply.
12411 (Fresize_window_apply): Rename to Fwindow_resize_apply.
12412 (Fdelete_other_windows_internal, resize_frame_windows)
12413 (Fsplit_window_internal, Fdelete_window_internal)
12414 (grow_mini_window, shrink_mini_window)
12415 (Fresize_mini_window_internal): Fix callers accordingly.
12416
12417 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
12418
12419 * emacsgtkfixed.h: State that this is only used with Gtk+3.
12420 (emacs_fixed_set_min_size): Remove.
12421 (emacs_fixed_new): Take frame as argument.
12422
12423 * emacsgtkfixed.c: State that this is only used with Gtk+3.
12424 (_EmacsFixedPrivate): Remove minwidth/height.
12425 Add struct frame *f.
12426 (emacs_fixed_init): Initialize priv->f.
12427 (get_parent_class, emacs_fixed_set_min_size): Remove.
12428 (emacs_fixed_new): Set priv->f to argument.
12429 (emacs_fixed_get_preferred_width)
12430 (emacs_fixed_get_preferred_height): Use min_width/height from
12431 frames size_hint to set minimum and natural (Bug#8919).
12432 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
12433 and use min_width/height from frames size_hint to set
12434 min_width/height (Bug#8919).
12435
12436 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
12437 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
12438 Fix indentation.
12439
12440 2011-06-26 Eli Zaretskii <eliz@gnu.org>
12441
12442 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
12443 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
12444 called at ZV.
12445
12446 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
12447
12448 * process.c (wait_reading_process_output): Bypass select if
12449 waiting for a cell while ignoring keyboard input, and input is
12450 pending. Suggested by Jan Djärv (Bug#8869).
12451
12452 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
12453
12454 Use gnulib's dup2 module instead of rolling our own.
12455 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
12456
12457 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12458
12459 * dispnew.c (scrolling_window): Before scrolling, turn off a
12460 mouse-highlight in the window being scrolled.
12461
12462 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
12463
12464 Move DEFSYM to lisp.h and use everywhere.
12465
12466 * character.h (DEFSYM): Move declaration...
12467 * lisp.h (DEFSYM): ...here.
12468
12469 * gnutls.c:
12470 * minibuf.c:
12471 * w32menu.c:
12472 * w32proc.c:
12473 * w32select.c: Don't include character.h.
12474
12475 * alloc.c (syms_of_alloc):
12476 * buffer.c (syms_of_buffer):
12477 * bytecode.c (syms_of_bytecode):
12478 * callint.c (syms_of_callint):
12479 * casefiddle.c (syms_of_casefiddle):
12480 * casetab.c (init_casetab_once):
12481 * category.c (init_category_once, syms_of_category):
12482 * ccl.c (syms_of_ccl):
12483 * cmds.c (syms_of_cmds):
12484 * composite.c (syms_of_composite):
12485 * dbusbind.c (syms_of_dbusbind):
12486 * dired.c (syms_of_dired):
12487 * dispnew.c (syms_of_display):
12488 * doc.c (syms_of_doc):
12489 * editfns.c (syms_of_editfns):
12490 * emacs.c (syms_of_emacs):
12491 * eval.c (syms_of_eval):
12492 * fileio.c (syms_of_fileio):
12493 * fns.c (syms_of_fns):
12494 * frame.c (syms_of_frame):
12495 * fringe.c (syms_of_fringe):
12496 * insdel.c (syms_of_insdel):
12497 * keymap.c (syms_of_keymap):
12498 * lread.c (init_obarray, syms_of_lread):
12499 * macros.c (syms_of_macros):
12500 * msdos.c (syms_of_msdos):
12501 * print.c (syms_of_print):
12502 * process.c (syms_of_process):
12503 * search.c (syms_of_search):
12504 * sound.c (syms_of_sound):
12505 * syntax.c (init_syntax_once, syms_of_syntax):
12506 * terminal.c (syms_of_terminal):
12507 * textprop.c (syms_of_textprop):
12508 * undo.c (syms_of_undo):
12509 * w32.c (globals_of_w32):
12510 * window.c (syms_of_window):
12511 * xdisp.c (syms_of_xdisp):
12512 * xfaces.c (syms_of_xfaces):
12513 * xfns.c (syms_of_xfns):
12514 * xmenu.c (syms_of_xmenu):
12515 * xsettings.c (syms_of_xsettings):
12516 * xterm.c (syms_of_xterm): Use DEFSYM.
12517
12518 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
12519
12520 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
12521
12522 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
12523
12524 Integer and buffer overflow fixes (Bug#8873).
12525
12526 * print.c (printchar, strout): Check for string overflow.
12527 (PRINTPREPARE, printchar, strout):
12528 Don't set size unless allocation succeeds.
12529
12530 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
12531 for sizes. Check for string overflow more accurately.
12532 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
12533
12534 * macros.c: Integer and buffer overflow fixes.
12535 * keyboard.h (struct keyboard.kbd_macro_bufsize):
12536 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
12537 Use ptrdiff_t, not int, for sizes.
12538 Don't increment bufsize until after realloc succeeds.
12539 Check for size-calculation overflow.
12540 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
12541
12542 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
12543
12544 * lread.c: Integer overflow fixes.
12545 (read_integer): Radix is now EMACS_INT, not int,
12546 to improve quality of diagnostics for out-of-range radices.
12547 Calculate buffer size correctly for out-of-range radices.
12548 (read1): Check for integer overflow in radices, and in
12549 read-circle numbers.
12550 (read_escape): Avoid int overflow.
12551 (Fload, openp, read_buffer_size, read1)
12552 (substitute_object_recurse, read_vector, read_list, map_obarray):
12553 Use ptrdiff_t, not int, for sizes.
12554 (read1): Use EMACS_INT, not int, for sizes.
12555 Check for size overflow.
12556
12557 * image.c (cache_image): Check for size arithmetic overflow.
12558
12559 * lread.c: Integer overflow issues.
12560 (saved_doc_string_size, saved_doc_string_length)
12561 (prev_saved_doc_string_size, prev_saved_doc_string_length):
12562 Now ptrdiff_t, not int.
12563 (read1): Don't assume doc string length fits in int. Check for
12564 out-of-range doc string lengths.
12565 (read_list): Don't assume file position fits in int.
12566 (read_escape): Check for hex character overflow.
12567
12568 2011-06-22 Leo Liu <sdl.web@gmail.com>
12569
12570 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
12571 Move to minibuffer.el.
12572
12573 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12574
12575 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
12576 The following patches are for when GLYPH_DEBUG && !XASSERT.
12577 * dispextern.h (trace_redisplay_p, dump_glyph_string):
12578 * dispnew.c (flush_stdout):
12579 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
12580 Mark as externally visible.
12581 * dispnew.c (check_window_matrix_pointers): Now static.
12582 * dispnew.c (window_to_frame_vpos):
12583 * xfns.c (unwind_create_frame):
12584 * xterm.c (x_check_font): Remove unused local.
12585 * scroll.c (CHECK_BOUNDS):
12586 * xfaces.c (cache_fache): Rename local to avoid shadowing.
12587 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
12588 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
12589 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
12590 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
12591 Now static.
12592 (debug_method_add): Use va_list and vsprintf rather than relying
12593 on undefined behavior with wrong number of arguments.
12594 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
12595 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
12596 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
12597 since we're not interested in debugging glyphs with old libraries.
12598 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
12599 GCC 4.6.0's static checking.
12600
12601 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
12602
12603 Integer overflow and signedness fixes (Bug#8873).
12604 A few related buffer overrun fixes, too.
12605
12606 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
12607
12608 * dispextern.h (struct face.stipple):
12609 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
12610 (x_bitmap_mask, x_allocate_bitmap_record)
12611 (x_create_bitmap_from_data, x_create_bitmap_from_file)
12612 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
12613 (x_create_bitmap_from_xpm_data):
12614 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
12615 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
12616 (.bitmaps_last):
12617 * xfaces.c (load_pixmap):
12618 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
12619 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
12620 (.bitmaps_last, struct x_output.icon_bitmap):
12621 Use ptrdiff_t, not int, for bitmap indexes.
12622 (x_allocate_bitmap_record): Check for size overflow.
12623 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
12624
12625 Use ptrdiff_t, not int, for overlay counts.
12626 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
12627 * editfns.c (overlays_around, get_pos_property):
12628 * textprop.c (get_char_property_and_overlay):
12629 * xdisp.c (next_overlay_change, note_mouse_highlight):
12630 * xfaces.c (face_at_buffer_position):
12631 * buffer.c (OVERLAY_COUNT_MAX): New macro.
12632 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
12633 (Fnext_overlay_change, Fprevious_overlay_change)
12634 (mouse_face_overlay_overlaps, Foverlays_in):
12635 Use ptrdiff_t, not int, for sizes.
12636 (overlays_at, overlays_in): Check for size-calculation overflow.
12637
12638 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
12639
12640 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
12641 (x_session_initialize): Do not assume string length fits in int.
12642
12643 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
12644 This is unlikely, but can occur if DPI is outlandish.
12645
12646 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
12647 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
12648
12649 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
12650 * xrdb.c (magic_file_p, search_magic_path):
12651 Omit last arg SUFFIX; it was always 0. All callers changed.
12652 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
12653
12654 * xfont.c (xfont_match): Avoid need for strlen.
12655
12656 * xfns.c: Don't assume strlen fits in int.
12657 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
12658
12659 * xdisp.c (message_log_check_duplicate): Return intmax_t,
12660 not unsigned long, as we prefer signed integers. All callers changed.
12661 Detect integer overflow in repeat count.
12662 (message_dolog): Don't assume print length fits in 39 bytes.
12663 (display_mode_element): Don't assume strlen fits in int.
12664
12665 * termcap.c: Don't assume sizes fit in int and never overflow.
12666 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
12667 (gobble_line): Check for size-calculation overflow.
12668
12669 * minibuf.c (Fread_buffer):
12670 * lread.c (intern, intern_c_string):
12671 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
12672 Don't assume string length fits in int.
12673
12674 * keyboard.c (parse_tool_bar_item):
12675 * gtkutil.c (style_changed_cb): Avoid need for strlen.
12676
12677 * font.c: Don't assume string length fits in int.
12678 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
12679 Use ptrdiff_t, not int.
12680 (font_intern_prop): Don't assume string length fits in int.
12681 Don't assume integer property fits in fixnum.
12682 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
12683
12684 * filelock.c: Fix some buffer overrun and integer overflow issues.
12685 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
12686 Reformulate so as not to need the command string.
12687 Invoke gzip -cd rather than gunzip, as it's more portable.
12688 (lock_info_type, lock_file_1, lock_file):
12689 Don't assume pid_t and time_t fit in unsigned long.
12690 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
12691 (current_lock_owner): Prefer signed type for sizes.
12692 Use memcpy, not strncpy, where memcpy is what is really wanted.
12693 Don't assume (via atoi) that time_t and pid_t fit in int.
12694 Check for time_t and/or pid_t out of range, e.g., via a network share.
12695 Don't alloca where an auto var works fine.
12696
12697 * fileio.c: Fix some integer overflow issues.
12698 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
12699 Don't assume string length fits in int.
12700 (directory_file_name): Don't assume string length fits in long.
12701 (make_temp_name): Don't assume pid fits in int, or that its print
12702 length is less than 20.
12703
12704 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
12705
12706 * coding.c (make_subsidiaries): Don't assume string length fits in int.
12707
12708 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
12709
12710 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
12711 We prefer signed integers, even for size calculations.
12712
12713 * emacs.c: Don't assume string length fits in 'int'.
12714 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
12715 (main): Don't invoke strlen when not needed.
12716
12717 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
12718 (XD_DEBUG_MESSAGE): Don't waste a byte.
12719
12720 * callproc.c (getenv_internal_1, getenv_internal)
12721 (Fgetenv_internal):
12722 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
12723
12724 * lread.c (invalid_syntax): Omit length argument.
12725 All uses changed. This doesn't fix a bug, but it simplifies the
12726 code away from its former Hollerith-constant appearance, and it's
12727 one less 'int' to worry about when looking at integer-overflow issues.
12728 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
12729
12730 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
12731 This didn't break anything, but it didn't help either.
12732 It's confusing to put a bogus integer in a place where the actual
12733 value does not matter.
12734 (LIST_END_P): Remove unused macro and its bogus comment.
12735 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
12736
12737 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
12738 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
12739 implementation.
12740 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
12741 We prefer signed types, and the value cannot exceed the EMACS_INT
12742 range anyway (because otherwise the length would not be representable).
12743 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
12744 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
12745 This avoids a GCC warning when WIDE_EMACS_INT.
12746
12747 * indent.c (sane_tab_width): New function.
12748 (current_column, scan_for_column, Findent_to, position_indentation)
12749 (compute_motion): Use it. This is just for clarity.
12750 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
12751
12752 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
12753
12754 * lisp.h (lint_assume): New macro.
12755 * composite.c (composition_gstring_put_cache):
12756 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
12757
12758 * editfns.c, insdel.c:
12759 Omit unnecessary forward decls, to simplify future changes.
12760
12761 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
12762
12763 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
12764
12765 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
12766 Use much-faster test for byte-length change.
12767 Don't assume string byte-length fits in 'int'.
12768 Check that character arg fits in 'int'.
12769 (mapcar1): Declare byte as byte, for clarity.
12770
12771 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
12772
12773 * fns.c (concat): Catch string overflow earlier.
12774 Do not rely on integer wraparound.
12775
12776 * dispextern.h (struct it.overlay_strings_charpos)
12777 (struct it.selective): Now EMACS_INT, not int.
12778 * xdisp.c (forward_to_next_line_start)
12779 (back_to_previous_visible_line_start)
12780 (reseat_at_next_visible_line_start, next_element_from_buffer):
12781 Don't arbitrarily truncate the value of 'selective' to int.
12782
12783 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
12784
12785 * composite.c: Don't truncate sizes to 'int'.
12786 (composition_gstring_p, composition_reseat_it)
12787 (composition_adjust_point): Use EMACS_INT, not int.
12788 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
12789 not EMACS_UINT, for indexes.
12790
12791 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
12792
12793 * buffer.c: Include <verify.h>.
12794 (struct sortvec.priority, struct sortstr.priority):
12795 Now EMACS_INT, not int.
12796 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
12797 (struct sortstr.size, record_overlay_string)
12798 (struct sortstrlist.size, struct sortlist.used):
12799 Don't truncate size to int.
12800 (record_overlay_string): Check for size-calculation overflow.
12801 (init_buffer_once): Check at compile-time, not run-time.
12802
12803 2011-06-22 Jim Meyering <meyering@redhat.com>
12804
12805 Don't leak an XBM-image-sized buffer
12806 * image.c (xbm_load): Free the image buffer after using it.
12807
12808 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
12809
12810 Port to Sun C.
12811 * composite.c (find_automatic_composition): Omit needless 'return 0;'
12812 that Sun C diagnosed.
12813 * fns.c (secure_hash): Fix pointer signedness issue.
12814 * intervals.c (static_offset_intervals): New function.
12815 (offset_intervals): Use it.
12816
12817 2011-06-21 Leo Liu <sdl.web@gmail.com>
12818
12819 * deps.mk (fns.o):
12820 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
12821 sha512.h.
12822
12823 * fns.c (secure_hash): Rename from crypto_hash_function and change
12824 the first arg to accept symbols.
12825 (Fsecure_hash): New primitive.
12826 (syms_of_fns): New symbols.
12827
12828 2011-06-20 Deniz Dogan <deniz@dogan.se>
12829
12830 * process.c (Fset_process_buffer): Clarify return value in
12831 docstring.
12832
12833 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
12834
12835 * dispnew.c (add_window_display_history): Use BVAR.
12836
12837 * xdisp.c (debug_method_add): Use BVAR.
12838 (check_window_end, dump_glyph_matrix, dump_glyph)
12839 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
12840
12841 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
12842 Likewise.
12843
12844 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
12845 check till after the cache is created in init_frame_faces.
12846
12847 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
12848
12849 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
12850
12851 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
12852
12853 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
12854 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
12855 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
12856
12857 Improve buffer-overflow checking (Bug#8873).
12858 * fileio.c (Finsert_file_contents):
12859 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
12860 Remove the old (too-loose) buffer overflow checks.
12861 They weren't needed, since make_gap checks for buffer overflow.
12862 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
12863 The old code merely checked for Emacs fixnum overflow, and relied
12864 on undefined (wraparound) behavior. The new code avoids undefined
12865 behavior, and also checks for ptrdiff_t and/or size_t overflow.
12866
12867 * editfns.c (Finsert_char): Don't dump core with very negative counts.
12868 Tune. Don't use wider integers than needed. Don't use alloca.
12869 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
12870
12871 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
12872
12873 * insdel.c, lisp.h (buffer_overflow): New function.
12874 (insert_from_buffer_1, replace_range, replace_range_2):
12875 * insdel.c (make_gap_larger):
12876 * editfns.c (Finsert_char):
12877 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
12878
12879 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
12880
12881 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
12882
12883 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
12884
12885 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
12886 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
12887
12888 * fileio.c: Don't assume EMACS_INT fits in off_t.
12889 (emacs_lseek): New static function.
12890 (Finsert_file_contents, Fwrite_region): Use it.
12891 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
12892
12893 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
12894
12895 * fns.c: Don't overflow int when computing a list length.
12896 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
12897 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
12898 truncation on 64-bit hosts. Check for QUIT every
12899 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
12900 faster and is responsive enough.
12901 (Flength): Report an error instead of overflowing an integer.
12902 (Fsafe_length): Return a float if the value is not representable
12903 as a fixnum. This shouldn't happen except in contrived situations.
12904 (Fnthcdr, Fsort): Don't assume list length fits in int.
12905 (Fcopy_sequence): Don't assume vector length fits in int.
12906
12907 * alloc.c: Check that resized vectors' lengths fit in fixnums.
12908 (header_size, word_size): New constants.
12909 (allocate_vectorlike): Don't check size overflow here.
12910 (allocate_vector): Check it here instead, since this is the only
12911 caller of allocate_vectorlike that could cause overflow.
12912 Check that the new vector's length is representable as a fixnum.
12913
12914 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
12915 The previous code was bogus. For example, next_almost_prime (32)
12916 returned 39, which is undesirable as it is a multiple of 3; and
12917 next_almost_prime (24) returned 25, which is a multiple of 5 so
12918 why was the code bothering to check for multiples of 7?
12919
12920 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
12921
12922 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
12923
12924 Variadic C functions now count arguments with ptrdiff_t.
12925 This partly undoes my 2011-03-30 change, which replaced int with size_t.
12926 Back then I didn't know that the Emacs coding style prefers signed int.
12927 Also, in the meantime I found a few more instances where arguments
12928 were being counted with int, which may truncate counts on 64-bit
12929 machines, or EMACS_INT, which may be unnecessarily wide.
12930 * lisp.h (struct Lisp_Subr.function.aMANY)
12931 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
12932 Arg counts are now ptrdiff_t, not size_t.
12933 All variadic functions and their callers changed accordingly.
12934 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
12935 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
12936 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
12937 * callint.c (Fcall_interactively): Check arg count for overflow,
12938 to avoid potential buffer overrun. Use signed char, not 'int',
12939 for 'varies' array, so that we needn't bother to check its size
12940 calculation for overflow.
12941 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
12942 * eval.c (apply_lambda):
12943 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
12944 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
12945 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
12946
12947 * callint.c (Fcall_interactively): Don't use index var as event count.
12948
12949 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
12950 * mem-limits.h (SIZE): Remove; no longer used.
12951
12952 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
12953
12954 Remove unnecessary casts.
12955 * xterm.c (x_term_init):
12956 * xfns.c (x_set_border_pixel):
12957 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
12958 These aren't needed now that we assume ANSI C.
12959
12960 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
12961 It's more likely to cause problems (due to unsigned overflow)
12962 than to cure them.
12963
12964 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
12965
12966 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
12967
12968 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
12969
12970 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
12971
12972 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
12973
12974 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
12975
12976 GLYPH_CODE_FACE returns EMACS_INT, not int.
12977 * dispextern.h (merge_faces):
12978 * xfaces.c (merge_faces):
12979 * xdisp.c (get_next_display_element, next_element_from_display_vector):
12980 Don't assume EMACS_INT fits in int.
12981
12982 * character.h (CHAR_VALID_P): Remove unused parameter.
12983 * fontset.c, lisp.h, xdisp.c: All uses changed.
12984
12985 * editfns.c (Ftranslate_region_internal): Omit redundant test.
12986
12987 * fns.c (concat): Minor tuning based on overflow analysis.
12988 This doesn't fix any bugs. Use int to hold character, instead
12989 of constantly refetching from Emacs object. Use XFASTINT, not
12990 XINT, for value known to be a character. Don't bother comparing
12991 a single byte to 0400, as it's always less.
12992
12993 * floatfns.c (Fexpt):
12994 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
12995
12996 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
12997 for characters.
12998
12999 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
13000
13001 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
13002 Without this fix, on a 64-bit host (aset S 0 4294967386) would
13003 incorrectly succeed when S was a string, because 4294967386 was
13004 truncated before it was used.
13005
13006 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
13007 Otherwise, an out-of-range integer could cause undefined behavior
13008 on a 64-bit host.
13009
13010 * composite.c: Use int, not EMACS_INT, for characters.
13011 (fill_gstring_body, composition_compute_stop_pos): Use int, not
13012 EMACS_INT, for values that are known to be in character range.
13013 This doesn't fix any bugs but is the usual style inside Emacs and
13014 may generate better code on 32-bit machines.
13015
13016 Make sure a 64-bit char is never passed to ENCODE_CHAR.
13017 This is for reasons similar to the recent CHAR_STRING fix.
13018 * charset.c (Fencode_char): Check that character arg is actually
13019 a character. Pass an int to ENCODE_CHAR.
13020 * charset.h (ENCODE_CHAR): Verify that the character argument is no
13021 wider than 'int', as a compile-time check to prevent future regressions
13022 in this area.
13023
13024 * character.c (char_string): Remove unnecessary casts.
13025
13026 Make sure a 64-bit char is never passed to CHAR_STRING.
13027 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
13028 by silently ignoring the top 32 bits, allowing some values
13029 that were far too large to be valid characters.
13030 * character.h: Include <verify.h>.
13031 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
13032 arguments are no wider than unsigned, as a compile-time check
13033 to prevent future regressions in this area.
13034 * data.c (Faset):
13035 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13036 (Fsubst_char_in_region):
13037 * fns.c (concat):
13038 * xdisp.c (decode_mode_spec_coding):
13039 Adjust to CHAR_STRING's new requirement.
13040 * editfns.c (Finsert_char, Fsubst_char_in_region):
13041 * fns.c (concat): Check that character args are actually
13042 characters. Without this test, these functions did the wrong
13043 thing with wildly out-of-range values on 64-bit hosts.
13044
13045 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
13046 These casts should not be needed on 32-bit hosts, either.
13047 * keyboard.c (read_char):
13048 * lread.c (Fload): Remove casts to unsigned.
13049
13050 * lisp.h (UNSIGNED_CMP): New macro.
13051 This fixes comparison bugs on 64-bit hosts.
13052 (ASCII_CHAR_P): Use it.
13053 * casefiddle.c (casify_object):
13054 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
13055 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
13056 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
13057 * dispextern.h (FACE_FROM_ID):
13058 * keyboard.c (read_char): Use UNSIGNED_CMP.
13059
13060 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
13061 not to EMACS_INT, to avoid GCC warning.
13062
13063 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
13064
13065 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
13066 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
13067 isn't needed on 32-bit machines.
13068
13069 * buffer.c (Fgenerate_new_buffer_name):
13070 Use EMACS_INT for count, not int.
13071 (advance_to_char_boundary): Return EMACS_INT, not int.
13072
13073 * data.c (Qcompiled_function): Now static.
13074
13075 * window.c (window_body_lines): Now static.
13076
13077 * image.c (gif_load): Rename local to avoid shadowing.
13078
13079 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
13080 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
13081 * alloc.c (make_save_value): Integer argument is now of type
13082 ptrdiff_t, not int.
13083 (mark_object): Use ptrdiff_t, not int.
13084 * lisp.h (pD): New macro.
13085 * print.c (print_object): Use it.
13086
13087 * alloc.c: Use EMACS_INT, not int, to count objects.
13088 (total_conses, total_markers, total_symbols, total_vector_size)
13089 (total_free_conses, total_free_markers, total_free_symbols)
13090 (total_free_floats, total_floats, total_free_intervals)
13091 (total_intervals, total_strings, total_free_strings):
13092 Now EMACS_INT, not int. All uses changed.
13093 (Fgarbage_collect): Compute overall total using a double, so that
13094 integer overflow is less likely to be a problem. Check for overflow
13095 when converting back to an integer.
13096 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
13097 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
13098 These were 'int' variables that could overflow on 64-bit hosts;
13099 they were never used, so remove them instead of repairing them.
13100 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
13101 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
13102 Previously, this ceilinged at INT_MAX, but that doesn't work on
13103 64-bit machines.
13104 (allocate_pseudovector): Don't use EMACS_INT when int would do.
13105
13106 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
13107 (allocate_vectorlike): Check for ptrdiff_t overflow.
13108 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
13109 when a (possibly-narrower) signed value would do just as well.
13110 We prefer using signed arithmetic, to avoid comparison confusion.
13111
13112 * alloc.c: Catch some string size overflows that we were missing.
13113 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
13114 for convenience in STRING_BYTES_MAX.
13115 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
13116 The definition here is exact; the one in lisp.h was approximate.
13117 (allocate_string_data): Check for string overflow. This catches
13118 some instances we weren't catching before. Also, it catches
13119 size_t overflow on (unusual) hosts where SIZE_MAX <= min
13120 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
13121 and ptrdiff_t and EMACS_INT are both 64 bits.
13122
13123 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
13124 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
13125 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
13126
13127 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
13128
13129 * alloc.c (Fmake_string): Check for out-of-range init.
13130
13131 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
13132
13133 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
13134
13135 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
13136
13137 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
13138 xg_get_default_scrollbar_width.
13139
13140 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
13141 (int_gtk_range_get_value): Move to the scroll bar part of the file.
13142 (style_changed_cb): Call update_theme_scrollbar_width and call
13143 x_set_scroll_bar_default_width and xg_frame_set_char_size for
13144 all frames (Bug#8505).
13145 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
13146 Call gtk_window_set_resizable if HAVE_GTK3.
13147 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
13148 and height if HAVE_GTK3 (Bug#8505).
13149 (scroll_bar_width_for_theme): New variable.
13150 (update_theme_scrollbar_width): New function.
13151 (xg_get_default_scrollbar_width): Move code to
13152 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
13153 (xg_initialize): Call update_theme_scrollbar_width.
13154
13155 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
13156
13157 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
13158
13159 2011-06-12 Martin Rudalics <rudalics@gmx.at>
13160
13161 * frame.c (make_frame): Call other_buffer_safely instead of
13162 other_buffer.
13163
13164 * window.c (temp_output_buffer_show): Call display_buffer with
13165 second argument Vtemp_buffer_show_specifiers and reset latter
13166 immediately after the call.
13167 (Vtemp_buffer_show_specifiers): New variable.
13168 (auto_window_vscroll_p, next_screen_context_lines)
13169 (Vscroll_preserve_screen_position): Remove leading asterisks from
13170 doc-strings.
13171
13172 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
13173
13174 Fix minor problems found by GCC 4.6.0 static checking.
13175 * buffer.c (Qclone_number): Remove for now, as it's unused.
13176 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
13177 (record_buffer): Remove unused local.
13178 * frame.c (other_visible_frames, frame_buffer_list): Now static.
13179 (set_frame_buffer_list): Remove; unused.
13180 * frame.h (other_visible_frames): Remove decl.
13181 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
13182 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
13183 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
13184 if HAVE_GPM.
13185 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
13186 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
13187 Define only if HAVE_GPM.
13188 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
13189 (update_hints_inhibit): Remove; never set. All uses removed.
13190 * widgetprv.h (emacsFrameClassRec): Remove decl.
13191 * window.c (delete_deletable_window): Now returns void, since it
13192 wasn't returning anything.
13193 (compare_window_configurations): Remove unused locals.
13194 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
13195 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
13196 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
13197 the same widths as pointers. This follows up on the 2011-05-06 patch.
13198 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
13199 * xterm.h: Likewise.
13200 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
13201
13202 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
13203
13204 * makefile.w32-in: Update dependencies.
13205 (LISP_H): Add lib/intprops.h.
13206
13207 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13208
13209 * image.c (gif_load): Add animation frame delay to the metadata.
13210 (syms_of_image): Use DEFSYM. New symbol `delay'.
13211
13212 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13213
13214 * window.c (delete_deletable_window): Re-add.
13215 (Fset_window_configuration): Rewrite to handle dead buffers and
13216 consequently deletable windows.
13217 (window_tree, Fwindow_tree): Remove. Supply functionality in
13218 window.el.
13219 (compare_window_configurations): Simplify code.
13220
13221 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
13222
13223 * image.c (imagemagick_load_image): Fix type mismatch.
13224 (Fimagemagick_types): Likewise.
13225
13226 * window.h (replace_buffer_in_windows): Declare.
13227
13228 2011-06-11 Martin Rudalics <rudalics@gmx.at>
13229
13230 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
13231 Qclone_number. Remove external declaration of Qdelete_window.
13232 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
13233 code.
13234 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
13235 Run Qbuffer_list_update_hook if allowed.
13236 (Fother_buffer): Rewrite doc-string. Major rewrite for new
13237 buffer list implementation.
13238 (other_buffer_safely): New function.
13239 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
13240 calls to replace_buffer_in_windows and
13241 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
13242 if allowed.
13243 (record_buffer): Inhibit quitting and rewrite using quittable
13244 functions. Run Qbuffer_list_update_hook if allowed.
13245 (Frecord_buffer, Funrecord_buffer): New functions.
13246 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
13247 Move switch-to-buffer to window.el.
13248 (bury-buffer): Move to window.el.
13249 (Vbuffer_list_update_hook): New variable.
13250
13251 * lisp.h (other_buffer_safely): Add prototype in buffer.c
13252 section.
13253
13254 * window.h (resize_frame_windows): Move up in code.
13255 (Fwindow_frame): Remove EXFUN.
13256 (replace_buffer_in_all_windows): Remove prototype.
13257 (replace_buffer_in_windows_safely): Add prototype.
13258
13259 * window.c: Declare Qdelete_window static again. Move down
13260 declaration of select_count.
13261 (Fnext_window, Fprevious_window): Rewrite doc-strings.
13262 (Fother_window): Move to window.el.
13263 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
13264 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
13265 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
13266 window.el.
13267 (replace_buffer_in_windows): Implement by calling
13268 Qreplace_buffer_in_windows.
13269 (replace_buffer_in_all_windows): Remove with some functionality
13270 moved into replace_buffer_in_windows_safely.
13271 (replace_buffer_in_windows_safely): New function.
13272 (select_window_norecord, select_frame_norecord): Move in front
13273 of run_window_configuration_change_hook. Remove now obsolete
13274 declarations.
13275 (Fset_window_buffer): Rewrite doc-string.
13276 Call Qrecord_window_buffer.
13277 (keys_of_window): Move binding for other-window to window.el.
13278
13279 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
13280
13281 * dispextern.h (struct image): Replace data member, whose int_val
13282 and ptr_val fields were not used by anything, with a single
13283 lisp_val object.
13284
13285 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
13286 (gif_clear_image, gif_load, imagemagick_load_image)
13287 (gs_clear_image, gs_load): Callers changed.
13288
13289 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
13290
13291 * buffer.h: Include <time.h>, for time_t.
13292 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
13293
13294 Fix minor problems found by static checking.
13295
13296 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
13297
13298 Make identifiers static if they are not used in other modules.
13299 * data.c (Qcompiled_function, Qframe, Qvector):
13300 * image.c (QimageMagick, Qsvg):
13301 * minibuf.c (Qmetadata):
13302 * window.c (resize_window_check, resize_root_window): Now static.
13303 * window.h (resize_window_check, resize_root_window): Remove decls.
13304
13305 * window.c (window_deletion_count, delete_deletable_window):
13306 Remove; unused.
13307 (window_body_lines): Now static.
13308 (Fdelete_other_windows_internal): Mark vars as initialized.
13309 Make sure 'resize_failed' is initialized.
13310 (run_window_configuration_change_hook): Rename local to avoid shadowing.
13311 (resize_window_apply): Remove unused local.
13312 * window.h (delete_deletable_window): Remove decl.
13313
13314 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
13315 (imagemagick_load_image): Fix pointer signedness problem by changing
13316 last arg from unsigned char * to char *. All uses changed.
13317 Also, fix a local for similar reasons.
13318 Remove unused locals. Remove locals to avoid shadowing.
13319 (fn_rsvg_handle_free): Remove; unused.
13320 (svg_load, svg_load_image): Fix pointer signedness problem.
13321 (imagemagick_load_image): Don't use garbage pointer image_wand.
13322
13323 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
13324
13325 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
13326
13327 * image.c (gif_load): Fix omitted cast error introduced by
13328 2011-06-06 change.
13329
13330 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13331
13332 * window.h (resize_proportionally, orig_total_lines)
13333 (orig_top_line): Remove from window structure.
13334 (set_window_height, set_window_width, change_window_heights)
13335 (Fdelete_window): Remove prototypes.
13336 (resize_frame_windows): Remove duplicate declaration.
13337
13338 2011-06-10 Eli Zaretskii <eliz@gnu.org>
13339
13340 * window.h (resize_frame_windows, resize_window_check)
13341 (delete_deletable_window, resize_root_window)
13342 (resize_frame_windows): Declare prototypes.
13343
13344 * window.c (resize_window_apply): Make definition be "static" to
13345 match the prototype.
13346
13347 2011-06-10 Martin Rudalics <rudalics@gmx.at>
13348
13349 * window.c: Remove declarations of Qwindow_size_fixed,
13350 window_min_size_1, window_min_size_2, window_min_size,
13351 size_window, window_fixed_size_p, enlarge_window, delete_window.
13352 Remove static from declaration of Qdelete_window, it's
13353 temporarily needed by Fbury_buffer.
13354 (replace_window): Don't assign orig_top_line and
13355 orig_total_lines.
13356 (Fdelete_window, delete_window): Remove. Window deletion is
13357 handled by window.el.
13358 (window_loop): Remove DELETE_OTHER_WINDOWS case.
13359 Replace Fdelete_window calls with calls to Qdelete_window.
13360 (Fdelete_other_windows): Remove. Deleting other windows is
13361 handled by window.el.
13362 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
13363 handled in window.el.
13364 (window_min_size_2, window_min_size_1, window_min_size): Remove.
13365 Window minimum sizes are handled in window.el.
13366 (shrink_windows, size_window, set_window_height)
13367 (set_window_width, change_window_heights, window_height)
13368 (window_width, CURBEG, CURSIZE, enlarge_window)
13369 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
13370 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
13371 handled in window.el.
13372 (make_dummy_parent): Rename to make_parent_window and give it a
13373 second argument horflag.
13374 (make_window): Don't set resize_proportionally any more.
13375 (Fsplit_window): Remove. Windows are split in window.el.
13376 (save_restore_action, save_restore_orig_size)
13377 (shrink_window_lowest_first, save_restore_orig_size): Remove.
13378 Resize mini windows in window.el.
13379 (grow_mini_window, shrink_mini_window): Implement by calling
13380 Qresize_root_window_vertically, resize_window_check and
13381 resize_window_apply.
13382 (saved_window, Fset_window_configuration, save_window_save):
13383 Do not handle orig_top_line, orig_total_lines, and
13384 resize_proportionally.
13385 (window_min_height, window_min_width): Move to window.el.
13386 (keys_of_window): Move bindings for delete-other-windows,
13387 split-window, delete-window and enlarge-window to window.el.
13388
13389 * buffer.c: Temporarily extern Qdelete_window.
13390 (Fbury_buffer): Temporarily call Qdelete_window instead of
13391 Fdelete_window (Fbury_buffer will move to window.el soon).
13392
13393 * frame.c (set_menu_bar_lines_1): Remove code handling
13394 orig_top_line and orig_total_lines.
13395
13396 * dispnew.c (adjust_frame_glyphs_initially): Don't use
13397 set_window_height but set heights directly.
13398 (change_frame_size_1): Use resize_frame_windows.
13399
13400 * xdisp.c (init_xdisp): Don't use set_window_height but set
13401 heights directly.
13402
13403 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
13404 Use resize_frame_windows instead of change_window_heights and run
13405 run_window_configuration_change_hook.
13406
13407 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
13408 instead of change_window_heights and run
13409 run_window_configuration_change_hook.
13410
13411 2011-06-09 Martin Rudalics <rudalics@gmx.at>
13412
13413 * window.c (replace_window): Rename second argument REPLACEMENT to
13414 NEW. New third argument SETFLAG. Rewrite.
13415 (delete_window, make_dummy_parent): Call replace_window with
13416 third argument 1.
13417 (window_list_1): Move down in code.
13418 (run_window_configuration_change_hook): Move set_buffer part
13419 before select_frame_norecord part in order to unwind correctly.
13420 Rename count1 to count.
13421 (recombine_windows, delete_deletable_window, resize_root_window)
13422 (Fdelete_other_windows_internal)
13423 (Frun_window_configuration_change_hook, make_parent_window)
13424 (resize_window_check, resize_window_apply, Fresize_window_apply)
13425 (resize_frame_windows, Fsplit_window_internal)
13426 (Fdelete_window_internal, Fresize_mini_window_internal):
13427 New functions.
13428 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
13429
13430 2011-06-08 Martin Rudalics <rudalics@gmx.at>
13431
13432 * window.h (window): Add some new members to window structure -
13433 normal_lines, normal_cols, new_total, new_normal, clone_number,
13434 splits, nest, prev_buffers, next_buffers.
13435 (WINDOW_TOTAL_SIZE): Move here from window.c.
13436 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
13437
13438 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
13439 Remove.
13440 (make_dummy_parent): Set new members of windows structure.
13441 (make_window): Move down in code. Handle new members of window
13442 structure.
13443 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
13444 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
13445 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
13446 (Fset_window_prev_buffers, Fwindow_next_buffers)
13447 (Fset_window_next_buffers, Fset_window_clone_number):
13448 New functions.
13449 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
13450 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
13451 Doc-string fixes.
13452 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
13453 Argument WINDOW can be now internal window too.
13454 (Fwindow_use_time): Move up in code.
13455 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
13456 Rewrite doc-string.
13457 (Fset_window_configuration, saved_window)
13458 (Fcurrent_window_configuration, save_window_save): Handle new
13459 members of window structure.
13460 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
13461 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
13462 (syms_of_window): New Lisp objects Qrecord_window_buffer,
13463 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
13464 Qget_mru_window, Qresize_root_window,
13465 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
13466 Qauto_buffer_name; staticpro them.
13467
13468 2011-06-07 Martin Rudalics <rudalics@gmx.at>
13469
13470 * window.c (Fwindow_total_size, Fwindow_left_column)
13471 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
13472 (Fwindow_list_1): New functions.
13473 (window_box_text_cols): Replace with window_body_cols.
13474 (Fwindow_width, Fscroll_left, Fscroll_right):
13475 Use window_body_cols instead of window_box_text_cols.
13476 (delete_window, Fset_window_configuration):
13477 Call delete_all_subwindows with window as argument.
13478 (delete_all_subwindows): Take a window as argument and not a
13479 structure. Rewrite.
13480 (window_loop): Remove handling of GET_LRU_WINDOW and
13481 GET_LARGEST_WINDOW.
13482 (Fget_lru_window, Fget_largest_window): Move to window.el.
13483
13484 * window.h: Extern window_body_cols instead of
13485 window_box_text_cols. delete_all_subwindows now takes a
13486 Lisp_Object as argument.
13487
13488 * indent.c (compute_motion, Fcompute_motion):
13489 Use window_body_cols instead of window_box_text_cols.
13490
13491 * frame.c (delete_frame): Call delete_all_subwindows with root
13492 window as argument.
13493
13494 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
13495
13496 * fns.c (Fputhash): Document return value.
13497
13498 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
13499
13500 * image.c (gif_load): Implement gif89a spec "no disposal" method.
13501
13502 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13503
13504 Cons<->int and similar integer overflow fixes (Bug#8794).
13505
13506 Check for overflow when converting integer to cons and back.
13507 * charset.c (Fdefine_charset_internal, Fdecode_char):
13508 Use cons_to_unsigned to catch overflow.
13509 (Fencode_char): Use INTEGER_TO_CONS.
13510 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
13511 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
13512 * data.c (long_to_cons, cons_to_long): Remove.
13513 (cons_to_unsigned, cons_to_signed): New functions.
13514 These signal an error for invalid or out-of-range values.
13515 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
13516 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
13517 * font.c (Ffont_variation_glyphs):
13518 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
13519 * lisp.h: Include <intprops.h>.
13520 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
13521 (cons_to_signed, cons_to_unsigned): New decls.
13522 (long_to_cons, cons_to_long): Remove decls.
13523 * undo.c (record_first_change): Use INTEGER_TO_CONS.
13524 (Fprimitive_undo): Use CONS_TO_INTEGER.
13525 * xfns.c (Fx_window_property): Likewise.
13526 * xselect.c: Include <limits.h>.
13527 (x_own_selection, selection_data_to_lisp_data):
13528 Use INTEGER_TO_CONS.
13529 (x_handle_selection_request, x_handle_selection_clear)
13530 (x_get_foreign_selection, Fx_disown_selection_internal)
13531 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
13532 (lisp_data_to_selection_data): Use cons_to_unsigned.
13533 (x_fill_property_data): Use cons_to_signed.
13534 Report values out of range.
13535
13536 Check for buffer and string overflow more precisely.
13537 * buffer.h (BUF_BYTES_MAX): New macro.
13538 * lisp.h (STRING_BYTES_MAX): New macro.
13539 * alloc.c (Fmake_string):
13540 * character.c (string_escape_byte8):
13541 * coding.c (coding_alloc_by_realloc):
13542 * doprnt.c (doprnt):
13543 * editfns.c (Fformat):
13544 * eval.c (verror):
13545 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
13546 since they may not be the same number.
13547 * editfns.c (Finsert_char):
13548 * fileio.c (Finsert_file_contents):
13549 Likewise for BUF_BYTES_MAX.
13550
13551 * image.c: Use ptrdiff_t, not int, for sizes.
13552 (slurp_file): Switch from int to ptrdiff_t.
13553 All uses changed.
13554 (slurp_file): Check that file size fits in both size_t (for
13555 malloc) and ptrdiff_t (for sanity and safety).
13556
13557 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
13558 if b->modtime has its maximal value.
13559
13560 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
13561
13562 Don't assume time_t can fit into int.
13563 * buffer.h (struct buffer.modtime): Now time_t, not int.
13564 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
13565 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
13566
13567 Minor fixes for signed vs unsigned integers.
13568 * character.h (MAYBE_UNIFY_CHAR):
13569 * charset.c (maybe_unify_char):
13570 * keyboard.c (read_char, reorder_modifiers):
13571 XINT -> XFASTINT, since the integer must be nonnegative.
13572 * ftfont.c (ftfont_spec_pattern):
13573 * keymap.c (access_keymap, silly_event_symbol_error):
13574 XUINT -> XFASTINT, since the integer must be nonnegative.
13575 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
13576 since it makes no difference and we prefer signed.
13577 * keyboard.c (record_char): Use XUINT when all the neighbors do.
13578 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
13579 nonnegative.
13580
13581 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
13582
13583 * window.h (Fwindow_frame): Declare.
13584
13585 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13586
13587 * alloc.c: Simplify handling of large-request failures (Bug#8800).
13588 (SPARE_MEMORY): Always define.
13589 (LARGE_REQUEST): Remove.
13590 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
13591
13592 2011-06-06 Martin Rudalics <rudalics@gmx.at>
13593
13594 * lisp.h: Move EXFUNS for Fframe_root_window,
13595 Fframe_first_window and Fset_frame_selected_window to window.h.
13596
13597 * window.h: Move EXFUNS for Fframe_root_window,
13598 Fframe_first_window and Fset_frame_selected_window here from
13599 lisp.h.
13600
13601 * frame.c (Fwindow_frame, Fframe_first_window)
13602 (Fframe_root_window, Fframe_selected_window)
13603 (Fset_frame_selected_window): Move to window.c.
13604 (Factive_minibuffer_window): Move to minibuf.c.
13605 (Fother_visible_frames_p): New function.
13606
13607 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
13608
13609 * window.c (decode_window, decode_any_window): Move up in code.
13610 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
13611 (inhibit_frame_unsplittable): Remove unused variable.
13612 (Fwindow_buffer): Move up and rewrite doc-string.
13613 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
13614 (Fwindow_prev): New functions.
13615 (Fwindow_frame): Move here from frame.c. Accept any window as
13616 argument.
13617 (Fframe_root_window, Fframe_first_window)
13618 (Fframe_selected_window): Move here from frame.c. Accept frame
13619 or arbitrary window as argument. Update doc-strings.
13620 (Fminibuffer_window): Move up in code.
13621 (Fwindow_minibuffer_p): Move up in code and simplify.
13622 (Fset_frame_selected_window): Move here from frame.c.
13623 Marginal rewrite.
13624 (Fselected_window, select_window, Fselect_window): Move up in
13625 code. Minor doc-string fixes.
13626
13627 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
13628
13629 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
13630 Do not assume that spare memory exists; that assumption is valid
13631 only if SYSTEM_MALLOC.
13632 (LARGE_REQUEST): New macro, so that the issue of large requests
13633 is separated from the issue of spare memory.
13634
13635 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
13636
13637 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
13638 format. (Bug#8806)
13639
13640 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
13641
13642 * xfns.c (x_set_scroll_bar_default_width): Move declarations
13643 before statements.
13644
13645 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
13646
13647 * gtkutil.c (xg_get_default_scrollbar_width): New function.
13648
13649 * gtkutil.h: Declare xg_get_default_scrollbar_width.
13650
13651 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
13652 min width by calling x_set_scroll_bar_default_width (Bug#8505).
13653
13654 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
13655
13656 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
13657
13658 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
13659
13660 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
13661 (x_clipboard_manager_save): Add return value.
13662 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
13663 New error handlers.
13664 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
13665 Obey Vx_select_enable_clipboard_manager. Catch errors in
13666 x_clipboard_manager_save (Bug#8779).
13667 (Vx_select_enable_clipboard_manager): New variable.
13668 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
13669
13670 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
13671
13672 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
13673
13674 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13675
13676 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
13677 in the current matrix if keep_current_p is non-zero.
13678
13679 2011-06-04 Eli Zaretskii <eliz@gnu.org>
13680
13681 * bidi.c (bidi_level_of_next_char): Fix last change.
13682
13683 2011-06-03 Eli Zaretskii <eliz@gnu.org>
13684
13685 Support bidi reordering of text covered by display properties.
13686
13687 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
13688 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
13689 (bidi_cache_search, bidi_cache_iterator_state)
13690 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13691 (bidi_level_of_next_char, bidi_move_to_visually_next):
13692 Support character positions inside a run of characters covered by a
13693 display string.
13694 (bidi_paragraph_init, bidi_resolve_explicit_1)
13695 (bidi_level_of_next_char): Call bidi_fetch_char and
13696 bidi_fetch_char_advance instead of FETCH_CHAR and
13697 FETCH_CHAR_ADVANCE.
13698 (bidi_init_it): Initialize new members.
13699 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
13700 definitions.
13701 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
13702 instead of using explicit *_CHAR codes.
13703 (bidi_resolve_explicit, bidi_resolve_weak):
13704 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
13705 bidirectional text is supported only in multibyte buffers.
13706 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
13707 it to initialize the frame_window_p member of struct bidi_it.
13708 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
13709 (bidi_resolve_explicit, bidi_resolve_weak)
13710 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
13711 bidi_it->nchars is non-positive.
13712 (bidi_level_of_next_char): Don't try to lookup the cache for the
13713 next/previous character if nothing is cached there yet, or if we
13714 were just reseat()'ed to a new position.
13715
13716 * xdisp.c (set_cursor_from_row): Set start and stop points
13717 according to the row's direction when priming the loop that looks
13718 for the glyph on which to display cursor.
13719 (single_display_spec_intangible_p): Function deleted.
13720 (display_prop_intangible_p): Reimplement to call
13721 handle_display_spec instead of single_display_spec_intangible_p.
13722 Accept 3 additional arguments needed by handle_display_spec.
13723 This fixes incorrect cursor motion across display property with complex
13724 values: lists, `(when COND...)' forms, etc.
13725 (single_display_spec_string_p): Support property values that are
13726 lists with the argument STRING its top-level element.
13727 (display_prop_string_p): Fix the condition for processing a
13728 property that is a list to be consistent with handle_display_spec.
13729 (handle_display_spec): New function, refactored from the
13730 last portion of handle_display_prop.
13731 (compute_display_string_pos): Accept additional argument
13732 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
13733 value of a `display' property is a "replacing spec".
13734 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
13735 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
13736 the display property, but just return a value indicating whether
13737 the display property will replace the characters it covers.
13738 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
13739 frame_window_p members of struct bidi_it.
13740 (compute_display_string_pos, compute_display_string_end):
13741 New functions.
13742 (push_it): Accept second argument POSITION, where pop_it should
13743 jump to continue iteration.
13744 (reseat_1): Initialize bidi_it.disp_pos.
13745
13746 * keyboard.c (adjust_point_for_property): Adjust the call to
13747 display_prop_intangible_p to its new signature.
13748
13749 * dispextern.h (struct bidi_it): New member frame_window_p.
13750 (bidi_init_it): Update prototypes.
13751 (display_prop_intangible_p): Update prototype.
13752 (compute_display_string_pos, compute_display_string_end):
13753 Declare prototypes.
13754 (struct bidi_it): New members nchars and disp_pos. ch_len is now
13755 EMACS_INT.
13756
13757 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
13758
13759 Malloc failure behavior now depends on size of allocation.
13760 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
13761 * lisp.h: Change signatures accordingly.
13762 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
13763 All callers changed. (Bug#8762)
13764
13765 * gnutls.c: Use Emacs's memory allocators.
13766 Without this change, the gnutls library would invoke malloc etc.
13767 directly, which causes problems on non-SYNC_INPUT hosts, and which
13768 runs afoul of improving memory_full behavior. (Bug#8761)
13769 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
13770 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
13771 xfree instead of the default malloc, realloc, free.
13772 (Fgnutls_boot): No need to check for memory allocation failure,
13773 since xmalloc does that for us.
13774
13775 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
13776 * category.c (hash_get_category_set):
13777 * ccl.c (ccl_driver):
13778 * charset.c (Fdefine_charset_internal):
13779 * charset.h (struct charset.hash_index):
13780 * composite.c (get_composition_id, gstring_lookup_cache)
13781 (composition_gstring_put_cache):
13782 * composite.h (struct composition.hash_index):
13783 * dispextern.h (struct image.hash):
13784 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
13785 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
13786 (hashfn_equal, hashfn_user_defined, make_hash_table)
13787 (maybe_resize_hash_table, hash_lookup, hash_put)
13788 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
13789 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
13790 (Fsxhash, Fgethash, Fputhash, Fmaphash):
13791 * image.c (make_image, search_image_cache, lookup_image)
13792 (xpm_put_color_table_h):
13793 * lisp.h (struct Lisp_Hash_Table):
13794 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
13795 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
13796 for hashes and hash indexes, instead of 'unsigned' and 'int'.
13797 * alloc.c (allocate_vectorlike):
13798 Check for overflow in vector size calculations.
13799 * ccl.c (ccl_driver):
13800 Check for overflow when converting EMACS_INT to int.
13801 * fns.c, image.c: Remove unnecessary static decls that would otherwise
13802 need to be updated by these changes.
13803 * fns.c (make_hash_table, maybe_resize_hash_table):
13804 Check for integer overflow with large hash tables.
13805 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
13806 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
13807 (SXHASH_REDUCE): New macro.
13808 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
13809 Use it instead of discarding useful hash info with large hash values.
13810 (sxhash_float): New function.
13811 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
13812 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
13813 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
13814 Rewrite to use FIXNUM_BITS, as this simplifies things.
13815 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
13816 Adjust signatures to match updated version of code.
13817 (consing_since_gc): Now EMACS_INT, since a single hash table can
13818 use more than INT_MAX bytes.
13819
13820 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
13821
13822 Make it possible to build with GCC-4.6+ -O2 -flto.
13823
13824 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
13825
13826 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
13827
13828 * minibuf.c (get_minibuffer, read_minibuf_unwind):
13829 Call minibuffer-inactive-mode.
13830
13831 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
13832
13833 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
13834 Update dependencies.
13835
13836 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13837
13838 * data.c (init_data): Remove code for UTS, this system is not
13839 supported anymore.
13840
13841 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13842
13843 Don't force ./temacs to start in terminal mode.
13844
13845 * frame.c (make_initial_frame): Initialize faces in all cases, not
13846 only when CANNOT_DUMP is defined.
13847 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
13848
13849 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13850
13851 * dispnew.c (add_window_display_history): Use const for the string
13852 pointer. Remove declaration, not needed.
13853
13854 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13855
13856 Use 'inline', not 'INLINE'.
13857 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
13858 * alloc.c, fontset.c (INLINE): Remove.
13859 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
13860 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
13861 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
13862 * gmalloc.c (register_heapinfo): Use inline unconditionally.
13863 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
13864
13865 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
13866
13867 Make it possible to run ./temacs.
13868
13869 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
13870 syms_of_callproc does the same thing. Remove test for
13871 "initialized", do it in the caller.
13872 * emacs.c (main): Avoid calling set_initial_environment when dumping.
13873
13874 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
13875
13876 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
13877 (read_minibuf): Use get_minibuffer.
13878 (syms_of_minibuf): Use DEFSYM.
13879 (Qmetadata): New var.
13880 * data.c (Qbuffer): Don't make it static.
13881 (syms_of_data): Use DEFSYM.
13882
13883 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
13884
13885 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
13886 (CCL_CODE_MIN): New macro.
13887
13888 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
13889
13890 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
13891
13892 * eval.c (Qdebug): Now static.
13893 * lisp.h (Qdebug): Remove decl. This reverts a part of the
13894 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
13895 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
13896
13897 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13898
13899 * image.c: Various fixes to ImageMagick code comments.
13900 (Fimagemagick_types): Doc fix.
13901
13902 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
13903
13904 Minor fixes prompted by GCC 4.6.0 warnings.
13905
13906 * xselect.c (converted_selections, conversion_fail_tag): Now static.
13907
13908 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
13909 (x_clipboard_manager_save_all): Move extern decl to ...
13910 * xterm.h: ... here, so that it can be checked for consistency.
13911
13912 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
13913
13914 * xselect.c (x_clipboard_manager_save_frame)
13915 (x_clipboard_manager_save_all): New functions.
13916 (Fx_clipboard_manager_save): Lisp function deleted.
13917
13918 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
13919 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
13920
13921 * xterm.h: Update prototype.
13922
13923 2011-05-28 William Xu <william.xwl@gmail.com>
13924
13925 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
13926 exiting (Bug#8239).
13927
13928 2011-05-28 Jim Meyering <meyering@redhat.com>
13929
13930 Avoid a sign-extension bug in crypto_hash_function.
13931 * fns.c (to_uchar): Define.
13932 (crypto_hash_function): Use it to convert some newly-signed
13933 variables to unsigned, to avoid sign-extension bugs. For example,
13934 without this change, (md5 "truc") would evaluate to
13935 45723a2aff78ff4fff7fff1114760e62 rather than the expected
13936 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
13937 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
13938
13939 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
13940
13941 Integer overflow fixes.
13942
13943 * dbusbind.c: Serial number integer overflow fixes.
13944 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
13945 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
13946 to hold a serial number that is too large for a fixnum.
13947 (Fdbus_method_return_internal, Fdbus_method_error_internal):
13948 Check for serial numbers out of range. Decode any serial number
13949 that was so large that it became a float. (Bug#8722)
13950
13951 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
13952 (Fdbus_call_method, Fdbus_call_method_asynchronously):
13953 Use XFASTINT rather than XUINT when numbers are nonnegative.
13954 (xd_append_arg, Fdbus_method_return_internal):
13955 (Fdbus_method_error_internal): Likewise. Also, for unsigned
13956 arguments, check that Lisp number is nonnegative, rather than
13957 silently wrapping negative numbers around. (Bug#8722)
13958 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
13959 (Bug#8722)
13960
13961 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
13962
13963 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
13964
13965 ccl: Add integer overflow checks.
13966 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
13967 (IN_INT_RANGE): New macros.
13968 (ccl_driver): Use them to check for integer overflow when
13969 decoding a CCL program. Many of the new checks are whether XINT (x)
13970 fits in int; it doesn't always, on 64-bit hosts. The new version
13971 doesn't catch all possible integer overflows, but it's an
13972 improvement. (Bug#8719)
13973
13974 * alloc.c (make_event_array): Use XINT, not XUINT.
13975 There's no need for unsigned here.
13976
13977 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
13978 This follows up to the 2011-05-06 change that substituted uintptr_t
13979 for EMACS_INT. This case wasn't caught back then.
13980
13981 Rework Fformat to avoid integer overflow issues.
13982 * editfns.c: Include <float.h> unconditionally, as it's everywhere
13983 now (part of C89). Include <verify.h>.
13984 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
13985 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
13986 (Fformat): Avoid the prepass trying to compute sizes; it was only
13987 approximate and thus did not catch overflow reliably. Instead, walk
13988 through the format just once, formatting and computing sizes as we go,
13989 checking for integer overflow at every step, and allocating a larger
13990 buffer as needed. Keep track separately whether the format is
13991 multibyte. Keep only the most-recently calculated precision, rather
13992 than them all. Record whether each argument has been converted to
13993 string. Use EMACS_INT, not int, for byte and char and arg counts.
13994 Support field widths and precisions larger than INT_MAX. Avoid
13995 sprintf's undefined behavior with conversion specifications such as %#d
13996 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
13997 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
13998 formatting out-of-range floating point numbers with int
13999 formats. (Bug#8668)
14000
14001 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
14002
14003 * data.c: Avoid integer truncation in expressions involving floats.
14004 * data.c: Include <intprops.h>.
14005 (arith_driver): When there's an integer overflow in an expression
14006 involving floating point, convert the integers to floating point
14007 so that the resulting value does not suffer from catastrophic
14008 integer truncation. For example, on a 64-bit host (* 4
14009 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
14010 Do not rely on undefined behavior after integer overflow.
14011
14012 merge count_size_as_multibyte, parse_str_to_multibyte
14013 * character.c, character.h (count_size_as_multibyte):
14014 Rename from parse_str_to_multibyte; all uses changed.
14015 Check for integer overflow.
14016 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
14017 since it's now a duplicate of the other. This is more of
14018 a character than a buffer op, so better that it's in character.c.
14019 * fns.c, print.c: Adjust to above changes.
14020
14021 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
14022
14023 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
14024
14025 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
14026
14027 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14028 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
14029 (x_clipboard_manager_save): Now static.
14030 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
14031
14032 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
14033 (crypto_hash_function): Now static.
14034 Fix pointer signedness problems. Avoid unnecessary initializations.
14035
14036 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
14037
14038 * termhooks.h (Vselection_alist): Make it terminal-local.
14039
14040 * terminal.c (create_terminal): Initialize it.
14041
14042 * xselect.c: Support for clipboard managers.
14043 (Vselection_alist): Move to termhooks.h as terminal-local var.
14044 (LOCAL_SELECTION): New macro.
14045 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
14046 (symbol_to_x_atom): Remove gratuitous arg.
14047 (x_handle_selection_request, lisp_data_to_selection_data)
14048 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
14049 (x_own_selection, x_get_local_selection, x_convert_selection):
14050 New arg, specifying work frame. Use terminal-local Vselection_alist.
14051 (some_frame_on_display): Delete unused function.
14052 (Fx_own_selection_internal, Fx_get_selection_internal)
14053 (Fx_disown_selection_internal, Fx_selection_owner_p)
14054 (Fx_selection_exists_p): New optional frame arg.
14055 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
14056 (x_handle_selection_clear): Don't treat other terminals with the
14057 same keyboard specially. Use the terminal-local Vselection_alist.
14058 (x_clear_frame_selections): Use Frun_hook_with_args.
14059
14060 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
14061
14062 * xterm.h: Add support for those atoms.
14063
14064 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
14065
14066 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
14067 (converted_selections, conversion_fail_tag): New global variables.
14068 (x_selection_request_lisp_error): Free the above.
14069 (x_get_local_selection): Remove unnecessary code.
14070 (x_reply_selection_request): Args changed; handle arbitrary array
14071 of converted selections stored in converted_selections.
14072 Separate the XChangeProperty and SelectionNotify steps.
14073 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
14074 (x_convert_selection): New function.
14075 (x_handle_selection_event): Simplify.
14076 (x_get_foreign_selection): Don't ignore incoming requests while
14077 waiting for an answer; this will fail when we implement
14078 SAVE_TARGETS, and seems unnecessary anyway.
14079 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
14080 (Vx_sent_selection_functions): Doc fix.
14081
14082 2011-05-26 Leo Liu <sdl.web@gmail.com>
14083
14084 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
14085
14086 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14087
14088 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
14089
14090 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
14091 for fringe update if it has periodic bitmap.
14092 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
14093 and fringe_bitmap_periodic_p.
14094
14095 * fringe.c (get_fringe_bitmap_data): New function.
14096 (draw_fringe_bitmap_1, update_window_fringes): Use it.
14097 (update_window_fringes): Record periodicity of fringe bitmap in glyph
14098 row. Mark glyph row for fringe update if periodicity changed.
14099
14100 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
14101 for fringe update unless it has periodic bitmap.
14102
14103 2011-05-25 Kenichi Handa <handa@m17n.org>
14104
14105 * xdisp.c (get_next_display_element): Set correct it->face_id for
14106 a static composition.
14107
14108 2011-05-24 Leo Liu <sdl.web@gmail.com>
14109
14110 * deps.mk (fns.o):
14111 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
14112
14113 * fns.c (crypto_hash_function, Fsha1): New function.
14114 (Fmd5): Use crypto_hash_function.
14115 (syms_of_fns): Add Ssha1.
14116
14117 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14118
14119 * gnutls.c: Remove unused macros.
14120 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
14121 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
14122 Remove macros that are defined and never used.
14123 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
14124
14125 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14126
14127 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
14128 (Fx_get_selection_internal): Minor cleanup.
14129 (Fx_own_selection_internal): Rename arguments for consistency with
14130 select.el.
14131
14132 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
14133
14134 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
14135
14136 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
14137
14138 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
14139
14140 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14141
14142 * dispnew.c (scrolling_window): Don't exclude the case that the
14143 last enabled row in the desired matrix touches the bottom boundary.
14144
14145 2011-05-21 Glenn Morris <rgm@gnu.org>
14146
14147 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
14148 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
14149 and add some more files.
14150
14151 2011-05-20 Eli Zaretskii <eliz@gnu.org>
14152
14153 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
14154 report_file_error introduced by the change from 2011-05-07.
14155
14156 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
14157
14158 * systime.h (Time): Define only if emacs is defined.
14159 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
14160 where the include path doesn't have X11/X.h by default. See
14161 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
14162
14163 2011-05-20 Kenichi Handa <handa@m17n.org>
14164
14165 * composite.c (find_automatic_composition): Fix previous change.
14166
14167 2011-05-20 Glenn Morris <rgm@gnu.org>
14168
14169 * lisp.mk: New file, split from Makefile.in.
14170 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
14171 (shortlisp): Remove.
14172 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
14173
14174 2011-05-19 Glenn Morris <rgm@gnu.org>
14175
14176 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
14177 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
14178 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
14179 (lisp): Set the order to that of loadup.el.
14180 (shortlisp): Make it a copy of $lisp.
14181 (SOME_MACHINE_LISP): Remove.
14182 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
14183 Use just $shortlisp, not $SOME_MACHINE_LISP too.
14184
14185 2011-05-18 Kenichi Handa <handa@m17n.org>
14186
14187 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
14188 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
14189 (find_automatic_composition): Mostly rewrite for efficiency.
14190
14191 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
14192
14193 * makefile.w32-in: Update dependencies.
14194
14195 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
14196
14197 * menu.c: Include limits.h (fixes the MS-Windows build broken by
14198 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
14199
14200 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
14201
14202 Fix some integer overflow issues, such as string length overflow.
14203
14204 * insdel.c (count_size_as_multibyte): Check for string overflow.
14205
14206 * character.c (lisp_string_width): Check for string overflow.
14207 Use EMACS_INT, not int, for string indexes and lengths; in
14208 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
14209 the resulting string length overflows an EMACS_INT; instead,
14210 report a string overflow if no precision given. When checking for
14211 precision exhaustion, use a check that cannot possibly have
14212 integer overflow. (Bug#8675)
14213 * character.h (lisp_string_width): Adjust to new signature.
14214
14215 * alloc.c (string_overflow): New function.
14216 (Fmake_string): Use it. This doesn't change behavior, but saves
14217 a few bytes and will simplify future changes.
14218 * character.c (string_escape_byte8): Likewise.
14219 * lisp.h (string_overflow): New decl.
14220
14221 Fixups, following up to the user-interface timestamp change.
14222 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
14223 for UI timestamps, instead of unsigned long.
14224 * msdos.c (mouse_get_pos): Likewise.
14225 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
14226 * w32gui.h (Time): Define by including "systime.h" rather than by
14227 declaring it ourselves. (Bug#8664)
14228
14229 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
14230 * image.c (clear_image_cache): Likewise.
14231
14232 * term.c (term_mouse_position): Don't assume time_t wraparound.
14233
14234 Be more systematic about user-interface timestamps.
14235 Before, the code sometimes used 'Time', sometimes 'unsigned long',
14236 and sometimes 'EMACS_UINT', to represent these timestamps.
14237 This change causes it to use 'Time' uniformly, as that's what X uses.
14238 This makes the code easier to follow, and makes it easier to catch
14239 integer overflow bugs such as Bug#8664.
14240 * frame.c (Fmouse_position, Fmouse_pixel_position):
14241 Use Time, not unsigned long, for user-interface timestamps.
14242 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
14243 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
14244 * keyboard.h (last_event_timestamp): Likewise.
14245 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
14246 * menu.h (xmenu_show): Likewise.
14247 * term.c (term_mouse_position): Likewise.
14248 * termhooks.h (struct input_event.timestamp): Likewise.
14249 (struct terminal.mouse_position_hook): Likewise.
14250 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
14251 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
14252 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
14253 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
14254 what it was before.
14255 * menu.h, termhooks.h: Include "systime.h", for Time.
14256
14257 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
14258 Don't assume that the difference between two unsigned long values
14259 can fit into an integer. At this point, we know button_down_time
14260 <= event->timestamp, so the difference must be nonnegative, so
14261 there's no need to cast the result if double-click-time is
14262 nonnegative, as it should be; check that it's nonnegative, just in
14263 case. This bug is triggered when events are more than 2**31 ms
14264 apart (about 25 days). (Bug#8664)
14265
14266 * xselect.c (last_event_timestamp): Remove duplicate decl.
14267 (x_own_selection): Remove needless cast to unsigned long.
14268
14269 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
14270 that always fit in int. Use a sentinel instead of a counter, to
14271 avoid a temp and to allay GCC's concerns about possible int overflow.
14272 * frame.h (struct frame): Use int for menu_bar_items_used
14273 instead of EMACS_INT, since it always fits in int.
14274
14275 * menu.c (grow_menu_items): Check for int overflow.
14276
14277 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
14278
14279 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
14280 Before, the code was not consistent. These values cannot exceed
14281 2**31 - 1 so there's no need to make them unsigned.
14282 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
14283 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
14284 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
14285 as modifiers.
14286 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
14287
14288 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
14289 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
14290 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
14291 presumably because the widths might not match.
14292
14293 * window.c (size_window): Avoid needless test at loop start.
14294
14295 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
14296
14297 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
14298
14299 2011-05-12 Drew Adams <drew.adams@oracle.com>
14300
14301 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
14302
14303 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14304
14305 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
14306 `width' to `bar_area_x' and `bar_area_width', respectively.
14307 (x_scroll_run): Take account of fringe background extension.
14308
14309 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
14310 Rename local vars `left' and `width' to `bar_area_x' and
14311 `bar_area_width', respectively.
14312 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
14313 background extension.
14314
14315 2011-05-10 Jim Meyering <meyering@redhat.com>
14316
14317 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
14318
14319 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
14320
14321 * image.c (Finit_image_library): Return t for built-in image types,
14322 like pbm and xbm. (Bug#8640)
14323
14324 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
14325
14326 * w32menu.c (set_frame_menubar): Fix submenu allocation.
14327
14328 2011-05-07 Eli Zaretskii <eliz@gnu.org>
14329
14330 * w32console.c (Fset_screen_color): Doc fix.
14331 (Fget_screen_color): New function.
14332 (syms_of_ntterm): Defsubr it.
14333
14334 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
14335 unlink the temporary file if Fcall_process didn't create it in the
14336 first place.
14337 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
14338 child process will be redirected to a file specified with `:file'.
14339 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
14340 cue to call_process_cleanup not to close that handle.
14341
14342 2011-05-07 Ben Key <bkey76@gmail.com>
14343
14344 * makefile.w32-in: The bootstrap-temacs rule now makes use of
14345 one of two shell specific rules, either bootstrap-temacs-CMD or
14346 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
14347 to the previous implementation of the bootstrap-temacs rule.
14348 The bootstrap-temacs-CMD rule is similar to the previous
14349 implementation of the bootstrap-temacs rule except that it
14350 makes use of the ESC_CFLAGS variable instead of the CFLAGS
14351 variable.
14352
14353 These changes, along with some changes to nt/configure.bat,
14354 nt/gmake.defs, and nt/nmake.defs, are required to extend my
14355 earlier fix to add support for --cflags and --ldflags options
14356 that include quotes so that it works whether make uses cmd or
14357 sh as the shell.
14358
14359 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
14360
14361 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
14362 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
14363 is a constant.
14364 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
14365 a string. Handle both cases.
14366 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
14367 (Fdbus_register_method): Use Qinvalid_function.
14368
14369 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14370
14371 * makefile.w32-in: Update dependencies.
14372 (LISP_H): Add inttypes.h and stdin.h.
14373 (PROCESS_H): Add unistd.h.
14374
14375 2011-05-06 Eli Zaretskii <eliz@gnu.org>
14376
14377 * lread.c: Include limits.h (fixes the MS-Windows build broken by
14378 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
14379
14380 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
14381
14382 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
14383
14384 * term.c (vfatal): Remove stray call to va_end.
14385 It's not needed and the C Standard doesn't allow it here anyway.
14386
14387 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
14388 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
14389
14390 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
14391 bytes.
14392
14393 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
14394
14395 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
14396
14397 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
14398
14399 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
14400
14401 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
14402
14403 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
14404 * charset.c (Fdefine_charset_internal): Don't initialize
14405 charset.code_space[15]. The value was garbage, on hosts with
14406 32-bit int (Bug#8600).
14407
14408 * lread.c (read_integer): Be more consistent with string-to-number.
14409 Use string_to_number to do the actual conversion; this avoids
14410 rounding errors and fixes some other screwups. Without this fix,
14411 for example, #x1fffffffffffffff was misread as -2305843009213693952.
14412 (digit_to_number): Move earlier, for benefit of read_integer.
14413 Return -1 if the digit is out of range for the base, -2 if it is
14414 not a digit in any supported base. (Bug#8602)
14415
14416 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14417
14418 * dispnew.c (scrolling_window): Return 1 if we scrolled,
14419 to match comment at start of function. This also removes a
14420 GCC warning about overflow in a 32+64-bit port.
14421
14422 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
14423
14424 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
14425 Reported by Stefan Monnier in
14426 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
14427 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14428 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
14429
14430 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
14431 (EMACS_UINTPTR): Likewise, with uintptr_t.
14432
14433 * lisp.h: Prefer 64-bit EMACS_INT if available.
14434 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
14435 on 32-bit hosts that have 64-bit int, so that they can access
14436 large files.
14437 However, temporarily disable this change unless the temporary
14438 symbol WIDE_EMACS_INT is defined.
14439
14440 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
14441
14442 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
14443 This removes an assumption that EMACS_INT and long are the same
14444 width as pointers. The assumption is true for Emacs porting targets
14445 now, but we want to make other targets possible.
14446 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
14447 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
14448 In the rest of the code, change types of integers that hold casted
14449 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
14450 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
14451 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
14452 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
14453 No need to cast type when ORing.
14454 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
14455 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
14456 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
14457 assume EMACS_INT is the same width as char *.
14458 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
14459 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
14460 Remove no-longer-needed casts.
14461 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
14462 (xg_tool_bar_help_callback, xg_make_tool_item):
14463 Use EMACS_INTPTR to hold an integer
14464 that will be cast to void *; this can avoid a GCC warning
14465 if EMACS_INT is not the same width as void *.
14466 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
14467 * xdisp.c (display_echo_area_1, resize_mini_window_1):
14468 (current_message_1, set_message_1):
14469 Use a local to convert to proper width without a cast.
14470 * xmenu.c (dialog_selection_callback): Likewise.
14471
14472 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
14473 Also, don't assume VALBITS / RAND_BITS is less than 5,
14474 and don't rely on undefined behavior when shifting a 1 left into
14475 the sign bit.
14476 * lisp.h (get_random): Change signature to match.
14477
14478 * lread.c (hash_string): Use size_t, not int, for hash computation.
14479 Normally we prefer signed values; but hashing is special, because
14480 it's better to use unsigned division on hash table sizes so that
14481 the remainder is nonnegative. Also, size_t is the natural width
14482 for hashing into memory. The previous code used 'int', which doesn't
14483 retain enough info to hash well into very large tables.
14484 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
14485
14486 * dbusbind.c: Don't possibly lose pointer info when converting.
14487 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
14488 Use XPNTR rather than XHASH, so that the high-order bits of
14489 the pointer aren't lost when converting through void *.
14490
14491 * eval.c (Fautoload): Don't double-shift a pointer.
14492
14493 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
14494
14495 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
14496
14497 * gnutls.c (DEF_GNUTLS_FN):
14498 * image.c (DEF_IMGLIB_FN): Make function pointers static.
14499
14500 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
14501
14502 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
14503 marker. (Bug#8610)
14504
14505 2011-05-05 Eli Zaretskii <eliz@gnu.org>
14506
14507 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
14508 New version that can reserve upto 2GB of heap space.
14509
14510 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
14511
14512 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
14513
14514 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
14515
14516 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
14517 `gnutls_certificate_set_x509_key_file'.
14518
14519 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
14520
14521 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
14522 Update dependencies.
14523
14524 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14525
14526 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
14527 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
14528 Remove unused parameter `fildes'.
14529 * process.c (read_process_output, send_process): Don't pass it.
14530
14531 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14532
14533 Fix previous change: the library cache is defined in w32.c.
14534 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
14535 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
14536
14537 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
14538
14539 Implement dynamic loading of GnuTLS on Windows.
14540
14541 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
14542 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
14543 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14544 Declare.
14545
14546 * gnutls.c (Qgnutls_dll): Define.
14547 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
14548 (gnutls_*): Declare function pointers.
14549 (init_gnutls_functions): New function to initialize function pointers.
14550 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
14551 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
14552 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
14553 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
14554 (emacs_gnutls_write, emacs_gnutls_read)
14555 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
14556 (Fgnutls_available_p): New function.
14557 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
14558 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
14559 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
14560
14561 * image.c: Include w32.h.
14562 (Vimage_type_cache): Delete.
14563 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
14564 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
14565 (w32_delayed_load): Move to w32.c.
14566
14567 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
14568
14569 * w32.c (QCloaded_from, Vlibrary_cache): Define.
14570 (w32_delayed_load): Move from image.c. When loading a library, record
14571 its filename in the :loaded-from property of the library id.
14572 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
14573 Initialize and staticpro them.
14574 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
14575
14576 * process.c: Include lisp.h before w32.h, not after.
14577 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
14578 instead of gnutls_record_check_pending.
14579
14580 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
14581
14582 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
14583
14584 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
14585 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
14586 as passed in.
14587
14588 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
14589
14590 * xterm.c (x_set_frame_alpha): Do not set property on anything
14591 else than FRAME_X_OUTER_WINDOW (Bug#8608).
14592
14593 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14594
14595 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
14596
14597 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
14598
14599 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
14600 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
14601 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
14602 (gnutls_global_initialized, Qgnutls_bootprop_priority)
14603 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
14604 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
14605 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
14606 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
14607 (Qgnutls_bootprop_callbacks_verify): Make static.
14608
14609 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
14610
14611 * callproc.c: Indentation fixup.
14612
14613 * sysdep.c (wait_for_termination_1): Make static.
14614 (wait_for_termination, interruptible_wait_for_termination):
14615 Move after wait_for_termination_1.
14616
14617 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
14618
14619 * sysdep.c (interruptible_wait_for_termination): New function
14620 which is like wait_for_termination, but allows keyboard
14621 interruptions.
14622
14623 * callproc.c (Fcall_process): Add (:file "file") as an option for
14624 the STDOUT buffer.
14625 (Fcall_process_region): Ditto.
14626
14627 2011-04-30 Eli Zaretskii <eliz@gnu.org>
14628
14629 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
14630 rather than `XVECTOR (FOO)->size'.
14631
14632 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
14633 inttypes.h, as a gnulib replacement is used if it not available in
14634 system headers.
14635
14636 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14637
14638 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
14639 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
14640 of MOST_POSITIVE_FIXNUM. (Bug#8528)
14641
14642 * coding.c (coding_alloc_by_realloc): Error out if destination
14643 will grow beyond MOST_POSITIVE_FIXNUM.
14644 (decode_coding_emacs_mule): Abort if there isn't enough place in
14645 charbuf for the composition carryover bytes. Reserve an extra
14646 space for up to 2 characters produced in a loop.
14647 (decode_coding_iso_2022): Abort if there isn't enough place in
14648 charbuf for the composition carryover bytes.
14649
14650 2011-04-21 Eli Zaretskii <eliz@gnu.org>
14651
14652 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
14653 aborting when %lld or %lll format is passed.
14654 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
14655 %llo or %llx format is passed. (Bug#8545)
14656
14657 * window.c (window_scroll_line_based): Use a marker instead of
14658 simple variables to record original value of point. (Bug#7952)
14659
14660 * doprnt.c (doprnt): Fix the case where a multibyte sequence
14661 produced by %s or %c overflows available buffer space. (Bug#8545)
14662
14663 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
14664
14665 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
14666 (SIZE_MAX): Move defn after all includes, as they might #define it.
14667
14668 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14669
14670 * w32.c (init_environment): Warn about defaulting HOME to C:\.
14671
14672 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14673
14674 * keyboard.c (Qdelayed_warnings_hook): Define.
14675 (command_loop_1): Run `delayed-warnings-hook'
14676 if Vdelayed_warnings_list is non-nil.
14677 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
14678 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
14679
14680 2011-04-28 Eli Zaretskii <eliz@gnu.org>
14681
14682 * doprnt.c (doprnt): Don't return value smaller than the buffer
14683 size if the message was truncated. (Bug#8545).
14684
14685 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
14686
14687 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
14688 (Fx_window_property): #if-0 the whole functions, not just the bodies.
14689
14690 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14691
14692 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
14693
14694 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
14695
14696 * makefile.w32-in: Update dependencies.
14697
14698 2011-04-27 Eli Zaretskii <eliz@gnu.org>
14699
14700 Improve `doprnt' and its usage. (Bug#8545)
14701 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
14702 `format_end'. Remove support for %l as a conversion specifier.
14703 Don't use xrealloc. Improve diagnostics when the %l size modifier
14704 is used. Update the commentary.
14705
14706 * eval.c (verror): Simplify calculation of size_t.
14707
14708 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
14709 messages.
14710
14711 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
14712
14713 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
14714 change.
14715
14716 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
14717
14718 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
14719 This makes this file independent of the recent pseudovector change.
14720
14721 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
14722
14723 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
14724
14725 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
14726 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
14727 Remove unused local.
14728 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
14729
14730 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
14731 GCC 4.6.0 optimizes based on type-based alias analysis.
14732 For example, if b is of type struct buffer * and v of type struct
14733 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
14734 != &v->size, and therefore "v->size = 1; b->size = 2; return
14735 v->size;" must therefore return 1. This assumption is incorrect
14736 for Emacs, since it type-puns struct Lisp_Vector * with many other
14737 types. To fix this problem, this patch adds a new type struct
14738 vectorlike_header that documents the constraints on layout of vectors
14739 and pseudovectors, and helps optimizing compilers not get fooled
14740 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
14741 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
14742 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
14743 the size member.
14744 (XSETPVECTYPE): Rewrite in terms of new macro.
14745 (XSETPVECTYPESIZE): New macro, specifying both type and size.
14746 This is a bit clearer, and further avoids the possibility of
14747 undesirable aliasing.
14748 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
14749 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
14750 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
14751 since Lisp_Subr is a special case (no "next" field).
14752 (ASIZE): Now uses header.size rather than size.
14753 All previous uses of XVECTOR (foo)->size replaced to use this macro,
14754 to avoid the hassle of writing XVECTOR (foo)->header.size.
14755 (struct vectorlike_header): New type.
14756 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
14757 object, to help avoid aliasing.
14758 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
14759 (SUBRP): Likewise, since Lisp_Subr is a special case.
14760 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
14761 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
14762 (struct Lisp_Hash_Table): Combine first two members into a single
14763 struct vectorlike_header member. All uses of "size" and "next" members
14764 changed to be "header.size" and "header.next".
14765 * buffer.h (struct buffer): Likewise.
14766 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
14767 * frame.h (struct frame): Likewise.
14768 * process.h (struct Lisp_Process): Likewise.
14769 * termhooks.h (struct terminal): Likewise.
14770 * window.c (struct save_window_data, struct saved_window): Likewise.
14771 * window.h (struct window): Likewise.
14772 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
14773 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
14774 * buffer.c (init_buffer_once): Likewise.
14775 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
14776 special case.
14777 * process.c (Fformat_network_address): Use local var for size,
14778 for brevity.
14779
14780 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
14781
14782 Make the Lisp reader and string-to-float more consistent (Bug#8525)
14783 * data.c (atof): Remove decl; no longer used or needed.
14784 (digit_to_number): Move to lread.c.
14785 (Fstring_to_number): Use new string_to_number function, to be
14786 consistent with how the Lisp reader treats infinities and NaNs.
14787 Do not assume that floating-point numbers represent EMACS_INT
14788 without losing information; this is not true on most 64-bit hosts.
14789 Avoid double-rounding errors, by insisting on integers when
14790 parsing non-base-10 numbers, as the documentation specifies.
14791 * lisp.h (string_to_number): New decl, replacing ...
14792 (isfloat_string): Remove.
14793 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
14794 (read1): Do not accept +. and -. as integers; this
14795 appears to have been a coding error. Similarly, do not accept
14796 strings like +-1e0 as floating point numbers. Do not report
14797 overflow for integer overflows unless the base is not 10 which
14798 means we have no simple and reliable way to continue.
14799 Break out the floating-point parsing into a new
14800 function string_to_number, so that Fstring_to_number parses
14801 floating point numbers consistently with the Lisp reader.
14802 (digit_to_number): Move here from data.c. Make it static inline.
14803 (E_CHAR, EXP_INT): Remove, replacing with ...
14804 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
14805 (string_to_number): New function, replacing isfloat_string.
14806 This function checks for valid syntax and produces the resulting
14807 Lisp float number too. Rework it so that string-to-number
14808 no longer mishandles examples like "1.0e+". Use strtoumax,
14809 so that overflow for non-base-10 numbers is reported only when
14810 there's no portable and simple way to convert to floating point.
14811
14812 * textprop.c (set_text_properties_1): Rewrite for clarity,
14813 and to avoid GCC warning about integer overflow.
14814
14815 * intervals.h (struct interval): Use EMACS_INT for members
14816 where EMACS_UINT might cause problems. See
14817 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
14818 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
14819 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
14820 All uses changed.
14821 (offset_intervals): Tell GCC not to worry about length overflow
14822 when negating a negative length.
14823
14824 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
14825 (overrun_check_free): Likewise.
14826
14827 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
14828 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
14829 word size.
14830
14831 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14832 (gnutls_make_error): Rename local to avoid shadowing.
14833 (gnutls_emacs_global_deinit): ifdef out; not used.
14834 (Fgnutls_boot): Use const for pointer to readonly storage.
14835 Comment out unused local. Fix pointer signedness problems.
14836
14837 * lread.c (openp): Don't stuff size_t into an 'int'.
14838 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
14839 about possible signed overflow.
14840
14841 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
14842 (GDK_KEY_g): Don't define if already defined.
14843 (xg_prepare_tooltip): Avoid pointer signedness problem.
14844 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
14845
14846 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
14847 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
14848
14849 * xfns.c (Fx_window_property): Simplify a bit,
14850 to make a bit faster and to avoid GCC 4.6.0 warning.
14851 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
14852
14853 * fns.c (internal_equal): Don't assume size_t fits in int.
14854
14855 * alloc.c (compact_small_strings): Tighten assertion a little.
14856
14857 Replace pEd with more-general pI, and fix some printf arg casts.
14858 * lisp.h (pI): New macro, generalizing old pEd macro to other
14859 conversion specifiers. For example, use "...%"pI"d..." rather
14860 than "...%"pEd"...".
14861 (pEd): Remove. All uses replaced with similar uses of pI.
14862 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
14863 * alloc.c (check_pure_size): Don't overflow by converting size to int.
14864 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
14865 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
14866 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
14867 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
14868 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
14869 64-bit hosts.
14870 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
14871 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
14872 * print.c (safe_debug_print, print_object): Likewise.
14873 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
14874 to int.
14875 Use pI instead of if-then-else-abort. Use %p to avoid casts,
14876 avoiding the 0 flag, which is not portable.
14877 * process.c (Fmake_network_process): Use pI to avoid cast.
14878 * region-cache.c (pp_cache): Likewise.
14879 * xdisp.c (decode_mode_spec): Likewise.
14880 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
14881 behavior on 64-bit hosts with printf arg.
14882 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
14883 (x_stop_queuing_selection_requests): Likewise.
14884 (x_get_window_property): Don't truncate byte count to an 'int'
14885 when tracing.
14886
14887 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
14888 here, since it parses constructs like leading '-' and spaces,
14889 which are not wanted; and it overflows with large numbers.
14890 Instead, simply match F[0-9]+, which is what is wanted anyway.
14891
14892 * alloc.c: Remove unportable assumptions about struct layout.
14893 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
14894 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
14895 (allocate_vectorlike, make_pure_vector): Use the new macros,
14896 plus offsetof, to remove unportable assumptions about struct layout.
14897 These assumptions hold on all porting targets that I know of, but
14898 they are not guaranteed, they're easy to remove, and removing them
14899 makes further changes easier.
14900
14901 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
14902 This doesn't fix a bug but makes the code clearer.
14903 (string_overrun_cookie): Now const. Use initializers that
14904 don't formally overflow signed char, to avoid warnings.
14905 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
14906 can cause Emacs to crash when string overrun checking is enabled.
14907 (allocate_buffer): Don't assume sizeof (struct buffer) is a
14908 multiple of sizeof (EMACS_INT); it need not be, if
14909 alignof(EMACS_INT) < sizeof (EMACS_INT).
14910 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
14911
14912 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
14913
14914 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
14915
14916 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
14917
14918 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
14919 supposed to be handshaking. (Bug#8556)
14920 Reported by Paul Eggert <eggert@cs.ucla.edu>.
14921
14922 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
14923
14924 * lisp.h (Qdebug): List symbol.
14925 * eval.c (Qdebug): Restore global linkage.
14926 * keyboard.c (debug-on-event): New variable.
14927 (handle_user_signal): Break into debugger when debug-on-event
14928 matches the current signal symbol.
14929
14930 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
14931
14932 * alloc.c (check_sblock, check_string_bytes)
14933 (check_string_free_list): Convert to standard C.
14934
14935 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
14936
14937 * w32.c (emacs_gnutls_push): Fix typo.
14938
14939 2011-04-25 Eli Zaretskii <eliz@gnu.org>
14940
14941 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
14942 "cast to pointer from integer of different size".
14943
14944 Improve doprnt and its use in verror. (Bug#8545)
14945 * doprnt.c (doprnt): Document the set of format control sequences
14946 supported by the function. Use SAFE_ALLOCA instead of always
14947 using `alloca'.
14948
14949 * eval.c (verror): Don't limit the buffer size at size_max-1, that
14950 is one byte too soon. Don't use xrealloc; instead xfree and
14951 xmalloc anew.
14952
14953 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
14954
14955 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
14956 callbacks stage.
14957
14958 * gnutls.c: Renamed global_initialized to
14959 gnutls_global_initialized. Added internals for the
14960 :verify-hostname-error, :verify-error, and :verify-flags
14961 parameters of `gnutls-boot' and documented those parameters in the
14962 docstring. Start callback support.
14963 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
14964 unless a fatal error occurred. Call gnutls_alert_send_appropriate
14965 on error. Return error code.
14966 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
14967 (emacs_gnutls_read): Likewise.
14968 (Fgnutls_boot): Return handshake error code.
14969 (emacs_gnutls_handle_error): New function.
14970 (wsaerror_to_errno): Likewise.
14971
14972 * w32.h (emacs_gnutls_pull): Add prototype.
14973 (emacs_gnutls_push): Likewise.
14974
14975 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
14976 (emacs_gnutls_push): Likewise.
14977
14978 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
14979
14980 * process.c (wait_reading_process_output): Check if GnuTLS
14981 buffered some data internally if no FDs are set for TLS
14982 connections.
14983
14984 * makefile.w32-in (OBJ2): Add gnutls.$(O).
14985 (LIBS): Link to USER_LIBS.
14986 ($(BLD)/gnutls.$(0)): New target.
14987
14988 2011-04-24 Eli Zaretskii <eliz@gnu.org>
14989
14990 * xdisp.c (handle_single_display_spec): Rename the
14991 display_replaced_before_p argument into display_replaced_p, to
14992 make it consistent with the commentary. Fix typos in the
14993 commentary.
14994
14995 * textprop.c (syms_of_textprop): Remove dead code.
14996 (copy_text_properties): Delete obsolete commentary about an
14997 interface that was deleted long ago. Fix typos in the description
14998 of arguments.
14999
15000 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
15001 to changes in oldXMenu/XMenu.h from 2011-04-16.
15002 <menu_help_message, prev_menu_help_message>: Constify.
15003 (IT_menu_make_room): menu->help_text is now `const char **';
15004 adjust.
15005
15006 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
15007 to changes in oldXMenu/XMenu.h from 2011-04-16.
15008 (struct XMenu): Declare `help_text' `const char **'.
15009
15010 * xfaces.c <Qunspecified>: Make extern again.
15011
15012 * syntax.c: Include sys/types.h before including regex.h, as
15013 required by POSIX.
15014
15015 * doc.c (get_doc_string): Improve the format passed to `error'.
15016
15017 * doprnt.c (doprnt): Improve commentary.
15018
15019 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
15020
15021 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
15022 them with etags.
15023
15024 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
15025 changes in globals.h immediately force recompilation.
15026 (TAGS): Depend on $(CURDIR)/m/intel386.h and
15027 $(CURDIR)/s/ms-w32.h.
15028 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
15029
15030 * character.c (Fchar_direction): Function deleted.
15031 (syms_of_character): Don't defsubr it.
15032 <char-direction-table>: Deleted.
15033
15034 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15035
15036 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
15037 * doprnt.c: Include limits.h.
15038 (SIZE_MAX): New macro.
15039 (doprnt): Return a size_t value. 2nd arg is now size_t.
15040 Many local variables are now size_t instead of int or unsigned.
15041 Improve overflow protection. Support `l' modifier for integer
15042 conversions. Support %l conversion. Don't assume an EMACS_INT
15043 argument for integer conversions and for %c.
15044
15045 * lisp.h (doprnt): Restore prototype.
15046
15047 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
15048 $(SRC)/character.h.
15049
15050 * Makefile.in (base_obj): Add back doprnt.o.
15051
15052 * deps.mk (doprnt.o): Add back prerequisites.
15053 (callint.o): Depend on character.h.
15054
15055 * eval.c (internal_lisp_condition_case): Include the handler
15056 representation in the error message.
15057 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
15058 when breaking from the loop.
15059
15060 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
15061
15062 * callint.c (Fcall_interactively): When displaying error message
15063 about invalid control letter, pass the character's codepoint, not
15064 a pointer to its multibyte form. Improve display of the character
15065 in octal and display also its hex code.
15066
15067 * character.c (char_string): Use %x to display the (unsigned)
15068 codepoint of an invalid character, to avoid displaying a bogus
15069 negative value.
15070
15071 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
15072 `error', not SYMBOL_NAME itself.
15073
15074 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
15075 character arguments to `error'.
15076
15077 * charset.c (check_iso_charset_parameter): Fix incorrect argument
15078 to `error' in error message about FINAL_CHAR argument. Make sure
15079 FINAL_CHAR is a character, and use %c when it is passed as
15080 argument to `error'.
15081
15082 2011-04-23 Eli Zaretskii <eliz@gnu.org>
15083
15084 * s/ms-w32.h (localtime): Redirect to sys_localtime.
15085
15086 * w32.c: Include <time.h>.
15087 (sys_localtime): New function.
15088
15089 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
15090
15091 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
15092
15093 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
15094
15095 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
15096
15097 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
15098 zombies (Bug#8467).
15099
15100 2011-04-19 Eli Zaretskii <eliz@gnu.org>
15101
15102 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
15103 gl_state.e_property when gl_state.object is Qt.
15104
15105 * insdel.c (make_gap_larger): Remove limitation of buffer size
15106 to <= INT_MAX.
15107
15108 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
15109
15110 * xdisp.c (lookup_glyphless_char_display)
15111 (produce_glyphless_glyph): Handle cons cell entry in
15112 glyphless-char-display.
15113 (Vglyphless_char_display): Document it.
15114
15115 * term.c (produce_glyphless_glyph): Handle cons cell entry in
15116 glyphless-char-display.
15117
15118 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
15119
15120 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
15121
15122 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
15123
15124 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
15125 definition for no-X builds.
15126
15127 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
15128
15129 Static checks with GCC 4.6.0 and non-default toolkits.
15130
15131 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
15132
15133 * process.c (keyboard_bit_set): Define only if SIGIO.
15134 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
15135 (send_process): Repair possible setjmp clobbering.
15136
15137 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
15138
15139 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
15140
15141 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
15142
15143 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
15144 Define only if needed.
15145
15146 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
15147 by pacifying GCC about it. Maybe it's time to retire it?
15148 * xfaces.c (USG, __TIMEVAL__): Likewise.
15149
15150 * dispextern.h (struct redisplay_interface): Rename param
15151 to avoid shadowing.
15152 * termhooks.h (struct terminal): Likewise.
15153 * xterm.c (xembed_send_message): Likewise.
15154
15155 * insdel.c (make_gap_smaller): Define only if
15156 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
15157
15158 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
15159 it.
15160
15161 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
15162 so that we aren't warned about unused symbols.
15163
15164 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
15165
15166 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
15167
15168 * xfns.c (x_real_positions): Mark locals as initialized.
15169
15170 * xmenu.c (xmenu_show): Don't use uninitialized vars.
15171
15172 * xterm.c: Fix problems found by static analysis with other toolkits.
15173 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
15174 (x_dispatch_event): Declare static if USE_GTK, and
15175 define if USE_GTK || USE_X_TOOLKIT.
15176 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
15177 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
15178 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
15179 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
15180
15181 * xmenu.c (menu_help_callback): Pointer type fixes.
15182 Use const pointers when pointing at readonly data. Avoid pointer
15183 signedness clashes.
15184 (FALSE): Remove unused macro.
15185 (update_frame_menubar): Remove unused decl.
15186
15187 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
15188
15189 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
15190 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
15191 (single_menu_item): Rename local to avoid shadowing.
15192
15193 * keyboard.c (make_lispy_event): Remove unused local var.
15194
15195 * frame.c, frame.h (x_get_resource_string): Bring this back, but
15196 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
15197
15198 * bitmaps: Change bitmaps from unsigned char back to the X11
15199 compatible char. Avoid the old compiler warnings about
15200 out-of-range initializers by using, for example, '\xab' rather
15201 than 0xab.
15202
15203 * xgselect.c (xgselect_initialize): Check vs interface
15204 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
15205
15206 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
15207
15208 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
15209 to read-only memory.
15210
15211 * fns.c (vector): Remove; this old hack is no longer needed.
15212
15213 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
15214 Remove unused var.
15215 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
15216
15217 * xrdb.c (x_load_resources): Omit unused local.
15218
15219 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
15220 (x_window): Rename locals to avoid shadowing.
15221 (USG): Use the kludged USG macro, to pacify gcc.
15222
15223 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
15224 (x_term_init): Remove local to avoid shadowing.
15225
15226 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
15227
15228 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
15229 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
15230
15231 2011-04-16 Eli Zaretskii <eliz@gnu.org>
15232
15233 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
15234
15235 Fix regex.c, syntax.c and friends for buffers > 2GB.
15236 * syntax.h (struct gl_state_s): Declare character position members
15237 EMACS_INT.
15238
15239 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
15240
15241 * textprop.c (verify_interval_modification, interval_of):
15242 Declare arguments EMACS_INT.
15243
15244 * intervals.c (adjust_intervals_for_insertion): Declare arguments
15245 EMACS_INT.
15246
15247 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
15248
15249 * indent.c (Fvertical_motion): Local variable it_start is now
15250 EMACS_INT.
15251
15252 * regex.c (re_match, re_match_2, re_match_2_internal)
15253 (bcmp_translate, regcomp, regexec, print_double_string)
15254 (group_in_compile_stack, re_search, re_search_2, regex_compile)
15255 (re_compile_pattern, re_exec): Declare arguments and local
15256 variables `size_t' and `ssize_t' and return values `regoff_t', as
15257 appropriate.
15258 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
15259 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
15260 <compile_stack_type>: `size' and `avail' are now `size_t'.
15261
15262 * regex.h <regoff_t>: Use ssize_t, not int.
15263 (re_search, re_search_2, re_match, re_match_2): Arguments that
15264 specify buffer/string position and length are now ssize_t and
15265 size_t. Return type is regoff_t.
15266
15267 2011-04-16 Ben Key <bkey76@gmail.com>
15268
15269 * nsfont.m: Fixed bugs in ns_get_family and
15270 ns_descriptor_to_entity that were caused by using free to
15271 deallocate memory blocks that were allocated by xmalloc (via
15272 xstrdup). This caused Emacs to crash when compiled with
15273 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
15274 --enable-checking=xmallocoverrun). xfree is now used to
15275 deallocate these memory blocks.
15276
15277 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
15278
15279 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
15280
15281 emacs_write: Accept and return EMACS_INT for sizes.
15282 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
15283 et seq.
15284 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
15285 Accept and return EMACS_INT.
15286 (emacs_gnutls_write): Return the number of bytes written on
15287 partial writes.
15288 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
15289 (emacs_read, emacs_write): Remove check for negative size, as the
15290 Emacs source code has been audited now.
15291 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
15292 (emacs_read, emacs_write): Use it.
15293 * process.c (send_process): Adjust to the new signatures of
15294 emacs_write and emacs_gnutls_write. Do not attempt to store
15295 a byte offset into an 'int'; it might overflow.
15296 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
15297
15298 * sound.c: Don't assume sizes fit in 'int'.
15299 (struct sound_device.period_size, alsa_period_size):
15300 Return EMACS_INT, not int.
15301 (struct sound_device.write, vox_write, alsa_write):
15302 Accept EMACS_INT, not int.
15303 (wav_play, au_play): Use EMACS_INT to store sizes and to
15304 record read return values.
15305
15306 2011-04-15 Ben Key <bkey76@gmail.com>
15307
15308 * keyboard.c (Qundefined): Don't declare static since it is used
15309 in nsfns.m.
15310 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
15311 static since they are used in nsfont.m.
15312
15313 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
15314
15315 * process.c (Qprocessp): Don't declare static.
15316 * lisp.h (Qprocessp): Declare again.
15317
15318 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
15319
15320 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
15321
15322 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
15323
15324 Improve C-level modularity by making more things 'static'.
15325
15326 Don't publish debugger-only interfaces to other modules.
15327 * lisp.h (safe_debug_print, debug_output_compilation_hack):
15328 (verify_bytepos, count_markers): Move decls to the only modules
15329 that need them.
15330 * region-cache.h (pp_cache): Likewise.
15331 * window.h (check_all_windows): Likewise.
15332 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
15333
15334 * sysdep.c (croak): Now static, if
15335 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
15336 * syssignal.h (croak): Declare only if not static.
15337
15338 * alloc.c (refill_memory_reserve): Now static if
15339 !defined REL_ALLOC || defined SYSTEM_MALLOC.
15340 * lisp.h (refill_memory_reserve): Declare only if not static.
15341
15342 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
15343 Define only if USE_LUCID.
15344
15345 * xrdb.c (x_customization_string, x_rm_string): Now static.
15346
15347 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
15348 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
15349
15350 * xdisp.c (draw_row_with_mouse_face): Now static.
15351 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
15352
15353 * window.h (check_all_windows): Mark externally visible.
15354
15355 * window.c (window_deletion_count): Now static.
15356
15357 * undo.c: Make symbols static if they're not exported.
15358 (last_undo_buffer, last_boundary_position, pending_boundary):
15359 Now static.
15360
15361 * textprop.c (interval_insert_behind_hooks): Now static.
15362 (interval_insert_in_front_hooks): Likewise.
15363
15364 * term.c: Make symbols static if they're not exported.
15365 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
15366 (max_frame_lines, tty_set_terminal_modes):
15367 (tty_reset_terminal_modes, tty_turn_off_highlight):
15368 (get_tty_terminal): Now static.
15369 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
15370 * termhooks.h (term_mouse_moveto): Do not declare if
15371 HAVE_WINDOW_SYSTEM.
15372 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
15373 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
15374
15375 * sysdep.c: Make symbols static if they're not exported.
15376 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
15377 Now static.
15378 (sigprocmask_set, full_mask): Remove; unused.
15379 (wait_debugging): Mark as visible.
15380 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
15381 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
15382
15383 * syntax.c (syntax_temp): Define only if !__GNUC__.
15384
15385 * sound.c (current_sound_device, current_sound): Now static.
15386
15387 * search.c (searchbufs, searchbuf_head): Now static.
15388
15389 * scroll.c (scroll_cost): Remove; unused.
15390 * dispextern.h (scroll_cost): Remove decl.
15391
15392 * region-cache.h (pp_cache): Mark as externally visible.
15393
15394 * process.c: Make symbols static if they're not exported.
15395 (process_tick, update_tick, create_process, chan_process):
15396 (Vprocess_alist, proc_buffered_char, datagram_access):
15397 (fd_callback_data, send_process_frame, process_sent_to): Now static.
15398 (deactivate_process): Mark defn as static, as well as decl.
15399 * lisp.h (create_process): Remove decl.
15400 * process.h (chan_process, Vprocess_alist): Remove decls.
15401
15402 * print.c: Make symbols static if they're not exported.
15403 (print_depth, new_backquote_output, being_printed, print_buffer):
15404 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
15405 (print_interval, print_number_index, initial_stderr_stream):
15406 Now static.
15407 * lisp.h (Fprinc): Remove decl.
15408 (debug_output_compilation_hack): Mark as externally visible.
15409
15410 * sysdep.c (croak): Move decl from here to syssignal.h.
15411 * syssignal.h (croak): Put it here, so the API can be checked when
15412 'croak' is called from dissociate_if_controlling_tty.
15413
15414 * minibuf.c: Make symbols static if they're not exported.
15415 (minibuf_save_list, choose_minibuf_frame): Now static.
15416 * lisp.h (choose_minibuf_frame): Remove decl.
15417
15418 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
15419
15420 * lread.c: Make symbols static if they're not exported.
15421 (read_objects, initial_obarray, oblookup_last_bucket_number):
15422 Now static.
15423 (make_symbol): Remove; unused.
15424 * lisp.h (initial_obarray, make_symbol): Remove decls.
15425
15426 * keyboard.c: Make symbols static if they're not exported.
15427 (single_kboard, recent_keys_index, total_keys, recent_keys):
15428 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
15429 (this_single_command_key_start, echoing, last_auto_save):
15430 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
15431 (command_loop, echo_now, keyboard_init_hook, help_char_p):
15432 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
15433 (Vlispy_mouse_stem, double_click_count):
15434 Now static.
15435 (force_auto_save_soon): Define only if SIGDANGER.
15436 (ignore_mouse_drag_p): Now static if
15437 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
15438 (print_help): Remove; unused.
15439 (stop_character, last_timer_event): Mark as externally visible.
15440 * keyboard.h (ignore_mouse_drag_p): Declare only if
15441 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
15442 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
15443 * lisp.h (echoing): Remove decl.
15444 (force_auto_save_soon): Declare only if SIGDANGER.
15445 * xdisp.c (redisplay_window): Simplify code, to make it more
15446 obvious that ignore_mouse_drag_p is not accessed if !defined
15447 USE_GTK && !defined HAVE_NS.
15448
15449 * intervals.c: Make symbols static if they're not exported.
15450 (merge_properties_sticky, merge_interval_right, delete_interval):
15451 Now static.
15452 * intervals.h (merge_interval_right, delete_interval): Remove decls.
15453
15454 * insdel.c: Make symbols static if they're not exported.
15455 However, leave prepare_to_modify_buffer alone. It's never
15456 called from outside this function, but that appears to be a bug.
15457 (combine_after_change_list, combine_after_change_buffer):
15458 (adjust_after_replace, signal_before_change): Now static.
15459 (adjust_after_replace_noundo): Remove; unused.
15460 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
15461 (signal_before_change): Remove decls.
15462
15463 * indent.c (val_compute_motion, val_vmotion): Now static.
15464
15465 * image.c: Make symbols static if they're not exported.
15466 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
15467 if USE_GTK.
15468 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
15469 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
15470
15471 * fringe.c (standard_bitmaps): Now static.
15472 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
15473
15474 * frame.c: Make symbols static if they're not exported.
15475 (x_report_frame_params, make_terminal_frame): Now static.
15476 (get_frame_param): Now static, unless HAVE_NS.
15477 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
15478 (x_get_resource_string): Remove; not used.
15479 * frame.h (make_terminal_frame, x_report_frame_params):
15480 (x_get_resource_string); Remove decls.
15481 (x_fullscreen_adjust): Declare only if WINDOWSNT.
15482 * lisp.h (get_frame_param): Declare only if HAVE_NS.
15483
15484 * font.c, fontset.c: Make symbols static if they're not exported.
15485 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
15486 (FACE_SUITABLE_FOR_CHAR_P): Use it.
15487 * font.c (font_close_object): Now static.
15488 * font.h (font_close_object): Remove.
15489 * fontset.c (FONTSET_OBJLIST): Remove.
15490 (free_realized_fontset) #if-0 the body, which does nothing.
15491 (face_suitable_for_char_p): #if-0, as it's never called.
15492 * fontset.h (face_suitable_for_char_p): Remove decl.
15493 * xfaces.c (face_at_string_position):
15494 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
15495 since 0 is always ASCII.
15496
15497 * fns.c (weak_hash_tables): Now static.
15498
15499 * fileio.c: Make symbols static if they're not exported.
15500 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
15501 (Vwrite_region_annotation_buffers): Now static.
15502
15503 * eval.c: Make symbols static if they're not exported.
15504 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
15505 * lisp.h (backtrace_list): Remove decl.
15506
15507 * emacs.c: Make symbols static if they're not exported.
15508 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
15509 (fatal_error_code, fatal_error_signal_hook, standard_args):
15510 Now static.
15511 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
15512 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
15513 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
15514 * lisp.h (fatal_error_signal_hook): Remove decl.
15515 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
15516
15517 * editfns.c: Move a (normally-unused) function to its only use.
15518 * editfns.c, lisp.h (get_operating_system_release): Remove.
15519 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
15520 worth the hassle of breaking this out.
15521
15522 * xterm.c: Make symbols static if they're not exported.
15523 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
15524 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
15525 (x_destroy_window, x_delete_display):
15526 Now static.
15527 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
15528 (x_mouse_leave): Remove; unused.
15529 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
15530 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
15531 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
15532 Remove decls.
15533 (x_mouse_leave): Declare only if WINDOWSNT.
15534 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
15535 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
15536 USE_X_TOOLKIT.
15537
15538 * ftxfont.c: Make symbols static if they're not exported.
15539 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
15540 HAVE_FREETYPE.
15541 * font.h (ftxfont_driver): Likewise.
15542
15543 * xfns.c: Make symbols static if they're not exported.
15544 (x_last_font_name, x_display_info_for_name):
15545 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
15546 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
15547 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
15548 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
15549 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
15550 (last_show_tip_args): Now static.
15551 (xic_defaut_fontset, xic_create_fontsetname): Define only if
15552 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
15553 (x_screen_planes): Remove; unused.
15554 * dispextern.h (x_screen_planes): Remove decl.
15555
15556 * dispnew.c: Make symbols static if they're not exported.
15557 * dispextern.h (redraw_garbaged_frames, scrolling):
15558 (increment_row_positions): Remove.
15559 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
15560 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
15561 Now static.
15562 (redraw_garbaged_frames): Remove; unused.
15563
15564 * xfaces.c: Make symbols static if they're not exported.
15565 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
15566 Remove decls.
15567 * xterm.h (defined_color): Remove decls.
15568 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
15569 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
15570 (menu_face_changed_default, defined_color, free_realized_face):
15571 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
15572 (ascii_face_of_lisp_face): Remove; unused.
15573
15574 * xdisp.c: Make symbols static if they're not exported.
15575 * dispextern.h (scratch_glyph_row, window_box_edges):
15576 (glyph_to_pixel_coords, set_cursor_from_row):
15577 (get_next_display_element, set_iterator_to_next):
15578 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
15579 (show_mouse_face): Remove decls
15580 * frame.h (message_buf_print): Likewise.
15581 * lisp.h (pop_message, set_message, check_point_in_composition):
15582 Likewise.
15583 * xterm.h (set_vertical_scroll_bar): Likewise.
15584 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
15585 (message_buf_print, scratch_glyph_row, displayed_buffer):
15586 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
15587 (get_next_display_element, show_mouse_face, window_box_edges):
15588 (frame_to_window_pixel_xy, check_point_in_composition):
15589 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
15590 (glyph_to_pixel_coords): Remove; unused.
15591
15592 * dired.c (file_name_completion): Now static.
15593
15594 * dbusbind.c (xd_in_read_queued_messages): Now static.
15595
15596 * lisp.h (circular_list_error, FOREACH): Remove; unused.
15597 * data.c (circular_list_error): Remove.
15598
15599 * commands.h (last_point_position, last_point_position_buffer):
15600 (last_point_position_window): Remove decls.
15601 * keyboard.c: Make these variables static.
15602
15603 * coding.h (coding, code_convert_region, encode_coding_gap):
15604 Remove decls.
15605 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
15606 (iso_code_class, detect_coding, code_convert_region): Now static.
15607 (encode_coding_gap): Remove; unused.
15608
15609 * chartab.c (chartab_chars, chartab_bits): Now static.
15610
15611 * charset.h (charset_iso_8859_1): Remove decl.
15612 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
15613 Now static.
15614
15615 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
15616 * ccl.c (Vccl_program_table): Now static.
15617 (check_ccl_update): Remove; unused.
15618
15619 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
15620 * category.h: ... from here.
15621 * category.c (check_category_table, set_category_set): Now static.
15622
15623 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
15624 * lisp.h: Remove these decls.
15625
15626 * buffer.c (buffer_count): Remove unused var.
15627
15628 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
15629 so that it's not optimized away.
15630 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
15631 * dispextern.h (bidi_dump_cached_states): Remove, since it's
15632 exported only to the debugger.
15633
15634 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
15635 * atimer.h (run_all_atimers): Remove; not exported.
15636
15637 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
15638 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
15639 was inaccessible from Lisp.
15640 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
15641 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
15642
15643 alloc.c: Import and export fewer symbols, and remove unused items.
15644 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
15645 is defined.
15646 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
15647 it's not optimized away by whole-program optimization.
15648 (message_enable_multibyte, free_misc): Remove.
15649 (catchlist, handlerlist, mark_backtrace):
15650 Declare only if BYTE_MARK_STACK.
15651 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
15652 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
15653 (message_enable_multibyte): Remove decl.
15654 (free_misc, interval_free_list, float_block, float_block_index):
15655 (n_float_blocks, float_free_list, cons_block, cons_block_index):
15656 (cons_free_list, last_marked_index):
15657 Now static.
15658 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
15659 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
15660 (mark_backtrace): Define only if BYTE_MARK_STACK.
15661 * xdisp.c (message_enable_multibyte): Now static.
15662
15663 Declare Lisp_Object Q* variables to be 'static' if not exported.
15664 This makes it easier for human readers (and static analyzers)
15665 to see whether these variables are used from other modules.
15666 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
15667 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
15668 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
15669 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
15670 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
15671 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
15672 * xmenu.c, xselect.c:
15673 Declare Q* vars static if they are not used in other modules.
15674 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
15675 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
15676 Remove decls of unexported vars.
15677 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
15678
15679 * lisp.h (DEFINE_FUNC): Make sname 'static'.
15680
15681 Make Emacs functions such as Fatom 'static' by default.
15682 This makes it easier for human readers (and static analyzers)
15683 to see whether these functions can be called from other modules.
15684 DEFUN now defines a static function. To make the function external
15685 so that it can be used in other C modules, use the new macro DEFUE.
15686 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
15687 (Finit_image_library):
15688 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
15689 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
15690 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
15691 Remove decls, since these functions are now static.
15692 (Funintern, Fget_internal_run_time): New decls, since these functions
15693 were already external.
15694
15695 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
15696 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
15697 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
15698 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
15699 * keyboard.c, keymap.c, lread.c:
15700 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
15701 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
15702 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
15703 Mark functions with DEFUE instead of DEFUN,
15704 if they are used in other modules.
15705 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
15706 decls for now-static functions.
15707 * buffer.h (Fdelete_overlay): Remove decl.
15708 * callproc.c (Fgetenv_internal): Mark as internal.
15709 * composite.c (Fremove_list_of_text_properties): Remove decl.
15710 (Fcomposition_get_gstring): New forward static decl.
15711 * composite.h (Fcomposite_get_gstring): Remove decl.
15712 * dired.c (Ffile_attributes): New forward static decl.
15713 * doc.c (Fdocumntation_property): New forward static decl.
15714 * eval.c (Ffetch_bytecode): New forward static decl.
15715 (Funintern): Remove extern decl; now in .h file where it belongs.
15716 * fileio.c (Fmake_symbolic_link): New forward static decl.
15717 * image.c (Finit_image_library): New forward static decl.
15718 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
15719 * intervals.h (Fprevious_property_change):
15720 (Fremove_list_of_text_properties): Remove decls.
15721 * keyboard.c (Fthis_command_keys): Remove decl.
15722 (Fcommand_execute): New forward static decl.
15723 * keymap.c (Flookup_key): New forward static decl.
15724 (Fcopy_keymap): Now static.
15725 * keymap.h (Flookup_key): Remove decl.
15726 * process.c (Fget_process): New forward static decl.
15727 (Fprocess_datagram_address): Mark as internal.
15728 * syntax.c (Fsyntax_table_p): New forward static decl.
15729 (skip_chars): Remove duplicate decl.
15730 * textprop.c (Fprevious_property_change): New forward static decl.
15731 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
15732 Now internal.
15733 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
15734 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
15735
15736 * editfns.c (Fformat): Remove unreachable code.
15737
15738 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
15739
15740 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
15741 change. (Bug#8496)
15742
15743 2011-04-13 Eli Zaretskii <eliz@gnu.org>
15744
15745 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
15746 when at ZV. (Bug#8487)
15747
15748 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
15749
15750 * charset.c (Fclear_charset_maps): Use xfree instead of free.
15751 (Bug#8437)
15752 * keyboard.c (parse_tool_bar_item): Likewise.
15753 * sound.c (sound_cleanup, alsa_close): Likewise.
15754 * termcap.c (tgetent): Likewise.
15755 * xfns.c (x_default_font_parameter): Likewise.
15756 * xsettings.c (read_and_apply_settings): Likewise.
15757
15758 * alloc.c (overrun_check_malloc, overrun_check_realloc)
15759 (overrun_check_free): Protoize.
15760
15761 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
15762
15763 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
15764 since callers should never pass a negative size.
15765 Change the signature to match that of plain 'read' and 'write'; see
15766 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
15767 * lisp.h: Update prototypes of emacs_write and emacs_read.
15768
15769 2011-04-11 Eli Zaretskii <eliz@gnu.org>
15770
15771 * xdisp.c (redisplay_window): Don't try to determine the character
15772 position of the scroll margin if the window start point w->startp
15773 is outside the buffer's accessible region. (Bug#8468)
15774
15775 2011-04-10 Eli Zaretskii <eliz@gnu.org>
15776
15777 Fix write-region and its subroutines for buffers > 2GB.
15778 * fileio.c (a_write, e_write): Modify declaration of arguments and
15779 local variables to support buffers larger than 2GB.
15780 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
15781
15782 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
15783 argument, local variables, and return value.
15784
15785 * lisp.h: Update prototypes of emacs_write and emacs_read.
15786
15787 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
15788
15789 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
15790
15791 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
15792
15793 Fix more problems found by GCC 4.6.0's static checks.
15794
15795 * xdisp.c (vmessage): Use a better test for character truncation.
15796
15797 * charset.c (load_charset_map): <, not <=, for optimization,
15798 and to avoid potential problems with integer overflow.
15799 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
15800 * casetab.c (set_identity, shuffle): Likewise.
15801 * editfns.c (Fformat): Likewise.
15802 * syntax.c (skip_chars): Likewise.
15803
15804 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
15805 This also lets GCC 4.6.0 generate slightly better loop code.
15806
15807 * callint.c (Fcall_interactively): <, not <=, for optimization.
15808 (Fcall_interactively): Count the number of arguments produced,
15809 not the number of arguments given. This is simpler and lets GCC
15810 4.6.0 generate slightly better code.
15811
15812 * ftfont.c: Distingish more carefully between FcChar8 and char.
15813 The previous code passed unsigned char * to a functions like
15814 strlen and xstrcasecmp that expect char *, which does not
15815 conform to the C standard.
15816 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
15817 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
15818 char * when the C standard requires it.
15819
15820 * keyboard.c (read_char): Remove unused var.
15821
15822 * eval.c: Port to Windows vsnprintf (Bug#8435).
15823 Include <limits.h>.
15824 (SIZE_MAX): Define if the headers do not.
15825 (verror): Do not give up if vsnprintf returns a negative count.
15826 Instead, grow the buffer. This ports to Windows vsnprintf, which
15827 does not conform to C99. Problem reported by Eli Zaretskii.
15828 Also, simplify the allocation scheme, by avoiding the need for
15829 calling realloc, and removing the ALLOCATED variable.
15830
15831 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
15832
15833 Remove invocations of doprnt, as Emacs now uses vsnprintf.
15834 But keep the doprint source code for now, as we might revamp it
15835 and use it again (Bug#8435).
15836 * lisp.h (doprnt): Remove.
15837 * Makefile.in (base_obj): Remove doprnt.o.
15838 * deps.mk (doprnt.o): Remove.
15839
15840 error: Print 32- and 64-bit integers portably (Bug#8435).
15841 Without this change, on typical 64-bit hosts error ("...%d...", N)
15842 was used to print both 32- and 64-bit integers N, which relied on
15843 undefined behavior.
15844 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
15845 * lisp.h (error, verror): Mark as printf-like functions.
15846 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
15847 Report overflow in size calculations when allocating printf buffer.
15848 Do not truncate output string at its first null byte.
15849 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
15850 Truncate the output at a character boundary, since vsnprintf does not
15851 do that.
15852 * charset.c (check_iso_charset_parameter): Convert internal
15853 character to string before calling 'error', since %c now has the
15854 printf meaning.
15855 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
15856 overflow when computing char to be passed to 'error'. Do not
15857 pass Lisp_Object to 'error'; pass the integer instead.
15858 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
15859 formatted with plain %d.
15860
15861 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
15862
15863 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
15864
15865 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
15866
15867 * xterm.c (x_catch_errors): Remove duplicate declaration.
15868
15869 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
15870
15871 * xdisp.c, lisp.h (message_nolog): Remove; unused.
15872
15873 2011-04-10 Jim Meyering <meyering@redhat.com>
15874
15875 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
15876 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
15877 return ssize_t not "int", and use size_t as the buffer length.
15878 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
15879 * gnutls.h: Update declarations.
15880 * process.c (read_process_output): Use ssize_t, to match.
15881 (send_process): Likewise.
15882
15883 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15884
15885 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
15886
15887 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
15888
15889 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
15890 Use unsigned char, to match FcChar8 type definition.
15891
15892 * xterm.c (handle_one_xevent):
15893 * xmenu.c (create_and_show_popup_menu):
15894 * xselect.c (x_decline_selection_request)
15895 (x_reply_selection_request): Avoid type-punned deref of X events.
15896
15897 2011-04-09 Eli Zaretskii <eliz@gnu.org>
15898
15899 Fix some uses of `int' instead of EMACS_INT.
15900 * search.c (string_match_1, fast_string_match)
15901 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
15902 (scan_buffer, find_next_newline_no_quit)
15903 (find_before_next_newline, search_command, Freplace_match)
15904 (Fmatch_data): Make some `int' variables be EMACS_INT.
15905
15906 * xdisp.c (display_count_lines): 3rd argument and return value now
15907 EMACS_INT. All callers changed.
15908 (pint2hrstr): Last argument is now EMACS_INT.
15909
15910 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
15911 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
15912 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
15913 (decode_coding_utf_16, decode_coding_emacs_mule)
15914 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
15915 (decode_coding_ccl, decode_coding_charset)
15916 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
15917 (decode_coding_iso_2022, decode_coding_emacs_mule)
15918 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
15919 <char_offset, last_offset>: Declare EMACS_INT.
15920 (encode_coding_utf_8, encode_coding_utf_16)
15921 (encode_coding_emacs_mule, encode_invocation_designation)
15922 (encode_designation_at_bol, encode_coding_iso_2022)
15923 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
15924 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
15925 Declare EMACS_INT.
15926 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
15927 (encode_invocation_designation): Last argument P_NCHARS is now
15928 EMACS_INT.
15929 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
15930 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
15931
15932 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
15933 All users changed.
15934
15935 * ccl.c (Fccl_execute_on_string): Declare some variables
15936 EMACS_INT.
15937
15938 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
15939
15940 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
15941
15942 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
15943
15944 * process.c (Fformat_network_address): Doc fix.
15945
15946 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
15947
15948 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
15949
15950 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
15951
15952 * keyboard.c (read_char): Call Lisp function help-form-show,
15953 instead of using internal_with_output_to_temp_buffer.
15954 (Qhelp_form_show): New var.
15955 (syms_of_keyboard): Use DEFSYM macro.
15956
15957 * print.c (internal_with_output_to_temp_buffer): Function deleted.
15958
15959 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
15960
15961 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
15962
15963 * process.c (Flist_processes): Remove to Lisp.
15964 (list_processes_1): Delete.
15965
15966 2011-04-06 Eli Zaretskii <eliz@gnu.org>
15967
15968 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
15969
15970 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
15971
15972 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
15973
15974 Fix more problems found by GCC 4.6.0's static checks.
15975
15976 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
15977
15978 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
15979
15980 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
15981
15982 * xdisp.c (vmessage): Mark as a printf-like function.
15983
15984 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
15985
15986 * sound.c (sound_warning): Don't crash if arg contains a printf format.
15987
15988 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
15989 printf-like functions.
15990 (tiff_load): Add casts to remove these marks before passing them
15991 to system-supplied API.
15992
15993 * eval.c (Fsignal): Remove excess argument to 'fatal'.
15994
15995 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
15996 This avoids several warnings with gcc -Wstrict-overflow.
15997 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
15998 directly, rather than having caller test rule sign. This avoids
15999 some unnecessary tests.
16000 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
16001 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
16002 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
16003
16004 * xfont.c (xfont_text_extents): Remove var that was set but not used.
16005 (xfont_open): Avoid unnecessary tests.
16006
16007 * composite.c (composition_gstring_put_cache): Use unsigned integer.
16008
16009 * composite.h, composite.c (composition_gstring_put_cache):
16010 Use EMACS_INT, not int, for length.
16011
16012 * composite.h (COMPOSITION_DECODE_REFS): New macro,
16013 breaking out part of COMPOSITION_DECODE_RULE.
16014 (COMPOSITION_DECODE_RULE): Use it.
16015 * composite.c (get_composition_id): Remove unused local vars,
16016 by using the new macro.
16017
16018 * textprop.c (set_text_properties_1): Change while to do-while,
16019 since the condition is always true at first.
16020
16021 * intervals.c (graft_intervals_into_buffer): Mark var as used.
16022 (interval_deletion_adjustment): Return unsigned value.
16023 All uses changed.
16024
16025 * process.c (list_processes_1, create_pty, read_process_output):
16026 (exec_sentinel): Remove vars that were set but not used.
16027 (create_pty): Remove unnecessary "volatile"s.
16028 (Fnetwork_interface_info): Avoid possibility of int overflow.
16029 (read_process_output): Do adaptive read buffering even if carryover.
16030 (read_process_output): Simplify nbytes computation if buffered.
16031
16032 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
16033
16034 * syntax.c (scan_words): Remove var that was set but not used.
16035 (update_syntax_table): Use unsigned instead of int.
16036
16037 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
16038 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
16039 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
16040
16041 * print.c (print_error_message): Avoid int overflow.
16042
16043 * font.c (font_list_entities): Redo for clarity,
16044 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
16045
16046 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
16047 (font_score): Avoid potential overflow in diff calculation.
16048
16049 * fns.c (substring_both): Remove var that is set but not used.
16050 (sxhash): Redo loop for clarity and to avoid wraparound warning.
16051
16052 * eval.c (funcall_lambda): Rename local to avoid shadowing.
16053
16054 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
16055 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
16056 can always succeed if overflow has undefined behavior.
16057
16058 * search.c (boyer_moore, wordify): Remove vars set but not used.
16059 (wordify): Omit three unnecessary tests.
16060
16061 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
16062 All callers changed. This avoids the need for an unused var.
16063
16064 * casefiddle.c (casify_region): Remove var that is set but not used.
16065
16066 * dired.c (file_name_completion): Remove var that is set but not used.
16067
16068 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
16069
16070 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
16071 (Finsert_file_contents): Remove unnecessary code checking fd.
16072
16073 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
16074 Check for integer overflow on size calculations.
16075
16076 * buffer.c (Fprevious_overlay_change): Remove var that is set
16077 but not used.
16078
16079 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
16080 Remove vars that are set but not used.
16081 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
16082 (timer_check_2): Mark vars as initialized.
16083
16084 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
16085
16086 * image.c (lookup_image): Remove var that is set but not used.
16087 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
16088
16089 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
16090 that are set but not used.
16091
16092 * xfns.c (make_invisible_cursor): Don't return garbage
16093 if XCreateBitmapFromData fails (Bug#8410).
16094
16095 * xselect.c (x_get_local_selection, x_handle_property_notify):
16096 Remove vars that are set but not used.
16097
16098 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
16099 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
16100
16101 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
16102 Remove var that is set but not used.
16103 (scroll_bar_windows_size): Now size_t, not int.
16104 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
16105 Check for overflow.
16106
16107 * xfaces.c (realize_named_face): Remove vars that are set but not used.
16108 (map_tty_color) [!defined MSDOS]: Likewise.
16109
16110 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
16111
16112 * coding.c: Remove vars that are set but not used.
16113 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
16114 All callers changed.
16115 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
16116 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
16117 (decode_coding_charset): Remove vars that are set but not used.
16118
16119 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
16120 that is set but not used.
16121
16122 * print.c (print_object): Remove var that is set but not used.
16123
16124 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
16125 The gnulib version avoids calling malloc in the usual case,
16126 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
16127 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
16128 * filelock.c (current_lock_owner): Likewise.
16129 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
16130 * sysdep.c: Include allocator.h, careadlinkat.h.
16131 (emacs_no_realloc_allocator): New static constant.
16132 (emacs_readlink): New function.
16133 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
16134 ../lib/careadlinkat.h.
16135
16136 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
16137
16138 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
16139 first non-nil return value).
16140
16141 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
16142
16143 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
16144 if not defined (Bug#8403).
16145
16146 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16147
16148 * xdisp.c (display_count_lines): Remove parameter `start',
16149 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16150 (get_char_face_and_encoding): Remove parameter `multibyte_p',
16151 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16152 (fill_stretch_glyph_string): Remove parameters `row' and `area',
16153 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
16154 and thereabouts. All callers changed.
16155 (get_per_char_metric): Remove parameter `f', unused since
16156 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
16157
16158 2011-04-02 Jim Meyering <meyering@redhat.com>
16159
16160 do not dereference NULL upon failed strdup
16161 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
16162 (ns_get_family): Likewise.
16163
16164 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
16165
16166 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
16167
16168 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
16169
16170 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
16171 later (Bug#8403).
16172
16173 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
16174
16175 Add lexical binding.
16176
16177 * window.c (Ftemp_output_buffer_show): New fun.
16178 (Fsave_window_excursion):
16179 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
16180
16181 * lread.c (lisp_file_lexically_bound_p): New function.
16182 (Fload): Bind Qlexical_binding.
16183 (readevalloop): Remove `evalfun' arg.
16184 Bind Qinternal_interpreter_environment.
16185 (Feval_buffer): Bind Qlexical_binding.
16186 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
16187 Mark as dynamic.
16188 (syms_of_lread): Declare `lexical-binding'.
16189
16190 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
16191
16192 * keyboard.c (eval_dyn): New fun.
16193 (menu_item_eval_property): Use it.
16194
16195 * image.c (parse_image_spec): Use Ffunctionp.
16196
16197 * fns.c (concat, mapcar1): Accept byte-code-functions.
16198
16199 * eval.c (Fsetq): Handle lexical vars.
16200 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
16201 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
16202 (FletX, Flet): Obey lexical binding.
16203 (Fcommandp): Handle closures.
16204 (Feval): New `lexical' arg.
16205 (eval_sub): New function extracted from Feval. Use it almost
16206 everywhere where Feval was used. Look up vars in lexical env.
16207 Handle closures.
16208 (Ffunctionp): Move from subr.el.
16209 (Ffuncall): Handle closures.
16210 (apply_lambda): Remove `eval_flags'.
16211 (funcall_lambda): Handle closures and new byte-code-functions.
16212 (Fspecial_variable_p): New function.
16213 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
16214 but without exporting it to Lisp.
16215
16216 * doc.c (Fdocumentation, store_function_docstring):
16217 * data.c (Finteractive_form): Handle closures.
16218
16219 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
16220 interactive spec.
16221
16222 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
16223 New byte-codes.
16224 (exec_byte_code): New function extracted from Fbyte_code to handle new
16225 calling convention for byte-code-functions. Add new byte-codes.
16226
16227 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
16228
16229 * alloc.c (Fmake_symbol): Init new `declared_special' field.
16230
16231 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16232
16233 * xdisp.c (redisplay_internal): Fix prototype.
16234
16235 2011-03-31 Eli Zaretskii <eliz@gnu.org>
16236
16237 * xdisp.c (SCROLL_LIMIT): New macro.
16238 (try_scrolling): Use it when setting scroll_limit.
16239 Limit scrolling to 100 screen lines.
16240 (redisplay_window): Even when falling back on "recentering",
16241 position point in the window according to scroll-conservatively,
16242 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
16243
16244 (try_scrolling): When point is above the window, allow searching
16245 as far as scroll_max, or one screenful, to compute vertical
16246 distance from PT to the scroll margin position. This prevents
16247 try_scrolling from unnecessarily failing when
16248 scroll-conservatively is set to a value slightly larger than the
16249 window height. Clean up the case of PT below the margin at bottom
16250 of window: scroll_max can no longer be INT_MAX. When aggressive
16251 scrolling is in use, don't let point enter the opposite scroll
16252 margin as result of the scroll.
16253 (syms_of_xdisp) <scroll-conservatively>: Document the
16254 threshold of 100 lines for never-recentering scrolling.
16255
16256 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
16257
16258 * dispextern.h (move_it_by_lines):
16259 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
16260 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
16261 (message_log_check_duplicate): Remove parameters `prev_bol' and
16262 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
16263 (redisplay_internal): Remove parameter `preserve_echo_area',
16264 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
16265
16266 * indent.c (Fvertical_motion):
16267 * window.c (window_scroll_pixel_based, Frecenter):
16268 Don't pass `need_y_p' to `move_it_by_lines'.
16269
16270 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
16271
16272 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
16273 steal a few bits to be more compact.
16274 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
16275 Remove unneeded casts.
16276
16277 * bytecode.c (Fbyte_code): CAR and CDR can GC.
16278
16279 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
16280
16281 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
16282 binding" message (bug#7967).
16283
16284 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
16285
16286 Fix more problems found by GCC 4.6.0's static checks.
16287
16288 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
16289 Remove unused local var.
16290
16291 * editfns.c (Fmessage_box): Remove unused local var.
16292
16293 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
16294 (note_mode_line_or_margin_highlight, note_mouse_highlight):
16295 Omit unused local vars.
16296 * window.c (shrink_windows): Omit unused local var.
16297 * menu.c (digest_single_submenu): Omit unused local var.
16298 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
16299 Omit unused local var.
16300
16301 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
16302 Don't assume string length fits in int.
16303 (keyremap_step, read_key_sequence): Use size_t for sizes.
16304 (read_key_sequence): Don't check last_real_key_start redundantly.
16305
16306 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
16307 instead of alloca (Bug#8344).
16308
16309 * eval.c (Fbacktrace): Don't assume nargs fits in int.
16310 (Fbacktrace_frame): Don't assume nframes fits in int.
16311
16312 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
16313
16314 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
16315 concerns.
16316
16317 * term.c (produce_glyphless_glyph): Remove unnecessary test.
16318
16319 * cm.c (calccost): Turn while-do into do-while, for clarity.
16320
16321 * keyboard.c (syms_of_keyboard): Use the same style as later
16322 in this function when indexing through an array. This also
16323 works around GCC bug 48267.
16324
16325 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
16326
16327 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
16328
16329 * chartab.c (sub_char_table_ref_and_range): Redo for slight
16330 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
16331
16332 * keyboard.c, keyboard.h (num_input_events): Now size_t.
16333 This avoids undefined behavior on integer overflow, and is a bit
16334 more convenient anyway since it is compared to a size_t variable.
16335
16336 Variadic C functions now count arguments with size_t, not int.
16337 This avoids an unnecessary limitation on 64-bit machines, which
16338 caused (substring ...) to crash on large vectors (Bug#8344).
16339 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
16340 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
16341 All variadic functions and their callers changed accordingly.
16342 (struct gcpro.nvars): Now size_t, not int. All uses changed.
16343 * data.c (arith_driver, float_arith_driver): Likewise.
16344 * editfns.c (general_insert_function): Likewise.
16345 * eval.c (struct backtrace.nargs, interactive_p)
16346 (internal_condition_case_n, run_hook_with_args, apply_lambda)
16347 (funcall_lambda, mark_backtrace): Likewise.
16348 * fns.c (concat): Likewise.
16349 * frame.c (x_set_frame_parameters): Likewise.
16350 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
16351 0 if not found, not -1. All callers changed.
16352
16353 * alloc.c (garbage_collect): Don't assume stack size fits in int.
16354 (stack_copy_size): Now size_t, not int.
16355 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
16356
16357 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16358
16359 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
16360 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16361 All callers changed.
16362
16363 * lisp.h (multibyte_char_to_unibyte):
16364 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
16365 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
16366 * character.h (CHAR_TO_BYTE8):
16367 * cmds.c (internal_self_insert):
16368 * editfns.c (general_insert_function):
16369 * keymap.c (push_key_description):
16370 * search.c (Freplace_match):
16371 * xdisp.c (message_dolog, set_message_1): All callers changed.
16372
16373 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
16374
16375 * keyboard.c (safe_run_hook_funcall): New function.
16376 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
16377 don't set the hook to nil, but remove the offending function instead.
16378 (Qcommand_hook_internal): Remove, unused.
16379 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
16380 Vcommand_hook_internal.
16381
16382 * eval.c (enum run_hooks_condition): Remove.
16383 (funcall_nil, funcall_not): New functions.
16384 (run_hook_with_args): Call each function through a `funcall' argument.
16385 Remove `cond' argument, now redundant.
16386 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
16387 (Frun_hook_with_args_until_failure): Adjust accordingly.
16388 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
16389
16390 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
16391
16392 * dispextern.h (string_buffer_position): Remove declaration.
16393
16394 * print.c (strout): Remove parameter `multibyte', unused since
16395 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
16396
16397 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
16398 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
16399 All callers changed.
16400
16401 * w32.c (_wsa_errlist): Use braces for struct initializers.
16402
16403 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
16404 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
16405 All callers changed.
16406 (string_buffer_position): Likewise. Also, make static (it's never
16407 used outside xdisp.c).
16408 (cursor_row_p): Remove parameter `w', unused since
16409 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
16410 (decode_mode_spec): Remove parameter `precision', introduced during
16411 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
16412 All callers changed.
16413
16414 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16415
16416 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
16417
16418 2011-03-27 Anders Lindgren <andlind@gmail.com>
16419
16420 * nsterm.m (ns_menu_bar_is_hidden): New variable.
16421 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
16422 (ns_update_auto_hide_menu_bar): New functions.
16423 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
16424 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
16425 ns_constrain_all_frames.
16426 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
16427 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
16428
16429 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
16430
16431 * nsmenu.m (runDialogAt): Remove argument to timer_check.
16432
16433 2011-03-27 Glenn Morris <rgm@gnu.org>
16434
16435 * syssignal.h: Replace RETSIGTYPE with void.
16436 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
16437 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
16438 Replace SIGTYPE with void everywhere.
16439 * s/usg5-4-common.h (SIGTYPE): Remove definition.
16440 * s/template.h (SIGTYPE): Remove commented out definition.
16441
16442 2011-03-26 Eli Zaretskii <eliz@gnu.org>
16443
16444 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
16445 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
16446
16447 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
16448
16449 * w32.c (read_unc_volume): Use parameter `henum', instead of
16450 global variable `wget_enum_handle'.
16451
16452 * keymap.c (describe_vector): Remove parameters `indices' and
16453 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
16454 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
16455
16456 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
16457
16458 * keyboard.c (timer_check): Remove parameter `do_it_now',
16459 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
16460 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
16461 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
16462
16463 * keyboard.c (read_char):
16464 * w32menu.c (w32_menu_display_help):
16465 * xmenu.c (show_help_event, menu_help_callback):
16466 Adjust calls to `show_help_echo'.
16467
16468 * gtkutil.c (xg_maybe_add_timer):
16469 * keyboard.c (readable_events):
16470 * process.c (wait_reading_process_output):
16471 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
16472
16473 * insdel.c (adjust_markers_gap_motion):
16474 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
16475 (gap_left, gap_right): Don't call it.
16476
16477 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
16478
16479 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
16480 incurred during fontification.
16481
16482 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16483
16484 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
16485 (DEFVAR_PER_BUFFER): Don't pass it.
16486
16487 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
16488 (scrolling_window): Don't pass it.
16489
16490 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
16491
16492 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
16493
16494 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
16495 and `suffix'.
16496 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
16497 of variables specific to SELinux and computation of `encoded_absname'.
16498
16499 * image.c (XPutPixel): Remove unused variable `height'.
16500
16501 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
16502
16503 * unexw32.c (get_section_info): Remove unused variable `section'.
16504
16505 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
16506 (system_process_attributes): Remove unused variable `sess'.
16507 (sys_read): Remove unused variable `err'.
16508
16509 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
16510 (w32_wnd_proc): Remove unused variable `isdead'.
16511 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
16512 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
16513 (x_create_tip_frame): Remove unused variable `tem'.
16514
16515 * w32inevt.c (w32_console_read_socket):
16516 Remove unused variable `no_events'.
16517
16518 * w32term.c (x_draw_composite_glyph_string_foreground):
16519 Remove unused variable `width'.
16520
16521 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
16522
16523 * w32term.c (x_set_glyph_string_clipping):
16524 Don't pass uninitialized region to CombineRgn.
16525
16526 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
16527
16528 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
16529 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
16530 (Fx_close_connection): Remove unused variable `i'.
16531
16532 * w32font.c (w32font_draw): Return number of glyphs.
16533 (w32font_open_internal): Remove unused variable `i'.
16534 (w32font_driver): Add missing initializer.
16535
16536 * w32menu.c (utf8to16): Remove unused variable `utf16'.
16537 (fill_in_menu): Remove unused variable `items_added'.
16538
16539 * w32term.c (last_mouse_press_frame): Remove static global variable.
16540 (w32_clip_to_row): Remove unused variable `f'.
16541 (x_delete_terminal): Remove unused variable `i'.
16542
16543 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
16544 (NOTHING): Remove unused static global variable.
16545 (uniscribe_check_otf): Remove unused variable `table'.
16546 (uniscribe_font_driver): Add missing initializers.
16547
16548 2011-03-23 Julien Danjou <julien@danjou.info>
16549
16550 * term.c (Fsuspend_tty, Fresume_tty):
16551 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
16552 * window.c (temp_output_buffer_show):
16553 * insdel.c (signal_before_change):
16554 * frame.c (Fhandle_switch_frame):
16555 * fileio.c (Fdo_auto_save):
16556 * emacs.c (Fkill_emacs):
16557 * editfns.c (save_excursion_restore):
16558 * cmds.c (internal_self_insert):
16559 * callint.c (Fcall_interactively):
16560 * buffer.c (Fkill_all_local_variables):
16561 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
16562 Use Frun_hooks.
16563 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
16564 unconditionally since it does the check itself.
16565
16566 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
16567
16568 Fix more problems found by GCC 4.5.2's static checks.
16569
16570 * coding.c (encode_coding_raw_text): Avoid unnecessary test
16571 the first time through the loop, since we know p0 < p1 then.
16572 This also avoids a gcc -Wstrict-overflow warning.
16573
16574 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
16575 leading to a memory leak, possible in functions like
16576 load_charset_map_from_file that can allocate an unbounded number
16577 of objects (Bug#8318).
16578
16579 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
16580 that could (at least in theory) be that large.
16581
16582 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
16583 This is less likely to overflow, and avoids undefined behavior if
16584 overflow does occur. All callers changed. Use strtoul to scan
16585 for the unsigned long integer.
16586 (pint2hrstr): Simplify and tune code slightly.
16587 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
16588
16589 * scroll.c (do_scrolling): Work around GCC bug 48228.
16590 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
16591
16592 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
16593 This also avoids a warning with gcc -Wstrict-overflow.
16594 (validate_x_resource_name): Simplify count usage.
16595 This also avoids a warning with gcc -Wstrict-overflow.
16596
16597 * fileio.c (Fcopy_file): Report error if fchown or fchmod
16598 fail (Bug#8306).
16599
16600 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
16601
16602 * process.c (Fmake_network_process): Use socklen_t, not int,
16603 where POSIX says socklen_t is required in portable programs.
16604 This fixes a porting bug on hosts like 64-bit HP-UX, where
16605 socklen_t is wider than int (Bug#8277).
16606 (Fmake_network_process, server_accept_connection):
16607 (wait_reading_process_output, read_process_output):
16608 Likewise.
16609
16610 * process.c: Rename or move locals to avoid shadowing.
16611 (list_processes_1, Fmake_network_process):
16612 (read_process_output_error_handler, exec_sentinel_error_handler):
16613 Rename or move locals.
16614 (Fmake_network_process): Define label "retry_connect" only if needed.
16615 (Fnetwork_interface_info): Fix pointer signedness.
16616 (process_send_signal): Add cast to avoid pointer signedness problem.
16617 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
16618 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
16619
16620 Make tparam.h and terminfo.c consistent.
16621 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
16622 Include tparam.h instead, since it declares them.
16623 * cm.h (PC): Remove extern decl; tparam.h now does this.
16624 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
16625 * terminfo.c: Include tparam.h, to check interfaces.
16626 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
16627 (tparam): Adjust signature to match interface in tparam.h;
16628 this removes some undefined behavior. Check that outstring and len
16629 are zero, which they always are with Emacs.
16630 * tparam.h (PC, BC, UP): New extern decls.
16631
16632 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
16633 (xftfont_open): Rename locals to avoid shadowing.
16634
16635 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
16636 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
16637 (OTF_TAG_SYM): Omit macro if not needed.
16638 (ftfont_list): Remove unused local.
16639 (get_adstyle_property, ftfont_pattern_entity):
16640 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
16641 Rename locals to avoid shadowing.
16642
16643 * xfont.c (xfont_list_family): Mark var as initialized.
16644
16645 * xml.c (make_dom): Now static.
16646
16647 * composite.c (composition_compute_stop_pos): Rename local to
16648 avoid shadowing.
16649 (composition_reseat_it): Remove unused locals.
16650 (find_automatic_composition, composition_adjust_point): Likewise.
16651 (composition_update_it): Mark var as initialized.
16652 (find_automatic_composition): Mark vars as initialized,
16653 with a FIXME (Bug#8290).
16654
16655 character.h: Rename locals to avoid shadowing.
16656 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
16657 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
16658 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
16659 (BUF_DEC_POS): Be more systematic about renaming local temporaries
16660 to avoid shadowing.
16661
16662 * textprop.c (property_change_between_p): Remove; unused.
16663
16664 * intervals.c (interval_start_pos): Now static.
16665
16666 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
16667
16668 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
16669 Rename locals to avoid shadowing.
16670
16671 * sound.c (wav_play, au_play, Fplay_sound_internal):
16672 Fix pointer signedness.
16673 (alsa_choose_format): Remove unused local var.
16674 (wav_play): Initialize a variable to 0, to prevent undefined
16675 behavior (Bug#8278).
16676
16677 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
16678
16679 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
16680
16681 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
16682 clobbering (Bug#8298).
16683 * sysdep.c (sys_subshell): Likewise.
16684 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
16685
16686 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
16687 This should get cleaned up, so that child_setup has the
16688 same signature on all platforms.
16689
16690 * callproc.c (call_process_cleanup): Now static.
16691 (relocate_fd): Rename locals to avoid shadowing.
16692
16693 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
16694
16695 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
16696 not to be necessary, and produces flickering.
16697
16698 2011-03-20 Glenn Morris <rgm@gnu.org>
16699
16700 * config.in: Remove file.
16701
16702 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
16703
16704 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
16705 are now in src/globals.h.
16706 (syms_of_minibuf): Remove spurious & from previous change.
16707
16708 2011-03-20 Leo Liu <sdl.web@gmail.com>
16709
16710 * minibuf.c (completing-read-function): New variable.
16711 (completing-read-default): Rename from completing-read.
16712 (completing-read): Call completing-read-function.
16713
16714 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16715
16716 * xfaces.c (Fx_load_color_file):
16717 Read color file from absolute filename (bug#8250).
16718
16719 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
16720
16721 * makefile.w32-in: Update dependencies.
16722
16723 2011-03-17 Eli Zaretskii <eliz@gnu.org>
16724
16725 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
16726
16727 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
16728
16729 Fix more problems found by GCC 4.5.2's static checks.
16730
16731 * process.c (make_serial_process_unwind, send_process_trap):
16732 (sigchld_handler): Now static.
16733
16734 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
16735 That way, the code declares only the vars that it needs.
16736 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
16737 * s/cygwin.h (PTY_ITERATION): Likewise.
16738 * s/darwin.h (PTY_ITERATION): Likewise.
16739 * s/gnu-linux.h (PTY_ITERATION): Likewise.
16740
16741 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
16742 * process.c (allocate_pty): Don't declare stb unless it's needed.
16743
16744 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
16745 (CONSTANTLIM): Remove; unused.
16746 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
16747 Define only if needed.
16748
16749 * unexelf.c (unexec): Name an expression,
16750 to avoid gcc -Wbad-function-cast warning.
16751 Use a different way to cause a compilation error if anyone uses
16752 n rather than nn, a way that does not involve shadowing.
16753 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
16754
16755 * deps.mk (unexalpha.o): Remove; unused.
16756
16757 New file unexec.h, the (simple) interface for unexec (Bug#8267).
16758 * unexec.h: New file.
16759 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
16760 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
16761 Depend on unexec.h.
16762 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
16763 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
16764 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
16765 Change as necessary to match prototype in unexec.h.
16766
16767 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
16768 shadowing.
16769 (back_comment, skip_chars): Mark vars as initialized.
16770
16771 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
16772 Rename locals to avoid shadowing.
16773
16774 * lread.c (read1): Rewrite so as not to use empty "else".
16775 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
16776
16777 * print.c (Fredirect_debugging_output): Fix pointer signedess.
16778
16779 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
16780 warning when compiling print.c.
16781
16782 * font.c (font_unparse_fcname): Abort in an "impossible" situation
16783 instead of using an uninitialized var.
16784 (font_sort_entities): Mark var as initialized.
16785
16786 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
16787
16788 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
16789 pointers to constants.
16790 (font_parse_fcname): Remove unused vars.
16791 (font_delete_unmatched): Now static.
16792 (font_get_spec): Remove; unused.
16793 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
16794 (font_update_drivers, Ffont_get_glyphs, font_add_log):
16795 Rename or move locals to avoid shadowing.
16796
16797 * fns.c (require_nesting_list, require_unwind): Now static.
16798 (Ffillarray): Rename locals to avoid shadowing.
16799
16800 * floatfns.c (domain_error2): Define only if needed.
16801 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
16802
16803 * alloc.c (mark_backtrace): Move decl from here ...
16804 * lisp.h: ... to here, so that it can be checked.
16805
16806 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
16807 (Fdefvar): Rewrite so as not to use empty "else".
16808 (lisp_indirect_variable): Name an expression,
16809 to avoid gcc -Wbad-function-cast warning.
16810 (Fdefvar): Rename locals to avoid shadowing.
16811
16812 * callint.c (quotify_arg, quotify_args): Now static.
16813 (Fcall_interactively): Rename locals to avoid shadowing.
16814 Use const pointer when appropriate.
16815
16816 * lisp.h (get_system_name, get_operating_system_release):
16817 Move decls here, to check interfaces.
16818 * process.c (get_operating_system_release): Move decl to lisp.h.
16819 * xrdb.c (get_system_name): Likewise.
16820 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
16821 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
16822 some of which prompt warnings from gcc -Wbad-function-cast.
16823 (Fformat_time_string, Fencode_time, Finsert_char):
16824 (Ftranslate_region_internal, Fformat):
16825 Rename or remove local vars to avoid shadowing.
16826 (Ftranslate_region_internal): Mark var as initialized.
16827
16828 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
16829 avoid shadowing.
16830
16831 * lisp.h (eassert): Check that the argument compiles, even if
16832 ENABLE_CHECKING is not defined.
16833
16834 * data.c (Findirect_variable): Name an expression, to avoid
16835 gcc -Wbad-function-cast warning.
16836 (default_value, arithcompare, arith_driver, arith_error): Now static.
16837 (store_symval_forwarding): Rename local to avoid shadowing.
16838 (Fmake_variable_buffer_local, Fmake_local_variable):
16839 Mark variables as initialized.
16840 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
16841
16842 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
16843 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
16844 Rename locals to avoid shadowing.
16845 (mark_stack): Move local variables into the #ifdef region where
16846 they're used.
16847 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
16848 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
16849 needed otherwise.
16850 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
16851 (GC_STRING_CHARS): Remove; not used.
16852 (Fmemory_limit): Cast sbrk's returned value to char *.
16853
16854 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
16855 avoids undefined behavior in theory.
16856
16857 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
16858
16859 Use functions, not macros, for up- and down-casing (Bug#8254).
16860 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16861 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
16862 to use the following functions instead of these macros.
16863 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
16864 EMACS_INT, since callers assume the returned value fits in int.
16865 (upcase1): Likewise, for UPCASE_TABLE.
16866 (uppercasep, lowercasep, upcase): New static inline functions.
16867 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
16868 the race-condition problem in the old DOWNCASE.
16869
16870 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
16871 Rename locals to avoid shadowing.
16872 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
16873 (regex_compile, re_search_2, re_match_2_internal):
16874 Remove unused local vars.
16875 (FREE_VAR): Rewrite so as not to use empty "else",
16876 which gcc can warn about.
16877 (regex_compile, re_match_2_internal): Mark locals as initialized.
16878 (RETALLOC_IF): Define only if needed.
16879 (WORDCHAR_P): Likewise. This one is never needed, but is used
16880 only in a comment talking about a compiler bug, so put inside
16881 the #if 0 of that comment.
16882 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
16883 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
16884 Remove; unused.
16885
16886 * search.c (boyer_moore): Rename locals to avoid shadowing.
16887 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
16888 (PREV_CHAR_BOUNDARY): Likewise.
16889
16890 * search.c (simple_search): Remove unused var.
16891
16892 * dired.c (compile_pattern): Move decl from here ...
16893 * lisp.h: ... to here, so that it can be checked.
16894 (struct re_registers): New forward decl.
16895
16896 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
16897
16898 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
16899 All uses changed.
16900 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
16901 Rename locals to avoid shadowing.
16902 (Fvertical_motion): Mark locals as initialized.
16903
16904 * casefiddle.c (casify_object, casify_region): Now static.
16905 (casify_region): Mark local as initialized.
16906
16907 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
16908
16909 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
16910 New macros, so that the caller can use some names other than
16911 gcpro1, gcpro2, etc.
16912 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
16913 of the new macros.
16914 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
16915 argument, for consistency with GCPRO2_VAR, etc: it is now the
16916 prefix of the variable, not the variable itself. All uses
16917 changed.
16918 * dired.c (directory_files_internal, file_name_completion):
16919 Rename locals to avoid shadowing.
16920
16921 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
16922 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
16923 dired.c's scmp function, had undefined behavior.
16924 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
16925 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
16926 * buffer.h: ... to here, because these macros use current_buffer,
16927 and the new implementation with inline functions needs to have
16928 current_buffer in scope now, rather than later when the macros
16929 are used.
16930 (downcase, upcase1): New static inline functions.
16931 (DOWNCASE, UPCASE1): Reimplement using these functions.
16932 This avoids undefined behavior in expressions like
16933 DOWNCASE (x) == DOWNCASE (y), which previously suffered
16934 from race conditions in accessing the global variables
16935 case_temp1 and case_temp2.
16936 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
16937 * lisp.h (case_temp1, case_temp2): Remove their decls.
16938 * character.h (ASCII_CHAR_P): Move from here ...
16939 * lisp.h: ... to here, so that the inline functions mentioned
16940 above can use them.
16941
16942 * dired.c (directory_files_internal_unwind): Now static.
16943
16944 * fileio.c (file_name_as_directory, directory_file_name):
16945 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
16946 Now static.
16947 (file_name_as_directory): Use const pointers when appropriate.
16948 (Fexpand_file_name): Likewise. In particular, newdir might
16949 point at constant storage, so make it a const pointer.
16950 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
16951 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
16952 signedness issues.
16953 (Fset_file_times, Finsert_file_contents, auto_save_error):
16954 Rename locals to avoid shadowing.
16955
16956 * minibuf.c (choose_minibuf_frame_1): Now static.
16957 (Ftry_completion, Fall_completions): Rename or remove locals
16958 to avoid shadowing.
16959
16960 * marker.c (bytepos_to_charpos): Remove; unused.
16961
16962 * lisp.h (verify_bytepos, count_markers): New decls,
16963 so that gcc does not warn that these functions aren't declared.
16964
16965 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
16966 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
16967 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
16968 (copy_text): Remove unused local var.
16969
16970 * filelock.c (within_one_second): Now static.
16971 (lock_file_1): Rename local to avoid shadowing.
16972
16973 * buffer.c (fix_overlays_before): Mark locals as initialized.
16974 (fix_start_end_in_overlays): Likewise. This function should be
16975 simplified by using pointers-to-pointers, but that's a different
16976 matter.
16977 (switch_to_buffer_1): Now static.
16978 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
16979 (report_overlay_modification): Rename locals to avoid shadowing.
16980
16981 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
16982 Fix pointer signedness issue.
16983 (sys_subshell): Mark local as volatile if checking for lint,
16984 to suppress a gcc -Wclobbered warning that does not seem to be right.
16985 (MAXPATHLEN): Define only if needed.
16986
16987 * process.c (serial_open, serial_configure): Move decls from here ...
16988 * systty.h: ... to here, so that they can be checked.
16989
16990 * fns.c (get_random, seed_random): Move extern decls from here ...
16991 * lisp.h: ... to here, so that they can be checked.
16992
16993 * sysdep.c (reset_io): Now static.
16994 (wait_for_termination_signal): Remove; unused.
16995
16996 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
16997 (copy_keymap_item, append_key, push_text_char_description):
16998 Now static.
16999 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
17000 (DENSE_TABLE_SIZE): Remove; unused.
17001 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
17002 (describe_map_tree):
17003 Rename locals to avoid shadowing.
17004
17005 * keyboard.c: Declare functions static if they are not used elsewhere.
17006 (echo_char, echo_dash, cmd_error, top_level_2):
17007 (poll_for_input, handle_async_input): Now static.
17008 (read_char, kbd_buffer_get_event, make_lispy_position):
17009 (make_lispy_event, make_lispy_movement, apply_modifiers):
17010 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
17011 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
17012 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
17013 (read_key_sequence, read_char): Mark locals as initialized.
17014 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
17015
17016 * keyboard.h (make_ctrl_char): New decl.
17017 (mark_kboards): Move decl here ...
17018 * alloc.c (mark_kboards): ... from here.
17019
17020 * lisp.h (force_auto_save_soon): New decl.
17021
17022 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
17023 (DEFINE_DUMMY_FUNCTION): New macro.
17024 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
17025 Use it.
17026 (main): Add casts to avoid warnings
17027 if GCC considers string literals to be constants.
17028
17029 * lisp.h (fatal_error_signal): Add decl, since it's exported.
17030
17031 * dbusbind.c: Pointer signedness fixes.
17032 (xd_signature, xd_append_arg, xd_initialize):
17033 (Fdbus_call_method, Fdbus_call_method_asynchronously):
17034 (Fdbus_method_return_internal, Fdbus_method_error_internal):
17035 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
17036 (Fdbus_register_signal): Use SSDATA when the context wants char *.
17037
17038 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
17039 if GCC considers string literals to be constants.
17040 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
17041
17042 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
17043
17044 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
17045 (print_preprocess, print_object): New macro to fix last change.
17046
17047 * print.c (print_preprocess): Don't forget font objects.
17048
17049 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
17050
17051 * emacs.c (USAGE3): Doc fixes.
17052
17053 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
17054
17055 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
17056 structure.
17057
17058 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
17059
17060 * lisp.h (VWindow_system, Qfile_name_history):
17061 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
17062 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
17063 (w32_system_caret_x, w32_system_caret_y): Declare extern.
17064
17065 * w32select.c: Don't #include "keyboard.h".
17066 (run_protected): Add extern declaration for waiting_for_input.
17067
17068 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
17069 * w32console.c (detect_input_pending, read_input_pending)
17070 (encode_terminal_code):
17071 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
17072 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
17073 (w32_system_caret_y, Qfile_name_history):
17074 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
17075 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
17076 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
17077 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
17078 * w32proc.c (Qlocal, report_file_error):
17079 * w32term.c (Vwindow_system, updating_frame):
17080 * w32uniscribe.c (initialized, uniscribe_font_driver):
17081 Remove unneeded extern declarations.
17082
17083 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
17084
17085 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
17086
17087 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
17088
17089 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
17090 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
17091 These macros can no longer be used for assignment.
17092
17093 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
17094 Assign struct members directly, instead of using BUF_BEGV etc.
17095 (record_buffer_markers, fetch_buffer_markers): New functions for
17096 recording and fetching special buffer markers.
17097 (set_buffer_internal_1, set_buffer_temp): Use them.
17098
17099 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
17100
17101 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
17102
17103 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
17104 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
17105
17106 * xdisp.c (hscroll_window_tree):
17107 (reconsider_clip_changes): Use PT instead of BUF_PT.
17108
17109 2011-03-13 Eli Zaretskii <eliz@gnu.org>
17110
17111 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
17112 $(EMACS_ROOT)/lib/intprops.h.
17113
17114 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
17115
17116 Fix more problems found by GCC 4.5.2's static checks.
17117
17118 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
17119 to unsigned char * to avoid compiler diagnostic.
17120 (xg_free_frame_widgets): Make it clear that a local variable is
17121 needed only if USE_GTK_TOOLTIP.
17122 (gdk_window_get_screen): Make it clear that this macro is needed
17123 only if USE_GTK_TOOLTIP.
17124 (int_gtk_range_get_value): New function, which avoids a diagnostic
17125 from gcc -Wbad-function-cast.
17126 (xg_set_toolkit_scroll_bar_thumb): Use it.
17127 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
17128 diagnostic from gcc -Wbad-function-cast.
17129 (get_utf8_string, xg_get_file_with_chooser):
17130 Rename locals to avoid shadowing.
17131 (create_dialog): Move locals to avoid shadowing.
17132
17133 * xgselect.c (xg_select): Remove unused var.
17134
17135 * image.c (four_corners_best): Mark locals as initialized.
17136 (gif_load): Initialize transparent_p to zero (Bug#8238).
17137 Mark another local as initialized.
17138 (my_png_error, my_error_exit): Mark with NO_RETURN.
17139
17140 * image.c (clear_image_cache): Now static.
17141 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
17142 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
17143 (x_edge_detection): Remove unnecessary cast that
17144 gcc -Wbad-function-cast diagnoses.
17145 (gif_load): Fix pointer signedness.
17146 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
17147 (jpeg_load, gif_load): Rename locals to avoid shadowing.
17148
17149 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
17150
17151 Improve quality of tests for time stamp overflow.
17152 For example, without this patch (encode-time 0 0 0 1 1
17153 1152921504606846976) returns the obviously-bogus value (-948597
17154 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
17155 reports time overflow. See
17156 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
17157 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
17158 * editfns.c: Include limits.h and intprops.h.
17159 (TIME_T_MIN, TIME_T_MAX): New macros.
17160 (time_overflow): Move earlier, to before first use.
17161 (hi_time, lo_time): New functions, for an accurate test for
17162 out-of-range times.
17163 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
17164 (Fget_internal_run_time): Don't assume time_t fits in int.
17165 (make_time): Use list2 instead of Fcons twice.
17166 (Fdecode_time): More accurate test for out-of-range times.
17167 (check_tm_member): New function.
17168 (Fencode_time): Use it, to test for out-of-range times.
17169 (lisp_time_argument): Don't rely on undefined left-shift and
17170 right-shift behavior when checking for time stamp overflow.
17171
17172 * editfns.c (time_overflow): New function, refactoring common code.
17173 (Fformat_time_string, Fdecode_time, Fencode_time):
17174 (Fcurrent_time_string): Use it.
17175
17176 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
17177 * dired.c (make_time): Move to ...
17178 * editfns.c (make_time): ... here.
17179 * systime.h: Note the move.
17180
17181 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17182
17183 * fringe.c (update_window_fringes): Remove unused variables.
17184
17185 * unexmacosx.c (copy_data_segment): Also copy __got section.
17186 (Bug#8223)
17187
17188 2011-03-12 Eli Zaretskii <eliz@gnu.org>
17189
17190 * termcap.c [MSDOS]: Include "msdos.h".
17191 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
17192 Constify `char *' arguments and their references according to
17193 prototypes in tparam.h.
17194
17195 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
17196
17197 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
17198 Adapt all references accordingly.
17199
17200 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
17201
17202 2011-03-11 Tom Tromey <tromey@redhat.com>
17203
17204 * buffer.c (syms_of_buffer): Remove obsolete comment.
17205
17206 2011-03-11 Eli Zaretskii <eliz@gnu.org>
17207
17208 * termhooks.h (encode_terminal_code): Declare prototype.
17209
17210 * msdos.c (encode_terminal_code): Don't declare prototype.
17211
17212 * term.c (encode_terminal_code): Now external again, used by
17213 w32console.c and msdos.c.
17214
17215 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
17216 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
17217
17218 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
17219
17220 Fix some minor problems found by GCC 4.5.2's static checks.
17221
17222 * fringe.c (update_window_fringes): Mark locals as initialized
17223 (Bug#8227).
17224 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
17225
17226 * alloc.c (mark_fringe_data): Move decl from here ...
17227 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
17228 to check its interface.
17229 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
17230
17231 * fontset.c (free_realized_fontset): Now static.
17232 (Fset_fontset_font): Rename local to avoid shadowing.
17233 (fontset_font): Mark local as initialized.
17234 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
17235
17236 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
17237
17238 * xselect.c (x_disown_buffer_selections): Remove; not used.
17239 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
17240 (x_own_selection, Fx_disown_selection_internal): Rename locals
17241 to avoid shadowing.
17242 (x_handle_dnd_message): Remove local to avoid shadowing.
17243
17244 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
17245 so that the caller can use some name other than gcpro1.
17246 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
17247 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17248 (Fx_backspace_delete_keys_p):
17249 Use them to avoid shadowing, and rename vars to avoid shadowing.
17250 (x_decode_color, x_set_name, x_window): Now static.
17251 (Fx_create_frame): Add braces to silence GCC warning.
17252 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
17253 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
17254 Remove unused locals.
17255 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
17256 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
17257 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
17258 macros.
17259
17260 * xterm.h (x_mouse_leave): New decl.
17261
17262 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
17263 Remove unused functions.
17264 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
17265 (x_calc_absolute_position): Now static.
17266 (XTread_socket): Don't define label "out" unless it's used.
17267 Don't declare local "event" unless it's used.
17268 (x_iconify_frame, x_free_frame_resources): Don't declare locals
17269 unless they are used.
17270 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
17271 (x_fatal_error_signal): Remove; not used.
17272 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
17273 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
17274 (x_error_catcher, x_connection_closed, x_error_handler):
17275 (x_error_quitter, xembed_send_message, x_iconify_frame):
17276 (my_log_handler): Rename locals to avoid shadowing.
17277 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
17278 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
17279
17280 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
17281 Rename or move locals to avoid shadowing.
17282 (tty_defined_color, merge_face_heights): Now static.
17283 (free_realized_faces_for_fontset): Remove; not used.
17284 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
17285 does not deduce is never used uninitialized.
17286 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
17287 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
17288
17289 * terminal.c (store_terminal_param): Now static.
17290
17291 * xmenu.c (menu_highlight_callback): Now static.
17292 (set_frame_menubar): Remove unused local.
17293 (xmenu_show): Rename parameter to avoid shadowing.
17294 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
17295 since they might point to immutable storage.
17296 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
17297 since it's unused otherwise.
17298
17299 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
17300 Add a FIXME, since the code still doesn't look right. (Bug#8215)
17301 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
17302 avoids a gcc -Wuninitialized diagnostic.
17303 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
17304 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
17305 does not deduce are never used uninitialized.
17306
17307 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
17308
17309 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
17310 * window.c (window_loop, size_window):
17311 (run_window_configuration_change_hook, enlarge_window): Likewise.
17312
17313 * window.c (display_buffer): Now static.
17314 (size_window): Mark variables that gcc -Wuninitialized
17315 does not deduce are never used uninitialized.
17316 * window.h (check_all_windows): New decl, to forestall
17317 gcc -Wmissing-prototypes diagnostic.
17318 * dispextern.h (bidi_dump_cached_states): Likewise.
17319
17320 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
17321 shadowing.
17322 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
17323 Include <limits.h>.
17324 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
17325 and to avoid gcc -Wuninitialized warning.
17326 (load_charset_map): Mark variables that gcc -Wuninitialized
17327 does not deduce are never used uninitialized.
17328 (load_charset): Abort instead of using uninitialized var (Bug#8229).
17329
17330 * coding.c (coding_set_source, coding_set_destination):
17331 Use "else { /* comment */ }" rather than "else /* comment */;"
17332 for clarity, and to avoid gcc -Wempty-body warning.
17333 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
17334 a block, when the outer 'i' will do.
17335 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
17336 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
17337 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
17338 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
17339 (Fdecode_sjis_char, Fdefine_coding_system_internal):
17340 Rename locals to avoid shadowing.
17341 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
17342 * coding.c (emacs_mule_char, encode_invocation_designation):
17343 Now static, since they're not used elsewhere.
17344 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
17345 (decode_coding_object, encode_coding_object, detect_coding_system):
17346 (decode_coding_emacs_mule): Mark variables that gcc
17347 -Wuninitialized does not deduce are never used uninitialized.
17348 (detect_coding_iso_2022): Initialize a local variable that might
17349 be used uninitialized. Leave a FIXME because it's not clear that
17350 this initialization is needed. (Bug#8211)
17351 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
17352 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
17353 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
17354 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
17355 Remove unused macros.
17356
17357 * category.c (hash_get_category_set): Remove unused local var.
17358 (copy_category_table): Now static, since it's not used elsewhere.
17359 * character.c (string_count_byte8): Likewise.
17360
17361 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
17362 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
17363
17364 * chartab.c (copy_sub_char_table): Now static, since it's not used
17365 elsewhere.
17366 (sub_char_table_ref_and_range, char_table_ref_and_range):
17367 Rename locals to avoid shadowing.
17368 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
17369
17370 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
17371 (BIDI_BOB): Remove unused macro.
17372
17373 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
17374 deduce are never used uninitialized.
17375 * term.c (encode_terminal_code): Likewise.
17376
17377 * term.c (encode_terminal_code): Now static. Remove unused local.
17378
17379 * tparam.h: New file.
17380 * term.c, tparam.h: Include it.
17381 * deps.mk (term.o, tparam.o): Depend on tparam.h.
17382 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
17383 Move these decls to tparam.h, and make them agree with what
17384 is actually in tparam.c. The previous trick of using incompatible
17385 decls in different modules does not conform to the C standard.
17386 All callers of tparam changed to use tparam's actual API.
17387 * tparam.c (tparam1, tparam, tgoto):
17388 Use const pointers where appropriate.
17389
17390 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
17391 * cm.h (struct cm): Likewise.
17392 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
17393 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
17394 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
17395 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
17396 (turn_on_face, init_tty): Likewise.
17397 * termchar.h (struct tty_display_info): Likewise.
17398
17399 * term.c (term_mouse_position): Rename local to avoid shadowing.
17400
17401 * alloc.c (mark_ttys): Move decl from here ...
17402 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
17403
17404 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
17405
17406 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
17407
17408 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
17409
17410 * search.c (compile_pattern_1): Remove argument regp, unused since
17411 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
17412 (compile_pattern): Don't pass it.
17413
17414 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
17415
17416 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
17417 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
17418 for ! HAVE_GTK3.
17419 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
17420
17421 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
17422
17423 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
17424 gdk_window_get_screen, gdk_window_get_geometry,
17425 gdk_x11_window_lookup_for_display and GDK_KEY_g.
17426 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
17427 (xg_get_pixbuf_from_pixmap): New function.
17428 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
17429 to Pixmap, take frame as parameter, remove GdkColormap parameter.
17430 Call xg_get_pixbuf_from_pixmap instead of
17431 gdk_pixbuf_get_from_drawable.
17432 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
17433 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
17434 (xg_check_special_colors): Use GtkStyleContext and its functions
17435 for HAVE_GTK3.
17436 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
17437 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
17438 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
17439 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
17440 Call gtk_widget_get_preferred_size.
17441 (xg_frame_resized): gdk_window_get_geometry only takes 5
17442 parameters.
17443 (xg_win_to_widget, xg_event_is_for_menubar):
17444 Call gdk_x11_window_lookup_for_display.
17445 (xg_set_widget_bg): New function.
17446 (delete_cb): New function.
17447 (xg_create_frame_widgets): Connect delete-event to delete_cb.
17448 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
17449 (xg_set_background_color): Call xg_set_widget_bg.
17450 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
17451 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
17452 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
17453 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
17454 if ! HAVE_GTK3.
17455 (update_frame_tool_bar): Call gtk_widget_hide.
17456 (xg_initialize): Use GDK_KEY_g.
17457
17458 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
17459 if ! HAVE_GTK3
17460 (x_session_initialize): Call gdk_x11_set_sm_client_id.
17461
17462 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
17463 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
17464 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
17465
17466 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
17467
17468 * w32xfns.c (select_palette): Check success of RealizePalette against
17469 GDI_ERROR, not zero.
17470
17471 See ChangeLog.11 for earlier changes.
17472
17473 ;; Local Variables:
17474 ;; coding: utf-8
17475 ;; End:
17476
17477 Copyright (C) 2011-2012 Free Software Foundation, Inc.
17478
17479 This file is part of GNU Emacs.
17480
17481 GNU Emacs is free software: you can redistribute it and/or modify
17482 it under the terms of the GNU General Public License as published by
17483 the Free Software Foundation, either version 3 of the License, or
17484 (at your option) any later version.
17485
17486 GNU Emacs is distributed in the hope that it will be useful,
17487 but WITHOUT ANY WARRANTY; without even the implied warranty of
17488 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17489 GNU General Public License for more details.
17490
17491 You should have received a copy of the GNU General Public License
17492 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.