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