* xgselect.c (xg_select): Just invoke 'select' if -nw.
[bpt/emacs.git] / src / ChangeLog
1 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
2
3 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
4
5 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * lread.c (init_obarray): Declare Qt and Qnil as special.
8
9 2012-05-14 Glenn Morris <rgm@gnu.org>
10
11 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
12 Put "libexec" before "bin", for the sake of init_callproc_1.
13
14 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
15
16 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
17
18 * unexaix.c: Port to more-recent AIX compilers.
19 (report_error, report_error_1, make_hdr, copy_sym)
20 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
21 Make arguments const char *, not char *, to avoid violations of C
22 standard and to fix some AIX warnings reported by Gilles Pion.
23
24 2012-05-14 Eli Zaretskii <eliz@gnu.org>
25
26 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
27 already have overlays loaded.
28 (handle_single_display_spec): Before returning without displaying
29 fringe bitmap, synchronize the bidi iterator with the main display
30 iterator, by calling iterate_out_of_display_property.
31 (iterate_out_of_display_property): Detect buffer iteration by
32 testing that it->string is a Lisp string.
33 (get_next_display_element): When the current object is exhausted,
34 and there's something on it->stack, call set_iterator_to_next to
35 proceed with what's on the stack, instead of returning zero.
36 (set_iterator_to_next): If called at the end of a Lisp string,
37 proceed to consider_string_end without incrementing string
38 position. Don't increment display vector index past the end of
39 the display vector. (Bug#11417)
40 (pos_visible_p): Don't report a position visible when move_it_to
41 stopped at the last line of window, which happens to be scanned
42 backwards by the bidi iteration. (Bug#11464)
43
44 2012-05-14 Eli Zaretskii <eliz@gnu.org>
45
46 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
47 and right-margin display specs even if the spec is invalid or we
48 are on a TTY, and thus unable to display on the fringes. That's
49 because the text with the property will not be displayed anyway,
50 so we need to signal to the caller that this is a "replacing"
51 display spec. This fixes display when the spec is invalid or we
52 are on a TTY.
53
54 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
55
56 * unexaix.c (make_hdr): Fix typo in prototype.
57 This bug broke the build on AIX. Problem reported by Gilles Pion.
58
59 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
60
61 * keyboard.c (kbd_buffer_get_event): Read special events also in
62 batch mode. (Bug#11415)
63
64 2012-05-12 Glenn Morris <rgm@gnu.org>
65
66 * ns.mk: Update for ns_appbindir no longer having trailing "/".
67
68 2012-05-12 Eli Zaretskii <eliz@gnu.org>
69
70 * lisp.mk (lisp): Add newcomment.elc.
71
72 2012-05-12 Glenn Morris <rgm@gnu.org>
73
74 * Makefile.in (MKDIR_P): New, set by configure.
75 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
76
77 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
78
79 Remove unused function hourglass_started.
80 * dispextern.h (hourglass_started):
81 * w32fns.c (hourglass_started):
82 * xdisp.c (hourglass_started): Remove.
83
84 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
85
86 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
87 Update dependencies.
88
89 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
90
91 * xgselect.c (xg_select): Put maxfds+1 into a var.
92 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
93
94 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
95
96 2012-05-10 Dave Abrahams <dave@boostpro.com>
97
98 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
99 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
100
101 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
102
103 * dbusbind.c (xd_registered_buses): New internal Lisp object.
104 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
105 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
106 Initialize xd_registered_buses.
107
108 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
109
110 Untag more efficiently if USE_LSB_TAG.
111 This is based on a proposal by YAMAMOTO Mitsuharu in
112 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
113 For an admittedly artificial (nth 8000 longlist) benchmark on
114 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
115 Emacs's overall text size by 1%.
116 * lisp.h (XUNTAG): New macro.
117 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
118 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
119 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
120 * eval.c (Fautoload):
121 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
122 * frame.h (XFRAME): Use XUNTAG.
123
124 Port recent dbusbind.c changes to 32-bit --with-wide-int.
125 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
126 Remove unportable assumptions about print widths of types like
127 dbus_uint32_t.
128 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
129 intptr_t when converting between pointer and integer, to avoid GCC
130 warnings about wrong width.
131
132 2012-05-09 Eli Zaretskii <eliz@gnu.org>
133
134 * w32proc.c (new_child): Force Windows to reserve only 64KB of
135 stack for each reader_thread, instead of defaulting to 8MB
136 determined by the linker. This avoids failures in creating
137 subprocesses on Windows 7, see the discussion in this thread:
138 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
139
140 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
141
142 Fix up display of the *Minibuf-0* buffer in the mini window.
143 * keyboard.c (read_char): Don't clear the echo area if there's no
144 message to clear.
145 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
146 contents of *Minibuf-0*) if there's no message displayed in its stead.
147
148 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
149
150 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
151 batch mode.
152
153 2012-05-06 Chong Yidong <cyd@gnu.org>
154
155 * lisp.mk (lisp): Update.
156
157 2012-05-05 Jim Meyering <meyering@redhat.com>
158
159 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
160
161 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
162
163 * data.c (PUT_ERROR): New macro.
164 (syms_of_data): Use it. Add new error type `user-error'.
165 * undo.c (user_error): New function.
166 (Fprimitive_undo): Use it.
167 * print.c (print_error_message): Adjust print style for `user-error'.
168 * keyboard.c (user_error): New function.
169 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
170
171 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
172
173 Do not limit current-time-string to years 1000..9999.
174 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
175 (Fcurrent_time_string): Support any year that is supported by the
176 underlying localtime representation. Don't use asctime, as it
177 has undefined behavior for years outside the range -999..9999.
178
179 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
180
181 Fix race conditions involving setenv, gmtime, localtime, asctime.
182 Without this fix, interrupts could mess up code that uses these
183 nonreentrant functions, since setting TZ invalidates existing
184 tm_zone or tzname values, and since most of these functions return
185 pointers to static storage.
186 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
187 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
188 Grow the critical sections to include not just invoking
189 localtime/gmtime, but also accessing these functions' results
190 including their tm_zone values if any, and any related TZ setting.
191 (format_time_string): Last arg is now struct tm *, not struct tm **,
192 so that the struct tm is saved in the critical section.
193 All callers changed. Simplify allocation of initial buffer, partly
194 motivated by the fact that memory allocation needs to be outside
195 the critical section.
196
197 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
198
199 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
200 with RESET_INTERVAL.
201
202 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
203 Remove duplicated buffer name initialization.
204
205 2012-05-02 Jim Meyering <jim@meyering.net>
206
207 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
208
209 * xfns.c (x_window): Use xstrdup (Bug#11375).
210
211 2012-05-02 Eli Zaretskii <eliz@gnu.org>
212
213 * xdisp.c (pos_visible_p): If already at a newline from the
214 display string before the 'while' loop, don't walk back the glyphs
215 from it3.glyph_row. Solves assertion violation when the display
216 string begins with a newline (egg.el). (Bug#11367)
217
218 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
219
220 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
221 Move to simple.el.
222
223 2012-05-01 Glenn Morris <rgm@gnu.org>
224
225 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
226 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
227 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
228 All were removed before 23.1.
229
230 * dispnew.c: Remove HAVE_LIBNCURSES test;
231 it is always true on relevant platforms.
232
233 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
234 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
235
236 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
237
238 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
239
240 * .gdbinit (xpr): Remove checks for no longer existing misc types.
241 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
242 Remove.
243
244 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
245
246 Do not avoid creating empty evaporating overlays (Bug#9642).
247 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
248 That is, do not delete an evaporating overlay if it becomes
249 empty after its bounds are adjusted to fit within its buffer.
250 This fix caused other problems, and I'm reverting it until we get
251 to the bottom of them.
252
253 2012-04-27 Chong Yidong <cyd@gnu.org>
254
255 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
256
257 2012-04-27 Eli Zaretskii <eliz@gnu.org>
258
259 * xdisp.c (pos_visible_p): If the window start position is beyond
260 ZV, start the display from buffer beginning. Prevents assertion
261 violation in init_iterator when the minibuffer window is scrolled
262 via the scroll bar.
263
264 * window.c (window_scroll_pixel_based): Likewise.
265
266 2012-04-27 Chong Yidong <cyd@gnu.org>
267
268 * keymap.c (where_is_internal): Doc fix (Bug#10872).
269
270 2012-04-27 Glenn Morris <rgm@gnu.org>
271
272 * fileio.c (Fcopy_file, Fset_file_selinux_context):
273 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
274
275 2012-04-27 Eli Zaretskii <eliz@gnu.org>
276
277 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
278 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
279
280 2012-04-26 Eli Zaretskii <eliz@gnu.org>
281
282 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
283 display element, check also the underlying string or buffer
284 character. (Bug#11341)
285
286 * w32menu.c: Include w32heap.h.
287 (add_menu_item): If the call to AppendMenuW (via
288 unicode_append_menu) fails, disable Unicode menus only if we are
289 running on Windows 9X/Me.
290
291 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
292
293 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
294 (xgetint): Add missing shift for LSB tags.
295
296 2012-04-24 Martin Rudalics <rudalics@gmx.at>
297
298 * keyboard.c (read_char): Don't wipe echo area for select window
299 events: These might get delayed via `mouse-autoselect-window'
300 (Bug#11304).
301
302 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
303
304 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
305 manipulation of :loaded-from data.
306
307 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
308
309 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
310 now a cons (bug#11311).
311
312 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
313
314 Do not create empty overlays with the evaporate property (Bug#9642).
315 * buffer.c (Fmove_overlay): Delete an evaporating overlay
316 if it becomes empty after its bounds are adjusted to fit within
317 its buffer. Without this fix, in a nonempty buffer (let ((o
318 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
319 yields an empty overlay that has the evaporate property, which is
320 not supposed to happen.
321
322 Fix minor GTK3 problems found by static checking.
323 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
324 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
325 (struct _EmacsFixedClass, emacs_fixed_get_type):
326 Move decls here from emacsgtkfixed.h, since they needn't be public.
327 (emacs_fixed_get_type): Now static.
328 (emacs_fixed_class_init): Omit unused local.
329 (emacs_fixed_child_type): Remove; unused.
330 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
331 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
332 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
333 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
334 (EMACS_FIXED_GET_CLASS): Remove; unused.
335 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
336
337 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
338 Problem reported by Juanma Barranquero for Windows -Wunused-function.
339
340 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
341
342 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
343 * gmalloc.c: (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
344 (__malloc_size_t, __malloc_ptrdiff_t):
345 Remove. All uses removed, replaced by the definiens if needed,
346 since we can assume C89 or better now.
347 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
348 (protect_malloc_state, align, get_contiguous_space)
349 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
350 (malloc_atfork_handler_child, malloc_enable_thread)
351 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
352 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
353 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
354 (special_realloc, _realloc_internal_nolock, _realloc_internal)
355 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
356 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
357 Define using prototypes, not old style.
358 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
359 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
360 (align): Don't assume that signed integer overflow wraps around.
361 Omit unused local var.
362 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
363 (_free_internal_nolock, memalign, mallochook, reallochook):
364 Omit no-longer-needed casts.
365 (valloc): Use getpagesize, not __getpagesize.
366 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
367 (struct hdr): The 'magic' member is now size_t, not unsigned long.
368
369 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
370
371 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
372
373 Move functions from C to Lisp. Make non-blocking method calls
374 the default. Implement further D-Bus standard interfaces.
375
376 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
377 (QCdbus_request_name_allow_replacement)
378 (QCdbus_request_name_replace_existing)
379 (QCdbus_request_name_do_not_queue)
380 (QCdbus_request_name_reply_primary_owner)
381 (QCdbus_request_name_reply_in_queue)
382 (QCdbus_request_name_reply_exists)
383 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
384 (QCdbus_registered_serial, QCdbus_registered_method)
385 (QCdbus_registered_signal): New Lisp objects.
386 (XD_DEBUG_MESSAGE): Use sizeof.
387 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
388 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
389 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
390 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
391 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
392 (xd_signature, xd_append_arg): Allow float for integer types.
393 (xd_get_connection_references): New function.
394 (xd_get_connection_address): Rename from xd_initialize.
395 Return cached address.
396 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
397 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
398 level.
399 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
400 Return number of refcounts.
401 (Fdbus_get_unique_name): Make stronger parameter check.
402 (Fdbus_message_internal): New defun.
403 (Fdbus_call_method, Fdbus_call_method_asynchronously)
404 (Fdbus_method_return_internal, Fdbus_method_error_internal)
405 (Fdbus_send_signal, Fdbus_register_service)
406 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
407 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
408 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
409 (Vdbus_compiled_version, Vdbus_runtime_version)
410 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
411 (Vdbus_message_type_method_return, Vdbus_message_type_error)
412 (Vdbus_message_type_signal): New defvars.
413 (Vdbus_registered_buses, Vdbus_registered_objects_table):
414 Adapt docstring.
415
416 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
417
418 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
419 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
420 Do not assume ptrdiff_t is the same width as 'int'.
421
422 * alloc.c: Handle unusual debugging option combinations.
423 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
424 since the two debugging options are incompatible.
425 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
426 is defined.
427 (mem_init, mem_insert, mem_insert_fixup):
428 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
429 (NEED_MEM_INSERT): Remove; no longer needed.
430
431 2012-04-22 Leo Liu <sdl.web@gmail.com>
432
433 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
434
435 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
436
437 * sysdep.c [__FreeBSD__]: Minor cleanups.
438 (list_system_processes, system_process_attributes) [__FreeBSD__]:
439 Use Emacs indenting style more consistently. Avoid some casts.
440 Use 'double' consistently rather than mixing 'float' and 'double'.
441
442 2012-04-21 Eduard Wiebe <usenet@pusto.de>
443
444 * sysdep.c (list_system_processes, system_process_attributes):
445 Add implementation for FreeBSD (Bug#5243).
446
447 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
448
449 * lisp.mk (lisp): Update.
450
451 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
452
453 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
454 It is never used otherwise.
455
456 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
457
458 * print.c (print_preprocess): Only check print_depth if print-circle
459 is nil.
460 (print_object): Check for cycles even when print-circle is nil and
461 print-gensym is t, but only check print_depth if print-circle is nil.
462
463 2012-04-20 Chong Yidong <cyd@gnu.org>
464
465 * process.c (wait_reading_process_output): If EIO occurs on a pty,
466 set the status to "failed" and ensure that sentinel is run.
467
468 2012-04-20 Glenn Morris <rgm@gnu.org>
469
470 * process.c (Fset_process_inherit_coding_system_flag)
471 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
472 (Fmake_network_process, Fmake_serial_process): Doc fix.
473
474 2012-04-20 Eli Zaretskii <eliz@gnu.org>
475
476 * xdisp.c (string_buffer_position_lim): Limit starting position to
477 BEGV.
478 (set_cursor_from_row): If called for a mode-line or header-line
479 row, return zero immediately.
480 (try_cursor_movement): If inside continuation line, don't back up
481 farther than the first row after the header line, if any.
482 Don't consider the header-line row as "partially visible", even if
483 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
484
485 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
486
487 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
488 (bug#11238).
489
490 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
491 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
492
493 configure: new option --enable-gcc-warnings (Bug#11207)
494 * Makefile.in (C_WARNINGS_SWITCH): Remove.
495 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
496 (ALL_CFLAGS): Use new macros rather than old.
497 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
498 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
499 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
500 -Wunused-result, -Wunused-variable. This should go away once
501 the Emacs and Gnulib regex code is merged.
502 (xmalloc, xrealloc): Now static.
503
504 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
505
506 * dired.c (Fsystem_groups): Remove unused local.
507
508 2012-04-17 Glenn Morris <rgm@gnu.org>
509
510 * dired.c (Fsystem_users): Doc fix.
511
512 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
513
514 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
515 (syms_of_dired): Add them.
516
517 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
518
519 Fix minor alloc.c problems found by static checking.
520 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
521 New extern decls, to avoid calling undeclared functions.
522 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
523 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
524 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
525 (NEED_MEM_INSERT): New macro.
526 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
527 Remove one incorrect comment and fix another.
528
529 Fix minor ralloc.c problems found by static checking.
530 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
531 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
532 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
533 (r_alloc_sbrk): Now static.
534
535 Improve ralloc.c interface checking.
536 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
537 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
538 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
539 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
540 [REL_ALLOC]: ... to here, to check interface.
541 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
542 Remove decls. This fixes an "It stinks!".
543
544 * alloc.c (which_symbols): Fix alignment issue / type clash.
545
546 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
547
548 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
549 (struct Lisp_Misc_Any): Likewise.
550 (struct Lisp_Free): Likewise.
551 * alloc.c (union aligned_Lisp_Symbol): Define.
552 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
553 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
554 (union aligned_Lisp_Misc): Define.
555 (MARKER_BLOCK_SIZE, struct marker_block): Use union
556 aligned_Lisp_Misc instead of union Lisp_Misc.
557 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
558
559 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
560
561 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
562 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
563 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
564 * s/netbsd.h, s/sol2-6.h:
565 Remove definition of GC_MARK_STACK, since the default now works.
566 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
567 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
568 no longer the default.
569 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
570
571 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
572
573 * lread.c (lisp_file_lexically_bound_p):
574 Fix hang at ";-*-\n" (bug#11238).
575
576 2012-04-14 Eli Zaretskii <eliz@gnu.org>
577
578 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
579 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
580
581 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
582
583 * nsterm.m (constrainFrameRect): Always constrain when there is only
584 one screen (Bug#10962).
585
586 2012-04-13 Ken Brown <kbrown@cornell.edu>
587
588 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
589
590 2012-04-13 Reuben Thomas <rrt@sc3d.org>
591
592 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
593
594 2012-04-11 Daniel Colascione <dancol@dancol.org>
595
596 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
597 against is gone. It's better to use vfork now so that when Cygwin
598 gains a new, working vfork, we use it automatically (bug#10398).
599
600 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
601
602 * window.c (save_window_save): Obey window-point-insertion-type.
603
604 2012-04-11 Glenn Morris <rgm@gnu.org>
605
606 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
607
608 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
609
610 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
611
612 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
613
614 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
615 (force_quit_count): New var.
616 (handle_interrupt): Use it.
617
618 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
619
620 * w32.c (w32_delayed_load): Record the full path of the library
621 being loaded (bug#10424).
622
623 2012-04-09 Glenn Morris <rgm@gnu.org>
624
625 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
626 not just in the obarray, before snarfing them. (Bug#11036)
627
628 * Makefile.in ($(leimdir)/leim-list.el):
629 Pass EMACS rather than BUILT_EMACS.
630
631 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
632
633 * process.c (make_process):
634 * process.h: Add integer `gnutls_handshakes_tried' member to
635 process struct.
636
637 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
638 Add convenience `GNUTLS_LOG2i' macro.
639
640 * gnutls.c (gnutls_log_function2i): Convenience log function.
641 (emacs_gnutls_read): Use new log functions,
642 `gnutls_handshakes_tried' process member, and
643 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
644 attempts per process (connection).
645
646 2012-04-09 Chong Yidong <cyd@gnu.org>
647
648 * eval.c (Fuser_variable_p, user_variable_p_eh)
649 (lisp_indirect_variable): Functions deleted.
650 (Fdefvar): Caller changed.
651
652 * callint.c (Finteractive, Fcall_interactively):
653 * minibuf.c (Fread_variable): Callers changed.
654
655 2012-04-09 Eli Zaretskii <eliz@gnu.org>
656
657 * xdisp.c (set_cursor_from_row): If the display string appears in
658 the buffer at position that is closer to point than the position
659 after the display string, display the cursor on the first glyph of
660 the display string. Fixes cursor display when a 'display' text
661 property immediately follows invisible text. (Bug#11094)
662
663 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
664
665 composite.c: use 'double' consistently
666 * composite.c (get_composition_id): Use 'double' consistently
667 instead of converting 'float' to 'double' and vice versa; this is
668 easier to understand and avoids a GCC warning.
669
670 2012-04-09 Glenn Morris <rgm@gnu.org>
671
672 * Makefile.in: Generate leim-list with bootstrap-emacs, in
673 preparation for dumping it with emacs. (Bug#4789)
674 (leimdir): New variable.
675 ($(leimdir)/leim-list.el): New rule.
676 (emacs$(EXEEXT)): Depend on leim-list.el.
677
678 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
679 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
680 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
681
682 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
683
684 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
685 proper alignment.
686
687 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
688
689 * xml.c (init_libxml2_functions) [WINDOWSNT]:
690 Remove unused local variable.
691
692 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
693
694 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
695 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
696 (mark_memory): Mark Lisp_Objects only if pointers might hide in
697 objects, as mark_maybe_pointer will catch them otherwise.
698 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
699 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
700
701 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
702
703 Fix typo that broke non-Windows builds.
704 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
705
706 2012-04-07 Eli Zaretskii <eliz@gnu.org>
707
708 Support building on MS-Windows with libxml2.
709
710 * makefile.w32-in (OBJ2): Add xml.$(O).
711 (GLOBAL_SOURCES): Add xml.c.
712 ($(BLD)/xml.$(O)): New dependency list.
713
714 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
715 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
716 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
717 [!WINDOWSNT]: New macros.
718 (init_libxml2_functions, libxml2_loaded_p): New functions.
719 (parse_region): Call fn_xmlCheckVersion instead of using the macro
720 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
721 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
722 Calls xmlCleanupParser only if libxml2 was loaded (or statically
723 linked in).
724 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
725 Call init_libxml2_functions before calling libxml2 functions.
726 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
727
728 * emacs.c: Don't include libxml/parser.h.
729 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
730 xmlCleanupParser directly.
731
732 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
733
734 2012-04-07 Eli Zaretskii <eliz@gnu.org>
735
736 * indent.c (Fvertical_motion): If there is a display string at
737 point, use it.vpos to compute how many lines to backtrack after
738 move_it_to point. (Bug#11133)
739
740 2012-04-06 Eli Zaretskii <eliz@gnu.org>
741
742 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
743 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
744 about subtle differences between FETCH_CHAR* and STRING_CHAR*
745 macros related to unification of CJK characters. For the details,
746 see the discussion following the message here:
747 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
748
749 2012-04-04 Chong Yidong <cyd@gnu.org>
750
751 * keyboard.c (Vdelayed_warnings_list): Doc fix.
752
753 2012-04-01 Eli Zaretskii <eliz@gnu.org>
754
755 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
756 instead of alloca. (Bug#11138)
757
758 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
759
760 * w32menu.c (is_simple_dialog): Properly check lisp types.
761 (Bug#11141)
762
763 2012-03-31 Eli Zaretskii <eliz@gnu.org>
764
765 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
766 position we get to after a call to move_it_to fails the
767 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
768 only if we wind up in a string from display property. (Bug#11063)
769
770 * window.c (Fdelete_other_windows_internal): Invalidate the row
771 and column information about mouse highlight, so that redisplay
772 restores it after reallocating the glyph matrices. (Bug#7464)
773
774 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
775 string comes from a `display' text property, use the buffer
776 position of that property as if we actually saw that position in
777 the row's glyphs.
778 (move_it_by_lines): Remove the assertion that
779 "it->current_x == 0 && it->hpos == 0" which can be legitimately
780 violated when there's a before-string at the beginning of a line.
781 (Bug#11063)
782
783 2012-03-30 Eli Zaretskii <eliz@gnu.org>
784
785 * xdisp.c (append_space_for_newline): If the default face was
786 remapped, use the remapped face for the appended newline.
787 (extend_face_to_end_of_line): Use the remapped default face for
788 extending the face to the end of the line.
789 (display_line): Call extend_face_to_end_of_line when the default
790 face was remapped. (Bug#11068)
791
792 2012-03-29 Eli Zaretskii <eliz@gnu.org>
793
794 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
795
796 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
797
798 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
799
800 2012-03-27 Glenn Morris <rgm@gnu.org>
801
802 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
803 Doc fixes.
804
805 2012-03-26 Kenichi Handa <handa@m17n.org>
806
807 * dispextern.h (struct glyph): Fix previous change. Change the
808 bit length of glyphless.ch to 25 (Bug#11082).
809
810 2012-03-26 Chong Yidong <cyd@gnu.org>
811
812 * keyboard.c (Vselection_inhibit_update_commands): New variable.
813 (command_loop_1): Use it; inhibit selection update for
814 handle-select-window too (Bug#8996).
815
816 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
817
818 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
819
820 2012-03-25 Kenichi Handa <handa@m17n.org>
821
822 * dispextern.h (struct glyph): Change the bit length of
823 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
824
825 2012-03-24 Eli Zaretskii <eliz@gnu.org>
826
827 * s/ms-w32.h (tzname): Include time.h before redirecting to
828 _tzname. Fixes the MSVC build. (Bug#9960)
829
830 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
831
832 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
833 characters.
834
835 * xterm.c (XTread_socket): Only modify handling_signal if
836 !SYNC_INPUT. (Bug#11080)
837
838 2012-03-23 Eli Zaretskii <eliz@gnu.org>
839
840 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
841 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
842 when fetching a multibyte character consumes more bytes than
843 CHAR_BYTES returns, due to unification of CJK characters in
844 string_char. (Bug#11073)
845
846 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
847
848 * process.c (wait_reading_process_output): Handle pty disconnect
849 by refraining from sending oneself a SIGCHLD (bug#10933).
850
851 2012-03-22 Chong Yidong <cyd@gnu.org>
852
853 * dispextern.h (struct it): New member string_from_prefix_prop_p.
854
855 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
856 Mark string as coming from a prefix property.
857 (handle_face_prop): Use default face for prefix strings (Bug#4281).
858 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
859
860 2012-03-21 Chong Yidong <cyd@gnu.org>
861
862 * xfaces.c (Vface_remapping_alist): Doc fix.
863
864 2012-03-20 Eli Zaretskii <eliz@gnu.org>
865
866 * w32proc.c (Fw32_set_console_codepage)
867 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
868 Doc fixes.
869
870 2012-03-20 Chong Yidong <cyd@gnu.org>
871
872 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
873 to reflect default non-nil value of redisplay-dont-pause.
874
875 2012-03-19 Kenichi Handa <handa@m17n.org>
876
877 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
878 it fit in a valid range (Bug#11003).
879
880 2012-03-18 Eli Zaretskii <eliz@gnu.org>
881
882 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
883 that is not from display property, accept the row as a "cursor
884 row" if one of the string's character has a non-nil `cursor'
885 property. Fixes cursor positioning when there are newlines in
886 overlay strings, e.g. in icomplete.el. (Bug#11035)
887
888 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
889
890 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
891
892 2012-03-12 Chong Yidong <cyd@gnu.org>
893
894 * eval.c (inhibit_lisp_code): Rename from
895 inhibit_window_configuration_change_hook; move from window.c.
896
897 * xfns.c (unwind_create_frame_1, Fx_create_frame):
898 * window.c (run_window_configuration_change_hook)
899 (syms_of_window): Callers changed.
900
901 2012-03-11 Chong Yidong <cyd@gnu.org>
902
903 * keymap.c (Fkey_description): Doc fix (Bug#9700).
904
905 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
906
907 2012-03-10 Chong Yidong <cyd@gnu.org>
908
909 * frame.c (other_visible_frames): Don't assume the selected frame
910 is visible (Bug#10955).
911
912 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
913
914 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
915
916 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
917
918 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
919 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
920 zero (Bug#10954).
921
922 2012-03-03 Glenn Morris <rgm@gnu.org>
923
924 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
925
926 2012-03-02 Eli Zaretskii <eliz@gnu.org>
927
928 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
929 position past the first glyph_row that ends at ZV. (Bug#10902)
930 (redisplay_window, next_element_from_string): Fix typos in
931 comments.
932 (redisplay_window): Pass to move_it_vertically the margin in
933 pixels, not in screen lines.
934
935 2012-03-02 Glenn Morris <rgm@gnu.org>
936
937 * buffer.c (buffer-list-update-hook): Doc fix.
938
939 2012-02-29 Eli Zaretskii <eliz@gnu.org>
940
941 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
942 push_it before setting up the iterator for the first overlay
943 string, even if we have an empty string loaded.
944 (next_overlay_string): If there's an empty string on the iterator
945 stack, pop the stack. (Bug#10903)
946
947 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
948
949 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
950 Suggested by Stefan Monnier in
951 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
952 * alloc.c (widen_to_Lisp_Object): New static function.
953 (mark_memory): Also mark Lisp_Objects by fetching pointer words
954 and widening them to Lisp_Objects. This would work even if
955 USE_LSB_TAG is defined and wide integers are used, which might
956 happen in a future version of Emacs.
957
958 2012-02-25 Chong Yidong <cyd@gnu.org>
959
960 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
961 Doc fix.
962
963 * xselect.c (Fx_selection_exists_p): Doc fix.
964 (x_clipboard_manager_save_all): Print an informative message
965 before saving to clipboard manager.
966
967 2012-02-24 Chong Yidong <cyd@gnu.org>
968
969 * keyboard.c (process_special_events): Handle all X selection
970 requests in kbd_buffer, not just the next one (Bug#8869).
971
972 2012-02-23 Chong Yidong <cyd@gnu.org>
973
974 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
975 call when setting menu-bar-lines and tool-bar-lines parameters.
976 (unwind_create_frame_1): New helper function.
977
978 * window.c (inhibit_window_configuration_change_hook): New var.
979 (run_window_configuration_change_hook): Obey it.
980 (syms_of_window): Initialize it.
981
982 2012-02-22 Chong Yidong <cyd@gnu.org>
983
984 * xterm.c (x_draw_image_relief): Add missing type check for
985 Vtool_bar_button_margin (Bug#10743).
986
987 2012-02-21 Chong Yidong <cyd@gnu.org>
988
989 * fileio.c (Vfile_name_handler_alist): Doc fix.
990
991 * buffer.c (Fget_file_buffer): Protect against invalid file
992 handler return value.
993
994 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
995
996 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
997 when computing $valmask.
998
999 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
1000 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
1001 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
1002 It's useless in that case, and it can cause problems on hosts
1003 that allocate halves of EMACS_INT values separately.
1004 Reported by Dan Horák. Diagnosed by Andreas Schwab in
1005 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
1006 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
1007 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
1008 it avoids undefined behavior on hosts where shifting right by more
1009 than the word width has undefined behavior.
1010
1011 2012-02-19 Chong Yidong <cyd@gnu.org>
1012
1013 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
1014 (Funhandled_file_name_directory, Ffile_name_as_directory)
1015 (Fdirectory_file_name, Fexpand_file_name)
1016 (Fsubstitute_in_file_name): Protect against invalid file handler
1017 return values (Bug#10845).
1018
1019 2012-02-18 Eli Zaretskii <eliz@gnu.org>
1020
1021 * .gdbinit (pitx): Fix incorrect references to fields of the
1022 iterator stack.
1023
1024 2012-02-17 Chong Yidong <cyd@gnu.org>
1025
1026 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
1027
1028 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
1029
1030 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
1031 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
1032
1033 2012-02-15 Chong Yidong <cyd@gnu.org>
1034
1035 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
1036 marked as special. Also, starting docstrings with * is obsolete.
1037
1038 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
1039
1040 * gnutls.c (emacs_gnutls_write): Fix last change.
1041
1042 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
1043
1044 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
1045 send_process.
1046
1047 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1048
1049 * keymap.c (Fsingle_key_description): Handle char ranges.
1050
1051 2012-02-12 Chong Yidong <cyd@gnu.org>
1052
1053 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
1054 as that creates a dangerous corner case.
1055
1056 * window.c (Fdelete_window_internal): Invalidate the mouse
1057 highlight (Bug#9904).
1058
1059 2012-02-12 Glenn Morris <rgm@gnu.org>
1060
1061 * xselect.c (Fx_own_selection_internal)
1062 (Fx_get_selection_internal, Fx_disown_selection_internal)
1063 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
1064 * nsselect.m (Fx_own_selection_internal)
1065 (Fx_disown_selection_internal, Fx_selection_exists_p)
1066 (Fx_selection_owner_p, Fx_get_selection_internal):
1067 Sync docs and argument specs with the xselect.c versions.
1068
1069 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
1070
1071 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
1072
1073 2012-02-11 Eli Zaretskii <eliz@gnu.org>
1074
1075 * w32select.c (Fx_selection_exists_p): Sync doc string and
1076 argument list with xselect.c. (Bug#10783)
1077
1078 * w16select.c (Fx_selection_exists_p): Sync doc string and
1079 argument list with xselect.c. (Bug#10783)
1080
1081 2012-02-10 Glenn Morris <rgm@gnu.org>
1082
1083 * fns.c (Fsecure_hash): Doc fix.
1084
1085 2012-02-09 Kenichi Handa <handa@m17n.org>
1086
1087 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
1088
1089 2012-02-07 Chong Yidong <cyd@gnu.org>
1090
1091 * buffer.c (Fbuffer_local_variables)
1092 (buffer_lisp_local_variables): Handle unbound vars correctly;
1093 don't let Qunbound leak into Lisp.
1094
1095 2012-02-07 Glenn Morris <rgm@gnu.org>
1096
1097 * image.c (Fimagemagick_types): Doc fix.
1098
1099 * image.c (imagemagick-render-type): Change it from a lisp object
1100 to an integer. Move the doc here from the lisp manual.
1101 Treat all values not equal to 0 the same.
1102
1103 2012-02-06 Chong Yidong <cyd@gnu.org>
1104
1105 * doc.c (store_function_docstring): Avoid applying docstring of
1106 alias to base function (Bug#2603).
1107
1108 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
1109
1110 * .gdbinit (pp1, pv1): Remove redundant defines.
1111 (pr): Use pp.
1112
1113 2012-02-04 Chong Yidong <cyd@gnu.org>
1114
1115 * nsterm.m: Declare a global (Bug#10694).
1116
1117 2012-02-04 Eli Zaretskii <eliz@gnu.org>
1118
1119 * w32.c (get_emacs_configuration_options):
1120 Include --enable-checking, if specified, in the return value.
1121
1122 2012-02-04 Martin Rudalics <rudalics@gmx.at>
1123
1124 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
1125 after rounding frame sizes. (Bug#9723)
1126
1127 2012-02-04 Eli Zaretskii <eliz@gnu.org>
1128
1129 * keyboard.c (adjust_point_for_property): Don't position point
1130 before BEGV. (Bug#10696)
1131
1132 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
1133
1134 Handle overflow when computing char display width (Bug#9496).
1135 * character.c (char_width): Return EMACS_INT, not int.
1136 (char_width, c_string_width): Check for overflow when
1137 computing the width; this is possible now that individual
1138 characters can have unbounded width. Problem introduced
1139 by merge from Emacs 23 on 2012-01-19.
1140
1141 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
1142
1143 * dbusbind.c (Fdbus_register_method): Mention the return value
1144 :ignore in the docstring.
1145
1146 2012-02-02 Glenn Morris <rgm@gnu.org>
1147
1148 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
1149
1150 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1151 Unconditionally set to t. (Bug#10673)
1152 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1153 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1154 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
1155
1156 2012-02-02 Kenichi Handa <handa@m17n.org>
1157
1158 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
1159 0, do not call append_composite_glyph.
1160
1161 2012-02-02 Kenichi Handa <handa@m17n.org>
1162
1163 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
1164 NULL (Bug#6988).
1165 (x_produce_glyphs): If the component of a composition is a null
1166 string, set it->pixel_width to 1 to avoid zero-width glyph.
1167
1168 2012-02-01 Eli Zaretskii <eliz@gnu.org>
1169
1170 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
1171 first 2 arguments are identical. This makes inserting large
1172 output from a subprocess an order of magnitude faster on
1173 MS-Windows, where all sbrk'ed memory is always contiguous.
1174
1175 2012-01-31 Glenn Morris <rgm@gnu.org>
1176
1177 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
1178 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
1179 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
1180
1181 2012-01-29 Glenn Morris <rgm@gnu.org>
1182
1183 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
1184
1185 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
1186
1187 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
1188
1189 2012-01-28 Chong Yidong <cyd@gnu.org>
1190
1191 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
1192
1193 2012-01-26 Chong Yidong <cyd@gnu.org>
1194
1195 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
1196
1197 * search.c (Fsearch_forward, Fsearch_backward): Document negative
1198 repeat counts (Bug#10507).
1199
1200 2012-01-26 Glenn Morris <rgm@gnu.org>
1201
1202 * lread.c (syms_of_lread): Doc fix.
1203
1204 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
1205
1206 * coding.c (encode_designation_at_bol): Change return value to
1207 EMACS_INT.
1208
1209 2012-01-25 Chong Yidong <cyd@gnu.org>
1210
1211 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
1212
1213 2012-01-21 Chong Yidong <cyd@gnu.org>
1214
1215 * floatfns.c (Fcopysign): Make the second argument non-optional,
1216 since nil is not allowed anyway.
1217
1218 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
1219
1220 * process.c (read_process_output): Use p instead of XPROCESS (proc).
1221 (send_process): Likewise.
1222
1223 2012-01-19 Martin Rudalics <rudalics@gmx.at>
1224
1225 * window.c (save_window_save, Fcurrent_window_configuration)
1226 (Vwindow_persistent_parameters): Do not use Qstate.
1227 Rewrite doc-strings.
1228
1229 2012-01-19 Kenichi Handa <handa@m17n.org>
1230
1231 * character.c (char_width): New function.
1232 (Fchar_width, c_string_width, lisp_string_width):
1233 Use char_width (Bug#9496).
1234
1235 2012-01-16 Martin Rudalics <rudalics@gmx.at>
1236
1237 * window.c (Vwindow_persistent_parameters): New variable.
1238 (Fset_window_configuration, save_window_save): Handle persistent
1239 window parameters.
1240
1241 2012-01-14 Eli Zaretskii <eliz@gnu.org>
1242
1243 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
1244 thrashing the stack of the thread. (Bug#9087)
1245
1246 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
1247
1248 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
1249
1250 2012-01-11 Eli Zaretskii <eliz@gnu.org>
1251
1252 * xdisp.c (rows_from_pos_range): Handle the case where the
1253 highlight ends on a newline. (Bug#10464)
1254 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
1255 he end column for display of highlight that ends on a newline
1256 before a R2L line.
1257
1258 2012-01-11 Glenn Morris <rgm@gnu.org>
1259
1260 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
1261 from load-path also when installation-directory is nil. (Bug#10208)
1262
1263 2012-01-10 Glenn Morris <rgm@gnu.org>
1264
1265 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
1266
1267 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
1268 Update template values to be closer to their typical values these days.
1269
1270 2012-01-09 Eli Zaretskii <eliz@gnu.org>
1271
1272 * xdisp.c (rows_from_pos_range): Accept additional argument
1273 DISP_STRING, and accept any glyph in a row whose object is that
1274 string as eligible for mouse highlight. Fixes mouse highlight of
1275 display strings from overlays. (Bug#10464)
1276
1277 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
1278
1279 emacs: fix an auto-save permissions race condition (Bug#10400)
1280 * fileio.c (auto_saving_dir_umask): New static var.
1281 (Fmake_directory_internal): Use it.
1282 (do_auto_save_make_dir): Set it, instead of invoking chmod after
1283 creating the directory. The old code temporarily assigns
1284 too-generous permissions to the directory.
1285 (do_auto_save_eh): Clear it.
1286 (Fdo_auto_save): Catch all errors, not just file errors, so
1287 that the var is always cleared.
1288
1289 2012-01-07 Eli Zaretskii <eliz@gnu.org>
1290
1291 * search.c (scan_buffer): Pass character positions to
1292 know_region_cache, not byte positions. (Bug#6540)
1293
1294 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
1295
1296 * w32.c (sys_rename): Report EXDEV when rename of a directory
1297 fails because the target is on another logical disk. (Bug#10284)
1298
1299 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
1300
1301 * xterm.c (x_embed_request_focus): New function.
1302
1303 * xterm.h: Add prototype.
1304
1305 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
1306
1307 2012-01-05 Glenn Morris <rgm@gnu.org>
1308
1309 * emacs.c (emacs_copyright): Update short copyright year to 2012.
1310
1311 2012-01-01 Eli Zaretskii <eliz@gnu.org>
1312
1313 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
1314 Load gnutls_transport_set_lowat only if GnuTLS version is below
1315 2.11.1.
1316 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
1317 GnuTLS versions below 2.11.1.
1318
1319 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
1320
1321 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
1322 to the doc string advising against its use for altering the way
1323 windows are scrolled.
1324
1325 2011-12-28 Kenichi Handa <handa@m17n.org>
1326
1327 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
1328 coding-system ASCII compatible only when it does not produce BOM
1329 on encoding (Bug#10383).
1330
1331 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
1332
1333 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
1334 can scroll.
1335 (create_and_show_popup_menu): Always use menu_position_func for
1336 Gtk3 (Bug#10361).
1337
1338 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
1339
1340 * callint.c (Fcall_interactively): Don't truncate prompt string.
1341
1342 2011-12-23 Eli Zaretskii <eliz@gnu.org>
1343
1344 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
1345 property that ends at ZV, so that the bidi iteration could be
1346 resumed from there (after widening). (Bug#10360)
1347
1348 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
1349
1350 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
1351
1352 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
1353
1354 * nsterm.m (x_free_frame_resources):
1355 Release f->output_data.ns->miniimage.
1356 (ns_index_color): Fix indentation. Do not retain
1357 color_table->colors[i].
1358
1359 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
1360 before returning.
1361
1362 * nsfns.m (x_set_background_color): Assign return value from
1363 ns_index_color to face-background instead of NSColor*.
1364 (ns_implicitly_set_icon_type): Fix indentation.
1365 Change assignment in for loop to comparison.
1366
1367 * emacs.c (ns_pool): New variable.
1368 (main): Assign ns_pool.
1369 (Fkill_emacs): Call ns_release_autorelease_pool.
1370
1371 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
1372 autorelease fdesc, release fdAttrs and tdict.
1373 (ns_get_covering_families): Release charset.
1374 (ns_findfonts): Release NSFontDescriptor created with new.
1375 (ns_uni_to_glyphs): Fix indentation.
1376 (setString): Release attrStr before assigning new value.
1377
1378 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1379
1380 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
1381 and NS_IMPL_COCOA.
1382 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
1383 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
1384
1385 2011-12-18 David Reitter <reitter@cmu.edu>
1386
1387 * nsterm.m (ns_term_init): Subscribe for notifications
1388 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
1389 to method trackingNotification in EmacsMenu.
1390
1391 * nsmenu.m (trackingMenu): New variable.
1392 (trackingNotification): New method (from Aquamacs).
1393 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
1394 from Aquamacs (Bug#7030).
1395
1396 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
1397
1398 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
1399 (symbol_to_nsstring): Fix indentation.
1400 (ns_symbol_to_pb): New function.
1401 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
1402 (Fns_rotate_cut_buffers_internal): Remove.
1403 (Fns_store_selection_internal): Rename from
1404 Fns_store_cut_buffer_internal.
1405 (ns_get_foreign_selection, Fx_own_selection_internal)
1406 (Fx_disown_selection_internal, Fx_selection_exists_p)
1407 (Fns_get_selection_internal, Fns_store_selection_internal):
1408 Use ns_symbol_to_pb and check if return value is nil.
1409 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
1410 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
1411 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
1412 renamed to Sns_store_selection_internal.
1413 (ns_handle_selection_request): Move code to Fx_own_selection_internal
1414 and remove this function.
1415 (ns_handle_selection_clear): Remove, never used.
1416 (Fx_own_selection_internal): Move code from ns_handle_selection_request
1417 here.
1418
1419 2011-12-17 Ken Brown <kbrown@cornell.edu>
1420
1421 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
1422 GID is unknown (Bug#10257).
1423
1424 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
1425
1426 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
1427 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
1428 which caused a build failure on GNU/Linux IA-64. This problem was
1429 introduced by my 2011-10-07 patch.
1430
1431 2011-12-15 Juri Linkov <juri@jurta.org>
1432
1433 * image.c (imagemagick_error): New function. (Bug#10112)
1434 (imagemagick_load_image): Comment out `MagickSetResolution' call.
1435 Use `imagemagick_error' where ImageMagick functions return
1436 `MagickFalse'.
1437 (Fimagemagick_types): Add `Fnreverse' to return the list in the
1438 proper order.
1439
1440 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1441
1442 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
1443 fill background (Bug#8992).
1444
1445 2011-12-13 Martin Rudalics <rudalics@gmx.at>
1446
1447 * window.c (Vwindow_combination_resize)
1448 (Vwindow_combination_limit): Use t instead of non-nil in
1449 doc-strings.
1450 (Vrecenter_redisplay): Add first sentence of doc-string on
1451 separate line.
1452 (Frecenter): Fix doc-string typo.
1453
1454 2011-12-11 Kenichi Handa <handa@m17n.org>
1455
1456 * coding.c (Funencodable_char_position): Pay attention to the
1457 buffer text relocation (Bug#9389).
1458
1459 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1460
1461 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
1462 gtk_init (Bug#10100).
1463
1464 2011-12-10 Eli Zaretskii <eliz@gnu.org>
1465
1466 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
1467 IT->string is nil. (Bug#10263)
1468
1469 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
1470
1471 * nsterm.h (x_free_frame_resources): Declare.
1472
1473 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
1474 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
1475
1476 * nsterm.h (ns_get_defaults_value): Declare.
1477
1478 * nsterm.m (ns_default): Call ns_get_defaults_value.
1479
1480 2011-12-09 Eli Zaretskii <eliz@gnu.org>
1481
1482 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
1483 (Bug#10170)
1484
1485 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1486
1487 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
1488 that where the value of an _OBJC_* symbol points to is in the .bss
1489 section (Bug#10240).
1490
1491 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1492
1493 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
1494 after the loop to call ccl_driver at least once (Bug#8619).
1495
1496 2011-12-08 Kenichi Handa <handa@m17n.org>
1497
1498 * ftfont.c (get_adstyle_property): Fix previous change
1499 (Bug#10233).
1500
1501 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
1502
1503 * w32.c (init_environment): If no_site_lisp, remove site-lisp
1504 dirs from the default value of EMACSLOADPATH (bug#10208).
1505
1506 2011-12-07 Glenn Morris <rgm@gnu.org>
1507
1508 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
1509 installation and source directories as well. (Bug#10208)
1510
1511 2011-12-06 Chong Yidong <cyd@gnu.org>
1512
1513 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
1514
1515 2011-12-06 Glenn Morris <rgm@gnu.org>
1516
1517 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
1518 as an error, not just -1. (Bug#10217)
1519
1520 2011-12-05 Chong Yidong <cyd@gnu.org>
1521
1522 * keyboard.c (process_special_events): New function.
1523 (swallow_events, Finput_pending_p): Use it (Bug#10195).
1524
1525 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
1526
1527 * coding.c (encode_designation_at_bol): Don't use uninitialized
1528 local variable (Bug#9318).
1529
1530 2011-12-05 Kenichi Handa <handa@m17n.org>
1531
1532 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
1533 return Qnil (Bug#8046, Bug#10193).
1534
1535 2011-12-05 Kenichi Handa <handa@m17n.org>
1536
1537 * coding.c (encode_designation_at_bol): New args charbuf_end and
1538 dst. Return the number of produced bytes. Callers changed.
1539 (coding_set_source): Return how many bytes coding->source was
1540 relocated.
1541 (coding_set_destination): Return how many bytes
1542 coding->destination was relocated.
1543 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
1544 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
1545
1546 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
1547
1548 * coding.c (CODING_CHAR_CHARSET_P): New macro.
1549 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
1550 macro (Bug#9318).
1551
1552 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
1553
1554 The following changes are to fix Bug#9318.
1555
1556 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
1557 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
1558 (encode_coding_iso_2022, encode_coding_sjis)
1559 (encode_coding_big5, encode_coding_charset): Use the above macros.
1560
1561 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
1562
1563 * lisp.h (process_quit_flag): Fix external declaration.
1564
1565 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
1566
1567 Don't macro-inline non-performance-critical code.
1568 * eval.c (process_quit_flag): New function.
1569 * lisp.h (QUIT): Use it.
1570
1571 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
1572
1573 * nsfns.m (get_geometry_from_preferences): New function.
1574 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
1575
1576 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
1577
1578 * emacs.c (Qkill_emacs): Define.
1579 (syms_of_emacs): Initialize it.
1580 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
1581 Qquit_flag to `kill-emacs' instead.
1582 (quit_throw_to_read_char): Add parameter `from_signal'.
1583 All callers changed. Call Fkill_emacs if requested and safe.
1584 * lisp.h (QUIT): Call Fkill_emacs if requested.
1585
1586 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
1587
1588 * widget.c (update_wm_hints): Return if wmshell is null.
1589 (widget_update_wm_size_hints): New function.
1590
1591 * widget.h (widget_update_wm_size_hints): Declare.
1592
1593 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
1594 widget_update_wm_size_hints (Bug#10104).
1595
1596 2011-12-03 Eli Zaretskii <eliz@gnu.org>
1597
1598 * xdisp.c (handle_invisible_prop): If the invisible text ends just
1599 before a newline, prepare the bidi iterator for consuming the
1600 newline, and keep the current paragraph direction. (Bug#10183)
1601 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
1602
1603 2011-12-02 Juri Linkov <juri@jurta.org>
1604
1605 * search.c (Fword_search_regexp): New Lisp function created from
1606 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
1607 (Fword_search_backward, Fword_search_forward)
1608 (Fword_search_backward_lax, Fword_search_forward_lax):
1609 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
1610 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
1611
1612 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
1613
1614 * fileio.c (Finsert_file_contents): Move after-change-function call
1615 to before the "handled:" label, since all "goto handled" appear in
1616 cases where the *-change-functions have already been properly called
1617 (bug#10117).
1618
1619 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
1620
1621 * keyboard.c (interrupt_signal): Don't call kill-emacs when
1622 waiting for input. (Bug#10169)
1623
1624 2011-11-30 Eli Zaretskii <eliz@gnu.org>
1625
1626 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
1627 verifies glyph row's hash code--we have just reallocated the
1628 glyphs, so their contents can be complete garbage. (Bug#10164)
1629
1630 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
1631
1632 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
1633
1634 2011-11-30 Eli Zaretskii <eliz@gnu.org>
1635
1636 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
1637 attributes are tested _before_ calling verify_row_hash, to protect
1638 against GCC re-ordering of the tests. (Bug#10164)
1639
1640 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
1641
1642 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
1643
1644 * xterm.c (handle_one_xevent): Only set async_visible and friends
1645 if net_wm_state_hidden_seen is non-zero (Bug#10002)
1646 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
1647 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
1648
1649 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
1650
1651 Remove GCPRO-related macros that exist only to avoid shadowing locals.
1652 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
1653 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
1654 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
1655 All uses changed to use GCPRO1 etc.
1656 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
1657 Revert to old implementation (i.e., before 2011-03-11).
1658
1659 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1660
1661 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
1662 of scroll runs so as to avoid assigning disabled bogus rows and
1663 unnecessary graphics copy operations.
1664
1665 2011-11-27 Eli Zaretskii <eliz@gnu.org>
1666
1667 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
1668 (snprintf) [_MSC_VER]: Redirect to _snprintf.
1669 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
1670 (malloc, free, realloc, calloc): Redirect to e_* only when
1671 compiling Emacs.
1672
1673 * lisp.h (GCTYPEBITS): Move before first use.
1674 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
1675 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
1676 this macro definition.
1677
1678 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
1679 _MSC_VER.
1680
1681 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
1682
1683 * gtkutil.c (xg_create_frame_widgets):
1684 Call gtk_window_set_has_resize_grip (FALSE) if that function is
1685 present with Gtk+ 2.0.
1686
1687 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
1688
1689 * fileio.c (Finsert_file_contents): Undo previous change; see
1690 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
1691
1692 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
1693
1694 Rename locals to avoid shadowing.
1695 * fileio.c (Finsert_file_contents):
1696 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
1697 * process.c (wait_reading_process_output):
1698 Rename inner 'proc' to 'p' to avoid shadowing.
1699 Indent for consistency with usual Emacs style.
1700
1701 2011-11-25 Eli Zaretskii <eliz@gnu.org>
1702
1703 * xdisp.c (redisplay_window): If cursor row is not fully visible
1704 after recentering, and scroll-conservatively is set to a large
1705 number, scroll window by a few more lines to make the cursor fully
1706 visible and out of scroll-margin. (Bug#10105)
1707 (start_display): Don't move to the next line if the display should
1708 start at a newline that is part of a display vector or an overlay
1709 string. (Bug#10119)
1710
1711 2011-11-24 Juri Linkov <juri@jurta.org>
1712
1713 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
1714 after the `MagickPingImage' call. (Bug#10112)
1715
1716 2011-11-23 Chong Yidong <cyd@gnu.org>
1717
1718 * window.c (Fcoordinates_in_window_p): Accept only live windows.
1719
1720 2011-11-23 Martin Rudalics <rudalics@gmx.at>
1721
1722 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
1723 making another buffer current. (Bug#10114)
1724
1725 2011-11-23 Glenn Morris <rgm@gnu.org>
1726
1727 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
1728
1729 2011-11-23 Chong Yidong <cyd@gnu.org>
1730
1731 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
1732 using it (Bug#5984).
1733
1734 2011-11-22 Eli Zaretskii <eliz@gnu.org>
1735
1736 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
1737 and header-lines, as they don't have one computed for them.
1738 (Bug#10098)
1739
1740 * .gdbinit (prow): Make displayed values more self-explaining.
1741 Add row's hash code.
1742
1743 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
1744
1745 * process.c (wait_reading_process_output): Fix asynchrounous
1746 GnuTLS socket handling on some versions of the GnuTLS library.
1747 (wait_reading_process_output): Add comment and URL.
1748
1749 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
1750
1751 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
1752
1753 2011-11-21 Chong Yidong <cyd@gnu.org>
1754
1755 * window.c (Fnext_window, Fprevious_window): Doc fix.
1756
1757 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1758
1759 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
1760
1761 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
1762
1763 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
1764
1765 2011-11-20 Martin Rudalics <rudalics@gmx.at>
1766
1767 * window.c (Fset_window_combination_limit): Rename argument
1768 STATUS to LIMIT.
1769 (Vwindow_combination_limit): Remove "status" from doc-string.
1770
1771 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
1772
1773 * m/ibms390.h: Remove.
1774 * m/ibms390x.h: Don't include "ibms390.h".
1775
1776 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
1777
1778 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
1779 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
1780
1781 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
1782
1783 * casetab.c (Fset_case_table):
1784 * charset.c (Fcharset_after): Fix typos.
1785
1786 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
1787
1788 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
1789 Otherwise, valgrind does not work on some platforms.
1790 Problem reported by Andreas Schwab in
1791 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
1792 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
1793 is set, removing the need for VIRT_ADDRESS_VARIES.
1794 (PURE_P): Use a more-efficient implementation that needs just one
1795 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
1796 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
1797 to 4 (xorl, subq, cmpq, setbe).
1798 * alloc.c (pure): Always extern now, since that's the
1799 VIRT_ADDR_VARIES behavior.
1800 (PURE_POINTER_P): Use a single comparison, not two, for
1801 consistency with the new puresize.h.
1802 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
1803 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
1804 Remove VIRT_ADDR_VARIES no longer needed.
1805
1806 2011-11-19 Eli Zaretskii <eliz@gnu.org>
1807
1808 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
1809 (erase_phys_cursor, update_window_cursor, show_mouse_face)
1810 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
1811 behave as if the cursor position were at the window margin.
1812
1813 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
1814 and the cursor position is out of bounds, behave as if the cursor
1815 position were at the window margin. (Bug#10075)
1816
1817 2011-11-18 Chong Yidong <cyd@gnu.org>
1818
1819 * window.c (Fwindow_combination_limit): Make first argument
1820 non-optional, since it is meaningless for live windows like the
1821 selected window.
1822
1823 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
1824
1825 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
1826
1827 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
1828
1829 * intervals.c: Fix grafting over the whole buffer (bug#10071).
1830 (graft_intervals_into_buffer): Simplify.
1831
1832 2011-11-18 Eli Zaretskii <eliz@gnu.org>
1833
1834 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
1835 hash values of the two rows.
1836 (copy_row_except_pointers): Preserve the used[] arrays and the
1837 hash values of the two rows. (Bug#10035)
1838 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
1839
1840 * xdisp.c (row_hash): New function, body extracted from
1841 compute_line_metrics.
1842 (compute_line_metrics): Call row_hash, instead of computing the
1843 hash code inline.
1844
1845 * dispnew.c (verify_row_hash): Call row_hash for computing the
1846 hash code of a row, instead of duplicating code from xdisp.c.
1847
1848 * dispextern.h (row_hash): Add prototype.
1849
1850 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
1851
1852 * frame.c (delete_frame): Don't delete the terminal when the last
1853 X frame is closed if emacs is built with GTK toolkit.
1854
1855 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
1856
1857 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
1858
1859 2011-11-17 Martin Rudalics <rudalics@gmx.at>
1860
1861 * window.c (Vwindow_splits): Rename to
1862 Vwindow_combination_resize. Suggested by Juri Linkov.
1863 (Fsplit_window_internal): Use Vwindow_combination_resize instead
1864 of Vwindow_splits.
1865
1866 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
1867
1868 * nsfns.m (Fns_font_name):
1869 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
1870
1871 2011-11-16 Martin Rudalics <rudalics@gmx.at>
1872
1873 * window.h (window): Rename slot "nest" to "combination_limit".
1874 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
1875 (Fset_window_nest): Rename to Fset_window_combination_limit.
1876 (Vwindow_nest): Rename to Vwindow_combination_limit.
1877 (recombine_windows, make_parent_window, make_window)
1878 (Fsplit_window_internal, saved_window)
1879 (Fset_window_configuration, save_window_save): Rename all
1880 occurrences of window_nest to window_combination_limit.
1881
1882 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
1883
1884 * image.c (imagemagick_load_image): Fix typo.
1885
1886 2011-11-14 Eli Zaretskii <eliz@gnu.org>
1887
1888 * xdisp.c (display_line): Move the call to
1889 highlight_trailing_whitespace before the call to
1890 compute_line_metrics, since the latter needs to see the final
1891 faces of all the glyphs to compute ROW's hash value.
1892 Fixes assertion violations in row_equal_p. (Bug#10035)
1893
1894 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
1895
1896 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
1897 just return (bug#10044).
1898
1899 2011-11-12 Eli Zaretskii <eliz@gnu.org>
1900
1901 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
1902 with user-defined heap size. Bump the default size of the temacs
1903 heap to 27MB, to avoid memory warning when running temacs.
1904 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
1905
1906 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
1907 current_matrix and desired_matrix. (Bug#9990)
1908 (verify_row_hash) [XASSERTS]: New function.
1909 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
1910 that the hash value of glyph rows is correct.
1911
1912 2011-11-12 Martin Rudalics <rudalics@gmx.at>
1913
1914 * window.h (window): Remove splits slot.
1915 * window.c (Fwindow_splits, Fset_window_splits): Remove.
1916 (Fdelete_other_windows_internal, make_parent_window)
1917 (make_window, Fsplit_window_internal, Fdelete_window_internal)
1918 (Fset_window_configuration, save_window_save): Don't deal with
1919 split status of windows.
1920 (saved_window): Remove splits slot.
1921 (Vwindow_splits): Rewrite doc-string.
1922
1923 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
1924
1925 * xfns.c (unwind_create_frame):
1926 * nsfns.m (unwind_create_frame):
1927 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
1928 Vframe_list (Bug#9999).
1929
1930 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
1931
1932 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
1933
1934 2011-11-11 Kenichi Handa <handa@m17n.org>
1935
1936 * callproc.c (Fcall_process): Set the member dst_multibyte of
1937 process_coding.
1938
1939 2011-11-11 Johan Bockgård <bojohan@gnu.org>
1940
1941 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
1942 avoid a crash (bug#9496).
1943
1944 2011-11-09 Chong Yidong <cyd@gnu.org>
1945
1946 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
1947 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
1948
1949 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
1950
1951 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
1952
1953 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
1954
1955 Avoid some portability problems by eschewing 'extern inline' functions.
1956 The trivial performance wins aren't worth the portability hassles; see
1957 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
1958 et seq.
1959 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
1960 (window_box_width, window_box_left, window_box_left_offset)
1961 (window_box_right, window_box_right_offset): Undo previous change,
1962 by removing the "extern"s.
1963 * intervals.c (adjust_intervals_for_insertion)
1964 (adjust_intervals_for_deletion): Undo previous change,
1965 making these static again.
1966 (offset_intervals, temp_set_point_both, temp_set_point)
1967 (copy_intervals_to_string): No longer inline.
1968 * xdisp.c (window_text_bottom_y, window_box_width)
1969 (window_box_height, window_box_left_offset)
1970 (window_box_right_offset, window_box_left, window_box_right)
1971 (window_box): No longer inline.
1972
1973 2011-11-08 Chong Yidong <cyd@gnu.org>
1974
1975 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
1976 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
1977 Signal an error if not a live window.
1978 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
1979 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
1980
1981 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
1982
1983 * lisp.h (syms_of_abbrev): Remove declaration.
1984 Reported by CHENG Gao <chenggao@royau.me>.
1985
1986 2011-11-07 Eli Zaretskii <eliz@gnu.org>
1987
1988 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
1989 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
1990 of temacs in GUI mode.
1991
1992 2011-11-07 Martin Rudalics <rudalics@gmx.at>
1993
1994 * window.h: Declare delete_all_child_windows instead of
1995 delete_all_subwindows.
1996 * window.c (Fwindow_nest, Fset_window_nest)
1997 (Fset_window_new_total, Fset_window_new_normal)
1998 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
1999 (delete_all_subwindows): Rename to delete_all_child_windows.
2000 (Fdelete_other_windows_internal, Fset_window_configuration):
2001 Call delete_all_child_windows instead of delete_all_subwindows.
2002 * frame.c (delete_frame): Call delete_all_child_windows instead
2003 of delete_all_subwindows.
2004
2005 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
2006
2007 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
2008 This is also needed for porting to any host where GC_MARK_STACK is
2009 not GC_MAKE_GCPROS_NOOPS.
2010 (which_symbols): Use it.
2011
2012 2011-11-07 Kenichi Handa <handa@m17n.org>
2013
2014 * coding.c (coding_set_destination): Check coding->src_pos only
2015 when coding->src_object is a buffer (bug#9910).
2016
2017 * process.c (send_process): Set the member src_multibyte of coding
2018 to 0 (bug#9911) when sending a unibyte text.
2019
2020 * callproc.c (Fcall_process): Set the member src_multibyte of
2021 process_coding to 0 (bug#9912).
2022
2023 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2024
2025 * xmenu.c (cleanup_widget_value_tree): New function.
2026 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
2027 calling free_menubar_widget_value_tree directly (Bug#9830).
2028
2029 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
2030
2031 Fix some portability problems with 'inline'.
2032 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
2033 (window_box_width, window_box_left, window_box_left_offset)
2034 (window_box_right, window_box_right_offset): Declare extern.
2035 Otherwise, these inline functions do not conform to C99 and
2036 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
2037 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
2038 * intervals.c (adjust_intervals_for_insertion)
2039 (adjust_intervals_for_deletion): Now extern, because otherwise the
2040 extern inline functions 'offset_intervals' couldn't refer to it.
2041 (static_offset_intervals): Remove.
2042 (offset_intervals): Rewrite using the old contents of
2043 static_offset_intervals. The old version didn't conform to C99
2044 because an extern inline function contained a reference to an
2045 identifier with static linkage.
2046
2047 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
2048
2049 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
2050 GC.
2051
2052 2011-11-06 Eli Zaretskii <eliz@gnu.org>
2053
2054 * xdisp.c (init_iterator, reseat_to_string): Don't set the
2055 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
2056 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
2057 return Qleft_to_right.
2058
2059 2011-11-06 Chong Yidong <cyd@gnu.org>
2060
2061 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
2062 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
2063 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
2064 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
2065 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
2066 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
2067 (Fwindow_vscroll): Doc fix.
2068 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
2069 argument, since it makes no sense to pass a live window and for
2070 consistency with window-child.
2071
2072 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
2073
2074 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
2075 support MSVC.
2076
2077 2011-11-05 Jason Rumney <jasonr@gnu.org>
2078
2079 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
2080 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
2081 fonts (Bug#6029).
2082 (add_font_entity_to_list): Fix logic errors in mixed boolean and
2083 bitwise arithmetic preventing use of unicode-sip and non-truetype
2084 opentype fonts.
2085
2086 2011-11-05 Eli Zaretskii <eliz@gnu.org>
2087
2088 * s/ms-w32.h (fstat, stat, utime): Move redirections to
2089 "emacs"-only part.
2090
2091 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
2092 initialization code to keep similarity to xfns.c after changes
2093 from 2011-11-05.
2094
2095 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
2096
2097 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
2098 (unwind_create_frame): New function (Bug#9943).
2099 (Fx_create_frame): Restructure code to be more similar to the one in
2100 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
2101 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
2102 Move terminal->reference_count++ just before making the frame official
2103 (Bug#9943).
2104
2105 * nsterm.m (x_free_frame_resources): New function.
2106 (x_destroy_window): Move code to x_free_frame_resources.
2107
2108 * xfns.c (unwind_create_frame): Fix comment.
2109 (Fx_create_frame, x_create_tip_frame):
2110 Move terminal->reference_count++ just before making the frame
2111 official. Move initialization of image_cache_refcount and
2112 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
2113
2114 2011-11-05 Eli Zaretskii <eliz@gnu.org>
2115
2116 Support MSVC build with newer versions of Visual Studio.
2117 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
2118 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
2119 nt/gmake.defs.
2120
2121 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
2122 which are not supported by MSVC.
2123 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
2124 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
2125 bitfields.
2126 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
2127 types in bitfields.
2128 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
2129
2130 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
2131
2132 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
2133
2134 Support MSVC build with newer versions of Visual Studio.
2135 * w32.c: Don't include w32api.h for MSVC.
2136 (init_environment) [_MSC_VER]: Call sys_access, not _access.
2137
2138 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
2139 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
2140 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
2141 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
2142 e_* cousins.
2143 (alloca) [_MSC_VER]: Define to _alloca.
2144
2145 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
2146
2147 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
2148
2149 2011-11-04 Eli Zaretskii <eliz@gnu.org>
2150
2151 * xdisp.c (note_mouse_highlight): If either of
2152 previous/next-single-property-change returns nil, treat that as
2153 the beginning or the end of the buffer. (Bug#9955)
2154
2155 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
2156
2157 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
2158 label is not null (Bug#9951).
2159 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
2160 may be NULL.
2161
2162 2011-11-04 Eli Zaretskii <eliz@gnu.org>
2163
2164 * window.c (Fwindow_body_size): Mention in the doc string that the
2165 return value is in frame's canonical units. (Bug#9949)
2166
2167 2011-11-03 Eli Zaretskii <eliz@gnu.org>
2168
2169 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
2170
2171 * w32fns.c (unwind_create_frame): If needed, free the glyph
2172 matrices of the partially constructed frame. (Bug#9943)
2173 * xfns.c (unwind_create_frame): Likewise.
2174
2175 2011-11-01 Eli Zaretskii <eliz@gnu.org>
2176
2177 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
2178 Don't stop backward scan on the continuation glyph, even though
2179 its CHARPOS is positive.
2180 (mouse_face_from_buffer_pos, note_mouse_highlight):
2181 Rename cover_string to disp_string.
2182
2183 2011-11-01 Martin Rudalics <rudalics@gmx.at>
2184
2185 * window.c (temp_output_buffer_show): Don't use
2186 Vtemp_buffer_show_specifiers.
2187 (Vtemp_buffer_show_specifiers): Remove unused variable.
2188
2189 2011-10-30 Eli Zaretskii <eliz@gnu.org>
2190
2191 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
2192 past the beginning of the current glyph matrix.
2193
2194 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2195
2196 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
2197 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
2198 HAVE_GTK3 (Bug#9869).
2199
2200 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
2201 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
2202
2203 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
2204
2205 * xterm.c: Declare x_handle_net_wm_state to return int.
2206 (handle_one_xevent): Check if we are iconified but don't have
2207 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
2208 (get_current_wm_state): Return non-zero if not hidden,
2209 check for _NET_WM_STATE_HIDDEN (Bug#9893).
2210 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
2211 (x_handle_net_wm_state): Return what get_current_wm_state returns.
2212 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
2213
2214 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
2215
2216 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
2217 so that this new function doesn't get optimized away by a
2218 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
2219
2220 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2221
2222 * frame.h (MOUSE_HL_INFO): Remove excess parens.
2223
2224 2011-10-29 Eli Zaretskii <eliz@gnu.org>
2225
2226 Fix the `xbytecode' command.
2227 * .gdbinit (xprintbytestr): New command.
2228 (xwhichsymbols): Rename from `which'; all callers changed.
2229 (xbytecode): Print the byte-code string as well.
2230
2231 2011-10-29 Kim Storm <storm@cua.dk>
2232
2233 * alloc.c (which_symbols): New function.
2234
2235 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
2236
2237 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
2238 line. (Bug#9903)
2239
2240 2011-10-29 Glenn Morris <rgm@gnu.org>
2241
2242 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
2243 Not clear what it was for, and it causes various bugs. (Bug#9839)
2244
2245 2011-10-28 Eli Zaretskii <eliz@gnu.org>
2246
2247 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
2248 possible random value that matches one of those tested as
2249 condition to clear the mouse face.
2250
2251 2011-10-28 Chong Yidong <cyd@gnu.org>
2252
2253 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
2254
2255 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
2256
2257 * window.c (make_window): Initialize phys_cursor_on_p.
2258
2259 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2260
2261 * lisp.h (struct Lisp_Symbol): Update comments.
2262
2263 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
2264
2265 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
2266
2267 2011-10-28 Eli Zaretskii <eliz@gnu.org>
2268
2269 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
2270 <oslsachem@gmail.com> for helping to debug this.
2271
2272 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
2273 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
2274 (g_b_init_get_glyph_outline_w): New static variables.
2275 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
2276 (GetGlyphOutlineW_Proc): New typedefs.
2277 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
2278 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
2279 New functions.
2280 (w32font_open_internal, compute_metrics):
2281 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
2282 instead of calling the "wide" APIs directly.
2283
2284 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
2285
2286 * w32.h (syms_of_w32font): Add prototype.
2287
2288 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
2289
2290 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
2291 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
2292 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
2293 (Fmove_to_window_line): Doc fix.
2294
2295 2011-10-27 Chong Yidong <cyd@gnu.org>
2296
2297 * process.c (make_process): Set gnutls_state to NULL.
2298
2299 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
2300 non-NULL, regardless of GNUTLS_INITSTAGE.
2301 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
2302 an error. Set process slots as soon as we allocate them.
2303
2304 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
2305
2306 2011-10-27 Chong Yidong <cyd@gnu.org>
2307
2308 * gnutls.c (emacs_gnutls_deinit): New function.
2309 Deallocate credentials structures as well as calling gnutls_deinit.
2310 (Fgnutls_deinit, Fgnutls_boot): Use it.
2311
2312 * process.c (make_process): Initialize GnuTLS credentials to NULL.
2313 (deactivate_process): Call emacs_gnutls_deinit.
2314
2315 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
2316
2317 * image.c (x_create_x_image_and_pixmap):
2318 * w32.c (sys_rename, w32_delayed_load):
2319 * w32font.c (fill_in_logfont):
2320 * w32reg.c (x_get_string_resource): Silence compiler warnings.
2321
2322 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
2323
2324 * w32fns.c (w32_default_color_map): New function,
2325 extracted from Fw32_default_color_map.
2326 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
2327
2328 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
2329
2330 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
2331
2332 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
2333
2334 * keyboard.c (test_undefined): New function (bug#9751).
2335 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
2336
2337 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
2338
2339 * sysdep.c (init_sys_modes): Fix the check for the controlling
2340 terminal (Bug#6649).
2341
2342 2011-10-20 Eli Zaretskii <eliz@gnu.org>
2343
2344 * dispextern.h (struct bidi_it): New member next_en_type.
2345
2346 * bidi.c (bidi_line_init): Initialize the next_en_type member.
2347 (bidi_resolve_explicit_1): When next_en_pos is valid for the
2348 current character, check also for next_en_type being WEAK_EN.
2349 (bidi_resolve_weak): Don't enter the expensive loop if the current
2350 position is before next_en_pos. Record the bidi type of the first
2351 non-ET, non-BN character we find, in addition to its position.
2352 (bidi_level_of_next_char): Invalidate next_en_type when
2353 next_en_pos is over-stepped.
2354
2355 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
2356
2357 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
2358 * editfns.c: Rewrite current-time-zone so that it invokes
2359 the equivalent of (format-time-string "%Z") to get the time zone name.
2360 This fixes a bug when the time zone name contains characters that
2361 need converting from the system time locale to Emacs internal format.
2362 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
2363 that patch fixed format-time-string to do the conversion, but
2364 I forgot to fix current-time-zone.
2365 (format_time_string): New function, containing most of
2366 what Fformat_time_string used to contain.
2367 (Fformat_time_string): Rewrite in terms of format_time_string.
2368 This doesn't change this function's behavior.
2369 (current-time-zone): Rewrite to use format_time_string.
2370 This fixes the bug reported by Michael Schierl in
2371 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
2372 Jason Rumney's 2007-06-07 change worked around this bug, but
2373 didn't fix it.
2374 * systime.h (tzname, timezone): Remove no-longer-used declarations.
2375
2376 2011-10-19 Eli Zaretskii <eliz@gnu.org>
2377
2378 * xdisp.c (start_display): If the character at POS is displayed
2379 via a display vector, reset IT->current.dpvec_index to zero.
2380 (try_window_reusing_current_matrix): If a line ends in a display
2381 vector or the next line starts in a display vector, continue
2382 redrawing the window even though the character position of
2383 start_row was reached.
2384 (Bug#9771, part 2)
2385
2386 2011-10-18 Chong Yidong <cyd@gnu.org>
2387
2388 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
2389 with nobreak-char-display too.
2390
2391 2011-10-18 Eli Zaretskii <eliz@gnu.org>
2392
2393 Fix part 3 of bug#9771.
2394 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
2395 (bidi_resolve_neutral): Don't enter the expensive loop looking for
2396 non-neutral characters if the current character is a paragraph
2397 separator (a.k.a. Newline). This avoids running the same
2398 expensive loop twice, once when we consume the preceding newline
2399 and the other time when the line actually needs to be displayed.
2400 Avoid the loop when we see neutrals on the base embedding level
2401 following a character whose directionality is the same as the
2402 paragraph's. This avoids running the expensive loop when a line
2403 ends in a long sequence of neutrals, like control characters.
2404 Add assertion against STRONG_AL type. Slightly rearrange code
2405 that determines the type of a neutral given the first non-neutral
2406 that follows it.
2407 (bidi_level_of_next_char): Set next_en_pos to zero when
2408 invalidating its info.
2409
2410 2011-10-17 Eli Zaretskii <eliz@gnu.org>
2411
2412 * xdisp.c (push_display_prop): Determine whether to record string
2413 or buffer position by IT->string, not by IT->method. Allow
2414 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
2415 (move_it_vertically_backward): Don't look for character position
2416 immediately after the newline when in a continuation line.
2417 (Bug#9771, part 1)
2418
2419 2011-10-15 Martin Rudalics <rudalics@gmx.at>
2420
2421 * window.c (coordinates_in_window): Rewrite and delabelize
2422 vertical border check. (Bug#5357) (Bug#9618)
2423
2424 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
2425
2426 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
2427 errors in XSetWindowBorder (bug#9310).
2428
2429 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
2430
2431 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
2432 avoid crash when xmalloc overrun checking is enabled.
2433
2434 2011-10-13 Eli Zaretskii <eliz@gnu.org>
2435
2436 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
2437 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
2438 cursor motion with <left> and <right> arrow keys.
2439
2440 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
2441 some callers set that themselves.
2442
2443 2011-10-12 Eli Zaretskii <eliz@gnu.org>
2444
2445 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
2446 display string and the previous row comes from the same string and
2447 is empty. (Bug#9739) (Bug#9738)
2448
2449 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
2450
2451 * doc.c (get_doc_string): Encode file name (bug#9735).
2452
2453 2011-10-12 Eli Zaretskii <eliz@gnu.org>
2454
2455 * bidi.c (bidi_level_of_next_char):
2456 * xdisp.c (get_visually_first_element): Remove old incorrect
2457 comments regarding the Unicode Line Separator character.
2458
2459 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
2460
2461 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
2462
2463 * alloc.c (Fgc_status): Do not access beyond zombies array
2464 boundary if nzombies > MAX_ZOMBIES.
2465 * alloc.c (dump_zombies): Add missing format specifier.
2466
2467 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
2468
2469 * xdisp.c (set_cursor_from_row): Simplify conditionals,
2470 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
2471
2472 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
2473 Some packages use them to denote characters with modifiers.
2474
2475 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
2476
2477 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
2478 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
2479 matching a pp-number. Rename parameter var to var1.
2480
2481 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
2482
2483 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
2484
2485 2011-10-08 Glenn Morris <rgm@gnu.org>
2486
2487 * callint.c (Fcall_interactively): Give a more explicit error for the
2488 'c' case with a non-character input. (Bug#8479)
2489
2490 2011-10-08 Eli Zaretskii <eliz@gnu.org>
2491
2492 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
2493 lines.
2494 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
2495 lines that are hscrolled on the left.
2496
2497 * dispnew.c (buffer_posn_from_coords): Account for a possible
2498 presence of header-line. (Bug#4426)
2499
2500 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
2501
2502 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
2503 Don't advertise functionality which we discourage or doesn't work.
2504
2505 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
2506
2507 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
2508 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
2509 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
2510 this makes Emacs dump core during garbage collection on rare
2511 occasions. sizeof is obviously inferior to offsetof here, so
2512 stick with offsetof.
2513 (GC_POINTER_ALIGNMENT): New macro.
2514 (mark_memory): Omit 3rd (offset) arg; caller changed.
2515 Don't assume EMACS_INT alignment is the same as pointer alignment.
2516
2517 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
2518
2519 * keyboard.c (read_key_sequence_remapped): New var.
2520 (read_key_sequence): Compute remapping in the right buffer.
2521 (command_loop_1): Use read_key_sequence's remapping directly.
2522
2523 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
2524
2525 * dired.c (file_name_completion): Don't expand file name.
2526 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
2527 before checking file name handler.
2528
2529 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
2530 they've been requested explicitly (bug#9591).
2531
2532 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
2533
2534 * keymap.c (Fsingle_key_description): Use make_specified_string
2535 instead of build_string to build string from push_key_description.
2536 (Bug#5193)
2537
2538 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2539
2540 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
2541 This fixes a Y2038 bug on 64-bit hosts.
2542 * buffer.c (reset_buffer):
2543 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
2544 (Fclear_buffer_auto_save_failure):
2545 Use 0, not -1, to represent an unset failure time, since time_t
2546 might not be signed.
2547
2548 Remove dependency on glibc malloc internals.
2549 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2550 Move back here from lisp.h, but with their new implementations.
2551 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2552 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
2553 * charset.c (charset_table_init): New static var.
2554 (syms_of_charset): Use it instead of xmalloc. This removes a
2555 dependency on glibc malloc internals. See Eli Zaretskii's comment in
2556 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
2557 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2558 Move back to alloc.c.
2559 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2560 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
2561
2562 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
2563
2564 * nsterm.m (windowDidResize): Call x_set_window_size only when
2565 ns_in_resize is true. Otherwise set pixelwidth/height and
2566 call change_frame_size (Bug#9628).
2567
2568 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
2569
2570 Port --enable-checking=all to Fedora 14 x86-64.
2571 * charset.c (syms_of_charset): Also account for glibc malloc's
2572 internal overhead when calculating the initial malloc maximum.
2573
2574 Port --enable-checking=all to Fedora 14 x86.
2575 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2576 Move to lisp.h.
2577 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
2578 (overrun_check_realloc, overrun_check_free):
2579 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
2580 That way, xmalloc returns a properly-aligned pointer even if
2581 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
2582 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
2583 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
2584 into account when calculating the initial malloc maximum.
2585 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
2586 Move here from alloc.c, so that charset.c can use it too.
2587 Properly align; the old code wasn't right for common 32-bit hosts
2588 when configured with --enable-checking=all.
2589 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
2590 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
2591
2592 2011-09-29 Eli Zaretskii <eliz@gnu.org>
2593
2594 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
2595 use EDOM.
2596
2597 2011-09-28 Eli Zaretskii <eliz@gnu.org>
2598
2599 * xdisp.c (compute_display_string_end): If there's no display
2600 string at CHARPOS, return -1.
2601
2602 * bidi.c (bidi_fetch_char): When compute_display_string_end
2603 returns a negative value, treat the character as a normal
2604 character not covered by a display string. (Bug#9624)
2605
2606 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
2607
2608 * lread.c (Fread_from_string): Fix typo in docstring.
2609
2610 2011-09-27 Eli Zaretskii <eliz@gnu.org>
2611
2612 * xdisp.c (handle_invisible_prop): If invisible text ends on a
2613 newline, reseat the iterator instead of bidi-iterating there one
2614 character at a time. (Bug#9610)
2615 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
2616 TO_CHARPOS if the bidi iterator is at base embedding level.
2617
2618 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
2619
2620 * lread.c (readevalloop): Use correct code for NBSP.
2621 (read1): Likewise. (Bug#9608)
2622
2623 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
2624
2625 * dbusbind.c (Fdbus_register_signal): When service is not
2626 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
2627
2628 2011-09-25 Glenn Morris <rgm@gnu.org>
2629
2630 * buffer.c (truncate-lines): Doc fix.
2631
2632 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
2633
2634 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
2635 (Fset_window_next_buffers): Doc fix.
2636
2637 2011-09-24 Glenn Morris <rgm@gnu.org>
2638
2639 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
2640
2641 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
2642
2643 Fix minor problems found by static checking.
2644 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
2645 * indent.c (Fvertical_motion): Fix == vs = typo.
2646
2647 2011-09-24 Eli Zaretskii <eliz@gnu.org>
2648
2649 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
2650 Default value is now t. Doc fix.
2651
2652 * indent.c (Fvertical_motion): Compute and apply the overshoot
2653 logic when moving up, not only when moving down. Fix the
2654 confusing name and values of the it_overshoot_expected variable;
2655 logic changes accordingly. (Bug#9254) (Bug#9549)
2656
2657 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
2658 CHARPOS is covered by a display string which includes newlines.
2659 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
2660 is covered by a display string with embedded newlines.
2661
2662 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
2663
2664 * dbusbind.c (Fdbus_register_signal): Add match rule to
2665 Vdbus_registered_objects_table. (Bug#9581)
2666 (Fdbus_register_method, Vdbus_registered_objects_table):
2667 Fix docstring.
2668
2669 2011-09-24 Jim Meyering <meyering@redhat.com>
2670
2671 do not ignore write error for any output size
2672 The previous change was incomplete.
2673 While it makes emacs --batch detect the vast majority of stdout
2674 write failures, errors were still ignored whenever the output size is
2675 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
2676 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
2677 && echo FAIL: ignored write error
2678 FAIL: ignored write error
2679 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
2680 && echo FAIL: ignored write error
2681 FAIL: ignored write error
2682 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
2683
2684 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
2685
2686 * emacs.c (Fkill_emacs): In noninteractive mode exit
2687 non-successfully if a write error occurred on stdout. (Bug#9574)
2688
2689 2011-09-21 Eli Zaretskii <eliz@gnu.org>
2690
2691 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
2692 the xassert test.
2693
2694 * dispextern.h (struct it): Update the comment documenting what
2695 can it->OBJECT be.
2696
2697 2011-09-20 Eli Zaretskii <eliz@gnu.org>
2698
2699 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
2700 a display string, extend search for cursor position to end of row.
2701 (find_row_edges): If the row ends in a newline from a display
2702 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
2703 Handle the case of a display string with multiple newlines.
2704 (Fcurrent_bidi_paragraph_direction): Fix search for previous
2705 non-empty line. Fixes confusing cursor motion with arrow keys at
2706 the beginning of a line that starts with whitespace.
2707
2708 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2709
2710 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
2711 (bug#9493).
2712
2713 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
2714
2715 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
2716 boolean (Bug#9154).
2717
2718 2011-09-18 Eli Zaretskii <eliz@gnu.org>
2719
2720 * xdisp.c (display_line): Record maximum and minimum buffer
2721 positions even if no glyphs were produced (e.g., by a zero-width
2722 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
2723 buffer positions that will be removed from the glyph row because
2724 they don't fit.
2725 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
2726 column is beyond frame width: don't subtract 1 "pixel" when
2727 computing width of the stretch.
2728 (reseat_at_next_visible_line_start): Undo the change made on
2729 2011-09-17 that saved paragraph information and restored it after
2730 the call to `reseat'. (Bug#9545)
2731
2732 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2733
2734 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
2735 and turn window cursor on if cleared (Bug#9415).
2736
2737 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
2738
2739 * search.c (boyer_moore): Take unibyte characters from pattern
2740 literally. (Bug#9458)
2741
2742 2011-09-18 Eli Zaretskii <eliz@gnu.org>
2743
2744 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
2745
2746 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
2747
2748 Fix minor problem found by static checking.
2749 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
2750 initialized, to pacify gcc -Wuninitialized.
2751
2752 * fileio.c: Report proper errno when syscall falls.
2753 (Finsert_file_contents): Save and restore errno,
2754 so that report_file_error outputs the correct diagnostic.
2755 (Fwrite_region) [CLASH_DETECTION]: Likewise.
2756
2757 2011-09-18 Eli Zaretskii <eliz@gnu.org>
2758
2759 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
2760
2761 2011-09-17 Eli Zaretskii <eliz@gnu.org>
2762
2763 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
2764 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
2765
2766 2011-09-17 Eli Zaretskii <eliz@gnu.org>
2767
2768 * xdisp.c (reseat_at_next_visible_line_start): Keep information
2769 about the current paragraph and restore it after the call to reseat.
2770
2771 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
2772 (bidi_find_paragraph_start): Search back for paragraph beginning
2773 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
2774 (bidi_move_to_visually_next): Only trigger paragraph-related
2775 computations when the last character is a newline or at EOB, not
2776 just any NEUTRAL_B. (Bug#9470)
2777
2778 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
2779 truncated lines if point is covered by a display string. (Bug#9524)
2780
2781 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
2782
2783 * xselect.c: Relax test for outgoing X longs (Bug#9498).
2784 (cons_to_x_long): New function.
2785 (lisp_data_to_selection_data): Use it. Correct the test for
2786 short-versus-long data; it was negated. Break out of vector
2787 loop, for efficiency, when a long datum is discovered.
2788
2789 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
2790
2791 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
2792
2793 2011-09-16 Eli Zaretskii <eliz@gnu.org>
2794
2795 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
2796 GCC PR/17406) by declaring this function with external scope.
2797
2798 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
2799
2800 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
2801 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
2802
2803 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
2804
2805 * editfns.c (Fformat): Correctly handle text properties on "%%".
2806
2807 2011-09-15 Eli Zaretskii <eliz@gnu.org>
2808
2809 * xterm.c (x_draw_composite_glyph_string_foreground):
2810 * w32term.c (x_draw_composite_glyph_string_foreground):
2811 * term.c (encode_terminal_code):
2812 * composite.c (composition_update_it, get_composition_id):
2813 * xdisp.c (get_next_display_element)
2814 (fill_composite_glyph_string): Add comments about special meaning
2815 of TAB characters in a composition.
2816
2817 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
2818
2819 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
2820 This occurs when processing a multibyte format.
2821 Problem reported by Wolfgang Jenker.
2822
2823 2011-09-15 Johan Bockgård <bojohan@gnu.org>
2824
2825 * xdisp.c (try_cursor_movement): Only check for exact match if
2826 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
2827
2828 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
2829
2830 Remove unused external symbols.
2831 * dispextern.h (calc_pixel_width_or_height): Remove decl.
2832 * xdisp.c (calc_pixel_width_or_height): Now static.
2833 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
2834 * indent.c (check_display_width):
2835 * w32term.c: Fix comment to match code.
2836 * xterm.c, xterm.h (x_catching_errors): Remove.
2837
2838 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
2839
2840 * xselect.c: Use signed conversions more consistently (Bug#9498).
2841 (selection_data_to_lisp_data): Assume incoming selection data are
2842 signed integers, not unsigned. This is to be consistent with
2843 outgoing selection data, which was modified to use signed integers
2844 in as part of the fix to Bug#9196 in response to Jan D.'s comment
2845 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
2846 expects long, not unsigned long.
2847
2848 2011-09-14 Eli Zaretskii <eliz@gnu.org>
2849
2850 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
2851 computation of loop end. Reported by Johan Bockgård
2852 <bojohan@gnu.org>.
2853
2854 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
2855
2856 * frame.c (Fother_visible_frames_p): Function deleted.
2857
2858 2011-09-12 Eli Zaretskii <eliz@gnu.org>
2859
2860 * indent.c (compute_motion): Process display vector front to back
2861 rather than the other way around. (Bug#2496)
2862
2863 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2864
2865 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
2866
2867 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
2868
2869 * minibuf.c (Fread_from_minibuffer): Doc fix.
2870
2871 2011-09-11 Eli Zaretskii <eliz@gnu.org>
2872
2873 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
2874 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
2875
2876 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
2877
2878 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
2879 value for non-existent files.
2880
2881 2011-09-11 Eli Zaretskii <eliz@gnu.org>
2882
2883 * fileio.c (Finsert_file_contents): If the file cannot be opened,
2884 set its "size" to -1. This will set the modtime_size field of
2885 the corresponding buffer to -1, which is what
2886 verify-visited-file-modtime expects for files that do not exist.
2887 (Bug#9139)
2888
2889 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
2890
2891 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
2892 here ...
2893 * lisp.h: ... from here. push_key_description is no longer
2894 defined in keyboard.c, so its declaration should not be in
2895 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
2896 logically belongs with push_key_description.
2897
2898 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
2899
2900 * buffer.h: Include <sys/types.h> instead of <time.h>.
2901 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
2902 Problem reported by Herbert J. Skuhra.
2903
2904 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
2905
2906 * xml.c (parse_region): Make the parsing work for
2907 non-comment-starting XML files again (bug#9144).
2908
2909 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
2910
2911 * image.c (gif_load): Fix calculation of bottom and right corner.
2912 (Bug#9468)
2913
2914 2011-09-10 Eli Zaretskii <eliz@gnu.org>
2915
2916 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
2917 redisplay in small windows.
2918
2919 2011-09-09 Eli Zaretskii <eliz@gnu.org>
2920
2921 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
2922
2923 2011-09-08 Martin Rudalics <rudalics@gmx.at>
2924
2925 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
2926 Operate on live windows only.
2927
2928 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
2929
2930 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
2931
2932 2011-09-07 Eli Zaretskii <eliz@gnu.org>
2933
2934 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
2935 only under bidi iteration.
2936
2937 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
2938
2939 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
2940
2941 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
2942
2943 isnan: Fix porting problem to Solaris 10 with bundled gcc.
2944 Without this fix, the command to link temacs failed due to an
2945 undefined symbol __builtin_isnan. This is because
2946 /usr/include/iso/math_c99.h #defines isnan(x) to
2947 __builtin_isnan(x), but the bundled gcc, which identifies itself
2948 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
2949 a __builtin_isnan.
2950 * floatfns.c (isnan): #undef, and then #define to a clone of
2951 what's in data.c.
2952 (Fisnan): Always define, since it's always available now.
2953 (syms_of_floatfns): Always define isnan at the Lisp level.
2954
2955 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
2956
2957 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
2958
2959 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
2960
2961 * fileio.c: Fix bugs with large file offsets (Bug#9428).
2962 The previous code assumed that file offsets (off_t values) fit in
2963 EMACS_INT variables, which is not true on typical 32-bit hosts.
2964 The code messed up by falsely reporting buffer overflow in cases
2965 such as (insert-file-contents "big" nil 1 2) into an empty buffer
2966 when "big" contains more than 2**29 bytes, even though this
2967 inserts just one byte and does not overflow the buffer.
2968 (Finsert_file_contents): Store file offsets as off_t
2969 values, not as EMACS_INT values. Check for overflow when
2970 converting between EMACS_INT and off_t. When checking for
2971 buffer overflow or for overlap, take the offsets into account.
2972 Don't use EMACS_INT for small values where int suffices.
2973 When checking for overlap, fix a typo: ZV was used where
2974 ZV_BYTE was intended.
2975 (Fwrite_region): Don't assume off_t fits into 'long'.
2976 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
2977
2978 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
2979
2980 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
2981
2982 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
2983
2984 sprintf-related integer and memory overflow issues (Bug#9412).
2985
2986 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
2987 (esprintf, exprintf, evxprintf): New functions.
2988 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
2989 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
2990 (modify_event_symbol): Do not assume that the length of
2991 name_alist_or_stem is safe to alloca and fits in int.
2992 (Fexecute_extended_command): Likewise for function name and binding.
2993 (Frecursion_depth): Wrap around reliably on integer overflow.
2994 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
2995 since some callers pass EMACS_INT values.
2996 (Fsingle_key_description): Don't crash if symbol name contains more
2997 than MAX_ALLOCA bytes.
2998 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
2999 (get_minibuffer): Arg is now EMACS_INT, not int.
3000 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
3001 (esprintf, exprintf, evxprintf): New decls.
3002 * window.h (command_loop_level, minibuf_level): Reflect API changes.
3003
3004 * dbusbind.c (signature_cat): New function.
3005 (xd_signature, Fdbus_register_signal):
3006 Do not overrun buffer; instead, report string overflow.
3007
3008 * dispnew.c (add_window_display_history): Don't overrun buffer.
3009 Truncate instead; this is OK since it's just a log.
3010
3011 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
3012 even if the time zone offset is outlandishly large.
3013 Don't mishandle offset == INT_MIN.
3014
3015 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
3016 when creating daemon; the previous buffer-overflow check was incorrect.
3017
3018 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
3019 which has the guts of the old verror function.
3020
3021 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
3022 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
3023
3024 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
3025 (font_unparse_xlfd): Don't blindly alloca long strings.
3026 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
3027 fits in int, when using sprintf. Use single snprintf to count
3028 length of string rather than counting it via multiple sprintfs;
3029 that's simpler and more reliable.
3030 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
3031 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
3032 sprintf, in case result does not fit in int.
3033
3034 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
3035 (fontset_from_font): Print it.
3036
3037 * frame.c (tty_frame_count): Now printmax_t, not int.
3038 (make_terminal_frame, set_term_frame_name): Print it.
3039 (x_report_frame_params): In X, window IDs are unsigned long,
3040 not signed long, so print them as unsigned.
3041 (validate_x_resource_name): Check for implausibly long names,
3042 and don't assume name length fits in 'int'.
3043 (x_get_resource_string): Don't blindly alloca invocation name;
3044 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
3045 not fit in int.
3046
3047 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
3048 (xg_check_special_colors, xg_set_geometry):
3049 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
3050
3051 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
3052 Use esprintf, not sprintf, in case result does not fit in int.
3053
3054 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3055 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
3056 it as a large positive number.
3057 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
3058 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
3059
3060 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
3061 in case result does not fit in int.
3062
3063 * print.c (float_to_string): Detect width overflow more reliably.
3064 (print_object): Make sprintf buffer a bit bigger, to avoid potential
3065 buffer overrun. Don't assume list length fits in 'int'. Treat
3066 print length of 0 as 0, not as infinity; to be consistent with other
3067 uses of print length in this function. Don't overflow print length
3068 index. Don't assume hash table size fits in 'long', or that
3069 vectorlike size fits in 'unsigned long'.
3070
3071 * process.c (make_process): Use printmax_t, not int, to format
3072 process-name gensyms.
3073
3074 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
3075
3076 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
3077 to avoid potential buffer overrun.
3078
3079 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
3080 if X resource line is longer than 512 bytes.
3081
3082 * xfns.c (x_window): Make sprintf buffer a bit bigger
3083 to avoid potential buffer overrun.
3084
3085 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
3086
3087 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
3088
3089 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
3090
3091 Integer overflow fixes for scrolling, etc.
3092 Without these, Emacs silently mishandles large integers sometimes.
3093 For example, "C-u 4294967297 M-x recenter" was treated as if
3094 it were "C-u 1 M-x recenter" on a typical 64-bit host.
3095
3096 * xdisp.c (try_window_id): Check Emacs fixnum range before
3097 converting to 'int'.
3098
3099 * window.c (window_scroll_line_based, Frecenter):
3100 Check that an Emacs fixnum is in range before assigning it to 'int'.
3101 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
3102 values converted from Emacs fixnums.
3103 (Frecenter): Don't wrap around a line count if it is out of 'int'
3104 range; instead, treat it as an extreme value.
3105 (Fset_window_configuration, compare_window_configurations):
3106 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
3107
3108 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
3109 that can exceed INT_MAX. Check that EMACS_INT value is in range
3110 before assigning it to the (possibly-narrower) index.
3111 (match_limit): Don't assume that a fixnum can fit in 'int'.
3112
3113 * print.c (print_object): Use ptrdiff_t, not int, for index that can
3114 exceed INT_MAX.
3115
3116 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3117 (Fvertical_motion): Don't wrap around LINES values that don't fit
3118 in 'int'. Instead, treat them as extreme values. This is good
3119 enough for windows, which can't have more than INT_MAX lines anyway.
3120
3121 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3122
3123 * Require libxml/parser.h to avoid compilation warning.
3124
3125 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
3126
3127 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
3128 since this reportedly can destroy thread storage.
3129
3130 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
3131
3132 * syntax.c (find_defun_start): Update all cache variables if
3133 exiting early (Bug#9401).
3134
3135 2011-08-30 Eli Zaretskii <eliz@gnu.org>
3136
3137 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
3138
3139 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
3140 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
3141 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
3142
3143 * term.c (tty_append_glyph): New function.
3144 (produce_stretch_glyph): Static function and its prototype deleted.
3145
3146 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
3147 Add prototypes.
3148
3149 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
3150
3151 * image.c (parse_image_spec): Check for nonnegative, not for positive,
3152 when checking :margin (Bug#9390).
3153 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
3154 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
3155 so that the name doesn't mislead. All uses changed.
3156
3157 2011-08-28 Johan Bockgård <bojohan@gnu.org>
3158
3159 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
3160 set_tty_hooks.
3161
3162 2011-08-27 Eli Zaretskii <eliz@gnu.org>
3163
3164 * xdisp.c (move_it_to): Don't bail out early when reaching
3165 position beyond to_charpos, if we are scanning backwards.
3166 (move_it_vertically_backward): When DY == 0, make sure we get to
3167 the first character in the line after the newline.
3168
3169 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
3170
3171 * ccl.c: Improve and simplify overflow checking (Bug#9196).
3172 (ccl_driver): Do not generate an out-of-range pointer.
3173 (Fccl_execute_on_string): Remove unnecessary check for
3174 integer overflow, noted by Stefan Monnier in
3175 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
3176 Remove a FIXME that didn't need fixing.
3177 Simplify the newly-introduced buffer reallocation code.
3178
3179 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
3180
3181 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
3182
3183 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
3184
3185 Integer and memory overflow issues (Bug#9196).
3186
3187 * doc.c (get_doc_string): Rework so that
3188 get_doc_string_buffer_size is the actual buffer size, rather than
3189 being 1 less than the actual buffer size; this makes xpalloc more
3190 convenient.
3191
3192 * image.c (x_allocate_bitmap_record, cache_image):
3193 * xselect.c (Fx_register_dnd_atom):
3194 Simplify previous changes by using xpalloc.
3195
3196 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
3197 since either will do and ptrdiff_t is convenient with xpalloc.
3198
3199 * charset.c (charset_table_size)
3200 (struct charset_sort_data.priority): Now ptrdiff_t.
3201 (charset_compare): Don't overflow if priorities differ greatly.
3202 (Fsort_charsets): Don't assume list length fits in int.
3203 Check for size-calculation overflow when allocating sort data.
3204 (syms_of_charset): Allocate an initial charset table that is
3205 just under 64 KiB, to avoid problems with glibc malloc and mmap.
3206
3207 * cmds.c (internal_self_insert): Check for size-calculation overflow.
3208
3209 * composite.h (struct composition.glyph_len): Now int, not unsigned.
3210 The actual value is always <= INT_MAX, and leaving it unsigned made
3211 overflow checking harder.
3212
3213 * dispextern.h (struct glyph_matrix.rows_allocated)
3214 (struct face_cache.size): Now ptrdiff_t, for convenience in use
3215 with xpalloc. The values are still always <= INT_MAX.
3216
3217 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
3218
3219 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
3220 (SAFE_NALLOCA): New macro.
3221
3222 * region-cache.c (struct boundary.pos, find_cache_boundary)
3223 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
3224 (set_cache_region, invalidate_region_cache)
3225 (revalidate_region_cache, know_region_cache, region_cache_forward)
3226 (region_cache_backward, pp_cache):
3227 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
3228 so that ptrdiff_t * can be passed to xpalloc.
3229 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
3230 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
3231 (pp_cache): Don't assume cache_len fits in int.
3232 * region-cache.h: Adjust extern decls to match.
3233
3234 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
3235 EMACS_INT, since either will do, for xpalloc.
3236
3237 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
3238 (xnmalloc, xnrealloc, xpalloc): New functions.
3239
3240 * bidi.c (bidi_shelve_header_size): New constant.
3241 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
3242 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
3243
3244 * bidi.c (bidi_cache_shrink):
3245 * buffer.c (overlays_at, overlays_in, record_overlay_string)
3246 (overlay_strings):
3247 Don't update size of array until after memory allocation succeeds,
3248 because xmalloc/xrealloc may not return.
3249 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
3250 now that we have proper integer overflow checking.
3251 (record_overlay_string, overlay_strings): Catch overflows when
3252 calculating size of overlay_str_buf.
3253
3254 * callproc.c (Fcall_process): Check for size overflow when
3255 calculating size of args2.
3256 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
3257 Normally we prefer signed values, but sticking with ptrdiff_t would
3258 require adding more-complicated checks.
3259
3260 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
3261 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
3262 Redo buffer-overflow calculations to avoid integer overflow.
3263 Add a FIXME comment where memory seems to be over-allocated.
3264
3265 * character.c (Fstring): Check for size-calculation overflow.
3266
3267 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
3268 unnecessary integer overflow. Check for size overflow.
3269 (encode_coding_object): Don't update size until xmalloc succeeds.
3270
3271 * composite.c (get_composition_id): Check for overflow in glyph
3272 length calculations.
3273
3274 Integer and memory overflow fixes for display code.
3275 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
3276 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
3277 (scrolling_window): Check for overflow in size calculations.
3278 (line_draw_cost, realloc_glyph_pool, add_row_entry):
3279 Don't assume glyph table len fits in int.
3280 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
3281 (row_table_size): Now ptrdiff_t, not int.
3282 (scrolling_window): Avoid overflow in size calculations.
3283 Don't update size until allocation succeeds.
3284 * fns.c (concat): Check for overflow in size calculations.
3285 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
3286 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3287 (NEXT_ALMOST_PRIME_LIMIT): New constant.
3288
3289 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
3290 (get_doc_string): Check for size calculation overflow.
3291 Don't update size until allocation succeeds.
3292 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
3293 EMACS_INT, where ptrdiff_t will do.
3294 (Fsubstitute_command_keys): Check for string overflow.
3295
3296 * editfns.c (set_time_zone_rule): Don't assume environment length
3297 fits in int.
3298 (message_length): Now ptrdiff_t, not int.
3299 (Fmessage_box): Don't update size until allocation succeeds.
3300 Don't assume message length fits in int.
3301 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
3302
3303 * emacs.c (main): Do not reallocate argv, since there is a null at
3304 the end that can be overwritten, and this way there's no need to
3305 worry about size-calculation overflow.
3306 (sort_args): Check for size-calculation overflow.
3307
3308 * eval.c (init_eval_once, grow_specpdl): Don't update size until
3309 alloc succeeds.
3310 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
3311
3312 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
3313 (x_set_scroll_bar_width, x_figure_window_size):
3314 Check for integer overflow.
3315 (x_set_alpha): Do not assume XINT fits in int.
3316
3317 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
3318 This is for the members text_lines, text_cols, total_lines, total_cols,
3319 where the system imposes an 'int' limit.
3320
3321 * fringe.c (Fdefine_fringe_bitmap):
3322 Don't update size until alloc works.
3323
3324 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
3325 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
3326
3327 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
3328 Check for size-calculation overflow.
3329 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
3330 do, as we prefer signed integers.
3331 (id_to_widget.max_size, id_to_widget.used)
3332 (xg_store_widget_in_map, xg_remove_widget_from_map)
3333 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
3334 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
3335 Use and return ptrdiff_t, not int.
3336 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
3337 * gtkutil.h: Change prototypes to match the above.
3338
3339 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
3340 are duplicate now that they've been promoted to lisp.h.
3341 (x_allocate_bitmap_record, x_alloc_image_color)
3342 (make_image_cache, cache_image, xpm_load):
3343 Don't update size until alloc is done.
3344 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
3345 (x_detect_edges):
3346 Check for size calculation overflow.
3347 (ct_colors_allocated_max): New constant.
3348 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
3349 overflow.
3350
3351 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
3352 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
3353 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
3354 Use ptrdiff_t, not int, to count maps.
3355 (read_char_minibuf_menu_prompt): Check for overflow in size
3356 calculations. Don't update size until allocation succeeds.
3357 Redo calculations to avoid overflow.
3358 * keyboard.h: Change prototypes to match the above.
3359
3360 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
3361 to count maps.
3362 (current_minor_maps): Check for size calculation overflow.
3363 * keymap.h: Change prototypes to match the above.
3364
3365 * lread.c (read1, init_obarray): Don't update size until alloc done.
3366
3367 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
3368 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
3369
3370 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
3371 Now ptrdiff_t, not int.
3372 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
3373 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
3374
3375 * process.c (Fnetwork_interface_list): Check for overflow
3376 in size calculation.
3377
3378 * region-cache.c (move_cache_gap): Check for size calculation overflow.
3379
3380 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
3381 overflow. Don't bother calling xmalloc when xrealloc will do.
3382
3383 * search.c (Freplace_match): Check for size calculation overflow.
3384 (Fset_match_data): Don't assume list lengths fit in 'int'.
3385
3386 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
3387 for command line length. Do not attempt to address one before the
3388 beginning of an array, as that's not portable.
3389
3390 * term.c (max_frame_lines): Remove; unused.
3391 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
3392 not int.
3393 (encode_terminal_code, calculate_costs): Check for size
3394 calculation overflow.
3395 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
3396 table lengths and related sizes. Don't update size until alloc
3397 done. Redo calculations to avoid overflow.
3398 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
3399
3400 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
3401 subtracting pointers.
3402 (gobble_line): Check for overflow more carefully. Don't update size
3403 until alloc done.
3404
3405 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
3406 Don't update size until alloc done.
3407 Redo size calculations to avoid overflow.
3408 Check for size calculation overflow.
3409 (main) [DEBUG]: Fix typo in invoking tparam1.
3410
3411 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
3412 Use ptrdiff_t, not int, for sizes.
3413 (store_mode_line_noprop_char): Don't update size until alloc done.
3414
3415 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
3416 Use ptrdiff_t, not int, for sizes.
3417 (Finternal_make_lisp_face, cache_face):
3418 Check for size calculation overflow.
3419 (cache_face): Treat size calculation overflows as if they were
3420 memory exhaustion (the usual treatment), rather than aborting.
3421
3422 * xfns.c (x_encode_text, x_set_name_internal)
3423 (Fx_change_window_property): Use ptrdiff_t, not int, to count
3424 sizes, since they can exceed INT_MAX in size. Check for size
3425 calculation overflow.
3426
3427 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
3428 (xg_select): Check for size calculation overflow.
3429 Don't update size until alloc done.
3430
3431 * xrdb.c (get_environ_db): Don't assume path length fits in int,
3432 as sprintf is limited to int lengths.
3433
3434 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
3435 (X_LONG_MIN): New macros.
3436 Use them to make the following changes clearer.
3437 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
3438 This change doesn't affect the value now, but it may help remind
3439 future maintainers not to raise the value too much later.
3440 (SELECTION_QUANTUM): Remove, replacing with ...
3441 (selection_quantum): ... new function, which avoids overflow.
3442 All uses changed.
3443 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
3444 assumption that selection length fits in 'int'.
3445 (x_reply_selection_request, x_handle_selection_request)
3446 (x_get_window_property, receive_incremental_selection)
3447 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
3448 (lisp_data_to_selection_data, clean_local_selection_data):
3449 Use ptrdiff_t, not int, to record length of selection.
3450 (x_reply_selection_request, x_get_window_property)
3451 (receive_incremental_selection, x_property_data_to_lisp):
3452 Redo calculations to avoid overflow.
3453 (x_reply_selection_request): When sending hint, ceiling it at
3454 X_LONG_MAX rather than relying on wraparound overflow to send
3455 something.
3456 (x_get_window_property, receive_incremental_selection)
3457 (lisp_data_to_selection_data, x_property_data_to_lisp):
3458 Check for size-calculation overflow.
3459 (x_get_window_property, receive_incremental_selection)
3460 (lisp_data_to_selection_data, Fx_register_dnd_atom):
3461 Don't store size until memory allocation succeeds.
3462 (x_get_window_property): Plug memory leak on memory exhaustion.
3463 Don't double-block input; malloc is safe here. Don't assume 2**34
3464 - 4 fits in unsigned long. Add an xassert to check
3465 XGetWindowProperty overflow. Be more careful about overflow
3466 calculations, and distinguish size from memory overflow better.
3467 (receive_incremental_selection): When tracing, don't assume
3468 unsigned int is less than INT_MAX.
3469 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
3470 harmful) conversions of unsigned short to int.
3471 (lisp_data_to_selection_data): Don't assume that integers
3472 in the range -65535 through -1 fit in an X unsigned short.
3473 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
3474 result parameters unless successful. Rely on cons_to_unsigned
3475 to report problems with elements; the old code wasn't right anyway.
3476 (x_check_property_data): Check for int overflow; we cannot use
3477 a wider type due to X limits.
3478 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
3479
3480 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
3481
3482 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
3483 (x_term_init): Check for size calculation overflow.
3484 (x_color_cells): Don't store size until memory allocation succeeds.
3485 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
3486 Don't assume alloca size is less than MAX_ALLOCA.
3487 (x_term_init): Don't assume length fits in int (sprintf is limited
3488 to int size).
3489
3490 Use ptrdiff_t for composition IDs.
3491 * character.c (lisp_string_width):
3492 * composite.c (composition_table_size, n_compositions)
3493 (get_composition_id, composition_gstring_from_id):
3494 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
3495 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
3496 * window.c (Frecenter):
3497 Use ptrdiff_t, not int, for composition IDs.
3498 * composite.c (get_composition_id): Check for integer overflow.
3499 * composite.h: Adjust prototypes to match the above changes.
3500
3501 Use ptrdiff_t for hash table indexes.
3502 * category.c (hash_get_category_set):
3503 * ccl.c (ccl_driver):
3504 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
3505 * coding.c (coding_system_charset_list, detect_coding_system):
3506 * coding.h (struct coding_system.id):
3507 * composite.c (get_composition_id, gstring_lookup_cache):
3508 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
3509 * image.c (xpm_get_color_table_h):
3510 * lisp.h (hash_lookup, hash_put):
3511 * minibuf.c (Ftest_completion):
3512 Use ptrdiff_t for hash table indexes, not int (which is too
3513 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
3514 32-bit --with-wide-int hosts).
3515
3516 * charset.c (Fdefine_charset_internal): Check for integer overflow.
3517 Add a FIXME comment about memory leaks.
3518 (syms_of_charset): Don't assume xmalloc returns.
3519
3520 Don't assume that stated character widths fit in int.
3521 * character.c (Fchar_width, c_string_width, lisp_string_width):
3522 * character.h (CHAR_WIDTH):
3523 * indent.c (MULTIBYTE_BYTES_WIDTH):
3524 Use sanitize_char_width to avoid undefined and/or bad behavior
3525 with outlandish widths.
3526 * character.h (sanitize_tab_width): Rename from sanitize_width,
3527 now that we have two such functions. All uses changed.
3528 (sanitize_char_width): New inline function.
3529
3530 Don't assume that tab-width fits in int.
3531 * character.h (sanitize_width): New inline function.
3532 (SANE_TAB_WIDTH): New macro.
3533 (ASCII_CHAR_WIDTH): Use it.
3534 * indent.c (sane_tab_width): Remove. All uses replaced by
3535 SANE_TAB_WIDTH (current_buffer).
3536 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
3537
3538 * fileio.c: Integer overflow issues with file modes.
3539 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
3540
3541 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
3542 Remove unreachable code.
3543 (read_hex, load_charset_map_from_file): Check for integer overflow.
3544
3545 * xterm.c: Don't go over XClientMessageEvent limit.
3546 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
3547 (x_send_scroll_bar_event): Likewise. Check that the size does not
3548 exceed limits imposed by XClientMessageEvent, as well as the usual
3549 ptrdiff_t and size_t limits.
3550
3551 * keyboard.c: Overflow, signedness and related fixes.
3552 (make_lispy_movement): Use same integer type in forward decl
3553 that is used in the definition.
3554 (read_key_sequence, keyremap_step):
3555 Change bufsize argument back to int, undoing my 2011-03-30 change.
3556 We prefer signed types, and int is wide enough here.
3557 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
3558 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
3559 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
3560 length, not size_t. Use ptrdiff_t for index, not int.
3561 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
3562 possibility of integer overflow.
3563
3564 Overflow, signedness and related fixes for images.
3565
3566 * dispextern.h (struct it.stack[0].u.image.image_id)
3567 (struct_it.image_id, struct image.id, struct image_cache.size)
3568 (struct image_cache.used, struct image_cache.ref_count):
3569 * gtkutil.c (update_frame_tool_bar):
3570 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
3571 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
3572 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
3573 * nsmenu.m (update_frame_tool_bar):
3574 * xdisp.c (calc_pixel_width_or_height):
3575 * xfns.c (image_cache_refcount):
3576 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
3577 on typical 64-bit hosts.
3578
3579 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
3580 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
3581 Omit unnecessary casts to int.
3582 (parse_image_spec): Check that integers fall into 'int' range
3583 when the callers expect that.
3584 (image_ascent): Redo ascent calculation to avoid int overflow.
3585 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
3586 (lookup_image): Remove unnecessary tests.
3587 (xbm_image_p): Locals are now of int, not EMACS_INT,
3588 since parse_image_check makes sure they fit into int.
3589 (png_load, gif_load, svg_load_image):
3590 Prefer int to unsigned where either will do.
3591 (tiff_handler): New function, combining the cores of the
3592 old tiff_error_handler and tiff_warning_handler.
3593 This function is rewritten to use vsnprintf and thereby avoid
3594 stack buffer overflows. It uses only the features of vsnprintf
3595 that are common to both POSIX and native Microsoft.
3596 (tiff_error_handler, tiff_warning_handler): Use it.
3597 (tiff_load, gif_load, imagemagick_load_image):
3598 Don't assume :index value fits in 'int'.
3599 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
3600 (imagemagick_load_image): Check that crop parameters fit into
3601 the integer types that MagickCropImage accepts. Don't assume
3602 Vimagemagick_render_type has a nonnegative value. Don't assume
3603 size_t fits in 'long'.
3604 (gs_load): Use printmax_t to print the widest integers possible.
3605 Check for integer overflow when computing image height and width.
3606
3607 2011-08-26 Eli Zaretskii <eliz@gnu.org>
3608
3609 * xdisp.c (redisplay_window): Don't force window start if point
3610 will be invisible in the resulting window. (Bug#9324)
3611
3612 2011-08-25 Eli Zaretskii <eliz@gnu.org>
3613
3614 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
3615 the display spec is of the form `(space ...)'.
3616 (handle_display_spec): Return the value returned by
3617 handle_single_display_spec, not just 1 or zero.
3618 (handle_single_display_spec): If the display spec is of the form
3619 `(space ...)', and specifies display in the text area, return 2
3620 rather than 1.
3621 (try_cursor_movement): Check for the need to scroll more
3622 accurately, and prefer exact match for point under bidi.
3623 Don't advance `row' beyond the last row of the window.
3624
3625 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
3626 into disp_prop; all users changed.
3627
3628 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
3629 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
3630 for the text covered by the display property.
3631
3632 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
3633
3634 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
3635 Change return value to nil.
3636 (Frecord_buffer): Delete unused function.
3637
3638 2011-08-24 Eli Zaretskii <eliz@gnu.org>
3639
3640 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
3641 buffers, return left-to-right.
3642 (set_cursor_from_row): Consider candidate row a win if its glyph
3643 represents a newline and point is on that newline. Fixes cursor
3644 positioning on the newline at EOL of R2L text within L2R
3645 paragraph, and vice versa.
3646 (try_cursor_movement): Check continued rows, in addition to
3647 continuation rows. Fixes unwarranted scroll when point enters a
3648 continued line of R2L text within an L2R paragraph, or vice versa.
3649 (cursor_row_p): Consider the case of point being equal to
3650 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
3651 from the end of a short line to the beginning of a continued line
3652 of R2L text within L2R paragraph.
3653 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
3654 composed characters.
3655
3656 * bidi.c (bidi_check_type): Use xassert.
3657 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
3658 members.
3659
3660 2011-08-23 Eli Zaretskii <eliz@gnu.org>
3661
3662 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
3663 a character.
3664
3665 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
3666
3667 * nsfont.m (ns_otf_to_script): Fix typo.
3668
3669 2011-08-22 Kenichi Handa <handa@m17n.org>
3670
3671 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
3672 extra slot even if the purpose is char-code-property-table.
3673
3674 2011-08-23 Eli Zaretskii <eliz@gnu.org>
3675
3676 * xdisp.c (redisplay_window): When computing centering_position,
3677 account for the height of the header line. (Bug#8874)
3678
3679 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
3680 instead of CHAR_TO_BYTE. Fixes a crash when a completion
3681 candidate is selected by the mouse, and that candidate has a
3682 composed character under the mouse.
3683
3684 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
3685 coordinates reported by pos-visible-in-window-p for a composed
3686 character in column zero.
3687
3688 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
3689
3690 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
3691
3692 2011-08-22 Eli Zaretskii <eliz@gnu.org>
3693
3694 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
3695 consider it a hit if to_charpos is anywhere in the range of the
3696 composed buffer positions.
3697
3698 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
3699
3700 * image.c (gif_load): Don't assume that each subimage has the same
3701 dimensions as the base image. Handle disposal method that is
3702 "undefined" by the gif spec (Bug#9335).
3703
3704 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
3705
3706 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
3707 (Fcondition_case): Document `debug' symbol in error handler.
3708
3709 2011-08-19 Eli Zaretskii <eliz@gnu.org>
3710
3711 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
3712 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
3713 from an Org mode buffer to a Speedbar frame.
3714
3715 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
3716 a composition, take its buffer position from IT->cmp_it.charpos.
3717 Fixes cursor positioning at the beginning of a line that begins
3718 with a composed character.
3719
3720 2011-08-18 Eli Zaretskii <eliz@gnu.org>
3721
3722 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
3723 character bidirectional type, use STRONG_L instead. Fixes crashes
3724 in a buffer produced by `describe-categories'.
3725
3726 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
3727 members before the level stack, so they would be saved and
3728 restored when copying iterator state. Fixes incorrect reordering
3729 around TABs covered by display properties.
3730
3731 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
3732
3733 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
3734
3735 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
3736
3737 * eval.c (internal_condition_case, internal_condition_case_1)
3738 (internal_condition_case_2, internal_condition_case_n):
3739 Remove unnecessary aborts (Bug#9081).
3740
3741 2011-08-17 Eli Zaretskii <eliz@gnu.org>
3742
3743 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
3744 has no `load' handler, try opening the file locally. (Bug#9311)
3745
3746 2011-08-16 Ken Brown <kbrown@cornell.edu>
3747
3748 * gmalloc.c: Expand comment.
3749
3750 2011-08-16 Eli Zaretskii <eliz@gnu.org>
3751
3752 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
3753 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
3754
3755 2011-08-16 Ken Brown <kbrown@cornell.edu>
3756
3757 Fix memory allocation problems in Cygwin build (Bug#9273).
3758
3759 * unexcw.c ( __malloc_initialized): Declare external variable.
3760 (fixup_executable): Force the dumped emacs to reinitialize malloc.
3761
3762 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
3763 New variables.
3764 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
3765 dumped emacs.
3766 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
3767 in the static heap.
3768 [CYGWIN] (special_realloc): New function.
3769 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
3770 requests to realloc storage in the static heap.
3771
3772 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
3773
3774 * bidi.c (bidi_initialize): Remove unused local.
3775
3776 2011-08-15 Eli Zaretskii <eliz@gnu.org>
3777
3778 * bidimirror.h:
3779 * biditype.h: Remove file.
3780 * makefile.w32-in ($(BLD)/bidi.$(O)):
3781 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
3782
3783 * dispextern.h: Fix a typo in the comment to bidi_type_t.
3784
3785 * chartab.c: Improve commentary for the uniprop_table API.
3786
3787 * bidi.c (bidi_paragraph_init): Support zero value of
3788 bidi_ignore_explicit_marks_for_paragraph_level.
3789 (bidi_initialize): Use uniprop_table instead of including
3790 biditype.h and bidimirror.h.
3791
3792 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
3793 coordinates of the iterator when restoring from ppos_it.
3794 (Bug#9296)
3795
3796 2011-08-14 Kenichi Handa <handa@m17n.org>
3797
3798 * process.c (create_process): Call setup_process_coding_systems
3799 after the pid of the process is set to -1 (Bug#8162).
3800
3801 2011-08-14 Eli Zaretskii <eliz@gnu.org>
3802
3803 * xdisp.c (move_it_in_display_line_to): Don't invoke
3804 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
3805 ppos_it. Fixes vertical cursor motion when line beginning is
3806 covered by an image. (Bug#9296)
3807
3808 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
3809
3810 * nsterm.h (ns_run_ascript): Declare.
3811 (NSAPP_DATA2_RUNASSCRIPT): Define.
3812
3813 * nsfns.m (as_script, as_result, as_status): New static variables.
3814 (ns_run_ascript): New function.
3815 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
3816 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
3817 the event loop. Get status from as_status (Bug#7276).
3818
3819 * nsterm.m (sendEvent): If event is NSApplicationDefined and
3820 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
3821 the event loop (Bug#7276).
3822
3823 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
3824
3825 * gnutls.c (QCgnutls_bootprop_priority)
3826 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
3827 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
3828 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
3829 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
3830 (QCgnutls_bootprop_verify_hostname_error)
3831 (QCgnutls_bootprop_callbacks_verify): Rename from
3832 Qgnutls_bootprop_..., all uses changed.
3833
3834 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
3835 uses changed.
3836
3837 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
3838
3839 * xfaces.c (Qframe_set_background_mode): Now static.
3840 * dispextern.h (Qframe_set_background_mode): Remove decl.
3841
3842 * process.c (Fnetwork_interface_info): Declare local only if needed.
3843
3844 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
3845
3846 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
3847 (Fnetwork_interface_list): Allocate in increments of bytes instead
3848 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
3849 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
3850 sockaddr.
3851 (struct ifflag_def): notrailers is smart on OSX.
3852 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
3853 Get hardware address with getifaddrs if available.
3854
3855 2011-08-12 Eli Zaretskii <eliz@gnu.org>
3856
3857 * xdisp.c (iterate_out_of_display_property): xassert that
3858 IT->position is set to within IT->object's boundaries. Break from
3859 the loop as soon as EOB is reached; avoids infloops in redisplay
3860 when IT->position is set up wrongly due to some bug.
3861 Set IT->current to match the bidi iterator unconditionally.
3862 (push_display_prop): Allow GET_FROM_STRING as IT->method on
3863 entry. Force push_it to save on the stack the current
3864 buffer/string position, to be restored by pop_it. Fix flags in
3865 the iterator structure wrt the object coming from a display
3866 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
3867 properties. (Bug#9284)
3868
3869 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
3870
3871 * fontset.c (fontset_get_font_group): Add proper type checks.
3872 (Bug#9172)
3873
3874 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3875
3876 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
3877 and LC_VERSION_MIN_MACOSX.
3878 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
3879 (dump_it) [LC_FUNCTION_STARTS]: Use it.
3880
3881 2011-08-08 Eli Zaretskii <eliz@gnu.org>
3882
3883 * xdisp.c (forward_to_next_line_start): Allow to use the
3884 no-display-properties-and-no-overlays under bidi display.
3885 Set disp_pos in the bidi iterator to avoid searches for display
3886 properties and overlays.
3887
3888 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
3889
3890 * editfns.c (Fset_time_zone_rule): Document relationship with the
3891 setenv function.
3892
3893 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
3894 the font entity extracted from the cache (Bug#8109).
3895
3896 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
3897
3898 * composite.c (autocmp_chars): Don't reset point. That is done by
3899 restore_point_unwind (Bug#5984).
3900
3901 2011-08-07 Juri Linkov <juri@jurta.org>
3902
3903 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
3904 to show the arg `TIME' instead of `TIMEVAL'.
3905
3906 2011-08-06 Eli Zaretskii <eliz@gnu.org>
3907
3908 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
3909 display property strides EOL and includes a newline, as in
3910 longlines-mode. (Bug#9254)
3911 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
3912 word-wrap under bidirectional display. (Bug#9224)
3913
3914 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
3915 is non-zero, even if the data buffer is NULL. Fixes a crash in
3916 vertical-motion with longlines-mode. (Bug#9254)
3917
3918 2011-08-05 Eli Zaretskii <eliz@gnu.org>
3919
3920 * bidi.c <bidi_cache_total_alloc>: Now static.
3921 (bidi_initialize): Initialize bidi_cache_total_alloc.
3922
3923 * xdisp.c (display_line): Release buffer allocated for shelved bidi
3924 cache. (Bug#9221)
3925
3926 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
3927 amount allocated this far in `bidi_cache_total_alloc'.
3928 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
3929 non-zero, only free the data buffer without restoring the cache
3930 contents. All callers changed.
3931
3932 * dispextern.h (bidi_unshelve_cache): Update prototype.
3933
3934 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
3935 (move_it_in_display_line, move_it_to)
3936 (move_it_vertically_backward, move_it_by_lines): Replace the call
3937 to xfree to an equivalent call to bidi_unshelve_cache.
3938 (move_it_in_display_line_to): Fix logic of returning
3939 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
3940
3941 2011-08-05 Eli Zaretskii <eliz@gnu.org>
3942
3943 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
3944 came from a string character with a `cursor' property. (Bug#9229)
3945
3946 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
3947
3948 * Makefile.in (LIB_PTHREAD): New variable.
3949 (LIBES): Add LIB_PTHREAD (Bug#9216).
3950
3951 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
3952 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
3953
3954 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
3955
3956 * regex.c (re_iswctype): Remove some redundant boolean conversions.
3957
3958 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
3959
3960 * xterm.c (x_find_topmost_parent): New function.
3961 (x_set_frame_alpha): Find topmost parent window with
3962 x_find_topmost_parent and set the property there also (bug#9181).
3963 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
3964
3965 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
3966
3967 * callproc.c (Fcall_process): Avoid vfork clobbering
3968 the local vars buffer, coding_systems, current_dir.
3969
3970 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
3971
3972 * keymap.c (Fmake_composed_keymap): Move to subr.el.
3973
3974 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
3975
3976 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
3977 so that it is not optimized away.
3978
3979 * xdisp.c (compute_display_string_pos): Remove unused local.
3980
3981 2011-08-02 Eli Zaretskii <eliz@gnu.org>
3982
3983 Fix slow cursor motion and scrolling in large buffers with
3984 selective display, like Org Mode buffers. (Bug#9218)
3985
3986 * dispextern.h (struct bidi_it): New member disp_prop_p.
3987
3988 * xdisp.c: Remove one-slot cache of display string positions.
3989 (compute_display_string_pos): Accept an additional argument
3990 DISP_PROP_P; callers changed. Scan at most 5K characters forward
3991 for a display string or property. If found, set DISP_PROP_P
3992 non-zero.
3993
3994 * bidi.c (bidi_fetch_char): Accept an additional argument
3995 DISP_PROP_P, and pass it to compute_display_string_pos.
3996 Only handle text covered by a display string if DISP_PROP_P is returned
3997 non-zero. All callers of bidi_fetch_char changed.
3998
3999 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
4000
4001 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
4002
4003 2010-12-03 Don March <don@ohspite.net>
4004
4005 * keymap.c (Fdefine_key): Fix non-prefix key error message when
4006 last character M-[char] is translated to ESC [char] (bug#7541).
4007
4008 2011-08-02 Kenichi Handa <handa@m17n.org>
4009
4010 * lisp.h (uniprop_table): Extern it.
4011
4012 * chartab.c (uniprop_table): Make it non-static.
4013
4014 2011-08-01 Eli Zaretskii <eliz@gnu.org>
4015
4016 * xdisp.c (forward_to_next_line_start): Accept additional argument
4017 BIDI_IT_PREV, and store into it the state of the bidi iterator had
4018 on the newline.
4019 (reseat_at_next_visible_line_start): Use the bidi iterator state
4020 returned by forward_to_next_line_start to restore the state of
4021 it->bidi_it after backing up to previous newline. (Bug#9212)
4022
4023 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
4024
4025 * regex.c (re_comp): Protoize.
4026 (re_exec): Fix return type.
4027 (regexec): Fix type of `ret'. (Bug#9203)
4028
4029 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4030
4031 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
4032 This is needed if max-image-size is a floating-point number.
4033
4034 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4035
4036 * print.c (print_object): Print empty symbol as ##.
4037
4038 * lread.c (read1): Read ## as empty symbol.
4039
4040 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4041
4042 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
4043 setting frame foreground color (Bug#9175).
4044 (x_set_background_color): Likewise.
4045
4046 * nsmenu.m (-setText): Size tooltip dimensions precisely to
4047 contents (Bug#9176).
4048 (EmacsTooltip -init): Remove bezels and add shadows to
4049 tooltip windows.
4050
4051 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
4052 or scroll bar (Bug#8470).
4053
4054 * nsfont.m (nsfont_open): Remove assignment to voffset and
4055 unnecessary vars hshink, expand, hd, full_height, min_height.
4056 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
4057
4058 * nsterm.h (nsfont_info): Remove voffset field.
4059
4060 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4061
4062 Implement strike-through and overline on NextStep (Bug#8863).
4063
4064 * nsfont.m (nsfont_open): Use underline position provided by font,
4065 instead of hard-coded value of 2.
4066 (nsfont_draw): Call ns_draw_text_decoration instead.
4067
4068 * nsterm.h: Add declaration for ns_draw_text_decoration.
4069
4070 * nsterm.m (ns_draw_text_decoration): New function for drawing
4071 underline, overline, and strike-through.
4072 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
4073 ns_draw_text_decoration. Change treatment of cursor drawing to
4074 accommodate underlining, etc.
4075
4076 2011-07-28 Eli Zaretskii <eliz@gnu.org>
4077
4078 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
4079 default.
4080
4081 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4082
4083 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
4084 Without this fix, if a signal arrives just after memory fills up,
4085 'malloc' might be invoked reentrantly.
4086
4087 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
4088 In other words, assume that every image size is allowed, on non-X
4089 hosts. This assumption is probably wrong, but it lets Emacs compile.
4090
4091 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
4092
4093 * regex.c (re_iswctype): Convert return values to boolean.
4094
4095 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
4096
4097 * xdisp.c (compute_display_string_pos): Don't use cached display
4098 string position if the buffer had its restriction changed.
4099 (Bug#9184)
4100
4101 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4102
4103 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
4104
4105 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
4106
4107 Integer signedness and overflow and related fixes. (Bug#9079)
4108
4109 * bidi.c: Integer size and overflow fixes.
4110 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
4111 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
4112 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4113 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
4114 (bidi_find_other_level_edge):
4115 Use ptrdiff_t instead of EMACS_INT where either will do.
4116 This works better on 32-bit hosts configured --with-wide-int.
4117 (bidi_cache_ensure_space): Check for size-calculation overflow.
4118 Use % rather than repeated addition, for better worst-case speed.
4119 Don't set bidi_cache_size until after xrealloc returns, because it
4120 might not return.
4121 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
4122 (bidi_cache_ensure_space): Also check that the bidi cache size
4123 does not exceed that of the largest Lisp string or buffer. See Eli
4124 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
4125
4126 * alloc.c (__malloc_size_t): Remove.
4127 All uses replaced by size_t. See Andreas Schwab's note
4128 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
4129
4130 * image.c: Improve checking for integer overflow.
4131 (check_image_size): Assume that f is nonnull, since
4132 it is always nonnull in practice. This is one less thing to
4133 worry about when checking for integer overflow later.
4134 (x_check_image_size): New function, which checks for integer
4135 overflow issues inside X.
4136 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
4137 This removes the need for a memory_full check.
4138 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
4139 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
4140 (xbm_read_bitmap_data): Change locals back to 'int', since
4141 their values must fit in 'int'.
4142 (xpm_load_image, png_load, tiff_load):
4143 Invoke x_create_x_image_and_pixmap earlier,
4144 to avoid much needless work if the image is too large.
4145 (tiff_load): Treat overly large images as if
4146 x_create_x_image_and_pixmap failed, not as malloc failures.
4147 (gs_load): Use x_check_image_size.
4148
4149 * gtkutil.c: Omit integer casts.
4150 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
4151 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
4152
4153 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
4154
4155 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
4156 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
4157 would wrongly return t on a 64-bit host.
4158
4159 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
4160 The plain *_OVERFLOW macros run afoul of GCC bug 49705
4161 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
4162 and therefore cause GCC to emit a bogus diagnostic in some cases.
4163
4164 * image.c: Integer signedness and overflow and related fixes.
4165 This is not an exhaustive set of fixes, but it's time to
4166 record what I've got.
4167 (lookup_pixel_color, check_image_size): Remove redundant decls.
4168 (check_image_size): Don't assume that arbitrary EMACS_INT values
4169 fit in 'int', or that arbitrary 'double' values fit in 'int'.
4170 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
4171 (tiff_load, imagemagick_load_image):
4172 Check for overflow in size calculations.
4173 (x_create_x_image_and_pixmap): Remove unnecessary test for
4174 xmalloc returning NULL; that can't happen.
4175 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
4176 (xpm_color_bucket): Use better integer hashing function.
4177 (xpm_cache_color): Don't possibly over-allocate memory.
4178 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
4179 (gif_memory_source):
4180 Use ptrdiff_t, not int or size_t, to record sizes.
4181 (png_load): Don't assume values greater than 2**31 fit in 'int'.
4182 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
4183 either works, as we prefer signed integers.
4184 (tiff_read_from_memory, tiff_write_from_memory):
4185 Return tsize_t, not size_t, since that's what the TIFF API wants.
4186 (tiff_read_from_memory): Don't fail simply because the read would
4187 go past EOF; instead, return a short read.
4188 (tiff_load): Omit no-longer-needed casts.
4189 (Fimagemagick_types): Don't assume size fits into 'int'.
4190
4191 Improve hashing quality when configured --with-wide-int.
4192 * fns.c (hash_string): New function, taken from sxhash_string.
4193 Do not discard information about ASCII character case; this
4194 discarding is no longer needed.
4195 (sxhash-string): Use it. Change sig to match it. Caller changed.
4196 * lisp.h: Declare it.
4197 * lread.c (hash_string): Remove, since we now use fns.c's version.
4198 The fns.c version returns a wider integer if --with-wide-int is
4199 specified, so this should help the quality of the hashing a bit.
4200
4201 * emacs.c: Integer overflow minor fix.
4202 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
4203 Define only if GNU_LINUX.
4204 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
4205
4206 * dispnew.c: Integer signedness and overflow fixes.
4207 Remove unnecessary forward decls, that were a maintenance hassle.
4208 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
4209 All uses changed.
4210 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
4211 (scrolling_window): Use ptrdiff_t, not int, for byte count.
4212 (prepare_desired_row, line_draw_cost):
4213 Use int, not unsigned, where either works.
4214 (save_current_matrix, restore_current_matrix):
4215 Use ptrdiff_t, not size_t, where either works.
4216 (init_display): Check for overflow more accurately, and without
4217 relying on undefined behavior.
4218
4219 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
4220 Remove, replacing with the new symbols in lisp.h. All uses changed.
4221 * fileio.c (make_temp_name):
4222 * filelock.c (lock_file_1, lock_file):
4223 * xdisp.c (message_dolog):
4224 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
4225 Use pMd etc. instead.
4226 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
4227 replacing the pWIDE etc. symbols removed from editfns.c.
4228
4229 * keyboard.h (num_input_events): Now uintmax_t.
4230 This is (very slightly) less likely to mess up due to wraparound.
4231 All uses changed.
4232
4233 * buffer.c: Integer signedness fixes.
4234 (alloc_buffer_text, enlarge_buffer_text):
4235 Use ptrdiff_t rather than size_t when either will do, as we prefer
4236 signed integers.
4237
4238 * alloc.c: Integer signedness and overflow fixes.
4239 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
4240 (__malloc_size_t): Default to size_t, not to int.
4241 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
4242 (Fgarbage_collect, mark_object_loop_halt, mark_object):
4243 Prefer ptrdiff_t to size_t when either would do, as we prefer
4244 signed integers.
4245 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
4246 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
4247 Now const. Initialize with values that are in range even if char
4248 is signed.
4249 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
4250 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
4251 These functions do the right thing with sizes > 2**32.
4252 (check_depth): Now ptrdiff_t, not int.
4253 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
4254 Adjust to new way of storing sizes. Check for size overflow bugs
4255 in rest of code.
4256 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
4257 slightly wrong anyway, as it missed one instance of
4258 XMALLOC_OVERRUN_CHECK_OVERHEAD.
4259 (refill_memory_reserve): Omit needless cast to size_t.
4260 (mark_object_loop_halt): Mark as externally visible.
4261
4262 * xselect.c: Integer signedness and overflow fixes.
4263 (Fx_register_dnd_atom, x_handle_dnd_message):
4264 Use ptrdiff_t, not size_t, since we prefer signed.
4265 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
4266 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
4267 x_dnd_atoms_size and x_dnd_atoms_length.
4268
4269 * doprnt.c: Prefer signed to unsigned when either works.
4270 * eval.c (verror):
4271 * doprnt.c (doprnt):
4272 * lisp.h (doprnt):
4273 * xdisp.c (vmessage):
4274 Use ptrdiff_t, not size_t, when using or implementing doprnt,
4275 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
4276 prefer signed arithmetic to avoid comparison confusion.
4277 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
4278 but is a bit tricky.
4279
4280 Assume freestanding C89 headers, string.h, stdlib.h.
4281 * data.c, doprnt.c, floatfns.c, print.c:
4282 Include float.h unconditionally.
4283 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
4284 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
4285 * regex.c: Likewise for stddef.h, string.h.
4286 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
4287 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
4288 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
4289 (STDC_HEADERS): Remove obsolete defines.
4290 * sysdep.c: Include limits.h unconditionally.
4291
4292 Assume support for memcmp, memcpy, memmove, memset.
4293 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
4294 * regex.c (memcmp, memcpy):
4295 Remove; we assume C89 now.
4296
4297 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
4298 (__malloc_safe_bcopy): Remove; no longer needed.
4299
4300 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
4301 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
4302 well either way, and we prefer signed to unsigned.
4303
4304 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
4305
4306 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
4307 closes the connection while we're reading (bug#9182).
4308
4309 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
4310
4311 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
4312 are specified (Bug#9168).
4313
4314 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
4315
4316 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
4317 Found by GCC static checking and --with-wide-int on a 32-bit host.
4318
4319 2011-07-25 Eli Zaretskii <eliz@gnu.org>
4320
4321 * xdisp.c (compute_display_string_pos): Fix logic of caching
4322 previous display string position. Initialize cached_prev_pos to
4323 -1. Fixes slow-down at the beginning of a buffer.
4324
4325 2011-07-24 Eli Zaretskii <eliz@gnu.org>
4326
4327 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
4328 for attrs[LFACE_FONTSET_INDEX].
4329
4330 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
4331
4332 * xml.c (parse_region): Remove unused local
4333 that was recently introduced.
4334
4335 2011-07-23 Eli Zaretskii <eliz@gnu.org>
4336
4337 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
4338 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
4339
4340 * xdisp.c (move_it_in_display_line_to): Record the best matching
4341 position for TO_CHARPOS while scanning the line, and restore it on
4342 exit if none of the characters scanned was an exact match.
4343 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
4344 when exact match is impossible due to invisible text, and the
4345 lines are truncated.
4346
4347 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
4348
4349 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
4350 for OSX >= 10.7.
4351
4352 2011-07-22 Eli Zaretskii <eliz@gnu.org>
4353
4354 Fix a significant slow-down of cursor motion with C-n, C-p,
4355 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
4356 auto-repeat under bidi redisplay in fontified buffers.
4357 * xdisp.c (compute_stop_pos_backwards): New function.
4358 (next_element_from_buffer): Call compute_stop_pos_backwards to
4359 find a suitable prev_stop when we find ourselves before
4360 base_level_stop.
4361 (reseat): Don't look for prev_stop, as that could mean a very long
4362 run.
4363 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
4364 <cached_disp_overlay_modiff>: Cache for last found display string
4365 position.
4366 (compute_display_string_pos): Return the cached position if asked
4367 about the same buffer in the same area of character positions, and
4368 the buffer wasn't changed since the time the display string
4369 position was cached.
4370
4371 2011-07-22 Eli Zaretskii <eliz@gnu.org>
4372
4373 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
4374 is an integer, which is important for empty lines. (Bug#9149)
4375
4376 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
4377
4378 * frame.c (Fmodify_frame_parameters): In tty case, update the
4379 default face if necessary (Bug#4238).
4380
4381 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
4382
4383 * editfns.c (Fstring_to_char): No need to explain what a character
4384 is in the docstring (Bug#6576).
4385
4386 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4387
4388 * xml.c (parse_region): Make sure we always return a tree.
4389
4390 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
4391
4392 * xml.c (parse_region): If a document contains only comments,
4393 return that, too.
4394
4395 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
4396
4397 * xml.c (make_dom): Return comments, too.
4398
4399 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
4400
4401 Port to OpenBSD.
4402 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
4403 and the surrounding thread.
4404 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
4405 rather than fgets, and retry after EINTR. Otherwise, 'emacs
4406 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
4407 timer goes off.
4408 * s/openbsd.h (BROKEN_SIGIO): Define.
4409 * unexelf.c (unexec) [__OpenBSD__]:
4410 Don't update the .mdebug section of the Alpha COFF symbol table.
4411
4412 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4413
4414 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
4415 (bug#8460).
4416
4417 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
4418
4419 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
4420 This fixes some race conditions on the permissions of any newly
4421 created file.
4422
4423 * alloc.c (valid_pointer_p): Use pipe, not open.
4424 This fixes some permissions issues when debugging.
4425
4426 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
4427 If fchown fails to set both uid and gid, try to set just gid,
4428 as that is sometimes allowed. Adjust the file's mode to eliminate
4429 setuid or setgid bits that are inappropriate if fchown fails.
4430
4431 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
4432
4433 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
4434 to compare Lisp_Objects.
4435 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
4436 global_gnutls_log_level, don't mistake it for a Lisp_Object.
4437 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
4438
4439 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
4440
4441 * lread.c (read_integer): Unread even EOF character.
4442 (read1): Likewise. Properly record start position of symbol.
4443
4444 * lread.c (read1): Read `#:' as empty uninterned symbol if no
4445 symbol character follows.
4446
4447 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
4448
4449 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
4450 This works around a problem with the previous change to Fcopy_file.
4451 Recent glibc declares fchown with __attribute__((warn_unused_result)),
4452 and without this change, GCC might complain about discarding
4453 fchown's return value.
4454
4455 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
4456
4457 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
4458
4459 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
4460
4461 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
4462
4463 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
4464
4465 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
4466 it's used from the C level.
4467
4468 * process.c: Use the same condition for POLL_FOR_INPUT in both
4469 keyboard.c and process.c (bug#1858).
4470
4471 2011-07-09 Lawrence Mitchell <wence@gmx.li>
4472
4473 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
4474 (Fgnutls_boot): Use it.
4475
4476 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
4477
4478 * doc.c (Fsubstitute_command_keys): Revert last change.
4479
4480 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
4481
4482 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
4483 quotes the next character, and doesn't affect other longer
4484 sequences (bug#8935).
4485
4486 * lread.c (syms_of_lread): Clarify that is isn't only
4487 `eval-buffer' and `eval-defun' that's affected by
4488 `lexical-binding' (bug#8460).
4489
4490 2011-07-15 Eli Zaretskii <eliz@gnu.org>
4491
4492 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
4493 bidi redisplay when a line includes both an image and is truncated.
4494
4495 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
4496
4497 Fix minor problems found by static checking.
4498 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
4499 (elsz): Now a signed constant, not a size_t var. We prefer signed
4500 types to unsigned, to avoid integer comparison confusion. Without
4501 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
4502 "cannot optimize loop, the loop counter may overflow", a symptom
4503 of the confusion.
4504 * indent.c (Fvertical_motion): Mark locals as initialized.
4505 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
4506
4507 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4508
4509 * search.c (Fre_search_backward): Mention `case-fold-search' in
4510 all the re_search_* functions (bug#8138).
4511
4512 * keyboard.c (Fopen_dribble_file): Document when the file is
4513 closed (bug#8056).
4514
4515 2011-07-14 Eli Zaretskii <eliz@gnu.org>
4516
4517 * bidi.c (bidi_dump_cached_states): Fix format of displaying
4518 bidi_cache_idx.
4519
4520 Support bidi reordering of display and overlay strings.
4521 * xdisp.c (compute_display_string_pos)
4522 (compute_display_string_end): Accept additional argument STRING.
4523 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
4524 (reseat_to_string): Initialize bidi_it->string.s and
4525 bidi_it->string.schars.
4526 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
4527 NULL (avoids a crash in bidi_paragraph_init).
4528 Initialize itb.string.lstring.
4529 (init_iterator): Call bidi_init_it only of a valid
4530 buffer position was specified. Initialize paragraph_embedding to
4531 L2R.
4532 (reseat_to_string): Initialize the bidi iterator.
4533 (display_string): If we need to ignore text properties of
4534 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
4535 original value of -1 will not work with bidi.)
4536 (compute_display_string_pos): First arg is now struct
4537 `text_pos *'; all callers changed. Support display properties on
4538 Lisp strings.
4539 (compute_display_string_end): Support display properties on Lisp
4540 strings.
4541 (init_iterator, reseat_1, reseat_to_string): Initialize the
4542 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
4543 when iterating on a string not from display properties).
4544 (compute_display_string_pos, compute_display_string_end):
4545 Fix calculation of the object to scan. Fixes an error when using
4546 arrow keys.
4547 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
4548 base_level_stop; instead, set base_level_stop to BEGV.
4549 Fixes crashes in vertical-motion.
4550 (next_element_from_buffer): Improve commentary for when
4551 the iterator is before prev_stop.
4552 (init_iterator): Initialize bidi_p from the default value of
4553 bidi-display-reordering, not from buffer-local value. Use the
4554 buffer-local value only if initializing for buffer iteration.
4555 (handle_invisible_prop): Support invisible properties on strings
4556 that are being bidi-reordered.
4557 (set_iterator_to_next): Support bidi reordering of C strings and
4558 Lisp strings.
4559 (next_element_from_string): Support bidi reordering of Lisp
4560 strings.
4561 (handle_stop_backwards): Support Lisp strings as well.
4562 (display_string): Support display of R2L glyph rows.
4563 Use IT_STRING_CHARPOS when displaying from a Lisp string.
4564 (init_iterator): Don't initialize it->bidi_p for strings
4565 here.
4566 (reseat_to_string): Initialize it->bidi_p for strings here.
4567 (next_element_from_string, next_element_from_c_string)
4568 (next_element_from_buffer): Add xassert's for correspondence
4569 between IT's object being iterated and it->bidi_it.string
4570 structure.
4571 (face_before_or_after_it_pos): Support bidi iteration.
4572 (next_element_from_c_string): Handle the case of the first string
4573 character that is not the first one in the visual order.
4574 (get_visually_first_element): New function, refactored from common
4575 parts of next_element_from_buffer, next_element_from_string, and
4576 next_element_from_c_string.
4577 (tool_bar_lines_needed, redisplay_tool_bar)
4578 (display_menu_bar): Force left-to-right direction. Add a FIXME
4579 comment for making that be controlled by a user option.
4580 (push_it, pop_it): Save and restore the state of the
4581 bidi iterator. Save and restore the bidi_p flag.
4582 (pop_it): Iterate out of display property for string iteration as
4583 well.
4584 (iterate_out_of_display_property): Support iteration over strings.
4585 (handle_single_display_spec): Set up it->bidi_it for iteration
4586 over a display string, and call bidi_init_it.
4587 (handle_single_display_spec, next_overlay_string)
4588 (get_overlay_strings_1, push_display_prop): Set up the bidi
4589 iterator for displaying display or overlay strings.
4590 (forward_to_next_line_start): Don't use the shortcut if
4591 bidi-iterating.
4592 (back_to_previous_visible_line_start): If handle_display_prop
4593 pushed the iterator stack, restore the internal state of the bidi
4594 iterator by calling bidi_pop_it same number of times.
4595 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
4596 and we are bidi-iterating, don't decrement the iterator position;
4597 instead, set the first_elt flag in the bidi iterator, to produce
4598 the same effect.
4599 (reseat_1): Remove redundant setting of string_from_display_prop_p.
4600 (push_display_prop): xassert that we are iterating a buffer.
4601 (push_it, pop_it): Save and restore paragraph_embedding member.
4602 (handle_single_display_spec, next_overlay_string)
4603 (get_overlay_strings_1, reseat_1, reseat_to_string)
4604 (push_display_prop): Set up the `unibyte' member of bidi_it.string
4605 correctly. Don't assume unibyte strings are not bidi-reordered.
4606 (compute_display_string_pos)
4607 (compute_display_string_end): Fix handling the case of C string.
4608 (push_it, pop_it): Save and restore from_disp_prop_p.
4609 (handle_single_display_spec, push_display_prop): Set the
4610 from_disp_prop_p flag.
4611 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
4612 (pop_it): Call iterate_out_of_display_property only if we are
4613 popping after iteration over a string that came from a display
4614 property. Fix a typo in popping stretch info. Add an assertion
4615 for verifying that the iterator position is in sync with the bidi
4616 iterator.
4617 (handle_single_display_spec, get_overlay_strings_1)
4618 (push_display_prop): Fix initialization of paragraph direction for
4619 string when that of the parent object is not yet determined.
4620 (reseat_1): Call bidi_init_it to resync the bidi
4621 iterator with IT's position. (Bug#7616)
4622 (find_row_edges): If ROW->start.pos gives position
4623 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
4624 (handle_stop, back_to_previous_visible_line_start, reseat_1):
4625 Reset the from_disp_prop_p flag.
4626 (SAVE_IT, RESTORE_IT): New macros.
4627 (pos_visible_p, face_before_or_after_it_pos)
4628 (back_to_previous_visible_line_start)
4629 (move_it_in_display_line_to, move_it_in_display_line)
4630 (move_it_to, move_it_vertically_backward, move_it_by_lines)
4631 (try_scrolling, redisplay_window, display_line): Use them when
4632 saving a temporary copy of the iterator and restoring it back.
4633 (back_to_previous_visible_line_start, reseat_1)
4634 (init_iterator): Empty the bidi cache "stack".
4635 (move_it_in_display_line_to): If iterator ended up at
4636 EOL, but we never saw any buffer positions smaller than
4637 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
4638 motion in bidi-reordered lines.
4639 (move_it_in_display_line_to): Record prev_method and prev_pos
4640 immediately before the call to set_iterator_to_next. Fixes cursor
4641 motion in bidi-reordered lines with stretch glyphs and strings
4642 displayed in margins. (Bug#8133) (Bug#8867)
4643 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
4644 TO_CHARPOS.
4645 (pos_visible_p): Support positions in bidi-reordered lines.
4646 Save and restore bidi cache.
4647
4648 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
4649 (bidi_paragraph_info): Delete unused struct.
4650 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
4651 (bidi_cache_start): New variable.
4652 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
4653 to zero.
4654 (bidi_cache_fetch_state, bidi_cache_search)
4655 (bidi_cache_find_level_change, bidi_cache_iterator_state)
4656 (bidi_cache_find, bidi_peek_at_next_level)
4657 (bidi_level_of_next_char, bidi_find_other_level_edge)
4658 (bidi_move_to_visually_next): Compare cache index with
4659 bidi_cache_start rather than with zero.
4660 (bidi_fetch_char): Accept new argument STRING; all callers
4661 changed. Support iteration over a string. Support strings with
4662 display properties. Support unibyte strings. Fix the type of
4663 `len' according to what STRING_CHAR_AND_LENGTH expects.
4664 (bidi_paragraph_init, bidi_resolve_explicit_1)
4665 (bidi_resolve_explicit, bidi_resolve_weak)
4666 (bidi_level_of_next_char, bidi_move_to_visually_next):
4667 Support iteration over a string.
4668 (bidi_set_sor_type, bidi_resolve_explicit_1)
4669 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
4670 can now be zero (for strings); special values 0 and -1 were
4671 changed to -1 and -2, respectively.
4672 (bidi_char_at_pos): New function.
4673 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
4674 Call it instead of FETCH_MULTIBYTE_CHAR.
4675 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
4676 initialized to valid values.
4677 (bidi_init_it): Don't initialize charpos and bytepos with invalid
4678 values.
4679 (bidi_level_of_next_char): Allow the sentinel "position" to pass
4680 the test for valid cached positions. Fix the logic for looking up
4681 the sentinel state in the cache. GCPRO the Lisp string we are
4682 iterating.
4683 (bidi_push_it, bidi_pop_it): New functions.
4684 (bidi_initialize): Initialize the bidi cache start stack pointer.
4685 (bidi_cache_ensure_space): New function, refactored from part of
4686 bidi_cache_iterator_state. Don't assume the required size is just
4687 one BIDI_CACHE_CHUNK away.
4688 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
4689 (bidi_count_bytes, bidi_char_at_pos): New functions.
4690 (bidi_cache_search): Don't assume bidi_cache_last_idx is
4691 always valid if bidi_cache_idx is valid.
4692 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
4693 is valid if it's going to be used.
4694 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
4695 (bidi_cache_fetch_state, bidi_cache_search)
4696 (bidi_cache_find_level_change, bidi_cache_ensure_space)
4697 (bidi_cache_iterator_state, bidi_cache_find)
4698 (bidi_find_other_level_edge, bidi_cache_start_stack):
4699 All variables related to cache indices are now EMACS_INT.
4700
4701 * dispextern.h (struct bidi_string_data): New structure.
4702 (struct bidi_it): New member `string'. Make flag members be 1-bit
4703 fields, and put them last in the struct.
4704 (compute_display_string_pos, compute_display_string_end):
4705 Update prototypes.
4706 (bidi_push_it, bidi_pop_it): Add prototypes.
4707 (struct iterator_stack_entry): New members bidi_p,
4708 paragraph_embedding, and from_disp_prop_p.
4709 (struct it): Member bidi_p is now a bit field 1 bit wide.
4710 (bidi_shelve_cache, bidi_unshelve_cache):
4711 Declare prototypes.
4712
4713 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
4714 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
4715 and vector-like objects.
4716
4717 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
4718 cache around display iteration.
4719
4720 * window.c (Fwindow_end, window_scroll_pixel_based)
4721 (displayed_window_lines, Frecenter): Save and restore the bidi
4722 cache around display iteration.
4723
4724 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
4725
4726 * editfns.c (Fdelete_region): Clarify the use of the named
4727 parameters (bug#6788).
4728
4729 2011-07-14 Martin Rudalics <rudalics@gmx.at>
4730
4731 * indent.c (Fvertical_motion): Set and restore w->pointm when
4732 saving and restoring the window's buffer (Bug#9006).
4733
4734 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
4735
4736 * editfns.c (Fstring_to_char): Clarify just what is returned
4737 (bug#6576). Text by Eli Zaretskii.
4738
4739 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
4740
4741 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
4742
4743 2011-07-13 Eli Zaretskii <eliz@gnu.org>
4744
4745 * buffer.c (mmap_find): Fix a typo.
4746
4747 2011-07-13 Johan Bockgård <bojohan@gnu.org>
4748
4749 Fix execution of x selection hooks.
4750 * xselect.c (Qx_lost_selection_functions)
4751 (Qx_sent_selection_functions): New vars.
4752 (syms_of_xselect): DEFSYM them.
4753 (x_handle_selection_request): Pass Qx_sent_selection_functions
4754 rather than Vx_sent_selection_functions to Frun_hook_with_args.
4755 (x_handle_selection_clear,x_clear_frame_selections):
4756 Pass Qx_lost_selection_functions rather than
4757 Vx_lost_selection_functions to Frun_hook_with_args.
4758
4759 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
4760
4761 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
4762 The old code sometimes used this field without initializing it.
4763
4764 * alloc.c (gc_sweep): Don't read past end of array.
4765 In theory, the old code could also have corrupted Emacs internals,
4766 though it'd be very unlikely.
4767
4768 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
4769
4770 * character.c (Fcharacterp): Don't advertise optional ignored
4771 argument. (Bug#4026)
4772
4773 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
4774
4775 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
4776 key" (bug#4257).
4777
4778 * window.c (Fset_window_start): Doc fix (bug#4199).
4779 (Fset_window_hscroll): Ditto.
4780
4781 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
4782
4783 Fix minor new problems caught by GCC 4.6.1.
4784 * term.c (init_tty): Remove unused local.
4785 * xsettings.c (store_monospaced_changed): Define this function only
4786 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
4787 not used otherwise.
4788
4789 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
4790
4791 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
4792
4793 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4794
4795 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
4796 are the mini-buffer and the echo area (bug#3320).
4797
4798 * term.c (init_tty): Remove support for supdup, c10 and perq
4799 terminals, which are no longer supported (bug#1482).
4800
4801 2011-07-10 Johan Bockgård <bojohan@gnu.org>
4802
4803 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
4804
4805 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
4806
4807 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
4808 for non-popups (Bug#3642).
4809
4810 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
4811
4812 * alloc.c (reset_malloc_hooks): Protoize.
4813 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
4814 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
4815 * cm.c (losecursor): Likewise.
4816 * data.c (fmod): Likewise.
4817 * dispnew.c (swap_glyphs_in_rows): Likewise.
4818 * emacs.c (memory_warning_signal): Likewise.
4819 * floatfns.c (float_error): Likewise.
4820 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
4821 (otf_open, font_otf_capability, generate_otf_features)
4822 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
4823 Likewise.
4824 * image.c (pbm_read_file): Likewise.
4825 * indent.c (string_display_width): Likewise.
4826 * intervals.c (check_for_interval, search_for_interval)
4827 (inc_interval_count, count_intervals, root_interval)
4828 (adjust_intervals_for_insertion, make_new_interval): Likewise.
4829 * lread.c (defalias): Likewise.
4830 * ralloc.c (r_alloc_check): Likewise.
4831 * regex.c (set_image_of_range_1, set_image_of_range)
4832 (regex_grow_registers): Likewise.
4833 * sysdep.c (strerror): Likewise.
4834 * termcap.c (valid_filename_p, tprint, main): Likewise.
4835 * tparam.c (main): Likewise.
4836 * unexhp9k800.c (run_time_remap, save_data_space)
4837 (update_file_ptrs, read_header, write_header, calculate_checksum)
4838 (copy_file, copy_rest, display_header): Likewise.
4839 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
4840 Likewise.
4841 * xdisp.c (check_it): Likewise.
4842 * xfaces.c (register_color, unregister_color, unregister_colors):
4843 Likewise.
4844 * xfns.c (print_fontset_result): Likewise.
4845 * xrdb.c (member, fatal, main): Likewise.
4846
4847 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
4848
4849 Fix minor problems found by static checking (Bug#9031).
4850 * chartab.c (char_table_set_range, map_sub_char_table):
4851 Remove unused locals.
4852 (uniprop_table): Now static.
4853 * composite.c (_work_char): Remove unused static var.
4854
4855 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
4856
4857 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
4858
4859 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
4860
4861 * gtkutil.c (qttip_cb): Remove code without function.
4862
4863 2011-07-09 Eli Zaretskii <eliz@gnu.org>
4864
4865 * w32.c (pthread_sigmask): New stub.
4866
4867 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
4868
4869 Use pthread_sigmask, not sigprocmask (Bug#9010).
4870 sigprocmask is portable only for single-threaded applications, and
4871 Emacs can be multi-threaded when it uses GTK.
4872 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
4873 (LIBES): Use it.
4874 * callproc.c (Fcall_process):
4875 * process.c (create_process):
4876 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
4877 Use pthread_sigmask, not sigprocmask.
4878
4879 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4880
4881 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
4882 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
4883 wrong (Bug#8591).
4884
4885 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4886
4887 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
4888 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
4889 (xg_hide_tooltip): Fix comment.
4890
4891 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
4892 in registerServicesMenuSendTypes.
4893 (validRequestorForSendType): Don't check ns_return_types.
4894
4895 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
4896 ns_return_type.
4897
4898 2011-07-08 Jason Rumney <jasonr@gnu.org>
4899
4900 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
4901 SH_SHOW for hidden windows (Bug#5482).
4902
4903 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
4904 frame struct members of non-existent frames (Bug#6284).
4905
4906 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
4907
4908 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
4909 variable firstTime not needed on OSX >= 10.6.
4910 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
4911 >= 10.5. Use setKnobProportion, setDoubleValue.
4912
4913 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
4914 (MAC_OS_X_VERSION_10_5): Define if not defined.
4915 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
4916 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
4917 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
4918
4919 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
4920 cString and lossyCString on OSX >= 10.4
4921
4922 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4923 sizeToFit on OSX >= 10.2.
4924
4925 * nsimage.m (allocInitFromFile): Don't use deprecated method
4926 bestRepresentationForDevice on OSX >= 10.6.
4927
4928 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
4929 to avoid warning.
4930
4931 * emacs.c: Declare unexec_init_emacs_zone.
4932
4933 * nsgui.h: Fix compiler warning about gnulib redefining verify.
4934
4935 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
4936
4937 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
4938 on svcsMenu (Bug#8842).
4939
4940 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
4941 ns_return_types.
4942 (Fns_list_services): Just return Qnil on 10.6, code not working there.
4943
4944 * nsterm.m (QUTF8_STRING): Declare.
4945 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
4946 (validRequestorForSendType): Return type is (id).
4947 Change indexOfObjectIdenticalTo to indexOfObject.
4948 Check if we have local selection before returning self (Bug#8842).
4949 (writeSelectionToPasteboard): Put local selection into paste board
4950 if we have a local selection (Bug#8842).
4951 (syms_of_nsterm): DEFSYM QUTF8_STRING.
4952
4953 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
4954 (ns_get_local_selection): Declare.
4955
4956 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
4957
4958 * keymap.c (describe_map_tree): Don't insert a double newline at
4959 the end of the buffer (bug#1169) and return whether we inserted
4960 something.
4961
4962 * callint.c (Fcall_interactively): Change "reading args" to
4963 "providing args" to try to clarify what it does (bug#1010).
4964
4965 2011-07-07 Kenichi Handa <handa@m17n.org>
4966
4967 * composite.c (composition_compute_stop_pos): Ignore a static
4968 composition starting before CHARPOS (Bug#8915).
4969
4970 * xdisp.c (handle_composition_prop): Likewise.
4971
4972 2011-07-07 Eli Zaretskii <eliz@gnu.org>
4973
4974 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
4975 (Bug#9015)
4976
4977 2011-07-07 Kenichi Handa <handa@m17n.org>
4978
4979 * character.h (unicode_category_t): New enum type.
4980
4981 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
4982 (Qchar_code_property_table): New variable.
4983 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
4984 (UNIPROP_COMPRESSED_FORM_P): New macros.
4985 (char_table_ascii): Uncompress the compressed values.
4986 (sub_char_table_ref): New arg is_uniprop. Callers changed.
4987 Uncompress the compressed values.
4988 (sub_char_table_ref_and_range): Likewise.
4989 (char_table_ref_and_range): Uncompress the compressed values.
4990 (sub_char_table_set): New arg is_uniprop. Callers changed.
4991 Uncompress the compressed values.
4992 (sub_char_table_set_range): Args changed. Callers changed.
4993 (char_table_set_range): Adjuted for the above change.
4994 (map_sub_char_table): Delete args default_val and parent. Add arg
4995 top. Give decoded values to a Lisp function.
4996 (map_char_table): Adjust for the above change. Give decoded
4997 values to a Lisp function. Gcpro more variables.
4998 (uniprop_table_uncompress)
4999 (uniprop_decode_value_run_length): New functions.
5000 (uniprop_decoder, uniprop_decoder_count): New variables.
5001 (uniprop_get_decoder, uniprop_encode_value_character)
5002 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
5003 New functions.
5004 (uniprop_encoder, uniprop_encoder_count): New variables.
5005 (uniprop_get_encoder, uniprop_table)
5006 (Funicode_property_table_internal, Fget_unicode_property_internal)
5007 (Fput_unicode_property_internal): New functions.
5008 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
5009 Sunicode_property_table_internal, Sget_unicode_property_internal,
5010 and Sput_unicode_property_internal. Defvar_lisp
5011 char-code-property-alist.
5012
5013 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
5014 Vunicode_category_table.
5015
5016 * font.c (font_range): Adjust for the change of
5017 Vunicode_category_table.
5018
5019 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
5020
5021 * m/iris4d.h: Remove file, move contents ...
5022 * s/irix6-5.h: ... here.
5023
5024 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
5025
5026 Remove unportable assumption about struct layout (Bug#8884).
5027 * alloc.c (mark_buffer):
5028 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
5029 (clone_per_buffer_values): Don't assume that
5030 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
5031 This isn't true in general, and it's particularly not true
5032 if Emacs is configured with --with-wide-int.
5033 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
5034 New macros, used in the buffer.c change.
5035
5036 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
5037
5038 * xsettings.c: Use both GConf and GSettings if both are available.
5039 (store_config_changed_event): Add comment.
5040 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
5041 (store_tool_bar_style_changed): New functions.
5042 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
5043 (struct xsettings): Move font inside HAVE_XFT.
5044 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
5045 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
5046 Move inside HAVE_XFT.
5047 (something_changed_gsettingsCB): Rename from something_changedCB.
5048 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
5049 also.
5050 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5051 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
5052 (something_changed_gconfCB): Rename from something_changedCB.
5053 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
5054 (parse_settings): Move check for font inside HAVE_XFT.
5055 (read_settings, apply_xft_settings): Add comment.
5056 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
5057 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
5058 call store_font_name_changed.
5059 (xft_settings_event): Add comment.
5060 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
5061 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
5062 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
5063 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
5064 (xsettings_initialize): Call init_gsettings last.
5065 (xsettings_get_system_font, xsettings_get_system_normal_font):
5066 Add comment.
5067
5068 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
5069
5070 Random fixes. E.g., (random) never returned negative values.
5071 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
5072 subseconds part to the entropy, as that's a bit more random.
5073 Prefer signed to unsigned, since the signedness doesn't matter and
5074 in general we prefer signed. When given a limit, use a
5075 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
5076 latter isn't right if USE_2_TAGS_FOR_INTS.
5077 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
5078 not 0..VALMASK. Don't discard "excess" bits that random () returns.
5079
5080 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
5081
5082 * textprop.c (text_property_stickiness):
5083 Obey Vtext_property_default_nonsticky.
5084 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
5085 * w32fns.c (syms_of_w32fns):
5086 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
5087
5088 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5089
5090 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
5091 This is more efficient than Ffile_directory_p and avoids a minor race.
5092
5093 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
5094
5095 * buffer.c (Foverlay_put): Say what the return value is
5096 (bug#7835).
5097
5098 * fileio.c (barf_or_query_if_file_exists): Check first if the file
5099 is a directory before asking whether to use the file name
5100 (bug#7564).
5101 (barf_or_query_if_file_exists): Make the "File is a directory"
5102 error be more correct.
5103
5104 * fns.c (Frequire): Remove the mention of the .gz files, since
5105 that's installation-specific, but keep the mention of
5106 `get-load-suffixes'.
5107
5108 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
5109
5110 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
5111 Report string overflow if the output is too long.
5112
5113 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
5114
5115 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
5116 (syms_of_gnutls): Remove duplicate DEFSYM for
5117 Qgnutls_bootprop_verify_hostname_error, an error for
5118 Qgnutls_bootprop_verify_error (which is no longer used).
5119
5120 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
5121 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
5122 Also (re)move comments that are misplaced or no longer relevant.
5123
5124 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5125
5126 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
5127
5128 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
5129
5130 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
5131 and background color parameters if they have been changed.
5132
5133 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5134
5135 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
5136
5137 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 * xsettings.c (SYSTEM_FONT): Define only when used.
5140 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
5141
5142 * keymap.c (access_keymap_1): Now static.
5143
5144 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
5145
5146 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
5147 leave any prefix arg for the up event (Bug#1586).
5148
5149 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
5150
5151 * lread.c (syms_of_lread): Mention single symbols defined by
5152 `defvar' or `defconst' (bug#7154).
5153
5154 * fns.c (Frequire): Mention .el.gz files (bug#7314).
5155 (Frequire): Mention get-load-suffixes.
5156
5157 2011-07-02 Martin Rudalics <rudalics@gmx.at>
5158
5159 * window.h (window): Remove clone_number slot.
5160 * window.c (Fwindow_clone_number, Fset_window_clone_number):
5161 Remove.
5162 (make_parent_window, make_window, saved_window)
5163 (Fset_window_configuration, save_window_save): Don't deal with
5164 clone numbers.
5165 * buffer.c (Qclone_number): Remove declaration.
5166 (sort_overlays, overlay_strings): Don't deal with clone numbers.
5167
5168 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
5169
5170 Add multiple inheritance to keymaps.
5171 * keymap.c (Fmake_composed_keymap): New function.
5172 (Fset_keymap_parent): Simplify.
5173 (fix_submap_inheritance): Remove.
5174 (access_keymap_1): New function extracted from access_keymap to handle
5175 embedded parents and handle lists of maps.
5176 (access_keymap): Use it.
5177 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
5178 (Fcopy_keymap): Handle embedded parents.
5179 (Fcommand_remapping, define_as_prefix): Simplify.
5180 (Fkey_binding): Simplify.
5181 (syms_of_keymap): Move minibuffer-local-completion-map,
5182 minibuffer-local-filename-completion-map,
5183 minibuffer-local-must-match-map, and
5184 minibuffer-local-filename-must-match-map to Elisp.
5185 (syms_of_keymap): Defsubr make-composed-keymap.
5186 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
5187 (parse_menu_item): Trivial simplification.
5188
5189 2011-07-01 Glenn Morris <rgm@gnu.org>
5190
5191 * Makefile.in (SETTINGS_LIBS): Fix typo.
5192
5193 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
5194
5195 * coding.c (Fencode_coding_string): Record the last coding system
5196 used, as the function doc string says (bug#8738).
5197
5198 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
5199
5200 * xsettings.c (store_monospaced_changed): Take new font as arg and
5201 check for change against current_mono_font.
5202 (EMACS_TYPE_SETTINGS): Remove this and related defines.
5203 (emacs_settings_constructor, emacs_settings_get_property)
5204 (emacs_settings_set_property, emacs_settings_class_init)
5205 (emacs_settings_init, gsettings_obj): Remove.
5206 (something_changedCB): New function for HAVE_GSETTINGS.
5207 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
5208 with value as argument.
5209 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
5210 g_settings_new (Bug#8967). Do not create gsettings_obj.
5211 Remove calls to g_settings_bind. Connect something_changedCB to
5212 "changed".
5213
5214 * xgselect.c: Add defined (HAVE_GSETTINGS).
5215 (xgselect_initialize): Ditto.
5216
5217 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
5218 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
5219 xg_select.
5220
5221 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
5222
5223 * eval.c (struct backtrace): Simplify and port the data structure.
5224 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
5225 signed bit field, as this assumption is not portable and it makes
5226 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
5227 "char debug_on_exit : 1" as this is not portable either; instead,
5228 use the portable "unsigned int debug_on_exit : 1". Remove unused
5229 member evalargs. Remove obsolete comments about cc bombing out.
5230
5231 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
5232
5233 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
5234 Let HAVE_GSETTINGS override HAVE_GCONF.
5235 (store_monospaced_changed): New function.
5236 (EMACS_SETTINGS): A new type derived from GObject to handle
5237 GSettings notifications.
5238 (emacs_settings_constructor, emacs_settings_get_property)
5239 (emacs_settings_set_property, emacs_settings_class_init):
5240 New functions.
5241 (gsettings_client, gsettings_obj): New variables.
5242 (GSETTINGS_SCHEMA): New define.
5243 (something_changedCB): Call store_monospaced_changed.
5244 (init_gsettings): New function.
5245 (xsettings_initialize): Call init_gsettings.
5246 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
5247 to NULL.
5248
5249 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
5250 GCONF_CFLAGS/LIBS.
5251
5252 2011-06-29 Martin Rudalics <rudalics@gmx.at>
5253
5254 * window.c (resize_root_window, grow_mini_window)
5255 (shrink_mini_window): Rename Qresize_root_window to
5256 Qwindow_resize_root_window and Qresize_root_window_vertically to
5257 Qwindow_resize_root_window_vertically.
5258
5259 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
5260
5261 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
5262
5263 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
5264
5265 * makefile.w32-in: Redesign dependencies so they reflect more
5266 clearly which files are directly included by each source file,
5267 and not through other includes.
5268
5269 2011-06-27 Martin Rudalics <rudalics@gmx.at>
5270
5271 * buffer.c (Qclone_number): Declare static and DEFSYM it.
5272 (sort_overlays, overlay_strings): When an overlay's clone number
5273 matches the window's clone number process the overlay even if
5274 the overlay's window property doesn't match the current window.
5275
5276 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
5277 (Fwindow_hchild): Rename to Fwindow_left_child.
5278 (Fwindow_next): Rename to Fwindow_next_sibling.
5279 (Fwindow_prev): Rename to Fwindow_prev_sibling.
5280 (resize_window_check): Rename to window_resize_check.
5281 (resize_window_apply): Rename to window_resize_apply.
5282 (Fresize_window_apply): Rename to Fwindow_resize_apply.
5283 (Fdelete_other_windows_internal, resize_frame_windows)
5284 (Fsplit_window_internal, Fdelete_window_internal)
5285 (grow_mini_window, shrink_mini_window)
5286 (Fresize_mini_window_internal): Fix callers accordingly.
5287
5288 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
5289
5290 * emacsgtkfixed.h: State that this is only used with Gtk+3.
5291 (emacs_fixed_set_min_size): Remove.
5292 (emacs_fixed_new): Take frame as argument.
5293
5294 * emacsgtkfixed.c: State that this is only used with Gtk+3.
5295 (_EmacsFixedPrivate): Remove minwidth/height.
5296 Add struct frame *f.
5297 (emacs_fixed_init): Initialize priv->f.
5298 (get_parent_class, emacs_fixed_set_min_size): Remove.
5299 (emacs_fixed_new): Set priv->f to argument.
5300 (emacs_fixed_get_preferred_width)
5301 (emacs_fixed_get_preferred_height): Use min_width/height from
5302 frames size_hint to set minimum and natural (Bug#8919).
5303 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
5304 and use min_width/height from frames size_hint to set
5305 min_width/height (Bug#8919).
5306
5307 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
5308 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
5309 Fix indentation.
5310
5311 2011-06-26 Eli Zaretskii <eliz@gnu.org>
5312
5313 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
5314 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
5315 called at ZV.
5316
5317 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
5318
5319 * process.c (wait_reading_process_output): Bypass select if
5320 waiting for a cell while ignoring keyboard input, and input is
5321 pending. Suggested by Jan Djärv (Bug#8869).
5322
5323 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
5324
5325 Use gnulib's dup2 module instead of rolling our own.
5326 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
5327
5328 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5329
5330 * dispnew.c (scrolling_window): Before scrolling, turn off a
5331 mouse-highlight in the window being scrolled.
5332
5333 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
5334
5335 Move DEFSYM to lisp.h and use everywhere.
5336
5337 * character.h (DEFSYM): Move declaration...
5338 * lisp.h (DEFSYM): ...here.
5339
5340 * gnutls.c:
5341 * minibuf.c:
5342 * w32menu.c:
5343 * w32proc.c:
5344 * w32select.c: Don't include character.h.
5345
5346 * alloc.c (syms_of_alloc):
5347 * buffer.c (syms_of_buffer):
5348 * bytecode.c (syms_of_bytecode):
5349 * callint.c (syms_of_callint):
5350 * casefiddle.c (syms_of_casefiddle):
5351 * casetab.c (init_casetab_once):
5352 * category.c (init_category_once, syms_of_category):
5353 * ccl.c (syms_of_ccl):
5354 * cmds.c (syms_of_cmds):
5355 * composite.c (syms_of_composite):
5356 * dbusbind.c (syms_of_dbusbind):
5357 * dired.c (syms_of_dired):
5358 * dispnew.c (syms_of_display):
5359 * doc.c (syms_of_doc):
5360 * editfns.c (syms_of_editfns):
5361 * emacs.c (syms_of_emacs):
5362 * eval.c (syms_of_eval):
5363 * fileio.c (syms_of_fileio):
5364 * fns.c (syms_of_fns):
5365 * frame.c (syms_of_frame):
5366 * fringe.c (syms_of_fringe):
5367 * insdel.c (syms_of_insdel):
5368 * keymap.c (syms_of_keymap):
5369 * lread.c (init_obarray, syms_of_lread):
5370 * macros.c (syms_of_macros):
5371 * msdos.c (syms_of_msdos):
5372 * print.c (syms_of_print):
5373 * process.c (syms_of_process):
5374 * search.c (syms_of_search):
5375 * sound.c (syms_of_sound):
5376 * syntax.c (init_syntax_once, syms_of_syntax):
5377 * terminal.c (syms_of_terminal):
5378 * textprop.c (syms_of_textprop):
5379 * undo.c (syms_of_undo):
5380 * w32.c (globals_of_w32):
5381 * window.c (syms_of_window):
5382 * xdisp.c (syms_of_xdisp):
5383 * xfaces.c (syms_of_xfaces):
5384 * xfns.c (syms_of_xfns):
5385 * xmenu.c (syms_of_xmenu):
5386 * xsettings.c (syms_of_xsettings):
5387 * xterm.c (syms_of_xterm): Use DEFSYM.
5388
5389 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
5390
5391 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
5392
5393 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
5394
5395 Integer and buffer overflow fixes (Bug#8873).
5396
5397 * print.c (printchar, strout): Check for string overflow.
5398 (PRINTPREPARE, printchar, strout):
5399 Don't set size unless allocation succeeds.
5400
5401 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
5402 for sizes. Check for string overflow more accurately.
5403 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
5404
5405 * macros.c: Integer and buffer overflow fixes.
5406 * keyboard.h (struct keyboard.kbd_macro_bufsize):
5407 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
5408 Use ptrdiff_t, not int, for sizes.
5409 Don't increment bufsize until after realloc succeeds.
5410 Check for size-calculation overflow.
5411 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
5412
5413 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
5414
5415 * lread.c: Integer overflow fixes.
5416 (read_integer): Radix is now EMACS_INT, not int,
5417 to improve quality of diagnostics for out-of-range radices.
5418 Calculate buffer size correctly for out-of-range radices.
5419 (read1): Check for integer overflow in radices, and in
5420 read-circle numbers.
5421 (read_escape): Avoid int overflow.
5422 (Fload, openp, read_buffer_size, read1)
5423 (substitute_object_recurse, read_vector, read_list, map_obarray):
5424 Use ptrdiff_t, not int, for sizes.
5425 (read1): Use EMACS_INT, not int, for sizes.
5426 Check for size overflow.
5427
5428 * image.c (cache_image): Check for size arithmetic overflow.
5429
5430 * lread.c: Integer overflow issues.
5431 (saved_doc_string_size, saved_doc_string_length)
5432 (prev_saved_doc_string_size, prev_saved_doc_string_length):
5433 Now ptrdiff_t, not int.
5434 (read1): Don't assume doc string length fits in int. Check for
5435 out-of-range doc string lengths.
5436 (read_list): Don't assume file position fits in int.
5437 (read_escape): Check for hex character overflow.
5438
5439 2011-06-22 Leo Liu <sdl.web@gmail.com>
5440
5441 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
5442 Move to minibuffer.el.
5443
5444 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5445
5446 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
5447 The following patches are for when GLYPH_DEBUG && !XASSERT.
5448 * dispextern.h (trace_redisplay_p, dump_glyph_string):
5449 * dispnew.c (flush_stdout):
5450 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
5451 Mark as externally visible.
5452 * dispnew.c (check_window_matrix_pointers): Now static.
5453 * dispnew.c (window_to_frame_vpos):
5454 * xfns.c (unwind_create_frame):
5455 * xterm.c (x_check_font): Remove unused local.
5456 * scroll.c (CHECK_BOUNDS):
5457 * xfaces.c (cache_fache): Rename local to avoid shadowing.
5458 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
5459 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
5460 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
5461 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
5462 Now static.
5463 (debug_method_add): Use va_list and vsprintf rather than relying
5464 on undefined behavior with wrong number of arguments.
5465 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
5466 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
5467 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
5468 since we're not interested in debugging glyphs with old libraries.
5469 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
5470 GCC 4.6.0's static checking.
5471
5472 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
5473
5474 Integer overflow and signedness fixes (Bug#8873).
5475 A few related buffer overrun fixes, too.
5476
5477 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
5478
5479 * dispextern.h (struct face.stipple):
5480 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
5481 (x_bitmap_mask, x_allocate_bitmap_record)
5482 (x_create_bitmap_from_data, x_create_bitmap_from_file)
5483 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
5484 (x_create_bitmap_from_xpm_data):
5485 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
5486 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
5487 (.bitmaps_last):
5488 * xfaces.c (load_pixmap):
5489 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
5490 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
5491 (.bitmaps_last, struct x_output.icon_bitmap):
5492 Use ptrdiff_t, not int, for bitmap indexes.
5493 (x_allocate_bitmap_record): Check for size overflow.
5494 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
5495
5496 Use ptrdiff_t, not int, for overlay counts.
5497 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
5498 * editfns.c (overlays_around, get_pos_property):
5499 * textprop.c (get_char_property_and_overlay):
5500 * xdisp.c (next_overlay_change, note_mouse_highlight):
5501 * xfaces.c (face_at_buffer_position):
5502 * buffer.c (OVERLAY_COUNT_MAX): New macro.
5503 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
5504 (Fnext_overlay_change, Fprevious_overlay_change)
5505 (mouse_face_overlay_overlaps, Foverlays_in):
5506 Use ptrdiff_t, not int, for sizes.
5507 (overlays_at, overlays_in): Check for size-calculation overflow.
5508
5509 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
5510
5511 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
5512 (x_session_initialize): Do not assume string length fits in int.
5513
5514 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
5515 This is unlikely, but can occur if DPI is outlandish.
5516
5517 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
5518 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
5519
5520 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
5521 * xrdb.c (magic_file_p, search_magic_path):
5522 Omit last arg SUFFIX; it was always 0. All callers changed.
5523 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
5524
5525 * xfont.c (xfont_match): Avoid need for strlen.
5526
5527 * xfns.c: Don't assume strlen fits in int.
5528 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
5529
5530 * xdisp.c (message_log_check_duplicate): Return intmax_t,
5531 not unsigned long, as we prefer signed integers. All callers changed.
5532 Detect integer overflow in repeat count.
5533 (message_dolog): Don't assume print length fits in 39 bytes.
5534 (display_mode_element): Don't assume strlen fits in int.
5535
5536 * termcap.c: Don't assume sizes fit in int and never overflow.
5537 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
5538 (gobble_line): Check for size-calculation overflow.
5539
5540 * minibuf.c (Fread_buffer):
5541 * lread.c (intern, intern_c_string):
5542 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
5543 Don't assume string length fits in int.
5544
5545 * keyboard.c (parse_tool_bar_item):
5546 * gtkutil.c (style_changed_cb): Avoid need for strlen.
5547
5548 * font.c: Don't assume string length fits in int.
5549 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
5550 Use ptrdiff_t, not int.
5551 (font_intern_prop): Don't assume string length fits in int.
5552 Don't assume integer property fits in fixnum.
5553 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
5554
5555 * filelock.c: Fix some buffer overrun and integer overflow issues.
5556 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
5557 Reformulate so as not to need the command string.
5558 Invoke gzip -cd rather than gunzip, as it's more portable.
5559 (lock_info_type, lock_file_1, lock_file):
5560 Don't assume pid_t and time_t fit in unsigned long.
5561 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
5562 (current_lock_owner): Prefer signed type for sizes.
5563 Use memcpy, not strncpy, where memcpy is what is really wanted.
5564 Don't assume (via atoi) that time_t and pid_t fit in int.
5565 Check for time_t and/or pid_t out of range, e.g., via a network share.
5566 Don't alloca where an auto var works fine.
5567
5568 * fileio.c: Fix some integer overflow issues.
5569 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
5570 Don't assume string length fits in int.
5571 (directory_file_name): Don't assume string length fits in long.
5572 (make_temp_name): Don't assume pid fits in int, or that its print
5573 length is less than 20.
5574
5575 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
5576
5577 * coding.c (make_subsidiaries): Don't assume string length fits in int.
5578
5579 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
5580
5581 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
5582 We prefer signed integers, even for size calculations.
5583
5584 * emacs.c: Don't assume string length fits in 'int'.
5585 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
5586 (main): Don't invoke strlen when not needed.
5587
5588 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
5589 (XD_DEBUG_MESSAGE): Don't waste a byte.
5590
5591 * callproc.c (getenv_internal_1, getenv_internal)
5592 (Fgetenv_internal):
5593 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
5594
5595 * lread.c (invalid_syntax): Omit length argument.
5596 All uses changed. This doesn't fix a bug, but it simplifies the
5597 code away from its former Hollerith-constant appearance, and it's
5598 one less 'int' to worry about when looking at integer-overflow issues.
5599 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
5600
5601 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
5602 This didn't break anything, but it didn't help either.
5603 It's confusing to put a bogus integer in a place where the actual
5604 value does not matter.
5605 (LIST_END_P): Remove unused macro and its bogus comment.
5606 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
5607
5608 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
5609 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
5610 implementation.
5611 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
5612 We prefer signed types, and the value cannot exceed the EMACS_INT
5613 range anyway (because otherwise the length would not be representable).
5614 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
5615 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
5616 This avoids a GCC warning when WIDE_EMACS_INT.
5617
5618 * indent.c (sane_tab_width): New function.
5619 (current_column, scan_for_column, Findent_to, position_indentation)
5620 (compute_motion): Use it. This is just for clarity.
5621 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
5622
5623 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
5624
5625 * lisp.h (lint_assume): New macro.
5626 * composite.c (composition_gstring_put_cache):
5627 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
5628
5629 * editfns.c, insdel.c:
5630 Omit unnecessary forward decls, to simplify future changes.
5631
5632 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
5633
5634 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
5635
5636 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
5637 Use much-faster test for byte-length change.
5638 Don't assume string byte-length fits in 'int'.
5639 Check that character arg fits in 'int'.
5640 (mapcar1): Declare byte as byte, for clarity.
5641
5642 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
5643
5644 * fns.c (concat): Catch string overflow earlier.
5645 Do not rely on integer wraparound.
5646
5647 * dispextern.h (struct it.overlay_strings_charpos)
5648 (struct it.selective): Now EMACS_INT, not int.
5649 * xdisp.c (forward_to_next_line_start)
5650 (back_to_previous_visible_line_start)
5651 (reseat_at_next_visible_line_start, next_element_from_buffer):
5652 Don't arbitrarily truncate the value of 'selective' to int.
5653
5654 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
5655
5656 * composite.c: Don't truncate sizes to 'int'.
5657 (composition_gstring_p, composition_reseat_it)
5658 (composition_adjust_point): Use EMACS_INT, not int.
5659 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
5660 not EMACS_UINT, for indexes.
5661
5662 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
5663
5664 * buffer.c: Include <verify.h>.
5665 (struct sortvec.priority, struct sortstr.priority):
5666 Now EMACS_INT, not int.
5667 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
5668 (struct sortstr.size, record_overlay_string)
5669 (struct sortstrlist.size, struct sortlist.used):
5670 Don't truncate size to int.
5671 (record_overlay_string): Check for size-calculation overflow.
5672 (init_buffer_once): Check at compile-time, not run-time.
5673
5674 2011-06-22 Jim Meyering <meyering@redhat.com>
5675
5676 Don't leak an XBM-image-sized buffer
5677 * image.c (xbm_load): Free the image buffer after using it.
5678
5679 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
5680
5681 Port to Sun C.
5682 * composite.c (find_automatic_composition): Omit needless 'return 0;'
5683 that Sun C diagnosed.
5684 * fns.c (secure_hash): Fix pointer signedness issue.
5685 * intervals.c (static_offset_intervals): New function.
5686 (offset_intervals): Use it.
5687
5688 2011-06-21 Leo Liu <sdl.web@gmail.com>
5689
5690 * deps.mk (fns.o):
5691 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
5692 sha512.h.
5693
5694 * fns.c (secure_hash): Rename from crypto_hash_function and change
5695 the first arg to accept symbols.
5696 (Fsecure_hash): New primitive.
5697 (syms_of_fns): New symbols.
5698
5699 2011-06-20 Deniz Dogan <deniz@dogan.se>
5700
5701 * process.c (Fset_process_buffer): Clarify return value in
5702 docstring.
5703
5704 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
5705
5706 * dispnew.c (add_window_display_history): Use BVAR.
5707
5708 * xdisp.c (debug_method_add): Use BVAR.
5709 (check_window_end, dump_glyph_matrix, dump_glyph)
5710 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
5711
5712 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
5713 Likewise.
5714
5715 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
5716 check till after the cache is created in init_frame_faces.
5717
5718 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
5719
5720 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
5721
5722 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
5723
5724 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
5725 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
5726 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
5727
5728 Improve buffer-overflow checking (Bug#8873).
5729 * fileio.c (Finsert_file_contents):
5730 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
5731 Remove the old (too-loose) buffer overflow checks.
5732 They weren't needed, since make_gap checks for buffer overflow.
5733 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
5734 The old code merely checked for Emacs fixnum overflow, and relied
5735 on undefined (wraparound) behavior. The new code avoids undefined
5736 behavior, and also checks for ptrdiff_t and/or size_t overflow.
5737
5738 * editfns.c (Finsert_char): Don't dump core with very negative counts.
5739 Tune. Don't use wider integers than needed. Don't use alloca.
5740 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
5741
5742 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
5743
5744 * insdel.c, lisp.h (buffer_overflow): New function.
5745 (insert_from_buffer_1, replace_range, replace_range_2):
5746 * insdel.c (make_gap_larger):
5747 * editfns.c (Finsert_char):
5748 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
5749
5750 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
5751
5752 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
5753
5754 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
5755
5756 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
5757 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
5758
5759 * fileio.c: Don't assume EMACS_INT fits in off_t.
5760 (emacs_lseek): New static function.
5761 (Finsert_file_contents, Fwrite_region): Use it.
5762 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
5763
5764 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
5765
5766 * fns.c: Don't overflow int when computing a list length.
5767 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
5768 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
5769 truncation on 64-bit hosts. Check for QUIT every
5770 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
5771 faster and is responsive enough.
5772 (Flength): Report an error instead of overflowing an integer.
5773 (Fsafe_length): Return a float if the value is not representable
5774 as a fixnum. This shouldn't happen except in contrived situations.
5775 (Fnthcdr, Fsort): Don't assume list length fits in int.
5776 (Fcopy_sequence): Don't assume vector length fits in int.
5777
5778 * alloc.c: Check that resized vectors' lengths fit in fixnums.
5779 (header_size, word_size): New constants.
5780 (allocate_vectorlike): Don't check size overflow here.
5781 (allocate_vector): Check it here instead, since this is the only
5782 caller of allocate_vectorlike that could cause overflow.
5783 Check that the new vector's length is representable as a fixnum.
5784
5785 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
5786 The previous code was bogus. For example, next_almost_prime (32)
5787 returned 39, which is undesirable as it is a multiple of 3; and
5788 next_almost_prime (24) returned 25, which is a multiple of 5 so
5789 why was the code bothering to check for multiples of 7?
5790
5791 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
5792
5793 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
5794
5795 Variadic C functions now count arguments with ptrdiff_t.
5796 This partly undoes my 2011-03-30 change, which replaced int with size_t.
5797 Back then I didn't know that the Emacs coding style prefers signed int.
5798 Also, in the meantime I found a few more instances where arguments
5799 were being counted with int, which may truncate counts on 64-bit
5800 machines, or EMACS_INT, which may be unnecessarily wide.
5801 * lisp.h (struct Lisp_Subr.function.aMANY)
5802 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
5803 Arg counts are now ptrdiff_t, not size_t.
5804 All variadic functions and their callers changed accordingly.
5805 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
5806 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
5807 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
5808 * callint.c (Fcall_interactively): Check arg count for overflow,
5809 to avoid potential buffer overrun. Use signed char, not 'int',
5810 for 'varies' array, so that we needn't bother to check its size
5811 calculation for overflow.
5812 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
5813 * eval.c (apply_lambda):
5814 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
5815 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
5816 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
5817
5818 * callint.c (Fcall_interactively): Don't use index var as event count.
5819
5820 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
5821 * mem-limits.h (SIZE): Remove; no longer used.
5822
5823 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5824
5825 Remove unnecessary casts.
5826 * xterm.c (x_term_init):
5827 * xfns.c (x_set_border_pixel):
5828 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
5829 These aren't needed now that we assume ANSI C.
5830
5831 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
5832 It's more likely to cause problems (due to unsigned overflow)
5833 than to cure them.
5834
5835 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
5836
5837 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
5838
5839 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
5840
5841 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
5842
5843 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
5844
5845 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
5846
5847 GLYPH_CODE_FACE returns EMACS_INT, not int.
5848 * dispextern.h (merge_faces):
5849 * xfaces.c (merge_faces):
5850 * xdisp.c (get_next_display_element, next_element_from_display_vector):
5851 Don't assume EMACS_INT fits in int.
5852
5853 * character.h (CHAR_VALID_P): Remove unused parameter.
5854 * fontset.c, lisp.h, xdisp.c: All uses changed.
5855
5856 * editfns.c (Ftranslate_region_internal): Omit redundant test.
5857
5858 * fns.c (concat): Minor tuning based on overflow analysis.
5859 This doesn't fix any bugs. Use int to hold character, instead
5860 of constantly refetching from Emacs object. Use XFASTINT, not
5861 XINT, for value known to be a character. Don't bother comparing
5862 a single byte to 0400, as it's always less.
5863
5864 * floatfns.c (Fexpt):
5865 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
5866
5867 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
5868 for characters.
5869
5870 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
5871
5872 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
5873 Without this fix, on a 64-bit host (aset S 0 4294967386) would
5874 incorrectly succeed when S was a string, because 4294967386 was
5875 truncated before it was used.
5876
5877 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
5878 Otherwise, an out-of-range integer could cause undefined behavior
5879 on a 64-bit host.
5880
5881 * composite.c: Use int, not EMACS_INT, for characters.
5882 (fill_gstring_body, composition_compute_stop_pos): Use int, not
5883 EMACS_INT, for values that are known to be in character range.
5884 This doesn't fix any bugs but is the usual style inside Emacs and
5885 may generate better code on 32-bit machines.
5886
5887 Make sure a 64-bit char is never passed to ENCODE_CHAR.
5888 This is for reasons similar to the recent CHAR_STRING fix.
5889 * charset.c (Fencode_char): Check that character arg is actually
5890 a character. Pass an int to ENCODE_CHAR.
5891 * charset.h (ENCODE_CHAR): Verify that the character argument is no
5892 wider than 'int', as a compile-time check to prevent future regressions
5893 in this area.
5894
5895 * character.c (char_string): Remove unnecessary casts.
5896
5897 Make sure a 64-bit char is never passed to CHAR_STRING.
5898 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
5899 by silently ignoring the top 32 bits, allowing some values
5900 that were far too large to be valid characters.
5901 * character.h: Include <verify.h>.
5902 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
5903 arguments are no wider than unsigned, as a compile-time check
5904 to prevent future regressions in this area.
5905 * data.c (Faset):
5906 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
5907 (Fsubst_char_in_region):
5908 * fns.c (concat):
5909 * xdisp.c (decode_mode_spec_coding):
5910 Adjust to CHAR_STRING's new requirement.
5911 * editfns.c (Finsert_char, Fsubst_char_in_region):
5912 * fns.c (concat): Check that character args are actually
5913 characters. Without this test, these functions did the wrong
5914 thing with wildly out-of-range values on 64-bit hosts.
5915
5916 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
5917 These casts should not be needed on 32-bit hosts, either.
5918 * keyboard.c (read_char):
5919 * lread.c (Fload): Remove casts to unsigned.
5920
5921 * lisp.h (UNSIGNED_CMP): New macro.
5922 This fixes comparison bugs on 64-bit hosts.
5923 (ASCII_CHAR_P): Use it.
5924 * casefiddle.c (casify_object):
5925 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
5926 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
5927 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
5928 * dispextern.h (FACE_FROM_ID):
5929 * keyboard.c (read_char): Use UNSIGNED_CMP.
5930
5931 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
5932 not to EMACS_INT, to avoid GCC warning.
5933
5934 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
5935
5936 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
5937 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
5938 isn't needed on 32-bit machines.
5939
5940 * buffer.c (Fgenerate_new_buffer_name):
5941 Use EMACS_INT for count, not int.
5942 (advance_to_char_boundary): Return EMACS_INT, not int.
5943
5944 * data.c (Qcompiled_function): Now static.
5945
5946 * window.c (window_body_lines): Now static.
5947
5948 * image.c (gif_load): Rename local to avoid shadowing.
5949
5950 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
5951 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
5952 * alloc.c (make_save_value): Integer argument is now of type
5953 ptrdiff_t, not int.
5954 (mark_object): Use ptrdiff_t, not int.
5955 * lisp.h (pD): New macro.
5956 * print.c (print_object): Use it.
5957
5958 * alloc.c: Use EMACS_INT, not int, to count objects.
5959 (total_conses, total_markers, total_symbols, total_vector_size)
5960 (total_free_conses, total_free_markers, total_free_symbols)
5961 (total_free_floats, total_floats, total_free_intervals)
5962 (total_intervals, total_strings, total_free_strings):
5963 Now EMACS_INT, not int. All uses changed.
5964 (Fgarbage_collect): Compute overall total using a double, so that
5965 integer overflow is less likely to be a problem. Check for overflow
5966 when converting back to an integer.
5967 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
5968 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
5969 These were 'int' variables that could overflow on 64-bit hosts;
5970 they were never used, so remove them instead of repairing them.
5971 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
5972 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
5973 Previously, this ceilinged at INT_MAX, but that doesn't work on
5974 64-bit machines.
5975 (allocate_pseudovector): Don't use EMACS_INT when int would do.
5976
5977 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
5978 (allocate_vectorlike): Check for ptrdiff_t overflow.
5979 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
5980 when a (possibly-narrower) signed value would do just as well.
5981 We prefer using signed arithmetic, to avoid comparison confusion.
5982
5983 * alloc.c: Catch some string size overflows that we were missing.
5984 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
5985 for convenience in STRING_BYTES_MAX.
5986 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
5987 The definition here is exact; the one in lisp.h was approximate.
5988 (allocate_string_data): Check for string overflow. This catches
5989 some instances we weren't catching before. Also, it catches
5990 size_t overflow on (unusual) hosts where SIZE_MAX <= min
5991 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
5992 and ptrdiff_t and EMACS_INT are both 64 bits.
5993
5994 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
5995 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
5996 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
5997
5998 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
5999
6000 * alloc.c (Fmake_string): Check for out-of-range init.
6001
6002 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
6003
6004 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
6005
6006 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
6007
6008 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
6009 xg_get_default_scrollbar_width.
6010
6011 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
6012 (int_gtk_range_get_value): Move to the scroll bar part of the file.
6013 (style_changed_cb): Call update_theme_scrollbar_width and call
6014 x_set_scroll_bar_default_width and xg_frame_set_char_size for
6015 all frames (Bug#8505).
6016 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
6017 Call gtk_window_set_resizable if HAVE_GTK3.
6018 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
6019 and height if HAVE_GTK3 (Bug#8505).
6020 (scroll_bar_width_for_theme): New variable.
6021 (update_theme_scrollbar_width): New function.
6022 (xg_get_default_scrollbar_width): Move code to
6023 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
6024 (xg_initialize): Call update_theme_scrollbar_width.
6025
6026 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
6027
6028 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
6029
6030 2011-06-12 Martin Rudalics <rudalics@gmx.at>
6031
6032 * frame.c (make_frame): Call other_buffer_safely instead of
6033 other_buffer.
6034
6035 * window.c (temp_output_buffer_show): Call display_buffer with
6036 second argument Vtemp_buffer_show_specifiers and reset latter
6037 immediately after the call.
6038 (Vtemp_buffer_show_specifiers): New variable.
6039 (auto_window_vscroll_p, next_screen_context_lines)
6040 (Vscroll_preserve_screen_position): Remove leading asterisks from
6041 doc-strings.
6042
6043 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
6044
6045 Fix minor problems found by GCC 4.6.0 static checking.
6046 * buffer.c (Qclone_number): Remove for now, as it's unused.
6047 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
6048 (record_buffer): Remove unused local.
6049 * frame.c (other_visible_frames, frame_buffer_list): Now static.
6050 (set_frame_buffer_list): Remove; unused.
6051 * frame.h (other_visible_frames): Remove decl.
6052 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
6053 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
6054 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
6055 if HAVE_GPM.
6056 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
6057 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
6058 Define only if HAVE_GPM.
6059 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
6060 (update_hints_inhibit): Remove; never set. All uses removed.
6061 * widgetprv.h (emacsFrameClassRec): Remove decl.
6062 * window.c (delete_deletable_window): Now returns void, since it
6063 wasn't returning anything.
6064 (compare_window_configurations): Remove unused locals.
6065 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
6066 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
6067 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
6068 the same widths as pointers. This follows up on the 2011-05-06 patch.
6069 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
6070 * xterm.h: Likewise.
6071 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
6072
6073 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
6074
6075 * makefile.w32-in: Update dependencies.
6076 (LISP_H): Add lib/intprops.h.
6077
6078 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
6079
6080 * image.c (gif_load): Add animation frame delay to the metadata.
6081 (syms_of_image): Use DEFSYM. New symbol `delay'.
6082
6083 2011-06-11 Martin Rudalics <rudalics@gmx.at>
6084
6085 * window.c (delete_deletable_window): Re-add.
6086 (Fset_window_configuration): Rewrite to handle dead buffers and
6087 consequently deletable windows.
6088 (window_tree, Fwindow_tree): Remove. Supply functionality in
6089 window.el.
6090 (compare_window_configurations): Simplify code.
6091
6092 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
6093
6094 * image.c (imagemagick_load_image): Fix type mismatch.
6095 (Fimagemagick_types): Likewise.
6096
6097 * window.h (replace_buffer_in_windows): Declare.
6098
6099 2011-06-11 Martin Rudalics <rudalics@gmx.at>
6100
6101 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
6102 Qclone_number. Remove external declaration of Qdelete_window.
6103 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
6104 code.
6105 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
6106 Run Qbuffer_list_update_hook if allowed.
6107 (Fother_buffer): Rewrite doc-string. Major rewrite for new
6108 buffer list implementation.
6109 (other_buffer_safely): New function.
6110 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
6111 calls to replace_buffer_in_windows and
6112 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
6113 if allowed.
6114 (record_buffer): Inhibit quitting and rewrite using quittable
6115 functions. Run Qbuffer_list_update_hook if allowed.
6116 (Frecord_buffer, Funrecord_buffer): New functions.
6117 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
6118 Move switch-to-buffer to window.el.
6119 (bury-buffer): Move to window.el.
6120 (Vbuffer_list_update_hook): New variable.
6121
6122 * lisp.h (other_buffer_safely): Add prototype in buffer.c
6123 section.
6124
6125 * window.h (resize_frame_windows): Move up in code.
6126 (Fwindow_frame): Remove EXFUN.
6127 (replace_buffer_in_all_windows): Remove prototype.
6128 (replace_buffer_in_windows_safely): Add prototype.
6129
6130 * window.c: Declare Qdelete_window static again. Move down
6131 declaration of select_count.
6132 (Fnext_window, Fprevious_window): Rewrite doc-strings.
6133 (Fother_window): Move to window.el.
6134 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
6135 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
6136 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
6137 window.el.
6138 (replace_buffer_in_windows): Implement by calling
6139 Qreplace_buffer_in_windows.
6140 (replace_buffer_in_all_windows): Remove with some functionality
6141 moved into replace_buffer_in_windows_safely.
6142 (replace_buffer_in_windows_safely): New function.
6143 (select_window_norecord, select_frame_norecord): Move in front
6144 of run_window_configuration_change_hook. Remove now obsolete
6145 declarations.
6146 (Fset_window_buffer): Rewrite doc-string.
6147 Call Qrecord_window_buffer.
6148 (keys_of_window): Move binding for other-window to window.el.
6149
6150 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
6151
6152 * dispextern.h (struct image): Replace data member, whose int_val
6153 and ptr_val fields were not used by anything, with a single
6154 lisp_val object.
6155
6156 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
6157 (gif_clear_image, gif_load, imagemagick_load_image)
6158 (gs_clear_image, gs_load): Callers changed.
6159
6160 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
6161
6162 * buffer.h: Include <time.h>, for time_t.
6163 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
6164
6165 Fix minor problems found by static checking.
6166
6167 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
6168
6169 Make identifiers static if they are not used in other modules.
6170 * data.c (Qcompiled_function, Qframe, Qvector):
6171 * image.c (QimageMagick, Qsvg):
6172 * minibuf.c (Qmetadata):
6173 * window.c (resize_window_check, resize_root_window): Now static.
6174 * window.h (resize_window_check, resize_root_window): Remove decls.
6175
6176 * window.c (window_deletion_count, delete_deletable_window):
6177 Remove; unused.
6178 (window_body_lines): Now static.
6179 (Fdelete_other_windows_internal): Mark vars as initialized.
6180 Make sure 'resize_failed' is initialized.
6181 (run_window_configuration_change_hook): Rename local to avoid shadowing.
6182 (resize_window_apply): Remove unused local.
6183 * window.h (delete_deletable_window): Remove decl.
6184
6185 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
6186 (imagemagick_load_image): Fix pointer signedness problem by changing
6187 last arg from unsigned char * to char *. All uses changed.
6188 Also, fix a local for similar reasons.
6189 Remove unused locals. Remove locals to avoid shadowing.
6190 (fn_rsvg_handle_free): Remove; unused.
6191 (svg_load, svg_load_image): Fix pointer signedness problem.
6192 (imagemagick_load_image): Don't use garbage pointer image_wand.
6193
6194 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
6195
6196 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
6197
6198 * image.c (gif_load): Fix omitted cast error introduced by
6199 2011-06-06 change.
6200
6201 2011-06-10 Martin Rudalics <rudalics@gmx.at>
6202
6203 * window.h (resize_proportionally, orig_total_lines)
6204 (orig_top_line): Remove from window structure.
6205 (set_window_height, set_window_width, change_window_heights)
6206 (Fdelete_window): Remove prototypes.
6207 (resize_frame_windows): Remove duplicate declaration.
6208
6209 2011-06-10 Eli Zaretskii <eliz@gnu.org>
6210
6211 * window.h (resize_frame_windows, resize_window_check)
6212 (delete_deletable_window, resize_root_window)
6213 (resize_frame_windows): Declare prototypes.
6214
6215 * window.c (resize_window_apply): Make definition be "static" to
6216 match the prototype.
6217
6218 2011-06-10 Martin Rudalics <rudalics@gmx.at>
6219
6220 * window.c: Remove declarations of Qwindow_size_fixed,
6221 window_min_size_1, window_min_size_2, window_min_size,
6222 size_window, window_fixed_size_p, enlarge_window, delete_window.
6223 Remove static from declaration of Qdelete_window, it's
6224 temporarily needed by Fbury_buffer.
6225 (replace_window): Don't assign orig_top_line and
6226 orig_total_lines.
6227 (Fdelete_window, delete_window): Remove. Window deletion is
6228 handled by window.el.
6229 (window_loop): Remove DELETE_OTHER_WINDOWS case.
6230 Replace Fdelete_window calls with calls to Qdelete_window.
6231 (Fdelete_other_windows): Remove. Deleting other windows is
6232 handled by window.el.
6233 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
6234 handled in window.el.
6235 (window_min_size_2, window_min_size_1, window_min_size): Remove.
6236 Window minimum sizes are handled in window.el.
6237 (shrink_windows, size_window, set_window_height)
6238 (set_window_width, change_window_heights, window_height)
6239 (window_width, CURBEG, CURSIZE, enlarge_window)
6240 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
6241 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
6242 handled in window.el.
6243 (make_dummy_parent): Rename to make_parent_window and give it a
6244 second argument horflag.
6245 (make_window): Don't set resize_proportionally any more.
6246 (Fsplit_window): Remove. Windows are split in window.el.
6247 (save_restore_action, save_restore_orig_size)
6248 (shrink_window_lowest_first, save_restore_orig_size): Remove.
6249 Resize mini windows in window.el.
6250 (grow_mini_window, shrink_mini_window): Implement by calling
6251 Qresize_root_window_vertically, resize_window_check and
6252 resize_window_apply.
6253 (saved_window, Fset_window_configuration, save_window_save):
6254 Do not handle orig_top_line, orig_total_lines, and
6255 resize_proportionally.
6256 (window_min_height, window_min_width): Move to window.el.
6257 (keys_of_window): Move bindings for delete-other-windows,
6258 split-window, delete-window and enlarge-window to window.el.
6259
6260 * buffer.c: Temporarily extern Qdelete_window.
6261 (Fbury_buffer): Temporarily call Qdelete_window instead of
6262 Fdelete_window (Fbury_buffer will move to window.el soon).
6263
6264 * frame.c (set_menu_bar_lines_1): Remove code handling
6265 orig_top_line and orig_total_lines.
6266
6267 * dispnew.c (adjust_frame_glyphs_initially): Don't use
6268 set_window_height but set heights directly.
6269 (change_frame_size_1): Use resize_frame_windows.
6270
6271 * xdisp.c (init_xdisp): Don't use set_window_height but set
6272 heights directly.
6273
6274 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
6275 Use resize_frame_windows instead of change_window_heights and run
6276 run_window_configuration_change_hook.
6277
6278 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
6279 instead of change_window_heights and run
6280 run_window_configuration_change_hook.
6281
6282 2011-06-09 Martin Rudalics <rudalics@gmx.at>
6283
6284 * window.c (replace_window): Rename second argument REPLACEMENT to
6285 NEW. New third argument SETFLAG. Rewrite.
6286 (delete_window, make_dummy_parent): Call replace_window with
6287 third argument 1.
6288 (window_list_1): Move down in code.
6289 (run_window_configuration_change_hook): Move set_buffer part
6290 before select_frame_norecord part in order to unwind correctly.
6291 Rename count1 to count.
6292 (recombine_windows, delete_deletable_window, resize_root_window)
6293 (Fdelete_other_windows_internal)
6294 (Frun_window_configuration_change_hook, make_parent_window)
6295 (resize_window_check, resize_window_apply, Fresize_window_apply)
6296 (resize_frame_windows, Fsplit_window_internal)
6297 (Fdelete_window_internal, Fresize_mini_window_internal):
6298 New functions.
6299 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
6300
6301 2011-06-08 Martin Rudalics <rudalics@gmx.at>
6302
6303 * window.h (window): Add some new members to window structure -
6304 normal_lines, normal_cols, new_total, new_normal, clone_number,
6305 splits, nest, prev_buffers, next_buffers.
6306 (WINDOW_TOTAL_SIZE): Move here from window.c.
6307 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
6308
6309 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
6310 Remove.
6311 (make_dummy_parent): Set new members of windows structure.
6312 (make_window): Move down in code. Handle new members of window
6313 structure.
6314 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
6315 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
6316 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
6317 (Fset_window_prev_buffers, Fwindow_next_buffers)
6318 (Fset_window_next_buffers, Fset_window_clone_number):
6319 New functions.
6320 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
6321 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
6322 Doc-string fixes.
6323 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
6324 Argument WINDOW can be now internal window too.
6325 (Fwindow_use_time): Move up in code.
6326 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
6327 Rewrite doc-string.
6328 (Fset_window_configuration, saved_window)
6329 (Fcurrent_window_configuration, save_window_save): Handle new
6330 members of window structure.
6331 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
6332 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
6333 (syms_of_window): New Lisp objects Qrecord_window_buffer,
6334 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
6335 Qget_mru_window, Qresize_root_window,
6336 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
6337 Qauto_buffer_name; staticpro them.
6338
6339 2011-06-07 Martin Rudalics <rudalics@gmx.at>
6340
6341 * window.c (Fwindow_total_size, Fwindow_left_column)
6342 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
6343 (Fwindow_list_1): New functions.
6344 (window_box_text_cols): Replace with window_body_cols.
6345 (Fwindow_width, Fscroll_left, Fscroll_right):
6346 Use window_body_cols instead of window_box_text_cols.
6347 (delete_window, Fset_window_configuration):
6348 Call delete_all_subwindows with window as argument.
6349 (delete_all_subwindows): Take a window as argument and not a
6350 structure. Rewrite.
6351 (window_loop): Remove handling of GET_LRU_WINDOW and
6352 GET_LARGEST_WINDOW.
6353 (Fget_lru_window, Fget_largest_window): Move to window.el.
6354
6355 * window.h: Extern window_body_cols instead of
6356 window_box_text_cols. delete_all_subwindows now takes a
6357 Lisp_Object as argument.
6358
6359 * indent.c (compute_motion, Fcompute_motion):
6360 Use window_body_cols instead of window_box_text_cols.
6361
6362 * frame.c (delete_frame): Call delete_all_subwindows with root
6363 window as argument.
6364
6365 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
6366
6367 * fns.c (Fputhash): Document return value.
6368
6369 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
6370
6371 * image.c (gif_load): Implement gif89a spec "no disposal" method.
6372
6373 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6374
6375 Cons<->int and similar integer overflow fixes (Bug#8794).
6376
6377 Check for overflow when converting integer to cons and back.
6378 * charset.c (Fdefine_charset_internal, Fdecode_char):
6379 Use cons_to_unsigned to catch overflow.
6380 (Fencode_char): Use INTEGER_TO_CONS.
6381 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
6382 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
6383 * data.c (long_to_cons, cons_to_long): Remove.
6384 (cons_to_unsigned, cons_to_signed): New functions.
6385 These signal an error for invalid or out-of-range values.
6386 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
6387 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
6388 * font.c (Ffont_variation_glyphs):
6389 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
6390 * lisp.h: Include <intprops.h>.
6391 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
6392 (cons_to_signed, cons_to_unsigned): New decls.
6393 (long_to_cons, cons_to_long): Remove decls.
6394 * undo.c (record_first_change): Use INTEGER_TO_CONS.
6395 (Fprimitive_undo): Use CONS_TO_INTEGER.
6396 * xfns.c (Fx_window_property): Likewise.
6397 * xselect.c: Include <limits.h>.
6398 (x_own_selection, selection_data_to_lisp_data):
6399 Use INTEGER_TO_CONS.
6400 (x_handle_selection_request, x_handle_selection_clear)
6401 (x_get_foreign_selection, Fx_disown_selection_internal)
6402 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
6403 (lisp_data_to_selection_data): Use cons_to_unsigned.
6404 (x_fill_property_data): Use cons_to_signed.
6405 Report values out of range.
6406
6407 Check for buffer and string overflow more precisely.
6408 * buffer.h (BUF_BYTES_MAX): New macro.
6409 * lisp.h (STRING_BYTES_MAX): New macro.
6410 * alloc.c (Fmake_string):
6411 * character.c (string_escape_byte8):
6412 * coding.c (coding_alloc_by_realloc):
6413 * doprnt.c (doprnt):
6414 * editfns.c (Fformat):
6415 * eval.c (verror):
6416 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
6417 since they may not be the same number.
6418 * editfns.c (Finsert_char):
6419 * fileio.c (Finsert_file_contents):
6420 Likewise for BUF_BYTES_MAX.
6421
6422 * image.c: Use ptrdiff_t, not int, for sizes.
6423 (slurp_file): Switch from int to ptrdiff_t.
6424 All uses changed.
6425 (slurp_file): Check that file size fits in both size_t (for
6426 malloc) and ptrdiff_t (for sanity and safety).
6427
6428 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
6429 if b->modtime has its maximal value.
6430
6431 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
6432
6433 Don't assume time_t can fit into int.
6434 * buffer.h (struct buffer.modtime): Now time_t, not int.
6435 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
6436 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
6437
6438 Minor fixes for signed vs unsigned integers.
6439 * character.h (MAYBE_UNIFY_CHAR):
6440 * charset.c (maybe_unify_char):
6441 * keyboard.c (read_char, reorder_modifiers):
6442 XINT -> XFASTINT, since the integer must be nonnegative.
6443 * ftfont.c (ftfont_spec_pattern):
6444 * keymap.c (access_keymap, silly_event_symbol_error):
6445 XUINT -> XFASTINT, since the integer must be nonnegative.
6446 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
6447 since it makes no difference and we prefer signed.
6448 * keyboard.c (record_char): Use XUINT when all the neighbors do.
6449 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
6450 nonnegative.
6451
6452 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
6453
6454 * window.h (Fwindow_frame): Declare.
6455
6456 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6457
6458 * alloc.c: Simplify handling of large-request failures (Bug#8800).
6459 (SPARE_MEMORY): Always define.
6460 (LARGE_REQUEST): Remove.
6461 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
6462
6463 2011-06-06 Martin Rudalics <rudalics@gmx.at>
6464
6465 * lisp.h: Move EXFUNS for Fframe_root_window,
6466 Fframe_first_window and Fset_frame_selected_window to window.h.
6467
6468 * window.h: Move EXFUNS for Fframe_root_window,
6469 Fframe_first_window and Fset_frame_selected_window here from
6470 lisp.h.
6471
6472 * frame.c (Fwindow_frame, Fframe_first_window)
6473 (Fframe_root_window, Fframe_selected_window)
6474 (Fset_frame_selected_window): Move to window.c.
6475 (Factive_minibuffer_window): Move to minibuf.c.
6476 (Fother_visible_frames_p): New function.
6477
6478 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
6479
6480 * window.c (decode_window, decode_any_window): Move up in code.
6481 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
6482 (inhibit_frame_unsplittable): Remove unused variable.
6483 (Fwindow_buffer): Move up and rewrite doc-string.
6484 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
6485 (Fwindow_prev): New functions.
6486 (Fwindow_frame): Move here from frame.c. Accept any window as
6487 argument.
6488 (Fframe_root_window, Fframe_first_window)
6489 (Fframe_selected_window): Move here from frame.c. Accept frame
6490 or arbitrary window as argument. Update doc-strings.
6491 (Fminibuffer_window): Move up in code.
6492 (Fwindow_minibuffer_p): Move up in code and simplify.
6493 (Fset_frame_selected_window): Move here from frame.c.
6494 Marginal rewrite.
6495 (Fselected_window, select_window, Fselect_window): Move up in
6496 code. Minor doc-string fixes.
6497
6498 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
6499
6500 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
6501 Do not assume that spare memory exists; that assumption is valid
6502 only if SYSTEM_MALLOC.
6503 (LARGE_REQUEST): New macro, so that the issue of large requests
6504 is separated from the issue of spare memory.
6505
6506 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
6507
6508 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
6509 format. (Bug#8806)
6510
6511 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
6512
6513 * xfns.c (x_set_scroll_bar_default_width): Move declarations
6514 before statements.
6515
6516 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
6517
6518 * gtkutil.c (xg_get_default_scrollbar_width): New function.
6519
6520 * gtkutil.h: Declare xg_get_default_scrollbar_width.
6521
6522 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
6523 min width by calling x_set_scroll_bar_default_width (Bug#8505).
6524
6525 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
6526
6527 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
6528
6529 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
6530
6531 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
6532 (x_clipboard_manager_save): Add return value.
6533 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
6534 New error handlers.
6535 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
6536 Obey Vx_select_enable_clipboard_manager. Catch errors in
6537 x_clipboard_manager_save (Bug#8779).
6538 (Vx_select_enable_clipboard_manager): New variable.
6539 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
6540
6541 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
6542
6543 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
6544
6545 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6546
6547 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
6548 in the current matrix if keep_current_p is non-zero.
6549
6550 2011-06-04 Eli Zaretskii <eliz@gnu.org>
6551
6552 * bidi.c (bidi_level_of_next_char): Fix last change.
6553
6554 2011-06-03 Eli Zaretskii <eliz@gnu.org>
6555
6556 Support bidi reordering of text covered by display properties.
6557
6558 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
6559 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
6560 (bidi_cache_search, bidi_cache_iterator_state)
6561 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
6562 (bidi_level_of_next_char, bidi_move_to_visually_next):
6563 Support character positions inside a run of characters covered by a
6564 display string.
6565 (bidi_paragraph_init, bidi_resolve_explicit_1)
6566 (bidi_level_of_next_char): Call bidi_fetch_char and
6567 bidi_fetch_char_advance instead of FETCH_CHAR and
6568 FETCH_CHAR_ADVANCE.
6569 (bidi_init_it): Initialize new members.
6570 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
6571 definitions.
6572 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
6573 instead of using explicit *_CHAR codes.
6574 (bidi_resolve_explicit, bidi_resolve_weak):
6575 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
6576 bidirectional text is supported only in multibyte buffers.
6577 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
6578 it to initialize the frame_window_p member of struct bidi_it.
6579 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
6580 (bidi_resolve_explicit, bidi_resolve_weak)
6581 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
6582 bidi_it->nchars is non-positive.
6583 (bidi_level_of_next_char): Don't try to lookup the cache for the
6584 next/previous character if nothing is cached there yet, or if we
6585 were just reseat()'ed to a new position.
6586
6587 * xdisp.c (set_cursor_from_row): Set start and stop points
6588 according to the row's direction when priming the loop that looks
6589 for the glyph on which to display cursor.
6590 (single_display_spec_intangible_p): Function deleted.
6591 (display_prop_intangible_p): Reimplement to call
6592 handle_display_spec instead of single_display_spec_intangible_p.
6593 Accept 3 additional arguments needed by handle_display_spec.
6594 This fixes incorrect cursor motion across display property with complex
6595 values: lists, `(when COND...)' forms, etc.
6596 (single_display_spec_string_p): Support property values that are
6597 lists with the argument STRING its top-level element.
6598 (display_prop_string_p): Fix the condition for processing a
6599 property that is a list to be consistent with handle_display_spec.
6600 (handle_display_spec): New function, refactored from the
6601 last portion of handle_display_prop.
6602 (compute_display_string_pos): Accept additional argument
6603 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
6604 value of a `display' property is a "replacing spec".
6605 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
6606 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
6607 the display property, but just return a value indicating whether
6608 the display property will replace the characters it covers.
6609 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
6610 frame_window_p members of struct bidi_it.
6611 (compute_display_string_pos, compute_display_string_end):
6612 New functions.
6613 (push_it): Accept second argument POSITION, where pop_it should
6614 jump to continue iteration.
6615 (reseat_1): Initialize bidi_it.disp_pos.
6616
6617 * keyboard.c (adjust_point_for_property): Adjust the call to
6618 display_prop_intangible_p to its new signature.
6619
6620 * dispextern.h (struct bidi_it): New member frame_window_p.
6621 (bidi_init_it): Update prototypes.
6622 (display_prop_intangible_p): Update prototype.
6623 (compute_display_string_pos, compute_display_string_end):
6624 Declare prototypes.
6625 (struct bidi_it): New members nchars and disp_pos. ch_len is now
6626 EMACS_INT.
6627
6628 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
6629
6630 Malloc failure behavior now depends on size of allocation.
6631 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
6632 * lisp.h: Change signatures accordingly.
6633 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
6634 All callers changed. (Bug#8762)
6635
6636 * gnutls.c: Use Emacs's memory allocators.
6637 Without this change, the gnutls library would invoke malloc etc.
6638 directly, which causes problems on non-SYNC_INPUT hosts, and which
6639 runs afoul of improving memory_full behavior. (Bug#8761)
6640 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
6641 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
6642 xfree instead of the default malloc, realloc, free.
6643 (Fgnutls_boot): No need to check for memory allocation failure,
6644 since xmalloc does that for us.
6645
6646 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
6647 * category.c (hash_get_category_set):
6648 * ccl.c (ccl_driver):
6649 * charset.c (Fdefine_charset_internal):
6650 * charset.h (struct charset.hash_index):
6651 * composite.c (get_composition_id, gstring_lookup_cache)
6652 (composition_gstring_put_cache):
6653 * composite.h (struct composition.hash_index):
6654 * dispextern.h (struct image.hash):
6655 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
6656 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
6657 (hashfn_equal, hashfn_user_defined, make_hash_table)
6658 (maybe_resize_hash_table, hash_lookup, hash_put)
6659 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
6660 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
6661 (Fsxhash, Fgethash, Fputhash, Fmaphash):
6662 * image.c (make_image, search_image_cache, lookup_image)
6663 (xpm_put_color_table_h):
6664 * lisp.h (struct Lisp_Hash_Table):
6665 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
6666 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
6667 for hashes and hash indexes, instead of 'unsigned' and 'int'.
6668 * alloc.c (allocate_vectorlike):
6669 Check for overflow in vector size calculations.
6670 * ccl.c (ccl_driver):
6671 Check for overflow when converting EMACS_INT to int.
6672 * fns.c, image.c: Remove unnecessary static decls that would otherwise
6673 need to be updated by these changes.
6674 * fns.c (make_hash_table, maybe_resize_hash_table):
6675 Check for integer overflow with large hash tables.
6676 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
6677 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
6678 (SXHASH_REDUCE): New macro.
6679 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
6680 Use it instead of discarding useful hash info with large hash values.
6681 (sxhash_float): New function.
6682 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
6683 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
6684 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
6685 Rewrite to use FIXNUM_BITS, as this simplifies things.
6686 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
6687 Adjust signatures to match updated version of code.
6688 (consing_since_gc): Now EMACS_INT, since a single hash table can
6689 use more than INT_MAX bytes.
6690
6691 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
6692
6693 Make it possible to build with GCC-4.6+ -O2 -flto.
6694
6695 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
6696
6697 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
6698
6699 * minibuf.c (get_minibuffer, read_minibuf_unwind):
6700 Call minibuffer-inactive-mode.
6701
6702 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
6703
6704 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
6705 Update dependencies.
6706
6707 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6708
6709 * data.c (init_data): Remove code for UTS, this system is not
6710 supported anymore.
6711
6712 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6713
6714 Don't force ./temacs to start in terminal mode.
6715
6716 * frame.c (make_initial_frame): Initialize faces in all cases, not
6717 only when CANNOT_DUMP is defined.
6718 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
6719
6720 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6721
6722 * dispnew.c (add_window_display_history): Use const for the string
6723 pointer. Remove declaration, not needed.
6724
6725 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
6726
6727 Use 'inline', not 'INLINE'.
6728 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
6729 * alloc.c, fontset.c (INLINE): Remove.
6730 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
6731 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
6732 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
6733 * gmalloc.c (register_heapinfo): Use inline unconditionally.
6734 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
6735
6736 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
6737
6738 Make it possible to run ./temacs.
6739
6740 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
6741 syms_of_callproc does the same thing. Remove test for
6742 "initialized", do it in the caller.
6743 * emacs.c (main): Avoid calling set_initial_environment when dumping.
6744
6745 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
6746
6747 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
6748 (read_minibuf): Use get_minibuffer.
6749 (syms_of_minibuf): Use DEFSYM.
6750 (Qmetadata): New var.
6751 * data.c (Qbuffer): Don't make it static.
6752 (syms_of_data): Use DEFSYM.
6753
6754 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
6755
6756 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
6757 (CCL_CODE_MIN): New macro.
6758
6759 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
6760
6761 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
6762
6763 * eval.c (Qdebug): Now static.
6764 * lisp.h (Qdebug): Remove decl. This reverts a part of the
6765 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
6766 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
6767
6768 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
6769
6770 * image.c: Various fixes to ImageMagick code comments.
6771 (Fimagemagick_types): Doc fix.
6772
6773 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
6774
6775 Minor fixes prompted by GCC 4.6.0 warnings.
6776
6777 * xselect.c (converted_selections, conversion_fail_tag): Now static.
6778
6779 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
6780 (x_clipboard_manager_save_all): Move extern decl to ...
6781 * xterm.h: ... here, so that it can be checked for consistency.
6782
6783 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
6784
6785 * xselect.c (x_clipboard_manager_save_frame)
6786 (x_clipboard_manager_save_all): New functions.
6787 (Fx_clipboard_manager_save): Lisp function deleted.
6788
6789 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
6790 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
6791
6792 * xterm.h: Update prototype.
6793
6794 2011-05-28 William Xu <william.xwl@gmail.com>
6795
6796 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
6797 exiting (Bug#8239).
6798
6799 2011-05-28 Jim Meyering <meyering@redhat.com>
6800
6801 Avoid a sign-extension bug in crypto_hash_function.
6802 * fns.c (to_uchar): Define.
6803 (crypto_hash_function): Use it to convert some newly-signed
6804 variables to unsigned, to avoid sign-extension bugs. For example,
6805 without this change, (md5 "truc") would evaluate to
6806 45723a2aff78ff4fff7fff1114760e62 rather than the expected
6807 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
6808 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
6809
6810 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
6811
6812 Integer overflow fixes.
6813
6814 * dbusbind.c: Serial number integer overflow fixes.
6815 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
6816 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
6817 to hold a serial number that is too large for a fixnum.
6818 (Fdbus_method_return_internal, Fdbus_method_error_internal):
6819 Check for serial numbers out of range. Decode any serial number
6820 that was so large that it became a float. (Bug#8722)
6821
6822 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
6823 (Fdbus_call_method, Fdbus_call_method_asynchronously):
6824 Use XFASTINT rather than XUINT when numbers are nonnegative.
6825 (xd_append_arg, Fdbus_method_return_internal):
6826 (Fdbus_method_error_internal): Likewise. Also, for unsigned
6827 arguments, check that Lisp number is nonnegative, rather than
6828 silently wrapping negative numbers around. (Bug#8722)
6829 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
6830 (Bug#8722)
6831
6832 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
6833
6834 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
6835
6836 ccl: Add integer overflow checks.
6837 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
6838 (IN_INT_RANGE): New macros.
6839 (ccl_driver): Use them to check for integer overflow when
6840 decoding a CCL program. Many of the new checks are whether XINT (x)
6841 fits in int; it doesn't always, on 64-bit hosts. The new version
6842 doesn't catch all possible integer overflows, but it's an
6843 improvement. (Bug#8719)
6844
6845 * alloc.c (make_event_array): Use XINT, not XUINT.
6846 There's no need for unsigned here.
6847
6848 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
6849 This follows up to the 2011-05-06 change that substituted uintptr_t
6850 for EMACS_INT. This case wasn't caught back then.
6851
6852 Rework Fformat to avoid integer overflow issues.
6853 * editfns.c: Include <float.h> unconditionally, as it's everywhere
6854 now (part of C89). Include <verify.h>.
6855 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
6856 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
6857 (Fformat): Avoid the prepass trying to compute sizes; it was only
6858 approximate and thus did not catch overflow reliably. Instead, walk
6859 through the format just once, formatting and computing sizes as we go,
6860 checking for integer overflow at every step, and allocating a larger
6861 buffer as needed. Keep track separately whether the format is
6862 multibyte. Keep only the most-recently calculated precision, rather
6863 than them all. Record whether each argument has been converted to
6864 string. Use EMACS_INT, not int, for byte and char and arg counts.
6865 Support field widths and precisions larger than INT_MAX. Avoid
6866 sprintf's undefined behavior with conversion specifications such as %#d
6867 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
6868 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
6869 formatting out-of-range floating point numbers with int
6870 formats. (Bug#8668)
6871
6872 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
6873
6874 * data.c: Avoid integer truncation in expressions involving floats.
6875 * data.c: Include <intprops.h>.
6876 (arith_driver): When there's an integer overflow in an expression
6877 involving floating point, convert the integers to floating point
6878 so that the resulting value does not suffer from catastrophic
6879 integer truncation. For example, on a 64-bit host (* 4
6880 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
6881 Do not rely on undefined behavior after integer overflow.
6882
6883 merge count_size_as_multibyte, parse_str_to_multibyte
6884 * character.c, character.h (count_size_as_multibyte):
6885 Rename from parse_str_to_multibyte; all uses changed.
6886 Check for integer overflow.
6887 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
6888 since it's now a duplicate of the other. This is more of
6889 a character than a buffer op, so better that it's in character.c.
6890 * fns.c, print.c: Adjust to above changes.
6891
6892 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
6893
6894 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
6895
6896 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
6897
6898 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
6899 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
6900 (x_clipboard_manager_save): Now static.
6901 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
6902
6903 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
6904 (crypto_hash_function): Now static.
6905 Fix pointer signedness problems. Avoid unnecessary initializations.
6906
6907 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
6908
6909 * termhooks.h (Vselection_alist): Make it terminal-local.
6910
6911 * terminal.c (create_terminal): Initialize it.
6912
6913 * xselect.c: Support for clipboard managers.
6914 (Vselection_alist): Move to termhooks.h as terminal-local var.
6915 (LOCAL_SELECTION): New macro.
6916 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
6917 (symbol_to_x_atom): Remove gratuitous arg.
6918 (x_handle_selection_request, lisp_data_to_selection_data)
6919 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
6920 (x_own_selection, x_get_local_selection, x_convert_selection):
6921 New arg, specifying work frame. Use terminal-local Vselection_alist.
6922 (some_frame_on_display): Delete unused function.
6923 (Fx_own_selection_internal, Fx_get_selection_internal)
6924 (Fx_disown_selection_internal, Fx_selection_owner_p)
6925 (Fx_selection_exists_p): New optional frame arg.
6926 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
6927 (x_handle_selection_clear): Don't treat other terminals with the
6928 same keyboard specially. Use the terminal-local Vselection_alist.
6929 (x_clear_frame_selections): Use Frun_hook_with_args.
6930
6931 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
6932
6933 * xterm.h: Add support for those atoms.
6934
6935 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
6936
6937 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
6938 (converted_selections, conversion_fail_tag): New global variables.
6939 (x_selection_request_lisp_error): Free the above.
6940 (x_get_local_selection): Remove unnecessary code.
6941 (x_reply_selection_request): Args changed; handle arbitrary array
6942 of converted selections stored in converted_selections.
6943 Separate the XChangeProperty and SelectionNotify steps.
6944 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
6945 (x_convert_selection): New function.
6946 (x_handle_selection_event): Simplify.
6947 (x_get_foreign_selection): Don't ignore incoming requests while
6948 waiting for an answer; this will fail when we implement
6949 SAVE_TARGETS, and seems unnecessary anyway.
6950 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
6951 (Vx_sent_selection_functions): Doc fix.
6952
6953 2011-05-26 Leo Liu <sdl.web@gmail.com>
6954
6955 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
6956
6957 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6958
6959 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
6960
6961 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
6962 for fringe update if it has periodic bitmap.
6963 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
6964 and fringe_bitmap_periodic_p.
6965
6966 * fringe.c (get_fringe_bitmap_data): New function.
6967 (draw_fringe_bitmap_1, update_window_fringes): Use it.
6968 (update_window_fringes): Record periodicity of fringe bitmap in glyph
6969 row. Mark glyph row for fringe update if periodicity changed.
6970
6971 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
6972 for fringe update unless it has periodic bitmap.
6973
6974 2011-05-25 Kenichi Handa <handa@m17n.org>
6975
6976 * xdisp.c (get_next_display_element): Set correct it->face_id for
6977 a static composition.
6978
6979 2011-05-24 Leo Liu <sdl.web@gmail.com>
6980
6981 * deps.mk (fns.o):
6982 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
6983
6984 * fns.c (crypto_hash_function, Fsha1): New function.
6985 (Fmd5): Use crypto_hash_function.
6986 (syms_of_fns): Add Ssha1.
6987
6988 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
6989
6990 * gnutls.c: Remove unused macros.
6991 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
6992 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
6993 Remove macros that are defined and never used.
6994 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
6995
6996 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
6997
6998 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
6999 (Fx_get_selection_internal): Minor cleanup.
7000 (Fx_own_selection_internal): Rename arguments for consistency with
7001 select.el.
7002
7003 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
7004
7005 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
7006
7007 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
7008
7009 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
7010
7011 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7012
7013 * dispnew.c (scrolling_window): Don't exclude the case that the
7014 last enabled row in the desired matrix touches the bottom boundary.
7015
7016 2011-05-21 Glenn Morris <rgm@gnu.org>
7017
7018 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
7019 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
7020 and add some more files.
7021
7022 2011-05-20 Eli Zaretskii <eliz@gnu.org>
7023
7024 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
7025 report_file_error introduced by the change from 2011-05-07.
7026
7027 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
7028
7029 * systime.h (Time): Define only if emacs is defined.
7030 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
7031 where the include path doesn't have X11/X.h by default. See
7032 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
7033
7034 2011-05-20 Kenichi Handa <handa@m17n.org>
7035
7036 * composite.c (find_automatic_composition): Fix previous change.
7037
7038 2011-05-20 Glenn Morris <rgm@gnu.org>
7039
7040 * lisp.mk: New file, split from Makefile.in.
7041 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
7042 (shortlisp): Remove.
7043 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
7044
7045 2011-05-19 Glenn Morris <rgm@gnu.org>
7046
7047 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
7048 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
7049 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
7050 (lisp): Set the order to that of loadup.el.
7051 (shortlisp): Make it a copy of $lisp.
7052 (SOME_MACHINE_LISP): Remove.
7053 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
7054 Use just $shortlisp, not $SOME_MACHINE_LISP too.
7055
7056 2011-05-18 Kenichi Handa <handa@m17n.org>
7057
7058 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
7059 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
7060 (find_automatic_composition): Mostly rewrite for efficiency.
7061
7062 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
7063
7064 * makefile.w32-in: Update dependencies.
7065
7066 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
7067
7068 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7069 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
7070
7071 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
7072
7073 Fix some integer overflow issues, such as string length overflow.
7074
7075 * insdel.c (count_size_as_multibyte): Check for string overflow.
7076
7077 * character.c (lisp_string_width): Check for string overflow.
7078 Use EMACS_INT, not int, for string indexes and lengths; in
7079 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
7080 the resulting string length overflows an EMACS_INT; instead,
7081 report a string overflow if no precision given. When checking for
7082 precision exhaustion, use a check that cannot possibly have
7083 integer overflow. (Bug#8675)
7084 * character.h (lisp_string_width): Adjust to new signature.
7085
7086 * alloc.c (string_overflow): New function.
7087 (Fmake_string): Use it. This doesn't change behavior, but saves
7088 a few bytes and will simplify future changes.
7089 * character.c (string_escape_byte8): Likewise.
7090 * lisp.h (string_overflow): New decl.
7091
7092 Fixups, following up to the user-interface timestamp change.
7093 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
7094 for UI timestamps, instead of unsigned long.
7095 * msdos.c (mouse_get_pos): Likewise.
7096 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
7097 * w32gui.h (Time): Define by including "systime.h" rather than by
7098 declaring it ourselves. (Bug#8664)
7099
7100 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
7101 * image.c (clear_image_cache): Likewise.
7102
7103 * term.c (term_mouse_position): Don't assume time_t wraparound.
7104
7105 Be more systematic about user-interface timestamps.
7106 Before, the code sometimes used 'Time', sometimes 'unsigned long',
7107 and sometimes 'EMACS_UINT', to represent these timestamps.
7108 This change causes it to use 'Time' uniformly, as that's what X uses.
7109 This makes the code easier to follow, and makes it easier to catch
7110 integer overflow bugs such as Bug#8664.
7111 * frame.c (Fmouse_position, Fmouse_pixel_position):
7112 Use Time, not unsigned long, for user-interface timestamps.
7113 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
7114 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
7115 * keyboard.h (last_event_timestamp): Likewise.
7116 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
7117 * menu.h (xmenu_show): Likewise.
7118 * term.c (term_mouse_position): Likewise.
7119 * termhooks.h (struct input_event.timestamp): Likewise.
7120 (struct terminal.mouse_position_hook): Likewise.
7121 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
7122 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
7123 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
7124 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
7125 what it was before.
7126 * menu.h, termhooks.h: Include "systime.h", for Time.
7127
7128 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
7129 Don't assume that the difference between two unsigned long values
7130 can fit into an integer. At this point, we know button_down_time
7131 <= event->timestamp, so the difference must be nonnegative, so
7132 there's no need to cast the result if double-click-time is
7133 nonnegative, as it should be; check that it's nonnegative, just in
7134 case. This bug is triggered when events are more than 2**31 ms
7135 apart (about 25 days). (Bug#8664)
7136
7137 * xselect.c (last_event_timestamp): Remove duplicate decl.
7138 (x_own_selection): Remove needless cast to unsigned long.
7139
7140 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
7141 that always fit in int. Use a sentinel instead of a counter, to
7142 avoid a temp and to allay GCC's concerns about possible int overflow.
7143 * frame.h (struct frame): Use int for menu_bar_items_used
7144 instead of EMACS_INT, since it always fits in int.
7145
7146 * menu.c (grow_menu_items): Check for int overflow.
7147
7148 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
7149
7150 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
7151 Before, the code was not consistent. These values cannot exceed
7152 2**31 - 1 so there's no need to make them unsigned.
7153 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
7154 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
7155 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
7156 as modifiers.
7157 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
7158
7159 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
7160 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
7161 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
7162 presumably because the widths might not match.
7163
7164 * window.c (size_window): Avoid needless test at loop start.
7165
7166 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
7167
7168 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
7169
7170 2011-05-12 Drew Adams <drew.adams@oracle.com>
7171
7172 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
7173
7174 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7175
7176 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
7177 `width' to `bar_area_x' and `bar_area_width', respectively.
7178 (x_scroll_run): Take account of fringe background extension.
7179
7180 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
7181 Rename local vars `left' and `width' to `bar_area_x' and
7182 `bar_area_width', respectively.
7183 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
7184 background extension.
7185
7186 2011-05-10 Jim Meyering <meyering@redhat.com>
7187
7188 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
7189
7190 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
7191
7192 * image.c (Finit_image_library): Return t for built-in image types,
7193 like pbm and xbm. (Bug#8640)
7194
7195 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
7196
7197 * w32menu.c (set_frame_menubar): Fix submenu allocation.
7198
7199 2011-05-07 Eli Zaretskii <eliz@gnu.org>
7200
7201 * w32console.c (Fset_screen_color): Doc fix.
7202 (Fget_screen_color): New function.
7203 (syms_of_ntterm): Defsubr it.
7204
7205 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
7206 unlink the temporary file if Fcall_process didn't create it in the
7207 first place.
7208 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
7209 child process will be redirected to a file specified with `:file'.
7210 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
7211 cue to call_process_cleanup not to close that handle.
7212
7213 2011-05-07 Ben Key <bkey76@gmail.com>
7214
7215 * makefile.w32-in: The bootstrap-temacs rule now makes use of
7216 one of two shell specific rules, either bootstrap-temacs-CMD or
7217 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
7218 to the previous implementation of the bootstrap-temacs rule.
7219 The bootstrap-temacs-CMD rule is similar to the previous
7220 implementation of the bootstrap-temacs rule except that it
7221 makes use of the ESC_CFLAGS variable instead of the CFLAGS
7222 variable.
7223
7224 These changes, along with some changes to nt/configure.bat,
7225 nt/gmake.defs, and nt/nmake.defs, are required to extend my
7226 earlier fix to add support for --cflags and --ldflags options
7227 that include quotes so that it works whether make uses cmd or
7228 sh as the shell.
7229
7230 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
7231
7232 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
7233 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
7234 is a constant.
7235 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
7236 a string. Handle both cases.
7237 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
7238 (Fdbus_register_method): Use Qinvalid_function.
7239
7240 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
7241
7242 * makefile.w32-in: Update dependencies.
7243 (LISP_H): Add inttypes.h and stdin.h.
7244 (PROCESS_H): Add unistd.h.
7245
7246 2011-05-06 Eli Zaretskii <eliz@gnu.org>
7247
7248 * lread.c: Include limits.h (fixes the MS-Windows build broken by
7249 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
7250
7251 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
7252
7253 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
7254
7255 * term.c (vfatal): Remove stray call to va_end.
7256 It's not needed and the C Standard doesn't allow it here anyway.
7257
7258 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
7259 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
7260
7261 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
7262 bytes.
7263
7264 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
7265
7266 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7267
7268 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
7269
7270 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
7271
7272 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
7273
7274 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
7275 * charset.c (Fdefine_charset_internal): Don't initialize
7276 charset.code_space[15]. The value was garbage, on hosts with
7277 32-bit int (Bug#8600).
7278
7279 * lread.c (read_integer): Be more consistent with string-to-number.
7280 Use string_to_number to do the actual conversion; this avoids
7281 rounding errors and fixes some other screwups. Without this fix,
7282 for example, #x1fffffffffffffff was misread as -2305843009213693952.
7283 (digit_to_number): Move earlier, for benefit of read_integer.
7284 Return -1 if the digit is out of range for the base, -2 if it is
7285 not a digit in any supported base. (Bug#8602)
7286
7287 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
7288
7289 * dispnew.c (scrolling_window): Return 1 if we scrolled,
7290 to match comment at start of function. This also removes a
7291 GCC warning about overflow in a 32+64-bit port.
7292
7293 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
7294
7295 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
7296 Reported by Stefan Monnier in
7297 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
7298 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7299 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
7300
7301 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
7302 (EMACS_UINTPTR): Likewise, with uintptr_t.
7303
7304 * lisp.h: Prefer 64-bit EMACS_INT if available.
7305 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
7306 on 32-bit hosts that have 64-bit int, so that they can access
7307 large files.
7308 However, temporarily disable this change unless the temporary
7309 symbol WIDE_EMACS_INT is defined.
7310
7311 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
7312
7313 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
7314 This removes an assumption that EMACS_INT and long are the same
7315 width as pointers. The assumption is true for Emacs porting targets
7316 now, but we want to make other targets possible.
7317 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
7318 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
7319 In the rest of the code, change types of integers that hold casted
7320 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
7321 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
7322 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
7323 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
7324 No need to cast type when ORing.
7325 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
7326 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
7327 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
7328 assume EMACS_INT is the same width as char *.
7329 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
7330 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
7331 Remove no-longer-needed casts.
7332 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
7333 (xg_tool_bar_help_callback, xg_make_tool_item):
7334 Use EMACS_INTPTR to hold an integer
7335 that will be cast to void *; this can avoid a GCC warning
7336 if EMACS_INT is not the same width as void *.
7337 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
7338 * xdisp.c (display_echo_area_1, resize_mini_window_1):
7339 (current_message_1, set_message_1):
7340 Use a local to convert to proper width without a cast.
7341 * xmenu.c (dialog_selection_callback): Likewise.
7342
7343 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
7344 Also, don't assume VALBITS / RAND_BITS is less than 5,
7345 and don't rely on undefined behavior when shifting a 1 left into
7346 the sign bit.
7347 * lisp.h (get_random): Change signature to match.
7348
7349 * lread.c (hash_string): Use size_t, not int, for hash computation.
7350 Normally we prefer signed values; but hashing is special, because
7351 it's better to use unsigned division on hash table sizes so that
7352 the remainder is nonnegative. Also, size_t is the natural width
7353 for hashing into memory. The previous code used 'int', which doesn't
7354 retain enough info to hash well into very large tables.
7355 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
7356
7357 * dbusbind.c: Don't possibly lose pointer info when converting.
7358 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
7359 Use XPNTR rather than XHASH, so that the high-order bits of
7360 the pointer aren't lost when converting through void *.
7361
7362 * eval.c (Fautoload): Don't double-shift a pointer.
7363
7364 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
7365
7366 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
7367
7368 * gnutls.c (DEF_GNUTLS_FN):
7369 * image.c (DEF_IMGLIB_FN): Make function pointers static.
7370
7371 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
7372
7373 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
7374 marker. (Bug#8610)
7375
7376 2011-05-05 Eli Zaretskii <eliz@gnu.org>
7377
7378 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
7379 New version that can reserve upto 2GB of heap space.
7380
7381 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
7382
7383 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
7384
7385 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
7386
7387 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
7388 `gnutls_certificate_set_x509_key_file'.
7389
7390 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
7391
7392 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
7393 Update dependencies.
7394
7395 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7396
7397 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
7398 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
7399 Remove unused parameter `fildes'.
7400 * process.c (read_process_output, send_process): Don't pass it.
7401
7402 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7403
7404 Fix previous change: the library cache is defined in w32.c.
7405 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
7406 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
7407
7408 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
7409
7410 Implement dynamic loading of GnuTLS on Windows.
7411
7412 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
7413 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
7414 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7415 Declare.
7416
7417 * gnutls.c (Qgnutls_dll): Define.
7418 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
7419 (gnutls_*): Declare function pointers.
7420 (init_gnutls_functions): New function to initialize function pointers.
7421 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
7422 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
7423 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
7424 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
7425 (emacs_gnutls_write, emacs_gnutls_read)
7426 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
7427 (Fgnutls_available_p): New function.
7428 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
7429 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
7430 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
7431
7432 * image.c: Include w32.h.
7433 (Vimage_type_cache): Delete.
7434 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
7435 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
7436 (w32_delayed_load): Move to w32.c.
7437
7438 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
7439
7440 * w32.c (QCloaded_from, Vlibrary_cache): Define.
7441 (w32_delayed_load): Move from image.c. When loading a library, record
7442 its filename in the :loaded-from property of the library id.
7443 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
7444 Initialize and staticpro them.
7445 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
7446
7447 * process.c: Include lisp.h before w32.h, not after.
7448 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
7449 instead of gnutls_record_check_pending.
7450
7451 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
7452
7453 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
7454
7455 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
7456 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
7457 as passed in.
7458
7459 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
7460
7461 * xterm.c (x_set_frame_alpha): Do not set property on anything
7462 else than FRAME_X_OUTER_WINDOW (Bug#8608).
7463
7464 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
7465
7466 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
7467
7468 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
7469
7470 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
7471 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
7472 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
7473 (gnutls_global_initialized, Qgnutls_bootprop_priority)
7474 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
7475 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
7476 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
7477 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
7478 (Qgnutls_bootprop_callbacks_verify): Make static.
7479
7480 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
7481
7482 * callproc.c: Indentation fixup.
7483
7484 * sysdep.c (wait_for_termination_1): Make static.
7485 (wait_for_termination, interruptible_wait_for_termination):
7486 Move after wait_for_termination_1.
7487
7488 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
7489
7490 * sysdep.c (interruptible_wait_for_termination): New function
7491 which is like wait_for_termination, but allows keyboard
7492 interruptions.
7493
7494 * callproc.c (Fcall_process): Add (:file "file") as an option for
7495 the STDOUT buffer.
7496 (Fcall_process_region): Ditto.
7497
7498 2011-04-30 Eli Zaretskii <eliz@gnu.org>
7499
7500 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
7501 rather than `XVECTOR (FOO)->size'.
7502
7503 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
7504 inttypes.h, as a gnulib replacement is used if it not available in
7505 system headers.
7506
7507 2011-04-21 Eli Zaretskii <eliz@gnu.org>
7508
7509 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
7510 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
7511 of MOST_POSITIVE_FIXNUM. (Bug#8528)
7512
7513 * coding.c (coding_alloc_by_realloc): Error out if destination
7514 will grow beyond MOST_POSITIVE_FIXNUM.
7515 (decode_coding_emacs_mule): Abort if there isn't enough place in
7516 charbuf for the composition carryover bytes. Reserve an extra
7517 space for up to 2 characters produced in a loop.
7518 (decode_coding_iso_2022): Abort if there isn't enough place in
7519 charbuf for the composition carryover bytes.
7520
7521 2011-04-21 Eli Zaretskii <eliz@gnu.org>
7522
7523 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
7524 aborting when %lld or %lll format is passed.
7525 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
7526 %llo or %llx format is passed. (Bug#8545)
7527
7528 * window.c (window_scroll_line_based): Use a marker instead of
7529 simple variables to record original value of point. (Bug#7952)
7530
7531 * doprnt.c (doprnt): Fix the case where a multibyte sequence
7532 produced by %s or %c overflows available buffer space. (Bug#8545)
7533
7534 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
7535
7536 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
7537 (SIZE_MAX): Move defn after all includes, as they might #define it.
7538
7539 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7540
7541 * w32.c (init_environment): Warn about defaulting HOME to C:\.
7542
7543 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7544
7545 * keyboard.c (Qdelayed_warnings_hook): Define.
7546 (command_loop_1): Run `delayed-warnings-hook'
7547 if Vdelayed_warnings_list is non-nil.
7548 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
7549 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
7550
7551 2011-04-28 Eli Zaretskii <eliz@gnu.org>
7552
7553 * doprnt.c (doprnt): Don't return value smaller than the buffer
7554 size if the message was truncated. (Bug#8545).
7555
7556 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
7557
7558 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
7559 (Fx_window_property): #if-0 the whole functions, not just the bodies.
7560
7561 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7562
7563 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
7564
7565 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
7566
7567 * makefile.w32-in: Update dependencies.
7568
7569 2011-04-27 Eli Zaretskii <eliz@gnu.org>
7570
7571 Improve `doprnt' and its usage. (Bug#8545)
7572 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
7573 `format_end'. Remove support for %l as a conversion specifier.
7574 Don't use xrealloc. Improve diagnostics when the %l size modifier
7575 is used. Update the commentary.
7576
7577 * eval.c (verror): Simplify calculation of size_t.
7578
7579 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
7580 messages.
7581
7582 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
7583
7584 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
7585 change.
7586
7587 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
7588
7589 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
7590 This makes this file independent of the recent pseudovector change.
7591
7592 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
7593
7594 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
7595
7596 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7597 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
7598 Remove unused local.
7599 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
7600
7601 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
7602 GCC 4.6.0 optimizes based on type-based alias analysis.
7603 For example, if b is of type struct buffer * and v of type struct
7604 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
7605 != &v->size, and therefore "v->size = 1; b->size = 2; return
7606 v->size;" must therefore return 1. This assumption is incorrect
7607 for Emacs, since it type-puns struct Lisp_Vector * with many other
7608 types. To fix this problem, this patch adds a new type struct
7609 vectorlike_header that documents the constraints on layout of vectors
7610 and pseudovectors, and helps optimizing compilers not get fooled
7611 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
7612 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
7613 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
7614 the size member.
7615 (XSETPVECTYPE): Rewrite in terms of new macro.
7616 (XSETPVECTYPESIZE): New macro, specifying both type and size.
7617 This is a bit clearer, and further avoids the possibility of
7618 undesirable aliasing.
7619 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
7620 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
7621 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
7622 since Lisp_Subr is a special case (no "next" field).
7623 (ASIZE): Now uses header.size rather than size.
7624 All previous uses of XVECTOR (foo)->size replaced to use this macro,
7625 to avoid the hassle of writing XVECTOR (foo)->header.size.
7626 (struct vectorlike_header): New type.
7627 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
7628 object, to help avoid aliasing.
7629 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
7630 (SUBRP): Likewise, since Lisp_Subr is a special case.
7631 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
7632 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
7633 (struct Lisp_Hash_Table): Combine first two members into a single
7634 struct vectorlike_header member. All uses of "size" and "next" members
7635 changed to be "header.size" and "header.next".
7636 * buffer.h (struct buffer): Likewise.
7637 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
7638 * frame.h (struct frame): Likewise.
7639 * process.h (struct Lisp_Process): Likewise.
7640 * termhooks.h (struct terminal): Likewise.
7641 * window.c (struct save_window_data, struct saved_window): Likewise.
7642 * window.h (struct window): Likewise.
7643 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
7644 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
7645 * buffer.c (init_buffer_once): Likewise.
7646 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
7647 special case.
7648 * process.c (Fformat_network_address): Use local var for size,
7649 for brevity.
7650
7651 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
7652
7653 Make the Lisp reader and string-to-float more consistent (Bug#8525)
7654 * data.c (atof): Remove decl; no longer used or needed.
7655 (digit_to_number): Move to lread.c.
7656 (Fstring_to_number): Use new string_to_number function, to be
7657 consistent with how the Lisp reader treats infinities and NaNs.
7658 Do not assume that floating-point numbers represent EMACS_INT
7659 without losing information; this is not true on most 64-bit hosts.
7660 Avoid double-rounding errors, by insisting on integers when
7661 parsing non-base-10 numbers, as the documentation specifies.
7662 * lisp.h (string_to_number): New decl, replacing ...
7663 (isfloat_string): Remove.
7664 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
7665 (read1): Do not accept +. and -. as integers; this
7666 appears to have been a coding error. Similarly, do not accept
7667 strings like +-1e0 as floating point numbers. Do not report
7668 overflow for integer overflows unless the base is not 10 which
7669 means we have no simple and reliable way to continue.
7670 Break out the floating-point parsing into a new
7671 function string_to_number, so that Fstring_to_number parses
7672 floating point numbers consistently with the Lisp reader.
7673 (digit_to_number): Move here from data.c. Make it static inline.
7674 (E_CHAR, EXP_INT): Remove, replacing with ...
7675 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
7676 (string_to_number): New function, replacing isfloat_string.
7677 This function checks for valid syntax and produces the resulting
7678 Lisp float number too. Rework it so that string-to-number
7679 no longer mishandles examples like "1.0e+". Use strtoumax,
7680 so that overflow for non-base-10 numbers is reported only when
7681 there's no portable and simple way to convert to floating point.
7682
7683 * textprop.c (set_text_properties_1): Rewrite for clarity,
7684 and to avoid GCC warning about integer overflow.
7685
7686 * intervals.h (struct interval): Use EMACS_INT for members
7687 where EMACS_UINT might cause problems. See
7688 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
7689 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
7690 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
7691 All uses changed.
7692 (offset_intervals): Tell GCC not to worry about length overflow
7693 when negating a negative length.
7694
7695 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
7696 (overrun_check_free): Likewise.
7697
7698 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
7699 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
7700 word size.
7701
7702 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
7703 (gnutls_make_error): Rename local to avoid shadowing.
7704 (gnutls_emacs_global_deinit): ifdef out; not used.
7705 (Fgnutls_boot): Use const for pointer to readonly storage.
7706 Comment out unused local. Fix pointer signedness problems.
7707
7708 * lread.c (openp): Don't stuff size_t into an 'int'.
7709 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
7710 about possible signed overflow.
7711
7712 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
7713 (GDK_KEY_g): Don't define if already defined.
7714 (xg_prepare_tooltip): Avoid pointer signedness problem.
7715 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
7716
7717 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
7718 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
7719
7720 * xfns.c (Fx_window_property): Simplify a bit,
7721 to make a bit faster and to avoid GCC 4.6.0 warning.
7722 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
7723
7724 * fns.c (internal_equal): Don't assume size_t fits in int.
7725
7726 * alloc.c (compact_small_strings): Tighten assertion a little.
7727
7728 Replace pEd with more-general pI, and fix some printf arg casts.
7729 * lisp.h (pI): New macro, generalizing old pEd macro to other
7730 conversion specifiers. For example, use "...%"pI"d..." rather
7731 than "...%"pEd"...".
7732 (pEd): Remove. All uses replaced with similar uses of pI.
7733 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
7734 * alloc.c (check_pure_size): Don't overflow by converting size to int.
7735 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
7736 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
7737 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
7738 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
7739 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
7740 64-bit hosts.
7741 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
7742 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
7743 * print.c (safe_debug_print, print_object): Likewise.
7744 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
7745 to int.
7746 Use pI instead of if-then-else-abort. Use %p to avoid casts,
7747 avoiding the 0 flag, which is not portable.
7748 * process.c (Fmake_network_process): Use pI to avoid cast.
7749 * region-cache.c (pp_cache): Likewise.
7750 * xdisp.c (decode_mode_spec): Likewise.
7751 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
7752 behavior on 64-bit hosts with printf arg.
7753 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
7754 (x_stop_queuing_selection_requests): Likewise.
7755 (x_get_window_property): Don't truncate byte count to an 'int'
7756 when tracing.
7757
7758 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
7759 here, since it parses constructs like leading '-' and spaces,
7760 which are not wanted; and it overflows with large numbers.
7761 Instead, simply match F[0-9]+, which is what is wanted anyway.
7762
7763 * alloc.c: Remove unportable assumptions about struct layout.
7764 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
7765 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
7766 (allocate_vectorlike, make_pure_vector): Use the new macros,
7767 plus offsetof, to remove unportable assumptions about struct layout.
7768 These assumptions hold on all porting targets that I know of, but
7769 they are not guaranteed, they're easy to remove, and removing them
7770 makes further changes easier.
7771
7772 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
7773 This doesn't fix a bug but makes the code clearer.
7774 (string_overrun_cookie): Now const. Use initializers that
7775 don't formally overflow signed char, to avoid warnings.
7776 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
7777 can cause Emacs to crash when string overrun checking is enabled.
7778 (allocate_buffer): Don't assume sizeof (struct buffer) is a
7779 multiple of sizeof (EMACS_INT); it need not be, if
7780 alignof(EMACS_INT) < sizeof (EMACS_INT).
7781 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
7782
7783 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
7784
7785 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
7786
7787 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
7788
7789 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
7790 supposed to be handshaking. (Bug#8556)
7791 Reported by Paul Eggert <eggert@cs.ucla.edu>.
7792
7793 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
7794
7795 * lisp.h (Qdebug): List symbol.
7796 * eval.c (Qdebug): Restore global linkage.
7797 * keyboard.c (debug-on-event): New variable.
7798 (handle_user_signal): Break into debugger when debug-on-event
7799 matches the current signal symbol.
7800
7801 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
7802
7803 * alloc.c (check_sblock, check_string_bytes)
7804 (check_string_free_list): Convert to standard C.
7805
7806 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
7807
7808 * w32.c (emacs_gnutls_push): Fix typo.
7809
7810 2011-04-25 Eli Zaretskii <eliz@gnu.org>
7811
7812 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
7813 "cast to pointer from integer of different size".
7814
7815 Improve doprnt and its use in verror. (Bug#8545)
7816 * doprnt.c (doprnt): Document the set of format control sequences
7817 supported by the function. Use SAFE_ALLOCA instead of always
7818 using `alloca'.
7819
7820 * eval.c (verror): Don't limit the buffer size at size_max-1, that
7821 is one byte too soon. Don't use xrealloc; instead xfree and
7822 xmalloc anew.
7823
7824 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
7825
7826 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
7827 callbacks stage.
7828
7829 * gnutls.c: Renamed global_initialized to
7830 gnutls_global_initialized. Added internals for the
7831 :verify-hostname-error, :verify-error, and :verify-flags
7832 parameters of `gnutls-boot' and documented those parameters in the
7833 docstring. Start callback support.
7834 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
7835 unless a fatal error occurred. Call gnutls_alert_send_appropriate
7836 on error. Return error code.
7837 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
7838 (emacs_gnutls_read): Likewise.
7839 (Fgnutls_boot): Return handshake error code.
7840 (emacs_gnutls_handle_error): New function.
7841 (wsaerror_to_errno): Likewise.
7842
7843 * w32.h (emacs_gnutls_pull): Add prototype.
7844 (emacs_gnutls_push): Likewise.
7845
7846 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
7847 (emacs_gnutls_push): Likewise.
7848
7849 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
7850
7851 * process.c (wait_reading_process_output): Check if GnuTLS
7852 buffered some data internally if no FDs are set for TLS
7853 connections.
7854
7855 * makefile.w32-in (OBJ2): Add gnutls.$(O).
7856 (LIBS): Link to USER_LIBS.
7857 ($(BLD)/gnutls.$(0)): New target.
7858
7859 2011-04-24 Eli Zaretskii <eliz@gnu.org>
7860
7861 * xdisp.c (handle_single_display_spec): Rename the
7862 display_replaced_before_p argument into display_replaced_p, to
7863 make it consistent with the commentary. Fix typos in the
7864 commentary.
7865
7866 * textprop.c (syms_of_textprop): Remove dead code.
7867 (copy_text_properties): Delete obsolete commentary about an
7868 interface that was deleted long ago. Fix typos in the description
7869 of arguments.
7870
7871 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
7872 to changes in oldXMenu/XMenu.h from 2011-04-16.
7873 <menu_help_message, prev_menu_help_message>: Constify.
7874 (IT_menu_make_room): menu->help_text is now `const char **';
7875 adjust.
7876
7877 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
7878 to changes in oldXMenu/XMenu.h from 2011-04-16.
7879 (struct XMenu): Declare `help_text' `const char **'.
7880
7881 * xfaces.c <Qunspecified>: Make extern again.
7882
7883 * syntax.c: Include sys/types.h before including regex.h, as
7884 required by POSIX.
7885
7886 * doc.c (get_doc_string): Improve the format passed to `error'.
7887
7888 * doprnt.c (doprnt): Improve commentary.
7889
7890 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
7891
7892 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
7893 them with etags.
7894
7895 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
7896 changes in globals.h immediately force recompilation.
7897 (TAGS): Depend on $(CURDIR)/m/intel386.h and
7898 $(CURDIR)/s/ms-w32.h.
7899 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
7900
7901 * character.c (Fchar_direction): Function deleted.
7902 (syms_of_character): Don't defsubr it.
7903 <char-direction-table>: Deleted.
7904
7905 2011-04-23 Eli Zaretskii <eliz@gnu.org>
7906
7907 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
7908 * doprnt.c: Include limits.h.
7909 (SIZE_MAX): New macro.
7910 (doprnt): Return a size_t value. 2nd arg is now size_t.
7911 Many local variables are now size_t instead of int or unsigned.
7912 Improve overflow protection. Support `l' modifier for integer
7913 conversions. Support %l conversion. Don't assume an EMACS_INT
7914 argument for integer conversions and for %c.
7915
7916 * lisp.h (doprnt): Restore prototype.
7917
7918 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
7919 $(SRC)/character.h.
7920
7921 * Makefile.in (base_obj): Add back doprnt.o.
7922
7923 * deps.mk (doprnt.o): Add back prerequisites.
7924 (callint.o): Depend on character.h.
7925
7926 * eval.c (internal_lisp_condition_case): Include the handler
7927 representation in the error message.
7928 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
7929 when breaking from the loop.
7930
7931 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
7932
7933 * callint.c (Fcall_interactively): When displaying error message
7934 about invalid control letter, pass the character's codepoint, not
7935 a pointer to its multibyte form. Improve display of the character
7936 in octal and display also its hex code.
7937
7938 * character.c (char_string): Use %x to display the (unsigned)
7939 codepoint of an invalid character, to avoid displaying a bogus
7940 negative value.
7941
7942 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
7943 `error', not SYMBOL_NAME itself.
7944
7945 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
7946 character arguments to `error'.
7947
7948 * charset.c (check_iso_charset_parameter): Fix incorrect argument
7949 to `error' in error message about FINAL_CHAR argument. Make sure
7950 FINAL_CHAR is a character, and use %c when it is passed as
7951 argument to `error'.
7952
7953 2011-04-23 Eli Zaretskii <eliz@gnu.org>
7954
7955 * s/ms-w32.h (localtime): Redirect to sys_localtime.
7956
7957 * w32.c: Include <time.h>.
7958 (sys_localtime): New function.
7959
7960 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
7961
7962 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
7963
7964 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
7965
7966 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
7967
7968 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
7969 zombies (Bug#8467).
7970
7971 2011-04-19 Eli Zaretskii <eliz@gnu.org>
7972
7973 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
7974 gl_state.e_property when gl_state.object is Qt.
7975
7976 * insdel.c (make_gap_larger): Remove limitation of buffer size
7977 to <= INT_MAX.
7978
7979 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
7980
7981 * xdisp.c (lookup_glyphless_char_display)
7982 (produce_glyphless_glyph): Handle cons cell entry in
7983 glyphless-char-display.
7984 (Vglyphless_char_display): Document it.
7985
7986 * term.c (produce_glyphless_glyph): Handle cons cell entry in
7987 glyphless-char-display.
7988
7989 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
7990
7991 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
7992
7993 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
7994
7995 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
7996 definition for no-X builds.
7997
7998 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
7999
8000 Static checks with GCC 4.6.0 and non-default toolkits.
8001
8002 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
8003
8004 * process.c (keyboard_bit_set): Define only if SIGIO.
8005 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
8006 (send_process): Repair possible setjmp clobbering.
8007
8008 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
8009
8010 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
8011
8012 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
8013
8014 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
8015 Define only if needed.
8016
8017 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
8018 by pacifying GCC about it. Maybe it's time to retire it?
8019 * xfaces.c (USG, __TIMEVAL__): Likewise.
8020
8021 * dispextern.h (struct redisplay_interface): Rename param
8022 to avoid shadowing.
8023 * termhooks.h (struct terminal): Likewise.
8024 * xterm.c (xembed_send_message): Likewise.
8025
8026 * insdel.c (make_gap_smaller): Define only if
8027 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
8028
8029 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
8030 it.
8031
8032 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
8033 so that we aren't warned about unused symbols.
8034
8035 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
8036
8037 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
8038
8039 * xfns.c (x_real_positions): Mark locals as initialized.
8040
8041 * xmenu.c (xmenu_show): Don't use uninitialized vars.
8042
8043 * xterm.c: Fix problems found by static analysis with other toolkits.
8044 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
8045 (x_dispatch_event): Declare static if USE_GTK, and
8046 define if USE_GTK || USE_X_TOOLKIT.
8047 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
8048 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
8049 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
8050 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
8051
8052 * xmenu.c (menu_help_callback): Pointer type fixes.
8053 Use const pointers when pointing at readonly data. Avoid pointer
8054 signedness clashes.
8055 (FALSE): Remove unused macro.
8056 (update_frame_menubar): Remove unused decl.
8057
8058 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
8059
8060 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
8061 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
8062 (single_menu_item): Rename local to avoid shadowing.
8063
8064 * keyboard.c (make_lispy_event): Remove unused local var.
8065
8066 * frame.c, frame.h (x_get_resource_string): Bring this back, but
8067 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
8068
8069 * bitmaps: Change bitmaps from unsigned char back to the X11
8070 compatible char. Avoid the old compiler warnings about
8071 out-of-range initializers by using, for example, '\xab' rather
8072 than 0xab.
8073
8074 * xgselect.c (xgselect_initialize): Check vs interface
8075 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
8076
8077 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
8078
8079 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
8080 to read-only memory.
8081
8082 * fns.c (vector): Remove; this old hack is no longer needed.
8083
8084 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
8085 Remove unused var.
8086 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
8087
8088 * xrdb.c (x_load_resources): Omit unused local.
8089
8090 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8091 (x_window): Rename locals to avoid shadowing.
8092 (USG): Use the kludged USG macro, to pacify gcc.
8093
8094 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
8095 (x_term_init): Remove local to avoid shadowing.
8096
8097 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
8098
8099 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
8100 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
8101
8102 2011-04-16 Eli Zaretskii <eliz@gnu.org>
8103
8104 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
8105
8106 Fix regex.c, syntax.c and friends for buffers > 2GB.
8107 * syntax.h (struct gl_state_s): Declare character position members
8108 EMACS_INT.
8109
8110 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
8111
8112 * textprop.c (verify_interval_modification, interval_of):
8113 Declare arguments EMACS_INT.
8114
8115 * intervals.c (adjust_intervals_for_insertion): Declare arguments
8116 EMACS_INT.
8117
8118 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
8119
8120 * indent.c (Fvertical_motion): Local variable it_start is now
8121 EMACS_INT.
8122
8123 * regex.c (re_match, re_match_2, re_match_2_internal)
8124 (bcmp_translate, regcomp, regexec, print_double_string)
8125 (group_in_compile_stack, re_search, re_search_2, regex_compile)
8126 (re_compile_pattern, re_exec): Declare arguments and local
8127 variables `size_t' and `ssize_t' and return values `regoff_t', as
8128 appropriate.
8129 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
8130 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
8131 <compile_stack_type>: `size' and `avail' are now `size_t'.
8132
8133 * regex.h <regoff_t>: Use ssize_t, not int.
8134 (re_search, re_search_2, re_match, re_match_2): Arguments that
8135 specify buffer/string position and length are now ssize_t and
8136 size_t. Return type is regoff_t.
8137
8138 2011-04-16 Ben Key <bkey76@gmail.com>
8139
8140 * nsfont.m: Fixed bugs in ns_get_family and
8141 ns_descriptor_to_entity that were caused by using free to
8142 deallocate memory blocks that were allocated by xmalloc (via
8143 xstrdup). This caused Emacs to crash when compiled with
8144 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
8145 --enable-checking=xmallocoverrun). xfree is now used to
8146 deallocate these memory blocks.
8147
8148 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
8149
8150 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
8151
8152 emacs_write: Accept and return EMACS_INT for sizes.
8153 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
8154 et seq.
8155 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
8156 Accept and return EMACS_INT.
8157 (emacs_gnutls_write): Return the number of bytes written on
8158 partial writes.
8159 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
8160 (emacs_read, emacs_write): Remove check for negative size, as the
8161 Emacs source code has been audited now.
8162 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
8163 (emacs_read, emacs_write): Use it.
8164 * process.c (send_process): Adjust to the new signatures of
8165 emacs_write and emacs_gnutls_write. Do not attempt to store
8166 a byte offset into an 'int'; it might overflow.
8167 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
8168
8169 * sound.c: Don't assume sizes fit in 'int'.
8170 (struct sound_device.period_size, alsa_period_size):
8171 Return EMACS_INT, not int.
8172 (struct sound_device.write, vox_write, alsa_write):
8173 Accept EMACS_INT, not int.
8174 (wav_play, au_play): Use EMACS_INT to store sizes and to
8175 record read return values.
8176
8177 2011-04-15 Ben Key <bkey76@gmail.com>
8178
8179 * keyboard.c (Qundefined): Don't declare static since it is used
8180 in nsfns.m.
8181 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
8182 static since they are used in nsfont.m.
8183
8184 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
8185
8186 * process.c (Qprocessp): Don't declare static.
8187 * lisp.h (Qprocessp): Declare again.
8188
8189 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
8190
8191 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
8192
8193 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
8194
8195 Improve C-level modularity by making more things 'static'.
8196
8197 Don't publish debugger-only interfaces to other modules.
8198 * lisp.h (safe_debug_print, debug_output_compilation_hack):
8199 (verify_bytepos, count_markers): Move decls to the only modules
8200 that need them.
8201 * region-cache.h (pp_cache): Likewise.
8202 * window.h (check_all_windows): Likewise.
8203 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
8204
8205 * sysdep.c (croak): Now static, if
8206 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
8207 * syssignal.h (croak): Declare only if not static.
8208
8209 * alloc.c (refill_memory_reserve): Now static if
8210 !defined REL_ALLOC || defined SYSTEM_MALLOC.
8211 * lisp.h (refill_memory_reserve): Declare only if not static.
8212
8213 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
8214 Define only if USE_LUCID.
8215
8216 * xrdb.c (x_customization_string, x_rm_string): Now static.
8217
8218 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
8219 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
8220
8221 * xdisp.c (draw_row_with_mouse_face): Now static.
8222 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
8223
8224 * window.h (check_all_windows): Mark externally visible.
8225
8226 * window.c (window_deletion_count): Now static.
8227
8228 * undo.c: Make symbols static if they're not exported.
8229 (last_undo_buffer, last_boundary_position, pending_boundary):
8230 Now static.
8231
8232 * textprop.c (interval_insert_behind_hooks): Now static.
8233 (interval_insert_in_front_hooks): Likewise.
8234
8235 * term.c: Make symbols static if they're not exported.
8236 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
8237 (max_frame_lines, tty_set_terminal_modes):
8238 (tty_reset_terminal_modes, tty_turn_off_highlight):
8239 (get_tty_terminal): Now static.
8240 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
8241 * termhooks.h (term_mouse_moveto): Do not declare if
8242 HAVE_WINDOW_SYSTEM.
8243 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
8244 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
8245
8246 * sysdep.c: Make symbols static if they're not exported.
8247 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
8248 Now static.
8249 (sigprocmask_set, full_mask): Remove; unused.
8250 (wait_debugging): Mark as visible.
8251 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
8252 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
8253
8254 * syntax.c (syntax_temp): Define only if !__GNUC__.
8255
8256 * sound.c (current_sound_device, current_sound): Now static.
8257
8258 * search.c (searchbufs, searchbuf_head): Now static.
8259
8260 * scroll.c (scroll_cost): Remove; unused.
8261 * dispextern.h (scroll_cost): Remove decl.
8262
8263 * region-cache.h (pp_cache): Mark as externally visible.
8264
8265 * process.c: Make symbols static if they're not exported.
8266 (process_tick, update_tick, create_process, chan_process):
8267 (Vprocess_alist, proc_buffered_char, datagram_access):
8268 (fd_callback_data, send_process_frame, process_sent_to): Now static.
8269 (deactivate_process): Mark defn as static, as well as decl.
8270 * lisp.h (create_process): Remove decl.
8271 * process.h (chan_process, Vprocess_alist): Remove decls.
8272
8273 * print.c: Make symbols static if they're not exported.
8274 (print_depth, new_backquote_output, being_printed, print_buffer):
8275 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
8276 (print_interval, print_number_index, initial_stderr_stream):
8277 Now static.
8278 * lisp.h (Fprinc): Remove decl.
8279 (debug_output_compilation_hack): Mark as externally visible.
8280
8281 * sysdep.c (croak): Move decl from here to syssignal.h.
8282 * syssignal.h (croak): Put it here, so the API can be checked when
8283 'croak' is called from dissociate_if_controlling_tty.
8284
8285 * minibuf.c: Make symbols static if they're not exported.
8286 (minibuf_save_list, choose_minibuf_frame): Now static.
8287 * lisp.h (choose_minibuf_frame): Remove decl.
8288
8289 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
8290
8291 * lread.c: Make symbols static if they're not exported.
8292 (read_objects, initial_obarray, oblookup_last_bucket_number):
8293 Now static.
8294 (make_symbol): Remove; unused.
8295 * lisp.h (initial_obarray, make_symbol): Remove decls.
8296
8297 * keyboard.c: Make symbols static if they're not exported.
8298 (single_kboard, recent_keys_index, total_keys, recent_keys):
8299 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
8300 (this_single_command_key_start, echoing, last_auto_save):
8301 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
8302 (command_loop, echo_now, keyboard_init_hook, help_char_p):
8303 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
8304 (Vlispy_mouse_stem, double_click_count):
8305 Now static.
8306 (force_auto_save_soon): Define only if SIGDANGER.
8307 (ignore_mouse_drag_p): Now static if
8308 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
8309 (print_help): Remove; unused.
8310 (stop_character, last_timer_event): Mark as externally visible.
8311 * keyboard.h (ignore_mouse_drag_p): Declare only if
8312 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
8313 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
8314 * lisp.h (echoing): Remove decl.
8315 (force_auto_save_soon): Declare only if SIGDANGER.
8316 * xdisp.c (redisplay_window): Simplify code, to make it more
8317 obvious that ignore_mouse_drag_p is not accessed if !defined
8318 USE_GTK && !defined HAVE_NS.
8319
8320 * intervals.c: Make symbols static if they're not exported.
8321 (merge_properties_sticky, merge_interval_right, delete_interval):
8322 Now static.
8323 * intervals.h (merge_interval_right, delete_interval): Remove decls.
8324
8325 * insdel.c: Make symbols static if they're not exported.
8326 However, leave prepare_to_modify_buffer alone. It's never
8327 called from outside this function, but that appears to be a bug.
8328 (combine_after_change_list, combine_after_change_buffer):
8329 (adjust_after_replace, signal_before_change): Now static.
8330 (adjust_after_replace_noundo): Remove; unused.
8331 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
8332 (signal_before_change): Remove decls.
8333
8334 * indent.c (val_compute_motion, val_vmotion): Now static.
8335
8336 * image.c: Make symbols static if they're not exported.
8337 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
8338 if USE_GTK.
8339 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
8340 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
8341
8342 * fringe.c (standard_bitmaps): Now static.
8343 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
8344
8345 * frame.c: Make symbols static if they're not exported.
8346 (x_report_frame_params, make_terminal_frame): Now static.
8347 (get_frame_param): Now static, unless HAVE_NS.
8348 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
8349 (x_get_resource_string): Remove; not used.
8350 * frame.h (make_terminal_frame, x_report_frame_params):
8351 (x_get_resource_string); Remove decls.
8352 (x_fullscreen_adjust): Declare only if WINDOWSNT.
8353 * lisp.h (get_frame_param): Declare only if HAVE_NS.
8354
8355 * font.c, fontset.c: Make symbols static if they're not exported.
8356 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
8357 (FACE_SUITABLE_FOR_CHAR_P): Use it.
8358 * font.c (font_close_object): Now static.
8359 * font.h (font_close_object): Remove.
8360 * fontset.c (FONTSET_OBJLIST): Remove.
8361 (free_realized_fontset) #if-0 the body, which does nothing.
8362 (face_suitable_for_char_p): #if-0, as it's never called.
8363 * fontset.h (face_suitable_for_char_p): Remove decl.
8364 * xfaces.c (face_at_string_position):
8365 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
8366 since 0 is always ASCII.
8367
8368 * fns.c (weak_hash_tables): Now static.
8369
8370 * fileio.c: Make symbols static if they're not exported.
8371 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
8372 (Vwrite_region_annotation_buffers): Now static.
8373
8374 * eval.c: Make symbols static if they're not exported.
8375 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
8376 * lisp.h (backtrace_list): Remove decl.
8377
8378 * emacs.c: Make symbols static if they're not exported.
8379 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
8380 (fatal_error_code, fatal_error_signal_hook, standard_args):
8381 Now static.
8382 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
8383 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
8384 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
8385 * lisp.h (fatal_error_signal_hook): Remove decl.
8386 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
8387
8388 * editfns.c: Move a (normally-unused) function to its only use.
8389 * editfns.c, lisp.h (get_operating_system_release): Remove.
8390 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
8391 worth the hassle of breaking this out.
8392
8393 * xterm.c: Make symbols static if they're not exported.
8394 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
8395 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
8396 (x_destroy_window, x_delete_display):
8397 Now static.
8398 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
8399 (x_mouse_leave): Remove; unused.
8400 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
8401 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
8402 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
8403 Remove decls.
8404 (x_mouse_leave): Declare only if WINDOWSNT.
8405 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
8406 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
8407 USE_X_TOOLKIT.
8408
8409 * ftxfont.c: Make symbols static if they're not exported.
8410 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
8411 HAVE_FREETYPE.
8412 * font.h (ftxfont_driver): Likewise.
8413
8414 * xfns.c: Make symbols static if they're not exported.
8415 (x_last_font_name, x_display_info_for_name):
8416 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
8417 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
8418 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
8419 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
8420 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
8421 (last_show_tip_args): Now static.
8422 (xic_defaut_fontset, xic_create_fontsetname): Define only if
8423 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
8424 (x_screen_planes): Remove; unused.
8425 * dispextern.h (x_screen_planes): Remove decl.
8426
8427 * dispnew.c: Make symbols static if they're not exported.
8428 * dispextern.h (redraw_garbaged_frames, scrolling):
8429 (increment_row_positions): Remove.
8430 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
8431 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
8432 Now static.
8433 (redraw_garbaged_frames): Remove; unused.
8434
8435 * xfaces.c: Make symbols static if they're not exported.
8436 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
8437 Remove decls.
8438 * xterm.h (defined_color): Remove decls.
8439 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
8440 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
8441 (menu_face_changed_default, defined_color, free_realized_face):
8442 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
8443 (ascii_face_of_lisp_face): Remove; unused.
8444
8445 * xdisp.c: Make symbols static if they're not exported.
8446 * dispextern.h (scratch_glyph_row, window_box_edges):
8447 (glyph_to_pixel_coords, set_cursor_from_row):
8448 (get_next_display_element, set_iterator_to_next):
8449 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
8450 (show_mouse_face): Remove decls
8451 * frame.h (message_buf_print): Likewise.
8452 * lisp.h (pop_message, set_message, check_point_in_composition):
8453 Likewise.
8454 * xterm.h (set_vertical_scroll_bar): Likewise.
8455 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
8456 (message_buf_print, scratch_glyph_row, displayed_buffer):
8457 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
8458 (get_next_display_element, show_mouse_face, window_box_edges):
8459 (frame_to_window_pixel_xy, check_point_in_composition):
8460 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
8461 (glyph_to_pixel_coords): Remove; unused.
8462
8463 * dired.c (file_name_completion): Now static.
8464
8465 * dbusbind.c (xd_in_read_queued_messages): Now static.
8466
8467 * lisp.h (circular_list_error, FOREACH): Remove; unused.
8468 * data.c (circular_list_error): Remove.
8469
8470 * commands.h (last_point_position, last_point_position_buffer):
8471 (last_point_position_window): Remove decls.
8472 * keyboard.c: Make these variables static.
8473
8474 * coding.h (coding, code_convert_region, encode_coding_gap):
8475 Remove decls.
8476 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
8477 (iso_code_class, detect_coding, code_convert_region): Now static.
8478 (encode_coding_gap): Remove; unused.
8479
8480 * chartab.c (chartab_chars, chartab_bits): Now static.
8481
8482 * charset.h (charset_iso_8859_1): Remove decl.
8483 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
8484 Now static.
8485
8486 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
8487 * ccl.c (Vccl_program_table): Now static.
8488 (check_ccl_update): Remove; unused.
8489
8490 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
8491 * category.h: ... from here.
8492 * category.c (check_category_table, set_category_set): Now static.
8493
8494 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
8495 * lisp.h: Remove these decls.
8496
8497 * buffer.c (buffer_count): Remove unused var.
8498
8499 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
8500 so that it's not optimized away.
8501 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
8502 * dispextern.h (bidi_dump_cached_states): Remove, since it's
8503 exported only to the debugger.
8504
8505 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
8506 * atimer.h (run_all_atimers): Remove; not exported.
8507
8508 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
8509 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
8510 was inaccessible from Lisp.
8511 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
8512 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
8513
8514 alloc.c: Import and export fewer symbols, and remove unused items.
8515 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
8516 is defined.
8517 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
8518 it's not optimized away by whole-program optimization.
8519 (message_enable_multibyte, free_misc): Remove.
8520 (catchlist, handlerlist, mark_backtrace):
8521 Declare only if BYTE_MARK_STACK.
8522 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
8523 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
8524 (message_enable_multibyte): Remove decl.
8525 (free_misc, interval_free_list, float_block, float_block_index):
8526 (n_float_blocks, float_free_list, cons_block, cons_block_index):
8527 (cons_free_list, last_marked_index):
8528 Now static.
8529 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
8530 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
8531 (mark_backtrace): Define only if BYTE_MARK_STACK.
8532 * xdisp.c (message_enable_multibyte): Now static.
8533
8534 Declare Lisp_Object Q* variables to be 'static' if not exported.
8535 This makes it easier for human readers (and static analyzers)
8536 to see whether these variables are used from other modules.
8537 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
8538 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
8539 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
8540 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
8541 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
8542 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
8543 * xmenu.c, xselect.c:
8544 Declare Q* vars static if they are not used in other modules.
8545 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
8546 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
8547 Remove decls of unexported vars.
8548 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
8549
8550 * lisp.h (DEFINE_FUNC): Make sname 'static'.
8551
8552 Make Emacs functions such as Fatom 'static' by default.
8553 This makes it easier for human readers (and static analyzers)
8554 to see whether these functions can be called from other modules.
8555 DEFUN now defines a static function. To make the function external
8556 so that it can be used in other C modules, use the new macro DEFUE.
8557 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
8558 (Finit_image_library):
8559 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
8560 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
8561 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
8562 Remove decls, since these functions are now static.
8563 (Funintern, Fget_internal_run_time): New decls, since these functions
8564 were already external.
8565
8566 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
8567 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
8568 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
8569 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
8570 * keyboard.c, keymap.c, lread.c:
8571 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
8572 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
8573 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
8574 Mark functions with DEFUE instead of DEFUN,
8575 if they are used in other modules.
8576 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
8577 decls for now-static functions.
8578 * buffer.h (Fdelete_overlay): Remove decl.
8579 * callproc.c (Fgetenv_internal): Mark as internal.
8580 * composite.c (Fremove_list_of_text_properties): Remove decl.
8581 (Fcomposition_get_gstring): New forward static decl.
8582 * composite.h (Fcomposite_get_gstring): Remove decl.
8583 * dired.c (Ffile_attributes): New forward static decl.
8584 * doc.c (Fdocumntation_property): New forward static decl.
8585 * eval.c (Ffetch_bytecode): New forward static decl.
8586 (Funintern): Remove extern decl; now in .h file where it belongs.
8587 * fileio.c (Fmake_symbolic_link): New forward static decl.
8588 * image.c (Finit_image_library): New forward static decl.
8589 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
8590 * intervals.h (Fprevious_property_change):
8591 (Fremove_list_of_text_properties): Remove decls.
8592 * keyboard.c (Fthis_command_keys): Remove decl.
8593 (Fcommand_execute): New forward static decl.
8594 * keymap.c (Flookup_key): New forward static decl.
8595 (Fcopy_keymap): Now static.
8596 * keymap.h (Flookup_key): Remove decl.
8597 * process.c (Fget_process): New forward static decl.
8598 (Fprocess_datagram_address): Mark as internal.
8599 * syntax.c (Fsyntax_table_p): New forward static decl.
8600 (skip_chars): Remove duplicate decl.
8601 * textprop.c (Fprevious_property_change): New forward static decl.
8602 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
8603 Now internal.
8604 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
8605 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
8606
8607 * editfns.c (Fformat): Remove unreachable code.
8608
8609 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
8610
8611 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
8612 change. (Bug#8496)
8613
8614 2011-04-13 Eli Zaretskii <eliz@gnu.org>
8615
8616 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
8617 when at ZV. (Bug#8487)
8618
8619 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
8620
8621 * charset.c (Fclear_charset_maps): Use xfree instead of free.
8622 (Bug#8437)
8623 * keyboard.c (parse_tool_bar_item): Likewise.
8624 * sound.c (sound_cleanup, alsa_close): Likewise.
8625 * termcap.c (tgetent): Likewise.
8626 * xfns.c (x_default_font_parameter): Likewise.
8627 * xsettings.c (read_and_apply_settings): Likewise.
8628
8629 * alloc.c (overrun_check_malloc, overrun_check_realloc)
8630 (overrun_check_free): Protoize.
8631
8632 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
8633
8634 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
8635 since callers should never pass a negative size.
8636 Change the signature to match that of plain 'read' and 'write'; see
8637 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
8638 * lisp.h: Update prototypes of emacs_write and emacs_read.
8639
8640 2011-04-11 Eli Zaretskii <eliz@gnu.org>
8641
8642 * xdisp.c (redisplay_window): Don't try to determine the character
8643 position of the scroll margin if the window start point w->startp
8644 is outside the buffer's accessible region. (Bug#8468)
8645
8646 2011-04-10 Eli Zaretskii <eliz@gnu.org>
8647
8648 Fix write-region and its subroutines for buffers > 2GB.
8649 * fileio.c (a_write, e_write): Modify declaration of arguments and
8650 local variables to support buffers larger than 2GB.
8651 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
8652
8653 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
8654 argument, local variables, and return value.
8655
8656 * lisp.h: Update prototypes of emacs_write and emacs_read.
8657
8658 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
8659
8660 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
8661
8662 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
8663
8664 Fix more problems found by GCC 4.6.0's static checks.
8665
8666 * xdisp.c (vmessage): Use a better test for character truncation.
8667
8668 * charset.c (load_charset_map): <, not <=, for optimization,
8669 and to avoid potential problems with integer overflow.
8670 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
8671 * casetab.c (set_identity, shuffle): Likewise.
8672 * editfns.c (Fformat): Likewise.
8673 * syntax.c (skip_chars): Likewise.
8674
8675 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
8676 This also lets GCC 4.6.0 generate slightly better loop code.
8677
8678 * callint.c (Fcall_interactively): <, not <=, for optimization.
8679 (Fcall_interactively): Count the number of arguments produced,
8680 not the number of arguments given. This is simpler and lets GCC
8681 4.6.0 generate slightly better code.
8682
8683 * ftfont.c: Distingish more carefully between FcChar8 and char.
8684 The previous code passed unsigned char * to a functions like
8685 strlen and xstrcasecmp that expect char *, which does not
8686 conform to the C standard.
8687 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
8688 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
8689 char * when the C standard requires it.
8690
8691 * keyboard.c (read_char): Remove unused var.
8692
8693 * eval.c: Port to Windows vsnprintf (Bug#8435).
8694 Include <limits.h>.
8695 (SIZE_MAX): Define if the headers do not.
8696 (verror): Do not give up if vsnprintf returns a negative count.
8697 Instead, grow the buffer. This ports to Windows vsnprintf, which
8698 does not conform to C99. Problem reported by Eli Zaretskii.
8699 Also, simplify the allocation scheme, by avoiding the need for
8700 calling realloc, and removing the ALLOCATED variable.
8701
8702 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
8703
8704 Remove invocations of doprnt, as Emacs now uses vsnprintf.
8705 But keep the doprint source code for now, as we might revamp it
8706 and use it again (Bug#8435).
8707 * lisp.h (doprnt): Remove.
8708 * Makefile.in (base_obj): Remove doprnt.o.
8709 * deps.mk (doprnt.o): Remove.
8710
8711 error: Print 32- and 64-bit integers portably (Bug#8435).
8712 Without this change, on typical 64-bit hosts error ("...%d...", N)
8713 was used to print both 32- and 64-bit integers N, which relied on
8714 undefined behavior.
8715 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
8716 * lisp.h (error, verror): Mark as printf-like functions.
8717 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
8718 Report overflow in size calculations when allocating printf buffer.
8719 Do not truncate output string at its first null byte.
8720 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
8721 Truncate the output at a character boundary, since vsnprintf does not
8722 do that.
8723 * charset.c (check_iso_charset_parameter): Convert internal
8724 character to string before calling 'error', since %c now has the
8725 printf meaning.
8726 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
8727 overflow when computing char to be passed to 'error'. Do not
8728 pass Lisp_Object to 'error'; pass the integer instead.
8729 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
8730 formatted with plain %d.
8731
8732 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
8733
8734 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
8735
8736 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
8737
8738 * xterm.c (x_catch_errors): Remove duplicate declaration.
8739
8740 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
8741
8742 * xdisp.c, lisp.h (message_nolog): Remove; unused.
8743
8744 2011-04-10 Jim Meyering <meyering@redhat.com>
8745
8746 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
8747 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
8748 return ssize_t not "int", and use size_t as the buffer length.
8749 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
8750 * gnutls.h: Update declarations.
8751 * process.c (read_process_output): Use ssize_t, to match.
8752 (send_process): Likewise.
8753
8754 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
8755
8756 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
8757
8758 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
8759
8760 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
8761 Use unsigned char, to match FcChar8 type definition.
8762
8763 * xterm.c (handle_one_xevent):
8764 * xmenu.c (create_and_show_popup_menu):
8765 * xselect.c (x_decline_selection_request)
8766 (x_reply_selection_request): Avoid type-punned deref of X events.
8767
8768 2011-04-09 Eli Zaretskii <eliz@gnu.org>
8769
8770 Fix some uses of `int' instead of EMACS_INT.
8771 * search.c (string_match_1, fast_string_match)
8772 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
8773 (scan_buffer, find_next_newline_no_quit)
8774 (find_before_next_newline, search_command, Freplace_match)
8775 (Fmatch_data): Make some `int' variables be EMACS_INT.
8776
8777 * xdisp.c (display_count_lines): 3rd argument and return value now
8778 EMACS_INT. All callers changed.
8779 (pint2hrstr): Last argument is now EMACS_INT.
8780
8781 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
8782 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8783 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
8784 (decode_coding_utf_16, decode_coding_emacs_mule)
8785 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
8786 (decode_coding_ccl, decode_coding_charset)
8787 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
8788 (decode_coding_iso_2022, decode_coding_emacs_mule)
8789 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
8790 <char_offset, last_offset>: Declare EMACS_INT.
8791 (encode_coding_utf_8, encode_coding_utf_16)
8792 (encode_coding_emacs_mule, encode_invocation_designation)
8793 (encode_designation_at_bol, encode_coding_iso_2022)
8794 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
8795 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
8796 Declare EMACS_INT.
8797 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
8798 (encode_invocation_designation): Last argument P_NCHARS is now
8799 EMACS_INT.
8800 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
8801 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
8802
8803 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
8804 All users changed.
8805
8806 * ccl.c (Fccl_execute_on_string): Declare some variables
8807 EMACS_INT.
8808
8809 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
8810
8811 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
8812
8813 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
8814
8815 * process.c (Fformat_network_address): Doc fix.
8816
8817 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
8818
8819 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
8820
8821 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
8822
8823 * keyboard.c (read_char): Call Lisp function help-form-show,
8824 instead of using internal_with_output_to_temp_buffer.
8825 (Qhelp_form_show): New var.
8826 (syms_of_keyboard): Use DEFSYM macro.
8827
8828 * print.c (internal_with_output_to_temp_buffer): Function deleted.
8829
8830 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
8831
8832 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
8833
8834 * process.c (Flist_processes): Remove to Lisp.
8835 (list_processes_1): Delete.
8836
8837 2011-04-06 Eli Zaretskii <eliz@gnu.org>
8838
8839 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
8840
8841 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
8842
8843 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
8844
8845 Fix more problems found by GCC 4.6.0's static checks.
8846
8847 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
8848
8849 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
8850
8851 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
8852
8853 * xdisp.c (vmessage): Mark as a printf-like function.
8854
8855 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
8856
8857 * sound.c (sound_warning): Don't crash if arg contains a printf format.
8858
8859 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
8860 printf-like functions.
8861 (tiff_load): Add casts to remove these marks before passing them
8862 to system-supplied API.
8863
8864 * eval.c (Fsignal): Remove excess argument to 'fatal'.
8865
8866 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
8867 This avoids several warnings with gcc -Wstrict-overflow.
8868 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
8869 directly, rather than having caller test rule sign. This avoids
8870 some unnecessary tests.
8871 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
8872 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
8873 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
8874
8875 * xfont.c (xfont_text_extents): Remove var that was set but not used.
8876 (xfont_open): Avoid unnecessary tests.
8877
8878 * composite.c (composition_gstring_put_cache): Use unsigned integer.
8879
8880 * composite.h, composite.c (composition_gstring_put_cache):
8881 Use EMACS_INT, not int, for length.
8882
8883 * composite.h (COMPOSITION_DECODE_REFS): New macro,
8884 breaking out part of COMPOSITION_DECODE_RULE.
8885 (COMPOSITION_DECODE_RULE): Use it.
8886 * composite.c (get_composition_id): Remove unused local vars,
8887 by using the new macro.
8888
8889 * textprop.c (set_text_properties_1): Change while to do-while,
8890 since the condition is always true at first.
8891
8892 * intervals.c (graft_intervals_into_buffer): Mark var as used.
8893 (interval_deletion_adjustment): Return unsigned value.
8894 All uses changed.
8895
8896 * process.c (list_processes_1, create_pty, read_process_output):
8897 (exec_sentinel): Remove vars that were set but not used.
8898 (create_pty): Remove unnecessary "volatile"s.
8899 (Fnetwork_interface_info): Avoid possibility of int overflow.
8900 (read_process_output): Do adaptive read buffering even if carryover.
8901 (read_process_output): Simplify nbytes computation if buffered.
8902
8903 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
8904
8905 * syntax.c (scan_words): Remove var that was set but not used.
8906 (update_syntax_table): Use unsigned instead of int.
8907
8908 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
8909 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
8910 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
8911
8912 * print.c (print_error_message): Avoid int overflow.
8913
8914 * font.c (font_list_entities): Redo for clarity,
8915 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
8916
8917 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
8918 (font_score): Avoid potential overflow in diff calculation.
8919
8920 * fns.c (substring_both): Remove var that is set but not used.
8921 (sxhash): Redo loop for clarity and to avoid wraparound warning.
8922
8923 * eval.c (funcall_lambda): Rename local to avoid shadowing.
8924
8925 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
8926 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
8927 can always succeed if overflow has undefined behavior.
8928
8929 * search.c (boyer_moore, wordify): Remove vars set but not used.
8930 (wordify): Omit three unnecessary tests.
8931
8932 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
8933 All callers changed. This avoids the need for an unused var.
8934
8935 * casefiddle.c (casify_region): Remove var that is set but not used.
8936
8937 * dired.c (file_name_completion): Remove var that is set but not used.
8938
8939 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
8940
8941 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
8942 (Finsert_file_contents): Remove unnecessary code checking fd.
8943
8944 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
8945 Check for integer overflow on size calculations.
8946
8947 * buffer.c (Fprevious_overlay_change): Remove var that is set
8948 but not used.
8949
8950 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
8951 Remove vars that are set but not used.
8952 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
8953 (timer_check_2): Mark vars as initialized.
8954
8955 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
8956
8957 * image.c (lookup_image): Remove var that is set but not used.
8958 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
8959
8960 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
8961 that are set but not used.
8962
8963 * xfns.c (make_invisible_cursor): Don't return garbage
8964 if XCreateBitmapFromData fails (Bug#8410).
8965
8966 * xselect.c (x_get_local_selection, x_handle_property_notify):
8967 Remove vars that are set but not used.
8968
8969 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
8970 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
8971
8972 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
8973 Remove var that is set but not used.
8974 (scroll_bar_windows_size): Now size_t, not int.
8975 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
8976 Check for overflow.
8977
8978 * xfaces.c (realize_named_face): Remove vars that are set but not used.
8979 (map_tty_color) [!defined MSDOS]: Likewise.
8980
8981 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
8982
8983 * coding.c: Remove vars that are set but not used.
8984 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
8985 All callers changed.
8986 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
8987 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
8988 (decode_coding_charset): Remove vars that are set but not used.
8989
8990 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
8991 that is set but not used.
8992
8993 * print.c (print_object): Remove var that is set but not used.
8994
8995 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
8996 The gnulib version avoids calling malloc in the usual case,
8997 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
8998 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
8999 * filelock.c (current_lock_owner): Likewise.
9000 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
9001 * sysdep.c: Include allocator.h, careadlinkat.h.
9002 (emacs_no_realloc_allocator): New static constant.
9003 (emacs_readlink): New function.
9004 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
9005 ../lib/careadlinkat.h.
9006
9007 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
9008
9009 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
9010 first non-nil return value).
9011
9012 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
9013
9014 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
9015 if not defined (Bug#8403).
9016
9017 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
9018
9019 * xdisp.c (display_count_lines): Remove parameter `start',
9020 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9021 (get_char_face_and_encoding): Remove parameter `multibyte_p',
9022 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9023 (fill_stretch_glyph_string): Remove parameters `row' and `area',
9024 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
9025 and thereabouts. All callers changed.
9026 (get_per_char_metric): Remove parameter `f', unused since
9027 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
9028
9029 2011-04-02 Jim Meyering <meyering@redhat.com>
9030
9031 do not dereference NULL upon failed strdup
9032 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
9033 (ns_get_family): Likewise.
9034
9035 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
9036
9037 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
9038
9039 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
9040
9041 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
9042 later (Bug#8403).
9043
9044 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
9045
9046 Add lexical binding.
9047
9048 * window.c (Ftemp_output_buffer_show): New fun.
9049 (Fsave_window_excursion):
9050 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
9051
9052 * lread.c (lisp_file_lexically_bound_p): New function.
9053 (Fload): Bind Qlexical_binding.
9054 (readevalloop): Remove `evalfun' arg.
9055 Bind Qinternal_interpreter_environment.
9056 (Feval_buffer): Bind Qlexical_binding.
9057 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
9058 Mark as dynamic.
9059 (syms_of_lread): Declare `lexical-binding'.
9060
9061 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
9062
9063 * keyboard.c (eval_dyn): New fun.
9064 (menu_item_eval_property): Use it.
9065
9066 * image.c (parse_image_spec): Use Ffunctionp.
9067
9068 * fns.c (concat, mapcar1): Accept byte-code-functions.
9069
9070 * eval.c (Fsetq): Handle lexical vars.
9071 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
9072 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
9073 (FletX, Flet): Obey lexical binding.
9074 (Fcommandp): Handle closures.
9075 (Feval): New `lexical' arg.
9076 (eval_sub): New function extracted from Feval. Use it almost
9077 everywhere where Feval was used. Look up vars in lexical env.
9078 Handle closures.
9079 (Ffunctionp): Move from subr.el.
9080 (Ffuncall): Handle closures.
9081 (apply_lambda): Remove `eval_flags'.
9082 (funcall_lambda): Handle closures and new byte-code-functions.
9083 (Fspecial_variable_p): New function.
9084 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
9085 but without exporting it to Lisp.
9086
9087 * doc.c (Fdocumentation, store_function_docstring):
9088 * data.c (Finteractive_form): Handle closures.
9089
9090 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
9091 interactive spec.
9092
9093 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
9094 New byte-codes.
9095 (exec_byte_code): New function extracted from Fbyte_code to handle new
9096 calling convention for byte-code-functions. Add new byte-codes.
9097
9098 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
9099
9100 * alloc.c (Fmake_symbol): Init new `declared_special' field.
9101
9102 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
9103
9104 * xdisp.c (redisplay_internal): Fix prototype.
9105
9106 2011-03-31 Eli Zaretskii <eliz@gnu.org>
9107
9108 * xdisp.c (SCROLL_LIMIT): New macro.
9109 (try_scrolling): Use it when setting scroll_limit.
9110 Limit scrolling to 100 screen lines.
9111 (redisplay_window): Even when falling back on "recentering",
9112 position point in the window according to scroll-conservatively,
9113 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
9114
9115 (try_scrolling): When point is above the window, allow searching
9116 as far as scroll_max, or one screenful, to compute vertical
9117 distance from PT to the scroll margin position. This prevents
9118 try_scrolling from unnecessarily failing when
9119 scroll-conservatively is set to a value slightly larger than the
9120 window height. Clean up the case of PT below the margin at bottom
9121 of window: scroll_max can no longer be INT_MAX. When aggressive
9122 scrolling is in use, don't let point enter the opposite scroll
9123 margin as result of the scroll.
9124 (syms_of_xdisp) <scroll-conservatively>: Document the
9125 threshold of 100 lines for never-recentering scrolling.
9126
9127 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
9128
9129 * dispextern.h (move_it_by_lines):
9130 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
9131 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
9132 (message_log_check_duplicate): Remove parameters `prev_bol' and
9133 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
9134 (redisplay_internal): Remove parameter `preserve_echo_area',
9135 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
9136
9137 * indent.c (Fvertical_motion):
9138 * window.c (window_scroll_pixel_based, Frecenter):
9139 Don't pass `need_y_p' to `move_it_by_lines'.
9140
9141 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
9142
9143 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
9144 steal a few bits to be more compact.
9145 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
9146 Remove unneeded casts.
9147
9148 * bytecode.c (Fbyte_code): CAR and CDR can GC.
9149
9150 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
9151
9152 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
9153 binding" message (bug#7967).
9154
9155 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
9156
9157 Fix more problems found by GCC 4.6.0's static checks.
9158
9159 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
9160 Remove unused local var.
9161
9162 * editfns.c (Fmessage_box): Remove unused local var.
9163
9164 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
9165 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9166 Omit unused local vars.
9167 * window.c (shrink_windows): Omit unused local var.
9168 * menu.c (digest_single_submenu): Omit unused local var.
9169 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
9170 Omit unused local var.
9171
9172 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
9173 Don't assume string length fits in int.
9174 (keyremap_step, read_key_sequence): Use size_t for sizes.
9175 (read_key_sequence): Don't check last_real_key_start redundantly.
9176
9177 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
9178 instead of alloca (Bug#8344).
9179
9180 * eval.c (Fbacktrace): Don't assume nargs fits in int.
9181 (Fbacktrace_frame): Don't assume nframes fits in int.
9182
9183 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
9184
9185 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
9186 concerns.
9187
9188 * term.c (produce_glyphless_glyph): Remove unnecessary test.
9189
9190 * cm.c (calccost): Turn while-do into do-while, for clarity.
9191
9192 * keyboard.c (syms_of_keyboard): Use the same style as later
9193 in this function when indexing through an array. This also
9194 works around GCC bug 48267.
9195
9196 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
9197
9198 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
9199
9200 * chartab.c (sub_char_table_ref_and_range): Redo for slight
9201 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
9202
9203 * keyboard.c, keyboard.h (num_input_events): Now size_t.
9204 This avoids undefined behavior on integer overflow, and is a bit
9205 more convenient anyway since it is compared to a size_t variable.
9206
9207 Variadic C functions now count arguments with size_t, not int.
9208 This avoids an unnecessary limitation on 64-bit machines, which
9209 caused (substring ...) to crash on large vectors (Bug#8344).
9210 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
9211 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
9212 All variadic functions and their callers changed accordingly.
9213 (struct gcpro.nvars): Now size_t, not int. All uses changed.
9214 * data.c (arith_driver, float_arith_driver): Likewise.
9215 * editfns.c (general_insert_function): Likewise.
9216 * eval.c (struct backtrace.nargs, interactive_p)
9217 (internal_condition_case_n, run_hook_with_args, apply_lambda)
9218 (funcall_lambda, mark_backtrace): Likewise.
9219 * fns.c (concat): Likewise.
9220 * frame.c (x_set_frame_parameters): Likewise.
9221 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
9222 0 if not found, not -1. All callers changed.
9223
9224 * alloc.c (garbage_collect): Don't assume stack size fits in int.
9225 (stack_copy_size): Now size_t, not int.
9226 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
9227
9228 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
9229
9230 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
9231 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9232 All callers changed.
9233
9234 * lisp.h (multibyte_char_to_unibyte):
9235 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
9236 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
9237 * character.h (CHAR_TO_BYTE8):
9238 * cmds.c (internal_self_insert):
9239 * editfns.c (general_insert_function):
9240 * keymap.c (push_key_description):
9241 * search.c (Freplace_match):
9242 * xdisp.c (message_dolog, set_message_1): All callers changed.
9243
9244 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9245
9246 * keyboard.c (safe_run_hook_funcall): New function.
9247 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
9248 don't set the hook to nil, but remove the offending function instead.
9249 (Qcommand_hook_internal): Remove, unused.
9250 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
9251 Vcommand_hook_internal.
9252
9253 * eval.c (enum run_hooks_condition): Remove.
9254 (funcall_nil, funcall_not): New functions.
9255 (run_hook_with_args): Call each function through a `funcall' argument.
9256 Remove `cond' argument, now redundant.
9257 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
9258 (Frun_hook_with_args_until_failure): Adjust accordingly.
9259 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
9260
9261 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
9262
9263 * dispextern.h (string_buffer_position): Remove declaration.
9264
9265 * print.c (strout): Remove parameter `multibyte', unused since
9266 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
9267
9268 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
9269 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
9270 All callers changed.
9271
9272 * w32.c (_wsa_errlist): Use braces for struct initializers.
9273
9274 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
9275 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
9276 All callers changed.
9277 (string_buffer_position): Likewise. Also, make static (it's never
9278 used outside xdisp.c).
9279 (cursor_row_p): Remove parameter `w', unused since
9280 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
9281 (decode_mode_spec): Remove parameter `precision', introduced during
9282 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
9283 All callers changed.
9284
9285 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9286
9287 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
9288
9289 2011-03-27 Anders Lindgren <andlind@gmail.com>
9290
9291 * nsterm.m (ns_menu_bar_is_hidden): New variable.
9292 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
9293 (ns_update_auto_hide_menu_bar): New functions.
9294 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
9295 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
9296 ns_constrain_all_frames.
9297 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
9298 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
9299
9300 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
9301
9302 * nsmenu.m (runDialogAt): Remove argument to timer_check.
9303
9304 2011-03-27 Glenn Morris <rgm@gnu.org>
9305
9306 * syssignal.h: Replace RETSIGTYPE with void.
9307 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
9308 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
9309 Replace SIGTYPE with void everywhere.
9310 * s/usg5-4-common.h (SIGTYPE): Remove definition.
9311 * s/template.h (SIGTYPE): Remove commented out definition.
9312
9313 2011-03-26 Eli Zaretskii <eliz@gnu.org>
9314
9315 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
9316 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
9317
9318 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
9319
9320 * w32.c (read_unc_volume): Use parameter `henum', instead of
9321 global variable `wget_enum_handle'.
9322
9323 * keymap.c (describe_vector): Remove parameters `indices' and
9324 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
9325 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
9326
9327 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
9328
9329 * keyboard.c (timer_check): Remove parameter `do_it_now',
9330 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
9331 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
9332 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
9333
9334 * keyboard.c (read_char):
9335 * w32menu.c (w32_menu_display_help):
9336 * xmenu.c (show_help_event, menu_help_callback):
9337 Adjust calls to `show_help_echo'.
9338
9339 * gtkutil.c (xg_maybe_add_timer):
9340 * keyboard.c (readable_events):
9341 * process.c (wait_reading_process_output):
9342 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
9343
9344 * insdel.c (adjust_markers_gap_motion):
9345 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
9346 (gap_left, gap_right): Don't call it.
9347
9348 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
9349
9350 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
9351 incurred during fontification.
9352
9353 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
9354
9355 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
9356 (DEFVAR_PER_BUFFER): Don't pass it.
9357
9358 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
9359 (scrolling_window): Don't pass it.
9360
9361 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
9362
9363 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
9364
9365 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
9366 and `suffix'.
9367 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
9368 of variables specific to SELinux and computation of `encoded_absname'.
9369
9370 * image.c (XPutPixel): Remove unused variable `height'.
9371
9372 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
9373
9374 * unexw32.c (get_section_info): Remove unused variable `section'.
9375
9376 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
9377 (system_process_attributes): Remove unused variable `sess'.
9378 (sys_read): Remove unused variable `err'.
9379
9380 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
9381 (w32_wnd_proc): Remove unused variable `isdead'.
9382 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
9383 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
9384 (x_create_tip_frame): Remove unused variable `tem'.
9385
9386 * w32inevt.c (w32_console_read_socket):
9387 Remove unused variable `no_events'.
9388
9389 * w32term.c (x_draw_composite_glyph_string_foreground):
9390 Remove unused variable `width'.
9391
9392 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
9393
9394 * w32term.c (x_set_glyph_string_clipping):
9395 Don't pass uninitialized region to CombineRgn.
9396
9397 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
9398
9399 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
9400 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
9401 (Fx_close_connection): Remove unused variable `i'.
9402
9403 * w32font.c (w32font_draw): Return number of glyphs.
9404 (w32font_open_internal): Remove unused variable `i'.
9405 (w32font_driver): Add missing initializer.
9406
9407 * w32menu.c (utf8to16): Remove unused variable `utf16'.
9408 (fill_in_menu): Remove unused variable `items_added'.
9409
9410 * w32term.c (last_mouse_press_frame): Remove static global variable.
9411 (w32_clip_to_row): Remove unused variable `f'.
9412 (x_delete_terminal): Remove unused variable `i'.
9413
9414 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
9415 (NOTHING): Remove unused static global variable.
9416 (uniscribe_check_otf): Remove unused variable `table'.
9417 (uniscribe_font_driver): Add missing initializers.
9418
9419 2011-03-23 Julien Danjou <julien@danjou.info>
9420
9421 * term.c (Fsuspend_tty, Fresume_tty):
9422 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
9423 * window.c (temp_output_buffer_show):
9424 * insdel.c (signal_before_change):
9425 * frame.c (Fhandle_switch_frame):
9426 * fileio.c (Fdo_auto_save):
9427 * emacs.c (Fkill_emacs):
9428 * editfns.c (save_excursion_restore):
9429 * cmds.c (internal_self_insert):
9430 * callint.c (Fcall_interactively):
9431 * buffer.c (Fkill_all_local_variables):
9432 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
9433 Use Frun_hooks.
9434 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
9435 unconditionally since it does the check itself.
9436
9437 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
9438
9439 Fix more problems found by GCC 4.5.2's static checks.
9440
9441 * coding.c (encode_coding_raw_text): Avoid unnecessary test
9442 the first time through the loop, since we know p0 < p1 then.
9443 This also avoids a gcc -Wstrict-overflow warning.
9444
9445 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
9446 leading to a memory leak, possible in functions like
9447 load_charset_map_from_file that can allocate an unbounded number
9448 of objects (Bug#8318).
9449
9450 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
9451 that could (at least in theory) be that large.
9452
9453 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
9454 This is less likely to overflow, and avoids undefined behavior if
9455 overflow does occur. All callers changed. Use strtoul to scan
9456 for the unsigned long integer.
9457 (pint2hrstr): Simplify and tune code slightly.
9458 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
9459
9460 * scroll.c (do_scrolling): Work around GCC bug 48228.
9461 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
9462
9463 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
9464 This also avoids a warning with gcc -Wstrict-overflow.
9465 (validate_x_resource_name): Simplify count usage.
9466 This also avoids a warning with gcc -Wstrict-overflow.
9467
9468 * fileio.c (Fcopy_file): Report error if fchown or fchmod
9469 fail (Bug#8306).
9470
9471 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
9472
9473 * process.c (Fmake_network_process): Use socklen_t, not int,
9474 where POSIX says socklen_t is required in portable programs.
9475 This fixes a porting bug on hosts like 64-bit HP-UX, where
9476 socklen_t is wider than int (Bug#8277).
9477 (Fmake_network_process, server_accept_connection):
9478 (wait_reading_process_output, read_process_output):
9479 Likewise.
9480
9481 * process.c: Rename or move locals to avoid shadowing.
9482 (list_processes_1, Fmake_network_process):
9483 (read_process_output_error_handler, exec_sentinel_error_handler):
9484 Rename or move locals.
9485 (Fmake_network_process): Define label "retry_connect" only if needed.
9486 (Fnetwork_interface_info): Fix pointer signedness.
9487 (process_send_signal): Add cast to avoid pointer signedness problem.
9488 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
9489 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
9490
9491 Make tparam.h and terminfo.c consistent.
9492 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
9493 Include tparam.h instead, since it declares them.
9494 * cm.h (PC): Remove extern decl; tparam.h now does this.
9495 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
9496 * terminfo.c: Include tparam.h, to check interfaces.
9497 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
9498 (tparam): Adjust signature to match interface in tparam.h;
9499 this removes some undefined behavior. Check that outstring and len
9500 are zero, which they always are with Emacs.
9501 * tparam.h (PC, BC, UP): New extern decls.
9502
9503 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
9504 (xftfont_open): Rename locals to avoid shadowing.
9505
9506 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
9507 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
9508 (OTF_TAG_SYM): Omit macro if not needed.
9509 (ftfont_list): Remove unused local.
9510 (get_adstyle_property, ftfont_pattern_entity):
9511 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
9512 Rename locals to avoid shadowing.
9513
9514 * xfont.c (xfont_list_family): Mark var as initialized.
9515
9516 * xml.c (make_dom): Now static.
9517
9518 * composite.c (composition_compute_stop_pos): Rename local to
9519 avoid shadowing.
9520 (composition_reseat_it): Remove unused locals.
9521 (find_automatic_composition, composition_adjust_point): Likewise.
9522 (composition_update_it): Mark var as initialized.
9523 (find_automatic_composition): Mark vars as initialized,
9524 with a FIXME (Bug#8290).
9525
9526 character.h: Rename locals to avoid shadowing.
9527 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
9528 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
9529 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
9530 (BUF_DEC_POS): Be more systematic about renaming local temporaries
9531 to avoid shadowing.
9532
9533 * textprop.c (property_change_between_p): Remove; unused.
9534
9535 * intervals.c (interval_start_pos): Now static.
9536
9537 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
9538
9539 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
9540 Rename locals to avoid shadowing.
9541
9542 * sound.c (wav_play, au_play, Fplay_sound_internal):
9543 Fix pointer signedness.
9544 (alsa_choose_format): Remove unused local var.
9545 (wav_play): Initialize a variable to 0, to prevent undefined
9546 behavior (Bug#8278).
9547
9548 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
9549
9550 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
9551
9552 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
9553 clobbering (Bug#8298).
9554 * sysdep.c (sys_subshell): Likewise.
9555 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
9556
9557 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
9558 This should get cleaned up, so that child_setup has the
9559 same signature on all platforms.
9560
9561 * callproc.c (call_process_cleanup): Now static.
9562 (relocate_fd): Rename locals to avoid shadowing.
9563
9564 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
9565
9566 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
9567 not to be necessary, and produces flickering.
9568
9569 2011-03-20 Glenn Morris <rgm@gnu.org>
9570
9571 * config.in: Remove file.
9572
9573 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
9574
9575 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
9576 are now in src/globals.h.
9577 (syms_of_minibuf): Remove spurious & from previous change.
9578
9579 2011-03-20 Leo Liu <sdl.web@gmail.com>
9580
9581 * minibuf.c (completing-read-function): New variable.
9582 (completing-read-default): Rename from completing-read.
9583 (completing-read): Call completing-read-function.
9584
9585 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
9586
9587 * xfaces.c (Fx_load_color_file):
9588 Read color file from absolute filename (bug#8250).
9589
9590 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
9591
9592 * makefile.w32-in: Update dependencies.
9593
9594 2011-03-17 Eli Zaretskii <eliz@gnu.org>
9595
9596 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
9597
9598 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
9599
9600 Fix more problems found by GCC 4.5.2's static checks.
9601
9602 * process.c (make_serial_process_unwind, send_process_trap):
9603 (sigchld_handler): Now static.
9604
9605 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
9606 That way, the code declares only the vars that it needs.
9607 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
9608 * s/cygwin.h (PTY_ITERATION): Likewise.
9609 * s/darwin.h (PTY_ITERATION): Likewise.
9610 * s/gnu-linux.h (PTY_ITERATION): Likewise.
9611
9612 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
9613 * process.c (allocate_pty): Don't declare stb unless it's needed.
9614
9615 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
9616 (CONSTANTLIM): Remove; unused.
9617 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
9618 Define only if needed.
9619
9620 * unexelf.c (unexec): Name an expression,
9621 to avoid gcc -Wbad-function-cast warning.
9622 Use a different way to cause a compilation error if anyone uses
9623 n rather than nn, a way that does not involve shadowing.
9624 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
9625
9626 * deps.mk (unexalpha.o): Remove; unused.
9627
9628 New file unexec.h, the (simple) interface for unexec (Bug#8267).
9629 * unexec.h: New file.
9630 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
9631 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
9632 Depend on unexec.h.
9633 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
9634 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
9635 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
9636 Change as necessary to match prototype in unexec.h.
9637
9638 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
9639 shadowing.
9640 (back_comment, skip_chars): Mark vars as initialized.
9641
9642 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
9643 Rename locals to avoid shadowing.
9644
9645 * lread.c (read1): Rewrite so as not to use empty "else".
9646 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
9647
9648 * print.c (Fredirect_debugging_output): Fix pointer signedess.
9649
9650 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
9651 warning when compiling print.c.
9652
9653 * font.c (font_unparse_fcname): Abort in an "impossible" situation
9654 instead of using an uninitialized var.
9655 (font_sort_entities): Mark var as initialized.
9656
9657 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
9658
9659 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
9660 pointers to constants.
9661 (font_parse_fcname): Remove unused vars.
9662 (font_delete_unmatched): Now static.
9663 (font_get_spec): Remove; unused.
9664 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
9665 (font_update_drivers, Ffont_get_glyphs, font_add_log):
9666 Rename or move locals to avoid shadowing.
9667
9668 * fns.c (require_nesting_list, require_unwind): Now static.
9669 (Ffillarray): Rename locals to avoid shadowing.
9670
9671 * floatfns.c (domain_error2): Define only if needed.
9672 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
9673
9674 * alloc.c (mark_backtrace): Move decl from here ...
9675 * lisp.h: ... to here, so that it can be checked.
9676
9677 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
9678 (Fdefvar): Rewrite so as not to use empty "else".
9679 (lisp_indirect_variable): Name an expression,
9680 to avoid gcc -Wbad-function-cast warning.
9681 (Fdefvar): Rename locals to avoid shadowing.
9682
9683 * callint.c (quotify_arg, quotify_args): Now static.
9684 (Fcall_interactively): Rename locals to avoid shadowing.
9685 Use const pointer when appropriate.
9686
9687 * lisp.h (get_system_name, get_operating_system_release):
9688 Move decls here, to check interfaces.
9689 * process.c (get_operating_system_release): Move decl to lisp.h.
9690 * xrdb.c (get_system_name): Likewise.
9691 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
9692 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
9693 some of which prompt warnings from gcc -Wbad-function-cast.
9694 (Fformat_time_string, Fencode_time, Finsert_char):
9695 (Ftranslate_region_internal, Fformat):
9696 Rename or remove local vars to avoid shadowing.
9697 (Ftranslate_region_internal): Mark var as initialized.
9698
9699 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
9700 avoid shadowing.
9701
9702 * lisp.h (eassert): Check that the argument compiles, even if
9703 ENABLE_CHECKING is not defined.
9704
9705 * data.c (Findirect_variable): Name an expression, to avoid
9706 gcc -Wbad-function-cast warning.
9707 (default_value, arithcompare, arith_driver, arith_error): Now static.
9708 (store_symval_forwarding): Rename local to avoid shadowing.
9709 (Fmake_variable_buffer_local, Fmake_local_variable):
9710 Mark variables as initialized.
9711 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
9712
9713 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
9714 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
9715 Rename locals to avoid shadowing.
9716 (mark_stack): Move local variables into the #ifdef region where
9717 they're used.
9718 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
9719 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
9720 needed otherwise.
9721 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
9722 (GC_STRING_CHARS): Remove; not used.
9723 (Fmemory_limit): Cast sbrk's returned value to char *.
9724
9725 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
9726 avoids undefined behavior in theory.
9727
9728 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
9729
9730 Use functions, not macros, for up- and down-casing (Bug#8254).
9731 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
9732 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
9733 to use the following functions instead of these macros.
9734 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
9735 EMACS_INT, since callers assume the returned value fits in int.
9736 (upcase1): Likewise, for UPCASE_TABLE.
9737 (uppercasep, lowercasep, upcase): New static inline functions.
9738 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
9739 the race-condition problem in the old DOWNCASE.
9740
9741 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
9742 Rename locals to avoid shadowing.
9743 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
9744 (regex_compile, re_search_2, re_match_2_internal):
9745 Remove unused local vars.
9746 (FREE_VAR): Rewrite so as not to use empty "else",
9747 which gcc can warn about.
9748 (regex_compile, re_match_2_internal): Mark locals as initialized.
9749 (RETALLOC_IF): Define only if needed.
9750 (WORDCHAR_P): Likewise. This one is never needed, but is used
9751 only in a comment talking about a compiler bug, so put inside
9752 the #if 0 of that comment.
9753 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
9754 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
9755 Remove; unused.
9756
9757 * search.c (boyer_moore): Rename locals to avoid shadowing.
9758 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
9759 (PREV_CHAR_BOUNDARY): Likewise.
9760
9761 * search.c (simple_search): Remove unused var.
9762
9763 * dired.c (compile_pattern): Move decl from here ...
9764 * lisp.h: ... to here, so that it can be checked.
9765 (struct re_registers): New forward decl.
9766
9767 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
9768
9769 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
9770 All uses changed.
9771 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
9772 Rename locals to avoid shadowing.
9773 (Fvertical_motion): Mark locals as initialized.
9774
9775 * casefiddle.c (casify_object, casify_region): Now static.
9776 (casify_region): Mark local as initialized.
9777
9778 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
9779
9780 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
9781 New macros, so that the caller can use some names other than
9782 gcpro1, gcpro2, etc.
9783 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
9784 of the new macros.
9785 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
9786 argument, for consistency with GCPRO2_VAR, etc: it is now the
9787 prefix of the variable, not the variable itself. All uses
9788 changed.
9789 * dired.c (directory_files_internal, file_name_completion):
9790 Rename locals to avoid shadowing.
9791
9792 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
9793 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
9794 dired.c's scmp function, had undefined behavior.
9795 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
9796 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
9797 * buffer.h: ... to here, because these macros use current_buffer,
9798 and the new implementation with inline functions needs to have
9799 current_buffer in scope now, rather than later when the macros
9800 are used.
9801 (downcase, upcase1): New static inline functions.
9802 (DOWNCASE, UPCASE1): Reimplement using these functions.
9803 This avoids undefined behavior in expressions like
9804 DOWNCASE (x) == DOWNCASE (y), which previously suffered
9805 from race conditions in accessing the global variables
9806 case_temp1 and case_temp2.
9807 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
9808 * lisp.h (case_temp1, case_temp2): Remove their decls.
9809 * character.h (ASCII_CHAR_P): Move from here ...
9810 * lisp.h: ... to here, so that the inline functions mentioned
9811 above can use them.
9812
9813 * dired.c (directory_files_internal_unwind): Now static.
9814
9815 * fileio.c (file_name_as_directory, directory_file_name):
9816 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
9817 Now static.
9818 (file_name_as_directory): Use const pointers when appropriate.
9819 (Fexpand_file_name): Likewise. In particular, newdir might
9820 point at constant storage, so make it a const pointer.
9821 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
9822 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
9823 signedness issues.
9824 (Fset_file_times, Finsert_file_contents, auto_save_error):
9825 Rename locals to avoid shadowing.
9826
9827 * minibuf.c (choose_minibuf_frame_1): Now static.
9828 (Ftry_completion, Fall_completions): Rename or remove locals
9829 to avoid shadowing.
9830
9831 * marker.c (bytepos_to_charpos): Remove; unused.
9832
9833 * lisp.h (verify_bytepos, count_markers): New decls,
9834 so that gcc does not warn that these functions aren't declared.
9835
9836 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
9837 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
9838 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
9839 (copy_text): Remove unused local var.
9840
9841 * filelock.c (within_one_second): Now static.
9842 (lock_file_1): Rename local to avoid shadowing.
9843
9844 * buffer.c (fix_overlays_before): Mark locals as initialized.
9845 (fix_start_end_in_overlays): Likewise. This function should be
9846 simplified by using pointers-to-pointers, but that's a different
9847 matter.
9848 (switch_to_buffer_1): Now static.
9849 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
9850 (report_overlay_modification): Rename locals to avoid shadowing.
9851
9852 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
9853 Fix pointer signedness issue.
9854 (sys_subshell): Mark local as volatile if checking for lint,
9855 to suppress a gcc -Wclobbered warning that does not seem to be right.
9856 (MAXPATHLEN): Define only if needed.
9857
9858 * process.c (serial_open, serial_configure): Move decls from here ...
9859 * systty.h: ... to here, so that they can be checked.
9860
9861 * fns.c (get_random, seed_random): Move extern decls from here ...
9862 * lisp.h: ... to here, so that they can be checked.
9863
9864 * sysdep.c (reset_io): Now static.
9865 (wait_for_termination_signal): Remove; unused.
9866
9867 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
9868 (copy_keymap_item, append_key, push_text_char_description):
9869 Now static.
9870 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
9871 (DENSE_TABLE_SIZE): Remove; unused.
9872 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
9873 (describe_map_tree):
9874 Rename locals to avoid shadowing.
9875
9876 * keyboard.c: Declare functions static if they are not used elsewhere.
9877 (echo_char, echo_dash, cmd_error, top_level_2):
9878 (poll_for_input, handle_async_input): Now static.
9879 (read_char, kbd_buffer_get_event, make_lispy_position):
9880 (make_lispy_event, make_lispy_movement, apply_modifiers):
9881 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
9882 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
9883 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
9884 (read_key_sequence, read_char): Mark locals as initialized.
9885 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
9886
9887 * keyboard.h (make_ctrl_char): New decl.
9888 (mark_kboards): Move decl here ...
9889 * alloc.c (mark_kboards): ... from here.
9890
9891 * lisp.h (force_auto_save_soon): New decl.
9892
9893 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
9894 (DEFINE_DUMMY_FUNCTION): New macro.
9895 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
9896 Use it.
9897 (main): Add casts to avoid warnings
9898 if GCC considers string literals to be constants.
9899
9900 * lisp.h (fatal_error_signal): Add decl, since it's exported.
9901
9902 * dbusbind.c: Pointer signedness fixes.
9903 (xd_signature, xd_append_arg, xd_initialize):
9904 (Fdbus_call_method, Fdbus_call_method_asynchronously):
9905 (Fdbus_method_return_internal, Fdbus_method_error_internal):
9906 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
9907 (Fdbus_register_signal): Use SSDATA when the context wants char *.
9908
9909 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
9910 if GCC considers string literals to be constants.
9911 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
9912
9913 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
9914
9915 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
9916 (print_preprocess, print_object): New macro to fix last change.
9917
9918 * print.c (print_preprocess): Don't forget font objects.
9919
9920 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
9921
9922 * emacs.c (USAGE3): Doc fixes.
9923
9924 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
9925
9926 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
9927 structure.
9928
9929 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
9930
9931 * lisp.h (VWindow_system, Qfile_name_history):
9932 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
9933 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
9934 (w32_system_caret_x, w32_system_caret_y): Declare extern.
9935
9936 * w32select.c: Don't #include "keyboard.h".
9937 (run_protected): Add extern declaration for waiting_for_input.
9938
9939 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
9940 * w32console.c (detect_input_pending, read_input_pending)
9941 (encode_terminal_code):
9942 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
9943 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
9944 (w32_system_caret_y, Qfile_name_history):
9945 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
9946 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
9947 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
9948 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
9949 * w32proc.c (Qlocal, report_file_error):
9950 * w32term.c (Vwindow_system, updating_frame):
9951 * w32uniscribe.c (initialized, uniscribe_font_driver):
9952 Remove unneeded extern declarations.
9953
9954 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
9955
9956 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
9957
9958 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
9959
9960 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
9961 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
9962 These macros can no longer be used for assignment.
9963
9964 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9965 Assign struct members directly, instead of using BUF_BEGV etc.
9966 (record_buffer_markers, fetch_buffer_markers): New functions for
9967 recording and fetching special buffer markers.
9968 (set_buffer_internal_1, set_buffer_temp): Use them.
9969
9970 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
9971
9972 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
9973
9974 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
9975 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
9976
9977 * xdisp.c (hscroll_window_tree):
9978 (reconsider_clip_changes): Use PT instead of BUF_PT.
9979
9980 2011-03-13 Eli Zaretskii <eliz@gnu.org>
9981
9982 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
9983 $(EMACS_ROOT)/lib/intprops.h.
9984
9985 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
9986
9987 Fix more problems found by GCC 4.5.2's static checks.
9988
9989 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
9990 to unsigned char * to avoid compiler diagnostic.
9991 (xg_free_frame_widgets): Make it clear that a local variable is
9992 needed only if USE_GTK_TOOLTIP.
9993 (gdk_window_get_screen): Make it clear that this macro is needed
9994 only if USE_GTK_TOOLTIP.
9995 (int_gtk_range_get_value): New function, which avoids a diagnostic
9996 from gcc -Wbad-function-cast.
9997 (xg_set_toolkit_scroll_bar_thumb): Use it.
9998 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
9999 diagnostic from gcc -Wbad-function-cast.
10000 (get_utf8_string, xg_get_file_with_chooser):
10001 Rename locals to avoid shadowing.
10002 (create_dialog): Move locals to avoid shadowing.
10003
10004 * xgselect.c (xg_select): Remove unused var.
10005
10006 * image.c (four_corners_best): Mark locals as initialized.
10007 (gif_load): Initialize transparent_p to zero (Bug#8238).
10008 Mark another local as initialized.
10009 (my_png_error, my_error_exit): Mark with NO_RETURN.
10010
10011 * image.c (clear_image_cache): Now static.
10012 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
10013 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
10014 (x_edge_detection): Remove unnecessary cast that
10015 gcc -Wbad-function-cast diagnoses.
10016 (gif_load): Fix pointer signedness.
10017 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
10018 (jpeg_load, gif_load): Rename locals to avoid shadowing.
10019
10020 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
10021
10022 Improve quality of tests for time stamp overflow.
10023 For example, without this patch (encode-time 0 0 0 1 1
10024 1152921504606846976) returns the obviously-bogus value (-948597
10025 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
10026 reports time overflow. See
10027 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
10028 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
10029 * editfns.c: Include limits.h and intprops.h.
10030 (TIME_T_MIN, TIME_T_MAX): New macros.
10031 (time_overflow): Move earlier, to before first use.
10032 (hi_time, lo_time): New functions, for an accurate test for
10033 out-of-range times.
10034 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
10035 (Fget_internal_run_time): Don't assume time_t fits in int.
10036 (make_time): Use list2 instead of Fcons twice.
10037 (Fdecode_time): More accurate test for out-of-range times.
10038 (check_tm_member): New function.
10039 (Fencode_time): Use it, to test for out-of-range times.
10040 (lisp_time_argument): Don't rely on undefined left-shift and
10041 right-shift behavior when checking for time stamp overflow.
10042
10043 * editfns.c (time_overflow): New function, refactoring common code.
10044 (Fformat_time_string, Fdecode_time, Fencode_time):
10045 (Fcurrent_time_string): Use it.
10046
10047 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
10048 * dired.c (make_time): Move to ...
10049 * editfns.c (make_time): ... here.
10050 * systime.h: Note the move.
10051
10052 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10053
10054 * fringe.c (update_window_fringes): Remove unused variables.
10055
10056 * unexmacosx.c (copy_data_segment): Also copy __got section.
10057 (Bug#8223)
10058
10059 2011-03-12 Eli Zaretskii <eliz@gnu.org>
10060
10061 * termcap.c [MSDOS]: Include "msdos.h".
10062 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
10063 Constify `char *' arguments and their references according to
10064 prototypes in tparam.h.
10065
10066 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
10067
10068 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
10069 Adapt all references accordingly.
10070
10071 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
10072
10073 2011-03-11 Tom Tromey <tromey@redhat.com>
10074
10075 * buffer.c (syms_of_buffer): Remove obsolete comment.
10076
10077 2011-03-11 Eli Zaretskii <eliz@gnu.org>
10078
10079 * termhooks.h (encode_terminal_code): Declare prototype.
10080
10081 * msdos.c (encode_terminal_code): Don't declare prototype.
10082
10083 * term.c (encode_terminal_code): Now external again, used by
10084 w32console.c and msdos.c.
10085
10086 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
10087 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
10088
10089 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
10090
10091 Fix some minor problems found by GCC 4.5.2's static checks.
10092
10093 * fringe.c (update_window_fringes): Mark locals as initialized
10094 (Bug#8227).
10095 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
10096
10097 * alloc.c (mark_fringe_data): Move decl from here ...
10098 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
10099 to check its interface.
10100 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
10101
10102 * fontset.c (free_realized_fontset): Now static.
10103 (Fset_fontset_font): Rename local to avoid shadowing.
10104 (fontset_font): Mark local as initialized.
10105 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
10106
10107 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
10108
10109 * xselect.c (x_disown_buffer_selections): Remove; not used.
10110 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
10111 (x_own_selection, Fx_disown_selection_internal): Rename locals
10112 to avoid shadowing.
10113 (x_handle_dnd_message): Remove local to avoid shadowing.
10114
10115 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
10116 so that the caller can use some name other than gcpro1.
10117 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
10118 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10119 (Fx_backspace_delete_keys_p):
10120 Use them to avoid shadowing, and rename vars to avoid shadowing.
10121 (x_decode_color, x_set_name, x_window): Now static.
10122 (Fx_create_frame): Add braces to silence GCC warning.
10123 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
10124 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
10125 Remove unused locals.
10126 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
10127 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
10128 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
10129 macros.
10130
10131 * xterm.h (x_mouse_leave): New decl.
10132
10133 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
10134 Remove unused functions.
10135 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
10136 (x_calc_absolute_position): Now static.
10137 (XTread_socket): Don't define label "out" unless it's used.
10138 Don't declare local "event" unless it's used.
10139 (x_iconify_frame, x_free_frame_resources): Don't declare locals
10140 unless they are used.
10141 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
10142 (x_fatal_error_signal): Remove; not used.
10143 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
10144 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
10145 (x_error_catcher, x_connection_closed, x_error_handler):
10146 (x_error_quitter, xembed_send_message, x_iconify_frame):
10147 (my_log_handler): Rename locals to avoid shadowing.
10148 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
10149 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
10150
10151 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
10152 Rename or move locals to avoid shadowing.
10153 (tty_defined_color, merge_face_heights): Now static.
10154 (free_realized_faces_for_fontset): Remove; not used.
10155 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
10156 does not deduce is never used uninitialized.
10157 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
10158 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
10159
10160 * terminal.c (store_terminal_param): Now static.
10161
10162 * xmenu.c (menu_highlight_callback): Now static.
10163 (set_frame_menubar): Remove unused local.
10164 (xmenu_show): Rename parameter to avoid shadowing.
10165 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
10166 since they might point to immutable storage.
10167 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
10168 since it's unused otherwise.
10169
10170 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
10171 Add a FIXME, since the code still doesn't look right. (Bug#8215)
10172 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
10173 avoids a gcc -Wuninitialized diagnostic.
10174 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
10175 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
10176 does not deduce are never used uninitialized.
10177
10178 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
10179
10180 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
10181 * window.c (window_loop, size_window):
10182 (run_window_configuration_change_hook, enlarge_window): Likewise.
10183
10184 * window.c (display_buffer): Now static.
10185 (size_window): Mark variables that gcc -Wuninitialized
10186 does not deduce are never used uninitialized.
10187 * window.h (check_all_windows): New decl, to forestall
10188 gcc -Wmissing-prototypes diagnostic.
10189 * dispextern.h (bidi_dump_cached_states): Likewise.
10190
10191 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
10192 shadowing.
10193 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
10194 Include <limits.h>.
10195 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
10196 and to avoid gcc -Wuninitialized warning.
10197 (load_charset_map): Mark variables that gcc -Wuninitialized
10198 does not deduce are never used uninitialized.
10199 (load_charset): Abort instead of using uninitialized var (Bug#8229).
10200
10201 * coding.c (coding_set_source, coding_set_destination):
10202 Use "else { /* comment */ }" rather than "else /* comment */;"
10203 for clarity, and to avoid gcc -Wempty-body warning.
10204 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
10205 a block, when the outer 'i' will do.
10206 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
10207 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
10208 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
10209 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
10210 (Fdecode_sjis_char, Fdefine_coding_system_internal):
10211 Rename locals to avoid shadowing.
10212 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
10213 * coding.c (emacs_mule_char, encode_invocation_designation):
10214 Now static, since they're not used elsewhere.
10215 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
10216 (decode_coding_object, encode_coding_object, detect_coding_system):
10217 (decode_coding_emacs_mule): Mark variables that gcc
10218 -Wuninitialized does not deduce are never used uninitialized.
10219 (detect_coding_iso_2022): Initialize a local variable that might
10220 be used uninitialized. Leave a FIXME because it's not clear that
10221 this initialization is needed. (Bug#8211)
10222 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
10223 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
10224 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
10225 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
10226 Remove unused macros.
10227
10228 * category.c (hash_get_category_set): Remove unused local var.
10229 (copy_category_table): Now static, since it's not used elsewhere.
10230 * character.c (string_count_byte8): Likewise.
10231
10232 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
10233 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
10234
10235 * chartab.c (copy_sub_char_table): Now static, since it's not used
10236 elsewhere.
10237 (sub_char_table_ref_and_range, char_table_ref_and_range):
10238 Rename locals to avoid shadowing.
10239 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
10240
10241 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
10242 (BIDI_BOB): Remove unused macro.
10243
10244 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
10245 deduce are never used uninitialized.
10246 * term.c (encode_terminal_code): Likewise.
10247
10248 * term.c (encode_terminal_code): Now static. Remove unused local.
10249
10250 * tparam.h: New file.
10251 * term.c, tparam.h: Include it.
10252 * deps.mk (term.o, tparam.o): Depend on tparam.h.
10253 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
10254 Move these decls to tparam.h, and make them agree with what
10255 is actually in tparam.c. The previous trick of using incompatible
10256 decls in different modules does not conform to the C standard.
10257 All callers of tparam changed to use tparam's actual API.
10258 * tparam.c (tparam1, tparam, tgoto):
10259 Use const pointers where appropriate.
10260
10261 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
10262 * cm.h (struct cm): Likewise.
10263 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
10264 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
10265 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
10266 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
10267 (turn_on_face, init_tty): Likewise.
10268 * termchar.h (struct tty_display_info): Likewise.
10269
10270 * term.c (term_mouse_position): Rename local to avoid shadowing.
10271
10272 * alloc.c (mark_ttys): Move decl from here ...
10273 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
10274
10275 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
10276
10277 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
10278
10279 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
10280
10281 * search.c (compile_pattern_1): Remove argument regp, unused since
10282 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
10283 (compile_pattern): Don't pass it.
10284
10285 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
10286
10287 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
10288 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
10289 for ! HAVE_GTK3.
10290 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
10291
10292 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
10293
10294 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
10295 gdk_window_get_screen, gdk_window_get_geometry,
10296 gdk_x11_window_lookup_for_display and GDK_KEY_g.
10297 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
10298 (xg_get_pixbuf_from_pixmap): New function.
10299 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
10300 to Pixmap, take frame as parameter, remove GdkColormap parameter.
10301 Call xg_get_pixbuf_from_pixmap instead of
10302 gdk_pixbuf_get_from_drawable.
10303 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
10304 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
10305 (xg_check_special_colors): Use GtkStyleContext and its functions
10306 for HAVE_GTK3.
10307 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
10308 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
10309 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
10310 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
10311 Call gtk_widget_get_preferred_size.
10312 (xg_frame_resized): gdk_window_get_geometry only takes 5
10313 parameters.
10314 (xg_win_to_widget, xg_event_is_for_menubar):
10315 Call gdk_x11_window_lookup_for_display.
10316 (xg_set_widget_bg): New function.
10317 (delete_cb): New function.
10318 (xg_create_frame_widgets): Connect delete-event to delete_cb.
10319 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
10320 (xg_set_background_color): Call xg_set_widget_bg.
10321 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
10322 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
10323 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
10324 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
10325 if ! HAVE_GTK3.
10326 (update_frame_tool_bar): Call gtk_widget_hide.
10327 (xg_initialize): Use GDK_KEY_g.
10328
10329 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
10330 if ! HAVE_GTK3
10331 (x_session_initialize): Call gdk_x11_set_sm_client_id.
10332
10333 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
10334 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
10335 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
10336
10337 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
10338
10339 * w32xfns.c (select_palette): Check success of RealizePalette against
10340 GDI_ERROR, not zero.
10341
10342 See ChangeLog.11 for earlier changes.
10343
10344 ;; Local Variables:
10345 ;; coding: utf-8
10346 ;; End:
10347
10348 Copyright (C) 2011-2012 Free Software Foundation, Inc.
10349
10350 This file is part of GNU Emacs.
10351
10352 GNU Emacs is free software: you can redistribute it and/or modify
10353 it under the terms of the GNU General Public License as published by
10354 the Free Software Foundation, either version 3 of the License, or
10355 (at your option) any later version.
10356
10357 GNU Emacs is distributed in the hope that it will be useful,
10358 but WITHOUT ANY WARRANTY; without even the implied warranty of
10359 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10360 GNU General Public License for more details.
10361
10362 You should have received a copy of the GNU General Public License
10363 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.