All platforms using configure support HAVE_PTYS and HAVE_SOCKETS
[emacs.git] / src / ChangeLog
blobeb83ed67017ecba9c0769618ebf8a34fd95652f9
1 2012-07-11  Glenn Morris  <rgm@gnu.org>
3         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
4         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5         Move HAVE_PTYS and HAVE_SOCKETS to configure.
7 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
9         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
11 2012-07-11  Glenn Morris  <rgm@gnu.org>
13         * s/darwin.h, s/gnu-linux.h, s/template.h:
14         Move INTERRUPT_INPUT to configure.
16 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
18         Minor adjustments to interning code.
19         * lisp.h (intern, intern_c_string): Redefine as static inline
20         wrappers for intern_1 and intern_c_string_1, respectively.
21         (intern_1, intern_c_string_1): Rename prototypes.
22         * lread.c (intern_1, intern_c_string_1, oblookup): Simplify
23         Vobarray checking.
24         * font.c (font_intern_prop): Likewise.  Adjust comment.
25         * w32font.c (intern_font_name): Likewise.
27 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
29         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
31         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
32         of Fcar/Fcdr if possible.
33         * font.c (check_otf_features): Likewise.
34         * fontset.c (Fnew_fontset): Likewise.
35         * gnutls.c (Fgnutls_boot): Likewise.
36         * minibuf.c (read_minibuf): Likewise.
37         * msdos.c (IT_set_frame_parameters): Likewise.
38         * xmenu.c (Fx_popup_dialog): Likewise.
39         * w32menu.c (Fx_popup_dialog): Likewise.
41 2012-07-11  Glenn Morris  <rgm@gnu.org>
43         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
44         since nothing has defined it on these platforms.
46         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
47         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
49         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
50         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
51         Move CLASH_DETECTION to configure.
53         * s/gnu.h: Remove file, which is now empty.
55         * s/gnu.h, s/gnu-linux.h:
56         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
58 2012-07-11  John Wiegley  <johnw@newartisans.com>
60         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
61         function attribute, so we only use it if it exists in the
62         compiler.
64 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
66         Avoid call to strlen in fast_c_string_match_ignore_case.
67         * search.c (fast_c_string_match_ignore_case): Change to use
68         length argument.  Adjust users accordingly.
69         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
71 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
73         Assume mkdir, rmdir.
74         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
75         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
77         Assume rename.
78         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
80         Assume perror.
81         * s/hpux10-20.h (HAVE_PERROR): Remove.
82         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
83         Remove dummy definition, as this problem was obsolete long ago.
85         Assume strerror.
86         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
88 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
90         Avoid calls to strlen in font processing functions.
91         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
92         (font_open_by_name): Change to use length argument.  Adjust
93         users accordingly.
94         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
95         Adjust prototypes.
96         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
97         Change to return ptrdiff_t.
98         (xfont_list_pattern, xfont_match): Use length returned by
99         xfont_decode_coding_xlfd.
100         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
102 2012-07-11  Glenn Morris  <rgm@gnu.org>
104         * s/darwin.h, s/freebsd.h, s/netbsd.h:
105         Move DONT_REOPEN_PTY to configure.
107         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
108         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
110 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
112         Remove "#define unix" that is no longer needed (Bug#11905).
113         * s/aix4-2.h (unix): Remove; no longer needed.
115         EMACS_TIME simplification (Bug#11875).
116         This replaces macros (which typically do not work in GDB)
117         with functions, typedefs and enums, making the code easier to debug.
118         The functional style also makes code easier to read and maintain.
119         * systime.h: Include <sys/time.h> on all hosts, not just if
120         WINDOWSNT, since 'struct timeval' is needed in general.
121         (EMACS_TIME): Now a typedef, not a macro.
122         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
123         not macros.
124         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
125         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
126         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
127         (EMACS_TIME_LE): Now functions, not macros.
128         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
129         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
130         which are not functions.  All uses rewritten to use:
131         (make_emacs_time): New function.
132         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
133         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
134         not functions.  All uses rewritten to use the following, respectively:
135         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
136         (add_emacs_time, sub_emacs_time): New functions.
137         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
138         * fileio.c (Fcopy_file):
139         * xterm.c (XTflash): Get the current time closer to when it's used.
140         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
142         * bytecode.c (targets): Suppress -Woverride-init warnings.
144         Simplify by avoiding confusing use of strncpy etc.
145         * doc.c (Fsnarf_documentation):
146         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
147         * frame.c (Fmake_terminal_frame):
148         * gtkutil.c (get_utf8_string):
149         * lread.c (openp):
150         * nsmenu.m (ns_update_menubar):
151         * regex.c (regerror):
152         Prefer memcpy to strncpy and strncat when either will do.
153         * fileio.c (Fsubstitute_in_file_name):
154         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
155         (menu_separator_name_p):
156         * nsmenu.m (ns_update_menubar):
157         Prefer memcmp to strncmp when either will do.
158         * nsterm.m: Include <ftoastr.h>.
159         (ns_get_color):
160         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
161         Prefer snprintf to strncpy.
162         * nsterm.m (ns_term_init):
163         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
164         * nsterm.m (ns_term_init):
165         Avoid the need for strncpy, by using build_string or
166         make_unibyte_string directly.  Use dtoastr, not snprintf.
167         * process.c (Fmake_network_process): Diagnose service names that
168         are too long, rather than silently truncating them or creating
169         non-null-terminated names.
170         (Fnetwork_interface_info): Likewise, for interface names.
171         * sysdep.c (system_process_attributes) [GNU_LINUX]:
172         Prefer sprintf to strncat.
173         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
174         Prefer vsnprintf to vsprintf + strncpy.
176 2012-07-10  Glenn Morris  <rgm@gnu.org>
178         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
179         Clarify fallback case.
181 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
183         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
184         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
185         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
186         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
187         where argument type is known to be a Lisp_Cons.
189 2012-07-10  Tom Tromey  <tromey@redhat.com>
191         * bytecode.c (BYTE_CODE_THREADED): New macro.
192         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
193         (enum byte_code_op): New type.
194         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
195         (exec_byte_code): Use them.  Use token threading when applicable.
197 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
199         Optimize pure C strings initialization.
200         * lisp.h (make_pure_string): Fix prototype.
201         (build_pure_c_string): New function, defined as static inline.  This
202         provides a better opportunity to optimize away calls to strlen when
203         the function is called with compile-time constant argument.
204         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
205         argument, adjust users accordingly.  Use build_pure_c_string where
206         appropriate.
207         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
208         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
209         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
211 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
213         Avoid calls to strlen in miscellaneous functions.
214         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
215         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
216         * lread.c (openp): Likewise.
218 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
220         Avoid calls to strlen in path processing functions.
221         * fileio.c (file_name_as_directory): Add comment.  Change to add
222         srclen argument and return the length of result.  Adjust users
223         accordingly.
224         (directory_file_name): Fix comment.  Change to add srclen argument,
225         swap 1st and 2nd arguments to obey the common convention.  Adjust
226         users accordingly.
227         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
229 2012-07-10  Glenn Morris  <rgm@gnu.org>
231         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
232         Move PENDING_OUTPUT_COUNT definition to configure.
234         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
235         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
236         * s/gnu.h (DATA_START): Move definitions to configure.
238         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
239         We include usg5-4-common.h, which defines them both.
241         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
242         O_RDONLY already includes it).
244         Stop ns builds setting the EMACSLOADPATH environment variable.
245         * nsterm.m (ns_load_path): Rename from ns_init_paths.
246         Now it does not set EMACSLOADPATH, just returns the load-path string.
247         * nsterm.h: Update accordingly.
248         * lread.c [HAVE_NS]: Include nsterm.h.
249         (init_lread) [HAVE_NS]: Use ns_load_path.
250         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
252 2012-07-09  Glenn Morris  <rgm@gnu.org>
254         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
255         since the included bsd-common.h does so.
257         Stop ns builds setting the EMACSPATH environment variable.
258         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
259         (ns_init_paths): Do not set EMACSPATH.
260         * nsterm.h (ns_exec_path): Add it.
261         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
262         Use ns_exec_path.
264         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
266 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
268         * process.c (wait_reading_process_output): 'waitchannels' was unset
269         when read_kbd || !NILP (wait_for_cell); fix this.
271         Add GCC-style 'const' attribute to functions that can use it.
272         * character.h (char_resolve_modifier_mask):
273         * keyboard.h (make_ctrl_char):
274         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
275         (init_character_once, next_almost_prime, init_fns, init_image)
276         (flush_pending_output, init_sound):
277         * mem-limits.h (start_of_data):
278         * menu.h (finish_menu_items):
279         Add ATTRIBUTE_CONST.
280         * emacs.c (DEFINE_DUMMY_FUNCTION):
281         Declare the dummy function with ATTRIBUTE_CONST.
282         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
283         Add decls with ATTRIBUTE_CONST.
285         Minor improvements to make_formatted_string.
286         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
287         where int is good enough, as vsprintf returns an int.
288         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
290 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
292         Use make_formatted_string to avoid double length calculation.
293         * lisp.h (make_formatted_string): New prototype.
294         * alloc.c (make_formatted_string): New function.
295         * buffer.c (Fgenerate_new_buffer_name): Use it.
296         * dbus.c (syms_of_dbusbind): Likewise.
297         * editfns.c (Fcurrent_time_zone): Likewise.
298         * filelock.c (get_boot_time): Likewise.
299         * frame.c (make_terminal_frame, set_term_frame_name)
300         (x_report_frame_params): Likewise.
301         * image.c (gs_load): Likewise.
302         * minibuf.c (get_minibuffer): Likewise.
303         * msdos.c (dos_set_window_size): Likewise.
304         * process.c (make_process): Likewise.
305         * xdisp.c (ensure_echo_area_buffers): Likewise.
306         * xsettings.c (apply_xft_settings): Likewise.
308 2012-07-09  Glenn Morris  <rgm@gnu.org>
310         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
311         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
312         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
313         * nsterm.h (ns_etc_directory): Add it.
314         * callproc.c [HAVE_NS]: Include nsterm.h.
315         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
317 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
319         Move marker debugging code under MARKER_DEBUG.
320         * marker.c (MARKER_DEBUG): Move marker debugging code under
321         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
322         for bootstrap with --enable-checking (~3x slowdown reported
323         by Juanma Barranquero <lekktu@gmail.com>).
324         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
326 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
328         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
329         See <http://bugs.gnu.org/11825#29>.
331 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
333         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
334         has no font, use the frame's font.  (Bug#11813)
335         (display_line): Add commentary about displaying truncation glyphs
336         on GUI frames.
337         (produce_special_glyphs): Move here from term.c.
339         * term.c (produce_special_glyphs): Move to xdisp.c.
341         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
342         section.
344 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
346         * xdisp.c (display_line): Avoid warning about implicit declaration
347         of FRAME_FONT.
349         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
351         * lisp.h: Remove empty conditional.
353 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
355         * lread.c (load_path_check): Now static.
357         Fix some minor --with-ns problems found by static checking.
358         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
359         (x_set_font) [!HAVE_X_WINDOWS]:
360         * image.c (xpm_load_image) [HAVE_NS]:
361         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
362         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
363         Remove unused local.
364         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
365         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
366         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
367         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
368         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
369         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
370         Fix pointer signedness problem.
371         * xfaces.c (FRAME_X_FONT_TABLE):
372         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
374 2012-07-07  Glenn Morris  <rgm@gnu.org>
376         * lread.c (load_path_check): New function, split from init_lread.
377         (init_lread): Reorganize.  Motivation:
378         If EMACSLOADPATH is set, check/warn about that rather than the
379         defaults, which we are not going to use.  Hence we can remove
380         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
381         Don't warn if site-lisp directories are missing.
382         If not installed, start from a blank load-path, since
383         PATH_LOADSEARCH refers to the eventual installation directories.
385 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
387         Support truncation and continuation glyphs on GUI frames, when
388         fringes are disabled.  (Bug#11832)
389         * xdisp.c (init_iterator): Get dimensions of truncation and
390         continuation glyphs even if on GUI frames.  Adjust
391         it->last_visible_x on GUI frames when the left or right fringes,
392         or both, are absent.
393         (start_display, move_it_in_display_line_to): Handle the case of a
394         GUI frame without a fringe to display continuation or truncation
395         glyphs.
396         (insert_left_trunc_glyphs): Support GUI frames: make sure
397         truncation glyphs overwrite enough glyphs from the current line to
398         have sufficient space in pixels.
399         (display_line): Support truncation and continuation glyphs on GUI
400         frames.  If some spare pixels are left on the line after inserting
401         the truncation glyphs, fill that space with a stretch glyph of a
402         suitably computed width.
404         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
405         produce_glyphs, to support GUI sessions.
407 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
409         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
411         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
413         Do not require float-time's arg to fit in time_t (Bug#11825).
414         This works better on hosts where time_t is unsigned, and where
415         float-time is applied to the (negative) difference between two times.
416         * editfns.c (decode_time_components): Last arg is now double *,
417         not int *, and means to store all the result as a double, without
418         worrying about whether the seconds part fits in time_t.
419         All callers changed.
420         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
421         All callers changed.
422         (Ffloat_time): Do not fail merely because the specified time falls
423         outside of time_t range.
425 2012-07-07  Glenn Morris  <rgm@gnu.org>
427         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
428         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
429         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
431 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
433         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
434         Update dependencies.
436         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
438 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
440         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
441         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
442         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
443         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
444         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
445         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
447         * xfont.c (compare_font_names): Redo to omit the need for casts.
449 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
451         * xfns.c (Fx_change_window_property): Doc fix.
452         * w32fns.c (Fx_change_window_property): Doc fix.
454         * w32fns.c (Fx_window_property): Accept the same arguments as the
455         X Windows version.  Doc fix.
456         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
458 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
459             Eli Zaretskii  <eliz@gnu.org>
461         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
462         Windows-specific code from nt/config.nt moved here.
463         Obsolete settings removed.
465 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
467         * process.c: Avoid unnecessary calls to gettime.
468         (wait_reading_process_output): Don't get the time of day
469         when gobbling data immediately and not waiting, as there's no need
470         for it in that case.  This removes a FIXME.
472 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
474         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
475         is defined (Bug#11768).
477 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
479         Fix marker debugging code.
480         * marker.c (byte_char_debug_check): Do not perform the check
481         if buffer is not multibyte.
482         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
483         Call byte_char_debug_check with correct arguments.
485 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
487         Compile marker debugging code only if ENABLE_CHECKING is defined.
488         * marker.c (byte_char_debug_check, count_markers):
489         Use only if ENABLE_CHECKING is defined.
490         (byte_debug_flag): Remove.
491         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
492         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
494 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
496         Avoid code repetition in marker-related functions.
497         * marker.c (attach_marker): New function.
498         (Fset_marker, set_marker_restricted, set_marker_both)
499         (set_marker_restricted_both): Use it.
500         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
501         Consistently rename charno to charpos.
502         (marker_position): Add eassert.
503         (marker_byte_position): Convert to eassert.
505 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
507         Simplify list operations in unchain_overlay and unchain_marker.
508         * buffer.c (unchain_overlay): Simplify.  Add comment.
509         * marker.c (unchain_marker): Simplify.  Fix comments.
511 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
513         Introduce fast path for the widely used marker operation.
514         * alloc.c (build_marker): New function.
515         * lisp.h (build_marker): New prototype.
516         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
517         * composite.c (autocmp_chars): Likewise.
518         * editfns.c (buildmark): Remove.
519         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
520         (save_restriction_save): Use build_marker.
521         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
522         * window.c (save_window_save): Likewise.
524 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
526         Do not use Fdelete_overlay in delete_all_overlays
527         to avoid redundant calls to unchain_overlay.
528         * buffer.c (drop_overlay): New function.
529         (delete_all_overlays, Fdelete_overlay): Use it.
530         * minibuf.c (get_minibuffer): Fix comment.
532 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
534         Port to OpenBSD 5.1 amd64.
535         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
536         This is needed for OpenBSD, and should be harmless on all BSD systems.
537         Also, include <sys/sysctl.h>, as it should be available on all
538         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
539         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
540         use p_pid member, not kp_proc.pid.
542 2012-07-06  Glenn Morris  <rgm@gnu.org>
544         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
546 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
548         More xmalloc and related cleanup.
549         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
550         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
551         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
552         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
553         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
554         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
555         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
556         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
557         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
558         * xterm.c:
559         Omit needless casts involving void * pointers and allocation.
560         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
561         as the former is more robust if P's type is changed.
562         Prefer xzalloc to xmalloc + memset 0.
563         Simplify malloc-or-realloc to realloc.
564         Don't worry about xmalloc returning a null pointer.
565         Prefer xstrdup to xmalloc + strcpy.
566         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
567         growing it.
568         * keyboard.c (apply_modifiers_uncached): Prefer local array to
569         alloca of a constant.
571 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
573         * xdisp.c (display_line): Fix horizontal pixel coordinates when
574         hscroll is larger than the line width.  Fixes long and futile
575         looping inside extend_face_to_end_of_line (on a TTY) producing
576         glyphs that are not needed and thrown away.
578 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
580         * marker.c (set_marker_restricted_both): Simplify by using
581         clip_to_bounds.
583 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
585         * editfns.c (region_limit): Simplify by using clip_to_bounds.
587 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
589         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
590         not defined (Bug#11768).
591         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
592         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
593         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
594         followed by gtk_box_set_homogeneous (Bug#11768).
595         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
596         (update_theme_scrollbar_width, xg_create_scroll_bar):
597         Use gtk_scrollbar_new (Bug#11768).
598         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
599         (is_box_type): New function (Bug#11768).
600         (xg_tool_item_stale_p): Call is_box_type.
601         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
602         with default display (Bug#11768).
604 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
606         * xdisp.c (window_hscroll_limited): New function.
607         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
608         coordinates when window's hscroll is set to insanely large
609         values.  (Bug#11857)
611 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
613         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
614         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
616 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
618         Cleanup xmalloc.
619         * lisp.h (xzalloc): New prototype.  Omit needless casts.
620         * alloc.c (xzalloc): New function.  Omit needless casts.
621         * charset.c: Omit needless casts.  Convert all calls to
622         xmalloc with following memset to xzalloc.
623         * dispnew.c: Likewise.
624         * fringe.c: Likewise.
625         * image.c: Likewise.
626         * sound.c: Likewise.
627         * term.c: Likewise.
628         * w32fns.c: Likewise.
629         * w32font.c: Likewise.
630         * w32term.c: Likewise.
631         * xfaces.c: Likewise.
632         * xfns.c: Likewise.
633         * xterm.c: Likewise.
634         * atimer.c: Omit needless casts.
635         * buffer.c: Likewise.
636         * callproc.c: Likewise.
637         * ccl.c: Likewise.
638         * coding.c: Likewise.
639         * composite.c: Likewise.
640         * doc.c: Likewise.
641         * doprnt.c: Likewise.
642         * editfns.c: Likewise.
643         * emacs.c: Likewise.
644         * eval.c: Likewise.
645         * filelock.c: Likewise.
646         * fns.c: Likewise.
647         * gtkutil.c: Likewise.
648         * keyboard.c: Likewise.
649         * lisp.h: Likewise.
650         * lread.c: Likewise.
651         * minibuf.c: Likewise.
652         * msdos.c: Likewise.
653         * print.c: Likewise.
654         * process.c: Likewise.
655         * region-cache.c: Likewise.
656         * search.c: Likewise.
657         * sysdep.c: Likewise.
658         * termcap.c: Likewise.
659         * terminal.c: Likewise.
660         * tparam.c: Likewise.
661         * w16select.c: Likewise.
662         * w32.c: Likewise.
663         * w32reg.c: Likewise.
664         * w32select.c: Likewise.
665         * w32uniscribe.c: Likewise.
666         * widget.c: Likewise.
667         * xdisp.c: Likewise.
668         * xmenu.c: Likewise.
669         * xrdb.c: Likewise.
670         * xselect.c: Likewise.
672 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
674         * fileio.c (time_error_value): Check the right error number.
675         Problem reported by Troels Nielsen in
676         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
678 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
680         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
681         This should be fixed in a better way; see Eli Zaretskii in
682         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
683         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
685         * fileio.c (time_error_value): Rename from special_mtime.
686         The old name's problems were noted by Eli Zaretskii in
687         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
689         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
690         This variable's comment says Emacs needs at least one GDB-visible
691         symbol of type enum pvec_type, to work around GDB problems.
692         The symbol's value doesn't matter.
694         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
695         that causes compilation to fail on pre-C99 compilers.
697 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
699         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
700         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
702 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
704         * buffer.c (init_buffer_once): Fix initialization of
705         headers for buffer_defaults and buffer_local_symbols.
706         Reported by Juanma Barranquero <lekktu@gmail.com>.
708 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
710         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
711         * lisp.h (enum pvec_type): Use fewer bits.
712         (PSEUDOVECTOR_SIZE_BITS): New constant.
713         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
714         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
715         change in pvec_type.
716         (PSEUDOVECTOR_TYPEP): New macro.
717         (TYPED_PSEUDOVECTORP): Use it.
718         * fns.c (internal_equal): Adapt code to extract pvectype.
719         * emacs.c (gdb_pvec_type): Update type.
720         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
721         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
722         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
723         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
724         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
725         abusing vector->header.next.nbytes.
726         (live_vector_p): Use PVEC_TYPE.
727         (mark_object): Adapt code to extract pvectype.  Use switch.
729 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
731         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
732         Tighten new eassert a bit.
734 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
736         Fix compilation with --enable-gcc-warnings and -O1
737         optimization level.
738         * doprnt.c (doprnt): Change type of tem to int, initialize
739         to avoid compiler warning.  Add eassert.
740         * search.c (simple_search): Initialize match_byte to avoid
741         compiler warning.  Add eassert.
743 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
745         Avoid weird behavior with large horizontal scrolls.
746         Without this change, for example, large hscroll values would
747         mess up Emacs's display on Fedora 15 x86, presumably due to
748         overflows in int calculations in the display code.
749         Also, if buffers had long lines, Emacs would freeze.
750         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
751         (set_window_hscroll): New function, containing the old guts of
752         Fset_window_hscroll.  Return the clipped value.
753         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
754         This avoids the need to check against PTRDIFF_MAX.
756         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
758 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
760         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
762 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
764         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
765         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
766         since GCC 4.4.6 issues a bogus warning for them.
768         Fix bugs in file timestamp newness comparisons.
769         * fileio.c (Ffile_newer_than_file_p):
770         * lread.c (Fload): Use full timestamp resolution of files,
771         not just the 1-second resolution, so that files that are only
772         slightly newer still count as newer.
773         * fileio.c (Ffile_newer_than_file_p): Don't assume file
774         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
776 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
778         * fileio.c: Improve handling of file time marker.  (Bug#11852)
779         (special_mtime): New function.
780         (Finsert_file_contents, Fverify_visited_file_modtime):
781         Use it to set special mtime values consistently.
783 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
785         * fileio.c (Finsert_file_contents): Properly handle st_mtime
786         marker for non-existing file.  (Bug#11852)
788 2012-07-03  Glenn Morris  <rgm@gnu.org>
790         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
791         and did not make it into globals.h).
793 2012-07-03  Tom Tromey  <tromey@redhat.com>
795         * window.c (Fset_window_margins, Fset_window_fringes)
796         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
797         * textprop.c (Fprevious_property_change): No longer static.
798         * syntax.c (Fsyntax_table_p): No longer static.
799         * process.c (Fget_process, Fprocess_datagram_address): No longer
800         static.
801         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
802         * keyboard.c (Fcommand_execute): No longer static.
803         Remove EXFUN.
804         * insdel.c (Fcombine_after_change_execute): No longer static.
805         * image.c (Finit_image_library): No longer static.
806         * fileio.c (Fmake_symbolic_link): No longer static.
807         * eval.c (Ffetch_bytecode): No longer static.
808         * editfns.c (Fuser_full_name): No longer static.
809         * doc.c (Fdocumentation_property, Fsnarf_documentation):
810         No longer static.
811         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
812         static.
813         * dired.c (Ffile_attributes): No longer static.
814         * composite.c (Fcomposition_get_gstring): No longer static.
815         * callproc.c (Fgetenv_internal): No longer static.
817         * ccl.h: Remove EXFUNs.
818         * buffer.h: Remove EXFUNs.
819         * dispextern.h: Remove EXFUNs.
820         * intervals.h: Remove EXFUNs.
821         * fontset.h: Remove EXFUN.
822         * font.h: Remove EXFUNs.
823         * dosfns.c (system_process_attributes): Remove EXFUN.
824         * keymap.h: Remove EXFUNs.
825         * lisp.h: Remove EXFUNs.
826         * w32term.h: Remove EXFUNs.
827         * window.h: Remove EXFUNs.
828         * xsettings.h: Remove EXFUN.
829         * xterm.h: Remove EXFUN.
831 2012-07-03  Glenn Morris  <rgm@gnu.org>
833         * lisp.h (Frandom): Make it visible to C.
834         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
835         buffer for invisible buffers.  (Bug#1229)
837 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
839         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
840         values which aren't power of 2.
841         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.  Verify
842         it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
843         accordingly.
845 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
847         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
849         * alloc.c (mark_object): Revert part of last patch to use `switch'.
851 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
853         * alloc.c (allocate_vector_block): Remove redundant
854         calls to mallopt if DOUG_LEA_MALLOC is defined.
855         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
856         avoid calls to mallopt if zero_vector is returned.
858 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
860         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
861         is enabled, avoid dereferencing NULL current_sblock if
862         running undumped.
864 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
866         Cleanup basic buffer management.
867         * buffer.h (struct buffer): Change layout to use generic vector
868         marking code.  Fix some comments.  Change type of 'clip_changed'
869         to bitfield.  Remove unused #ifndef old.
870         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
871         (GET_OVERLAYS_AT): Fix indentation.
872         (for_each_per_buffer_object_at): New macro.
873         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
874         (Fbuffer_local_variables): Use it.
875         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
876         * alloc.c (allocate_buffer): Adjust to match new layout of
877         struct buffer.  Fix comment.
878         (mark_overlay): New function.
879         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
880         Lisp area of struct buffer.
881         (mark_object): Use it.  Adjust marking of misc objects
882         and related comments.
884 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
886         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
887         wrapper that is not needed because the wrapped code is a no-op (zero
888         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
889         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
891 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
893         * alloc.c (mark_buffer): Simplify.  Remove prototype.
894         (mark_object): Add comment.  Reorganize marking of vector-like
895         objects.  Use CHECK_LIVE for all vector-like objects except buffers
896         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.  Avoid
897         redundant calls to mark_vectorlike for bool vectors.
899 2012-06-30  Glenn Morris  <rgm@gnu.org>
901         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
903         * epaths.in (PATH_SITELOADSEARCH): New.
904         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
905         This is rather than relying on --enable-locallisppath elements
906         having "site-lisp" in their names.  (Bug#10208#25, 11658)
908 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
910         * w32proc.c (sys_select): Accept and ignore one more argument.
912         * w32.c (emacs_gnutls_pull): Call select with one more argument.
914         * sysselect.h [DOS_NT]: Don't include sys/select.h.
915         (pselect) [!MS_DOS]: Redirect to sys_select.
917         * sysdep.c: Don't include dos.h and dosfns.h.
919         * process.c (sys_select):
920         * msdos.c (sys_select): Accept one more argument and ignore it.
922         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
923         adapt data types and code to that.
925         * dosfns.c:
926         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
927         which clashes with the gnulib function of the same name.
929 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
931         * font.c (font_style_to_value, font_style_symbolic)
932         (font_prop_validate_style): Add type checks for values in
933         font_style_table.
935         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
936         argument.
937         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
938         uses.
940 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
942         * xdisp.c (try_window_id): Undo last change.
944         * w32.c (getwd): Adjust commentary about startup_dir.
945         (init_environment): Always call sys_access, even in non-MSVC
946         builds.  Don't chdir to the directory of the Emacs executable.
947         This undoes code from 1997 which was justified by the need to
948         "avoid conflicts when removing and renaming directories".  But its
949         downside was that every relative file name was being interpreted
950         relative to the directory of the Emacs executable, which can never
951         be TRT.  In particular, it broke sys_access when called with
952         relative file names.
953         (sys_access): Map GetLastError to errno.
955 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
957         * window.h (struct window): Change type of 'fringes_outside_margins'
958         to bitfield.  Fix comment.  Adjust users accordingly.
959         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
960         Adjust comment.
961         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
962         to ptrdiff_t.
964 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
966         * gnutls.c (emacs_gnutls_handshake):
967         Add QUIT to make the loop interruptible.
969 2012-06-29  Glenn Morris  <rgm@gnu.org>
971         * charset.c (init_charset): Make lack of etc/charsets fatal.
973 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
975         * editfns.c (region_limit): Fix type mismatch.
977 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
979         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
980         undefined.  Convert from xassert to eassert.
981         * nsmenu.m: Convert from xassert to eassert.
982         * nsterm.m: Likewise.
984 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
986         * editfns.c (region_limit): Clip to narrowing (bug#11770).
988 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
990         Avoid integer overflow on scroll-left and scroll-right.
991         * window.c (HSCROLL_MAX): New macro.
992         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
993         overflow when requested scroll falls outside ptrdiff_t range.
995 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
997         * window.h (struct window): Change type of 'hscroll',
998         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
999         'last_modified' and 'last_overlay_modified' to EMACS_INT.
1000         Adjust users accordingly.
1001         * xdisp.c (try_cursor_movement): Replace type check with eassert.
1002         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
1003         from EMACS_INT to ptrdiff_t.
1004         (make_window): Omit redundant initialization.
1006 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
1008         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
1010 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
1012         * window.h (struct window): Change type of 'use_time' and
1013         'sequence_number' from Lisp_Object to int.
1014         * frame.c (make_frame): Adjust users accordingly.
1015         * print.c (print_object): Likewise.
1016         * window.c (select_window, Fwindow_use_time, make_parent_window)
1017         (make_window): Likewise.
1019 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
1021         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
1022         enabled with --enable-checking=[all,glyphs] configure option.
1023         Fix GLYPH_DEBUG usage assuming that it may be undefined,
1024         adjust comments accordingly.
1025         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
1026         undefined, adjust comments accordingly.
1027         * image.c: Likewise.
1028         * scroll.c: Likewise.
1029         * w32fns.c: Likewise.
1030         * w32term.c: Likewise.
1031         * xdisp.c: Likewise.
1032         * xfaces.c: Likewise.
1033         * xfns.c: Likewise.
1034         * xterm.c: Likewise.
1036 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
1038         Generalize run-time debugging checks.
1039         * dispextern.h (XASSERTS): Remove.
1040         * fontset.c (xassert): Remove.
1041         Convert from xassert to eassert.
1042         * alloc.c: Convert from xassert to eassert.
1043         * bidi.c: Likewise.
1044         * dispnew.c: Likewise.
1045         * fns.c: Likewise.
1046         * fringe.c: Likewise.
1047         * ftfont.c: Likewise.
1048         * gtkutil.c: Likewise.
1049         * image.c: Likewise.
1050         * keyboard.c: Likewise.
1051         * menu.c: Likewise.
1052         * process.c: Likewise.
1053         * scroll.c: Likewise.
1054         * sound.c: Likewise.
1055         * term.c: Likewise.
1056         * w32console.c: Likewise.
1057         * w32fns.c: Likewise.
1058         * w32term.c: Likewise.
1059         * window.c: Likewise.
1060         * xdisp.c: Likewise.
1061         * xfaces.c: Likewise.
1062         * xfns.c: Likewise.
1063         * xselect.c: Likewise.
1064         * xterm.c: Likewise.
1066 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
1068         * fns.c (maybe_resize_hash_table): Output message when growing the
1069         purify-hashtable.
1071 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
1073         * alloc.c (allocate_string_data): Remove dead code.
1074         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
1075         avoid GCC warning about unused macro.
1077 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
1079         * alloc.c (allocate_string): Omit intervals initialization.
1080         * alloc.c (make_uninit_multibyte_string): Initialize intervals
1081         as in make_pure_string and make_pure_c_string.
1083 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
1085         * alloc.c (allocate_string): Fix last change.
1087 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
1089         * alloc.c (allocate_string): Remove two redundant calls
1090         to memset, add explicit initialization where appropriate.
1092 2012-06-27  Glenn Morris  <rgm@gnu.org>
1094         * lisp.mk (lisp): Remove paths.elc.
1096 2012-06-27  Chong Yidong  <cyd@gnu.org>
1098         * doc.c (Fsubstitute_command_keys): Fix punctuation.
1100 2012-06-26  John Wiegley  <johnw@newartisans.com>
1102         * unexmacosx.c (copy_data_segment): Add two section names used
1103         on Mac OS X Lion: __mod_init_func and __mod_term_func.
1105         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
1106         when building with Clang.
1108 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
1110         * eval.c (Fapply): Allow calling it with a single argument.
1112 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
1114         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
1115         _stricmp and _strnicmp.
1116         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
1118 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
1120         * alloc.c (allocate_window): Zero out non-Lisp part of newly
1121         allocated window.
1122         (allocate_process): Likewise for new process.
1123         (allocate_terminal): Change to use offsetof.
1124         (allocate_frame): Likewise.
1125         * frame.c (make_frame): Omit redundant initialization.
1126         * window.c (make_parent_window): Use memset.
1127         (make_window): Omit redundant initialization.
1128         * process.c (make_process): Omit redundant initialization.
1129         * terminal.c (create_terminal): Likewise.
1131 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
1133         * term.c (delete_tty): Remove redundant call to memset.
1135 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
1137         * alloc.c: Remove build_string.
1138         * lisp.h: Define build_string as static inline.  This provides
1139         a better opportunity to optimize away calls to strlen when the
1140         function is called with compile-time constant argument.
1141         * image.c (imagemagick_error): Convert to build_string.
1142         * w32proc.c (sys_spawnve): Likewise.
1143         * xterm.c (x_term_init): Likewise.
1145 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
1147         Use sprintf return value instead of invoking strlen on result.
1148         In the old days this wasn't portable, since some sprintf
1149         implementations returned char *.  But they died out years ago and
1150         Emacs already assumes sprintf returns int.
1151         Similarly for float_to_string.
1152         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
1153         * ccl.c (ccl_driver):
1154         * character.c (string_escape_byte8):
1155         * data.c (Fnumber_to_string):
1156         * doprnt.c (doprnt):
1157         * print.c (print_object):
1158         * xdisp.c (message_dolog):
1159         * xfns.c (syms_of_xfns):
1160         Use sprintf or float_to_string result to avoid need to call strlen.
1161         * data.c (Fnumber_to_string):
1162         Use make_unibyte_string, since the string must be ASCII.
1163         * lisp.h, print.c (float_to_string): Now returns int length.
1164         * term.c (produce_glyphless_glyph):
1165         Use sprintf result rather than recomputing it.
1167         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
1168         * Makefile.in (ALL_CFLAGS):
1169         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
1170         * gmalloc.c, regex.c: Include <config.h> unconditionally.
1172 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
1174         * dispextern.h (xstrcasecmp): Define to library function
1175         strcasecmp if available.
1176         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
1178 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
1180         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
1181         Avoid comma operator.
1182         * menu.c (push_submenu_start, push_submenu_end)
1183         (push_left_right_boundary, push_menu_pane): Likewise.
1184         * msdos.c (dos_rawgetc): Likewise.
1186 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
1188         * xfns.c (xic_create_fontsetname): Remove redundant calls
1189         to memset.
1191 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
1193         * gtkutil.c (get_utf8_string): Remove redundant assignment.
1194         sprintf already null-terminates its output.
1196         * xfns.c (x_window): Remove redundant cast.
1198 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
1200         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
1201         `const char *' to `char *' to avoid compiler warning.
1203 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
1205         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
1206         instead of truncating it to 63 (admittedly a generous limit).
1208         * process.c: Fix spelling and caps in comments.
1210 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
1212         * emacs.c (setpgrp): Remove definition, unused.
1213         * sysdep.c (setpgrp): Remove definition, not used in this file.
1215 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
1217         * makefile.w32-in: Update dependencies.
1219 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
1221         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
1222         (SYSTIME_H): Add nt/inc/sys/time.h.
1224         * systime.h [WINDOWSNT]: Include sys/time.h.
1226         * s/ms-w32.h (struct timespec): Definition moved from
1227         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
1229 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
1231         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
1232         * buffer.h (buffer_slot_type_mismatch):
1233         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1234         * eval.c (unwind_to_catch):
1235         * image.c (my_png_error, my_error_exit):
1236         * keyboard.c (quit_throw_to_read_char, user_error)
1237         (Fexit_recursive_edit, Fabort_recursive_edit):
1238         * lisp.h (die, args_out_of_range, args_out_of_range_3)
1239         (wrong_type_argument, buffer_overflow, __executable_start)
1240         (memory_full, buffer_memory_full, string_overflow, Fthrow)
1241         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
1242         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
1243         (fatal):
1244         (child_setup) [!DOS_NT]:
1245         * lread.c (end_of_file_error, invalid_syntax):
1246         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
1247         * puresize.h (pure_write_error):
1248         * search.c (matcher_overflow):
1249         * sound.c (sound_perror, alsa_sound_perror):
1250         * sysdep.c, syssignal.h (croak):
1251         * term.c (maybe_fatal, vfatal):
1252         * textprop.c (text_read_only):
1253         * undo.c (user_error):
1254         * unexmacosx.c (unexec_error):
1255         * xterm.c (x_ins_del_lines, x_delete_glyphs):
1256         Use _Noreturn rather than NO_RETURN.
1257         No need for separate decl merely because of _Noreturn.
1258         * sound.c (sound_warning, parse_sound):
1259         Remove unnecessary forward decls.
1261 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
1263         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
1264         * lisp.h (WAIT_READING_MAX): New macro.
1265         * dispnew.c (Fsleep_for, sit_for):
1266         * keyboard.c (kbd_buffer_get_event):
1267         * process.c (Faccept_process_output):
1268         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
1269         This improves on the previous patch, which introduced a bug
1270         when time_t is unsigned and as wide as intmax_t.
1271         See <http://bugs.gnu.org/9000#51>.
1273 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
1275         * dispnew.c (sit_for, Fsleep_for):
1276         * keyboard.c (kbd_buffer_get_event):
1277         * process.c (Faccept_process_output): Avoid compiler warnings when
1278         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
1280 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
1282         * makefile.w32-in: Update dependencies.
1284         * w32.c (ltime): Add return type and declare static.
1285         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
1287 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
1289         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
1290         Privately reported by Herbert J. Skuhra.
1291         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
1292         All uses changed.
1293         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
1294         not make_lisp_timeval, when the argument is of type EMACS_TIME.
1296 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
1298         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
1299         last argument of make_unibyte_string.
1301         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
1302         language ID in the event parameters.
1304         * w32term.c (w32_read_socket): Put the new keyboard codepage into
1305         event.code, not the obscure "character set ID".
1307 2012-06-23  Chong Yidong  <cyd@gnu.org>
1309         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
1311 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
1313         Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
1314         * w32.c (fdutimens): New function.
1316         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
1318         * s/ms-w32.h (pselect): Redirect to sys_select.
1320         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
1322         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
1323         in the logic of incrementing and decrementing the value of
1324         use_relocatable_buffers.
1326 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
1328         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
1329         Privately reported by Herbert J. Skuhra.
1330         [__FreeBSD__]: Remove "*/" typo after "#include".
1331         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
1332         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
1333         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
1334         Don't assume EMACS_TIME and struct timeval are the same type.
1336 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
1338         Support higher-resolution time stamps (Bug#9000).
1339         The time stamps are only nanosecond-resolution at the C level,
1340         since that's the best that any real-world system supports now.
1341         But they are picosecond-resolution at the Lisp level, as that's
1342         easy, and leaves room for future OS improvements.
1344         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
1345         (LIBES): Use it.
1347         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
1348         Don't get current time unless it's needed.
1350         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
1351         now provides it if it's absent.
1352         (start_atimer): Port to higher-res time stamps.
1353         Check for time stamp overflow.  Don't get current time more
1354         often than is needed.
1356         * buffer.h (struct buffer): Buffer modtime now has high resolution.
1357         Include systime.h, not time.h.
1358         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
1360         * dired.c: Include stat-time.h.
1361         (Ffile-attributes): File times now have higher resolution.
1363         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
1364         (struct image): Timestamp now has higher resolution.
1366         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
1367         has at least microseconds now.  All uses removed.
1368         (update_frame, update_single_window, update_window, update_frame_1)
1369         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
1371         * editfns.c (time_overflow): Now extern.
1372         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
1373         (float-time, Fformat_time_string, Fcurrent_time_string)
1374         (Fcurrent_time_zone): Accept and generate higher-resolution
1375         time stamps.
1376         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
1377         (decode_time_components, lisp_seconds_argument): New functions.
1378         (make_time): Now static.
1379         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
1380         Report an error if the time is invalid, rather than having the caller
1381         do that.
1383         * fileio.c: Include <stat-time.h>
1384         (Fcopy_file): Copy higher-resolution time stamps.
1385         Prefer to set the time stamp via a file descriptor if that works.
1386         (Fset_file_times, Finsert_file_contents, Fwrite_region)
1387         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
1388         (Fvisited_file_modtime, Fset_visited_file_modtime):
1389         Support higher-resolution time stamps.
1391         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
1393         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
1395         * image.c (prepare_image_for_display, clear_image_cache)
1396         (lookup_image): Port to higer-resolution time stamps.
1398         * keyboard.c (start_polling, bind_polling_period):
1399         Check for time stamp overflow.
1400         (read_char, kbd_buffer_get_event, timer_start_idle)
1401         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
1402         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
1403         Port to higher-resolution time stamps.  Do not assume time_t is signed.
1404         (decode_timer): New function.  Timers are now vectors of length 9,
1405         not 8, to accommodate the picosecond component.
1406         (timer_check_2): Use it.
1408         * nsterm.m (select_timeout, timeval_subtract): Remove.
1409         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
1410         as they're a bit more accurate and handle overflow better.
1411         (ns_select): Change prototype to be compatible with pselect.
1412         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
1413         * nsterm.h (ns_select): Adjust prototype.
1415         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
1416         us-resolution time stamps.
1417         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
1419         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
1421         * lisp.h (time_overflow): New decl.
1422         (wait_reading_process_output): First arg is now intmax_t, not int,
1423         to accommodate larger waits.
1425         * process.h (struct Lisp_Process.read_output_delay):
1426         Now counts nanoseconds, not microseconds.
1427         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
1428         EMACS_HAS_USECS.
1429         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
1430         (wait_reading_process_output):
1431         Port to ns-resolution time stamps.
1432         (Faccept_process_output, wait_reading_process_output):
1433         Check for time stamp overflow.  Do not assume time_t is signed.
1434         (select_wrapper): Remove; we now use pselect.
1435         (Fprocess_attributes): Now generates ns-resolution time stamps.
1437         * sysdep.c: Include utimens.h.  Don't include utime.h
1438         or worry about struct utimbuf; gnulib does that for us now.
1439         (gettimeofday): Remove; gnulib provides a substitute.
1440         (make_timeval): New function.
1441         (set_file_times): Now sets ns-resolution time stamps.
1442         New arg FD; all uses changed.
1443         (time_from_jiffies, ltime_from_jiffies, get_up_time)
1444         (system_process_attributes):
1445         Now returns ns-resolution time stamp.  All uses changed.
1446         Check for time stamp overflow.
1448         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
1449         provides a substitute now.
1451         * systime.h: Include timespec.h rather than sys/time.h and time.h,
1452         since it guarantees struct timespec.
1453         (EMACS_TIME): Now struct timespec, so that we can support
1454         ns-resolution time stamps.
1455         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
1456         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
1457         (EMACS_USECS): Remove.
1458         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
1459         so multiply the arg by 1000 before storing it.
1460         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
1461         New macros.
1462         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
1463         Port to ns-resolution time stamps.
1464         (EMACS_TIME_NEG_P): Remove; replaced by....
1465         (EMACS_TIME_SIGN): New macro.
1466         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
1467         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
1468         (set_file_times, make_time, lisp_time_argument): Adjust signature.
1469         (make_timeval, make_lisp_time, decode_time_components): New decls.
1470         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
1471         that it mishandled time_t overflow.  You can't compare by subtracting!
1472         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
1473         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
1475         * term.c: Include <sys/time.h>.
1476         (timeval_to_Time): New function, for proper overflow wraparound.
1477         (term_mouse_position, term_mouse_click): Use it.
1479         * undo.c (record_first_change): Support higher-resolution time stamps
1480         in the undo buffer.
1481         (Fprimitive_undo): Use them when restoring time stamps.
1483         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
1484         (w32_get_internal_run_time):
1485         Port to higher-resolution Emacs time stamps.
1486         (ltime): Now accepts single 64-bit integer, as that's more convenient
1487         for callers.
1489         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
1491         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
1492         for compatibility with pselect.  Support ns-resolution time stamps.
1494         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
1496         * xselect.c (wait_for_property_change, x_get_foreign_selection):
1497         Check for time stamp overflow, and support ns-resolution time stamps.
1499         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
1500         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
1501         (timeval_subtract): Remove; no longer needed.
1502         (XTflash, XTring_bell, x_wait_for_event):
1503         Port to ns-resolution time stamps.  Don't assume time_t is signed.
1505 2012-06-22  Chong Yidong  <cyd@gnu.org>
1507         * xdisp.c (x_consider_frame_title): Revert last change.
1509 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
1511         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
1512         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
1513         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
1514         staticidx goes up to 1597 out of 1600 = 0x640.)
1516 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
1518         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
1519         Otherwise, the umask might be mistakenly 0 while handling input signals.
1521 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
1523         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
1525 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
1527         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
1528         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
1529         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
1530         access to `contents' member of Lisp_Vector objects with AREF and ASET
1531         where appropriate.
1533 2012-06-19  Chong Yidong  <cyd@gnu.org>
1535         * frame.c (delete_frame): When selecting a frame on a different
1536         text terminal, do not alter the terminal's top-frame.
1538         * xdisp.c (format_mode_line_unwind_data): Record the target
1539         frame's selected window and its terminal's top-frame.
1540         (unwind_format_mode_line): Restore them.
1541         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
1542         Callers changed.
1543         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
1544         since tty frames can be explicitly named.
1545         (prepare_menu_bars): Likewise.
1547         * term.c (Ftty_top_frame): New function.
1549 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
1551         Port byte-code-meter to modern targets.
1552         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
1553         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
1554         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
1555         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
1556         (METER_1, METER_2): Simplify.
1558 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
1560         * data.c (Fdefalias): Return `symbol' (bug#11686).
1562 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
1564         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1565         gets killed during executing of this function (Bug#11665).
1566         Try to always return Qt when the buffer has been actually killed.
1567         (Vkill_buffer_query_functions): In doc-string say that functions
1568         run by this hook should not change the current buffer.
1570 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
1572         Fix recently-introduced process.c problems found by static checking.
1573         * process.c (write_queue_push, write_queue_pop, send_process):
1574         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
1575         (write_queue_pop): Fix pointer signedness problem.
1576         (send_process): Remove unused local.
1578 2012-06-17  Chong Yidong  <cyd@gnu.org>
1580         * xdisp.c (redisplay_internal): No need to redisplay terminal
1581         frames that are not on top.
1583 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
1585         * process.c (make_process): Initialize write_queue.
1586         (write_queue_push, write_queue_pop): New functions.
1587         (send_process): Use them to maintain correct ordering of process
1588         writes (Bug#10815).
1590 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
1592         * lisp.h (eassert): Assume C89 or later.
1593         This removes the need for CHECK.
1594         (CHECK): Remove.  Its comments about always evaluating its
1595         argument were confusing, as 'eassert' typically does not evaluate
1596         its argument.
1598         * coding.c (produce_chars): Use ptrdiff_t, not int.
1600         * xterm.c (x_draw_underwave): Check for integer overflow.
1601         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
1603 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
1605         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
1606         referenced (Bug#11583).
1608 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
1610         Implement wave-style variant of underlining.
1611         * dispextern.h (face_underline_type): New enum.
1612         (face): Add field for underline type.
1613         * nsterm.m (ns_draw_underwave): New function.
1614         (ns_draw_text_decoration): Use it.
1615         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
1616         New functions.
1617         (x_draw_glyph_string): Use them.
1618         * xfaces.c (Qline, Qwave): New Lisp objects.
1619         (check_lface_attrs, merge_face_ref)
1620         (Finternal_set_lisp_face_attribute, realize_x_face):
1621         Handle wave-style underline face attributes.
1622         * xterm.c (x_draw_underwave): New function.
1623         (x_draw_glyph_string): Use it.
1625 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
1627         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
1628         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
1629         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
1630         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
1631         ($(BLD)/w32select.$(O)): Update dependencies.
1633 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
1635         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
1636         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
1637         * character.c (_fetch_multibyte_char_p): Remove.
1638         * alloc.c: Include "character.h" before "buffer.h".
1639         * bidi.c: Likewise.
1640         * buffer.c: Likewise.
1641         * bytecode.c: Likewise.
1642         * callint.c: Likewise.
1643         * callproc.c: Likewise.
1644         * casefiddle.c: Likewise.
1645         * casetab.c: Likewise.
1646         * category.c: Likewise.
1647         * cmds.c: Likewise.
1648         * coding.c: Likewise.
1649         * composite.c: Likewise.
1650         * dired.c: Likewise.
1651         * dispnew.c: Likewise.
1652         * doc.c: Likewise.
1653         * dosfns.c: Likewise.
1654         * editfns.c: Likewise.
1655         * emacs.c: Likewise.
1656         * fileio.c: Likewise.
1657         * filelock.c: Likewise.
1658         * font.c: Likewise.
1659         * fontset.c: Likewise.
1660         * fringe.c: Likewise.
1661         * indent.c: Likewise.
1662         * insdel.c: Likewise.
1663         * intervals.c: Likewise.
1664         * keyboard.c: Likewise.
1665         * keymap.c: Likewise.
1666         * lread.c: Likewise.
1667         * macros.c: Likewise.
1668         * marker.c: Likewise.
1669         * minibuf.c: Likewise.
1670         * nsfns.m: Likewise.
1671         * nsmenu.m: Likewise.
1672         * print.c: Likewise.
1673         * process.c: Likewise.
1674         * regex.c: Likewise.
1675         * region-cache.c: Likewise.
1676         * search.c: Likewise.
1677         * syntax.c: Likewise.
1678         * term.c: Likewise.
1679         * textprop.c: Likewise.
1680         * undo.c: Likewise.
1681         * unexsol.c: Likewise.
1682         * w16select.c: Likewise.
1683         * w32fns.c: Likewise.
1684         * w32menu.c: Likewise.
1685         * window.c: Likewise.
1686         * xdisp.c: Likewise.
1687         * xfns.c: Likewise.
1688         * xmenu.c: Likewise.
1689         * xml.c: Likewise.
1690         * xselect.c: Likewise.
1692 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
1694         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
1695         If all the glyphs of the glyph row came from strings, and we have no
1696         cursor positioning clues, put the cursor on the first glyph of the
1697         row.
1698         (handle_face_prop): Use chunk-relative overlay string index when
1699         indexing into it->string_overlays array.  (Bug#11653)
1700         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
1701         the rightmost.  (Bug#11720)
1703 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
1705         * category.h (CHAR_HAS_CATEGORY): Define as inline.
1706         (CATEGORY_MEMBER): Enforce 1/0 value.
1707         * category.c (_temp_category_set): Remove.
1709 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
1711         * window.c (Fdelete_other_windows_internal)
1712         (Fdelete_window_internal): Don't access frame's mouse highlight
1713         info of the initial frame.  (Bug#11677)
1715 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
1717         * .gdbinit (xgetint): Fix recently-introduced paren typo.
1718         Assume USE_2_TAGS_FOR_INTS.
1719         (xreload): Adjust $tagmask width to match recent lisp.h change.
1721         Simplify lisp.h in minor ways that should not affect code.
1722         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
1723         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
1724         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
1725         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
1726         (INTTYPEBITS): New macro, for clarity.
1727         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1728         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
1729         Simplify now that USE_LSB_TAG is always defined.
1730         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
1731         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
1733 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
1735         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
1737 2012-06-13  Glenn Morris  <rgm@gnu.org>
1739         * s/bsd-common.h (BSD4_3):
1740         * s/usg5-4-common.h (USG5_4): No longer define; unused.
1742 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
1744         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
1745         instead of union.
1746         (XLI, XIL): Define.
1747         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
1748         Use them.
1749         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
1750         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1751         * alloc.c (widen_to_Lisp_Object): Remove.
1752         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
1753         * frame.c (delete_frame): Remove outdated comment.
1754         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
1755         USE_LISP_UNION_TYPE.
1756         (Fw32_unregister_hot_key): Likewise.
1757         (Fw32_toggle_lock_key): Likewise.
1758         * w32menu.c (add_menu_item): Likewise.
1759         (w32_menu_display_help): Use XIL instead of checking
1760         USE_LISP_UNION_TYPE.
1761         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
1762         (init_heap): Likewise.
1763         * w32term.c (w32_read_socket): Update comment.
1765 2012-06-13  Glenn Morris  <rgm@gnu.org>
1767         * s/usg5-4-common.h, src/s/unixware.h:
1768         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
1770         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
1772 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
1774         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
1775         * alloc.c (make_number) [!defined make_number]:
1776         Remove, as lisp.h always defines this now.
1777         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
1778         (roundup_size): Verify that it is a power of 2.
1779         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
1780         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
1781         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
1782         -DUSE_LSB_TAG=0, to override the automatically-selected default.
1783         USE_LSB_TAG now is always defined to be either 0 or 1.
1784         All uses changed.
1785         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
1786         code works fine either way, and efficiency is not a concern here,
1787         as the union type is for debugging, not for production.
1788         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
1789         Use an inline function on all platforms when using the union type,
1790         since this is simpler and 'static inline' can be used portably
1791         within Emacs now.
1792         (LISP_INITIALLY_ZERO): New macro.
1793         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
1794         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
1796 2012-06-12  Glenn Morris  <rgm@gnu.org>
1798         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
1800         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
1802         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
1803         Move BROKEN_SIGIO to configure.
1805         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
1806         Move NO_TERMIO to configure.
1808 2012-06-12  Chong Yidong  <cyd@gnu.org>
1810         * image.c (imagemagick_load_image): Use MagickFlattenImage if
1811         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
1812         MagickExportImagePixels is undefined.
1814 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
1816         * image.c (imagemagick_load_image): Remove unused label.
1818 2012-06-11  Glenn Morris  <rgm@gnu.org>
1820         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1821         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
1822         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
1823         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
1825 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
1827         * alloc.c (make_byte_code): New function.
1828         (Fmake_byte_code): Use it.  Don't purify here.
1829         * lread.c (read1): Use it as well to avoid extra allocation.
1831 2012-06-11  Chong Yidong  <cyd@gnu.org>
1833         * image.c (imagemagick_load_image): Implement transparency.
1835 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
1837         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
1838         account for preceding backslashes.  (Bug#11663)
1840 2012-06-09  Chong Yidong  <cyd@gnu.org>
1842         * term.c: Support italics in capable terminals (Bug#9652).
1843         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
1844         (turn_on_face): Output using TS_enter_italic_mode if available.
1845         Don't handle unused blinking and alt-charset cases.
1846         (turn_off_face): Handle italic case; discard unused tty_blinking_p
1847         and tty_alt_charset_p cases.
1848         (tty_capable_p, init_tty): Support italics.
1850         * termchar.h (struct tty_display_info): Add field for italics.
1851         Remove unused blink field.
1853         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
1854         Handle slant.
1856         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
1857         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
1858         tty_alt_charset_p.  Add tty_italic_p.
1860 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
1862         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
1863         dbus_type_is_basic if available.
1864         (xd_extract_signed, xd_extract_unsigned): Rename from
1865         extract_signed and extract_unsigned, respectively.  Adapt callers.
1867 2012-06-09  Chong Yidong  <cyd@gnu.org>
1869         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
1871         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
1872         case (Bug#9752).
1874 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
1876         * xdisp.c (vmessage): Treat frame message as multibyte.
1877         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
1878         would generate the diagnostic "Making \302\247 buffer-local while
1879         let-bound!".
1881 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
1883         * dispnew.c (showing_window_margins_p): Undo last change, which
1884         was done due to an inadvertent commit.
1885         (adjust_frame_glyphs_for_frame_redisplay): Do call
1886         showing_window_margins_p.
1888 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
1890         * eval.c (Fmake_var_non_special): New primitive.
1891         (syms_of_eval): Defsubr it.
1892         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
1894 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
1896         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
1897         function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
1899 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
1901         * alloc.c (allocate_vectorlike): Fix last change.
1903 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
1905         Block-based vector allocation of small vectors.
1906         * lisp.h (struct vectorlike_header): New field `nbytes',
1907         adjust comment accordingly.
1908         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
1909         to denote vector blocks. Adjust users (live_vector_p,
1910         mark_maybe_pointer, valid_lisp_object_p) accordingly.
1911         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
1912         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
1913         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
1914         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
1915         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
1916         (roundup_size): New constant.
1917         (struct vector_block): New data type.
1918         (vector_blocks, vector_free_lists, zero_vector): New variables.
1919         (all_vectors): Rename to `large_vectors'.
1920         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
1921         (sweep_vectors): New functions.
1922         (allocate_vectorlike): Return `zero_vector' as the only vector of
1923         0 items. Allocate new vector from block if vector size is less than
1924         or equal to VBLOCK_BYTES_MAX.
1925         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
1926         (init_alloc_once): Add call to init_vectors.
1928 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
1930         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
1932 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
1934         * doprnt.c (doprnt): Truncate multibyte char correctly.
1935         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
1936         would mishandle a string argument "Xc" if X was a multibyte
1937         character of length 2: it would truncate after X's first byte
1938         rather than including all of X.
1940 2012-06-06  Chong Yidong  <cyd@gnu.org>
1942         * buffer.c (word_wrap): Doc fix.
1944 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
1946         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
1948 2012-06-03  Glenn Morris  <rgm@gnu.org>
1950         * xdisp.c (tool-bar-style): Doc fix.
1952 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
1954         * Makefile.in (PAXCTL): Define.
1955         (temacs$(EXEEXT)): Disable memory randomization for the temacs
1956         binary via PaX flags if the paxctl utility is available.
1957         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
1958         Restore PaX flags to their default.  (Bug#11398)
1960 2012-06-03  Chong Yidong  <cyd@gnu.org>
1962         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
1963         buffer (Bug#11226).
1965 2012-06-03  Chong Yidong  <cyd@gnu.org>
1967         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
1968         (note_mode_line_or_margin_highlight): If there is no help echo,
1969         use mode-line-default-help-echo.  Handle the case where the mouse
1970         position is past the end of the mode line string.
1972         * buffer.c (buffer_local_value_1): New function, split from
1973         Fbuffer_local_value; can return Qunbound.
1974         (Fbuffer_local_value): Use it.
1975         (Vmode_line_format): Docstring tweaks.
1977 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
1979         * sysdep.c (system_process_attributes): Improve comment.
1981 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
1983         * keyboard.c: Export real-this-command to Elisp.
1984         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
1985         and DEFVAR it.  Update all users.
1987 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
1989         * minibuf.c (Fassoc_string): Remove duplicate declaration.
1991         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
1992         Convert pctcpu and pctmem to Lisp float properly.
1993         Let the compiler fold better, as 100.0/0x8000 is exact.
1995 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
1997         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
1998         cons_block.
2000 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
2002         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
2004 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
2006         For a 'struct window', replace some Lisp_Object fields to
2007         bitfields where appropriate, remove unused fields.
2008         * window.h (struct window): Remove unused 'last_mark_x' and
2009         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
2010         change it's type from Lisp_Object to bitfield.
2011         Change type of 'force_start', 'optional_new_start',
2012         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
2013         fields from Lisp_Object to bitfield. Adjust users accordingly.
2015 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
2017         Pacify gcc -Wdouble-precision when using Xaw.
2018         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
2019         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
2020         Use 'float' consistently, rather than 'float' in most places
2021         and 'double' in a couple of places.
2023 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
2025         * xdisp.c (handle_stop): Detect whether we have overlay strings
2026         loaded by testing it->current.overlay_string_index to be
2027         non-negative, instead of checking whether n_overlay_strings is
2028         positive.  (Bug#11587)
2030 2012-05-31  Chong Yidong  <cyd@gnu.org>
2032         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
2034         * doc.c (Fsubstitute_command_keys): Doc fix.
2036 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
2038         * search.c (search_buffer): Remove calls to
2039         r_alloc_inhibit_buffer_relocation, as it is now called by
2040         maybe_unify_char, which was the cause of relocation of buffer text
2041         in bug#11519.
2043 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
2045         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
2046         for the duration of call to load_charset, to avoid problems with
2047         callers of maybe_unify_char that access buffer text through C
2048         pointers.
2050         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
2051         decrement the inhibition flag, instead of just setting or
2052         resetting it.
2054 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
2056         Remove obsolete '#define static' cruft.
2057         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
2058         This #undef was "temporary" in 2000; it is no longer needed
2059         now that '#define static' has gone away.
2060         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
2061         (gray_bitmap_bits): Remove; no longer needed.
2062         All uses replaced with definiens.
2063         * xterm.c: Include "bitmaps/gray.xbm".
2065 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
2067         Clean up __executable_start, monstartup when --enable-profiling.
2068         The following changes affect the code only when profiling.
2069         * dispnew.c (__executable_start): Rename from safe_bcopy.
2070         Define only on platforms that need it.
2071         * emacs.c: Include <sys/gmon.h> when profiling.
2072         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
2073         (__executable_start): Remove decl, since lisp.h does it now.
2074         (safe_bcopy): Remove decl; no longer has that name.
2075         (main): Coalesce #if into single bit of code, for simplicity.
2076         Cast pointers to uintptr_t, since standard libraries want integers
2077         and not pointers.
2078         * lisp.h (__executable_start): New decl.
2080 2012-05-31  Glenn Morris  <rgm@gnu.org>
2082         * image.c (Fimagemagick_types): Doc fix.
2084 2012-05-30  Jim Meyering  <meyering@redhat.com>
2086         * callproc.c (Fcall_process_region): Include directory component
2087         in mkstemp error message (Bug#11586).
2089 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
2091         * alloc.c, lisp.h (make_pure_vector): Now static.
2093 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
2095         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
2096         Move to byte-run.el.
2097         (Fautoload): Do the hash-doc more carefully.
2098         * data.c (Fdefalias): Purify definition, except for keymaps.
2099         (Qdefun): Move from eval.c.
2100         * lisp.h (Qdefun): Remove.
2101         * lread.c (read1): Tiny simplification.
2103 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
2105         Do not create empty overlays with the evaporate property (Bug#9642).
2106         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
2107         Bug#9642, but explicitly check that the buffer the overlay would
2108         be moved to is live and rearrange lines to make sure that errors
2109         will not put the overlay in an inconsistent state.
2110         (Fdelete_overlay): Cosmetics.
2112 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
2114         * w32term.c (my_bring_window_to_top): New function.
2115         (x_raise_frame): Use handle returned by DeferWindowPos, which
2116         could be different from the original one.
2117         Call my_bring_window_to_top instead of my_set_foreground_window.
2118         (Bug#11513)
2120         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
2121         by calling BringWindowToTop.
2123         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
2124         (WM_EMACS_END): Increase by one.
2126 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
2128         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
2129         This avoids undefined behavior that might cause the eassert
2130         to not catch an out-of-range value.
2132 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
2134         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
2135         Update dependencies.
2137 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
2139         * bidi.c (bidi_mirror_char): Fix last change.
2141 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
2143         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
2144         when referring to sectname field in printf format.
2146 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
2148         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
2149         Only r_alloc_inhibit_buffer_relocation needed to be added;
2150         the others were already declared.
2152         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
2153         before checking whether it's out of range.  Put the check inside
2154         eassert.  See
2155         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
2157 2012-05-27  Ken Brown  <kbrown@cornell.edu>
2159         * callproc.c (Fcall_process): Restore a line that was accidentally
2160         commented out in the 2011-02-13 change (bug#11547).
2162 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
2164         * lisp.h [REL_ALLOC]: Add prototypes for external functions
2165         defined on ralloc.c.
2167         * buffer.c [REL_ALLOC]: Remove prototypes of
2168         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
2169         they are now on lisp.h.
2171         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
2173         * search.c (search_buffer): Use it to inhibit relocation of buffer
2174         text while re_search_2 is doing its job, because re_search_2 is
2175         passed C pointers to buffer text.  (Bug#11519)
2177         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
2178         Update value to 24.
2180         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
2181         state after an additional call to move_it_in_display_line_to, keep
2182         the values of it->max_ascent and it->max_descent found for the
2183         entire line.
2184         (pos_visible_p): Revert the comparison against bottom_y to what it
2185         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
2186         (Bug#11464)
2188 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
2190         Fix coding-related core dumps with gcc -ftrapv.
2191         The code was computing A - B, where A and B are pointers, and B is
2192         random garbage.  This can lead to core dumps on platforms that
2193         have special pointer registers, and it also leads to core dumps on
2194         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
2195         A - B only when B is initialized properly.
2196         * coding.c (coding_set_source, coding_set_destination): Return void.
2197         (coding_change_source, coding_change_destinations): New functions,
2198         with the old behaviors of coding_set_source and coding_set_destination.
2199         All callers that need an offset changed to use these new functions.
2201 2012-05-26  Glenn Morris  <rgm@gnu.org>
2203         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
2205 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
2207         Extend mouse support on W32 text-mode console.
2208         * xdisp.c (draw_row_with_mouse_face):
2209         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
2211         * w32console.c: Include window.h.
2212         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
2213         New functions.
2214         (initialize_w32_display): Initialize mouse-highlight data.
2216         * w32inevt.c: Include termchar.h and window.h.
2217         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
2218         moves, call note_mouse_highlight.  If help_echo changed, call
2219         gen_help_event to produce help-echo message in the echo area.
2220         Call clear_mouse_face if mouse_face_hidden is set in the mouse
2221         highlight info.
2223 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
2225         * lread.c (read1): Simplify slightly to avoid an overflow warning
2226         with GCC 4.7.0 on x86-64.
2228 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
2230         * bidi.c (bidi_mirror_char): Revert last change: an int is
2231         definitely wide enough here.
2233 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
2235         Fix integer width and related bugs (Bug#9874).
2236         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
2237         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
2238         (string_bytes, check_sblock, allocate_string_data):
2239         (compact_small_strings, Fmake_bool_vector, make_string)
2240         (make_unibyte_string, make_multibyte_string)
2241         (make_string_from_bytes, make_specified_string)
2242         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
2243         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
2244         (mark_vectorlike):
2245         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2246         (allocate_pseudovector):
2247         Use int, not EMACS_INT, where int is wide enough.
2248         (inhibit_garbage_collection, Fgarbage_collect):
2249         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2250         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
2251         int might not be wide enough.
2252         (bidi_cache_search, bidi_cache_find, bidi_init_it)
2253         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
2254         (bidi_at_paragraph_end, bidi_find_paragraph_start)
2255         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
2256         (bidi_level_of_next_char, bidi_move_to_visually_next):
2257         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2258         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
2259         (Fkill_buffer, Fset_buffer_major_mode)
2260         (advance_to_char_boundary, Fbuffer_swap_text)
2261         (Fset_buffer_multibyte, overlays_at, overlays_in)
2262         (overlay_touches_p, struct sortvec, record_overlay_string)
2263         (overlay_strings, recenter_overlay_lists)
2264         (adjust_overlays_for_insert, adjust_overlays_for_delete)
2265         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
2266         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
2267         (Foverlay_recenter, last_overlay_modification_hooks_used)
2268         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
2269         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2270         (validate_region): Omit unnecessary test for b <= e,
2271         since that's guaranteed by the previous test.
2272         (adjust_overlays_for_delete): Avoid pos + length overflow.
2273         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
2274         (report_overlay_modification):
2275         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2276         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
2277         Omit pointer cast, which isn't needed anyway, and doesn't work
2278         after the EMACS_INT -> ptrdiff_t change.
2279         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
2280         * buffer.h: Adjust decls to match defn changes elsewhere.
2281         (struct buffer_text, struct buffer):
2282         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2283         Use EMACS_INT, not int, where int might not be wide enough.
2284         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
2285         not int, to avoid needless 32-bit limit on 64-bit hosts.
2286         (exec_byte_code): Use tighter memory-full test, one that checks
2287         for alloca overflow.  Don't compute the address of the object just
2288         before an array, as that's not portable.  Use EMACS_INT, not
2289         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
2290         * callint.c (Fcall_interactively):
2291         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2292         * callproc.c (call_process_kill, Fcall_process):
2293         Don't assume pid_t fits into an Emacs fixnum.
2294         (call_process_cleanup, Fcall_process, child_setup):
2295         Don't assume pid_t fits into int.
2296         (call_process_cleanup, Fcall_process, delete_temp_file)
2297         (Fcall_process_region):
2298         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2299         (Fcall_process): Simplify handling of volatile integers.
2300         Use int, not EMACS_INT, where int will do.
2301         * casefiddle.c (casify_object, casify_region, operate_on_word)
2302         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
2303         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2304         (casify_object): Avoid integer overflow when overallocating buffer.
2305         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
2306         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
2307         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
2308         * category.h (CATEGORYP): Don't assume arg is nonnegative.
2309         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
2310         integers are now checked earlier.  All uses replaced with XINT.
2311         (ccl_driver):
2312         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2313         For CCL_MapSingle, check that content and value are in int range.
2314         (ccl_driver, Fregister_code_conversion_map):
2315         Check that Vcode_version_map_vector is a vector.
2316         (resolve_symbol_ccl_program): Check that vector header is in range.
2317         Always copy the vector, so that we can check its contents reliably
2318         now rather than having to recheck each instruction as it's being
2319         executed.  Check that vector words fit in 'int'.
2320         (ccl_get_compiled_code, Fregister_ccl_program)
2321         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
2322         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
2323         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
2324         contents are in range.
2325         (Fccl_execute_on_string): Check that status is in range.
2326         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
2327         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
2328         Accept and return EMACS_INT, not int, because callers can pass values
2329         out of 'int' range.
2330         (c_string_width, strwidth, lisp_string_width, chars_in_text)
2331         (multibyte_chars_in_text, parse_str_as_multibyte)
2332         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
2333         (str_as_unibyte, str_to_unibyte, string_count_byte8)
2334         (string_escape_byte8, Fget_byte):
2335         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2336         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
2337         avoid mishandling large integers.
2338         * character.h: Adjust decls to match defn changes elsewhere.
2339         * charset.c (load_charset_map_from_file, find_charsets_in_text)
2340         (Ffind_charset_region):
2341         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2342         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
2343         (load_charset_map_from_vector, Fdefine_charset_internal):
2344         Don't assume fixnum fits in int.
2345         (load_charset_map_from_vector, Fmap_charset_chars):
2346         Remove now-unnecessary CHECK_NATNUMs.
2347         (Fdefine_charset_internal): Check ranges here, more carefully.
2348         Don't rely on undefined behavior with signed left shift overflow.
2349         Don't assume unsigned int fits into fixnum, or that fixnum fits
2350         into unsigned int.  Don't require max_code to be a valid fixnum;
2351         that's not true for gb10830 4-byte on a 32-bit host.  Allow
2352         invalid_code to be a cons, for the same reason.  Require code_offset
2353         to be a character.  Avoid int overflow if max_char is close
2354         to INT_MAX.
2355         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
2356         this is intended anyway and avoids some undefined behavior.
2357         (load_charset_map): Pass unsigned, not int, as 2nd arg of
2358         INDEX_TO_CODE_POINT, as that's what it expects.
2359         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
2360         * charset.h (DECODE_CHAR): Return int, not unsigned;
2361         this is what was intended anyway, and it avoids undefined behavior.
2362         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
2363         integer-overflow issues.
2364         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
2365         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
2366         where the argument is EMACS_INT, and this behavior is not intended.
2367         * chartab.c (Fmake_char_table, Fset_char_table_range)
2368         (uniprop_get_decoder, uniprop_get_encoder):
2369         Don't assume fixnum fits in int.
2370         * cmds.c (move_point): New function, that does the gist of
2371         Fforward_char and Fbackward_char, but does so while checking
2372         for integer overflow more accurately.
2373         (Fforward_char, Fbackward_char): Use it.
2374         (Fforward_line, Fend_of_line, internal_self_insert)
2375         (internal_self_insert):
2376         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2377         Fix a FIXME, by checking for integer overflow when calculating
2378         target_clm and actual_clm.
2379         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
2380         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
2381         (ASSURE_DESTINATION, coding_alloc_by_realloc)
2382         (coding_alloc_by_making_gap, alloc_destination)
2383         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
2384         (encode_coding_utf_16, detect_coding_emacs_mule)
2385         (decode_coding_emacs_mule, encode_coding_emacs_mule)
2386         (detect_coding_iso_2022, decode_coding_iso_2022)
2387         (encode_invocation_designation, encode_designation_at_bol)
2388         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
2389         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
2390         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
2391         (encode_coding_ccl, encode_coding_raw_text)
2392         (detect_coding_charset, decode_coding_charset)
2393         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
2394         (produce_composition, produce_charset, produce_annotation)
2395         (decode_coding, handle_composition_annotation)
2396         (handle_charset_annotation, consume_chars, decode_coding_gap)
2397         (decode_coding_object, encode_coding_object, detect_coding_system)
2398         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
2399         (code_convert_region, code_convert_string)
2400         (Fdefine_coding_system_internal)
2401         (coding_set_source, coding_set_destination):
2402         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2403         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
2404         (Fdefine_coding_system_internal):
2405         Don't assume fixnums fit in int.
2406         (decode_coding_gap, decode_coding_object, encode_coding_object)
2407         (Fread_coding_system, Fdetect_coding_region)
2408         (Funencodable_char_position, Fcheck_coding_systems_region)
2409         (get_translation, handle_composition_annotation, consume_chars):
2410         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2411         (consume_chars): Rewrite to not calculate an address outside buffer.
2412         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
2413         Don't access memory outside of the args array.
2414         (Fdefine_coding_system_internal): Check for charset-id overflow.
2415         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
2416         result of ENCODE_CHAR.
2417         * coding.h: Adjust decls to match defn changes elsewhere.
2418         (struct coding_system):
2419         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2420         * composite.c (get_composition_id, find_composition)
2421         (run_composition_function, update_compositions)
2422         (compose_text, composition_gstring_put_cache)
2423         (composition_gstring_p, composition_gstring_width)
2424         (fill_gstring_header, fill_gstring_body, autocmp_chars)
2425         (composition_compute_stop_pos, composition_reseat_it)
2426         (composition_update_it, struct position_record)
2427         (find_automatic_composition, composition_adjust_point)
2428         (Fcomposition_get_gstring, Ffind_composition_internal):
2429         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2430         (update_compositions):
2431         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2432         * composite.h: Adjust decls to match defn changes elsewhere.
2433         (struct composition):
2434         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2435         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2436         Do not attempt to compute the address of the object just before a
2437         buffer; this is not portable.
2438         (Faref, Faset):
2439         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2440         (Faset): Use int, not EMACS_INT, where int is wide enough.
2441         (Fstring_to_number): Don't assume fixnums fit in int.
2442         (Frem): Don't assume arg is nonnegative.
2443         * dbusbind.c (xd_append_arg): Check for integers out of range.
2444         (Fdbus_call_method): Don't overflow the timeout int.
2445         (extract_signed, extract_unsigned): New functions.
2446         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
2447         (xd_get_connection_references): Return ptrdiff_t, not int.
2448         All uses changed.
2449         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
2450         (xd_read_message_1):
2451         Use int, not unsigned, where the dbus API uses int.
2452         (Fdbus_message_internal): Don't overflow mtype.
2453         (syms_of_dbusbind): Allocate right-sized buffer for integers.
2454         * dired.c (directory_files_internal, file_name_completion, scmp)
2455         (file_name_completion_stat):
2456         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2457         (file_name_completion): Don't overflow matchcount.
2458         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
2459         * dispextern.h: Adjust decls to match defn changes elsewhere.
2460         (struct text_pos, struct glyph, struct bidi_saved_info)
2461         (struct bidi_string_data, struct bidi_it, struct composition_it)
2462         (struct it):
2463         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2464         (struct display_pos, struct composition_it, struct it):
2465         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2466         * dispnew.c (increment_matrix_positions)
2467         (increment_row_positions, mode_line_string)
2468         (marginal_area_string):
2469         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2470         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
2471         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2472         (duration_to_sec_usec): New function, to check for overflow better.
2473         (Fsleep_for, sit_for): Use it.
2474         * doc.c (get_doc_string, store_function_docstring):
2475         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2476         (get_doc_string, Fsnarf_documentation):
2477         Use int, not EMACS_INT, where int is wide enough.
2478         (get_doc_string):
2479         Use SAFE_ALLOCA, not alloca.
2480         Check for overflow when converting EMACS_INT to off_t.
2481         * doprnt.c (doprnt):
2482         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2483         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
2484         Don't assume uid_t fits into fixnum.
2485         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
2486         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
2487         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
2488         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
2489         (general_insert_function)
2490         (Finsert_char, make_buffer_string, make_buffer_string_both)
2491         (update_buffer_properties, Fbuffer_substring)
2492         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
2493         (Fsubst_char_in_region, check_translation)
2494         (Ftranslate_region_internal, save_restriction_restore, Fformat)
2495         (transpose_markers, Ftranspose_regions):
2496         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2497         (clip_to_bounds): Move to lisp.h as an inline function).
2498         (Fconstrain_to_field): Don't assume integers are nonnegative.
2499         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
2500         (Fsubst_char_in_region, Fsave_restriction):
2501         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2502         (Femacs_pid): Don't assume pid_t fits into fixnum.
2503         (lo_time): Use int, not EMACS_INT, when int suffices.
2504         (lisp_time_argument): Check for usec out of range.
2505         (Fencode_time): Don't assume fixnum fits in int.
2506         (Fuser_login_name, Fuser_full_name): Signal an error
2507         if a uid argument is out of range, rather than relying on
2508         undefined behavior.
2509         (Fformat_time_string): Remove now-unnecessary check.
2510         lisp_time_argument checks for out-of-range usec now.
2511         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
2512         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
2513         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
2514         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
2515         (init_cmdargs, Fdump_emacs):
2516         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2517         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
2518         the bottom (typically) 32 bits of the fixnum.
2519         * eval.c (specpdl_size, call_debugger):
2520         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2521         (when_entered_debugger, Fbacktrace_debug):
2522         Don't assume fixnum can fit in int.
2523         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
2524         the object just before a buffer; this is not portable.
2525         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
2526         (grow_specpdl, unbind_to):
2527         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2528         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
2529         (grow_specpdl): Simplify allocation by using xpalloc.
2530         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
2531         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
2532         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
2533         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2534         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
2535         (a_write, e_write):
2536         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2537         (Fcopy_file, non_regular_nbytes, read_non_regular)
2538         (Finsert_file_contents):
2539         Use int, not EMACS_INT, where int is wide enough.
2540         (READ_BUF_SIZE): Verify that it fits in int.
2541         (Finsert_file_contents): Check that counts are in proper range,
2542         rather than assuming fixnums fit into ptrdiff_t etc.
2543         Don't assume fixnums fit into int.
2544         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
2545         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
2546         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
2547         (string_char_to_byte, string_byte_to_char)
2548         (string_make_multibyte, string_to_multibyte)
2549         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
2550         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
2551         (substring_both, Fdelete, internal_equal, Ffillarray)
2552         (Fclear_string, mapcar1)
2553         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
2554         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
2555         (larger_vector, make_hash_table, maybe_resize_hash_table)
2556         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
2557         (Fmaphash, secure_hash):
2558         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2559         (concat): Check for string index and length overflow.
2560         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
2561         (Frequire):
2562         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2563         (larger_vector): New API (vec, incr_min, size_max) replaces old
2564         one (vec, new_size, init).  This catches size overflow.
2565         INIT was removed because it was always Qnil.
2566         All callers changed.
2567         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
2568         the upper bound on a hash table index size.
2569         (make_hash_table, maybe_resize_hash_table): Use it.
2570         (secure_hash): Computer start_byte and end_byte only after
2571         they're known to be in ptrdiff_t range.
2572         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
2573         (Ffont_get_glyphs, Ffont_at):
2574         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2575         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
2576         (Flist_fonts, Fopen_font):
2577         Don't assume fixnum can fit in int.
2578         (check_gstring): Don't assume index can fit in int.
2579         (font_match_p): Check that fixnum is a character, not a nonnegative
2580         fixnum, since the later code needs to stuff it into an int.
2581         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
2582         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
2583         conversion overflow issues.
2584         (Fopen_font): Check for integer out of  range.
2585         (Ffont_get_glyphs): Don't assume index can fit in int.
2586         * font.h: Adjust decls to match defn changes elsewhere.
2587         * fontset.c (reorder_font_vector): Redo score calculation to avoid
2588         integer overflow.
2589         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
2590         printmax_t, where ptrdiff_t is wide enough.
2591         (Finternal_char_font):
2592         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2593         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
2594         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
2595         (Fset_frame_position, x_set_frame_parameters)
2596         (x_set_line_spacing, x_set_border_width)
2597         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
2598         Check that fixnums are in proper range for system types.
2599         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
2600         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2601         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
2602         Use SAFE_ALLOCA_LISP, not alloca.
2603         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
2604         intptr_t is wide enough.
2605         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
2606         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
2607         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
2608         Check for fixnum out of range.
2609         * ftfont.c (ftfont_list): Don't assume index fits in int.
2610         Check that fixnums are in proper range for system types.
2611         (ftfont_shape_by_flt):
2612         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2613         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
2614         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2615         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
2616         Check that fixnums are in proper range for system types.
2617         * gnutls.h: Adjust decls to match defn changes elsewhere.
2618         * gtkutil.c (xg_dialog_run):
2619         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2620         (update_frame_tool_bar):
2621         Check that fixnums are in proper range for system types.
2622         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
2623         (lookup_image): Check that fixnums are in range for system types.
2624         * indent.c (last_known_column, last_known_column_point):
2625         (current_column_bol_cache):
2626         (skip_invisible, current_column, check_display_width):
2627         (check_display_width, scan_for_column, current_column_1)
2628         (Findent_to, Fcurrent_indentation, position_indentation)
2629         (indented_beyond_p, Fmove_to_column, compute_motion):
2630         (Fcompute_motion, Fvertical_motion):
2631         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2632         (last_known_column_modified): Use EMACS_INT, not int.
2633         (check_display_width):
2634         (Fcompute_motion):
2635         Check that fixnums and floats are in proper range for system types.
2636         (compute_motion): Don't assume index or fixnum fits in int.
2637         (compute_motion, Fcompute_motion):
2638         Use int, not EMACS_INT, when it is wide enough.
2639         (vmotion): Omit local var start_hpos that is always 0; that way
2640         we don't need to worry about overflow in expressions involving it.
2641         * indent.h: Adjust decls to match defn changes elsewhere.
2642         (struct position):
2643         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2644         Use int, not EMACS_INT, where int is wide enough.
2645         Remove unused members ovstring_chars_done and tab_offset;
2646         all uses removed.
2647         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
2648         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
2649         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
2650         (make_gap, copy_text, insert, insert_and_inherit)
2651         (insert_before_markers, insert_before_markers_and_inherit)
2652         (insert_1, count_combining_before, count_combining_after)
2653         (insert_1_both, insert_from_string)
2654         (insert_from_string_before_markers, insert_from_string_1)
2655         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
2656         (adjust_after_replace, adjust_after_insert, replace_range)
2657         (replace_range_2, del_range, del_range_1, del_range_byte)
2658         (del_range_both, del_range_2, modify_region)
2659         (prepare_to_modify_buffer, signal_before_change)
2660         (signal_after_change, Fcombine_after_change_execute):
2661         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2662         * intervals.c (traverse_intervals, rotate_right, rotate_left)
2663         (balance_an_interval, split_interval_right, split_interval_left)
2664         (find_interval, next_interval, update_interval)
2665         (adjust_intervals_for_insertion, delete_node, delete_interval)
2666         (interval_deletion_adjustment, adjust_intervals_for_deletion)
2667         (static_offset_intervals, offset_intervals)
2668         (merge_interval_right, merge_interval_left, make_new_interval)
2669         (graft_intervals_into_buffer, temp_set_point_both)
2670         (temp_set_point, set_point, adjust_for_invis_intang)
2671         (set_point_both, move_if_not_intangible, get_property_and_range)
2672         (get_local_map, copy_intervals, copy_intervals_to_string)
2673         (compare_string_intervals, set_intervals_multibyte_1):
2674         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2675         * intervals.h: Adjust decls to match defn changes elsewhere.
2676         (struct interval):
2677         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2678         * keyboard.c (this_command_key_count, this_single_command_key_start)
2679         (before_command_key_count, before_command_echo_length, echo_now)
2680         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
2681         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
2682         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
2683         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
2684         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2685         (last_non_minibuf_size, last_point_position, echo_truncate)
2686         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
2687         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
2688         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
2689         (stuff_buffered_input):
2690         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2691         (last_auto_save, command_loop_1, read_char):
2692         Use EMACS_INT, not int, to avoid integer overflow.
2693         (record_char): Avoid overflow in total_keys computation.
2694         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
2695         * keyboard.h: Adjust decls to match defn changes elsewhere.
2696         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
2697         (Fkey_description, Fdescribe_vector, Flookup_key):
2698         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2699         (click_position): New function, to check that positions are in range.
2700         (Fcurrent_active_maps):
2701         (describe_command):
2702         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2703         (Faccessible_keymaps, Fkey_description):
2704         (preferred_sequence_p):
2705         Don't assume fixnum can fit into int.
2706         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
2707         Check for integer overflow in size calculations.
2708         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
2709         avoid mishandling large integers.
2710         * lisp.h: Adjust decls to match defn changes elsewhere.
2711         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
2712         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
2713         (struct Lisp_Marker):
2714         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2715         (clip_to_bounds): Now an inline function, moved here from editfns.c.
2716         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
2717         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
2718         All callers changed.
2719         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
2720         Assume the arg has valid form, since it always does.
2721         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
2722         unsigned integer system type.
2723         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
2724         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
2725         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2726         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
2727         (duration_to_sec_usec): New decl.
2728         * lread.c (read_from_string_index, read_from_string_index_byte)
2729         (read_from_string_limit, readchar, unreadchar, openp)
2730         (read_internal_start, read1, oblookup):
2731         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2732         (Fload, readevalloop, Feval_buffer, Feval_region):
2733         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2734         (openp): Check for out-of-range argument to 'access'.
2735         (read1): Use int, not EMACS_INT, where int is wide enough.
2736         Don't assume fixnum fits into int.
2737         Fix off-by-one error that can read outside a buffer.
2738         (read_filtered_event): Use duration_to_sec_usec
2739         to do proper overflow checking on durations.
2740         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
2741         in size calculation.
2742         (Fexecute_kbd_macro):
2743         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2744         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
2745         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
2746         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
2747         (set_marker_both, set_marker_restricted_both, marker_position)
2748         (marker_byte_position, Fbuffer_has_markers_at):
2749         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2750         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
2751         * menu.c (ensure_menu_items): Rename from grow_menu_items.
2752         It now merely ensures that the menu is large enough, without
2753         necessarily growing it, as this avoids some integer overflow issues.
2754         All callers changed.
2755         (keymap_panes, parse_single_submenu, Fx_popup_menu):
2756         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2757         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
2758         Use SAFE_ALLOCA_LISP, not alloca.
2759         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
2760         to EMACS_INT.  Check that fixnums are in proper range for system types.
2761         * minibuf.c (minibuf_prompt_width, string_to_object)
2762         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
2763         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
2764         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2765         (get_minibuffer, read_minibuf_unwind):
2766         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2767         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
2768         this simplifies overflow checking.  All callers changed.
2769         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
2770         (Ftest_completion):
2771         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2772         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
2773         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
2774         Check that fixnums are in proper range for system types.
2775         (Fx_create_frame, Fx_show_tip):
2776         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2777         * nsfont.m (ns_findfonts, nsfont_list_family):
2778         Don't assume fixnum fits in long.
2779         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
2780         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2781         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
2782         wide enough.
2783         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
2784         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2785         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
2786         (PRINTDECLARE, PRINTPREPARE):
2787         (strout, print_string):
2788         (print, print_preprocess, print_check_string_charset_prop)
2789         (print_object):
2790         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2791         (PRINTDECLARE):
2792         (temp_output_buffer_setup, Fprin1_to_string, print_object):
2793         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2794         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
2795         (printchar, strout): Use xpalloc to catch size calculation overflow.
2796         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
2797         (print_error_message): Use SAFE_ALLOCA, not alloca.
2798         (print_object): Use int, not EMACS_INT, where int is wide enough.
2799         (print_depth, new_backquote_output, print_number_index):
2800         Use ptrdiff_t, not int, where int might not be wide enough.
2801         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
2802         (Fset_process_window_size, Fformat_network_address)
2803         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
2804         (sigchld_handler):
2805         Check that fixnums are in proper range for system types.
2806         (Fsignal_process): Simplify by avoiding a goto.
2807         Check for process-ids out of pid_t range rather than relying on
2808         undefined behavior.
2809         (process_tick, update_tick): Use EMACS_INT, not int.
2810         (Fformat_network_address, read_process_output, send_process)
2811         (Fprocess_send_region, status_notify):
2812         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2813         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
2814         (wait_reading_process_output, read_process_output, exec_sentinel):
2815         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2816         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
2817         (Faccept_process_output): Use duration_to_sec_usec to do proper
2818         overflow checking on durations.
2819         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
2820         Don't assume pid_t fits in int.
2821         * process.h (struct Lisp_Process): Members tick and update_tick
2822         are now of type EMACS_INT, not int.
2823         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
2824         configured --with-wide-int.
2825         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
2826         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
2827         * search.c (looking_at_1, string_match_1):
2828         (fast_string_match, fast_c_string_match_ignore_case)
2829         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
2830         (scan_newline, find_before_next_newline, search_command)
2831         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
2832         (set_search_regs, wordify):
2833         (Freplace_match):
2834         (Fmatch_data):
2835         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2836         (string_match_1, search_buffer, set_search_regs):
2837         (Fmatch_data):
2838         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2839         (wordify): Check for overflow in size calculation.
2840         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
2841         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
2842         Check that fixnums are in proper range for system types.
2843         * sound.c (struct sound_device)
2844         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
2845         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2846         (Fplay_sound_internal):
2847         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2848         * syntax.c (struct lisp_parse_state, find_start_modiff)
2849         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
2850         (Fparse_partial_sexp):
2851         Don't assume fixnums can fit in int.
2852         (struct lisp_parse_state, find_start_pos, find_start_value)
2853         (find_start_value_byte, find_start_begv)
2854         (update_syntax_table, char_quoted, dec_bytepos)
2855         (find_defun_start, prev_char_comend_first, back_comment):
2856         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
2857         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
2858         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2859         (Finternal_describe_syntax_value): Check that match_lisp is a
2860         character, not an integer, since the code stuffs it into int.
2861         (scan_words, scan_sexps_forward):
2862         Check that fixnums are in proper range for system types.
2863         (Fforward_word):
2864         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2865         (scan_sexps_forward):
2866         Use CHARACTERP, not INTEGERP, since the value must fit into int.
2867         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
2868         * syntax.h: Adjust decls to match defn changes elsewhere.
2869         (struct gl_state_s):
2870         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2871         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
2872         MOST_POSITIVE_FIXNUM.
2873         * sysdep.c (wait_for_termination_1, wait_for_termination)
2874         (interruptible_wait_for_termination, mkdir):
2875         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
2876         (emacs_read, emacs_write):
2877         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2878         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
2879         and double all fit in int.
2880         * term.c (set_tty_color_mode):
2881         Check that fixnums are in proper range for system types.
2882         * termhooks.h (struct input_event):
2883         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2884         * textprop.c (validate_interval_range, interval_of)
2885         (Fadd_text_properties, set_text_properties_1)
2886         (Fremove_text_properties, Fremove_list_of_text_properties)
2887         (Ftext_property_any, Ftext_property_not_all)
2888         (copy_text_properties, text_property_list, extend_property_ranges)
2889         (verify_interval_modification):
2890         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2891         (Fnext_single_char_property_change)
2892         (Fprevious_single_char_property_change):
2893         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2894         (copy_text_properties):
2895         Check for integer overflow in index calculation.
2896         * undo.c (last_boundary_position, record_point, record_insert)
2897         (record_delete, record_marker_adjustment, record_change)
2898         (record_property_change):
2899         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2900         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
2901         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2902         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
2903         (Fx_hide_tip, Fx_file_dialog):
2904         * w32menu.c (set_frame_menubar):
2905         Use ptrdiff_t, not int, for consistency with rest of code.
2906         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
2907         (select_window, Fdelete_other_windows_internal)
2908         (window_scroll_pixel_based, window_scroll_line_based)
2909         (Frecenter, Fset_window_configuration):
2910         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2911         (Fset_window_hscroll, run_window_configuration_change_hook)
2912         (set_window_buffer, temp_output_buffer_show, scroll_command)
2913         (Fscroll_other_window, Frecenter):
2914         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2915         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
2916         Don't assume fixnum fits in int.
2917         (Fset_window_scroll_bars):
2918         Check that fixnums are in proper range for system types.
2919         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
2920         (string_pos, c_string_pos, number_of_chars, init_iterator)
2921         (in_ellipses_for_invisible_text_p, init_from_display_pos)
2922         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
2923         (compute_display_string_end, handle_face_prop)
2924         (face_before_or_after_it_pos, handle_invisible_prop)
2925         (handle_display_prop, handle_display_spec, handle_single_display_spec)
2926         (display_prop_intangible_p, string_buffer_position_lim)
2927         (string_buffer_position, handle_composition_prop, load_overlay_strings)
2928         (get_overlay_strings_1, get_overlay_strings)
2929         (iterate_out_of_display_property, forward_to_next_line_start)
2930         (back_to_previous_visible_line_start, reseat, reseat_to_string)
2931         (get_next_display_element, set_iterator_to_next)
2932         (get_visually_first_element, compute_stop_pos_backwards)
2933         (handle_stop_backwards, next_element_from_buffer)
2934         (move_it_in_display_line_to, move_it_in_display_line)
2935         (move_it_to, move_it_vertically_backward, move_it_by_lines)
2936         (add_to_log, message_dolog, message_log_check_duplicate)
2937         (message2, message2_nolog, message3, message3_nolog
2938         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
2939         (current_message_1, truncate_echo_area, truncate_message_1)
2940         (set_message, set_message_1, store_mode_line_noprop)
2941         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
2942         (text_outside_line_unchanged_p, check_point_in_composition)
2943         (reconsider_clip_changes)
2944         (redisplay_internal, set_cursor_from_row, try_scrolling)
2945         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
2946         (redisplay_window, find_last_unchanged_at_beg_row)
2947         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
2948         (trailing_whitespace_p, find_row_edges, display_line)
2949         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
2950         (display_mode_element, store_mode_line_string)
2951         (pint2str, pint2hrstr, decode_mode_spec)
2952         (display_count_lines, display_string, draw_glyphs)
2953         (x_produce_glyphs, x_insert_glyphs)
2954         (rows_from_pos_range, mouse_face_from_buffer_pos)
2955         (fast_find_string_pos, mouse_face_from_string_pos)
2956         (note_mode_line_or_margin_highlight, note_mouse_highlight):
2957         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2958         (safe_call, init_from_display_pos, handle_fontified_prop)
2959         (handle_single_display_spec, load_overlay_strings)
2960         (with_echo_area_buffer, setup_echo_area_for_printing)
2961         (display_echo_area, echo_area_display)
2962         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
2963         (update_tool_bar, hscroll_window_tree, redisplay_internal)
2964         (redisplay_window, dump_glyph_row, display_mode_line)
2965         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
2966         (handle_display_spec, display_prop_string_p):
2967         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2968         (handle_single_display_spec, build_desired_tool_bar_string)
2969         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
2970         (get_specified_cursor_type):
2971         Check that fixnums are in proper range for system types.
2972         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
2973         (Flookup_image_map):
2974         Don't assume fixnums fit in int.
2975         (compare_overlay_entries):
2976         Avoid mishandling comparisons due to subtraction overflow.
2977         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
2978         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
2979         (handle_tool_bar_click):
2980         Use int, not unsigned, since we prefer signed and the signedness
2981         doesn't matter here.
2982         (get_next_display_element, next_element_from_display_vector):
2983         Use int, not EMACS_INT, when int is wide enough.
2984         (start_hourglass): Use duration_to_sec_usec to do proper
2985         overflow checking on durations.
2986         * xfaces.c (Fbitmap_spec_p):
2987         Check that fixnums are in proper range for system types.
2988         (compare_fonts_by_sort_order):
2989         Avoid mishandling comparisons due to subtraction overflow.
2990         (Fx_family_fonts, realize_basic_faces):
2991         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2992         (Fx_family_fonts):
2993         Don't assume fixnum fits in int.
2994         Use SAFE_ALLOCA_LISP, not alloca.
2995         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
2996         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
2997         (face_at_buffer_position, face_for_overlay_string)
2998         (face_at_string_position):
2999         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3000         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
3001         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
3002         (Fx_show_tip):
3003         Check that fixnums are in proper range for system types.
3004         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
3005         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
3006         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3007         (Fx_change_window_property): Don't assume fixnums fit in int.
3008         * xfont.c (xfont_chars_supported):
3009         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3010         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
3011         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
3012         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3013         * xml.c (parse_region):
3014         * xrdb.c (magic_file_p):
3015         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
3016         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
3017         (x_get_local_selection, x_reply_selection_request)
3018         (x_handle_selection_request, wait_for_property_change):
3019         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3020         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
3021         short is wide enough.
3022         (x_send_client_event): Don't assume fixnum fits in int.
3023         * xterm.c (x_x_to_emacs_modifiers):
3024         Don't assume EMACS_INT overflows nicely into int.
3025         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
3026         may come from Lisp.
3027         (handle_one_xevent): NATNUMP can eval its arg twice.
3028         (x_connection_closed):
3029         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
3030         * xterm.h: Adjust decls to match defn changes elsewhere.
3031         (struct scroll_bar): Use struct vectorlike_header
3032         rather than rolling our own approximation.
3033         (SCROLL_BAR_VEC_SIZE): Remove; not used.
3035 2012-05-25  Glenn Morris  <rgm@gnu.org>
3037         * lisp.mk (lisp): Update for more files being compiled now.
3039 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
3041         * lread.c: Remove `read_pure' which makes no difference.
3042         (read_pure): Remove var.
3043         (unreadpure): Remove function.
3044         (readevalloop): Don't call read_list with -1 flag.
3045         (read1, read_vector): Don't test read_pure any more.
3046         (read_list): Simplify.
3048         * fileio.c, character.h: Minor style tweaks.
3050 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
3052         * window.h (clip_changed): Remove useless declaration.
3054 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
3056         * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
3057         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
3059 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
3061         Remove src/m/*.
3062         This directory predates autoconf and is no longer needed nowadays.
3063         Move its few remaining bits of functionality to where they're needed.
3064         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
3065         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
3066         * m/template.h: Remove.
3067         * Makefile.in (M_FILE): Remove.  All uses removed.
3068         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
3069         * lisp.h (USE_LSB_TAG):
3070         * mem-limits.h (EXCEEDS_LISP_PTR):
3071         Use VAL_MAX, not VALBITS, in #if.
3072         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
3073         (EMACS_UINT): Define unconditionally now.
3074         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
3075         (BITS_PER_EMACS_INT): New constants, replacing
3076         what used to be in config.h, but not useful in #if.
3077         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
3078         define them any more.
3079         (VAL_MAX): New macro.
3080         (VALMASK): Use it.
3081         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
3082         BITS_PER_EMACS_INT, in #if.
3083         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
3084         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
3085         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
3086         * s/ms-w32.h (DATA_START):
3087         Move here from removed file m/intel386.h.
3088         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
3089         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
3091 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
3093         Assume C89 or later.
3094         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
3095         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
3096         (xrealloc):
3097         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
3098         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
3099         * textprop.c, tparam.c (NULL): Remove.
3100         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
3101         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
3102         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
3103         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
3104         * xterm.c (input_signal_count): Assume volatile works.
3106 2012-05-21  Ken Brown  <kbrown@cornell.edu>
3108         * xgselect.c (xg_select): Fix first argument in call to 'select'
3109         (bug#11508).
3111 2012-05-20  Ken Brown  <kbrown@cornell.edu>
3113         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
3114         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
3116 2012-05-19  Ken Brown  <kbrown@cornell.edu>
3118         * xfns.c (x_in_use): Remove `static' qualifier.
3119         * xterm.h (x_in_use): Declare.
3120         * xgselect.c: Include xterm.h.
3121         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
3122         and `display_arg' (bug#9754).
3124 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
3126         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
3128         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
3129         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
3131 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
3133         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
3135         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
3136         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
3138         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
3139         reference to image_cache->refcount.
3140         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
3142 2012-05-17  Juri Linkov  <juri@jurta.org>
3144         * search.c (Fword_search_regexp, Fword_search_backward)
3145         (Fword_search_forward, Fword_search_backward_lax)
3146         (Fword_search_forward_lax): Move functions to isearch.el
3147         (bug#10145, bug#11381).
3149 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
3151         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
3153 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
3155         * lread.c (init_obarray): Declare Qt and Qnil as special.
3157 2012-05-14  Glenn Morris  <rgm@gnu.org>
3159         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
3160         Put "libexec" before "bin", for the sake of init_callproc_1.
3162 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3164         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
3166         * unexaix.c: Port to more-recent AIX compilers.
3167         (report_error, report_error_1, make_hdr, copy_sym)
3168         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
3169         Make arguments const char *, not char *, to avoid violations of C
3170         standard and to fix some AIX warnings reported by Gilles Pion.
3172 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
3174         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
3175         already have overlays loaded.
3176         (handle_single_display_spec): Before returning without displaying
3177         fringe bitmap, synchronize the bidi iterator with the main display
3178         iterator, by calling iterate_out_of_display_property.
3179         (iterate_out_of_display_property): Detect buffer iteration by
3180         testing that it->string is a Lisp string.
3181         (get_next_display_element): When the current object is exhausted,
3182         and there's something on it->stack, call set_iterator_to_next to
3183         proceed with what's on the stack, instead of returning zero.
3184         (set_iterator_to_next): If called at the end of a Lisp string,
3185         proceed to consider_string_end without incrementing string
3186         position.  Don't increment display vector index past the end of
3187         the display vector.  (Bug#11417)
3188         (pos_visible_p): Don't report a position visible when move_it_to
3189         stopped at the last line of window, which happens to be scanned
3190         backwards by the bidi iteration.  (Bug#11464)
3192 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
3194         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
3195         and right-margin display specs even if the spec is invalid or we
3196         are on a TTY, and thus unable to display on the fringes.
3197         That's because the text with the property will not be displayed anyway,
3198         so we need to signal to the caller that this is a "replacing"
3199         display spec.  This fixes display when the spec is invalid or we
3200         are on a TTY.
3202 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3204         * unexaix.c (make_hdr): Fix typo in prototype.
3205         This bug broke the build on AIX.  Problem reported by Gilles Pion.
3207 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
3209         * keyboard.c (kbd_buffer_get_event): Read special events also in
3210         batch mode.  (Bug#11415)
3212 2012-05-12  Glenn Morris  <rgm@gnu.org>
3214         * ns.mk: Update for ns_appbindir no longer having trailing "/".
3216 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
3218         * lisp.mk (lisp): Add newcomment.elc.
3220 2012-05-12  Glenn Morris  <rgm@gnu.org>
3222         * Makefile.in (MKDIR_P): New, set by configure.
3223         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
3225 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
3227         Remove unused function hourglass_started.
3228         * dispextern.h (hourglass_started):
3229         * w32fns.c (hourglass_started):
3230         * xdisp.c (hourglass_started): Remove.
3232 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
3234         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
3235         Update dependencies.
3237 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
3239         * xgselect.c (xg_select): Put maxfds+1 into a var.
3240         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
3242         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
3244 2012-05-10  Dave Abrahams  <dave@boostpro.com>
3246         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
3247         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
3249 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
3251         * dbusbind.c (xd_registered_buses): New internal Lisp object.
3252         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
3253         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
3254         Initialize xd_registered_buses.
3256 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
3258         Untag more efficiently if USE_LSB_TAG.
3259         This is based on a proposal by YAMAMOTO Mitsuharu in
3260         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
3261         For an admittedly artificial (nth 8000 longlist) benchmark on
3262         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
3263         Emacs's overall text size by 1%.
3264         * lisp.h (XUNTAG): New macro.
3265         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
3266         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
3267         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
3268         * eval.c (Fautoload):
3269         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
3270         * frame.h (XFRAME): Use XUNTAG.
3272         Port recent dbusbind.c changes to 32-bit --with-wide-int.
3273         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
3274         Remove unportable assumptions about print widths of types like
3275         dbus_uint32_t.
3276         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
3277         intptr_t when converting between pointer and integer, to avoid GCC
3278         warnings about wrong width.
3280 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
3282         * w32proc.c (new_child): Force Windows to reserve only 64KB of
3283         stack for each reader_thread, instead of defaulting to 8MB
3284         determined by the linker.  This avoids failures in creating
3285         subprocesses on Windows 7, see the discussion in this thread:
3286         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
3288 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
3290         Fix up display of the *Minibuf-0* buffer in the mini window.
3291         * keyboard.c (read_char): Don't clear the echo area if there's no
3292         message to clear.
3293         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
3294         contents of *Minibuf-0*) if there's no message displayed in its stead.
3296 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
3298         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
3299         batch mode.
3301 2012-05-06  Chong Yidong  <cyd@gnu.org>
3303         * lisp.mk (lisp): Update.
3305 2012-05-05  Jim Meyering  <meyering@redhat.com>
3307         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
3309 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
3311         * data.c (PUT_ERROR): New macro.
3312         (syms_of_data): Use it.  Add new error type `user-error'.
3313         * undo.c (user_error): New function.
3314         (Fprimitive_undo): Use it.
3315         * print.c (print_error_message): Adjust print style for `user-error'.
3316         * keyboard.c (user_error): New function.
3317         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
3319 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
3321         Do not limit current-time-string to years 1000..9999.
3322         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
3323         (Fcurrent_time_string): Support any year that is supported by the
3324         underlying localtime representation.  Don't use asctime, as it
3325         has undefined behavior for years outside the range -999..9999.
3327 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
3329         Fix race conditions involving setenv, gmtime, localtime, asctime.
3330         Without this fix, interrupts could mess up code that uses these
3331         nonreentrant functions, since setting TZ invalidates existing
3332         tm_zone or tzname values, and since most of these functions return
3333         pointers to static storage.
3334         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
3335         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
3336         Grow the critical sections to include not just invoking
3337         localtime/gmtime, but also accessing these functions' results
3338         including their tm_zone values if any, and any related TZ setting.
3339         (format_time_string): Last arg is now struct tm *, not struct tm **,
3340         so that the struct tm is saved in the critical section.
3341         All callers changed.  Simplify allocation of initial buffer, partly
3342         motivated by the fact that memory allocation needs to be outside
3343         the critical section.
3345 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
3347         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
3348         with RESET_INTERVAL.
3350         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3351         Remove duplicated buffer name initialization.
3353 2012-05-02  Jim Meyering  <jim@meyering.net>
3355         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
3357         * xfns.c (x_window): Use xstrdup (Bug#11375).
3359 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
3361         * xdisp.c (pos_visible_p): If already at a newline from the
3362         display string before the 'while' loop, don't walk back the glyphs
3363         from it3.glyph_row.  Solves assertion violation when the display
3364         string begins with a newline (egg.el).  (Bug#11367)
3366 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
3368         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
3369         Move to simple.el.
3371 2012-05-01  Glenn Morris  <rgm@gnu.org>
3373         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
3374         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
3375         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
3376         All were removed before 23.1.
3378         * dispnew.c: Remove HAVE_LIBNCURSES test;
3379         it is always true on relevant platforms.
3381         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
3382         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
3384         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
3386 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
3388         * .gdbinit (xpr): Remove checks for no longer existing misc types.
3389         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
3390         Remove.
3392 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
3394         Do not avoid creating empty evaporating overlays (Bug#9642).
3395         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
3396         That is, do not delete an evaporating overlay if it becomes
3397         empty after its bounds are adjusted to fit within its buffer.
3398         This fix caused other problems, and I'm reverting it until we get
3399         to the bottom of them.
3401 2012-04-27  Chong Yidong  <cyd@gnu.org>
3403         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
3405 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
3407         * xdisp.c (pos_visible_p): If the window start position is beyond
3408         ZV, start the display from buffer beginning.  Prevents assertion
3409         violation in init_iterator when the minibuffer window is scrolled
3410         via the scroll bar.
3412         * window.c (window_scroll_pixel_based): Likewise.
3414 2012-04-27  Chong Yidong  <cyd@gnu.org>
3416         * keymap.c (where_is_internal): Doc fix (Bug#10872).
3418 2012-04-27  Glenn Morris  <rgm@gnu.org>
3420         * fileio.c (Fcopy_file, Fset_file_selinux_context):
3421         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
3423 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
3425         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
3426         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
3428 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
3430         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
3431         display element, check also the underlying string or buffer
3432         character.  (Bug#11341)
3434         * w32menu.c: Include w32heap.h.
3435         (add_menu_item): If the call to AppendMenuW (via
3436         unicode_append_menu) fails, disable Unicode menus only if we are
3437         running on Windows 9X/Me.
3439 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
3441         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
3442         (xgetint): Add missing shift for LSB tags.
3444 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
3446         * keyboard.c (read_char): Don't wipe echo area for select window
3447         events: These might get delayed via `mouse-autoselect-window'
3448         (Bug#11304).
3450 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
3452         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
3453         manipulation of :loaded-from data.
3455 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
3457         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
3458         now a cons (bug#11311).
3460 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
3462         Do not create empty overlays with the evaporate property (Bug#9642).
3463         * buffer.c (Fmove_overlay): Delete an evaporating overlay
3464         if it becomes empty after its bounds are adjusted to fit within
3465         its buffer.  Without this fix, in a nonempty buffer (let ((o
3466         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
3467         yields an empty overlay that has the evaporate property, which is
3468         not supposed to happen.
3470         Fix minor GTK3 problems found by static checking.
3471         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3472         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3473         (struct _EmacsFixedClass, emacs_fixed_get_type):
3474         Move decls here from emacsgtkfixed.h, since they needn't be public.
3475         (emacs_fixed_get_type): Now static.
3476         (emacs_fixed_class_init): Omit unused local.
3477         (emacs_fixed_child_type): Remove; unused.
3478         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
3479         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
3480         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
3481         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
3482         (EMACS_FIXED_GET_CLASS): Remove; unused.
3483         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
3485         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
3486         Problem reported by Juanma Barranquero for Windows -Wunused-function.
3488 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
3490         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
3491         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
3492         (__malloc_size_t, __malloc_ptrdiff_t):
3493         Remove.  All uses removed, replaced by the definiens if needed,
3494         since we can assume C89 or better now.
3495         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
3496         (protect_malloc_state, align, get_contiguous_space)
3497         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
3498         (malloc_atfork_handler_child, malloc_enable_thread)
3499         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
3500         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
3501         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
3502         (special_realloc, _realloc_internal_nolock, _realloc_internal)
3503         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
3504         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
3505         Define using prototypes, not old style.
3506         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
3507         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
3508         (align): Don't assume that signed integer overflow wraps around.
3509         Omit unused local var.
3510         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
3511         (_free_internal_nolock, memalign, mallochook, reallochook):
3512         Omit no-longer-needed casts.
3513         (valloc): Use getpagesize, not __getpagesize.
3514         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
3515         (struct hdr): The 'magic' member is now size_t, not unsigned long.
3517         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
3519 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
3521         Move functions from C to Lisp.  Make non-blocking method calls
3522         the default.  Implement further D-Bus standard interfaces.
3524         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
3525         (QCdbus_request_name_allow_replacement)
3526         (QCdbus_request_name_replace_existing)
3527         (QCdbus_request_name_do_not_queue)
3528         (QCdbus_request_name_reply_primary_owner)
3529         (QCdbus_request_name_reply_in_queue)
3530         (QCdbus_request_name_reply_exists)
3531         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
3532         (QCdbus_registered_serial, QCdbus_registered_method)
3533         (QCdbus_registered_signal): New Lisp objects.
3534         (XD_DEBUG_MESSAGE): Use sizeof.
3535         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
3536         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
3537         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
3538         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
3539         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
3540         (xd_signature, xd_append_arg): Allow float for integer types.
3541         (xd_get_connection_references): New function.
3542         (xd_get_connection_address): Rename from xd_initialize.
3543         Return cached address.
3544         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
3545         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
3546         level.
3547         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
3548         Return number of refcounts.
3549         (Fdbus_get_unique_name): Make stronger parameter check.
3550         (Fdbus_message_internal): New defun.
3551         (Fdbus_call_method, Fdbus_call_method_asynchronously)
3552         (Fdbus_method_return_internal, Fdbus_method_error_internal)
3553         (Fdbus_send_signal, Fdbus_register_service)
3554         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
3555         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
3556         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
3557         (Vdbus_compiled_version, Vdbus_runtime_version)
3558         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
3559         (Vdbus_message_type_method_return, Vdbus_message_type_error)
3560         (Vdbus_message_type_signal): New defvars.
3561         (Vdbus_registered_buses, Vdbus_registered_objects_table):
3562         Adapt docstring.
3564 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
3566         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
3567         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
3568         Do not assume ptrdiff_t is the same width as 'int'.
3570         * alloc.c: Handle unusual debugging option combinations.
3571         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
3572         since the two debugging options are incompatible.
3573         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
3574         is defined.
3575         (mem_init, mem_insert, mem_insert_fixup):
3576         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
3577         (NEED_MEM_INSERT): Remove; no longer needed.
3579 2012-04-22  Leo Liu  <sdl.web@gmail.com>
3581         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
3583 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
3585         * sysdep.c [__FreeBSD__]: Minor cleanups.
3586         (list_system_processes, system_process_attributes) [__FreeBSD__]:
3587         Use Emacs indenting style more consistently.  Avoid some casts.
3588         Use 'double' consistently rather than mixing 'float' and 'double'.
3590 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
3592         * sysdep.c (list_system_processes, system_process_attributes):
3593         Add implementation for FreeBSD (Bug#5243).
3595 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
3597         * lisp.mk (lisp): Update.
3599 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
3601         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
3602         It is never used otherwise.
3604 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
3606         * print.c (print_preprocess): Only check print_depth if print-circle
3607         is nil.
3608         (print_object): Check for cycles even when print-circle is nil and
3609         print-gensym is t, but only check print_depth if print-circle is nil.
3611 2012-04-20  Chong Yidong  <cyd@gnu.org>
3613         * process.c (wait_reading_process_output): If EIO occurs on a pty,
3614         set the status to "failed" and ensure that sentinel is run.
3616 2012-04-20  Glenn Morris  <rgm@gnu.org>
3618         * process.c (Fset_process_inherit_coding_system_flag)
3619         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
3620         (Fmake_network_process, Fmake_serial_process): Doc fix.
3622 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
3624         * xdisp.c (string_buffer_position_lim): Limit starting position to
3625         BEGV.
3626         (set_cursor_from_row): If called for a mode-line or header-line
3627         row, return zero immediately.
3628         (try_cursor_movement): If inside continuation line, don't back up
3629         farther than the first row after the header line, if any.
3630         Don't consider the header-line row as "partially visible", even if
3631         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
3633 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
3635         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
3636         (bug#11238).
3638 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
3639 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
3641         configure: new option --enable-gcc-warnings (Bug#11207)
3642         * Makefile.in (C_WARNINGS_SWITCH): Remove.
3643         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
3644         (ALL_CFLAGS): Use new macros rather than old.
3645         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
3646         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
3647         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
3648         -Wunused-result, -Wunused-variable.  This should go away once
3649         the Emacs and Gnulib regex code is merged.
3650         (xmalloc, xrealloc): Now static.
3652 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
3654         * dired.c (Fsystem_groups): Remove unused local.
3656 2012-04-17  Glenn Morris  <rgm@gnu.org>
3658         * dired.c (Fsystem_users): Doc fix.
3660 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
3662         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
3663         (syms_of_dired): Add them.
3665 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
3667         Fix minor alloc.c problems found by static checking.
3668         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
3669         New extern decls, to avoid calling undeclared functions.
3670         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
3671         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
3672         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
3673         (NEED_MEM_INSERT): New macro.
3674         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
3675         Remove one incorrect comment and fix another.
3677         Fix minor ralloc.c problems found by static checking.
3678         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3679         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
3680         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
3681         (r_alloc_sbrk): Now static.
3683         Improve ralloc.c interface checking.
3684         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
3685         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
3686         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
3687         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
3688         [REL_ALLOC]: ... to here, to check interface.
3689         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
3690         Remove decls.  This fixes an "It stinks!".
3692         * alloc.c (which_symbols): Fix alignment issue / type clash.
3694 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
3696         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
3697         (struct Lisp_Misc_Any): Likewise.
3698         (struct Lisp_Free): Likewise.
3699         * alloc.c (union aligned_Lisp_Symbol): Define.
3700         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
3701         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
3702         (union aligned_Lisp_Misc): Define.
3703         (MARKER_BLOCK_SIZE, struct marker_block): Use union
3704         aligned_Lisp_Misc instead of union Lisp_Misc.
3705         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
3707 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
3709         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
3710         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
3711         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
3712         * s/netbsd.h, s/sol2-6.h:
3713         Remove definition of GC_MARK_STACK, since the default now works.
3714         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
3715         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
3716         no longer the default.
3717         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
3719 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
3721         * lread.c (lisp_file_lexically_bound_p):
3722         Fix hang at ";-*-\n" (bug#11238).
3724 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
3726         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
3727         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
3729 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
3731         * nsterm.m (constrainFrameRect): Always constrain when there is only
3732         one screen (Bug#10962).
3734 2012-04-13  Ken Brown  <kbrown@cornell.edu>
3736         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
3738 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
3740         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
3742 2012-04-11  Daniel Colascione  <dancol@dancol.org>
3744         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
3745         against is gone.  It's better to use vfork now so that when Cygwin
3746         gains a new, working vfork, we use it automatically (bug#10398).
3748 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
3750         * window.c (save_window_save): Obey window-point-insertion-type.
3752 2012-04-11  Glenn Morris  <rgm@gnu.org>
3754         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
3756 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
3758         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
3760 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
3762         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
3763         (force_quit_count): New var.
3764         (handle_interrupt): Use it.
3766 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
3768         * w32.c (w32_delayed_load): Record the full path of the library
3769         being loaded (bug#10424).
3771 2012-04-09  Glenn Morris  <rgm@gnu.org>
3773         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
3774         not just in the obarray, before snarfing them.  (Bug#11036)
3776         * Makefile.in ($(leimdir)/leim-list.el):
3777         Pass EMACS rather than BUILT_EMACS.
3779 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
3781         * process.c (make_process):
3782         * process.h: Add integer `gnutls_handshakes_tried' member to
3783         process struct.
3785         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
3786         Add convenience `GNUTLS_LOG2i' macro.
3788         * gnutls.c (gnutls_log_function2i): Convenience log function.
3789         (emacs_gnutls_read): Use new log functions,
3790         `gnutls_handshakes_tried' process member, and
3791         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
3792         attempts per process (connection).
3794 2012-04-09  Chong Yidong  <cyd@gnu.org>
3796         * eval.c (Fuser_variable_p, user_variable_p_eh)
3797         (lisp_indirect_variable): Functions deleted.
3798         (Fdefvar): Caller changed.
3800         * callint.c (Finteractive, Fcall_interactively):
3801         * minibuf.c (Fread_variable): Callers changed.
3803 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
3805         * xdisp.c (set_cursor_from_row): If the display string appears in
3806         the buffer at position that is closer to point than the position
3807         after the display string, display the cursor on the first glyph of
3808         the display string.  Fixes cursor display when a 'display' text
3809         property immediately follows invisible text.  (Bug#11094)
3811 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
3813         composite.c: use 'double' consistently
3814         * composite.c (get_composition_id): Use 'double' consistently
3815         instead of converting 'float' to 'double' and vice versa; this is
3816         easier to understand and avoids a GCC warning.
3818 2012-04-09  Glenn Morris  <rgm@gnu.org>
3820         * Makefile.in: Generate leim-list with bootstrap-emacs, in
3821         preparation for dumping it with emacs.  (Bug#4789)
3822         (leimdir): New variable.
3823         ($(leimdir)/leim-list.el): New rule.
3824         (emacs$(EXEEXT)): Depend on leim-list.el.
3826         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
3827         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
3828         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
3830 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
3832         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
3833         proper alignment.
3835 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
3837         * xml.c (init_libxml2_functions) [WINDOWSNT]:
3838         Remove unused local variable.
3840 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
3842         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
3843         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
3844         (mark_memory): Mark Lisp_Objects only if pointers might hide in
3845         objects, as mark_maybe_pointer will catch them otherwise.
3846         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
3847         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
3849 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
3851         Fix typo that broke non-Windows builds.
3852         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
3854 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
3856         Support building on MS-Windows with libxml2.
3858         * makefile.w32-in (OBJ2): Add xml.$(O).
3859         (GLOBAL_SOURCES): Add xml.c.
3860         ($(BLD)/xml.$(O)): New dependency list.
3862         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
3863         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
3864         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
3865         [!WINDOWSNT]: New macros.
3866         (init_libxml2_functions, libxml2_loaded_p): New functions.
3867         (parse_region): Call fn_xmlCheckVersion instead of using the macro
3868         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
3869         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
3870         Calls xmlCleanupParser only if libxml2 was loaded (or statically
3871         linked in).
3872         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
3873         Call init_libxml2_functions before calling libxml2 functions.
3874         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
3876         * emacs.c: Don't include libxml/parser.h.
3877         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
3878         xmlCleanupParser directly.
3880         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
3882 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
3884         * indent.c (Fvertical_motion): If there is a display string at
3885         point, use it.vpos to compute how many lines to backtrack after
3886         move_it_to point.  (Bug#11133)
3888 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
3890         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
3891         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
3892         about subtle differences between FETCH_CHAR* and STRING_CHAR*
3893         macros related to unification of CJK characters.  For the details,
3894         see the discussion following the message here:
3895         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
3897 2012-04-04  Chong Yidong  <cyd@gnu.org>
3899         * keyboard.c (Vdelayed_warnings_list): Doc fix.
3901 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
3903         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
3904         instead of alloca.  (Bug#11138)
3906 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
3908         * w32menu.c (is_simple_dialog): Properly check lisp types.
3909         (Bug#11141)
3911 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
3913         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
3914         position we get to after a call to move_it_to fails the
3915         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
3916         only if we wind up in a string from display property.  (Bug#11063)
3918         * window.c (Fdelete_other_windows_internal): Invalidate the row
3919         and column information about mouse highlight, so that redisplay
3920         restores it after reallocating the glyph matrices.  (Bug#7464)
3922         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
3923         string comes from a `display' text property, use the buffer
3924         position of that property as if we actually saw that position in
3925         the row's glyphs.
3926         (move_it_by_lines): Remove the assertion that
3927         "it->current_x == 0 && it->hpos == 0" which can be legitimately
3928         violated when there's a before-string at the beginning of a line.
3929         (Bug#11063)
3931 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
3933         * xdisp.c (append_space_for_newline): If the default face was
3934         remapped, use the remapped face for the appended newline.
3935         (extend_face_to_end_of_line): Use the remapped default face for
3936         extending the face to the end of the line.
3937         (display_line): Call extend_face_to_end_of_line when the default
3938         face was remapped.  (Bug#11068)
3940 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
3942         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
3944 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
3946         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
3948 2012-03-27  Glenn Morris  <rgm@gnu.org>
3950         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
3951         Doc fixes.
3953 2012-03-26  Kenichi Handa  <handa@m17n.org>
3955         * dispextern.h (struct glyph): Fix previous change.  Change the
3956         bit length of glyphless.ch to 25 (Bug#11082).
3958 2012-03-26  Chong Yidong  <cyd@gnu.org>
3960         * keyboard.c (Vselection_inhibit_update_commands): New variable.
3961         (command_loop_1): Use it; inhibit selection update for
3962         handle-select-window too (Bug#8996).
3964 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
3966         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
3968 2012-03-25  Kenichi Handa  <handa@m17n.org>
3970         * dispextern.h (struct glyph): Change the bit length of
3971         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
3973 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
3975         * s/ms-w32.h (tzname): Include time.h before redirecting to
3976         _tzname.  Fixes the MSVC build.  (Bug#9960)
3978 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
3980         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
3981         characters.
3983         * xterm.c (XTread_socket): Only modify handling_signal if
3984         !SYNC_INPUT.  (Bug#11080)
3986 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
3988         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
3989         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
3990         when fetching a multibyte character consumes more bytes than
3991         CHAR_BYTES returns, due to unification of CJK characters in
3992         string_char.  (Bug#11073)
3994 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
3996         * process.c (wait_reading_process_output): Handle pty disconnect
3997         by refraining from sending oneself a SIGCHLD (bug#10933).
3999 2012-03-22  Chong Yidong  <cyd@gnu.org>
4001         * dispextern.h (struct it): New member string_from_prefix_prop_p.
4003         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
4004         Mark string as coming from a prefix property.
4005         (handle_face_prop): Use default face for prefix strings (Bug#4281).
4006         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
4008 2012-03-21  Chong Yidong  <cyd@gnu.org>
4010         * xfaces.c (Vface_remapping_alist): Doc fix.
4012 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
4014         * w32proc.c (Fw32_set_console_codepage)
4015         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
4016         Doc fixes.
4018 2012-03-20  Chong Yidong  <cyd@gnu.org>
4020         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
4021         to reflect default non-nil value of redisplay-dont-pause.
4023 2012-03-19  Kenichi Handa  <handa@m17n.org>
4025         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
4026         it fit in a valid range (Bug#11003).
4028 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
4030         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
4031         that is not from display property, accept the row as a "cursor
4032         row" if one of the string's character has a non-nil `cursor'
4033         property.  Fixes cursor positioning when there are newlines in
4034         overlay strings, e.g. in icomplete.el.  (Bug#11035)
4036 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
4038         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
4040 2012-03-12  Chong Yidong  <cyd@gnu.org>
4042         * eval.c (inhibit_lisp_code): Rename from
4043         inhibit_window_configuration_change_hook; move from window.c.
4045         * xfns.c (unwind_create_frame_1, Fx_create_frame):
4046         * window.c (run_window_configuration_change_hook)
4047         (syms_of_window): Callers changed.
4049 2012-03-11  Chong Yidong  <cyd@gnu.org>
4051         * keymap.c (Fkey_description): Doc fix (Bug#9700).
4053         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
4055 2012-03-10  Chong Yidong  <cyd@gnu.org>
4057         * frame.c (other_visible_frames): Don't assume the selected frame
4058         is visible (Bug#10955).
4060 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
4062         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
4064 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
4066         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
4067         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
4068         zero (Bug#10954).
4070 2012-03-03  Glenn Morris  <rgm@gnu.org>
4072         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
4074 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
4076         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
4077         position past the first glyph_row that ends at ZV.  (Bug#10902)
4078         (redisplay_window, next_element_from_string): Fix typos in
4079         comments.
4080         (redisplay_window): Pass to move_it_vertically the margin in
4081         pixels, not in screen lines.
4083 2012-03-02  Glenn Morris  <rgm@gnu.org>
4085         * buffer.c (buffer-list-update-hook): Doc fix.
4087 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
4089         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
4090         push_it before setting up the iterator for the first overlay
4091         string, even if we have an empty string loaded.
4092         (next_overlay_string): If there's an empty string on the iterator
4093         stack, pop the stack.  (Bug#10903)
4095 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
4097         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
4098         Suggested by Stefan Monnier in
4099         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
4100         * alloc.c (widen_to_Lisp_Object): New static function.
4101         (mark_memory): Also mark Lisp_Objects by fetching pointer words
4102         and widening them to Lisp_Objects.  This would work even if
4103         USE_LSB_TAG is defined and wide integers are used, which might
4104         happen in a future version of Emacs.
4106 2012-02-25  Chong Yidong  <cyd@gnu.org>
4108         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
4109         Doc fix.
4111         * xselect.c (Fx_selection_exists_p): Doc fix.
4112         (x_clipboard_manager_save_all): Print an informative message
4113         before saving to clipboard manager.
4115 2012-02-24  Chong Yidong  <cyd@gnu.org>
4117         * keyboard.c (process_special_events): Handle all X selection
4118         requests in kbd_buffer, not just the next one (Bug#8869).
4120 2012-02-23  Chong Yidong  <cyd@gnu.org>
4122         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
4123         call when setting menu-bar-lines and tool-bar-lines parameters.
4124         (unwind_create_frame_1): New helper function.
4126         * window.c (inhibit_window_configuration_change_hook): New var.
4127         (run_window_configuration_change_hook): Obey it.
4128         (syms_of_window): Initialize it.
4130 2012-02-22  Chong Yidong  <cyd@gnu.org>
4132         * xterm.c (x_draw_image_relief): Add missing type check for
4133         Vtool_bar_button_margin (Bug#10743).
4135 2012-02-21  Chong Yidong  <cyd@gnu.org>
4137         * fileio.c (Vfile_name_handler_alist): Doc fix.
4139         * buffer.c (Fget_file_buffer): Protect against invalid file
4140         handler return value.
4142 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
4144         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
4145         when computing $valmask.
4147         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
4148         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
4149         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
4150         It's useless in that case, and it can cause problems on hosts
4151         that allocate halves of EMACS_INT values separately.
4152         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
4153         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
4154         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
4155         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
4156         it avoids undefined behavior on hosts where shifting right by more
4157         than the word width has undefined behavior.
4159 2012-02-19  Chong Yidong  <cyd@gnu.org>
4161         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
4162         (Funhandled_file_name_directory, Ffile_name_as_directory)
4163         (Fdirectory_file_name, Fexpand_file_name)
4164         (Fsubstitute_in_file_name): Protect against invalid file handler
4165         return values (Bug#10845).
4167 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
4169         * .gdbinit (pitx): Fix incorrect references to fields of the
4170         iterator stack.
4172 2012-02-17  Chong Yidong  <cyd@gnu.org>
4174         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
4176 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
4178         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
4179         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
4181 2012-02-15  Chong Yidong  <cyd@gnu.org>
4183         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
4184         marked as special.  Also, starting docstrings with * is obsolete.
4186 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
4188         * gnutls.c (emacs_gnutls_write): Fix last change.
4190 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
4192         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
4193         send_process.
4195 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
4197         * keymap.c (Fsingle_key_description): Handle char ranges.
4199 2012-02-12  Chong Yidong  <cyd@gnu.org>
4201         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
4202         as that creates a dangerous corner case.
4204         * window.c (Fdelete_window_internal): Invalidate the mouse
4205         highlight (Bug#9904).
4207 2012-02-12  Glenn Morris  <rgm@gnu.org>
4209         * xselect.c (Fx_own_selection_internal)
4210         (Fx_get_selection_internal, Fx_disown_selection_internal)
4211         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
4212         * nsselect.m (Fx_own_selection_internal)
4213         (Fx_disown_selection_internal, Fx_selection_exists_p)
4214         (Fx_selection_owner_p, Fx_get_selection_internal):
4215         Sync docs and argument specs with the xselect.c versions.
4217 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
4219         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
4221 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
4223         * w32select.c (Fx_selection_exists_p): Sync doc string and
4224         argument list with xselect.c.  (Bug#10783)
4226         * w16select.c (Fx_selection_exists_p): Sync doc string and
4227         argument list with xselect.c.  (Bug#10783)
4229 2012-02-10  Glenn Morris  <rgm@gnu.org>
4231         * fns.c (Fsecure_hash): Doc fix.
4233 2012-02-09  Kenichi Handa  <handa@m17n.org>
4235         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
4237 2012-02-07  Chong Yidong  <cyd@gnu.org>
4239         * buffer.c (Fbuffer_local_variables)
4240         (buffer_lisp_local_variables): Handle unbound vars correctly;
4241         don't let Qunbound leak into Lisp.
4243 2012-02-07  Glenn Morris  <rgm@gnu.org>
4245         * image.c (Fimagemagick_types): Doc fix.
4247         * image.c (imagemagick-render-type): Change it from a lisp object
4248         to an integer.  Move the doc here from the lisp manual.
4249         Treat all values not equal to 0 the same.
4251 2012-02-06  Chong Yidong  <cyd@gnu.org>
4253         * doc.c (store_function_docstring): Avoid applying docstring of
4254         alias to base function (Bug#2603).
4256 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
4258         * .gdbinit (pp1, pv1): Remove redundant defines.
4259         (pr): Use pp.
4261 2012-02-04  Chong Yidong  <cyd@gnu.org>
4263         * nsterm.m: Declare a global (Bug#10694).
4265 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
4267         * w32.c (get_emacs_configuration_options):
4268         Include --enable-checking, if specified, in the return value.
4270 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
4272         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
4273         after rounding frame sizes.  (Bug#9723)
4275 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
4277         * keyboard.c (adjust_point_for_property): Don't position point
4278         before BEGV.  (Bug#10696)
4280 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4282         Handle overflow when computing char display width (Bug#9496).
4283         * character.c (char_width): Return EMACS_INT, not int.
4284         (char_width, c_string_width): Check for overflow when
4285         computing the width; this is possible now that individual
4286         characters can have unbounded width.  Problem introduced
4287         by merge from Emacs 23 on 2012-01-19.
4289 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
4291         * dbusbind.c (Fdbus_register_method): Mention the return value
4292         :ignore in the docstring.
4294 2012-02-02  Glenn Morris  <rgm@gnu.org>
4296         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
4298         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4299         Unconditionally set to t.  (Bug#10673)
4300         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4301         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4302         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
4304 2012-02-02  Kenichi Handa  <handa@m17n.org>
4306         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
4307         0, do not call append_composite_glyph.
4309 2012-02-02  Kenichi Handa  <handa@m17n.org>
4311         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
4312         NULL (Bug#6988).
4313         (x_produce_glyphs): If the component of a composition is a null
4314         string, set it->pixel_width to 1 to avoid zero-width glyph.
4316 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
4318         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
4319         first 2 arguments are identical.  This makes inserting large
4320         output from a subprocess an order of magnitude faster on
4321         MS-Windows, where all sbrk'ed memory is always contiguous.
4323 2012-01-31  Glenn Morris  <rgm@gnu.org>
4325         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
4326         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
4327         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
4329 2012-01-29  Glenn Morris  <rgm@gnu.org>
4331         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
4333 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
4335         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
4337 2012-01-28  Chong Yidong  <cyd@gnu.org>
4339         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
4341 2012-01-26  Chong Yidong  <cyd@gnu.org>
4343         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
4345         * search.c (Fsearch_forward, Fsearch_backward): Document negative
4346         repeat counts (Bug#10507).
4348 2012-01-26  Glenn Morris  <rgm@gnu.org>
4350         * lread.c (syms_of_lread): Doc fix.
4352 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
4354         * coding.c (encode_designation_at_bol): Change return value to
4355         EMACS_INT.
4357 2012-01-25  Chong Yidong  <cyd@gnu.org>
4359         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
4361 2012-01-21  Chong Yidong  <cyd@gnu.org>
4363         * floatfns.c (Fcopysign): Make the second argument non-optional,
4364         since nil is not allowed anyway.
4366 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
4368         * process.c (read_process_output): Use p instead of XPROCESS (proc).
4369         (send_process): Likewise.
4371 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
4373         * window.c (save_window_save, Fcurrent_window_configuration)
4374         (Vwindow_persistent_parameters): Do not use Qstate.
4375         Rewrite doc-strings.
4377 2012-01-19  Kenichi Handa  <handa@m17n.org>
4379         * character.c (char_width): New function.
4380         (Fchar_width, c_string_width, lisp_string_width):
4381         Use char_width (Bug#9496).
4383 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
4385         * window.c (Vwindow_persistent_parameters): New variable.
4386         (Fset_window_configuration, save_window_save): Handle persistent
4387         window parameters.
4389 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
4391         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
4392         thrashing the stack of the thread.  (Bug#9087)
4394 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
4396         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
4398 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
4400         * xdisp.c (rows_from_pos_range): Handle the case where the
4401         highlight ends on a newline.  (Bug#10464)
4402         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
4403         he end column for display of highlight that ends on a newline
4404         before a R2L line.
4406 2012-01-11  Glenn Morris  <rgm@gnu.org>
4408         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
4409         from load-path also when installation-directory is nil.  (Bug#10208)
4411 2012-01-10  Glenn Morris  <rgm@gnu.org>
4413         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
4415         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
4416         Update template values to be closer to their typical values these days.
4418 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
4420         * xdisp.c (rows_from_pos_range): Accept additional argument
4421         DISP_STRING, and accept any glyph in a row whose object is that
4422         string as eligible for mouse highlight.  Fixes mouse highlight of
4423         display strings from overlays.  (Bug#10464)
4425 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
4427         emacs: fix an auto-save permissions race condition (Bug#10400)
4428         * fileio.c (auto_saving_dir_umask): New static var.
4429         (Fmake_directory_internal): Use it.
4430         (do_auto_save_make_dir): Set it, instead of invoking chmod after
4431         creating the directory.  The old code temporarily assigns
4432         too-generous permissions to the directory.
4433         (do_auto_save_eh): Clear it.
4434         (Fdo_auto_save): Catch all errors, not just file errors, so
4435         that the var is always cleared.
4437 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
4439         * search.c (scan_buffer): Pass character positions to
4440         know_region_cache, not byte positions.  (Bug#6540)
4442 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
4444         * w32.c (sys_rename): Report EXDEV when rename of a directory
4445         fails because the target is on another logical disk.  (Bug#10284)
4447 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
4449         * xterm.c (x_embed_request_focus): New function.
4451         * xterm.h: Add prototype.
4453         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
4455 2012-01-05  Glenn Morris  <rgm@gnu.org>
4457         * emacs.c (emacs_copyright): Update short copyright year to 2012.
4459 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
4461         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
4462         Load gnutls_transport_set_lowat only if GnuTLS version is below
4463         2.11.1.
4464         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
4465         GnuTLS versions below 2.11.1.
4467 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
4469         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
4470         to the doc string advising against its use for altering the way
4471         windows are scrolled.
4473 2011-12-28  Kenichi Handa  <handa@m17n.org>
4475         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
4476         coding-system ASCII compatible only when it does not produce BOM
4477         on encoding (Bug#10383).
4479 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
4481         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
4482         can scroll.
4483         (create_and_show_popup_menu): Always use menu_position_func for
4484         Gtk3 (Bug#10361).
4486 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
4488         * callint.c (Fcall_interactively): Don't truncate prompt string.
4490 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
4492         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
4493         property that ends at ZV, so that the bidi iteration could be
4494         resumed from there (after widening).  (Bug#10360)
4496 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
4498         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
4500 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
4502         * nsterm.m (x_free_frame_resources):
4503         Release f->output_data.ns->miniimage.
4504         (ns_index_color): Fix indentation.  Do not retain
4505         color_table->colors[i].
4507         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
4508         before returning.
4510         * nsfns.m (x_set_background_color): Assign return value from
4511         ns_index_color to face-background instead of NSColor*.
4512         (ns_implicitly_set_icon_type): Fix indentation.
4513         Change assignment in for loop to comparison.
4515         * emacs.c (ns_pool): New variable.
4516         (main): Assign ns_pool.
4517         (Fkill_emacs): Call ns_release_autorelease_pool.
4519         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
4520         autorelease fdesc, release fdAttrs and tdict.
4521         (ns_get_covering_families): Release charset.
4522         (ns_findfonts): Release NSFontDescriptor created with new.
4523         (ns_uni_to_glyphs): Fix indentation.
4524         (setString): Release attrStr before assigning new value.
4526 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
4528         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
4529         and NS_IMPL_COCOA.
4530         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
4531         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
4533 2011-12-18  David Reitter  <reitter@cmu.edu>
4535         * nsterm.m (ns_term_init): Subscribe for notifications
4536         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
4537         to method trackingNotification in EmacsMenu.
4539         * nsmenu.m (trackingMenu): New variable.
4540         (trackingNotification): New method (from Aquamacs).
4541         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
4542         from Aquamacs (Bug#7030).
4544 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
4546         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
4547         (symbol_to_nsstring): Fix indentation.
4548         (ns_symbol_to_pb): New function.
4549         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
4550         (Fns_rotate_cut_buffers_internal): Remove.
4551         (Fns_store_selection_internal): Rename from
4552         Fns_store_cut_buffer_internal.
4553         (ns_get_foreign_selection, Fx_own_selection_internal)
4554         (Fx_disown_selection_internal, Fx_selection_exists_p)
4555         (Fns_get_selection_internal, Fns_store_selection_internal):
4556         Use ns_symbol_to_pb and check if return value is nil.
4557         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
4558         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
4559         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
4560         renamed to Sns_store_selection_internal.
4561         (ns_handle_selection_request): Move code to Fx_own_selection_internal
4562         and remove this function.
4563         (ns_handle_selection_clear): Remove, never used.
4564         (Fx_own_selection_internal): Move code from ns_handle_selection_request
4565         here.
4567 2011-12-17  Ken Brown  <kbrown@cornell.edu>
4569         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
4570         GID is unknown (Bug#10257).
4572 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
4574         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
4575         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
4576         which caused a build failure on GNU/Linux IA-64.  This problem was
4577         introduced by my 2011-10-07 patch.
4579 2011-12-15  Juri Linkov  <juri@jurta.org>
4581         * image.c (imagemagick_error): New function.  (Bug#10112)
4582         (imagemagick_load_image): Comment out `MagickSetResolution' call.
4583         Use `imagemagick_error' where ImageMagick functions return
4584         `MagickFalse'.
4585         (Fimagemagick_types): Add `Fnreverse' to return the list in the
4586         proper order.
4588 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
4590         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
4591         fill background (Bug#8992).
4593 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
4595         * window.c (Vwindow_combination_resize)
4596         (Vwindow_combination_limit): Use t instead of non-nil in
4597         doc-strings.
4598         (Vrecenter_redisplay): Add first sentence of doc-string on
4599         separate line.
4600         (Frecenter): Fix doc-string typo.
4602 2011-12-11  Kenichi Handa  <handa@m17n.org>
4604         * coding.c (Funencodable_char_position): Pay attention to the
4605         buffer text relocation (Bug#9389).
4607 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
4609         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
4610         gtk_init (Bug#10100).
4612 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
4614         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
4615         IT->string is nil.  (Bug#10263)
4617 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
4619         * nsterm.h (x_free_frame_resources): Declare.
4621         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
4622         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
4624         * nsterm.h (ns_get_defaults_value): Declare.
4626         * nsterm.m (ns_default): Call ns_get_defaults_value.
4628 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
4630         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
4631         (Bug#10170)
4633 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
4635         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
4636         that where the value of an _OBJC_* symbol points to is in the .bss
4637         section (Bug#10240).
4639 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
4641         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
4642         after the loop to call ccl_driver at least once (Bug#8619).
4644 2011-12-08  Kenichi Handa  <handa@m17n.org>
4646         * ftfont.c (get_adstyle_property): Fix previous change
4647         (Bug#10233).
4649 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
4651         * w32.c (init_environment): If no_site_lisp, remove site-lisp
4652         dirs from the default value of EMACSLOADPATH (bug#10208).
4654 2011-12-07  Glenn Morris  <rgm@gnu.org>
4656         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
4657         installation and source directories as well.  (Bug#10208)
4659 2011-12-06  Chong Yidong  <cyd@gnu.org>
4661         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
4663 2011-12-06  Glenn Morris  <rgm@gnu.org>
4665         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
4666         as an error, not just -1.  (Bug#10217)
4668 2011-12-05  Chong Yidong  <cyd@gnu.org>
4670         * keyboard.c (process_special_events): New function.
4671         (swallow_events, Finput_pending_p): Use it (Bug#10195).
4673 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
4675         * coding.c (encode_designation_at_bol): Don't use uninitialized
4676         local variable (Bug#9318).
4678 2011-12-05  Kenichi Handa  <handa@m17n.org>
4680         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
4681         return Qnil (Bug#8046, Bug#10193).
4683 2011-12-05  Kenichi Handa  <handa@m17n.org>
4685         * coding.c (encode_designation_at_bol): New args charbuf_end and
4686         dst.  Return the number of produced bytes.  Callers changed.
4687         (coding_set_source): Return how many bytes coding->source was
4688         relocated.
4689         (coding_set_destination): Return how many bytes
4690         coding->destination was relocated.
4691         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
4692         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
4694 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
4696         * coding.c (CODING_CHAR_CHARSET_P): New macro.
4697         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
4698         macro (Bug#9318).
4700 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
4702         The following changes are to fix Bug#9318.
4704         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
4705         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
4706         (encode_coding_iso_2022, encode_coding_sjis)
4707         (encode_coding_big5, encode_coding_charset): Use the above macros.
4709 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
4711         * lisp.h (process_quit_flag): Fix external declaration.
4713 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
4715         Don't macro-inline non-performance-critical code.
4716         * eval.c (process_quit_flag): New function.
4717         * lisp.h (QUIT): Use it.
4719 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
4721         * nsfns.m (get_geometry_from_preferences): New function.
4722         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
4724 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
4726         * emacs.c (Qkill_emacs): Define.
4727         (syms_of_emacs): Initialize it.
4728         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
4729         Qquit_flag to `kill-emacs' instead.
4730         (quit_throw_to_read_char): Add parameter `from_signal'.
4731         All callers changed.  Call Fkill_emacs if requested and safe.
4732         * lisp.h (QUIT): Call Fkill_emacs if requested.
4734 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
4736         * widget.c (update_wm_hints): Return if wmshell is null.
4737         (widget_update_wm_size_hints): New function.
4739         * widget.h (widget_update_wm_size_hints): Declare.
4741         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
4742         widget_update_wm_size_hints (Bug#10104).
4744 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
4746         * xdisp.c (handle_invisible_prop): If the invisible text ends just
4747         before a newline, prepare the bidi iterator for consuming the
4748         newline, and keep the current paragraph direction.  (Bug#10183)
4749         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
4751 2011-12-02  Juri Linkov  <juri@jurta.org>
4753         * search.c (Fword_search_regexp): New Lisp function created from
4754         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
4755         (Fword_search_backward, Fword_search_forward)
4756         (Fword_search_backward_lax, Fword_search_forward_lax):
4757         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
4758         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
4760 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
4762         * fileio.c (Finsert_file_contents): Move after-change-function call
4763         to before the "handled:" label, since all "goto handled" appear in
4764         cases where the *-change-functions have already been properly called
4765         (bug#10117).
4767 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
4769         * keyboard.c (interrupt_signal): Don't call kill-emacs when
4770         waiting for input.  (Bug#10169)
4772 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
4774         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
4775         verifies glyph row's hash code--we have just reallocated the
4776         glyphs, so their contents can be complete garbage.  (Bug#10164)
4778 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
4780         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
4782 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
4784         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
4785         attributes are tested _before_ calling verify_row_hash, to protect
4786         against GCC re-ordering of the tests.  (Bug#10164)
4788 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
4790         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
4792         * xterm.c (handle_one_xevent): Only set async_visible and friends
4793         if net_wm_state_hidden_seen is non-zero (Bug#10002)
4794         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
4795         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
4797 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
4799         Remove GCPRO-related macros that exist only to avoid shadowing locals.
4800         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
4801         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
4802         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4803         All uses changed to use GCPRO1 etc.
4804         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
4805         Revert to old implementation (i.e., before 2011-03-11).
4807 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
4809         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
4810         of scroll runs so as to avoid assigning disabled bogus rows and
4811         unnecessary graphics copy operations.
4813 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
4815         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
4816         (snprintf) [_MSC_VER]: Redirect to _snprintf.
4817         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
4818         (malloc, free, realloc, calloc): Redirect to e_* only when
4819         compiling Emacs.
4821         * lisp.h (GCTYPEBITS): Move before first use.
4822         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
4823         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
4824         this macro definition.
4826         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
4827         _MSC_VER.
4829 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
4831         * gtkutil.c (xg_create_frame_widgets):
4832         Call gtk_window_set_has_resize_grip (FALSE) if that function is
4833         present with Gtk+ 2.0.
4835 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
4837         * fileio.c (Finsert_file_contents): Undo previous change; see
4838         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
4840 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
4842         Rename locals to avoid shadowing.
4843         * fileio.c (Finsert_file_contents):
4844         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
4845         * process.c (wait_reading_process_output):
4846         Rename inner 'proc' to 'p' to avoid shadowing.
4847         Indent for consistency with usual Emacs style.
4849 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
4851         * xdisp.c (redisplay_window): If cursor row is not fully visible
4852         after recentering, and scroll-conservatively is set to a large
4853         number, scroll window by a few more lines to make the cursor fully
4854         visible and out of scroll-margin.  (Bug#10105)
4855         (start_display): Don't move to the next line if the display should
4856         start at a newline that is part of a display vector or an overlay
4857         string.  (Bug#10119)
4859 2011-11-24  Juri Linkov  <juri@jurta.org>
4861         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
4862         after the `MagickPingImage' call.  (Bug#10112)
4864 2011-11-23  Chong Yidong  <cyd@gnu.org>
4866         * window.c (Fcoordinates_in_window_p): Accept only live windows.
4868 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
4870         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
4871         making another buffer current.  (Bug#10114)
4873 2011-11-23  Glenn Morris  <rgm@gnu.org>
4875         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
4877 2011-11-23  Chong Yidong  <cyd@gnu.org>
4879         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
4880         using it (Bug#5984).
4882 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
4884         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
4885         and header-lines, as they don't have one computed for them.
4886         (Bug#10098)
4888         * .gdbinit (prow): Make displayed values more self-explaining.
4889         Add row's hash code.
4891 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
4893         * process.c (wait_reading_process_output): Fix asynchrounous
4894         GnuTLS socket handling on some versions of the GnuTLS library.
4895         (wait_reading_process_output): Add comment and URL.
4897 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
4899         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
4901 2011-11-21  Chong Yidong  <cyd@gnu.org>
4903         * window.c (Fnext_window, Fprevious_window): Doc fix.
4905 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
4907         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
4909 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
4911         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
4913 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
4915         * window.c (Fset_window_combination_limit): Rename argument
4916         STATUS to LIMIT.
4917         (Vwindow_combination_limit): Remove "status" from doc-string.
4919 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
4921         * m/ibms390.h: Remove.
4922         * m/ibms390x.h: Don't include "ibms390.h".
4924 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
4926         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
4927         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
4929 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
4931         * casetab.c (Fset_case_table):
4932         * charset.c (Fcharset_after): Fix typos.
4934 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
4936         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
4937         Otherwise, valgrind does not work on some platforms.
4938         Problem reported by Andreas Schwab in
4939         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
4940         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
4941         is set, removing the need for VIRT_ADDRESS_VARIES.
4942         (PURE_P): Use a more-efficient implementation that needs just one
4943         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
4944         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
4945         to 4 (xorl, subq, cmpq, setbe).
4946         * alloc.c (pure): Always extern now, since that's the
4947         VIRT_ADDR_VARIES behavior.
4948         (PURE_POINTER_P): Use a single comparison, not two, for
4949         consistency with the new puresize.h.
4950         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
4951         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
4952         Remove VIRT_ADDR_VARIES no longer needed.
4954 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
4956         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
4957         (erase_phys_cursor, update_window_cursor, show_mouse_face)
4958         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
4959         behave as if the cursor position were at the window margin.
4961         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
4962         and the cursor position is out of bounds, behave as if the cursor
4963         position were at the window margin.  (Bug#10075)
4965 2011-11-18  Chong Yidong  <cyd@gnu.org>
4967         * window.c (Fwindow_combination_limit): Make first argument
4968         non-optional, since it is meaningless for live windows like the
4969         selected window.
4971 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
4973         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
4975 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
4977         * intervals.c: Fix grafting over the whole buffer (bug#10071).
4978         (graft_intervals_into_buffer): Simplify.
4980 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
4982         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
4983         hash values of the two rows.
4984         (copy_row_except_pointers): Preserve the used[] arrays and the
4985         hash values of the two rows.  (Bug#10035)
4986         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
4988         * xdisp.c (row_hash): New function, body extracted from
4989         compute_line_metrics.
4990         (compute_line_metrics): Call row_hash, instead of computing the
4991         hash code inline.
4993         * dispnew.c (verify_row_hash): Call row_hash for computing the
4994         hash code of a row, instead of duplicating code from xdisp.c.
4996         * dispextern.h (row_hash): Add prototype.
4998 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
5000         * frame.c (delete_frame): Don't delete the terminal when the last
5001         X frame is closed if emacs is built with GTK toolkit.
5003 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
5005         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
5007 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
5009         * window.c (Vwindow_splits): Rename to
5010         Vwindow_combination_resize.  Suggested by Juri Linkov.
5011         (Fsplit_window_internal): Use Vwindow_combination_resize instead
5012         of Vwindow_splits.
5014 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
5016         * nsfns.m (Fns_font_name):
5017         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
5019 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
5021         * window.h (window): Rename slot "nest" to "combination_limit".
5022         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
5023         (Fset_window_nest): Rename to Fset_window_combination_limit.
5024         (Vwindow_nest): Rename to Vwindow_combination_limit.
5025         (recombine_windows, make_parent_window, make_window)
5026         (Fsplit_window_internal, saved_window)
5027         (Fset_window_configuration, save_window_save): Rename all
5028         occurrences of window_nest to window_combination_limit.
5030 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
5032         * image.c (imagemagick_load_image): Fix typo.
5034 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
5036         * xdisp.c (display_line): Move the call to
5037         highlight_trailing_whitespace before the call to
5038         compute_line_metrics, since the latter needs to see the final
5039         faces of all the glyphs to compute ROW's hash value.
5040         Fixes assertion violations in row_equal_p.  (Bug#10035)
5042 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
5044         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
5045         just return (bug#10044).
5047 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
5049         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
5050         with user-defined heap size.  Bump the default size of the temacs
5051         heap to 27MB, to avoid memory warning when running temacs.
5052         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
5054         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
5055         current_matrix and desired_matrix.  (Bug#9990)
5056         (verify_row_hash) [XASSERTS]: New function.
5057         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
5058         that the hash value of glyph rows is correct.
5060 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
5062         * window.h (window): Remove splits slot.
5063         * window.c (Fwindow_splits, Fset_window_splits): Remove.
5064         (Fdelete_other_windows_internal, make_parent_window)
5065         (make_window, Fsplit_window_internal, Fdelete_window_internal)
5066         (Fset_window_configuration, save_window_save): Don't deal with
5067         split status of windows.
5068         (saved_window): Remove splits slot.
5069         (Vwindow_splits): Rewrite doc-string.
5071 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
5073         * xfns.c (unwind_create_frame):
5074         * nsfns.m (unwind_create_frame):
5075         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
5076         Vframe_list (Bug#9999).
5078 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
5080         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
5082 2011-11-11  Kenichi Handa  <handa@m17n.org>
5084         * callproc.c (Fcall_process): Set the member dst_multibyte of
5085         process_coding.
5087 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
5089         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
5090         avoid a crash (bug#9496).
5092 2011-11-09  Chong Yidong  <cyd@gnu.org>
5094         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
5095         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
5097 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
5099         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
5101 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
5103         Avoid some portability problems by eschewing 'extern inline' functions.
5104         The trivial performance wins aren't worth the portability hassles; see
5105         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
5106         et seq.
5107         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5108         (window_box_width, window_box_left, window_box_left_offset)
5109         (window_box_right, window_box_right_offset): Undo previous change,
5110         by removing the "extern"s.
5111         * intervals.c (adjust_intervals_for_insertion)
5112         (adjust_intervals_for_deletion): Undo previous change,
5113         making these static again.
5114         (offset_intervals, temp_set_point_both, temp_set_point)
5115         (copy_intervals_to_string): No longer inline.
5116         * xdisp.c (window_text_bottom_y, window_box_width)
5117         (window_box_height, window_box_left_offset)
5118         (window_box_right_offset, window_box_left, window_box_right)
5119         (window_box): No longer inline.
5121 2011-11-08  Chong Yidong  <cyd@gnu.org>
5123         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
5124         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
5125         Signal an error if not a live window.
5126         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
5127         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
5129 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
5131         * lisp.h (syms_of_abbrev): Remove declaration.
5132         Reported by CHENG Gao <chenggao@royau.me>.
5134 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
5136         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
5137         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
5138         of temacs in GUI mode.
5140 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
5142         * window.h: Declare delete_all_child_windows instead of
5143         delete_all_subwindows.
5144         * window.c (Fwindow_nest, Fset_window_nest)
5145         (Fset_window_new_total, Fset_window_new_normal)
5146         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
5147         (delete_all_subwindows): Rename to delete_all_child_windows.
5148         (Fdelete_other_windows_internal, Fset_window_configuration):
5149         Call delete_all_child_windows instead of delete_all_subwindows.
5150         * frame.c (delete_frame): Call delete_all_child_windows instead
5151         of delete_all_subwindows.
5153 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
5155         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
5156         This is also needed for porting to any host where GC_MARK_STACK is
5157         not GC_MAKE_GCPROS_NOOPS.
5158         (which_symbols): Use it.
5160 2011-11-07  Kenichi Handa  <handa@m17n.org>
5162         * coding.c (coding_set_destination): Check coding->src_pos only
5163         when coding->src_object is a buffer (bug#9910).
5165         * process.c (send_process): Set the member src_multibyte of coding
5166         to 0 (bug#9911) when sending a unibyte text.
5168         * callproc.c (Fcall_process): Set the member src_multibyte of
5169         process_coding to 0 (bug#9912).
5171 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5173         * xmenu.c (cleanup_widget_value_tree): New function.
5174         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
5175         calling free_menubar_widget_value_tree directly (Bug#9830).
5177 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
5179         Fix some portability problems with 'inline'.
5180         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
5181         (window_box_width, window_box_left, window_box_left_offset)
5182         (window_box_right, window_box_right_offset): Declare extern.
5183         Otherwise, these inline functions do not conform to C99 and
5184         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
5185         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
5186         * intervals.c (adjust_intervals_for_insertion)
5187         (adjust_intervals_for_deletion): Now extern, because otherwise the
5188         extern inline functions 'offset_intervals' couldn't refer to it.
5189         (static_offset_intervals): Remove.
5190         (offset_intervals): Rewrite using the old contents of
5191         static_offset_intervals.  The old version didn't conform to C99
5192         because an extern inline function contained a reference to an
5193         identifier with static linkage.
5195 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
5197         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
5198         GC.
5200 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
5202         * xdisp.c (init_iterator, reseat_to_string): Don't set the
5203         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
5204         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
5205         return Qleft_to_right.
5207 2011-11-06  Chong Yidong  <cyd@gnu.org>
5209         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
5210         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
5211         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
5212         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
5213         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
5214         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
5215         (Fwindow_vscroll): Doc fix.
5216         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
5217         argument, since it makes no sense to pass a live window and for
5218         consistency with window-child.
5220 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
5222         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
5223         support MSVC.
5225 2011-11-05  Jason Rumney  <jasonr@gnu.org>
5227         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
5228         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
5229         fonts (Bug#6029).
5230         (add_font_entity_to_list): Fix logic errors in mixed boolean and
5231         bitwise arithmetic preventing use of unicode-sip and non-truetype
5232         opentype fonts.
5234 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
5236         * s/ms-w32.h (fstat, stat, utime): Move redirections to
5237         "emacs"-only part.
5239         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
5240         initialization code to keep similarity to xfns.c after changes
5241         from 2011-11-05.
5243 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
5245         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
5246         (unwind_create_frame): New function (Bug#9943).
5247         (Fx_create_frame): Restructure code to be more similar to the one in
5248         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
5249         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
5250         Move terminal->reference_count++ just before making the frame official
5251         (Bug#9943).
5253         * nsterm.m (x_free_frame_resources): New function.
5254         (x_destroy_window): Move code to x_free_frame_resources.
5256         * xfns.c (unwind_create_frame): Fix comment.
5257         (Fx_create_frame, x_create_tip_frame):
5258         Move terminal->reference_count++ just before making the frame
5259         official.  Move initialization of image_cache_refcount and
5260         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
5262 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
5264         Support MSVC build with newer versions of Visual Studio.
5265         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
5266         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
5267         nt/gmake.defs.
5269         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
5270         which are not supported by MSVC.
5271         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
5272         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
5273         bitfields.
5274         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
5275         types in bitfields.
5276         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
5278         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
5280 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
5282         Support MSVC build with newer versions of Visual Studio.
5283         * w32.c: Don't include w32api.h for MSVC.
5284         (init_environment) [_MSC_VER]: Call sys_access, not _access.
5286         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
5287         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
5288         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
5289         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
5290         e_* cousins.
5291         (alloca) [_MSC_VER]: Define to _alloca.
5293         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
5295         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
5297 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
5299         * xdisp.c (note_mouse_highlight): If either of
5300         previous/next-single-property-change returns nil, treat that as
5301         the beginning or the end of the buffer.  (Bug#9955)
5303 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
5305         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
5306         label is not null (Bug#9951).
5307         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
5308         may be NULL.
5310 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
5312         * window.c (Fwindow_body_size): Mention in the doc string that the
5313         return value is in frame's canonical units.  (Bug#9949)
5315 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
5317         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
5319         * w32fns.c (unwind_create_frame): If needed, free the glyph
5320         matrices of the partially constructed frame.  (Bug#9943)
5321         * xfns.c (unwind_create_frame): Likewise.
5323 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
5325         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
5326         Don't stop backward scan on the continuation glyph, even though
5327         its CHARPOS is positive.
5328         (mouse_face_from_buffer_pos, note_mouse_highlight):
5329         Rename cover_string to disp_string.
5331 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
5333         * window.c (temp_output_buffer_show): Don't use
5334         Vtemp_buffer_show_specifiers.
5335         (Vtemp_buffer_show_specifiers): Remove unused variable.
5337 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
5339         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
5340         past the beginning of the current glyph matrix.
5342 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
5344         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
5345         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
5346         HAVE_GTK3 (Bug#9869).
5348         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
5349         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
5351         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
5353         * xterm.c: Declare x_handle_net_wm_state to return int.
5354         (handle_one_xevent): Check if we are iconified but don't have
5355         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
5356         (get_current_wm_state): Return non-zero if not hidden,
5357         check for _NET_WM_STATE_HIDDEN (Bug#9893).
5358         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
5359         (x_handle_net_wm_state): Return what get_current_wm_state returns.
5360         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
5362 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
5364         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
5365         so that this new function doesn't get optimized away by a
5366         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
5368 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
5370         * frame.h (MOUSE_HL_INFO): Remove excess parens.
5372 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
5374         Fix the `xbytecode' command.
5375         * .gdbinit (xprintbytestr): New command.
5376         (xwhichsymbols): Rename from `which'; all callers changed.
5377         (xbytecode): Print the byte-code string as well.
5379 2011-10-29  Kim Storm  <storm@cua.dk>
5381         * alloc.c (which_symbols): New function.
5383 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
5385         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
5386         line.  (Bug#9903)
5388 2011-10-29  Glenn Morris  <rgm@gnu.org>
5390         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
5391         Not clear what it was for, and it causes various bugs.  (Bug#9839)
5393 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
5395         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
5396         possible random value that matches one of those tested as
5397         condition to clear the mouse face.
5399 2011-10-28  Chong Yidong  <cyd@gnu.org>
5401         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
5403 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
5405         * window.c (make_window): Initialize phys_cursor_on_p.
5407 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
5409         * lisp.h (struct Lisp_Symbol): Update comments.
5411 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
5413         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
5415 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
5417         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
5418         <oslsachem@gmail.com> for helping to debug this.
5420         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
5421         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
5422         (g_b_init_get_glyph_outline_w): New static variables.
5423         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
5424         (GetGlyphOutlineW_Proc): New typedefs.
5425         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
5426         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
5427         New functions.
5428         (w32font_open_internal, compute_metrics):
5429         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
5430         instead of calling the "wide" APIs directly.
5432         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
5434         * w32.h (syms_of_w32font): Add prototype.
5436 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
5438         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
5439         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
5440         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
5441         (Fmove_to_window_line): Doc fix.
5443 2011-10-27  Chong Yidong  <cyd@gnu.org>
5445         * process.c (make_process): Set gnutls_state to NULL.
5447         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
5448         non-NULL, regardless of GNUTLS_INITSTAGE.
5449         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
5450         an error.  Set process slots as soon as we allocate them.
5452         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
5454 2011-10-27  Chong Yidong  <cyd@gnu.org>
5456         * gnutls.c (emacs_gnutls_deinit): New function.
5457         Deallocate credentials structures as well as calling gnutls_deinit.
5458         (Fgnutls_deinit, Fgnutls_boot): Use it.
5460         * process.c (make_process): Initialize GnuTLS credentials to NULL.
5461         (deactivate_process): Call emacs_gnutls_deinit.
5463 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
5465         * image.c (x_create_x_image_and_pixmap):
5466         * w32.c (sys_rename, w32_delayed_load):
5467         * w32font.c (fill_in_logfont):
5468         * w32reg.c (x_get_string_resource): Silence compiler warnings.
5470 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
5472         * w32fns.c (w32_default_color_map): New function,
5473         extracted from Fw32_default_color_map.
5474         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
5476 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
5478         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
5480 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
5482         * keyboard.c (test_undefined): New function (bug#9751).
5483         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
5485 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
5487         * sysdep.c (init_sys_modes): Fix the check for the controlling
5488         terminal (Bug#6649).
5490 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
5492         * dispextern.h (struct bidi_it): New member next_en_type.
5494         * bidi.c (bidi_line_init): Initialize the next_en_type member.
5495         (bidi_resolve_explicit_1): When next_en_pos is valid for the
5496         current character, check also for next_en_type being WEAK_EN.
5497         (bidi_resolve_weak): Don't enter the expensive loop if the current
5498         position is before next_en_pos.  Record the bidi type of the first
5499         non-ET, non-BN character we find, in addition to its position.
5500         (bidi_level_of_next_char): Invalidate next_en_type when
5501         next_en_pos is over-stepped.
5503 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
5505         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
5506         * editfns.c: Rewrite current-time-zone so that it invokes
5507         the equivalent of (format-time-string "%Z") to get the time zone name.
5508         This fixes a bug when the time zone name contains characters that
5509         need converting from the system time locale to Emacs internal format.
5510         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
5511         that patch fixed format-time-string to do the conversion, but
5512         I forgot to fix current-time-zone.
5513         (format_time_string): New function, containing most of
5514         what Fformat_time_string used to contain.
5515         (Fformat_time_string): Rewrite in terms of format_time_string.
5516         This doesn't change this function's behavior.
5517         (current-time-zone): Rewrite to use format_time_string.
5518         This fixes the bug reported by Michael Schierl in
5519         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
5520         Jason Rumney's 2007-06-07 change worked around this bug, but
5521         didn't fix it.
5522         * systime.h (tzname, timezone): Remove no-longer-used declarations.
5524 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
5526         * xdisp.c (start_display): If the character at POS is displayed
5527         via a display vector, reset IT->current.dpvec_index to zero.
5528         (try_window_reusing_current_matrix): If a line ends in a display
5529         vector or the next line starts in a display vector, continue
5530         redrawing the window even though the character position of
5531         start_row was reached.
5532         (Bug#9771, part 2)
5534 2011-10-18  Chong Yidong  <cyd@gnu.org>
5536         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
5537         with nobreak-char-display too.
5539 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
5541         Fix part 3 of bug#9771.
5542         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
5543         (bidi_resolve_neutral): Don't enter the expensive loop looking for
5544         non-neutral characters if the current character is a paragraph
5545         separator (a.k.a. Newline).  This avoids running the same
5546         expensive loop twice, once when we consume the preceding newline
5547         and the other time when the line actually needs to be displayed.
5548         Avoid the loop when we see neutrals on the base embedding level
5549         following a character whose directionality is the same as the
5550         paragraph's.  This avoids running the expensive loop when a line
5551         ends in a long sequence of neutrals, like control characters.
5552         Add assertion against STRONG_AL type.  Slightly rearrange code
5553         that determines the type of a neutral given the first non-neutral
5554         that follows it.
5555         (bidi_level_of_next_char): Set next_en_pos to zero when
5556         invalidating its info.
5558 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
5560         * xdisp.c (push_display_prop): Determine whether to record string
5561         or buffer position by IT->string, not by IT->method.  Allow
5562         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
5563         (move_it_vertically_backward): Don't look for character position
5564         immediately after the newline when in a continuation line.
5565         (Bug#9771, part 1)
5567 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
5569         * window.c (coordinates_in_window): Rewrite and delabelize
5570         vertical border check.  (Bug#5357) (Bug#9618)
5572 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
5574         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
5575         errors in XSetWindowBorder (bug#9310).
5577 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
5579         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
5580         avoid crash when xmalloc overrun checking is enabled.
5582 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
5584         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
5585         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
5586         cursor motion with <left> and <right> arrow keys.
5588         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
5589         some callers set that themselves.
5591 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
5593         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
5594         display string and the previous row comes from the same string and
5595         is empty.  (Bug#9739)  (Bug#9738)
5597 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
5599         * doc.c (get_doc_string): Encode file name (bug#9735).
5601 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
5603         * bidi.c (bidi_level_of_next_char):
5604         * xdisp.c (get_visually_first_element): Remove old incorrect
5605         comments regarding the Unicode Line Separator character.
5607         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
5609 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
5611         * alloc.c (Fgc_status): Do not access beyond zombies array
5612         boundary if nzombies > MAX_ZOMBIES.
5613         * alloc.c (dump_zombies): Add missing format specifier.
5615 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
5617         * xdisp.c (set_cursor_from_row): Simplify conditionals,
5618         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
5620         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
5621         Some packages use them to denote characters with modifiers.
5623 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
5625         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
5626         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
5627         matching a pp-number.  Rename parameter var to var1.
5629 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
5631         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
5633 2011-10-08  Glenn Morris  <rgm@gnu.org>
5635         * callint.c (Fcall_interactively): Give a more explicit error for the
5636         'c' case with a non-character input.  (Bug#8479)
5638 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
5640         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
5641         lines.
5642         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
5643         lines that are hscrolled on the left.
5645         * dispnew.c (buffer_posn_from_coords): Account for a possible
5646         presence of header-line.  (Bug#4426)
5648 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
5650         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
5651         Don't advertise functionality which we discourage or doesn't work.
5653 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
5655         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
5656         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
5657         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
5658         this makes Emacs dump core during garbage collection on rare
5659         occasions.  sizeof is obviously inferior to offsetof here, so
5660         stick with offsetof.
5661         (GC_POINTER_ALIGNMENT): New macro.
5662         (mark_memory): Omit 3rd (offset) arg; caller changed.
5663         Don't assume EMACS_INT alignment is the same as pointer alignment.
5665 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
5667         * keyboard.c (read_key_sequence_remapped): New var.
5668         (read_key_sequence): Compute remapping in the right buffer.
5669         (command_loop_1): Use read_key_sequence's remapping directly.
5671 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
5673         * dired.c (file_name_completion): Don't expand file name.
5674         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
5675         before checking file name handler.
5677         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
5678         they've been requested explicitly (bug#9591).
5680 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
5682         * keymap.c (Fsingle_key_description): Use make_specified_string
5683         instead of build_string to build string from push_key_description.
5684         (Bug#5193)
5686 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
5688         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
5689         This fixes a Y2038 bug on 64-bit hosts.
5690         * buffer.c (reset_buffer):
5691         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
5692         (Fclear_buffer_auto_save_failure):
5693         Use 0, not -1, to represent an unset failure time, since time_t
5694         might not be signed.
5696         Remove dependency on glibc malloc internals.
5697         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5698         Move back here from lisp.h, but with their new implementations.
5699         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5700         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
5701         * charset.c (charset_table_init): New static var.
5702         (syms_of_charset): Use it instead of xmalloc.  This removes a
5703         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
5704         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
5705         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5706         Move back to alloc.c.
5707         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5708         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
5710 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
5712         * nsterm.m (windowDidResize): Call x_set_window_size only when
5713         ns_in_resize is true.  Otherwise set pixelwidth/height and
5714         call change_frame_size (Bug#9628).
5716 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
5718         Port --enable-checking=all to Fedora 14 x86-64.
5719         * charset.c (syms_of_charset): Also account for glibc malloc's
5720         internal overhead when calculating the initial malloc maximum.
5722         Port --enable-checking=all to Fedora 14 x86.
5723         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5724         Move to lisp.h.
5725         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
5726         (overrun_check_realloc, overrun_check_free):
5727         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
5728         That way, xmalloc returns a properly-aligned pointer even if
5729         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
5730         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
5731         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
5732         into account when calculating the initial malloc maximum.
5733         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
5734         Move here from alloc.c, so that charset.c can use it too.
5735         Properly align; the old code wasn't right for common 32-bit hosts
5736         when configured with --enable-checking=all.
5737         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
5738         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
5740 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
5742         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
5743         use EDOM.
5745 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
5747         * xdisp.c (compute_display_string_end): If there's no display
5748         string at CHARPOS, return -1.
5750         * bidi.c (bidi_fetch_char): When compute_display_string_end
5751         returns a negative value, treat the character as a normal
5752         character not covered by a display string.  (Bug#9624)
5754 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
5756         * lread.c (Fread_from_string): Fix typo in docstring.
5758 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
5760         * xdisp.c (handle_invisible_prop): If invisible text ends on a
5761         newline, reseat the iterator instead of bidi-iterating there one
5762         character at a time.  (Bug#9610)
5763         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
5764         TO_CHARPOS if the bidi iterator is at base embedding level.
5766 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
5768         * lread.c (readevalloop): Use correct code for NBSP.
5769         (read1): Likewise.  (Bug#9608)
5771 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
5773         * dbusbind.c (Fdbus_register_signal): When service is not
5774         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
5776 2011-09-25  Glenn Morris  <rgm@gnu.org>
5778         * buffer.c (truncate-lines): Doc fix.
5780 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
5782         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
5783         (Fset_window_next_buffers): Doc fix.
5785 2011-09-24  Glenn Morris  <rgm@gnu.org>
5787         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
5789 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
5791         Fix minor problems found by static checking.
5792         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
5793         * indent.c (Fvertical_motion): Fix == vs = typo.
5795 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
5797         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
5798         Default value is now t.  Doc fix.
5800         * indent.c (Fvertical_motion): Compute and apply the overshoot
5801         logic when moving up, not only when moving down.  Fix the
5802         confusing name and values of the it_overshoot_expected variable;
5803         logic changes accordingly.  (Bug#9254) (Bug#9549)
5805         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
5806         CHARPOS is covered by a display string which includes newlines.
5807         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
5808         is covered by a display string with embedded newlines.
5810 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
5812         * dbusbind.c (Fdbus_register_signal): Add match rule to
5813         Vdbus_registered_objects_table.  (Bug#9581)
5814         (Fdbus_register_method, Vdbus_registered_objects_table):
5815         Fix docstring.
5817 2011-09-24  Jim Meyering  <meyering@redhat.com>
5819         do not ignore write error for any output size
5820         The previous change was incomplete.
5821         While it makes emacs --batch detect the vast majority of stdout
5822         write failures, errors were still ignored whenever the output size is
5823         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
5824           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
5825               && echo FAIL: ignored write error
5826           FAIL: ignored write error
5827           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
5828               && echo FAIL: ignored write error
5829           FAIL: ignored write error
5830         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
5832 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
5834         * emacs.c (Fkill_emacs): In noninteractive mode exit
5835         non-successfully if a write error occurred on stdout.  (Bug#9574)
5837 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
5839         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
5840         the xassert test.
5842         * dispextern.h (struct it): Update the comment documenting what
5843         can it->OBJECT be.
5845 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
5847         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
5848         a display string, extend search for cursor position to end of row.
5849         (find_row_edges): If the row ends in a newline from a display
5850         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
5851         Handle the case of a display string with multiple newlines.
5852         (Fcurrent_bidi_paragraph_direction): Fix search for previous
5853         non-empty line.  Fixes confusing cursor motion with arrow keys at
5854         the beginning of a line that starts with whitespace.
5856 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
5858         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
5859         (bug#9493).
5861 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
5863         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
5864         boolean (Bug#9154).
5866 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
5868         * xdisp.c (display_line): Record maximum and minimum buffer
5869         positions even if no glyphs were produced (e.g., by a zero-width
5870         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
5871         buffer positions that will be removed from the glyph row because
5872         they don't fit.
5873         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
5874         column is beyond frame width: don't subtract 1 "pixel" when
5875         computing width of the stretch.
5876         (reseat_at_next_visible_line_start): Undo the change made on
5877         2011-09-17 that saved paragraph information and restored it after
5878         the call to `reseat'.  (Bug#9545)
5880 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5882         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
5883         and turn window cursor on if cleared (Bug#9415).
5885 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
5887         * search.c (boyer_moore): Take unibyte characters from pattern
5888         literally.  (Bug#9458)
5890 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
5892         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
5894 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
5896         Fix minor problem found by static checking.
5897         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
5898         initialized, to pacify gcc -Wuninitialized.
5900         * fileio.c: Report proper errno when syscall falls.
5901         (Finsert_file_contents): Save and restore errno,
5902         so that report_file_error outputs the correct diagnostic.
5903         (Fwrite_region) [CLASH_DETECTION]: Likewise.
5905 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
5907         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
5909 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
5911         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
5912         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
5914 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
5916         * xdisp.c (reseat_at_next_visible_line_start): Keep information
5917         about the current paragraph and restore it after the call to reseat.
5919         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
5920         (bidi_find_paragraph_start): Search back for paragraph beginning
5921         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
5922         (bidi_move_to_visually_next): Only trigger paragraph-related
5923         computations when the last character is a newline or at EOB, not
5924         just any NEUTRAL_B.  (Bug#9470)
5926         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
5927         truncated lines if point is covered by a display string.  (Bug#9524)
5929 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
5931         * xselect.c: Relax test for outgoing X longs (Bug#9498).
5932         (cons_to_x_long): New function.
5933         (lisp_data_to_selection_data): Use it.  Correct the test for
5934         short-versus-long data; it was negated.  Break out of vector
5935         loop, for efficiency, when a long datum is discovered.
5937 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
5939         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
5941 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
5943         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
5944         GCC PR/17406) by declaring this function with external scope.
5946 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
5948         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
5949         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
5951 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
5953         * editfns.c (Fformat): Correctly handle text properties on "%%".
5955 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
5957         * xterm.c (x_draw_composite_glyph_string_foreground):
5958         * w32term.c (x_draw_composite_glyph_string_foreground):
5959         * term.c (encode_terminal_code):
5960         * composite.c (composition_update_it, get_composition_id):
5961         * xdisp.c (get_next_display_element)
5962         (fill_composite_glyph_string): Add comments about special meaning
5963         of TAB characters in a composition.
5965 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
5967         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
5968         This occurs when processing a multibyte format.
5969         Problem reported by Wolfgang Jenker.
5971 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
5973         * xdisp.c (try_cursor_movement): Only check for exact match if
5974         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
5976 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
5978         Remove unused external symbols.
5979         * dispextern.h (calc_pixel_width_or_height): Remove decl.
5980         * xdisp.c (calc_pixel_width_or_height): Now static.
5981         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
5982         * indent.c (check_display_width):
5983         * w32term.c: Fix comment to match code.
5984         * xterm.c, xterm.h (x_catching_errors): Remove.
5986 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
5988         * xselect.c: Use signed conversions more consistently (Bug#9498).
5989         (selection_data_to_lisp_data): Assume incoming selection data are
5990         signed integers, not unsigned.  This is to be consistent with
5991         outgoing selection data, which was modified to use signed integers
5992         in as part of the fix to Bug#9196 in response to Jan D.'s comment
5993         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
5994         expects long, not unsigned long.
5996 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
5998         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
5999         computation of loop end.  Reported by Johan Bockgård
6000         <bojohan@gnu.org>.
6002 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
6004         * frame.c (Fother_visible_frames_p): Function deleted.
6006 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
6008         * indent.c (compute_motion): Process display vector front to back
6009         rather than the other way around.  (Bug#2496)
6011 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
6013         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
6015 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
6017         * minibuf.c (Fread_from_minibuffer): Doc fix.
6019 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
6021         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
6022         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
6024 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
6026         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
6027         value for non-existent files.
6029 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
6031         * fileio.c (Finsert_file_contents): If the file cannot be opened,
6032         set its "size" to -1.  This will set the modtime_size field of
6033         the corresponding buffer to -1, which is what
6034         verify-visited-file-modtime expects for files that do not exist.
6035         (Bug#9139)
6037 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
6039         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
6040         here ...
6041         * lisp.h: ... from here.  push_key_description is no longer
6042         defined in keyboard.c, so its declaration should not be in
6043         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
6044         logically belongs with push_key_description.
6046 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
6048         * buffer.h: Include <sys/types.h> instead of <time.h>.
6049         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
6050         Problem reported by Herbert J. Skuhra.
6052 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
6054         * xml.c (parse_region): Make the parsing work for
6055         non-comment-starting XML files again (bug#9144).
6057 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
6059         * image.c (gif_load): Fix calculation of bottom and right corner.
6060         (Bug#9468)
6062 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
6064         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
6065         redisplay in small windows.
6067 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
6069         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
6071 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
6073         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
6074         Operate on live windows only.
6076 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
6078         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
6080 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
6082         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
6083         only under bidi iteration.
6085 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
6087         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
6089 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
6091         isnan: Fix porting problem to Solaris 10 with bundled gcc.
6092         Without this fix, the command to link temacs failed due to an
6093         undefined symbol __builtin_isnan.  This is because
6094         /usr/include/iso/math_c99.h #defines isnan(x) to
6095         __builtin_isnan(x), but the bundled gcc, which identifies itself
6096         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
6097         a __builtin_isnan.
6098         * floatfns.c (isnan): #undef, and then #define to a clone of
6099         what's in data.c.
6100         (Fisnan): Always define, since it's always available now.
6101         (syms_of_floatfns): Always define isnan at the Lisp level.
6103 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
6105         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
6107 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
6109         * fileio.c: Fix bugs with large file offsets (Bug#9428).
6110         The previous code assumed that file offsets (off_t values) fit in
6111         EMACS_INT variables, which is not true on typical 32-bit hosts.
6112         The code messed up by falsely reporting buffer overflow in cases
6113         such as (insert-file-contents "big" nil 1 2) into an empty buffer
6114         when "big" contains more than 2**29 bytes, even though this
6115         inserts just one byte and does not overflow the buffer.
6116         (Finsert_file_contents): Store file offsets as off_t
6117         values, not as EMACS_INT values.  Check for overflow when
6118         converting between EMACS_INT and off_t.  When checking for
6119         buffer overflow or for overlap, take the offsets into account.
6120         Don't use EMACS_INT for small values where int suffices.
6121         When checking for overlap, fix a typo: ZV was used where
6122         ZV_BYTE was intended.
6123         (Fwrite_region): Don't assume off_t fits into 'long'.
6124         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
6126 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
6128         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
6130 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
6132         sprintf-related integer and memory overflow issues (Bug#9412).
6134         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
6135         (esprintf, exprintf, evxprintf): New functions.
6136         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6137         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
6138         (modify_event_symbol): Do not assume that the length of
6139         name_alist_or_stem is safe to alloca and fits in int.
6140         (Fexecute_extended_command): Likewise for function name and binding.
6141         (Frecursion_depth): Wrap around reliably on integer overflow.
6142         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
6143         since some callers pass EMACS_INT values.
6144         (Fsingle_key_description): Don't crash if symbol name contains more
6145         than MAX_ALLOCA bytes.
6146         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
6147         (get_minibuffer): Arg is now EMACS_INT, not int.
6148         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
6149         (esprintf, exprintf, evxprintf): New decls.
6150         * window.h (command_loop_level, minibuf_level): Reflect API changes.
6152         * dbusbind.c (signature_cat): New function.
6153         (xd_signature, Fdbus_register_signal):
6154         Do not overrun buffer; instead, report string overflow.
6156         * dispnew.c (add_window_display_history): Don't overrun buffer.
6157         Truncate instead; this is OK since it's just a log.
6159         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
6160         even if the time zone offset is outlandishly large.
6161         Don't mishandle offset == INT_MIN.
6163         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
6164         when creating daemon; the previous buffer-overflow check was incorrect.
6166         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
6167         which has the guts of the old verror function.
6169         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
6170         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
6172         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
6173         (font_unparse_xlfd): Don't blindly alloca long strings.
6174         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
6175         fits in int, when using sprintf.  Use single snprintf to count
6176         length of string rather than counting it via multiple sprintfs;
6177         that's simpler and more reliable.
6178         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
6179         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
6180         sprintf, in case result does not fit in int.
6182         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
6183         (fontset_from_font): Print it.
6185         * frame.c (tty_frame_count): Now printmax_t, not int.
6186         (make_terminal_frame, set_term_frame_name): Print it.
6187         (x_report_frame_params): In X, window IDs are unsigned long,
6188         not signed long, so print them as unsigned.
6189         (validate_x_resource_name): Check for implausibly long names,
6190         and don't assume name length fits in 'int'.
6191         (x_get_resource_string): Don't blindly alloca invocation name;
6192         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
6193         not fit in int.
6195         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
6196         (xg_check_special_colors, xg_set_geometry):
6197         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
6199         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
6200         Use esprintf, not sprintf, in case result does not fit in int.
6202         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6203         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
6204         it as a large positive number.
6205         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
6206         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
6208         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
6209         in case result does not fit in int.
6211         * print.c (float_to_string): Detect width overflow more reliably.
6212         (print_object): Make sprintf buffer a bit bigger, to avoid potential
6213         buffer overrun.  Don't assume list length fits in 'int'.  Treat
6214         print length of 0 as 0, not as infinity; to be consistent with other
6215         uses of print length in this function.  Don't overflow print length
6216         index.  Don't assume hash table size fits in 'long', or that
6217         vectorlike size fits in 'unsigned long'.
6219         * process.c (make_process): Use printmax_t, not int, to format
6220         process-name gensyms.
6222         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
6224         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
6225         to avoid potential buffer overrun.
6227         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
6228         if X resource line is longer than 512 bytes.
6230         * xfns.c (x_window): Make sprintf buffer a bit bigger
6231         to avoid potential buffer overrun.
6233         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
6235         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
6237 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
6239         Integer overflow fixes for scrolling, etc.
6240         Without these, Emacs silently mishandles large integers sometimes.
6241         For example, "C-u 4294967297 M-x recenter" was treated as if
6242         it were "C-u 1 M-x recenter" on a typical 64-bit host.
6244         * xdisp.c (try_window_id): Check Emacs fixnum range before
6245         converting to 'int'.
6247         * window.c (window_scroll_line_based, Frecenter):
6248         Check that an Emacs fixnum is in range before assigning it to 'int'.
6249         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
6250         values converted from Emacs fixnums.
6251         (Frecenter): Don't wrap around a line count if it is out of 'int'
6252         range; instead, treat it as an extreme value.
6253         (Fset_window_configuration, compare_window_configurations):
6254         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
6256         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
6257         that can exceed INT_MAX.  Check that EMACS_INT value is in range
6258         before assigning it to the (possibly-narrower) index.
6259         (match_limit): Don't assume that a fixnum can fit in 'int'.
6261         * print.c (print_object): Use ptrdiff_t, not int, for index that can
6262         exceed INT_MAX.
6264         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
6265         (Fvertical_motion): Don't wrap around LINES values that don't fit
6266         in 'int'.  Instead, treat them as extreme values.  This is good
6267         enough for windows, which can't have more than INT_MAX lines anyway.
6269 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
6271         * Require libxml/parser.h to avoid compilation warning.
6273         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
6275         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
6276         since this reportedly can destroy thread storage.
6278 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
6280         * syntax.c (find_defun_start): Update all cache variables if
6281         exiting early (Bug#9401).
6283 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
6285         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
6287         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
6288         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
6289         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
6291         * term.c (tty_append_glyph): New function.
6292         (produce_stretch_glyph): Static function and its prototype deleted.
6294         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
6295         Add prototypes.
6297 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
6299         * image.c (parse_image_spec): Check for nonnegative, not for positive,
6300         when checking :margin (Bug#9390).
6301         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
6302         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
6303         so that the name doesn't mislead.  All uses changed.
6305 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
6307         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
6308         set_tty_hooks.
6310 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
6312         * xdisp.c (move_it_to): Don't bail out early when reaching
6313         position beyond to_charpos, if we are scanning backwards.
6314         (move_it_vertically_backward): When DY == 0, make sure we get to
6315         the first character in the line after the newline.
6317 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
6319         * ccl.c: Improve and simplify overflow checking (Bug#9196).
6320         (ccl_driver): Do not generate an out-of-range pointer.
6321         (Fccl_execute_on_string): Remove unnecessary check for
6322         integer overflow, noted by Stefan Monnier in
6323         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
6324         Remove a FIXME that didn't need fixing.
6325         Simplify the newly-introduced buffer reallocation code.
6327 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
6329         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
6331 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
6333         Integer and memory overflow issues (Bug#9196).
6335         * doc.c (get_doc_string): Rework so that
6336         get_doc_string_buffer_size is the actual buffer size, rather than
6337         being 1 less than the actual buffer size; this makes xpalloc more
6338         convenient.
6340         * image.c (x_allocate_bitmap_record, cache_image):
6341         * xselect.c (Fx_register_dnd_atom):
6342         Simplify previous changes by using xpalloc.
6344         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
6345         since either will do and ptrdiff_t is convenient with xpalloc.
6347         * charset.c (charset_table_size)
6348         (struct charset_sort_data.priority): Now ptrdiff_t.
6349         (charset_compare): Don't overflow if priorities differ greatly.
6350         (Fsort_charsets): Don't assume list length fits in int.
6351         Check for size-calculation overflow when allocating sort data.
6352         (syms_of_charset): Allocate an initial charset table that is
6353         just under 64 KiB, to avoid problems with glibc malloc and mmap.
6355         * cmds.c (internal_self_insert): Check for size-calculation overflow.
6357         * composite.h (struct composition.glyph_len): Now int, not unsigned.
6358         The actual value is always <= INT_MAX, and leaving it unsigned made
6359         overflow checking harder.
6361         * dispextern.h (struct glyph_matrix.rows_allocated)
6362         (struct face_cache.size): Now ptrdiff_t, for convenience in use
6363         with xpalloc.  The values are still always <= INT_MAX.
6365         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
6367         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
6368         (SAFE_NALLOCA): New macro.
6370         * region-cache.c (struct boundary.pos, find_cache_boundary)
6371         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
6372         (set_cache_region, invalidate_region_cache)
6373         (revalidate_region_cache, know_region_cache, region_cache_forward)
6374         (region_cache_backward, pp_cache):
6375         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
6376         so that ptrdiff_t * can be passed to xpalloc.
6377         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
6378         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
6379         (pp_cache): Don't assume cache_len fits in int.
6380         * region-cache.h: Adjust extern decls to match.
6382         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
6383         EMACS_INT, since either will do, for xpalloc.
6385         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
6386         (xnmalloc, xnrealloc, xpalloc): New functions.
6388         * bidi.c (bidi_shelve_header_size): New constant.
6389         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
6390         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
6392         * bidi.c (bidi_cache_shrink):
6393         * buffer.c (overlays_at, overlays_in, record_overlay_string)
6394         (overlay_strings):
6395         Don't update size of array until after memory allocation succeeds,
6396         because xmalloc/xrealloc may not return.
6397         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
6398         now that we have proper integer overflow checking.
6399         (record_overlay_string, overlay_strings): Catch overflows when
6400         calculating size of overlay_str_buf.
6402         * callproc.c (Fcall_process): Check for size overflow when
6403         calculating size of args2.
6404         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
6405         Normally we prefer signed values, but sticking with ptrdiff_t would
6406         require adding more-complicated checks.
6408         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
6409         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
6410         Redo buffer-overflow calculations to avoid integer overflow.
6411         Add a FIXME comment where memory seems to be over-allocated.
6413         * character.c (Fstring): Check for size-calculation overflow.
6415         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
6416         unnecessary integer overflow.  Check for size overflow.
6417         (encode_coding_object): Don't update size until xmalloc succeeds.
6419         * composite.c (get_composition_id): Check for overflow in glyph
6420         length calculations.
6422         Integer and memory overflow fixes for display code.
6423         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
6424         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
6425         (scrolling_window): Check for overflow in size calculations.
6426         (line_draw_cost, realloc_glyph_pool, add_row_entry):
6427         Don't assume glyph table len fits in int.
6428         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
6429         (row_table_size): Now ptrdiff_t, not int.
6430         (scrolling_window): Avoid overflow in size calculations.
6431         Don't update size until allocation succeeds.
6432         * fns.c (concat): Check for overflow in size calculations.
6433         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
6434         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6435         (NEXT_ALMOST_PRIME_LIMIT): New constant.
6437         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
6438         (get_doc_string): Check for size calculation overflow.
6439         Don't update size until allocation succeeds.
6440         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
6441         EMACS_INT, where ptrdiff_t will do.
6442         (Fsubstitute_command_keys): Check for string overflow.
6444         * editfns.c (set_time_zone_rule): Don't assume environment length
6445         fits in int.
6446         (message_length): Now ptrdiff_t, not int.
6447         (Fmessage_box): Don't update size until allocation succeeds.
6448         Don't assume message length fits in int.
6449         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
6451         * emacs.c (main): Do not reallocate argv, since there is a null at
6452         the end that can be overwritten, and this way there's no need to
6453         worry about size-calculation overflow.
6454         (sort_args): Check for size-calculation overflow.
6456         * eval.c (init_eval_once, grow_specpdl): Don't update size until
6457         alloc succeeds.
6458         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
6460         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
6461         (x_set_scroll_bar_width, x_figure_window_size):
6462         Check for integer overflow.
6463         (x_set_alpha): Do not assume XINT fits in int.
6465         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
6466         This is for the members text_lines, text_cols, total_lines, total_cols,
6467         where the system imposes an 'int' limit.
6469         * fringe.c (Fdefine_fringe_bitmap):
6470         Don't update size until alloc works.
6472         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
6473         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
6475         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
6476         Check for size-calculation overflow.
6477         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
6478         do, as we prefer signed integers.
6479         (id_to_widget.max_size, id_to_widget.used)
6480         (xg_store_widget_in_map, xg_remove_widget_from_map)
6481         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
6482         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
6483         Use and return ptrdiff_t, not int.
6484         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
6485         * gtkutil.h: Change prototypes to match the above.
6487         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
6488         are duplicate now that they've been promoted to lisp.h.
6489         (x_allocate_bitmap_record, x_alloc_image_color)
6490         (make_image_cache, cache_image, xpm_load):
6491         Don't update size until alloc is done.
6492         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
6493         (x_detect_edges):
6494         Check for size calculation overflow.
6495         (ct_colors_allocated_max): New constant.
6496         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
6497         overflow.
6499         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
6500         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
6501         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
6502         Use ptrdiff_t, not int, to count maps.
6503         (read_char_minibuf_menu_prompt): Check for overflow in size
6504         calculations.  Don't update size until allocation succeeds.
6505         Redo calculations to avoid overflow.
6506         * keyboard.h: Change prototypes to match the above.
6508         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
6509         to count maps.
6510         (current_minor_maps): Check for size calculation overflow.
6511         * keymap.h: Change prototypes to match the above.
6513         * lread.c (read1, init_obarray): Don't update size until alloc done.
6515         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
6516         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
6518         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
6519         Now ptrdiff_t, not int.
6520         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
6521         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
6523         * process.c (Fnetwork_interface_list): Check for overflow
6524         in size calculation.
6526         * region-cache.c (move_cache_gap): Check for size calculation overflow.
6528         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
6529         overflow.  Don't bother calling xmalloc when xrealloc will do.
6531         * search.c (Freplace_match): Check for size calculation overflow.
6532         (Fset_match_data): Don't assume list lengths fit in 'int'.
6534         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
6535         for command line length.  Do not attempt to address one before the
6536         beginning of an array, as that's not portable.
6538         * term.c (max_frame_lines): Remove; unused.
6539         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
6540         not int.
6541         (encode_terminal_code, calculate_costs): Check for size
6542         calculation overflow.
6543         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
6544         table lengths and related sizes.  Don't update size until alloc
6545         done.  Redo calculations to avoid overflow.
6546         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
6548         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
6549         subtracting pointers.
6550         (gobble_line): Check for overflow more carefully.  Don't update size
6551         until alloc done.
6553         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
6554         Don't update size until alloc done.
6555         Redo size calculations to avoid overflow.
6556         Check for size calculation overflow.
6557         (main) [DEBUG]: Fix typo in invoking tparam1.
6559         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
6560         Use ptrdiff_t, not int, for sizes.
6561         (store_mode_line_noprop_char): Don't update size until alloc done.
6563         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
6564         Use ptrdiff_t, not int, for sizes.
6565         (Finternal_make_lisp_face, cache_face):
6566         Check for size calculation overflow.
6567         (cache_face): Treat size calculation overflows as if they were
6568         memory exhaustion (the usual treatment), rather than aborting.
6570         * xfns.c (x_encode_text, x_set_name_internal)
6571         (Fx_change_window_property): Use ptrdiff_t, not int, to count
6572         sizes, since they can exceed INT_MAX in size.  Check for size
6573         calculation overflow.
6575         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
6576         (xg_select): Check for size calculation overflow.
6577         Don't update size until alloc done.
6579         * xrdb.c (get_environ_db): Don't assume path length fits in int,
6580         as sprintf is limited to int lengths.
6582         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
6583         (X_LONG_MIN): New macros.
6584         Use them to make the following changes clearer.
6585         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
6586         This change doesn't affect the value now, but it may help remind
6587         future maintainers not to raise the value too much later.
6588         (SELECTION_QUANTUM): Remove, replacing with ...
6589         (selection_quantum): ... new function, which avoids overflow.
6590         All uses changed.
6591         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
6592         assumption that selection length fits in 'int'.
6593         (x_reply_selection_request, x_handle_selection_request)
6594         (x_get_window_property, receive_incremental_selection)
6595         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
6596         (lisp_data_to_selection_data, clean_local_selection_data):
6597         Use ptrdiff_t, not int, to record length of selection.
6598         (x_reply_selection_request, x_get_window_property)
6599         (receive_incremental_selection, x_property_data_to_lisp):
6600         Redo calculations to avoid overflow.
6601         (x_reply_selection_request): When sending hint, ceiling it at
6602         X_LONG_MAX rather than relying on wraparound overflow to send
6603         something.
6604         (x_get_window_property, receive_incremental_selection)
6605         (lisp_data_to_selection_data, x_property_data_to_lisp):
6606         Check for size-calculation overflow.
6607         (x_get_window_property, receive_incremental_selection)
6608         (lisp_data_to_selection_data, Fx_register_dnd_atom):
6609         Don't store size until memory allocation succeeds.
6610         (x_get_window_property): Plug memory leak on memory exhaustion.
6611         Don't double-block input; malloc is safe here.  Don't assume 2**34
6612         - 4 fits in unsigned long.  Add an xassert to check
6613         XGetWindowProperty overflow.  Be more careful about overflow
6614         calculations, and distinguish size from memory overflow better.
6615         (receive_incremental_selection): When tracing, don't assume
6616         unsigned int is less than INT_MAX.
6617         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
6618         harmful) conversions of unsigned short to int.
6619         (lisp_data_to_selection_data): Don't assume that integers
6620         in the range -65535 through -1 fit in an X unsigned short.
6621         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
6622         result parameters unless successful.  Rely on cons_to_unsigned
6623         to report problems with elements; the old code wasn't right anyway.
6624         (x_check_property_data): Check for int overflow; we cannot use
6625         a wider type due to X limits.
6626         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
6628         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
6630         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
6631         (x_term_init): Check for size calculation overflow.
6632         (x_color_cells): Don't store size until memory allocation succeeds.
6633         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
6634         Don't assume alloca size is less than MAX_ALLOCA.
6635         (x_term_init): Don't assume length fits in int (sprintf is limited
6636         to int size).
6638         Use ptrdiff_t for composition IDs.
6639         * character.c (lisp_string_width):
6640         * composite.c (composition_table_size, n_compositions)
6641         (get_composition_id, composition_gstring_from_id):
6642         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
6643         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
6644         * window.c (Frecenter):
6645         Use ptrdiff_t, not int, for composition IDs.
6646         * composite.c (get_composition_id): Check for integer overflow.
6647         * composite.h: Adjust prototypes to match the above changes.
6649         Use ptrdiff_t for hash table indexes.
6650         * category.c (hash_get_category_set):
6651         * ccl.c (ccl_driver):
6652         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
6653         * coding.c (coding_system_charset_list, detect_coding_system):
6654         * coding.h (struct coding_system.id):
6655         * composite.c (get_composition_id, gstring_lookup_cache):
6656         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
6657         * image.c (xpm_get_color_table_h):
6658         * lisp.h (hash_lookup, hash_put):
6659         * minibuf.c (Ftest_completion):
6660         Use ptrdiff_t for hash table indexes, not int (which is too
6661         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
6662         32-bit --with-wide-int hosts).
6664         * charset.c (Fdefine_charset_internal): Check for integer overflow.
6665         Add a FIXME comment about memory leaks.
6666         (syms_of_charset): Don't assume xmalloc returns.
6668         Don't assume that stated character widths fit in int.
6669         * character.c (Fchar_width, c_string_width, lisp_string_width):
6670         * character.h (CHAR_WIDTH):
6671         * indent.c (MULTIBYTE_BYTES_WIDTH):
6672         Use sanitize_char_width to avoid undefined and/or bad behavior
6673         with outlandish widths.
6674         * character.h (sanitize_tab_width): Rename from sanitize_width,
6675         now that we have two such functions.  All uses changed.
6676         (sanitize_char_width): New inline function.
6678         Don't assume that tab-width fits in int.
6679         * character.h (sanitize_width): New inline function.
6680         (SANE_TAB_WIDTH): New macro.
6681         (ASCII_CHAR_WIDTH): Use it.
6682         * indent.c (sane_tab_width): Remove.  All uses replaced by
6683         SANE_TAB_WIDTH (current_buffer).
6684         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
6686         * fileio.c: Integer overflow issues with file modes.
6687         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
6689         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
6690         Remove unreachable code.
6691         (read_hex, load_charset_map_from_file): Check for integer overflow.
6693         * xterm.c: Don't go over XClientMessageEvent limit.
6694         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
6695         (x_send_scroll_bar_event): Likewise.  Check that the size does not
6696         exceed limits imposed by XClientMessageEvent, as well as the usual
6697         ptrdiff_t and size_t limits.
6699         * keyboard.c: Overflow, signedness and related fixes.
6700         (make_lispy_movement): Use same integer type in forward decl
6701         that is used in the definition.
6702         (read_key_sequence, keyremap_step):
6703         Change bufsize argument back to int, undoing my 2011-03-30 change.
6704         We prefer signed types, and int is wide enough here.
6705         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
6706         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
6707         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
6708         length, not size_t.  Use ptrdiff_t for index, not int.
6709         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
6710         possibility of integer overflow.
6712         Overflow, signedness and related fixes for images.
6714         * dispextern.h (struct it.stack[0].u.image.image_id)
6715         (struct_it.image_id, struct image.id, struct image_cache.size)
6716         (struct image_cache.used, struct image_cache.ref_count):
6717         * gtkutil.c (update_frame_tool_bar):
6718         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
6719         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
6720         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
6721         * nsmenu.m (update_frame_tool_bar):
6722         * xdisp.c (calc_pixel_width_or_height):
6723         * xfns.c (image_cache_refcount):
6724         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
6725         on typical 64-bit hosts.
6727         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
6728         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
6729         Omit unnecessary casts to int.
6730         (parse_image_spec): Check that integers fall into 'int' range
6731         when the callers expect that.
6732         (image_ascent): Redo ascent calculation to avoid int overflow.
6733         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
6734         (lookup_image): Remove unnecessary tests.
6735         (xbm_image_p): Locals are now of int, not EMACS_INT,
6736         since parse_image_check makes sure they fit into int.
6737         (png_load, gif_load, svg_load_image):
6738         Prefer int to unsigned where either will do.
6739         (tiff_handler): New function, combining the cores of the
6740         old tiff_error_handler and tiff_warning_handler.
6741         This function is rewritten to use vsnprintf and thereby avoid
6742         stack buffer overflows.  It uses only the features of vsnprintf
6743         that are common to both POSIX and native Microsoft.
6744         (tiff_error_handler, tiff_warning_handler): Use it.
6745         (tiff_load, gif_load, imagemagick_load_image):
6746         Don't assume :index value fits in 'int'.
6747         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
6748         (imagemagick_load_image): Check that crop parameters fit into
6749         the integer types that MagickCropImage accepts.  Don't assume
6750         Vimagemagick_render_type has a nonnegative value.  Don't assume
6751         size_t fits in 'long'.
6752         (gs_load): Use printmax_t to print the widest integers possible.
6753         Check for integer overflow when computing image height and width.
6755 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
6757         * xdisp.c (redisplay_window): Don't force window start if point
6758         will be invisible in the resulting window.  (Bug#9324)
6760 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
6762         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
6763         the display spec is of the form `(space ...)'.
6764         (handle_display_spec): Return the value returned by
6765         handle_single_display_spec, not just 1 or zero.
6766         (handle_single_display_spec): If the display spec is of the form
6767         `(space ...)', and specifies display in the text area, return 2
6768         rather than 1.
6769         (try_cursor_movement): Check for the need to scroll more
6770         accurately, and prefer exact match for point under bidi.
6771         Don't advance `row' beyond the last row of the window.
6773         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
6774         into disp_prop; all users changed.
6776         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
6777         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
6778         for the text covered by the display property.
6780 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
6782         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
6783         Change return value to nil.
6784         (Frecord_buffer): Delete unused function.
6786 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
6788         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
6789         buffers, return left-to-right.
6790         (set_cursor_from_row): Consider candidate row a win if its glyph
6791         represents a newline and point is on that newline.  Fixes cursor
6792         positioning on the newline at EOL of R2L text within L2R
6793         paragraph, and vice versa.
6794         (try_cursor_movement): Check continued rows, in addition to
6795         continuation rows.  Fixes unwarranted scroll when point enters a
6796         continued line of R2L text within an L2R paragraph, or vice versa.
6797         (cursor_row_p): Consider the case of point being equal to
6798         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
6799         from the end of a short line to the beginning of a continued line
6800         of R2L text within L2R paragraph.
6801         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
6802         composed characters.
6804         * bidi.c (bidi_check_type): Use xassert.
6805         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
6806         members.
6808 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
6810         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
6811         a character.
6813 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
6815         * nsfont.m (ns_otf_to_script): Fix typo.
6817 2011-08-22  Kenichi Handa  <handa@m17n.org>
6819         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
6820         extra slot even if the purpose is char-code-property-table.
6822 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
6824         * xdisp.c (redisplay_window): When computing centering_position,
6825         account for the height of the header line.  (Bug#8874)
6827         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
6828         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
6829         candidate is selected by the mouse, and that candidate has a
6830         composed character under the mouse.
6832         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
6833         coordinates reported by pos-visible-in-window-p for a composed
6834         character in column zero.
6836 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
6838         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
6840 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
6842         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
6843         consider it a hit if to_charpos is anywhere in the range of the
6844         composed buffer positions.
6846 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
6848         * image.c (gif_load): Don't assume that each subimage has the same
6849         dimensions as the base image.  Handle disposal method that is
6850         "undefined" by the gif spec (Bug#9335).
6852 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
6854         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
6855         (Fcondition_case): Document `debug' symbol in error handler.
6857 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
6859         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
6860         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
6861         from an Org mode buffer to a Speedbar frame.
6863         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
6864         a composition, take its buffer position from IT->cmp_it.charpos.
6865         Fixes cursor positioning at the beginning of a line that begins
6866         with a composed character.
6868 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
6870         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
6871         character bidirectional type, use STRONG_L instead.  Fixes crashes
6872         in a buffer produced by `describe-categories'.
6874         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
6875         members before the level stack, so they would be saved and
6876         restored when copying iterator state.  Fixes incorrect reordering
6877         around TABs covered by display properties.
6879 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
6881         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
6883 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
6885         * eval.c (internal_condition_case, internal_condition_case_1)
6886         (internal_condition_case_2, internal_condition_case_n):
6887         Remove unnecessary aborts (Bug#9081).
6889 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
6891         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
6892         has no `load' handler, try opening the file locally.  (Bug#9311)
6894 2011-08-16  Ken Brown  <kbrown@cornell.edu>
6896         * gmalloc.c: Expand comment.
6898 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
6900         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
6901         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
6903 2011-08-16  Ken Brown  <kbrown@cornell.edu>
6905         Fix memory allocation problems in Cygwin build (Bug#9273).
6907         * unexcw.c ( __malloc_initialized): Declare external variable.
6908         (fixup_executable): Force the dumped emacs to reinitialize malloc.
6910         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
6911         New variables.
6912         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
6913         dumped emacs.
6914         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
6915         in the static heap.
6916         [CYGWIN] (special_realloc): New function.
6917         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
6918         requests to realloc storage in the static heap.
6920 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
6922         * bidi.c (bidi_initialize): Remove unused local.
6924 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
6926         * bidimirror.h:
6927         * biditype.h: Remove file.
6928         * makefile.w32-in ($(BLD)/bidi.$(O)):
6929         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
6931         * dispextern.h: Fix a typo in the comment to bidi_type_t.
6933         * chartab.c: Improve commentary for the uniprop_table API.
6935         * bidi.c (bidi_paragraph_init): Support zero value of
6936         bidi_ignore_explicit_marks_for_paragraph_level.
6937         (bidi_initialize): Use uniprop_table instead of including
6938         biditype.h and bidimirror.h.
6940         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
6941         coordinates of the iterator when restoring from ppos_it.
6942         (Bug#9296)
6944 2011-08-14  Kenichi Handa  <handa@m17n.org>
6946         * process.c (create_process): Call setup_process_coding_systems
6947         after the pid of the process is set to -1 (Bug#8162).
6949 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
6951         * xdisp.c (move_it_in_display_line_to): Don't invoke
6952         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
6953         ppos_it.  Fixes vertical cursor motion when line beginning is
6954         covered by an image.  (Bug#9296)
6956 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
6958         * nsterm.h (ns_run_ascript): Declare.
6959         (NSAPP_DATA2_RUNASSCRIPT): Define.
6961         * nsfns.m (as_script, as_result, as_status): New static variables.
6962         (ns_run_ascript): New function.
6963         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
6964         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
6965         the event loop.  Get status from as_status (Bug#7276).
6967         * nsterm.m (sendEvent): If event is NSApplicationDefined and
6968         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
6969         the event loop (Bug#7276).
6971 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
6973         * gnutls.c (QCgnutls_bootprop_priority)
6974         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
6975         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
6976         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
6977         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
6978         (QCgnutls_bootprop_verify_hostname_error)
6979         (QCgnutls_bootprop_callbacks_verify): Rename from
6980         Qgnutls_bootprop_..., all uses changed.
6982         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
6983         uses changed.
6985 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
6987         * xfaces.c (Qframe_set_background_mode): Now static.
6988         * dispextern.h (Qframe_set_background_mode): Remove decl.
6990         * process.c (Fnetwork_interface_info): Declare local only if needed.
6992 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
6994         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
6995         (Fnetwork_interface_list): Allocate in increments of bytes instead
6996         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
6997         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
6998         sockaddr.
6999         (struct ifflag_def): notrailers is smart on OSX.
7000         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
7001         Get hardware address with getifaddrs if available.
7003 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
7005         * xdisp.c (iterate_out_of_display_property): xassert that
7006         IT->position is set to within IT->object's boundaries.  Break from
7007         the loop as soon as EOB is reached; avoids infloops in redisplay
7008         when IT->position is set up wrongly due to some bug.
7009         Set IT->current to match the bidi iterator unconditionally.
7010         (push_display_prop): Allow GET_FROM_STRING as IT->method on
7011         entry.  Force push_it to save on the stack the current
7012         buffer/string position, to be restored by pop_it.  Fix flags in
7013         the iterator structure wrt the object coming from a display
7014         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
7015         properties.  (Bug#9284)
7017 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
7019         * fontset.c (fontset_get_font_group): Add proper type checks.
7020         (Bug#9172)
7022 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
7024         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
7025         and LC_VERSION_MIN_MACOSX.
7026         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
7027         (dump_it) [LC_FUNCTION_STARTS]: Use it.
7029 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
7031         * xdisp.c (forward_to_next_line_start): Allow to use the
7032         no-display-properties-and-no-overlays under bidi display.
7033         Set disp_pos in the bidi iterator to avoid searches for display
7034         properties and overlays.
7036 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
7038         * editfns.c (Fset_time_zone_rule): Document relationship with the
7039         setenv function.
7041         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
7042         the font entity extracted from the cache (Bug#8109).
7044 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
7046         * composite.c (autocmp_chars): Don't reset point.  That is done by
7047         restore_point_unwind (Bug#5984).
7049 2011-08-07  Juri Linkov  <juri@jurta.org>
7051         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
7052         to show the arg `TIME' instead of `TIMEVAL'.
7054 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
7056         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
7057         display property strides EOL and includes a newline, as in
7058         longlines-mode.  (Bug#9254)
7059         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
7060         word-wrap under bidirectional display.  (Bug#9224)
7062         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
7063         is non-zero, even if the data buffer is NULL.  Fixes a crash in
7064         vertical-motion with longlines-mode.  (Bug#9254)
7066 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
7068         * bidi.c <bidi_cache_total_alloc>: Now static.
7069         (bidi_initialize): Initialize bidi_cache_total_alloc.
7071         * xdisp.c (display_line): Release buffer allocated for shelved bidi
7072         cache.  (Bug#9221)
7074         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
7075         amount allocated this far in `bidi_cache_total_alloc'.
7076         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
7077         non-zero, only free the data buffer without restoring the cache
7078         contents.  All callers changed.
7080         * dispextern.h (bidi_unshelve_cache): Update prototype.
7082         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
7083         (move_it_in_display_line, move_it_to)
7084         (move_it_vertically_backward, move_it_by_lines): Replace the call
7085         to xfree to an equivalent call to bidi_unshelve_cache.
7086         (move_it_in_display_line_to): Fix logic of returning
7087         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
7089 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
7091         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
7092         came from a string character with a `cursor' property.  (Bug#9229)
7094 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
7096         * Makefile.in (LIB_PTHREAD): New variable.
7097         (LIBES): Add LIB_PTHREAD (Bug#9216).
7099         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
7100         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
7102 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
7104         * regex.c (re_iswctype): Remove some redundant boolean conversions.
7106 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
7108         * xterm.c (x_find_topmost_parent): New function.
7109         (x_set_frame_alpha): Find topmost parent window with
7110         x_find_topmost_parent and set the property there also (bug#9181).
7111         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
7113 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
7115         * callproc.c (Fcall_process): Avoid vfork clobbering
7116         the local vars buffer, coding_systems, current_dir.
7118 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
7120         * keymap.c (Fmake_composed_keymap): Move to subr.el.
7122 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
7124         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
7125         so that it is not optimized away.
7127         * xdisp.c (compute_display_string_pos): Remove unused local.
7129 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
7131         Fix slow cursor motion and scrolling in large buffers with
7132         selective display, like Org Mode buffers.  (Bug#9218)
7134         * dispextern.h (struct bidi_it): New member disp_prop_p.
7136         * xdisp.c: Remove one-slot cache of display string positions.
7137         (compute_display_string_pos): Accept an additional argument
7138         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
7139         for a display string or property.  If found, set DISP_PROP_P
7140         non-zero.
7142         * bidi.c (bidi_fetch_char): Accept an additional argument
7143         DISP_PROP_P, and pass it to compute_display_string_pos.
7144         Only handle text covered by a display string if DISP_PROP_P is returned
7145         non-zero.  All callers of bidi_fetch_char changed.
7147 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
7149         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
7151 2010-12-03  Don March  <don@ohspite.net>
7153         * keymap.c (Fdefine_key): Fix non-prefix key error message when
7154         last character M-[char] is translated to ESC [char] (bug#7541).
7156 2011-08-02  Kenichi Handa  <handa@m17n.org>
7158         * lisp.h (uniprop_table): Extern it.
7160         * chartab.c (uniprop_table): Make it non-static.
7162 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
7164         * xdisp.c (forward_to_next_line_start): Accept additional argument
7165         BIDI_IT_PREV, and store into it the state of the bidi iterator had
7166         on the newline.
7167         (reseat_at_next_visible_line_start): Use the bidi iterator state
7168         returned by forward_to_next_line_start to restore the state of
7169         it->bidi_it after backing up to previous newline.  (Bug#9212)
7171 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
7173         * regex.c (re_comp): Protoize.
7174         (re_exec): Fix return type.
7175         (regexec): Fix type of `ret'.  (Bug#9203)
7177 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
7179         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
7180         This is needed if max-image-size is a floating-point number.
7182 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
7184         * print.c (print_object): Print empty symbol as ##.
7186         * lread.c (read1): Read ## as empty symbol.
7188 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
7190         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
7191         setting frame foreground color (Bug#9175).
7192         (x_set_background_color): Likewise.
7194         * nsmenu.m (-setText): Size tooltip dimensions precisely to
7195         contents (Bug#9176).
7196         (EmacsTooltip -init): Remove bezels and add shadows to
7197         tooltip windows.
7199         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
7200         or scroll bar (Bug#8470).
7202         * nsfont.m (nsfont_open): Remove assignment to voffset and
7203         unnecessary vars hshink, expand, hd, full_height, min_height.
7204         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
7206         * nsterm.h (nsfont_info): Remove voffset field.
7208 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
7210         Implement strike-through and overline on NextStep (Bug#8863).
7212         * nsfont.m (nsfont_open): Use underline position provided by font,
7213         instead of hard-coded value of 2.
7214         (nsfont_draw): Call ns_draw_text_decoration instead.
7216         * nsterm.h: Add declaration for ns_draw_text_decoration.
7218         * nsterm.m (ns_draw_text_decoration): New function for drawing
7219         underline, overline, and strike-through.
7220         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
7221         ns_draw_text_decoration.  Change treatment of cursor drawing to
7222         accommodate underlining, etc.
7224 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
7226         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
7227         default.
7229 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
7231         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
7232         Without this fix, if a signal arrives just after memory fills up,
7233         'malloc' might be invoked reentrantly.
7235         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
7236         In other words, assume that every image size is allowed, on non-X
7237         hosts.  This assumption is probably wrong, but it lets Emacs compile.
7239 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
7241         * regex.c (re_iswctype): Convert return values to boolean.
7243 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
7245         * xdisp.c (compute_display_string_pos): Don't use cached display
7246         string position if the buffer had its restriction changed.
7247         (Bug#9184)
7249 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
7251         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
7253 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
7255         Integer signedness and overflow and related fixes.  (Bug#9079)
7257         * bidi.c: Integer size and overflow fixes.
7258         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
7259         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
7260         (bidi_cache_find_level_change, bidi_cache_ensure_space)
7261         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
7262         (bidi_find_other_level_edge):
7263         Use ptrdiff_t instead of EMACS_INT where either will do.
7264         This works better on 32-bit hosts configured --with-wide-int.
7265         (bidi_cache_ensure_space): Check for size-calculation overflow.
7266         Use % rather than repeated addition, for better worst-case speed.
7267         Don't set bidi_cache_size until after xrealloc returns, because it
7268         might not return.
7269         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
7270         (bidi_cache_ensure_space): Also check that the bidi cache size
7271         does not exceed that of the largest Lisp string or buffer.  See Eli
7272         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
7274         * alloc.c (__malloc_size_t): Remove.
7275         All uses replaced by size_t.  See Andreas Schwab's note
7276         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
7278         * image.c: Improve checking for integer overflow.
7279         (check_image_size): Assume that f is nonnull, since
7280         it is always nonnull in practice.  This is one less thing to
7281         worry about when checking for integer overflow later.
7282         (x_check_image_size): New function, which checks for integer
7283         overflow issues inside X.
7284         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
7285         This removes the need for a memory_full check.
7286         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
7287         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
7288         (xbm_read_bitmap_data): Change locals back to 'int', since
7289         their values must fit in 'int'.
7290         (xpm_load_image, png_load, tiff_load):
7291         Invoke x_create_x_image_and_pixmap earlier,
7292         to avoid much needless work if the image is too large.
7293         (tiff_load): Treat overly large images as if
7294         x_create_x_image_and_pixmap failed, not as malloc failures.
7295         (gs_load): Use x_check_image_size.
7297         * gtkutil.c: Omit integer casts.
7298         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
7299         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
7301         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
7303         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
7304         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
7305         would wrongly return t on a 64-bit host.
7307         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
7308         The plain *_OVERFLOW macros run afoul of GCC bug 49705
7309         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
7310         and therefore cause GCC to emit a bogus diagnostic in some cases.
7312         * image.c: Integer signedness and overflow and related fixes.
7313         This is not an exhaustive set of fixes, but it's time to
7314         record what I've got.
7315         (lookup_pixel_color, check_image_size): Remove redundant decls.
7316         (check_image_size): Don't assume that arbitrary EMACS_INT values
7317         fit in 'int', or that arbitrary 'double' values fit in 'int'.
7318         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
7319         (tiff_load, imagemagick_load_image):
7320         Check for overflow in size calculations.
7321         (x_create_x_image_and_pixmap): Remove unnecessary test for
7322         xmalloc returning NULL; that can't happen.
7323         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
7324         (xpm_color_bucket): Use better integer hashing function.
7325         (xpm_cache_color): Don't possibly over-allocate memory.
7326         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
7327         (gif_memory_source):
7328         Use ptrdiff_t, not int or size_t, to record sizes.
7329         (png_load): Don't assume values greater than 2**31 fit in 'int'.
7330         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
7331         either works, as we prefer signed integers.
7332         (tiff_read_from_memory, tiff_write_from_memory):
7333         Return tsize_t, not size_t, since that's what the TIFF API wants.
7334         (tiff_read_from_memory): Don't fail simply because the read would
7335         go past EOF; instead, return a short read.
7336         (tiff_load): Omit no-longer-needed casts.
7337         (Fimagemagick_types): Don't assume size fits into 'int'.
7339         Improve hashing quality when configured --with-wide-int.
7340         * fns.c (hash_string): New function, taken from sxhash_string.
7341         Do not discard information about ASCII character case; this
7342         discarding is no longer needed.
7343         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
7344         * lisp.h: Declare it.
7345         * lread.c (hash_string): Remove, since we now use fns.c's version.
7346         The fns.c version returns a wider integer if --with-wide-int is
7347         specified, so this should help the quality of the hashing a bit.
7349         * emacs.c: Integer overflow minor fix.
7350         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
7351         Define only if GNU_LINUX.
7352         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
7354         * dispnew.c: Integer signedness and overflow fixes.
7355         Remove unnecessary forward decls, that were a maintenance hassle.
7356         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
7357         All uses changed.
7358         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
7359         (scrolling_window): Use ptrdiff_t, not int, for byte count.
7360         (prepare_desired_row, line_draw_cost):
7361         Use int, not unsigned, where either works.
7362         (save_current_matrix, restore_current_matrix):
7363         Use ptrdiff_t, not size_t, where either works.
7364         (init_display): Check for overflow more accurately, and without
7365         relying on undefined behavior.
7367         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
7368         Remove, replacing with the new symbols in lisp.h.  All uses changed.
7369         * fileio.c (make_temp_name):
7370         * filelock.c (lock_file_1, lock_file):
7371         * xdisp.c (message_dolog):
7372         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
7373         Use pMd etc. instead.
7374         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
7375         replacing the pWIDE etc. symbols removed from editfns.c.
7377         * keyboard.h (num_input_events): Now uintmax_t.
7378         This is (very slightly) less likely to mess up due to wraparound.
7379         All uses changed.
7381         * buffer.c: Integer signedness fixes.
7382         (alloc_buffer_text, enlarge_buffer_text):
7383         Use ptrdiff_t rather than size_t when either will do, as we prefer
7384         signed integers.
7386         * alloc.c: Integer signedness and overflow fixes.
7387         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
7388         (__malloc_size_t): Default to size_t, not to int.
7389         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
7390         (Fgarbage_collect, mark_object_loop_halt, mark_object):
7391         Prefer ptrdiff_t to size_t when either would do, as we prefer
7392         signed integers.
7393         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
7394         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
7395         Now const.  Initialize with values that are in range even if char
7396         is signed.
7397         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
7398         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
7399         These functions do the right thing with sizes > 2**32.
7400         (check_depth): Now ptrdiff_t, not int.
7401         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
7402         Adjust to new way of storing sizes.  Check for size overflow bugs
7403         in rest of code.
7404         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
7405         slightly wrong anyway, as it missed one instance of
7406         XMALLOC_OVERRUN_CHECK_OVERHEAD.
7407         (refill_memory_reserve): Omit needless cast to size_t.
7408         (mark_object_loop_halt): Mark as externally visible.
7410         * xselect.c: Integer signedness and overflow fixes.
7411         (Fx_register_dnd_atom, x_handle_dnd_message):
7412         Use ptrdiff_t, not size_t, since we prefer signed.
7413         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
7414         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
7415         x_dnd_atoms_size and x_dnd_atoms_length.
7417         * doprnt.c: Prefer signed to unsigned when either works.
7418         * eval.c (verror):
7419         * doprnt.c (doprnt):
7420         * lisp.h (doprnt):
7421         * xdisp.c (vmessage):
7422         Use ptrdiff_t, not size_t, when using or implementing doprnt,
7423         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
7424         prefer signed arithmetic to avoid comparison confusion.
7425         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
7426         but is a bit tricky.
7428         Assume freestanding C89 headers, string.h, stdlib.h.
7429         * data.c, doprnt.c, floatfns.c, print.c:
7430         Include float.h unconditionally.
7431         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
7432         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
7433         * regex.c: Likewise for stddef.h, string.h.
7434         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
7435         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
7436         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
7437         (STDC_HEADERS): Remove obsolete defines.
7438         * sysdep.c: Include limits.h unconditionally.
7440         Assume support for memcmp, memcpy, memmove, memset.
7441         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
7442         * regex.c (memcmp, memcpy):
7443         Remove; we assume C89 now.
7445         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
7446         (__malloc_safe_bcopy): Remove; no longer needed.
7448         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
7449         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
7450         well either way, and we prefer signed to unsigned.
7452 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7454         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
7455         closes the connection while we're reading (bug#9182).
7457 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
7459         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
7460         are specified (Bug#9168).
7462 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
7464         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
7465         Found by GCC static checking and --with-wide-int on a 32-bit host.
7467 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
7469         * xdisp.c (compute_display_string_pos): Fix logic of caching
7470         previous display string position.  Initialize cached_prev_pos to
7471         -1.  Fixes slow-down at the beginning of a buffer.
7473 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
7475         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
7476         for attrs[LFACE_FONTSET_INDEX].
7478 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
7480         * xml.c (parse_region): Remove unused local
7481         that was recently introduced.
7483 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
7485         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
7486         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
7488         * xdisp.c (move_it_in_display_line_to): Record the best matching
7489         position for TO_CHARPOS while scanning the line, and restore it on
7490         exit if none of the characters scanned was an exact match.
7491         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
7492         when exact match is impossible due to invisible text, and the
7493         lines are truncated.
7495 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
7497         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
7498         for OSX >= 10.7.
7500 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
7502         Fix a significant slow-down of cursor motion with C-n, C-p,
7503         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
7504         auto-repeat under bidi redisplay in fontified buffers.
7505         * xdisp.c (compute_stop_pos_backwards): New function.
7506         (next_element_from_buffer): Call compute_stop_pos_backwards to
7507         find a suitable prev_stop when we find ourselves before
7508         base_level_stop.
7509         (reseat): Don't look for prev_stop, as that could mean a very long
7510         run.
7511         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
7512         <cached_disp_overlay_modiff>: Cache for last found display string
7513         position.
7514         (compute_display_string_pos): Return the cached position if asked
7515         about the same buffer in the same area of character positions, and
7516         the buffer wasn't changed since the time the display string
7517         position was cached.
7519 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
7521         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
7522         is an integer, which is important for empty lines.  (Bug#9149)
7524 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
7526         * frame.c (Fmodify_frame_parameters): In tty case, update the
7527         default face if necessary (Bug#4238).
7529 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
7531         * editfns.c (Fstring_to_char): No need to explain what a character
7532         is in the docstring (Bug#6576).
7534 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7536         * xml.c (parse_region): Make sure we always return a tree.
7538 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
7540         * xml.c (parse_region): If a document contains only comments,
7541         return that, too.
7543 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7545         * xml.c (make_dom): Return comments, too.
7547 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
7549         Port to OpenBSD.
7550         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
7551         and the surrounding thread.
7552         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
7553         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
7554         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
7555         timer goes off.
7556         * s/openbsd.h (BROKEN_SIGIO): Define.
7557         * unexelf.c (unexec) [__OpenBSD__]:
7558         Don't update the .mdebug section of the Alpha COFF symbol table.
7560 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7562         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
7563         (bug#8460).
7565 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
7567         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
7568         This fixes some race conditions on the permissions of any newly
7569         created file.
7571         * alloc.c (valid_pointer_p): Use pipe, not open.
7572         This fixes some permissions issues when debugging.
7574         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
7575         If fchown fails to set both uid and gid, try to set just gid,
7576         as that is sometimes allowed.  Adjust the file's mode to eliminate
7577         setuid or setgid bits that are inappropriate if fchown fails.
7579 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
7581         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
7582         to compare Lisp_Objects.
7583         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
7584         global_gnutls_log_level, don't mistake it for a Lisp_Object.
7585         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
7587 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
7589         * lread.c (read_integer): Unread even EOF character.
7590         (read1): Likewise.  Properly record start position of symbol.
7592         * lread.c (read1): Read `#:' as empty uninterned symbol if no
7593         symbol character follows.
7595 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
7597         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
7598         This works around a problem with the previous change to Fcopy_file.
7599         Recent glibc declares fchown with __attribute__((warn_unused_result)),
7600         and without this change, GCC might complain about discarding
7601         fchown's return value.
7603 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
7605         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
7607 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
7609         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
7611 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7613         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
7614         it's used from the C level.
7616         * process.c: Use the same condition for POLL_FOR_INPUT in both
7617         keyboard.c and process.c (bug#1858).
7619 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
7621         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
7622         (Fgnutls_boot): Use it.
7624 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
7626         * doc.c (Fsubstitute_command_keys): Revert last change.
7628 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7630         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
7631         quotes the next character, and doesn't affect other longer
7632         sequences (bug#8935).
7634         * lread.c (syms_of_lread): Clarify that is isn't only
7635         `eval-buffer' and `eval-defun' that's affected by
7636         `lexical-binding' (bug#8460).
7638 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
7640         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
7641         bidi redisplay when a line includes both an image and is truncated.
7643 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
7645         Fix minor problems found by static checking.
7646         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
7647         (elsz): Now a signed constant, not a size_t var.  We prefer signed
7648         types to unsigned, to avoid integer comparison confusion.  Without
7649         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
7650         "cannot optimize loop, the loop counter may overflow", a symptom
7651         of the confusion.
7652         * indent.c (Fvertical_motion): Mark locals as initialized.
7653         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
7655 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7657         * search.c (Fre_search_backward): Mention `case-fold-search' in
7658         all the re_search_* functions (bug#8138).
7660         * keyboard.c (Fopen_dribble_file): Document when the file is
7661         closed (bug#8056).
7663 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
7665         * bidi.c (bidi_dump_cached_states): Fix format of displaying
7666         bidi_cache_idx.
7668         Support bidi reordering of display and overlay strings.
7669         * xdisp.c (compute_display_string_pos)
7670         (compute_display_string_end): Accept additional argument STRING.
7671         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
7672         (reseat_to_string): Initialize bidi_it->string.s and
7673         bidi_it->string.schars.
7674         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
7675         NULL (avoids a crash in bidi_paragraph_init).
7676         Initialize itb.string.lstring.
7677         (init_iterator): Call bidi_init_it only of a valid
7678         buffer position was specified.  Initialize paragraph_embedding to
7679         L2R.
7680         (reseat_to_string): Initialize the bidi iterator.
7681         (display_string): If we need to ignore text properties of
7682         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
7683         original value of -1 will not work with bidi.)
7684         (compute_display_string_pos): First arg is now struct
7685         `text_pos *'; all callers changed.  Support display properties on
7686         Lisp strings.
7687         (compute_display_string_end): Support display properties on Lisp
7688         strings.
7689         (init_iterator, reseat_1, reseat_to_string): Initialize the
7690         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
7691         when iterating on a string not from display properties).
7692         (compute_display_string_pos, compute_display_string_end):
7693         Fix calculation of the object to scan.  Fixes an error when using
7694         arrow keys.
7695         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
7696         base_level_stop; instead, set base_level_stop to BEGV.
7697         Fixes crashes in vertical-motion.
7698         (next_element_from_buffer): Improve commentary for when
7699         the iterator is before prev_stop.
7700         (init_iterator): Initialize bidi_p from the default value of
7701         bidi-display-reordering, not from buffer-local value.  Use the
7702         buffer-local value only if initializing for buffer iteration.
7703         (handle_invisible_prop): Support invisible properties on strings
7704         that are being bidi-reordered.
7705         (set_iterator_to_next): Support bidi reordering of C strings and
7706         Lisp strings.
7707         (next_element_from_string): Support bidi reordering of Lisp
7708         strings.
7709         (handle_stop_backwards): Support Lisp strings as well.
7710         (display_string): Support display of R2L glyph rows.
7711         Use IT_STRING_CHARPOS when displaying from a Lisp string.
7712         (init_iterator): Don't initialize it->bidi_p for strings
7713         here.
7714         (reseat_to_string): Initialize it->bidi_p for strings here.
7715         (next_element_from_string, next_element_from_c_string)
7716         (next_element_from_buffer): Add xassert's for correspondence
7717         between IT's object being iterated and it->bidi_it.string
7718         structure.
7719         (face_before_or_after_it_pos): Support bidi iteration.
7720         (next_element_from_c_string): Handle the case of the first string
7721         character that is not the first one in the visual order.
7722         (get_visually_first_element): New function, refactored from common
7723         parts of next_element_from_buffer, next_element_from_string, and
7724         next_element_from_c_string.
7725         (tool_bar_lines_needed, redisplay_tool_bar)
7726         (display_menu_bar): Force left-to-right direction.  Add a FIXME
7727         comment for making that be controlled by a user option.
7728         (push_it, pop_it): Save and restore the state of the
7729         bidi iterator.  Save and restore the bidi_p flag.
7730         (pop_it): Iterate out of display property for string iteration as
7731         well.
7732         (iterate_out_of_display_property): Support iteration over strings.
7733         (handle_single_display_spec): Set up it->bidi_it for iteration
7734         over a display string, and call bidi_init_it.
7735         (handle_single_display_spec, next_overlay_string)
7736         (get_overlay_strings_1, push_display_prop): Set up the bidi
7737         iterator for displaying display or overlay strings.
7738         (forward_to_next_line_start): Don't use the shortcut if
7739         bidi-iterating.
7740         (back_to_previous_visible_line_start): If handle_display_prop
7741         pushed the iterator stack, restore the internal state of the bidi
7742         iterator by calling bidi_pop_it same number of times.
7743         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
7744         and we are bidi-iterating, don't decrement the iterator position;
7745         instead, set the first_elt flag in the bidi iterator, to produce
7746         the same effect.
7747         (reseat_1): Remove redundant setting of string_from_display_prop_p.
7748         (push_display_prop): xassert that we are iterating a buffer.
7749         (push_it, pop_it): Save and restore paragraph_embedding member.
7750         (handle_single_display_spec, next_overlay_string)
7751         (get_overlay_strings_1, reseat_1, reseat_to_string)
7752         (push_display_prop): Set up the `unibyte' member of bidi_it.string
7753         correctly.  Don't assume unibyte strings are not bidi-reordered.
7754         (compute_display_string_pos)
7755         (compute_display_string_end): Fix handling the case of C string.
7756         (push_it, pop_it): Save and restore from_disp_prop_p.
7757         (handle_single_display_spec, push_display_prop): Set the
7758         from_disp_prop_p flag.
7759         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
7760         (pop_it): Call iterate_out_of_display_property only if we are
7761         popping after iteration over a string that came from a display
7762         property.  Fix a typo in popping stretch info.  Add an assertion
7763         for verifying that the iterator position is in sync with the bidi
7764         iterator.
7765         (handle_single_display_spec, get_overlay_strings_1)
7766         (push_display_prop): Fix initialization of paragraph direction for
7767         string when that of the parent object is not yet determined.
7768         (reseat_1): Call bidi_init_it to resync the bidi
7769         iterator with IT's position.  (Bug#7616)
7770         (find_row_edges): If ROW->start.pos gives position
7771         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
7772         (handle_stop, back_to_previous_visible_line_start, reseat_1):
7773         Reset the from_disp_prop_p flag.
7774         (SAVE_IT, RESTORE_IT): New macros.
7775         (pos_visible_p, face_before_or_after_it_pos)
7776         (back_to_previous_visible_line_start)
7777         (move_it_in_display_line_to, move_it_in_display_line)
7778         (move_it_to, move_it_vertically_backward, move_it_by_lines)
7779         (try_scrolling, redisplay_window, display_line): Use them when
7780         saving a temporary copy of the iterator and restoring it back.
7781         (back_to_previous_visible_line_start, reseat_1)
7782         (init_iterator): Empty the bidi cache "stack".
7783         (move_it_in_display_line_to): If iterator ended up at
7784         EOL, but we never saw any buffer positions smaller than
7785         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
7786         motion in bidi-reordered lines.
7787         (move_it_in_display_line_to): Record prev_method and prev_pos
7788         immediately before the call to set_iterator_to_next.  Fixes cursor
7789         motion in bidi-reordered lines with stretch glyphs and strings
7790         displayed in margins.  (Bug#8133) (Bug#8867)
7791         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
7792         TO_CHARPOS.
7793         (pos_visible_p): Support positions in bidi-reordered lines.
7794         Save and restore bidi cache.
7796         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
7797         (bidi_paragraph_info): Delete unused struct.
7798         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
7799         (bidi_cache_start): New variable.
7800         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
7801         to zero.
7802         (bidi_cache_fetch_state, bidi_cache_search)
7803         (bidi_cache_find_level_change, bidi_cache_iterator_state)
7804         (bidi_cache_find, bidi_peek_at_next_level)
7805         (bidi_level_of_next_char, bidi_find_other_level_edge)
7806         (bidi_move_to_visually_next): Compare cache index with
7807         bidi_cache_start rather than with zero.
7808         (bidi_fetch_char): Accept new argument STRING; all callers
7809         changed.  Support iteration over a string.  Support strings with
7810         display properties.  Support unibyte strings.  Fix the type of
7811         `len' according to what STRING_CHAR_AND_LENGTH expects.
7812         (bidi_paragraph_init, bidi_resolve_explicit_1)
7813         (bidi_resolve_explicit, bidi_resolve_weak)
7814         (bidi_level_of_next_char, bidi_move_to_visually_next):
7815         Support iteration over a string.
7816         (bidi_set_sor_type, bidi_resolve_explicit_1)
7817         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
7818         can now be zero (for strings); special values 0 and -1 were
7819         changed to -1 and -2, respectively.
7820         (bidi_char_at_pos): New function.
7821         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
7822         Call it instead of FETCH_MULTIBYTE_CHAR.
7823         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
7824         initialized to valid values.
7825         (bidi_init_it): Don't initialize charpos and bytepos with invalid
7826         values.
7827         (bidi_level_of_next_char): Allow the sentinel "position" to pass
7828         the test for valid cached positions.  Fix the logic for looking up
7829         the sentinel state in the cache.  GCPRO the Lisp string we are
7830         iterating.
7831         (bidi_push_it, bidi_pop_it): New functions.
7832         (bidi_initialize): Initialize the bidi cache start stack pointer.
7833         (bidi_cache_ensure_space): New function, refactored from part of
7834         bidi_cache_iterator_state.  Don't assume the required size is just
7835         one BIDI_CACHE_CHUNK away.
7836         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
7837         (bidi_count_bytes, bidi_char_at_pos): New functions.
7838         (bidi_cache_search): Don't assume bidi_cache_last_idx is
7839         always valid if bidi_cache_idx is valid.
7840         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
7841         is valid if it's going to be used.
7842         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
7843         (bidi_cache_fetch_state, bidi_cache_search)
7844         (bidi_cache_find_level_change, bidi_cache_ensure_space)
7845         (bidi_cache_iterator_state, bidi_cache_find)
7846         (bidi_find_other_level_edge, bidi_cache_start_stack):
7847         All variables related to cache indices are now EMACS_INT.
7849         * dispextern.h (struct bidi_string_data): New structure.
7850         (struct bidi_it): New member `string'.  Make flag members be 1-bit
7851         fields, and put them last in the struct.
7852         (compute_display_string_pos, compute_display_string_end):
7853         Update prototypes.
7854         (bidi_push_it, bidi_pop_it): Add prototypes.
7855         (struct iterator_stack_entry): New members bidi_p,
7856         paragraph_embedding, and from_disp_prop_p.
7857         (struct it): Member bidi_p is now a bit field 1 bit wide.
7858         (bidi_shelve_cache, bidi_unshelve_cache):
7859         Declare prototypes.
7861         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
7862         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
7863         and vector-like objects.
7865         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
7866         cache around display iteration.
7868         * window.c (Fwindow_end, window_scroll_pixel_based)
7869         (displayed_window_lines, Frecenter): Save and restore the bidi
7870         cache around display iteration.
7872 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7874         * editfns.c (Fdelete_region): Clarify the use of the named
7875         parameters (bug#6788).
7877 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
7879         * indent.c (Fvertical_motion): Set and restore w->pointm when
7880         saving and restoring the window's buffer (Bug#9006).
7882 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7884         * editfns.c (Fstring_to_char): Clarify just what is returned
7885         (bug#6576).  Text by Eli Zaretskii.
7887 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
7889         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
7891 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
7893         * buffer.c (mmap_find): Fix a typo.
7895 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
7897         Fix execution of x selection hooks.
7898         * xselect.c (Qx_lost_selection_functions)
7899         (Qx_sent_selection_functions): New vars.
7900         (syms_of_xselect): DEFSYM them.
7901         (x_handle_selection_request): Pass Qx_sent_selection_functions
7902         rather than Vx_sent_selection_functions to Frun_hook_with_args.
7903         (x_handle_selection_clear,x_clear_frame_selections):
7904         Pass Qx_lost_selection_functions rather than
7905         Vx_lost_selection_functions to Frun_hook_with_args.
7907 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
7909         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
7910         The old code sometimes used this field without initializing it.
7912         * alloc.c (gc_sweep): Don't read past end of array.
7913         In theory, the old code could also have corrupted Emacs internals,
7914         though it'd be very unlikely.
7916 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
7918         * character.c (Fcharacterp): Don't advertise optional ignored
7919         argument.  (Bug#4026)
7921 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7923         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
7924         key" (bug#4257).
7926         * window.c (Fset_window_start): Doc fix (bug#4199).
7927         (Fset_window_hscroll): Ditto.
7929 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
7931         Fix minor new problems caught by GCC 4.6.1.
7932         * term.c (init_tty): Remove unused local.
7933         * xsettings.c (store_monospaced_changed): Define this function only
7934         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
7935         not used otherwise.
7937 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
7939         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
7941 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7943         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
7944         are the mini-buffer and the echo area (bug#3320).
7946         * term.c (init_tty): Remove support for supdup, c10 and perq
7947         terminals, which are no longer supported (bug#1482).
7949 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
7951         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
7953 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
7955         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
7956         for non-popups (Bug#3642).
7958 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
7960         * alloc.c (reset_malloc_hooks): Protoize.
7961         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
7962         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
7963         * cm.c (losecursor): Likewise.
7964         * data.c (fmod): Likewise.
7965         * dispnew.c (swap_glyphs_in_rows): Likewise.
7966         * emacs.c (memory_warning_signal): Likewise.
7967         * floatfns.c (float_error): Likewise.
7968         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
7969         (otf_open, font_otf_capability, generate_otf_features)
7970         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
7971         Likewise.
7972         * image.c (pbm_read_file): Likewise.
7973         * indent.c (string_display_width): Likewise.
7974         * intervals.c (check_for_interval, search_for_interval)
7975         (inc_interval_count, count_intervals, root_interval)
7976         (adjust_intervals_for_insertion, make_new_interval): Likewise.
7977         * lread.c (defalias): Likewise.
7978         * ralloc.c (r_alloc_check): Likewise.
7979         * regex.c (set_image_of_range_1, set_image_of_range)
7980         (regex_grow_registers): Likewise.
7981         * sysdep.c (strerror): Likewise.
7982         * termcap.c (valid_filename_p, tprint, main): Likewise.
7983         * tparam.c (main): Likewise.
7984         * unexhp9k800.c (run_time_remap, save_data_space)
7985         (update_file_ptrs, read_header, write_header, calculate_checksum)
7986         (copy_file, copy_rest, display_header): Likewise.
7987         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
7988         Likewise.
7989         * xdisp.c (check_it): Likewise.
7990         * xfaces.c (register_color, unregister_color, unregister_colors):
7991         Likewise.
7992         * xfns.c (print_fontset_result): Likewise.
7993         * xrdb.c (member, fatal, main): Likewise.
7995 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
7997         Fix minor problems found by static checking (Bug#9031).
7998         * chartab.c (char_table_set_range, map_sub_char_table):
7999         Remove unused locals.
8000         (uniprop_table): Now static.
8001         * composite.c (_work_char): Remove unused static var.
8003 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
8005         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
8007 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
8009         * gtkutil.c (qttip_cb): Remove code without function.
8011 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
8013         * w32.c (pthread_sigmask): New stub.
8015 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
8017         Use pthread_sigmask, not sigprocmask (Bug#9010).
8018         sigprocmask is portable only for single-threaded applications, and
8019         Emacs can be multi-threaded when it uses GTK.
8020         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
8021         (LIBES): Use it.
8022         * callproc.c (Fcall_process):
8023         * process.c (create_process):
8024         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
8025         Use pthread_sigmask, not sigprocmask.
8027 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
8029         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
8030         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
8031         wrong (Bug#8591).
8033 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
8035         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
8036         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
8037         (xg_hide_tooltip): Fix comment.
8039         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
8040         in registerServicesMenuSendTypes.
8041         (validRequestorForSendType): Don't check ns_return_types.
8043         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
8044         ns_return_type.
8046 2011-07-08  Jason Rumney  <jasonr@gnu.org>
8048         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
8049         SH_SHOW for hidden windows (Bug#5482).
8051         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
8052         frame struct members of non-existent frames (Bug#6284).
8054 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
8056         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
8057         variable firstTime not needed on OSX >= 10.6.
8058         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
8059         >= 10.5.  Use setKnobProportion, setDoubleValue.
8061         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
8062         (MAC_OS_X_VERSION_10_5): Define if not defined.
8063         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
8064         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
8065         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
8067         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
8068         cString and lossyCString on OSX >= 10.4.
8070         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
8071         sizeToFit on OSX >= 10.2.
8073         * nsimage.m (allocInitFromFile): Don't use deprecated method
8074         bestRepresentationForDevice on OSX >= 10.6.
8076         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
8077         to avoid warning.
8079         * emacs.c: Declare unexec_init_emacs_zone.
8081         * nsgui.h: Fix compiler warning about gnulib redefining verify.
8083         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
8085         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
8086         on svcsMenu (Bug#8842).
8088         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
8089         ns_return_types.
8090         (Fns_list_services): Just return Qnil on 10.6, code not working there.
8092         * nsterm.m (QUTF8_STRING): Declare.
8093         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
8094         (validRequestorForSendType): Return type is (id).
8095         Change indexOfObjectIdenticalTo to indexOfObject.
8096         Check if we have local selection before returning self (Bug#8842).
8097         (writeSelectionToPasteboard): Put local selection into paste board
8098         if we have a local selection (Bug#8842).
8099         (syms_of_nsterm): DEFSYM QUTF8_STRING.
8101         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
8102         (ns_get_local_selection): Declare.
8104 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8106         * keymap.c (describe_map_tree): Don't insert a double newline at
8107         the end of the buffer (bug#1169) and return whether we inserted
8108         something.
8110         * callint.c (Fcall_interactively): Change "reading args" to
8111         "providing args" to try to clarify what it does (bug#1010).
8113 2011-07-07  Kenichi Handa  <handa@m17n.org>
8115         * composite.c (composition_compute_stop_pos): Ignore a static
8116         composition starting before CHARPOS (Bug#8915).
8118         * xdisp.c (handle_composition_prop): Likewise.
8120 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
8122         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
8123         (Bug#9015)
8125 2011-07-07  Kenichi Handa  <handa@m17n.org>
8127         * character.h (unicode_category_t): New enum type.
8129         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
8130         (Qchar_code_property_table): New variable.
8131         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
8132         (UNIPROP_COMPRESSED_FORM_P): New macros.
8133         (char_table_ascii): Uncompress the compressed values.
8134         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
8135         Uncompress the compressed values.
8136         (sub_char_table_ref_and_range): Likewise.
8137         (char_table_ref_and_range): Uncompress the compressed values.
8138         (sub_char_table_set): New arg is_uniprop.  Callers changed.
8139         Uncompress the compressed values.
8140         (sub_char_table_set_range): Args changed.  Callers changed.
8141         (char_table_set_range): Adjuted for the above change.
8142         (map_sub_char_table): Delete args default_val and parent.  Add arg
8143         top.  Give decoded values to a Lisp function.
8144         (map_char_table): Adjust for the above change.  Give decoded
8145         values to a Lisp function.  Gcpro more variables.
8146         (uniprop_table_uncompress)
8147         (uniprop_decode_value_run_length): New functions.
8148         (uniprop_decoder, uniprop_decoder_count): New variables.
8149         (uniprop_get_decoder, uniprop_encode_value_character)
8150         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
8151         New functions.
8152         (uniprop_encoder, uniprop_encoder_count): New variables.
8153         (uniprop_get_encoder, uniprop_table)
8154         (Funicode_property_table_internal, Fget_unicode_property_internal)
8155         (Fput_unicode_property_internal): New functions.
8156         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
8157         Sunicode_property_table_internal, Sget_unicode_property_internal,
8158         and Sput_unicode_property_internal.  Defvar_lisp
8159         char-code-property-alist.
8161         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
8162         Vunicode_category_table.
8164         * font.c (font_range): Adjust for the change of
8165         Vunicode_category_table.
8167 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
8169         * m/iris4d.h: Remove file, move contents ...
8170         * s/irix6-5.h: ... here.
8172 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
8174         Remove unportable assumption about struct layout (Bug#8884).
8175         * alloc.c (mark_buffer):
8176         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
8177         (clone_per_buffer_values): Don't assume that
8178         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
8179         This isn't true in general, and it's particularly not true
8180         if Emacs is configured with --with-wide-int.
8181         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
8182         New macros, used in the buffer.c change.
8184 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
8186         * xsettings.c: Use both GConf and GSettings if both are available.
8187         (store_config_changed_event): Add comment.
8188         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
8189         (store_tool_bar_style_changed): New functions.
8190         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
8191         (struct xsettings): Move font inside HAVE_XFT.
8192         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
8193         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
8194         Move inside HAVE_XFT.
8195         (something_changed_gsettingsCB): Rename from something_changedCB.
8196         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
8197         also.
8198         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
8199         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
8200         (something_changed_gconfCB): Rename from something_changedCB.
8201         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
8202         (parse_settings): Move check for font inside HAVE_XFT.
8203         (read_settings, apply_xft_settings): Add comment.
8204         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
8205         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
8206         call store_font_name_changed.
8207         (xft_settings_event): Add comment.
8208         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
8209         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
8210         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
8211         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
8212         (xsettings_initialize): Call init_gsettings last.
8213         (xsettings_get_system_font, xsettings_get_system_normal_font):
8214         Add comment.
8216 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
8218         Random fixes.  E.g., (random) never returned negative values.
8219         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
8220         subseconds part to the entropy, as that's a bit more random.
8221         Prefer signed to unsigned, since the signedness doesn't matter and
8222         in general we prefer signed.  When given a limit, use a
8223         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
8224         latter isn't right if USE_2_TAGS_FOR_INTS.
8225         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
8226         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
8228 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
8230         * textprop.c (text_property_stickiness):
8231         Obey Vtext_property_default_nonsticky.
8232         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
8233         * w32fns.c (syms_of_w32fns):
8234         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
8236 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
8238         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
8239         This is more efficient than Ffile_directory_p and avoids a minor race.
8241 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8243         * buffer.c (Foverlay_put): Say what the return value is
8244         (bug#7835).
8246         * fileio.c (barf_or_query_if_file_exists): Check first if the file
8247         is a directory before asking whether to use the file name
8248         (bug#7564).
8249         (barf_or_query_if_file_exists): Make the "File is a directory"
8250         error be more correct.
8252         * fns.c (Frequire): Remove the mention of the .gz files, since
8253         that's installation-specific, but keep the mention of
8254         `get-load-suffixes'.
8256 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
8258         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
8259         Report string overflow if the output is too long.
8261 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
8263         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
8264         (syms_of_gnutls): Remove duplicate DEFSYM for
8265         Qgnutls_bootprop_verify_hostname_error, an error for
8266         Qgnutls_bootprop_verify_error (which is no longer used).
8268         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
8269         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
8270         Also (re)move comments that are misplaced or no longer relevant.
8272 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8274         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
8276 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
8278         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
8279         and background color parameters if they have been changed.
8281 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8283         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
8285 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
8287         * xsettings.c (SYSTEM_FONT): Define only when used.
8288         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
8290         * keymap.c (access_keymap_1): Now static.
8292 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
8294         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
8295         leave any prefix arg for the up event (Bug#1586).
8297 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8299         * lread.c (syms_of_lread): Mention single symbols defined by
8300         `defvar' or `defconst' (bug#7154).
8302         * fns.c (Frequire): Mention .el.gz files (bug#7314).
8303         (Frequire): Mention get-load-suffixes.
8305 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
8307         * window.h (window): Remove clone_number slot.
8308         * window.c (Fwindow_clone_number, Fset_window_clone_number):
8309         Remove.
8310         (make_parent_window, make_window, saved_window)
8311         (Fset_window_configuration, save_window_save): Don't deal with
8312         clone numbers.
8313         * buffer.c (Qclone_number): Remove declaration.
8314         (sort_overlays, overlay_strings): Don't deal with clone numbers.
8316 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
8318         Add multiple inheritance to keymaps.
8319         * keymap.c (Fmake_composed_keymap): New function.
8320         (Fset_keymap_parent): Simplify.
8321         (fix_submap_inheritance): Remove.
8322         (access_keymap_1): New function extracted from access_keymap to handle
8323         embedded parents and handle lists of maps.
8324         (access_keymap): Use it.
8325         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
8326         (Fcopy_keymap): Handle embedded parents.
8327         (Fcommand_remapping, define_as_prefix): Simplify.
8328         (Fkey_binding): Simplify.
8329         (syms_of_keymap): Move minibuffer-local-completion-map,
8330         minibuffer-local-filename-completion-map,
8331         minibuffer-local-must-match-map, and
8332         minibuffer-local-filename-must-match-map to Elisp.
8333         (syms_of_keymap): Defsubr make-composed-keymap.
8334         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
8335         (parse_menu_item): Trivial simplification.
8337 2011-07-01  Glenn Morris  <rgm@gnu.org>
8339         * Makefile.in (SETTINGS_LIBS): Fix typo.
8341 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny patch)
8343         * coding.c (Fencode_coding_string): Record the last coding system
8344         used, as the function doc string says (bug#8738).
8346 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
8348         * xsettings.c (store_monospaced_changed): Take new font as arg and
8349         check for change against current_mono_font.
8350         (EMACS_TYPE_SETTINGS): Remove this and related defines.
8351         (emacs_settings_constructor, emacs_settings_get_property)
8352         (emacs_settings_set_property, emacs_settings_class_init)
8353         (emacs_settings_init, gsettings_obj): Remove.
8354         (something_changedCB): New function for HAVE_GSETTINGS.
8355         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
8356         with value as argument.
8357         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
8358         g_settings_new (Bug#8967).  Do not create gsettings_obj.
8359         Remove calls to g_settings_bind.  Connect something_changedCB to
8360         "changed".
8362         * xgselect.c: Add defined (HAVE_GSETTINGS).
8363         (xgselect_initialize): Ditto.
8365         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
8366         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
8367         xg_select.
8369 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
8371         * eval.c (struct backtrace): Simplify and port the data structure.
8372         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
8373         signed bit field, as this assumption is not portable and it makes
8374         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
8375         "char debug_on_exit : 1" as this is not portable either; instead,
8376         use the portable "unsigned int debug_on_exit : 1".  Remove unused
8377         member evalargs.  Remove obsolete comments about cc bombing out.
8379 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
8381         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
8382         Let HAVE_GSETTINGS override HAVE_GCONF.
8383         (store_monospaced_changed): New function.
8384         (EMACS_SETTINGS): A new type derived from GObject to handle
8385         GSettings notifications.
8386         (emacs_settings_constructor, emacs_settings_get_property)
8387         (emacs_settings_set_property, emacs_settings_class_init):
8388         New functions.
8389         (gsettings_client, gsettings_obj): New variables.
8390         (GSETTINGS_SCHEMA): New define.
8391         (something_changedCB): Call store_monospaced_changed.
8392         (init_gsettings): New function.
8393         (xsettings_initialize): Call init_gsettings.
8394         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
8395         to NULL.
8397         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
8398         GCONF_CFLAGS/LIBS.
8400 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
8402         * window.c (resize_root_window, grow_mini_window)
8403         (shrink_mini_window): Rename Qresize_root_window to
8404         Qwindow_resize_root_window and Qresize_root_window_vertically to
8405         Qwindow_resize_root_window_vertically.
8407 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
8409         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
8411 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
8413         * makefile.w32-in: Redesign dependencies so they reflect more
8414         clearly which files are directly included by each source file,
8415         and not through other includes.
8417 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
8419         * buffer.c (Qclone_number): Declare static and DEFSYM it.
8420         (sort_overlays, overlay_strings): When an overlay's clone number
8421         matches the window's clone number process the overlay even if
8422         the overlay's window property doesn't match the current window.
8424         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
8425         (Fwindow_hchild): Rename to Fwindow_left_child.
8426         (Fwindow_next): Rename to Fwindow_next_sibling.
8427         (Fwindow_prev): Rename to Fwindow_prev_sibling.
8428         (resize_window_check): Rename to window_resize_check.
8429         (resize_window_apply): Rename to window_resize_apply.
8430         (Fresize_window_apply): Rename to Fwindow_resize_apply.
8431         (Fdelete_other_windows_internal, resize_frame_windows)
8432         (Fsplit_window_internal, Fdelete_window_internal)
8433         (grow_mini_window, shrink_mini_window)
8434         (Fresize_mini_window_internal): Fix callers accordingly.
8436 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
8438         * emacsgtkfixed.h: State that this is only used with Gtk+3.
8439         (emacs_fixed_set_min_size): Remove.
8440         (emacs_fixed_new): Take frame as argument.
8442         * emacsgtkfixed.c: State that this is only used with Gtk+3.
8443         (_EmacsFixedPrivate): Remove minwidth/height.
8444         Add struct frame *f.
8445         (emacs_fixed_init): Initialize priv->f.
8446         (get_parent_class, emacs_fixed_set_min_size): Remove.
8447         (emacs_fixed_new): Set priv->f to argument.
8448         (emacs_fixed_get_preferred_width)
8449         (emacs_fixed_get_preferred_height): Use min_width/height from
8450         frames size_hint to set minimum and natural (Bug#8919).
8451         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
8452         and use min_width/height from frames size_hint to set
8453         min_width/height (Bug#8919).
8455         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
8456         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
8457         Fix indentation.
8459 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
8461         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
8462         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
8463         called at ZV.
8465 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
8467         * process.c (wait_reading_process_output): Bypass select if
8468         waiting for a cell while ignoring keyboard input, and input is
8469         pending.  Suggested by Jan Djärv (Bug#8869).
8471 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
8473         Use gnulib's dup2 module instead of rolling our own.
8474         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
8476 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
8478         * dispnew.c (scrolling_window): Before scrolling, turn off a
8479         mouse-highlight in the window being scrolled.
8481 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
8483         Move DEFSYM to lisp.h and use everywhere.
8485         * character.h (DEFSYM): Move declaration...
8486         * lisp.h (DEFSYM): ...here.
8488         * gnutls.c:
8489         * minibuf.c:
8490         * w32menu.c:
8491         * w32proc.c:
8492         * w32select.c: Don't include character.h.
8494         * alloc.c (syms_of_alloc):
8495         * buffer.c (syms_of_buffer):
8496         * bytecode.c (syms_of_bytecode):
8497         * callint.c (syms_of_callint):
8498         * casefiddle.c (syms_of_casefiddle):
8499         * casetab.c (init_casetab_once):
8500         * category.c (init_category_once, syms_of_category):
8501         * ccl.c (syms_of_ccl):
8502         * cmds.c (syms_of_cmds):
8503         * composite.c (syms_of_composite):
8504         * dbusbind.c (syms_of_dbusbind):
8505         * dired.c (syms_of_dired):
8506         * dispnew.c (syms_of_display):
8507         * doc.c (syms_of_doc):
8508         * editfns.c (syms_of_editfns):
8509         * emacs.c (syms_of_emacs):
8510         * eval.c (syms_of_eval):
8511         * fileio.c (syms_of_fileio):
8512         * fns.c (syms_of_fns):
8513         * frame.c (syms_of_frame):
8514         * fringe.c (syms_of_fringe):
8515         * insdel.c (syms_of_insdel):
8516         * keymap.c (syms_of_keymap):
8517         * lread.c (init_obarray, syms_of_lread):
8518         * macros.c (syms_of_macros):
8519         * msdos.c (syms_of_msdos):
8520         * print.c (syms_of_print):
8521         * process.c (syms_of_process):
8522         * search.c (syms_of_search):
8523         * sound.c (syms_of_sound):
8524         * syntax.c (init_syntax_once, syms_of_syntax):
8525         * terminal.c (syms_of_terminal):
8526         * textprop.c (syms_of_textprop):
8527         * undo.c (syms_of_undo):
8528         * w32.c (globals_of_w32):
8529         * window.c (syms_of_window):
8530         * xdisp.c (syms_of_xdisp):
8531         * xfaces.c (syms_of_xfaces):
8532         * xfns.c (syms_of_xfns):
8533         * xmenu.c (syms_of_xmenu):
8534         * xsettings.c (syms_of_xsettings):
8535         * xterm.c (syms_of_xterm): Use DEFSYM.
8537 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
8539         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
8541 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
8543         Integer and buffer overflow fixes (Bug#8873).
8545         * print.c (printchar, strout): Check for string overflow.
8546         (PRINTPREPARE, printchar, strout):
8547         Don't set size unless allocation succeeds.
8549         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
8550         for sizes.  Check for string overflow more accurately.
8551         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
8553         * macros.c: Integer and buffer overflow fixes.
8554         * keyboard.h (struct keyboard.kbd_macro_bufsize):
8555         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
8556         Use ptrdiff_t, not int, for sizes.
8557         Don't increment bufsize until after realloc succeeds.
8558         Check for size-calculation overflow.
8559         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
8561         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
8563         * lread.c: Integer overflow fixes.
8564         (read_integer): Radix is now EMACS_INT, not int,
8565         to improve quality of diagnostics for out-of-range radices.
8566         Calculate buffer size correctly for out-of-range radices.
8567         (read1): Check for integer overflow in radices, and in
8568         read-circle numbers.
8569         (read_escape): Avoid int overflow.
8570         (Fload, openp, read_buffer_size, read1)
8571         (substitute_object_recurse, read_vector, read_list, map_obarray):
8572         Use ptrdiff_t, not int, for sizes.
8573         (read1): Use EMACS_INT, not int, for sizes.
8574         Check for size overflow.
8576         * image.c (cache_image): Check for size arithmetic overflow.
8578         * lread.c: Integer overflow issues.
8579         (saved_doc_string_size, saved_doc_string_length)
8580         (prev_saved_doc_string_size, prev_saved_doc_string_length):
8581         Now ptrdiff_t, not int.
8582         (read1): Don't assume doc string length fits in int.  Check for
8583         out-of-range doc string lengths.
8584         (read_list): Don't assume file position fits in int.
8585         (read_escape): Check for hex character overflow.
8587 2011-06-22  Leo Liu  <sdl.web@gmail.com>
8589         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
8590         Move to minibuffer.el.
8592 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
8594         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
8595         The following patches are for when GLYPH_DEBUG && !XASSERT.
8596         * dispextern.h (trace_redisplay_p, dump_glyph_string):
8597         * dispnew.c (flush_stdout):
8598         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
8599         Mark as externally visible.
8600         * dispnew.c (check_window_matrix_pointers): Now static.
8601         * dispnew.c (window_to_frame_vpos):
8602         * xfns.c (unwind_create_frame):
8603         * xterm.c (x_check_font): Remove unused local.
8604         * scroll.c (CHECK_BOUNDS):
8605         * xfaces.c (cache_fache): Rename local to avoid shadowing.
8606         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
8607         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
8608         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
8609         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
8610         Now static.
8611         (debug_method_add): Use va_list and vsprintf rather than relying
8612         on undefined behavior with wrong number of arguments.
8613         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
8614         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
8615         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
8616         since we're not interested in debugging glyphs with old libraries.
8617         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
8618         GCC 4.6.0's static checking.
8620 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
8622         Integer overflow and signedness fixes (Bug#8873).
8623         A few related buffer overrun fixes, too.
8625         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
8627         * dispextern.h (struct face.stipple):
8628         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
8629         (x_bitmap_mask, x_allocate_bitmap_record)
8630         (x_create_bitmap_from_data, x_create_bitmap_from_file)
8631         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
8632         (x_create_bitmap_from_xpm_data):
8633         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
8634         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
8635         (.bitmaps_last):
8636         * xfaces.c (load_pixmap):
8637         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
8638         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
8639         (.bitmaps_last, struct x_output.icon_bitmap):
8640         Use ptrdiff_t, not int, for bitmap indexes.
8641         (x_allocate_bitmap_record): Check for size overflow.
8642         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
8644         Use ptrdiff_t, not int, for overlay counts.
8645         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
8646         * editfns.c (overlays_around, get_pos_property):
8647         * textprop.c (get_char_property_and_overlay):
8648         * xdisp.c (next_overlay_change, note_mouse_highlight):
8649         * xfaces.c (face_at_buffer_position):
8650         * buffer.c (OVERLAY_COUNT_MAX): New macro.
8651         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
8652         (Fnext_overlay_change, Fprevious_overlay_change)
8653         (mouse_face_overlay_overlaps, Foverlays_in):
8654         Use ptrdiff_t, not int, for sizes.
8655         (overlays_at, overlays_in): Check for size-calculation overflow.
8657         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
8659         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
8660         (x_session_initialize): Do not assume string length fits in int.
8662         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
8663         This is unlikely, but can occur if DPI is outlandish.
8665         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
8666         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
8668         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
8669         * xrdb.c (magic_file_p, search_magic_path):
8670         Omit last arg SUFFIX; it was always 0.  All callers changed.
8671         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
8673         * xfont.c (xfont_match): Avoid need for strlen.
8675         * xfns.c: Don't assume strlen fits in int.
8676         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
8678         * xdisp.c (message_log_check_duplicate): Return intmax_t,
8679         not unsigned long, as we prefer signed integers.  All callers changed.
8680         Detect integer overflow in repeat count.
8681         (message_dolog): Don't assume print length fits in 39 bytes.
8682         (display_mode_element): Don't assume strlen fits in int.
8684         * termcap.c: Don't assume sizes fit in int and never overflow.
8685         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
8686         (gobble_line): Check for size-calculation overflow.
8688         * minibuf.c (Fread_buffer):
8689         * lread.c (intern, intern_c_string):
8690         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
8691         Don't assume string length fits in int.
8693         * keyboard.c (parse_tool_bar_item):
8694         * gtkutil.c (style_changed_cb): Avoid need for strlen.
8696         * font.c: Don't assume string length fits in int.
8697         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
8698         Use ptrdiff_t, not int.
8699         (font_intern_prop): Don't assume string length fits in int.
8700         Don't assume integer property fits in fixnum.
8701         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
8703         * filelock.c: Fix some buffer overrun and integer overflow issues.
8704         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
8705         Reformulate so as not to need the command string.
8706         Invoke gzip -cd rather than gunzip, as it's more portable.
8707         (lock_info_type, lock_file_1, lock_file):
8708         Don't assume pid_t and time_t fit in unsigned long.
8709         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
8710         (current_lock_owner): Prefer signed type for sizes.
8711         Use memcpy, not strncpy, where memcpy is what is really wanted.
8712         Don't assume (via atoi) that time_t and pid_t fit in int.
8713         Check for time_t and/or pid_t out of range, e.g., via a network share.
8714         Don't alloca where an auto var works fine.
8716         * fileio.c: Fix some integer overflow issues.
8717         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
8718         Don't assume string length fits in int.
8719         (directory_file_name): Don't assume string length fits in long.
8720         (make_temp_name): Don't assume pid fits in int, or that its print
8721         length is less than 20.
8723         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
8725         * coding.c (make_subsidiaries): Don't assume string length fits in int.
8727         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
8729         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
8730         We prefer signed integers, even for size calculations.
8732         * emacs.c: Don't assume string length fits in 'int'.
8733         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
8734         (main): Don't invoke strlen when not needed.
8736         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
8737         (XD_DEBUG_MESSAGE): Don't waste a byte.
8739         * callproc.c (getenv_internal_1, getenv_internal)
8740         (Fgetenv_internal):
8741         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
8743         * lread.c (invalid_syntax): Omit length argument.
8744         All uses changed.  This doesn't fix a bug, but it simplifies the
8745         code away from its former Hollerith-constant appearance, and it's
8746         one less 'int' to worry about when looking at integer-overflow issues.
8747         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
8749         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
8750         This didn't break anything, but it didn't help either.
8751         It's confusing to put a bogus integer in a place where the actual
8752         value does not matter.
8753         (LIST_END_P): Remove unused macro and its bogus comment.
8754         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
8756         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
8757         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
8758         implementation.
8759         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
8760         We prefer signed types, and the value cannot exceed the EMACS_INT
8761         range anyway (because otherwise the length would not be representable).
8762         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
8763         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
8764         This avoids a GCC warning when WIDE_EMACS_INT.
8766         * indent.c (sane_tab_width): New function.
8767         (current_column, scan_for_column, Findent_to, position_indentation)
8768         (compute_motion): Use it.  This is just for clarity.
8769         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
8771         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
8773         * lisp.h (lint_assume): New macro.
8774         * composite.c (composition_gstring_put_cache):
8775         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
8777         * editfns.c, insdel.c:
8778         Omit unnecessary forward decls, to simplify future changes.
8780         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
8782         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
8784         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
8785         Use much-faster test for byte-length change.
8786         Don't assume string byte-length fits in 'int'.
8787         Check that character arg fits in 'int'.
8788         (mapcar1): Declare byte as byte, for clarity.
8790         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
8792         * fns.c (concat): Catch string overflow earlier.
8793         Do not rely on integer wraparound.
8795         * dispextern.h (struct it.overlay_strings_charpos)
8796         (struct it.selective): Now EMACS_INT, not int.
8797         * xdisp.c (forward_to_next_line_start)
8798         (back_to_previous_visible_line_start)
8799         (reseat_at_next_visible_line_start, next_element_from_buffer):
8800         Don't arbitrarily truncate the value of 'selective' to int.
8802         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
8804         * composite.c: Don't truncate sizes to 'int'.
8805         (composition_gstring_p, composition_reseat_it)
8806         (composition_adjust_point): Use EMACS_INT, not int.
8807         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
8808         not EMACS_UINT, for indexes.
8810         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
8812         * buffer.c: Include <verify.h>.
8813         (struct sortvec.priority, struct sortstr.priority):
8814         Now EMACS_INT, not int.
8815         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
8816         (struct sortstr.size, record_overlay_string)
8817         (struct sortstrlist.size, struct sortlist.used):
8818         Don't truncate size to int.
8819         (record_overlay_string): Check for size-calculation overflow.
8820         (init_buffer_once): Check at compile-time, not run-time.
8822 2011-06-22  Jim Meyering  <meyering@redhat.com>
8824         Don't leak an XBM-image-sized buffer
8825         * image.c (xbm_load): Free the image buffer after using it.
8827 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
8829         Port to Sun C.
8830         * composite.c (find_automatic_composition): Omit needless 'return 0;'
8831         that Sun C diagnosed.
8832         * fns.c (secure_hash): Fix pointer signedness issue.
8833         * intervals.c (static_offset_intervals): New function.
8834         (offset_intervals): Use it.
8836 2011-06-21  Leo Liu  <sdl.web@gmail.com>
8838         * deps.mk (fns.o):
8839         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
8840         sha512.h.
8842         * fns.c (secure_hash): Rename from crypto_hash_function and change
8843         the first arg to accept symbols.
8844         (Fsecure_hash): New primitive.
8845         (syms_of_fns): New symbols.
8847 2011-06-20  Deniz Dogan  <deniz@dogan.se>
8849         * process.c (Fset_process_buffer): Clarify return value in
8850         docstring.
8852 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
8854         * dispnew.c (add_window_display_history): Use BVAR.
8856         * xdisp.c (debug_method_add): Use BVAR.
8857         (check_window_end, dump_glyph_matrix, dump_glyph)
8858         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
8860         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
8861         Likewise.
8863         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
8864         check till after the cache is created in init_frame_faces.
8866 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
8868         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
8870 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
8872         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
8873         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
8874         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
8876         Improve buffer-overflow checking (Bug#8873).
8877         * fileio.c (Finsert_file_contents):
8878         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
8879         Remove the old (too-loose) buffer overflow checks.
8880         They weren't needed, since make_gap checks for buffer overflow.
8881         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
8882         The old code merely checked for Emacs fixnum overflow, and relied
8883         on undefined (wraparound) behavior.  The new code avoids undefined
8884         behavior, and also checks for ptrdiff_t and/or size_t overflow.
8886         * editfns.c (Finsert_char): Don't dump core with very negative counts.
8887         Tune.  Don't use wider integers than needed.  Don't use alloca.
8888         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
8890         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
8892         * insdel.c, lisp.h (buffer_overflow): New function.
8893         (insert_from_buffer_1, replace_range, replace_range_2):
8894         * insdel.c (make_gap_larger):
8895         * editfns.c (Finsert_char):
8896         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
8898         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
8900 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
8902         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
8904         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
8905         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
8907         * fileio.c: Don't assume EMACS_INT fits in off_t.
8908         (emacs_lseek): New static function.
8909         (Finsert_file_contents, Fwrite_region): Use it.
8910         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
8912         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
8914         * fns.c: Don't overflow int when computing a list length.
8915         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
8916         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
8917         truncation on 64-bit hosts.  Check for QUIT every
8918         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
8919         faster and is responsive enough.
8920         (Flength): Report an error instead of overflowing an integer.
8921         (Fsafe_length): Return a float if the value is not representable
8922         as a fixnum.  This shouldn't happen except in contrived situations.
8923         (Fnthcdr, Fsort): Don't assume list length fits in int.
8924         (Fcopy_sequence): Don't assume vector length fits in int.
8926         * alloc.c: Check that resized vectors' lengths fit in fixnums.
8927         (header_size, word_size): New constants.
8928         (allocate_vectorlike): Don't check size overflow here.
8929         (allocate_vector): Check it here instead, since this is the only
8930         caller of allocate_vectorlike that could cause overflow.
8931         Check that the new vector's length is representable as a fixnum.
8933         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
8934         The previous code was bogus.  For example, next_almost_prime (32)
8935         returned 39, which is undesirable as it is a multiple of 3; and
8936         next_almost_prime (24) returned 25, which is a multiple of 5 so
8937         why was the code bothering to check for multiples of 7?
8939         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
8941         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
8943         Variadic C functions now count arguments with ptrdiff_t.
8944         This partly undoes my 2011-03-30 change, which replaced int with size_t.
8945         Back then I didn't know that the Emacs coding style prefers signed int.
8946         Also, in the meantime I found a few more instances where arguments
8947         were being counted with int, which may truncate counts on 64-bit
8948         machines, or EMACS_INT, which may be unnecessarily wide.
8949         * lisp.h (struct Lisp_Subr.function.aMANY)
8950         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
8951         Arg counts are now ptrdiff_t, not size_t.
8952         All variadic functions and their callers changed accordingly.
8953         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
8954         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
8955         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
8956         * callint.c (Fcall_interactively): Check arg count for overflow,
8957         to avoid potential buffer overrun.  Use signed char, not 'int',
8958         for 'varies' array, so that we needn't bother to check its size
8959         calculation for overflow.
8960         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
8961         * eval.c (apply_lambda):
8962         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
8963         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
8964         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
8966         * callint.c (Fcall_interactively): Don't use index var as event count.
8968         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
8969         * mem-limits.h (SIZE): Remove; no longer used.
8971         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
8973         Remove unnecessary casts.
8974         * xterm.c (x_term_init):
8975         * xfns.c (x_set_border_pixel):
8976         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
8977         These aren't needed now that we assume ANSI C.
8979         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
8980         It's more likely to cause problems (due to unsigned overflow)
8981         than to cure them.
8983         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
8985         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
8987         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
8989         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
8991         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
8993         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
8995         GLYPH_CODE_FACE returns EMACS_INT, not int.
8996         * dispextern.h (merge_faces):
8997         * xfaces.c (merge_faces):
8998         * xdisp.c (get_next_display_element, next_element_from_display_vector):
8999         Don't assume EMACS_INT fits in int.
9001         * character.h (CHAR_VALID_P): Remove unused parameter.
9002         * fontset.c, lisp.h, xdisp.c: All uses changed.
9004         * editfns.c (Ftranslate_region_internal): Omit redundant test.
9006         * fns.c (concat): Minor tuning based on overflow analysis.
9007         This doesn't fix any bugs.  Use int to hold character, instead
9008         of constantly refetching from Emacs object.  Use XFASTINT, not
9009         XINT, for value known to be a character.  Don't bother comparing
9010         a single byte to 0400, as it's always less.
9012         * floatfns.c (Fexpt):
9013         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
9015         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
9016         for characters.
9018         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
9020         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
9021         Without this fix, on a 64-bit host (aset S 0 4294967386) would
9022         incorrectly succeed when S was a string, because 4294967386 was
9023         truncated before it was used.
9025         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
9026         Otherwise, an out-of-range integer could cause undefined behavior
9027         on a 64-bit host.
9029         * composite.c: Use int, not EMACS_INT, for characters.
9030         (fill_gstring_body, composition_compute_stop_pos): Use int, not
9031         EMACS_INT, for values that are known to be in character range.
9032         This doesn't fix any bugs but is the usual style inside Emacs and
9033         may generate better code on 32-bit machines.
9035         Make sure a 64-bit char is never passed to ENCODE_CHAR.
9036         This is for reasons similar to the recent CHAR_STRING fix.
9037         * charset.c (Fencode_char): Check that character arg is actually
9038         a character.  Pass an int to ENCODE_CHAR.
9039         * charset.h (ENCODE_CHAR): Verify that the character argument is no
9040         wider than 'int', as a compile-time check to prevent future regressions
9041         in this area.
9043         * character.c (char_string): Remove unnecessary casts.
9045         Make sure a 64-bit char is never passed to CHAR_STRING.
9046         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
9047         by silently ignoring the top 32 bits, allowing some values
9048         that were far too large to be valid characters.
9049         * character.h: Include <verify.h>.
9050         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
9051         arguments are no wider than unsigned, as a compile-time check
9052         to prevent future regressions in this area.
9053         * data.c (Faset):
9054         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
9055         (Fsubst_char_in_region):
9056         * fns.c (concat):
9057         * xdisp.c (decode_mode_spec_coding):
9058         Adjust to CHAR_STRING's new requirement.
9059         * editfns.c (Finsert_char, Fsubst_char_in_region):
9060         * fns.c (concat): Check that character args are actually
9061         characters.  Without this test, these functions did the wrong
9062         thing with wildly out-of-range values on 64-bit hosts.
9064         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
9065         These casts should not be needed on 32-bit hosts, either.
9066         * keyboard.c (read_char):
9067         * lread.c (Fload): Remove casts to unsigned.
9069         * lisp.h (UNSIGNED_CMP): New macro.
9070         This fixes comparison bugs on 64-bit hosts.
9071         (ASCII_CHAR_P): Use it.
9072         * casefiddle.c (casify_object):
9073         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
9074         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
9075         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
9076         * dispextern.h (FACE_FROM_ID):
9077         * keyboard.c (read_char): Use UNSIGNED_CMP.
9079         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
9080         not to EMACS_INT, to avoid GCC warning.
9082         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
9084         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
9085         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
9086         isn't needed on 32-bit machines.
9088         * buffer.c (Fgenerate_new_buffer_name):
9089         Use EMACS_INT for count, not int.
9090         (advance_to_char_boundary): Return EMACS_INT, not int.
9092         * data.c (Qcompiled_function): Now static.
9094         * window.c (window_body_lines): Now static.
9096         * image.c (gif_load): Rename local to avoid shadowing.
9098         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
9099         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
9100         * alloc.c (make_save_value): Integer argument is now of type
9101         ptrdiff_t, not int.
9102         (mark_object): Use ptrdiff_t, not int.
9103         * lisp.h (pD): New macro.
9104         * print.c (print_object): Use it.
9106         * alloc.c: Use EMACS_INT, not int, to count objects.
9107         (total_conses, total_markers, total_symbols, total_vector_size)
9108         (total_free_conses, total_free_markers, total_free_symbols)
9109         (total_free_floats, total_floats, total_free_intervals)
9110         (total_intervals, total_strings, total_free_strings):
9111         Now EMACS_INT, not int.  All uses changed.
9112         (Fgarbage_collect): Compute overall total using a double, so that
9113         integer overflow is less likely to be a problem.  Check for overflow
9114         when converting back to an integer.
9115         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
9116         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
9117         These were 'int' variables that could overflow on 64-bit hosts;
9118         they were never used, so remove them instead of repairing them.
9119         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
9120         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
9121         Previously, this ceilinged at INT_MAX, but that doesn't work on
9122         64-bit machines.
9123         (allocate_pseudovector): Don't use EMACS_INT when int would do.
9125         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
9126         (allocate_vectorlike): Check for ptrdiff_t overflow.
9127         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
9128         when a (possibly-narrower) signed value would do just as well.
9129         We prefer using signed arithmetic, to avoid comparison confusion.
9131         * alloc.c: Catch some string size overflows that we were missing.
9132         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
9133         for convenience in STRING_BYTES_MAX.
9134         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
9135         The definition here is exact; the one in lisp.h was approximate.
9136         (allocate_string_data): Check for string overflow.  This catches
9137         some instances we weren't catching before.  Also, it catches
9138         size_t overflow on (unusual) hosts where SIZE_MAX <= min
9139         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
9140         and ptrdiff_t and EMACS_INT are both 64 bits.
9142         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
9143         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
9144         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
9146         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
9148         * alloc.c (Fmake_string): Check for out-of-range init.
9150 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
9152         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
9154 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
9156         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
9157         xg_get_default_scrollbar_width.
9159         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
9160         (int_gtk_range_get_value): Move to the scroll bar part of the file.
9161         (style_changed_cb): Call update_theme_scrollbar_width and call
9162         x_set_scroll_bar_default_width and xg_frame_set_char_size for
9163         all frames (Bug#8505).
9164         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
9165         Call gtk_window_set_resizable if HAVE_GTK3.
9166         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
9167         and height if HAVE_GTK3 (Bug#8505).
9168         (scroll_bar_width_for_theme): New variable.
9169         (update_theme_scrollbar_width): New function.
9170         (xg_get_default_scrollbar_width): Move code to
9171         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
9172         (xg_initialize): Call update_theme_scrollbar_width.
9174         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
9176         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
9178 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
9180         * frame.c (make_frame): Call other_buffer_safely instead of
9181         other_buffer.
9183         * window.c (temp_output_buffer_show): Call display_buffer with
9184         second argument Vtemp_buffer_show_specifiers and reset latter
9185         immediately after the call.
9186         (Vtemp_buffer_show_specifiers): New variable.
9187         (auto_window_vscroll_p, next_screen_context_lines)
9188         (Vscroll_preserve_screen_position): Remove leading asterisks from
9189         doc-strings.
9191 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
9193         Fix minor problems found by GCC 4.6.0 static checking.
9194         * buffer.c (Qclone_number): Remove for now, as it's unused.
9195         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
9196         (record_buffer): Remove unused local.
9197         * frame.c (other_visible_frames, frame_buffer_list): Now static.
9198         (set_frame_buffer_list): Remove; unused.
9199         * frame.h (other_visible_frames): Remove decl.
9200         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
9201         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
9202         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
9203         if HAVE_GPM.
9204         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
9205         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
9206         Define only if HAVE_GPM.
9207         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
9208         (update_hints_inhibit): Remove; never set.  All uses removed.
9209         * widgetprv.h (emacsFrameClassRec): Remove decl.
9210         * window.c (delete_deletable_window): Now returns void, since it
9211         wasn't returning anything.
9212         (compare_window_configurations): Remove unused locals.
9213         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
9214         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
9215         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
9216         the same widths as pointers.  This follows up on the 2011-05-06 patch.
9217         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
9218         * xterm.h: Likewise.
9219         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
9221 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
9223         * makefile.w32-in: Update dependencies.
9224         (LISP_H): Add lib/intprops.h.
9226 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
9228         * image.c (gif_load): Add animation frame delay to the metadata.
9229         (syms_of_image): Use DEFSYM.  New symbol `delay'.
9231 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
9233         * window.c (delete_deletable_window): Re-add.
9234         (Fset_window_configuration): Rewrite to handle dead buffers and
9235         consequently deletable windows.
9236         (window_tree, Fwindow_tree): Remove.  Supply functionality in
9237         window.el.
9238         (compare_window_configurations): Simplify code.
9240 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
9242         * image.c (imagemagick_load_image): Fix type mismatch.
9243         (Fimagemagick_types): Likewise.
9245         * window.h (replace_buffer_in_windows): Declare.
9247 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
9249         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
9250         Qclone_number.  Remove external declaration of Qdelete_window.
9251         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
9252         code.
9253         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
9254         Run Qbuffer_list_update_hook if allowed.
9255         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
9256         buffer list implementation.
9257         (other_buffer_safely): New function.
9258         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
9259         calls to replace_buffer_in_windows and
9260         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
9261         if allowed.
9262         (record_buffer): Inhibit quitting and rewrite using quittable
9263         functions.  Run Qbuffer_list_update_hook if allowed.
9264         (Frecord_buffer, Funrecord_buffer): New functions.
9265         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
9266         Move switch-to-buffer to window.el.
9267         (bury-buffer): Move to window.el.
9268         (Vbuffer_list_update_hook): New variable.
9270         * lisp.h (other_buffer_safely): Add prototype in buffer.c
9271         section.
9273         * window.h (resize_frame_windows): Move up in code.
9274         (Fwindow_frame): Remove EXFUN.
9275         (replace_buffer_in_all_windows): Remove prototype.
9276         (replace_buffer_in_windows_safely): Add prototype.
9278         * window.c: Declare Qdelete_window static again.  Move down
9279         declaration of select_count.
9280         (Fnext_window, Fprevious_window): Rewrite doc-strings.
9281         (Fother_window): Move to window.el.
9282         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
9283         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
9284         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
9285         window.el.
9286         (replace_buffer_in_windows): Implement by calling
9287         Qreplace_buffer_in_windows.
9288         (replace_buffer_in_all_windows): Remove with some functionality
9289         moved into replace_buffer_in_windows_safely.
9290         (replace_buffer_in_windows_safely): New function.
9291         (select_window_norecord, select_frame_norecord): Move in front
9292         of run_window_configuration_change_hook.  Remove now obsolete
9293         declarations.
9294         (Fset_window_buffer): Rewrite doc-string.
9295         Call Qrecord_window_buffer.
9296         (keys_of_window): Move binding for other-window to window.el.
9298 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
9300         * dispextern.h (struct image): Replace data member, whose int_val
9301         and ptr_val fields were not used by anything, with a single
9302         lisp_val object.
9304         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
9305         (gif_clear_image, gif_load, imagemagick_load_image)
9306         (gs_clear_image, gs_load): Callers changed.
9308 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
9310         * buffer.h: Include <time.h>, for time_t.
9311         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
9313         Fix minor problems found by static checking.
9315         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
9317         Make identifiers static if they are not used in other modules.
9318         * data.c (Qcompiled_function, Qframe, Qvector):
9319         * image.c (QimageMagick, Qsvg):
9320         * minibuf.c (Qmetadata):
9321         * window.c (resize_window_check, resize_root_window): Now static.
9322         * window.h (resize_window_check, resize_root_window): Remove decls.
9324         * window.c (window_deletion_count, delete_deletable_window):
9325         Remove; unused.
9326         (window_body_lines): Now static.
9327         (Fdelete_other_windows_internal): Mark vars as initialized.
9328         Make sure 'resize_failed' is initialized.
9329         (run_window_configuration_change_hook): Rename local to avoid shadowing.
9330         (resize_window_apply): Remove unused local.
9331         * window.h (delete_deletable_window): Remove decl.
9333         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
9334         (imagemagick_load_image): Fix pointer signedness problem by changing
9335         last arg from unsigned char * to char *.  All uses changed.
9336         Also, fix a local for similar reasons.
9337         Remove unused locals.  Remove locals to avoid shadowing.
9338         (fn_rsvg_handle_free): Remove; unused.
9339         (svg_load, svg_load_image): Fix pointer signedness problem.
9340         (imagemagick_load_image): Don't use garbage pointer image_wand.
9342         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
9344 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
9346         * image.c (gif_load): Fix omitted cast error introduced by
9347         2011-06-06 change.
9349 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
9351         * window.h (resize_proportionally, orig_total_lines)
9352         (orig_top_line): Remove from window structure.
9353         (set_window_height, set_window_width, change_window_heights)
9354         (Fdelete_window): Remove prototypes.
9355         (resize_frame_windows): Remove duplicate declaration.
9357 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
9359         * window.h (resize_frame_windows, resize_window_check)
9360         (delete_deletable_window, resize_root_window)
9361         (resize_frame_windows): Declare prototypes.
9363         * window.c (resize_window_apply): Make definition be "static" to
9364         match the prototype.
9366 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
9368         * window.c: Remove declarations of Qwindow_size_fixed,
9369         window_min_size_1, window_min_size_2, window_min_size,
9370         size_window, window_fixed_size_p, enlarge_window, delete_window.
9371         Remove static from declaration of Qdelete_window, it's
9372         temporarily needed by Fbury_buffer.
9373         (replace_window): Don't assign orig_top_line and
9374         orig_total_lines.
9375         (Fdelete_window, delete_window): Remove.  Window deletion is
9376         handled by window.el.
9377         (window_loop): Remove DELETE_OTHER_WINDOWS case.
9378         Replace Fdelete_window calls with calls to Qdelete_window.
9379         (Fdelete_other_windows): Remove.  Deleting other windows is
9380         handled by window.el.
9381         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
9382         handled in window.el.
9383         (window_min_size_2, window_min_size_1, window_min_size): Remove.
9384         Window minimum sizes are handled in window.el.
9385         (shrink_windows, size_window, set_window_height)
9386         (set_window_width, change_window_heights, window_height)
9387         (window_width, CURBEG, CURSIZE, enlarge_window)
9388         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
9389         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
9390         handled in window.el.
9391         (make_dummy_parent): Rename to make_parent_window and give it a
9392         second argument horflag.
9393         (make_window): Don't set resize_proportionally any more.
9394         (Fsplit_window): Remove.  Windows are split in window.el.
9395         (save_restore_action, save_restore_orig_size)
9396         (shrink_window_lowest_first, save_restore_orig_size): Remove.
9397         Resize mini windows in window.el.
9398         (grow_mini_window, shrink_mini_window): Implement by calling
9399         Qresize_root_window_vertically, resize_window_check and
9400         resize_window_apply.
9401         (saved_window, Fset_window_configuration, save_window_save):
9402         Do not handle orig_top_line, orig_total_lines, and
9403         resize_proportionally.
9404         (window_min_height, window_min_width): Move to window.el.
9405         (keys_of_window): Move bindings for delete-other-windows,
9406         split-window, delete-window and enlarge-window to window.el.
9408         * buffer.c: Temporarily extern Qdelete_window.
9409         (Fbury_buffer): Temporarily call Qdelete_window instead of
9410         Fdelete_window (Fbury_buffer will move to window.el soon).
9412         * frame.c (set_menu_bar_lines_1): Remove code handling
9413         orig_top_line and orig_total_lines.
9415         * dispnew.c (adjust_frame_glyphs_initially): Don't use
9416         set_window_height but set heights directly.
9417         (change_frame_size_1): Use resize_frame_windows.
9419         * xdisp.c (init_xdisp): Don't use set_window_height but set
9420         heights directly.
9422         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
9423         Use resize_frame_windows instead of change_window_heights and run
9424         run_window_configuration_change_hook.
9426         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
9427         instead of change_window_heights and run
9428         run_window_configuration_change_hook.
9430 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
9432         * window.c (replace_window): Rename second argument REPLACEMENT to
9433         NEW.  New third argument SETFLAG.  Rewrite.
9434         (delete_window, make_dummy_parent): Call replace_window with
9435         third argument 1.
9436         (window_list_1): Move down in code.
9437         (run_window_configuration_change_hook): Move set_buffer part
9438         before select_frame_norecord part in order to unwind correctly.
9439         Rename count1 to count.
9440         (recombine_windows, delete_deletable_window, resize_root_window)
9441         (Fdelete_other_windows_internal)
9442         (Frun_window_configuration_change_hook, make_parent_window)
9443         (resize_window_check, resize_window_apply, Fresize_window_apply)
9444         (resize_frame_windows, Fsplit_window_internal)
9445         (Fdelete_window_internal, Fresize_mini_window_internal):
9446         New functions.
9447         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
9449 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
9451         * window.h (window): Add some new members to window structure -
9452         normal_lines, normal_cols, new_total, new_normal, clone_number,
9453         splits, nest, prev_buffers, next_buffers.
9454         (WINDOW_TOTAL_SIZE): Move here from window.c.
9455         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
9457         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
9458         Remove.
9459         (make_dummy_parent): Set new members of windows structure.
9460         (make_window): Move down in code.  Handle new members of window
9461         structure.
9462         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
9463         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
9464         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
9465         (Fset_window_prev_buffers, Fwindow_next_buffers)
9466         (Fset_window_next_buffers, Fset_window_clone_number):
9467         New functions.
9468         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
9469         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
9470         Doc-string fixes.
9471         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
9472         Argument WINDOW can be now internal window too.
9473         (Fwindow_use_time): Move up in code.
9474         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
9475         Rewrite doc-string.
9476         (Fset_window_configuration, saved_window)
9477         (Fcurrent_window_configuration, save_window_save): Handle new
9478         members of window structure.
9479         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
9480         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
9481         (syms_of_window): New Lisp objects Qrecord_window_buffer,
9482         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
9483         Qget_mru_window, Qresize_root_window,
9484         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
9485         Qauto_buffer_name; staticpro them.
9487 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
9489         * window.c (Fwindow_total_size, Fwindow_left_column)
9490         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
9491         (Fwindow_list_1): New functions.
9492         (window_box_text_cols): Replace with window_body_cols.
9493         (Fwindow_width, Fscroll_left, Fscroll_right):
9494         Use window_body_cols instead of window_box_text_cols.
9495         (delete_window, Fset_window_configuration):
9496         Call delete_all_subwindows with window as argument.
9497         (delete_all_subwindows): Take a window as argument and not a
9498         structure.  Rewrite.
9499         (window_loop): Remove handling of GET_LRU_WINDOW and
9500         GET_LARGEST_WINDOW.
9501         (Fget_lru_window, Fget_largest_window): Move to window.el.
9503         * window.h: Extern window_body_cols instead of
9504         window_box_text_cols.  delete_all_subwindows now takes a
9505         Lisp_Object as argument.
9507         * indent.c (compute_motion, Fcompute_motion):
9508         Use window_body_cols instead of window_box_text_cols.
9510         * frame.c (delete_frame): Call delete_all_subwindows with root
9511         window as argument.
9513 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
9515         * fns.c (Fputhash): Document return value.
9517 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
9519         * image.c (gif_load): Implement gif89a spec "no disposal" method.
9521 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
9523         Cons<->int and similar integer overflow fixes (Bug#8794).
9525         Check for overflow when converting integer to cons and back.
9526         * charset.c (Fdefine_charset_internal, Fdecode_char):
9527         Use cons_to_unsigned to catch overflow.
9528         (Fencode_char): Use INTEGER_TO_CONS.
9529         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
9530         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
9531         * data.c (long_to_cons, cons_to_long): Remove.
9532         (cons_to_unsigned, cons_to_signed): New functions.
9533         These signal an error for invalid or out-of-range values.
9534         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
9535         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
9536         * font.c (Ffont_variation_glyphs):
9537         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
9538         * lisp.h: Include <intprops.h>.
9539         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
9540         (cons_to_signed, cons_to_unsigned): New decls.
9541         (long_to_cons, cons_to_long): Remove decls.
9542         * undo.c (record_first_change): Use INTEGER_TO_CONS.
9543         (Fprimitive_undo): Use CONS_TO_INTEGER.
9544         * xfns.c (Fx_window_property): Likewise.
9545         * xselect.c: Include <limits.h>.
9546         (x_own_selection, selection_data_to_lisp_data):
9547         Use INTEGER_TO_CONS.
9548         (x_handle_selection_request, x_handle_selection_clear)
9549         (x_get_foreign_selection, Fx_disown_selection_internal)
9550         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
9551         (lisp_data_to_selection_data): Use cons_to_unsigned.
9552         (x_fill_property_data): Use cons_to_signed.
9553         Report values out of range.
9555         Check for buffer and string overflow more precisely.
9556         * buffer.h (BUF_BYTES_MAX): New macro.
9557         * lisp.h (STRING_BYTES_MAX): New macro.
9558         * alloc.c (Fmake_string):
9559         * character.c (string_escape_byte8):
9560         * coding.c (coding_alloc_by_realloc):
9561         * doprnt.c (doprnt):
9562         * editfns.c (Fformat):
9563         * eval.c (verror):
9564         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
9565         since they may not be the same number.
9566         * editfns.c (Finsert_char):
9567         * fileio.c (Finsert_file_contents):
9568         Likewise for BUF_BYTES_MAX.
9570         * image.c: Use ptrdiff_t, not int, for sizes.
9571         (slurp_file): Switch from int to ptrdiff_t.
9572         All uses changed.
9573         (slurp_file): Check that file size fits in both size_t (for
9574         malloc) and ptrdiff_t (for sanity and safety).
9576         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
9577         if b->modtime has its maximal value.
9579         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
9581         Don't assume time_t can fit into int.
9582         * buffer.h (struct buffer.modtime): Now time_t, not int.
9583         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
9584         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
9586         Minor fixes for signed vs unsigned integers.
9587         * character.h (MAYBE_UNIFY_CHAR):
9588         * charset.c (maybe_unify_char):
9589         * keyboard.c (read_char, reorder_modifiers):
9590         XINT -> XFASTINT, since the integer must be nonnegative.
9591         * ftfont.c (ftfont_spec_pattern):
9592         * keymap.c (access_keymap, silly_event_symbol_error):
9593         XUINT -> XFASTINT, since the integer must be nonnegative.
9594         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
9595         since it makes no difference and we prefer signed.
9596         * keyboard.c (record_char): Use XUINT when all the neighbors do.
9597         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
9598         nonnegative.
9600 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
9602         * window.h (Fwindow_frame): Declare.
9604 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
9606         * alloc.c: Simplify handling of large-request failures (Bug#8800).
9607         (SPARE_MEMORY): Always define.
9608         (LARGE_REQUEST): Remove.
9609         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
9611 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
9613         * lisp.h: Move EXFUNS for Fframe_root_window,
9614         Fframe_first_window and Fset_frame_selected_window to window.h.
9616         * window.h: Move EXFUNS for Fframe_root_window,
9617         Fframe_first_window and Fset_frame_selected_window here from
9618         lisp.h.
9620         * frame.c (Fwindow_frame, Fframe_first_window)
9621         (Fframe_root_window, Fframe_selected_window)
9622         (Fset_frame_selected_window): Move to window.c.
9623         (Factive_minibuffer_window): Move to minibuf.c.
9624         (Fother_visible_frames_p): New function.
9626         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
9628         * window.c (decode_window, decode_any_window): Move up in code.
9629         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
9630         (inhibit_frame_unsplittable): Remove unused variable.
9631         (Fwindow_buffer): Move up and rewrite doc-string.
9632         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
9633         (Fwindow_prev): New functions.
9634         (Fwindow_frame): Move here from frame.c.  Accept any window as
9635         argument.
9636         (Fframe_root_window, Fframe_first_window)
9637         (Fframe_selected_window): Move here from frame.c.  Accept frame
9638         or arbitrary window as argument.  Update doc-strings.
9639         (Fminibuffer_window): Move up in code.
9640         (Fwindow_minibuffer_p): Move up in code and simplify.
9641         (Fset_frame_selected_window): Move here from frame.c.
9642         Marginal rewrite.
9643         (Fselected_window, select_window, Fselect_window): Move up in
9644         code.  Minor doc-string fixes.
9646 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
9648         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
9649         Do not assume that spare memory exists; that assumption is valid
9650         only if SYSTEM_MALLOC.
9651         (LARGE_REQUEST): New macro, so that the issue of large requests
9652         is separated from the issue of spare memory.
9654 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
9656         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
9657         format.  (Bug#8806)
9659         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
9661         * xfns.c (x_set_scroll_bar_default_width): Move declarations
9662         before statements.
9664 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
9666         * gtkutil.c (xg_get_default_scrollbar_width): New function.
9668         * gtkutil.h: Declare xg_get_default_scrollbar_width.
9670         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
9671         min width by calling x_set_scroll_bar_default_width (Bug#8505).
9673 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
9675         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
9677 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
9679         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
9680         (x_clipboard_manager_save): Add return value.
9681         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
9682         New error handlers.
9683         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
9684         Obey Vx_select_enable_clipboard_manager.  Catch errors in
9685         x_clipboard_manager_save (Bug#8779).
9686         (Vx_select_enable_clipboard_manager): New variable.
9687         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
9689 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
9691         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
9693 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9695         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
9696         in the current matrix if keep_current_p is non-zero.
9698 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
9700         * bidi.c (bidi_level_of_next_char): Fix last change.
9702 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
9704         Support bidi reordering of text covered by display properties.
9706         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
9707         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
9708         (bidi_cache_search, bidi_cache_iterator_state)
9709         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
9710         (bidi_level_of_next_char, bidi_move_to_visually_next):
9711         Support character positions inside a run of characters covered by a
9712         display string.
9713         (bidi_paragraph_init, bidi_resolve_explicit_1)
9714         (bidi_level_of_next_char): Call bidi_fetch_char and
9715         bidi_fetch_char_advance instead of FETCH_CHAR and
9716         FETCH_CHAR_ADVANCE.
9717         (bidi_init_it): Initialize new members.
9718         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
9719         definitions.
9720         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
9721         instead of using explicit *_CHAR codes.
9722         (bidi_resolve_explicit, bidi_resolve_weak):
9723         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
9724         bidirectional text is supported only in multibyte buffers.
9725         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
9726         it to initialize the frame_window_p member of struct bidi_it.
9727         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
9728         (bidi_resolve_explicit, bidi_resolve_weak)
9729         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
9730         bidi_it->nchars is non-positive.
9731         (bidi_level_of_next_char): Don't try to lookup the cache for the
9732         next/previous character if nothing is cached there yet, or if we
9733         were just reseat()'ed to a new position.
9735         * xdisp.c (set_cursor_from_row): Set start and stop points
9736         according to the row's direction when priming the loop that looks
9737         for the glyph on which to display cursor.
9738         (single_display_spec_intangible_p): Function deleted.
9739         (display_prop_intangible_p): Reimplement to call
9740         handle_display_spec instead of single_display_spec_intangible_p.
9741         Accept 3 additional arguments needed by handle_display_spec.
9742         This fixes incorrect cursor motion across display property with complex
9743         values: lists, `(when COND...)' forms, etc.
9744         (single_display_spec_string_p): Support property values that are
9745         lists with the argument STRING its top-level element.
9746         (display_prop_string_p): Fix the condition for processing a
9747         property that is a list to be consistent with handle_display_spec.
9748         (handle_display_spec): New function, refactored from the
9749         last portion of handle_display_prop.
9750         (compute_display_string_pos): Accept additional argument
9751         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
9752         value of a `display' property is a "replacing spec".
9753         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
9754         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
9755         the display property, but just return a value indicating whether
9756         the display property will replace the characters it covers.
9757         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
9758         frame_window_p members of struct bidi_it.
9759         (compute_display_string_pos, compute_display_string_end):
9760         New functions.
9761         (push_it): Accept second argument POSITION, where pop_it should
9762         jump to continue iteration.
9763         (reseat_1): Initialize bidi_it.disp_pos.
9765         * keyboard.c (adjust_point_for_property): Adjust the call to
9766         display_prop_intangible_p to its new signature.
9768         * dispextern.h (struct bidi_it): New member frame_window_p.
9769         (bidi_init_it): Update prototypes.
9770         (display_prop_intangible_p): Update prototype.
9771         (compute_display_string_pos, compute_display_string_end):
9772         Declare prototypes.
9773         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
9774         EMACS_INT.
9776 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
9778         Malloc failure behavior now depends on size of allocation.
9779         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
9780         * lisp.h: Change signatures accordingly.
9781         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
9782         All callers changed.  (Bug#8762)
9784         * gnutls.c: Use Emacs's memory allocators.
9785         Without this change, the gnutls library would invoke malloc etc.
9786         directly, which causes problems on non-SYNC_INPUT hosts, and which
9787         runs afoul of improving memory_full behavior.  (Bug#8761)
9788         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
9789         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
9790         xfree instead of the default malloc, realloc, free.
9791         (Fgnutls_boot): No need to check for memory allocation failure,
9792         since xmalloc does that for us.
9794         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
9795         * category.c (hash_get_category_set):
9796         * ccl.c (ccl_driver):
9797         * charset.c (Fdefine_charset_internal):
9798         * charset.h (struct charset.hash_index):
9799         * composite.c (get_composition_id, gstring_lookup_cache)
9800         (composition_gstring_put_cache):
9801         * composite.h (struct composition.hash_index):
9802         * dispextern.h (struct image.hash):
9803         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
9804         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
9805         (hashfn_equal, hashfn_user_defined, make_hash_table)
9806         (maybe_resize_hash_table, hash_lookup, hash_put)
9807         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
9808         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
9809         (Fsxhash, Fgethash, Fputhash, Fmaphash):
9810         * image.c (make_image, search_image_cache, lookup_image)
9811         (xpm_put_color_table_h):
9812         * lisp.h (struct Lisp_Hash_Table):
9813         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
9814         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
9815         for hashes and hash indexes, instead of 'unsigned' and 'int'.
9816         * alloc.c (allocate_vectorlike):
9817         Check for overflow in vector size calculations.
9818         * ccl.c (ccl_driver):
9819         Check for overflow when converting EMACS_INT to int.
9820         * fns.c, image.c: Remove unnecessary static decls that would otherwise
9821         need to be updated by these changes.
9822         * fns.c (make_hash_table, maybe_resize_hash_table):
9823         Check for integer overflow with large hash tables.
9824         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
9825         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
9826         (SXHASH_REDUCE): New macro.
9827         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
9828         Use it instead of discarding useful hash info with large hash values.
9829         (sxhash_float): New function.
9830         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
9831         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
9832         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
9833         Rewrite to use FIXNUM_BITS, as this simplifies things.
9834         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
9835         Adjust signatures to match updated version of code.
9836         (consing_since_gc): Now EMACS_INT, since a single hash table can
9837         use more than INT_MAX bytes.
9839 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
9841         Make it possible to build with GCC-4.6+ -O2 -flto.
9843         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
9845 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
9847         * minibuf.c (get_minibuffer, read_minibuf_unwind):
9848         Call minibuffer-inactive-mode.
9850 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
9852         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
9853         Update dependencies.
9855 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
9857         * data.c (init_data): Remove code for UTS, this system is not
9858         supported anymore.
9860 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
9862         Don't force ./temacs to start in terminal mode.
9864         * frame.c (make_initial_frame): Initialize faces in all cases, not
9865         only when CANNOT_DUMP is defined.
9866         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
9868 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
9870         * dispnew.c (add_window_display_history): Use const for the string
9871         pointer.  Remove declaration, not needed.
9873 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
9875         Use 'inline', not 'INLINE'.
9876         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
9877         * alloc.c, fontset.c (INLINE): Remove.
9878         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
9879         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
9880         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
9881         * gmalloc.c (register_heapinfo): Use inline unconditionally.
9882         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
9884 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
9886         Make it possible to run ./temacs.
9888         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
9889         syms_of_callproc does the same thing.  Remove test for
9890         "initialized", do it in the caller.
9891         * emacs.c (main): Avoid calling set_initial_environment when dumping.
9893 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
9895         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
9896         (read_minibuf): Use get_minibuffer.
9897         (syms_of_minibuf): Use DEFSYM.
9898         (Qmetadata): New var.
9899         * data.c (Qbuffer): Don't make it static.
9900         (syms_of_data): Use DEFSYM.
9902 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
9904         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
9905         (CCL_CODE_MIN): New macro.
9907 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
9909         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
9911         * eval.c (Qdebug): Now static.
9912         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
9913         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
9914         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
9916 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
9918         * image.c: Various fixes to ImageMagick code comments.
9919         (Fimagemagick_types): Doc fix.
9921 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
9923         Minor fixes prompted by GCC 4.6.0 warnings.
9925         * xselect.c (converted_selections, conversion_fail_tag): Now static.
9927         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
9928         (x_clipboard_manager_save_all): Move extern decl to ...
9929         * xterm.h: ... here, so that it can be checked for consistency.
9931 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
9933         * xselect.c (x_clipboard_manager_save_frame)
9934         (x_clipboard_manager_save_all): New functions.
9935         (Fx_clipboard_manager_save): Lisp function deleted.
9937         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
9938         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
9940         * xterm.h: Update prototype.
9942 2011-05-28  William Xu  <william.xwl@gmail.com>
9944         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
9945         exiting (Bug#8239).
9947 2011-05-28  Jim Meyering  <meyering@redhat.com>
9949         Avoid a sign-extension bug in crypto_hash_function.
9950         * fns.c (to_uchar): Define.
9951         (crypto_hash_function): Use it to convert some newly-signed
9952         variables to unsigned, to avoid sign-extension bugs.  For example,
9953         without this change, (md5 "truc") would evaluate to
9954         45723a2aff78ff4fff7fff1114760e62 rather than the expected
9955         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
9956         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
9958 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
9960         Integer overflow fixes.
9962         * dbusbind.c: Serial number integer overflow fixes.
9963         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
9964         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
9965         to hold a serial number that is too large for a fixnum.
9966         (Fdbus_method_return_internal, Fdbus_method_error_internal):
9967         Check for serial numbers out of range.  Decode any serial number
9968         that was so large that it became a float.  (Bug#8722)
9970         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
9971         (Fdbus_call_method, Fdbus_call_method_asynchronously):
9972         Use XFASTINT rather than XUINT when numbers are nonnegative.
9973         (xd_append_arg, Fdbus_method_return_internal):
9974         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
9975         arguments, check that Lisp number is nonnegative, rather than
9976         silently wrapping negative numbers around.  (Bug#8722)
9977         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
9978         (Bug#8722)
9980         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
9982         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
9984         ccl: Add integer overflow checks.
9985         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
9986         (IN_INT_RANGE): New macros.
9987         (ccl_driver): Use them to check for integer overflow when
9988         decoding a CCL program.  Many of the new checks are whether XINT (x)
9989         fits in int; it doesn't always, on 64-bit hosts.  The new version
9990         doesn't catch all possible integer overflows, but it's an
9991         improvement.  (Bug#8719)
9993         * alloc.c (make_event_array): Use XINT, not XUINT.
9994         There's no need for unsigned here.
9996         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
9997         This follows up to the 2011-05-06 change that substituted uintptr_t
9998         for EMACS_INT.  This case wasn't caught back then.
10000         Rework Fformat to avoid integer overflow issues.
10001         * editfns.c: Include <float.h> unconditionally, as it's everywhere
10002         now (part of C89).  Include <verify.h>.
10003         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
10004         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
10005         (Fformat): Avoid the prepass trying to compute sizes; it was only
10006         approximate and thus did not catch overflow reliably.  Instead, walk
10007         through the format just once, formatting and computing sizes as we go,
10008         checking for integer overflow at every step, and allocating a larger
10009         buffer as needed.  Keep track separately whether the format is
10010         multibyte.  Keep only the most-recently calculated precision, rather
10011         than them all.  Record whether each argument has been converted to
10012         string.  Use EMACS_INT, not int, for byte and char and arg counts.
10013         Support field widths and precisions larger than INT_MAX.  Avoid
10014         sprintf's undefined behavior with conversion specifications such as %#d
10015         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
10016         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
10017         formatting out-of-range floating point numbers with int
10018         formats.  (Bug#8668)
10020         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
10022         * data.c: Avoid integer truncation in expressions involving floats.
10023         * data.c: Include <intprops.h>.
10024         (arith_driver): When there's an integer overflow in an expression
10025         involving floating point, convert the integers to floating point
10026         so that the resulting value does not suffer from catastrophic
10027         integer truncation.  For example, on a 64-bit host (* 4
10028         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
10029         Do not rely on undefined behavior after integer overflow.
10031         merge count_size_as_multibyte, parse_str_to_multibyte
10032         * character.c, character.h (count_size_as_multibyte):
10033         Rename from parse_str_to_multibyte; all uses changed.
10034         Check for integer overflow.
10035         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
10036         since it's now a duplicate of the other.  This is more of
10037         a character than a buffer op, so better that it's in character.c.
10038         * fns.c, print.c: Adjust to above changes.
10040 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
10042         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
10044 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
10046         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10047         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
10048         (x_clipboard_manager_save): Now static.
10049         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
10051         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
10052         (crypto_hash_function): Now static.
10053         Fix pointer signedness problems.  Avoid unnecessary initializations.
10055 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
10057         * termhooks.h (Vselection_alist): Make it terminal-local.
10059         * terminal.c (create_terminal): Initialize it.
10061         * xselect.c: Support for clipboard managers.
10062         (Vselection_alist): Move to termhooks.h as terminal-local var.
10063         (LOCAL_SELECTION): New macro.
10064         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
10065         (symbol_to_x_atom): Remove gratuitous arg.
10066         (x_handle_selection_request, lisp_data_to_selection_data)
10067         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
10068         (x_own_selection, x_get_local_selection, x_convert_selection):
10069         New arg, specifying work frame.  Use terminal-local Vselection_alist.
10070         (some_frame_on_display): Delete unused function.
10071         (Fx_own_selection_internal, Fx_get_selection_internal)
10072         (Fx_disown_selection_internal, Fx_selection_owner_p)
10073         (Fx_selection_exists_p): New optional frame arg.
10074         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
10075         (x_handle_selection_clear): Don't treat other terminals with the
10076         same keyboard specially.  Use the terminal-local Vselection_alist.
10077         (x_clear_frame_selections): Use Frun_hook_with_args.
10079         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
10081         * xterm.h: Add support for those atoms.
10083 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
10085         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
10086         (converted_selections, conversion_fail_tag): New global variables.
10087         (x_selection_request_lisp_error): Free the above.
10088         (x_get_local_selection): Remove unnecessary code.
10089         (x_reply_selection_request): Args changed; handle arbitrary array
10090         of converted selections stored in converted_selections.
10091         Separate the XChangeProperty and SelectionNotify steps.
10092         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
10093         (x_convert_selection): New function.
10094         (x_handle_selection_event): Simplify.
10095         (x_get_foreign_selection): Don't ignore incoming requests while
10096         waiting for an answer; this will fail when we implement
10097         SAVE_TARGETS, and seems unnecessary anyway.
10098         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
10099         (Vx_sent_selection_functions): Doc fix.
10101 2011-05-26  Leo Liu  <sdl.web@gmail.com>
10103         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
10105 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10107         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
10109         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
10110         for fringe update if it has periodic bitmap.
10111         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
10112         and fringe_bitmap_periodic_p.
10114         * fringe.c (get_fringe_bitmap_data): New function.
10115         (draw_fringe_bitmap_1, update_window_fringes): Use it.
10116         (update_window_fringes): Record periodicity of fringe bitmap in glyph
10117         row.  Mark glyph row for fringe update if periodicity changed.
10119         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
10120         for fringe update unless it has periodic bitmap.
10122 2011-05-25  Kenichi Handa  <handa@m17n.org>
10124         * xdisp.c (get_next_display_element): Set correct it->face_id for
10125         a static composition.
10127 2011-05-24  Leo Liu  <sdl.web@gmail.com>
10129         * deps.mk (fns.o):
10130         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
10132         * fns.c (crypto_hash_function, Fsha1): New function.
10133         (Fmd5): Use crypto_hash_function.
10134         (syms_of_fns): Add Ssha1.
10136 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
10138         * gnutls.c: Remove unused macros.
10139         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
10140         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
10141         Remove macros that are defined and never used.
10142         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
10144 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
10146         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
10147         (Fx_get_selection_internal): Minor cleanup.
10148         (Fx_own_selection_internal): Rename arguments for consistency with
10149         select.el.
10151 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
10153         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
10155 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
10157         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
10159 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10161         * dispnew.c (scrolling_window): Don't exclude the case that the
10162         last enabled row in the desired matrix touches the bottom boundary.
10164 2011-05-21  Glenn Morris  <rgm@gnu.org>
10166         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
10167         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
10168         and add some more files.
10170 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
10172         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
10173         report_file_error introduced by the change from 2011-05-07.
10175 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
10177         * systime.h (Time): Define only if emacs is defined.
10178         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
10179         where the include path doesn't have X11/X.h by default.  See
10180         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
10182 2011-05-20  Kenichi Handa  <handa@m17n.org>
10184         * composite.c (find_automatic_composition): Fix previous change.
10186 2011-05-20  Glenn Morris  <rgm@gnu.org>
10188         * lisp.mk: New file, split from Makefile.in.
10189         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
10190         (shortlisp): Remove.
10191         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
10193 2011-05-19  Glenn Morris  <rgm@gnu.org>
10195         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
10196         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
10197         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
10198         (lisp): Set the order to that of loadup.el.
10199         (shortlisp): Make it a copy of $lisp.
10200         (SOME_MACHINE_LISP): Remove.
10201         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
10202         Use just $shortlisp, not $SOME_MACHINE_LISP too.
10204 2011-05-18  Kenichi Handa  <handa@m17n.org>
10206         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
10207         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
10208         (find_automatic_composition): Mostly rewrite for efficiency.
10210 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
10212         * makefile.w32-in: Update dependencies.
10214 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
10216         * menu.c: Include limits.h (fixes the MS-Windows build broken by
10217         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
10219 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
10221         Fix some integer overflow issues, such as string length overflow.
10223         * insdel.c (count_size_as_multibyte): Check for string overflow.
10225         * character.c (lisp_string_width): Check for string overflow.
10226         Use EMACS_INT, not int, for string indexes and lengths; in
10227         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
10228         the resulting string length overflows an EMACS_INT; instead,
10229         report a string overflow if no precision given.  When checking for
10230         precision exhaustion, use a check that cannot possibly have
10231         integer overflow.  (Bug#8675)
10232         * character.h (lisp_string_width): Adjust to new signature.
10234         * alloc.c (string_overflow): New function.
10235         (Fmake_string): Use it.  This doesn't change behavior, but saves
10236         a few bytes and will simplify future changes.
10237         * character.c (string_escape_byte8): Likewise.
10238         * lisp.h (string_overflow): New decl.
10240         Fixups, following up to the user-interface timestamp change.
10241         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
10242         for UI timestamps, instead of unsigned long.
10243         * msdos.c (mouse_get_pos): Likewise.
10244         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
10245         * w32gui.h (Time): Define by including "systime.h" rather than by
10246         declaring it ourselves.  (Bug#8664)
10248         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
10249         * image.c (clear_image_cache): Likewise.
10251         * term.c (term_mouse_position): Don't assume time_t wraparound.
10253         Be more systematic about user-interface timestamps.
10254         Before, the code sometimes used 'Time', sometimes 'unsigned long',
10255         and sometimes 'EMACS_UINT', to represent these timestamps.
10256         This change causes it to use 'Time' uniformly, as that's what X uses.
10257         This makes the code easier to follow, and makes it easier to catch
10258         integer overflow bugs such as Bug#8664.
10259         * frame.c (Fmouse_position, Fmouse_pixel_position):
10260         Use Time, not unsigned long, for user-interface timestamps.
10261         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
10262         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
10263         * keyboard.h (last_event_timestamp): Likewise.
10264         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
10265         * menu.h (xmenu_show): Likewise.
10266         * term.c (term_mouse_position): Likewise.
10267         * termhooks.h (struct input_event.timestamp): Likewise.
10268         (struct terminal.mouse_position_hook): Likewise.
10269         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
10270         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
10271         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
10272         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
10273         what it was before.
10274         * menu.h, termhooks.h: Include "systime.h", for Time.
10276         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
10277         Don't assume that the difference between two unsigned long values
10278         can fit into an integer.  At this point, we know button_down_time
10279         <= event->timestamp, so the difference must be nonnegative, so
10280         there's no need to cast the result if double-click-time is
10281         nonnegative, as it should be; check that it's nonnegative, just in
10282         case.  This bug is triggered when events are more than 2**31 ms
10283         apart (about 25 days).  (Bug#8664)
10285         * xselect.c (last_event_timestamp): Remove duplicate decl.
10286         (x_own_selection): Remove needless cast to unsigned long.
10288         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
10289         that always fit in int.  Use a sentinel instead of a counter, to
10290         avoid a temp and to allay GCC's concerns about possible int overflow.
10291         * frame.h (struct frame): Use int for menu_bar_items_used
10292         instead of EMACS_INT, since it always fits in int.
10294         * menu.c (grow_menu_items): Check for int overflow.
10296         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
10298         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
10299         Before, the code was not consistent.  These values cannot exceed
10300         2**31 - 1 so there's no need to make them unsigned.
10301         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
10302         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
10303         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
10304         as modifiers.
10305         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
10307         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
10308         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
10309         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
10310         presumably because the widths might not match.
10312         * window.c (size_window): Avoid needless test at loop start.
10314 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
10316         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
10318 2011-05-12  Drew Adams  <drew.adams@oracle.com>
10320         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
10322 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10324         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
10325         `width' to `bar_area_x' and `bar_area_width', respectively.
10326         (x_scroll_run): Take account of fringe background extension.
10328         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
10329         Rename local vars `left' and `width' to `bar_area_x' and
10330         `bar_area_width', respectively.
10331         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
10332         background extension.
10334 2011-05-10  Jim Meyering  <meyering@redhat.com>
10336         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
10338 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
10340         * image.c (Finit_image_library): Return t for built-in image types,
10341         like pbm and xbm.  (Bug#8640)
10343 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
10345         * w32menu.c (set_frame_menubar): Fix submenu allocation.
10347 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
10349         * w32console.c (Fset_screen_color): Doc fix.
10350         (Fget_screen_color): New function.
10351         (syms_of_ntterm): Defsubr it.
10353         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
10354         unlink the temporary file if Fcall_process didn't create it in the
10355         first place.
10356         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
10357         child process will be redirected to a file specified with `:file'.
10358         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
10359         cue to call_process_cleanup not to close that handle.
10361 2011-05-07  Ben Key  <bkey76@gmail.com>
10363         * makefile.w32-in: The bootstrap-temacs rule now makes use of
10364         one of two shell specific rules, either bootstrap-temacs-CMD or
10365         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
10366         to the previous implementation of the bootstrap-temacs rule.
10367         The bootstrap-temacs-CMD rule is similar to the previous
10368         implementation of the bootstrap-temacs rule except that it
10369         makes use of the ESC_CFLAGS variable instead of the CFLAGS
10370         variable.
10372         These changes, along with some changes to nt/configure.bat,
10373         nt/gmake.defs, and nt/nmake.defs, are required to extend my
10374         earlier fix to add support for --cflags and --ldflags options
10375         that include quotes so that it works whether make uses cmd or
10376         sh as the shell.
10378 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
10380         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
10381         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
10382         is a constant.
10383         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
10384         a string.  Handle both cases.
10385         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
10386         (Fdbus_register_method): Use Qinvalid_function.
10388 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
10390         * makefile.w32-in: Update dependencies.
10391         (LISP_H): Add inttypes.h and stdin.h.
10392         (PROCESS_H): Add unistd.h.
10394 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
10396         * lread.c: Include limits.h (fixes the MS-Windows build broken by
10397         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
10399 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
10401         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
10403         * term.c (vfatal): Remove stray call to va_end.
10404         It's not needed and the C Standard doesn't allow it here anyway.
10406         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
10407         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
10409         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
10410         bytes.
10412         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
10414         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10416         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
10418         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
10420         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
10422         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
10423         * charset.c (Fdefine_charset_internal): Don't initialize
10424         charset.code_space[15].  The value was garbage, on hosts with
10425         32-bit int (Bug#8600).
10427         * lread.c (read_integer): Be more consistent with string-to-number.
10428         Use string_to_number to do the actual conversion; this avoids
10429         rounding errors and fixes some other screwups.  Without this fix,
10430         for example, #x1fffffffffffffff was misread as -2305843009213693952.
10431         (digit_to_number): Move earlier, for benefit of read_integer.
10432         Return -1 if the digit is out of range for the base, -2 if it is
10433         not a digit in any supported base.  (Bug#8602)
10435         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
10437         * dispnew.c (scrolling_window): Return 1 if we scrolled,
10438         to match comment at start of function.  This also removes a
10439         GCC warning about overflow in a 32+64-bit port.
10441         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
10443         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
10444         Reported by Stefan Monnier in
10445         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
10446         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10447         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
10449         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
10450         (EMACS_UINTPTR): Likewise, with uintptr_t.
10452         * lisp.h: Prefer 64-bit EMACS_INT if available.
10453         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
10454         on 32-bit hosts that have 64-bit int, so that they can access
10455         large files.
10456         However, temporarily disable this change unless the temporary
10457         symbol WIDE_EMACS_INT is defined.
10459         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
10461         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
10462         This removes an assumption that EMACS_INT and long are the same
10463         width as pointers.  The assumption is true for Emacs porting targets
10464         now, but we want to make other targets possible.
10465         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
10466         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
10467         In the rest of the code, change types of integers that hold casted
10468         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
10469         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
10470         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
10471         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
10472         No need to cast type when ORing.
10473         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
10474         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
10475         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
10476         assume EMACS_INT is the same width as char *.
10477         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
10478         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
10479         Remove no-longer-needed casts.
10480         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
10481         (xg_tool_bar_help_callback, xg_make_tool_item):
10482         Use EMACS_INTPTR to hold an integer
10483         that will be cast to void *; this can avoid a GCC warning
10484         if EMACS_INT is not the same width as void *.
10485         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
10486         * xdisp.c (display_echo_area_1, resize_mini_window_1):
10487         (current_message_1, set_message_1):
10488         Use a local to convert to proper width without a cast.
10489         * xmenu.c (dialog_selection_callback): Likewise.
10491         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
10492         Also, don't assume VALBITS / RAND_BITS is less than 5,
10493         and don't rely on undefined behavior when shifting a 1 left into
10494         the sign bit.
10495         * lisp.h (get_random): Change signature to match.
10497         * lread.c (hash_string): Use size_t, not int, for hash computation.
10498         Normally we prefer signed values; but hashing is special, because
10499         it's better to use unsigned division on hash table sizes so that
10500         the remainder is nonnegative.  Also, size_t is the natural width
10501         for hashing into memory.  The previous code used 'int', which doesn't
10502         retain enough info to hash well into very large tables.
10503         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
10505         * dbusbind.c: Don't possibly lose pointer info when converting.
10506         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
10507         Use XPNTR rather than XHASH, so that the high-order bits of
10508         the pointer aren't lost when converting through void *.
10510         * eval.c (Fautoload): Don't double-shift a pointer.
10512         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
10514 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
10516         * gnutls.c (DEF_GNUTLS_FN):
10517         * image.c (DEF_IMGLIB_FN): Make function pointers static.
10519 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
10521         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
10522         marker.  (Bug#8610)
10524 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
10526         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
10527         New version that can reserve upto 2GB of heap space.
10529 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
10531         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
10533 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
10535         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
10536         `gnutls_certificate_set_x509_key_file'.
10538 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
10540         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
10541         Update dependencies.
10543 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
10545         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
10546         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
10547         Remove unused parameter `fildes'.
10548         * process.c (read_process_output, send_process): Don't pass it.
10550 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
10552         Fix previous change: the library cache is defined in w32.c.
10553         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
10554         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
10556 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
10558         Implement dynamic loading of GnuTLS on Windows.
10560         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
10561         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
10562         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10563         Declare.
10565         * gnutls.c (Qgnutls_dll): Define.
10566         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
10567         (gnutls_*): Declare function pointers.
10568         (init_gnutls_functions): New function to initialize function pointers.
10569         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
10570         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
10571         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
10572         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
10573         (emacs_gnutls_write, emacs_gnutls_read)
10574         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
10575         (Fgnutls_available_p): New function.
10576         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
10577         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
10578         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
10580         * image.c: Include w32.h.
10581         (Vimage_type_cache): Delete.
10582         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
10583         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
10584         (w32_delayed_load): Move to w32.c.
10586         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
10588         * w32.c (QCloaded_from, Vlibrary_cache): Define.
10589         (w32_delayed_load): Move from image.c.  When loading a library, record
10590         its filename in the :loaded-from property of the library id.
10591         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
10592         Initialize and staticpro them.
10593         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
10595         * process.c: Include lisp.h before w32.h, not after.
10596         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
10597         instead of gnutls_record_check_pending.
10599         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
10601 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
10603         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
10604         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
10605         as passed in.
10607 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
10609         * xterm.c (x_set_frame_alpha): Do not set property on anything
10610         else than FRAME_X_OUTER_WINDOW (Bug#8608).
10612 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
10614         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
10616 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
10618         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
10619         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
10620         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
10621         (gnutls_global_initialized, Qgnutls_bootprop_priority)
10622         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
10623         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
10624         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
10625         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
10626         (Qgnutls_bootprop_callbacks_verify): Make static.
10628 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
10630         * callproc.c: Indentation fixup.
10632         * sysdep.c (wait_for_termination_1): Make static.
10633         (wait_for_termination, interruptible_wait_for_termination):
10634         Move after wait_for_termination_1.
10636 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10638         * sysdep.c (interruptible_wait_for_termination): New function
10639         which is like wait_for_termination, but allows keyboard
10640         interruptions.
10642         * callproc.c (Fcall_process): Add (:file "file") as an option for
10643         the STDOUT buffer.
10644         (Fcall_process_region): Ditto.
10646 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
10648         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
10649         rather than `XVECTOR (FOO)->size'.
10651         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
10652         inttypes.h, as a gnulib replacement is used if it not available in
10653         system headers.
10655 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
10657         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
10658         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
10659         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
10661         * coding.c (coding_alloc_by_realloc): Error out if destination
10662         will grow beyond MOST_POSITIVE_FIXNUM.
10663         (decode_coding_emacs_mule): Abort if there isn't enough place in
10664         charbuf for the composition carryover bytes.  Reserve an extra
10665         space for up to 2 characters produced in a loop.
10666         (decode_coding_iso_2022): Abort if there isn't enough place in
10667         charbuf for the composition carryover bytes.
10669 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
10671         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
10672         aborting when %lld or %lll format is passed.
10673         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
10674         %llo or %llx format is passed.  (Bug#8545)
10676         * window.c (window_scroll_line_based): Use a marker instead of
10677         simple variables to record original value of point.  (Bug#7952)
10679         * doprnt.c (doprnt): Fix the case where a multibyte sequence
10680         produced by %s or %c overflows available buffer space.  (Bug#8545)
10682 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
10684         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
10685         (SIZE_MAX): Move defn after all includes, as they might #define it.
10687 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
10689         * w32.c (init_environment): Warn about defaulting HOME to C:\.
10691 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
10693         * keyboard.c (Qdelayed_warnings_hook): Define.
10694         (command_loop_1): Run `delayed-warnings-hook'
10695         if Vdelayed_warnings_list is non-nil.
10696         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
10697         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
10699 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
10701         * doprnt.c (doprnt): Don't return value smaller than the buffer
10702         size if the message was truncated.  (Bug#8545).
10704 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
10706         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
10707         (Fx_window_property): #if-0 the whole functions, not just the bodies.
10709 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
10711         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
10713 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
10715         * makefile.w32-in: Update dependencies.
10717 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
10719         Improve `doprnt' and its usage.  (Bug#8545)
10720         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
10721         `format_end'.  Remove support for %l as a conversion specifier.
10722         Don't use xrealloc.  Improve diagnostics when the %l size modifier
10723         is used.  Update the commentary.
10725         * eval.c (verror): Simplify calculation of size_t.
10727         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
10728         messages.
10730 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
10732         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
10733         change.
10735 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
10737         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
10738         This makes this file independent of the recent pseudovector change.
10740 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
10742         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
10744         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
10745         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
10746         Remove unused local.
10747         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
10749         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
10750         GCC 4.6.0 optimizes based on type-based alias analysis.
10751         For example, if b is of type struct buffer * and v of type struct
10752         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
10753         != &v->size, and therefore "v->size = 1; b->size = 2; return
10754         v->size;" must therefore return 1.  This assumption is incorrect
10755         for Emacs, since it type-puns struct Lisp_Vector * with many other
10756         types.  To fix this problem, this patch adds a new type struct
10757         vectorlike_header that documents the constraints on layout of vectors
10758         and pseudovectors, and helps optimizing compilers not get fooled
10759         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
10760         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
10761         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
10762         the size member.
10763         (XSETPVECTYPE): Rewrite in terms of new macro.
10764         (XSETPVECTYPESIZE): New macro, specifying both type and size.
10765         This is a bit clearer, and further avoids the possibility of
10766         undesirable aliasing.
10767         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
10768         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
10769         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
10770         since Lisp_Subr is a special case (no "next" field).
10771         (ASIZE): Now uses header.size rather than size.
10772         All previous uses of XVECTOR (foo)->size replaced to use this macro,
10773         to avoid the hassle of writing XVECTOR (foo)->header.size.
10774         (struct vectorlike_header): New type.
10775         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
10776         object, to help avoid aliasing.
10777         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
10778         (SUBRP): Likewise, since Lisp_Subr is a special case.
10779         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
10780         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
10781         (struct Lisp_Hash_Table): Combine first two members into a single
10782         struct vectorlike_header member.  All uses of "size" and "next" members
10783         changed to be "header.size" and "header.next".
10784         * buffer.h (struct buffer): Likewise.
10785         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
10786         * frame.h (struct frame): Likewise.
10787         * process.h (struct Lisp_Process): Likewise.
10788         * termhooks.h (struct terminal): Likewise.
10789         * window.c (struct save_window_data, struct saved_window): Likewise.
10790         * window.h (struct window): Likewise.
10791         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
10792         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
10793         * buffer.c (init_buffer_once): Likewise.
10794         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
10795         special case.
10796         * process.c (Fformat_network_address): Use local var for size,
10797         for brevity.
10799         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
10801         Make the Lisp reader and string-to-float more consistent (Bug#8525)
10802         * data.c (atof): Remove decl; no longer used or needed.
10803         (digit_to_number): Move to lread.c.
10804         (Fstring_to_number): Use new string_to_number function, to be
10805         consistent with how the Lisp reader treats infinities and NaNs.
10806         Do not assume that floating-point numbers represent EMACS_INT
10807         without losing information; this is not true on most 64-bit hosts.
10808         Avoid double-rounding errors, by insisting on integers when
10809         parsing non-base-10 numbers, as the documentation specifies.
10810         * lisp.h (string_to_number): New decl, replacing ...
10811         (isfloat_string): Remove.
10812         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
10813         (read1): Do not accept +. and -. as integers; this
10814         appears to have been a coding error.  Similarly, do not accept
10815         strings like +-1e0 as floating point numbers.  Do not report
10816         overflow for integer overflows unless the base is not 10 which
10817         means we have no simple and reliable way to continue.
10818         Break out the floating-point parsing into a new
10819         function string_to_number, so that Fstring_to_number parses
10820         floating point numbers consistently with the Lisp reader.
10821         (digit_to_number): Move here from data.c.  Make it static inline.
10822         (E_CHAR, EXP_INT): Remove, replacing with ...
10823         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
10824         (string_to_number): New function, replacing isfloat_string.
10825         This function checks for valid syntax and produces the resulting
10826         Lisp float number too.  Rework it so that string-to-number
10827         no longer mishandles examples like "1.0e+".  Use strtoumax,
10828         so that overflow for non-base-10 numbers is reported only when
10829         there's no portable and simple way to convert to floating point.
10831         * textprop.c (set_text_properties_1): Rewrite for clarity,
10832         and to avoid GCC warning about integer overflow.
10834         * intervals.h (struct interval): Use EMACS_INT for members
10835         where EMACS_UINT might cause problems.  See
10836         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
10837         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
10838         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
10839         All uses changed.
10840         (offset_intervals): Tell GCC not to worry about length overflow
10841         when negating a negative length.
10843         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
10844         (overrun_check_free): Likewise.
10846         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
10847         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
10848         word size.
10850         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10851         (gnutls_make_error): Rename local to avoid shadowing.
10852         (gnutls_emacs_global_deinit): ifdef out; not used.
10853         (Fgnutls_boot): Use const for pointer to readonly storage.
10854         Comment out unused local.  Fix pointer signedness problems.
10856         * lread.c (openp): Don't stuff size_t into an 'int'.
10857         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
10858         about possible signed overflow.
10860         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
10861         (GDK_KEY_g): Don't define if already defined.
10862         (xg_prepare_tooltip): Avoid pointer signedness problem.
10863         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
10865         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
10866         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
10868         * xfns.c (Fx_window_property): Simplify a bit,
10869         to make a bit faster and to avoid GCC 4.6.0 warning.
10870         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
10872         * fns.c (internal_equal): Don't assume size_t fits in int.
10874         * alloc.c (compact_small_strings): Tighten assertion a little.
10876         Replace pEd with more-general pI, and fix some printf arg casts.
10877         * lisp.h (pI): New macro, generalizing old pEd macro to other
10878         conversion specifiers.  For example, use "...%"pI"d..." rather
10879         than "...%"pEd"...".
10880         (pEd): Remove.  All uses replaced with similar uses of pI.
10881         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
10882         * alloc.c (check_pure_size): Don't overflow by converting size to int.
10883         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
10884         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
10885         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
10886         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
10887         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
10888         64-bit hosts.
10889         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
10890         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
10891         * print.c (safe_debug_print, print_object): Likewise.
10892         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
10893         to int.
10894         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
10895         avoiding the 0 flag, which is not portable.
10896         * process.c (Fmake_network_process): Use pI to avoid cast.
10897         * region-cache.c (pp_cache): Likewise.
10898         * xdisp.c (decode_mode_spec): Likewise.
10899         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
10900         behavior on 64-bit hosts with printf arg.
10901         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
10902         (x_stop_queuing_selection_requests): Likewise.
10903         (x_get_window_property): Don't truncate byte count to an 'int'
10904         when tracing.
10906         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
10907         here, since it parses constructs like leading '-' and spaces,
10908         which are not wanted; and it overflows with large numbers.
10909         Instead, simply match F[0-9]+, which is what is wanted anyway.
10911         * alloc.c: Remove unportable assumptions about struct layout.
10912         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
10913         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
10914         (allocate_vectorlike, make_pure_vector): Use the new macros,
10915         plus offsetof, to remove unportable assumptions about struct layout.
10916         These assumptions hold on all porting targets that I know of, but
10917         they are not guaranteed, they're easy to remove, and removing them
10918         makes further changes easier.
10920         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
10921         This doesn't fix a bug but makes the code clearer.
10922         (string_overrun_cookie): Now const.  Use initializers that
10923         don't formally overflow signed char, to avoid warnings.
10924         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
10925         can cause Emacs to crash when string overrun checking is enabled.
10926         (allocate_buffer): Don't assume sizeof (struct buffer) is a
10927         multiple of sizeof (EMACS_INT); it need not be, if
10928         alignof(EMACS_INT) < sizeof (EMACS_INT).
10929         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
10931 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
10933         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
10935 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
10937         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
10938         supposed to be handshaking.  (Bug#8556)
10939         Reported by Paul Eggert <eggert@cs.ucla.edu>.
10941 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
10943         * lisp.h (Qdebug): List symbol.
10944         * eval.c (Qdebug): Restore global linkage.
10945         * keyboard.c (debug-on-event): New variable.
10946         (handle_user_signal): Break into debugger when debug-on-event
10947         matches the current signal symbol.
10949 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
10951         * alloc.c (check_sblock, check_string_bytes)
10952         (check_string_free_list): Convert to standard C.
10954 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
10956         * w32.c (emacs_gnutls_push): Fix typo.
10958 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
10960         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
10961         "cast to pointer from integer of different size".
10963         Improve doprnt and its use in verror.  (Bug#8545)
10964         * doprnt.c (doprnt): Document the set of format control sequences
10965         supported by the function.  Use SAFE_ALLOCA instead of always
10966         using `alloca'.
10968         * eval.c (verror): Don't limit the buffer size at size_max-1, that
10969         is one byte too soon.  Don't use xrealloc; instead xfree and
10970         xmalloc anew.
10972 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
10974         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
10975         callbacks stage.
10977         * gnutls.c: Renamed global_initialized to
10978         gnutls_global_initialized.  Added internals for the
10979         :verify-hostname-error, :verify-error, and :verify-flags
10980         parameters of `gnutls-boot' and documented those parameters in the
10981         docstring.  Start callback support.
10982         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
10983         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
10984         on error.  Return error code.
10985         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
10986         (emacs_gnutls_read): Likewise.
10987         (Fgnutls_boot): Return handshake error code.
10988         (emacs_gnutls_handle_error): New function.
10989         (wsaerror_to_errno): Likewise.
10991         * w32.h (emacs_gnutls_pull): Add prototype.
10992         (emacs_gnutls_push): Likewise.
10994         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
10995         (emacs_gnutls_push): Likewise.
10997 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
10999         * process.c (wait_reading_process_output): Check if GnuTLS
11000         buffered some data internally if no FDs are set for TLS
11001         connections.
11003         * makefile.w32-in (OBJ2): Add gnutls.$(O).
11004         (LIBS): Link to USER_LIBS.
11005         ($(BLD)/gnutls.$(0)): New target.
11007 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
11009         * xdisp.c (handle_single_display_spec): Rename the
11010         display_replaced_before_p argument into display_replaced_p, to
11011         make it consistent with the commentary.  Fix typos in the
11012         commentary.
11014         * textprop.c (syms_of_textprop): Remove dead code.
11015         (copy_text_properties): Delete obsolete commentary about an
11016         interface that was deleted long ago.  Fix typos in the description
11017         of arguments.
11019         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
11020         to changes in oldXMenu/XMenu.h from 2011-04-16.
11021         <menu_help_message, prev_menu_help_message>: Constify.
11022         (IT_menu_make_room): menu->help_text is now `const char **';
11023         adjust.
11025         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
11026         to changes in oldXMenu/XMenu.h from 2011-04-16.
11027         (struct XMenu): Declare `help_text' `const char **'.
11029         * xfaces.c <Qunspecified>: Make extern again.
11031         * syntax.c: Include sys/types.h before including regex.h, as
11032         required by POSIX.
11034         * doc.c (get_doc_string): Improve the format passed to `error'.
11036         * doprnt.c (doprnt): Improve commentary.
11038         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
11040         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
11041         them with etags.
11043         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
11044         changes in globals.h immediately force recompilation.
11045         (TAGS): Depend on $(CURDIR)/m/intel386.h and
11046         $(CURDIR)/s/ms-w32.h.
11047         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
11049         * character.c (Fchar_direction): Function deleted.
11050         (syms_of_character): Don't defsubr it.
11051         <char-direction-table>: Deleted.
11053 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
11055         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
11056         * doprnt.c: Include limits.h.
11057         (SIZE_MAX): New macro.
11058         (doprnt): Return a size_t value.  2nd arg is now size_t.
11059         Many local variables are now size_t instead of int or unsigned.
11060         Improve overflow protection.  Support `l' modifier for integer
11061         conversions.  Support %l conversion.  Don't assume an EMACS_INT
11062         argument for integer conversions and for %c.
11064         * lisp.h (doprnt): Restore prototype.
11066         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
11067         $(SRC)/character.h.
11069         * Makefile.in (base_obj): Add back doprnt.o.
11071         * deps.mk (doprnt.o): Add back prerequisites.
11072         (callint.o): Depend on character.h.
11074         * eval.c (internal_lisp_condition_case): Include the handler
11075         representation in the error message.
11076         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
11077         when breaking from the loop.
11079         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
11081         * callint.c (Fcall_interactively): When displaying error message
11082         about invalid control letter, pass the character's codepoint, not
11083         a pointer to its multibyte form.  Improve display of the character
11084         in octal and display also its hex code.
11086         * character.c (char_string): Use %x to display the (unsigned)
11087         codepoint of an invalid character, to avoid displaying a bogus
11088         negative value.
11090         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
11091         `error', not SYMBOL_NAME itself.
11093         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
11094         character arguments to `error'.
11096         * charset.c (check_iso_charset_parameter): Fix incorrect argument
11097         to `error' in error message about FINAL_CHAR argument.  Make sure
11098         FINAL_CHAR is a character, and use %c when it is passed as
11099         argument to `error'.
11101 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
11103         * s/ms-w32.h (localtime): Redirect to sys_localtime.
11105         * w32.c: Include <time.h>.
11106         (sys_localtime): New function.
11108 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
11110         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
11112         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
11114 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
11116         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
11117         zombies (Bug#8467).
11119 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
11121         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
11122         gl_state.e_property when gl_state.object is Qt.
11124         * insdel.c (make_gap_larger): Remove limitation of buffer size
11125         to <= INT_MAX.
11127 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
11129         * xdisp.c (lookup_glyphless_char_display)
11130         (produce_glyphless_glyph): Handle cons cell entry in
11131         glyphless-char-display.
11132         (Vglyphless_char_display): Document it.
11134         * term.c (produce_glyphless_glyph): Handle cons cell entry in
11135         glyphless-char-display.
11137 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
11139         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
11141         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
11143         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
11144         definition for no-X builds.
11146 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
11148         Static checks with GCC 4.6.0 and non-default toolkits.
11150         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
11152         * process.c (keyboard_bit_set): Define only if SIGIO.
11153         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
11154         (send_process): Repair possible setjmp clobbering.
11156         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
11158         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
11160         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
11162         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
11163         Define only if needed.
11165         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
11166         by pacifying GCC about it.  Maybe it's time to retire it?
11167         * xfaces.c (USG, __TIMEVAL__): Likewise.
11169         * dispextern.h (struct redisplay_interface): Rename param
11170         to avoid shadowing.
11171         * termhooks.h (struct terminal): Likewise.
11172         * xterm.c (xembed_send_message): Likewise.
11174         * insdel.c (make_gap_smaller): Define only if
11175         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
11177         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
11178         it.
11180         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
11181         so that we aren't warned about unused symbols.
11183         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
11185         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
11187         * xfns.c (x_real_positions): Mark locals as initialized.
11189         * xmenu.c (xmenu_show): Don't use uninitialized vars.
11191         * xterm.c: Fix problems found by static analysis with other toolkits.
11192         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
11193         (x_dispatch_event): Declare static if USE_GTK, and
11194         define if USE_GTK || USE_X_TOOLKIT.
11195         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
11196         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
11197         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
11198         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
11200         * xmenu.c (menu_help_callback): Pointer type fixes.
11201         Use const pointers when pointing at readonly data.  Avoid pointer
11202         signedness clashes.
11203         (FALSE): Remove unused macro.
11204         (update_frame_menubar): Remove unused decl.
11206         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
11208         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
11209         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
11210         (single_menu_item): Rename local to avoid shadowing.
11212         * keyboard.c (make_lispy_event): Remove unused local var.
11214         * frame.c, frame.h (x_get_resource_string): Bring this back, but
11215         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
11217         * bitmaps: Change bitmaps from unsigned char back to the X11
11218         compatible char.  Avoid the old compiler warnings about
11219         out-of-range initializers by using, for example, '\xab' rather
11220         than 0xab.
11222         * xgselect.c (xgselect_initialize): Check vs interface
11223         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
11225         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
11227         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
11228         to read-only memory.
11230         * fns.c (vector): Remove; this old hack is no longer needed.
11232         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
11233         Remove unused var.
11234         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
11236         * xrdb.c (x_load_resources): Omit unused local.
11238         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
11239         (x_window): Rename locals to avoid shadowing.
11240         (USG): Use the kludged USG macro, to pacify gcc.
11242         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
11243         (x_term_init): Remove local to avoid shadowing.
11245         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
11247         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
11248         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
11250 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
11252         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
11254         Fix regex.c, syntax.c and friends for buffers > 2GB.
11255         * syntax.h (struct gl_state_s): Declare character position members
11256         EMACS_INT.
11258         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
11260         * textprop.c (verify_interval_modification, interval_of):
11261         Declare arguments EMACS_INT.
11263         * intervals.c (adjust_intervals_for_insertion): Declare arguments
11264         EMACS_INT.
11266         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
11268         * indent.c (Fvertical_motion): Local variable it_start is now
11269         EMACS_INT.
11271         * regex.c (re_match, re_match_2, re_match_2_internal)
11272         (bcmp_translate, regcomp, regexec, print_double_string)
11273         (group_in_compile_stack, re_search, re_search_2, regex_compile)
11274         (re_compile_pattern, re_exec): Declare arguments and local
11275         variables `size_t' and `ssize_t' and return values `regoff_t', as
11276         appropriate.
11277         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
11278         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
11279         <compile_stack_type>: `size' and `avail' are now `size_t'.
11281         * regex.h <regoff_t>: Use ssize_t, not int.
11282         (re_search, re_search_2, re_match, re_match_2): Arguments that
11283         specify buffer/string position and length are now ssize_t and
11284         size_t.  Return type is regoff_t.
11286 2011-04-16  Ben Key  <bkey76@gmail.com>
11288         * nsfont.m: Fixed bugs in ns_get_family and
11289         ns_descriptor_to_entity that were caused by using free to
11290         deallocate memory blocks that were allocated by xmalloc (via
11291         xstrdup).  This caused Emacs to crash when compiled with
11292         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
11293         --enable-checking=xmallocoverrun).  xfree is now used to
11294         deallocate these memory blocks.
11296 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
11298         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
11300         emacs_write: Accept and return EMACS_INT for sizes.
11301         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
11302         et seq.
11303         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
11304         Accept and return EMACS_INT.
11305         (emacs_gnutls_write): Return the number of bytes written on
11306         partial writes.
11307         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
11308         (emacs_read, emacs_write): Remove check for negative size, as the
11309         Emacs source code has been audited now.
11310         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
11311         (emacs_read, emacs_write): Use it.
11312         * process.c (send_process): Adjust to the new signatures of
11313         emacs_write and emacs_gnutls_write.  Do not attempt to store
11314         a byte offset into an 'int'; it might overflow.
11315         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
11317         * sound.c: Don't assume sizes fit in 'int'.
11318         (struct sound_device.period_size, alsa_period_size):
11319         Return EMACS_INT, not int.
11320         (struct sound_device.write, vox_write, alsa_write):
11321         Accept EMACS_INT, not int.
11322         (wav_play, au_play): Use EMACS_INT to store sizes and to
11323         record read return values.
11325 2011-04-15  Ben Key  <bkey76@gmail.com>
11327         * keyboard.c (Qundefined): Don't declare static since it is used
11328         in nsfns.m.
11329         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
11330         static since they are used in nsfont.m.
11332 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
11334         * process.c (Qprocessp): Don't declare static.
11335         * lisp.h (Qprocessp): Declare again.
11337 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
11339         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
11341 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
11343         Improve C-level modularity by making more things 'static'.
11345         Don't publish debugger-only interfaces to other modules.
11346         * lisp.h (safe_debug_print, debug_output_compilation_hack):
11347         (verify_bytepos, count_markers): Move decls to the only modules
11348         that need them.
11349         * region-cache.h (pp_cache): Likewise.
11350         * window.h (check_all_windows): Likewise.
11351         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
11353         * sysdep.c (croak): Now static, if
11354         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
11355         * syssignal.h (croak): Declare only if not static.
11357         * alloc.c (refill_memory_reserve): Now static if
11358         !defined REL_ALLOC || defined SYSTEM_MALLOC.
11359         * lisp.h (refill_memory_reserve): Declare only if not static.
11361         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
11362         Define only if USE_LUCID.
11364         * xrdb.c (x_customization_string, x_rm_string): Now static.
11366         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
11367         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
11369         * xdisp.c (draw_row_with_mouse_face): Now static.
11370         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
11372         * window.h (check_all_windows): Mark externally visible.
11374         * window.c (window_deletion_count): Now static.
11376         * undo.c: Make symbols static if they're not exported.
11377         (last_undo_buffer, last_boundary_position, pending_boundary):
11378         Now static.
11380         * textprop.c (interval_insert_behind_hooks): Now static.
11381         (interval_insert_in_front_hooks): Likewise.
11383         * term.c: Make symbols static if they're not exported.
11384         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
11385         (max_frame_lines, tty_set_terminal_modes):
11386         (tty_reset_terminal_modes, tty_turn_off_highlight):
11387         (get_tty_terminal): Now static.
11388         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
11389         * termhooks.h (term_mouse_moveto): Do not declare if
11390         HAVE_WINDOW_SYSTEM.
11391         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
11392         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
11394         * sysdep.c: Make symbols static if they're not exported.
11395         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
11396         Now static.
11397         (sigprocmask_set, full_mask): Remove; unused.
11398         (wait_debugging): Mark as visible.
11399         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
11400         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
11402         * syntax.c (syntax_temp): Define only if !__GNUC__.
11404         * sound.c (current_sound_device, current_sound): Now static.
11406         * search.c (searchbufs, searchbuf_head): Now static.
11408         * scroll.c (scroll_cost): Remove; unused.
11409         * dispextern.h (scroll_cost): Remove decl.
11411         * region-cache.h (pp_cache): Mark as externally visible.
11413         * process.c: Make symbols static if they're not exported.
11414         (process_tick, update_tick, create_process, chan_process):
11415         (Vprocess_alist, proc_buffered_char, datagram_access):
11416         (fd_callback_data, send_process_frame, process_sent_to): Now static.
11417         (deactivate_process): Mark defn as static, as well as decl.
11418         * lisp.h (create_process): Remove decl.
11419         * process.h (chan_process, Vprocess_alist): Remove decls.
11421         * print.c: Make symbols static if they're not exported.
11422         (print_depth, new_backquote_output, being_printed, print_buffer):
11423         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
11424         (print_interval, print_number_index, initial_stderr_stream):
11425         Now static.
11426         * lisp.h (Fprinc): Remove decl.
11427         (debug_output_compilation_hack): Mark as externally visible.
11429         * sysdep.c (croak): Move decl from here to syssignal.h.
11430         * syssignal.h (croak): Put it here, so the API can be checked when
11431         'croak' is called from dissociate_if_controlling_tty.
11433         * minibuf.c: Make symbols static if they're not exported.
11434         (minibuf_save_list, choose_minibuf_frame): Now static.
11435         * lisp.h (choose_minibuf_frame): Remove decl.
11437         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
11439         * lread.c: Make symbols static if they're not exported.
11440         (read_objects, initial_obarray, oblookup_last_bucket_number):
11441         Now static.
11442         (make_symbol): Remove; unused.
11443         * lisp.h (initial_obarray, make_symbol): Remove decls.
11445         * keyboard.c: Make symbols static if they're not exported.
11446         (single_kboard, recent_keys_index, total_keys, recent_keys):
11447         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
11448         (this_single_command_key_start, echoing, last_auto_save):
11449         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
11450         (command_loop, echo_now, keyboard_init_hook, help_char_p):
11451         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
11452         (Vlispy_mouse_stem, double_click_count):
11453         Now static.
11454         (force_auto_save_soon): Define only if SIGDANGER.
11455         (ignore_mouse_drag_p): Now static if
11456         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
11457         (print_help): Remove; unused.
11458         (stop_character, last_timer_event): Mark as externally visible.
11459         * keyboard.h (ignore_mouse_drag_p): Declare only if
11460         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
11461         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
11462         * lisp.h (echoing): Remove decl.
11463         (force_auto_save_soon): Declare only if SIGDANGER.
11464         * xdisp.c (redisplay_window): Simplify code, to make it more
11465         obvious that ignore_mouse_drag_p is not accessed if !defined
11466         USE_GTK && !defined HAVE_NS.
11468         * intervals.c: Make symbols static if they're not exported.
11469         (merge_properties_sticky, merge_interval_right, delete_interval):
11470         Now static.
11471         * intervals.h (merge_interval_right, delete_interval): Remove decls.
11473         * insdel.c: Make symbols static if they're not exported.
11474         However, leave prepare_to_modify_buffer alone.  It's never
11475         called from outside this function, but that appears to be a bug.
11476         (combine_after_change_list, combine_after_change_buffer):
11477         (adjust_after_replace, signal_before_change): Now static.
11478         (adjust_after_replace_noundo): Remove; unused.
11479         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
11480         (signal_before_change): Remove decls.
11482         * indent.c (val_compute_motion, val_vmotion): Now static.
11484         * image.c: Make symbols static if they're not exported.
11485         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
11486         if USE_GTK.
11487         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
11488         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
11490         * fringe.c (standard_bitmaps): Now static.
11491         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
11493         * frame.c: Make symbols static if they're not exported.
11494         (x_report_frame_params, make_terminal_frame): Now static.
11495         (get_frame_param): Now static, unless HAVE_NS.
11496         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
11497         (x_get_resource_string): Remove; not used.
11498         * frame.h (make_terminal_frame, x_report_frame_params):
11499         (x_get_resource_string); Remove decls.
11500         (x_fullscreen_adjust): Declare only if WINDOWSNT.
11501         * lisp.h (get_frame_param): Declare only if HAVE_NS.
11503         * font.c, fontset.c: Make symbols static if they're not exported.
11504         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
11505         (FACE_SUITABLE_FOR_CHAR_P): Use it.
11506         * font.c (font_close_object): Now static.
11507         * font.h (font_close_object): Remove.
11508         * fontset.c (FONTSET_OBJLIST): Remove.
11509         (free_realized_fontset) #if-0 the body, which does nothing.
11510         (face_suitable_for_char_p): #if-0, as it's never called.
11511         * fontset.h (face_suitable_for_char_p): Remove decl.
11512         * xfaces.c (face_at_string_position):
11513         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
11514         since 0 is always ASCII.
11516         * fns.c (weak_hash_tables): Now static.
11518         * fileio.c: Make symbols static if they're not exported.
11519         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
11520         (Vwrite_region_annotation_buffers): Now static.
11522         * eval.c: Make symbols static if they're not exported.
11523         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
11524         * lisp.h (backtrace_list): Remove decl.
11526         * emacs.c: Make symbols static if they're not exported.
11527         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
11528         (fatal_error_code, fatal_error_signal_hook, standard_args):
11529         Now static.
11530         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
11531         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
11532         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
11533         * lisp.h (fatal_error_signal_hook): Remove decl.
11534         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
11536         * editfns.c: Move a (normally-unused) function to its only use.
11537         * editfns.c, lisp.h (get_operating_system_release): Remove.
11538         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
11539         worth the hassle of breaking this out.
11541         * xterm.c: Make symbols static if they're not exported.
11542         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
11543         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
11544         (x_destroy_window, x_delete_display):
11545         Now static.
11546         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
11547         (x_mouse_leave): Remove; unused.
11548         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
11549         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
11550         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
11551         Remove decls.
11552         (x_mouse_leave): Declare only if WINDOWSNT.
11553         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
11554         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
11555         USE_X_TOOLKIT.
11557         * ftxfont.c: Make symbols static if they're not exported.
11558         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
11559         HAVE_FREETYPE.
11560         * font.h (ftxfont_driver): Likewise.
11562         * xfns.c: Make symbols static if they're not exported.
11563         (x_last_font_name, x_display_info_for_name):
11564         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
11565         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
11566         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
11567         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
11568         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
11569         (last_show_tip_args): Now static.
11570         (xic_defaut_fontset, xic_create_fontsetname): Define only if
11571         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
11572         (x_screen_planes): Remove; unused.
11573         * dispextern.h (x_screen_planes): Remove decl.
11575         * dispnew.c: Make symbols static if they're not exported.
11576         * dispextern.h (redraw_garbaged_frames, scrolling):
11577         (increment_row_positions): Remove.
11578         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
11579         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
11580         Now static.
11581         (redraw_garbaged_frames): Remove; unused.
11583         * xfaces.c: Make symbols static if they're not exported.
11584         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
11585         Remove decls.
11586         * xterm.h (defined_color): Remove decls.
11587         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
11588         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
11589         (menu_face_changed_default, defined_color, free_realized_face):
11590         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
11591         (ascii_face_of_lisp_face): Remove; unused.
11593         * xdisp.c: Make symbols static if they're not exported.
11594         * dispextern.h (scratch_glyph_row, window_box_edges):
11595         (glyph_to_pixel_coords, set_cursor_from_row):
11596         (get_next_display_element, set_iterator_to_next):
11597         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
11598         (show_mouse_face): Remove decls
11599         * frame.h (message_buf_print): Likewise.
11600         * lisp.h (pop_message, set_message, check_point_in_composition):
11601         Likewise.
11602         * xterm.h (set_vertical_scroll_bar): Likewise.
11603         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
11604         (message_buf_print, scratch_glyph_row, displayed_buffer):
11605         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
11606         (get_next_display_element, show_mouse_face, window_box_edges):
11607         (frame_to_window_pixel_xy, check_point_in_composition):
11608         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
11609         (glyph_to_pixel_coords): Remove; unused.
11611         * dired.c (file_name_completion): Now static.
11613         * dbusbind.c (xd_in_read_queued_messages): Now static.
11615         * lisp.h (circular_list_error, FOREACH): Remove; unused.
11616         * data.c (circular_list_error): Remove.
11618         * commands.h (last_point_position, last_point_position_buffer):
11619         (last_point_position_window): Remove decls.
11620         * keyboard.c: Make these variables static.
11622         * coding.h (coding, code_convert_region, encode_coding_gap):
11623         Remove decls.
11624         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
11625         (iso_code_class, detect_coding, code_convert_region): Now static.
11626         (encode_coding_gap): Remove; unused.
11628         * chartab.c (chartab_chars, chartab_bits): Now static.
11630         * charset.h (charset_iso_8859_1): Remove decl.
11631         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
11632         Now static.
11634         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
11635         * ccl.c (Vccl_program_table): Now static.
11636         (check_ccl_update): Remove; unused.
11638         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
11639         * category.h: ... from here.
11640         * category.c (check_category_table, set_category_set): Now static.
11642         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
11643         * lisp.h: Remove these decls.
11645         * buffer.c (buffer_count): Remove unused var.
11647         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
11648         so that it's not optimized away.
11649         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
11650         * dispextern.h (bidi_dump_cached_states): Remove, since it's
11651         exported only to the debugger.
11653         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
11654         * atimer.h (run_all_atimers): Remove; not exported.
11656         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
11657         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
11658         was inaccessible from Lisp.
11659         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
11660         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
11662         alloc.c: Import and export fewer symbols, and remove unused items.
11663         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
11664         is defined.
11665         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
11666         it's not optimized away by whole-program optimization.
11667         (message_enable_multibyte, free_misc): Remove.
11668         (catchlist, handlerlist, mark_backtrace):
11669         Declare only if BYTE_MARK_STACK.
11670         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
11671         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
11672         (message_enable_multibyte): Remove decl.
11673         (free_misc, interval_free_list, float_block, float_block_index):
11674         (n_float_blocks, float_free_list, cons_block, cons_block_index):
11675         (cons_free_list, last_marked_index):
11676         Now static.
11677         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
11678         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
11679         (mark_backtrace): Define only if BYTE_MARK_STACK.
11680         * xdisp.c (message_enable_multibyte): Now static.
11682         Declare Lisp_Object Q* variables to be 'static' if not exported.
11683         This makes it easier for human readers (and static analyzers)
11684         to see whether these variables are used from other modules.
11685         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
11686         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
11687         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
11688         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
11689         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
11690         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
11691         * xmenu.c, xselect.c:
11692         Declare Q* vars static if they are not used in other modules.
11693         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
11694         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
11695         Remove decls of unexported vars.
11696         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
11698         * lisp.h (DEFINE_FUNC): Make sname 'static'.
11700         Make Emacs functions such as Fatom 'static' by default.
11701         This makes it easier for human readers (and static analyzers)
11702         to see whether these functions can be called from other modules.
11703         DEFUN now defines a static function.  To make the function external
11704         so that it can be used in other C modules, use the new macro DEFUE.
11705         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
11706         (Finit_image_library):
11707         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
11708         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
11709         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
11710         Remove decls, since these functions are now static.
11711         (Funintern, Fget_internal_run_time): New decls, since these functions
11712         were already external.
11714         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
11715         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
11716         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
11717         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
11718         * keyboard.c, keymap.c, lread.c:
11719         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
11720         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
11721         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
11722         Mark functions with DEFUE instead of DEFUN,
11723         if they are used in other modules.
11724         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
11725         decls for now-static functions.
11726         * buffer.h (Fdelete_overlay): Remove decl.
11727         * callproc.c (Fgetenv_internal): Mark as internal.
11728         * composite.c (Fremove_list_of_text_properties): Remove decl.
11729         (Fcomposition_get_gstring): New forward static decl.
11730         * composite.h (Fcomposite_get_gstring): Remove decl.
11731         * dired.c (Ffile_attributes): New forward static decl.
11732         * doc.c (Fdocumntation_property): New forward static decl.
11733         * eval.c (Ffetch_bytecode): New forward static decl.
11734         (Funintern): Remove extern decl; now in .h file where it belongs.
11735         * fileio.c (Fmake_symbolic_link): New forward static decl.
11736         * image.c (Finit_image_library): New forward static decl.
11737         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
11738         * intervals.h (Fprevious_property_change):
11739         (Fremove_list_of_text_properties): Remove decls.
11740         * keyboard.c (Fthis_command_keys): Remove decl.
11741         (Fcommand_execute): New forward static decl.
11742         * keymap.c (Flookup_key): New forward static decl.
11743         (Fcopy_keymap): Now static.
11744         * keymap.h (Flookup_key): Remove decl.
11745         * process.c (Fget_process): New forward static decl.
11746         (Fprocess_datagram_address): Mark as internal.
11747         * syntax.c (Fsyntax_table_p): New forward static decl.
11748         (skip_chars): Remove duplicate decl.
11749         * textprop.c (Fprevious_property_change): New forward static decl.
11750         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
11751         Now internal.
11752         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
11753         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
11755         * editfns.c (Fformat): Remove unreachable code.
11757 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
11759         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
11760         change.  (Bug#8496)
11762 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
11764         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
11765         when at ZV.  (Bug#8487)
11767 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
11769         * charset.c (Fclear_charset_maps): Use xfree instead of free.
11770         (Bug#8437)
11771         * keyboard.c (parse_tool_bar_item): Likewise.
11772         * sound.c (sound_cleanup, alsa_close): Likewise.
11773         * termcap.c (tgetent): Likewise.
11774         * xfns.c (x_default_font_parameter): Likewise.
11775         * xsettings.c (read_and_apply_settings): Likewise.
11777         * alloc.c (overrun_check_malloc, overrun_check_realloc)
11778         (overrun_check_free): Protoize.
11780 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
11782         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
11783         since callers should never pass a negative size.
11784         Change the signature to match that of plain 'read' and 'write'; see
11785         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
11786         * lisp.h: Update prototypes of emacs_write and emacs_read.
11788 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
11790         * xdisp.c (redisplay_window): Don't try to determine the character
11791         position of the scroll margin if the window start point w->startp
11792         is outside the buffer's accessible region.  (Bug#8468)
11794 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
11796         Fix write-region and its subroutines for buffers > 2GB.
11797         * fileio.c (a_write, e_write): Modify declaration of arguments and
11798         local variables to support buffers larger than 2GB.
11799         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
11801         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
11802         argument, local variables, and return value.
11804         * lisp.h: Update prototypes of emacs_write and emacs_read.
11806         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
11808 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
11810         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
11812         Fix more problems found by GCC 4.6.0's static checks.
11814         * xdisp.c (vmessage): Use a better test for character truncation.
11816         * charset.c (load_charset_map): <, not <=, for optimization,
11817         and to avoid potential problems with integer overflow.
11818         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
11819         * casetab.c (set_identity, shuffle): Likewise.
11820         * editfns.c (Fformat): Likewise.
11821         * syntax.c (skip_chars): Likewise.
11823         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
11824         This also lets GCC 4.6.0 generate slightly better loop code.
11826         * callint.c (Fcall_interactively): <, not <=, for optimization.
11827         (Fcall_interactively): Count the number of arguments produced,
11828         not the number of arguments given.  This is simpler and lets GCC
11829         4.6.0 generate slightly better code.
11831         * ftfont.c: Distingish more carefully between FcChar8 and char.
11832         The previous code passed unsigned char * to a functions like
11833         strlen and xstrcasecmp that expect char *, which does not
11834         conform to the C standard.
11835         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
11836         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
11837         char * when the C standard requires it.
11839         * keyboard.c (read_char): Remove unused var.
11841         * eval.c: Port to Windows vsnprintf (Bug#8435).
11842         Include <limits.h>.
11843         (SIZE_MAX): Define if the headers do not.
11844         (verror): Do not give up if vsnprintf returns a negative count.
11845         Instead, grow the buffer.  This ports to Windows vsnprintf, which
11846         does not conform to C99.  Problem reported by Eli Zaretskii.
11847         Also, simplify the allocation scheme, by avoiding the need for
11848         calling realloc, and removing the ALLOCATED variable.
11850         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
11852         Remove invocations of doprnt, as Emacs now uses vsnprintf.
11853         But keep the doprint source code for now, as we might revamp it
11854         and use it again (Bug#8435).
11855         * lisp.h (doprnt): Remove.
11856         * Makefile.in (base_obj): Remove doprnt.o.
11857         * deps.mk (doprnt.o): Remove.
11859         error: Print 32- and 64-bit integers portably (Bug#8435).
11860         Without this change, on typical 64-bit hosts error ("...%d...", N)
11861         was used to print both 32- and 64-bit integers N, which relied on
11862         undefined behavior.
11863         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
11864         * lisp.h (error, verror): Mark as printf-like functions.
11865         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
11866         Report overflow in size calculations when allocating printf buffer.
11867         Do not truncate output string at its first null byte.
11868         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
11869         Truncate the output at a character boundary, since vsnprintf does not
11870         do that.
11871         * charset.c (check_iso_charset_parameter): Convert internal
11872         character to string before calling 'error', since %c now has the
11873         printf meaning.
11874         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
11875         overflow when computing char to be passed to 'error'.  Do not
11876         pass Lisp_Object to 'error'; pass the integer instead.
11877         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
11878         formatted with plain %d.
11880         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
11882         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
11884         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
11886         * xterm.c (x_catch_errors): Remove duplicate declaration.
11888         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
11890         * xdisp.c, lisp.h (message_nolog): Remove; unused.
11892 2011-04-10  Jim Meyering  <meyering@redhat.com>
11894         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
11895         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
11896         return ssize_t not "int", and use size_t as the buffer length.
11897         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
11898         * gnutls.h: Update declarations.
11899         * process.c (read_process_output): Use ssize_t, to match.
11900         (send_process): Likewise.
11902 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
11904         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
11906 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
11908         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
11909         Use unsigned char, to match FcChar8 type definition.
11911         * xterm.c (handle_one_xevent):
11912         * xmenu.c (create_and_show_popup_menu):
11913         * xselect.c (x_decline_selection_request)
11914         (x_reply_selection_request): Avoid type-punned deref of X events.
11916 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
11918         Fix some uses of `int' instead of EMACS_INT.
11919         * search.c (string_match_1, fast_string_match)
11920         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
11921         (scan_buffer, find_next_newline_no_quit)
11922         (find_before_next_newline, search_command, Freplace_match)
11923         (Fmatch_data): Make some `int' variables be EMACS_INT.
11925         * xdisp.c (display_count_lines): 3rd argument and return value now
11926         EMACS_INT.  All callers changed.
11927         (pint2hrstr): Last argument is now EMACS_INT.
11929         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
11930         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
11931         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
11932         (decode_coding_utf_16, decode_coding_emacs_mule)
11933         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
11934         (decode_coding_ccl, decode_coding_charset)
11935         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
11936         (decode_coding_iso_2022, decode_coding_emacs_mule)
11937         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
11938         <char_offset, last_offset>: Declare EMACS_INT.
11939         (encode_coding_utf_8, encode_coding_utf_16)
11940         (encode_coding_emacs_mule, encode_invocation_designation)
11941         (encode_designation_at_bol, encode_coding_iso_2022)
11942         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
11943         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
11944         Declare EMACS_INT.
11945         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
11946         (encode_invocation_designation): Last argument P_NCHARS is now
11947         EMACS_INT.
11948         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
11949         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
11951         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
11952         All users changed.
11954         * ccl.c (Fccl_execute_on_string): Declare some variables
11955         EMACS_INT.
11957 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
11959         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
11961 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
11963         * process.c (Fformat_network_address): Doc fix.
11965 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
11967         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
11969 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
11971         * keyboard.c (read_char): Call Lisp function help-form-show,
11972         instead of using internal_with_output_to_temp_buffer.
11973         (Qhelp_form_show): New var.
11974         (syms_of_keyboard): Use DEFSYM macro.
11976         * print.c (internal_with_output_to_temp_buffer): Function deleted.
11978         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
11980 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
11982         * process.c (Flist_processes): Remove to Lisp.
11983         (list_processes_1): Delete.
11985 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
11987         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
11989         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
11991 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
11993         Fix more problems found by GCC 4.6.0's static checks.
11995         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
11997         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
11999         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
12001         * xdisp.c (vmessage): Mark as a printf-like function.
12003         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
12005         * sound.c (sound_warning): Don't crash if arg contains a printf format.
12007         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
12008         printf-like functions.
12009         (tiff_load): Add casts to remove these marks before passing them
12010         to system-supplied API.
12012         * eval.c (Fsignal): Remove excess argument to 'fatal'.
12014         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
12015         This avoids several warnings with gcc -Wstrict-overflow.
12016         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
12017         directly, rather than having caller test rule sign.  This avoids
12018         some unnecessary tests.
12019         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
12020         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
12021         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
12023         * xfont.c (xfont_text_extents): Remove var that was set but not used.
12024         (xfont_open): Avoid unnecessary tests.
12026         * composite.c (composition_gstring_put_cache): Use unsigned integer.
12028         * composite.h, composite.c (composition_gstring_put_cache):
12029         Use EMACS_INT, not int, for length.
12031         * composite.h (COMPOSITION_DECODE_REFS): New macro,
12032         breaking out part of COMPOSITION_DECODE_RULE.
12033         (COMPOSITION_DECODE_RULE): Use it.
12034         * composite.c (get_composition_id): Remove unused local vars,
12035         by using the new macro.
12037         * textprop.c (set_text_properties_1): Change while to do-while,
12038         since the condition is always true at first.
12040         * intervals.c (graft_intervals_into_buffer): Mark var as used.
12041         (interval_deletion_adjustment): Return unsigned value.
12042         All uses changed.
12044         * process.c (list_processes_1, create_pty, read_process_output):
12045         (exec_sentinel): Remove vars that were set but not used.
12046         (create_pty): Remove unnecessary "volatile"s.
12047         (Fnetwork_interface_info): Avoid possibility of int overflow.
12048         (read_process_output): Do adaptive read buffering even if carryover.
12049         (read_process_output): Simplify nbytes computation if buffered.
12051         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
12053         * syntax.c (scan_words): Remove var that was set but not used.
12054         (update_syntax_table): Use unsigned instead of int.
12056         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
12057         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
12058         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
12060         * print.c (print_error_message): Avoid int overflow.
12062         * font.c (font_list_entities): Redo for clarity,
12063         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
12065         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
12066         (font_score): Avoid potential overflow in diff calculation.
12068         * fns.c (substring_both): Remove var that is set but not used.
12069         (sxhash): Redo loop for clarity and to avoid wraparound warning.
12071         * eval.c (funcall_lambda): Rename local to avoid shadowing.
12073         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
12074         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
12075         can always succeed if overflow has undefined behavior.
12077         * search.c (boyer_moore, wordify): Remove vars set but not used.
12078         (wordify): Omit three unnecessary tests.
12080         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
12081         All callers changed.  This avoids the need for an unused var.
12083         * casefiddle.c (casify_region): Remove var that is set but not used.
12085         * dired.c (file_name_completion): Remove var that is set but not used.
12087         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
12089         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
12090         (Finsert_file_contents): Remove unnecessary code checking fd.
12092         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
12093         Check for integer overflow on size calculations.
12095         * buffer.c (Fprevious_overlay_change): Remove var that is set
12096         but not used.
12098         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
12099         Remove vars that are set but not used.
12100         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
12101         (timer_check_2): Mark vars as initialized.
12103         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
12105         * image.c (lookup_image): Remove var that is set but not used.
12106         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
12108         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
12109         that are set but not used.
12111         * xfns.c (make_invisible_cursor): Don't return garbage
12112         if XCreateBitmapFromData fails (Bug#8410).
12114         * xselect.c (x_get_local_selection, x_handle_property_notify):
12115         Remove vars that are set but not used.
12117         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
12118         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
12120         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
12121         Remove var that is set but not used.
12122         (scroll_bar_windows_size): Now size_t, not int.
12123         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
12124         Check for overflow.
12126         * xfaces.c (realize_named_face): Remove vars that are set but not used.
12127         (map_tty_color) [!defined MSDOS]: Likewise.
12129         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
12131         * coding.c: Remove vars that are set but not used.
12132         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
12133         All callers changed.
12134         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
12135         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
12136         (decode_coding_charset): Remove vars that are set but not used.
12138         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
12139         that is set but not used.
12141         * print.c (print_object): Remove var that is set but not used.
12143         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
12144         The gnulib version avoids calling malloc in the usual case,
12145         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
12146         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
12147         * filelock.c (current_lock_owner): Likewise.
12148         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
12149         * sysdep.c: Include allocator.h, careadlinkat.h.
12150         (emacs_no_realloc_allocator): New static constant.
12151         (emacs_readlink): New function.
12152         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
12153         ../lib/careadlinkat.h.
12155 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
12157         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
12158         first non-nil return value).
12160 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
12162         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
12163         if not defined (Bug#8403).
12165 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
12167         * xdisp.c (display_count_lines): Remove parameter `start',
12168         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
12169         (get_char_face_and_encoding): Remove parameter `multibyte_p',
12170         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
12171         (fill_stretch_glyph_string): Remove parameters `row' and `area',
12172         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
12173         and thereabouts.  All callers changed.
12174         (get_per_char_metric): Remove parameter `f', unused since
12175         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
12177 2011-04-02  Jim Meyering  <meyering@redhat.com>
12179         do not dereference NULL upon failed strdup
12180         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
12181         (ns_get_family): Likewise.
12183 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
12185         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
12187 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
12189         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
12190         later (Bug#8403).
12192 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
12194         Add lexical binding.
12196         * window.c (Ftemp_output_buffer_show): New fun.
12197         (Fsave_window_excursion):
12198         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
12200         * lread.c (lisp_file_lexically_bound_p): New function.
12201         (Fload): Bind Qlexical_binding.
12202         (readevalloop): Remove `evalfun' arg.
12203         Bind Qinternal_interpreter_environment.
12204         (Feval_buffer): Bind Qlexical_binding.
12205         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
12206         Mark as dynamic.
12207         (syms_of_lread): Declare `lexical-binding'.
12209         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
12211         * keyboard.c (eval_dyn): New fun.
12212         (menu_item_eval_property): Use it.
12214         * image.c (parse_image_spec): Use Ffunctionp.
12216         * fns.c (concat, mapcar1): Accept byte-code-functions.
12218         * eval.c (Fsetq): Handle lexical vars.
12219         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
12220         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
12221         (FletX, Flet): Obey lexical binding.
12222         (Fcommandp): Handle closures.
12223         (Feval): New `lexical' arg.
12224         (eval_sub): New function extracted from Feval.  Use it almost
12225         everywhere where Feval was used.  Look up vars in lexical env.
12226         Handle closures.
12227         (Ffunctionp): Move from subr.el.
12228         (Ffuncall): Handle closures.
12229         (apply_lambda): Remove `eval_flags'.
12230         (funcall_lambda): Handle closures and new byte-code-functions.
12231         (Fspecial_variable_p): New function.
12232         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
12233         but without exporting it to Lisp.
12235         * doc.c (Fdocumentation, store_function_docstring):
12236         * data.c (Finteractive_form): Handle closures.
12238         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
12239         interactive spec.
12241         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
12242         New byte-codes.
12243         (exec_byte_code): New function extracted from Fbyte_code to handle new
12244         calling convention for byte-code-functions.  Add new byte-codes.
12246         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
12248         * alloc.c (Fmake_symbol): Init new `declared_special' field.
12250 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
12252         * xdisp.c (redisplay_internal): Fix prototype.
12254 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
12256         * xdisp.c (SCROLL_LIMIT): New macro.
12257         (try_scrolling): Use it when setting scroll_limit.
12258         Limit scrolling to 100 screen lines.
12259         (redisplay_window): Even when falling back on "recentering",
12260         position point in the window according to scroll-conservatively,
12261         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
12263         (try_scrolling): When point is above the window, allow searching
12264         as far as scroll_max, or one screenful, to compute vertical
12265         distance from PT to the scroll margin position.  This prevents
12266         try_scrolling from unnecessarily failing when
12267         scroll-conservatively is set to a value slightly larger than the
12268         window height.  Clean up the case of PT below the margin at bottom
12269         of window: scroll_max can no longer be INT_MAX.  When aggressive
12270         scrolling is in use, don't let point enter the opposite scroll
12271         margin as result of the scroll.
12272         (syms_of_xdisp) <scroll-conservatively>: Document the
12273         threshold of 100 lines for never-recentering scrolling.
12275 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
12277         * dispextern.h (move_it_by_lines):
12278         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
12279         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
12280         (message_log_check_duplicate): Remove parameters `prev_bol' and
12281         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
12282         (redisplay_internal): Remove parameter `preserve_echo_area',
12283         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
12285         * indent.c (Fvertical_motion):
12286         * window.c (window_scroll_pixel_based, Frecenter):
12287         Don't pass `need_y_p' to `move_it_by_lines'.
12289 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
12291         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
12292         steal a few bits to be more compact.
12293         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
12294         Remove unneeded casts.
12296         * bytecode.c (Fbyte_code): CAR and CDR can GC.
12298 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
12300         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
12301         binding" message (bug#7967).
12303 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
12305         Fix more problems found by GCC 4.6.0's static checks.
12307         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
12308         Remove unused local var.
12310         * editfns.c (Fmessage_box): Remove unused local var.
12312         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
12313         (note_mode_line_or_margin_highlight, note_mouse_highlight):
12314         Omit unused local vars.
12315         * window.c (shrink_windows): Omit unused local var.
12316         * menu.c (digest_single_submenu): Omit unused local var.
12317         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
12318         Omit unused local var.
12320         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
12321         Don't assume string length fits in int.
12322         (keyremap_step, read_key_sequence): Use size_t for sizes.
12323         (read_key_sequence): Don't check last_real_key_start redundantly.
12325         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
12326         instead of alloca (Bug#8344).
12328         * eval.c (Fbacktrace): Don't assume nargs fits in int.
12329         (Fbacktrace_frame): Don't assume nframes fits in int.
12331         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
12333         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
12334         concerns.
12336         * term.c (produce_glyphless_glyph): Remove unnecessary test.
12338         * cm.c (calccost): Turn while-do into do-while, for clarity.
12340         * keyboard.c (syms_of_keyboard): Use the same style as later
12341         in this function when indexing through an array.  This also
12342         works around GCC bug 48267.
12344         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
12346         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
12348         * chartab.c (sub_char_table_ref_and_range): Redo for slight
12349         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
12351         * keyboard.c, keyboard.h (num_input_events): Now size_t.
12352         This avoids undefined behavior on integer overflow, and is a bit
12353         more convenient anyway since it is compared to a size_t variable.
12355         Variadic C functions now count arguments with size_t, not int.
12356         This avoids an unnecessary limitation on 64-bit machines, which
12357         caused (substring ...) to crash on large vectors (Bug#8344).
12358         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
12359         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
12360         All variadic functions and their callers changed accordingly.
12361         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
12362         * data.c (arith_driver, float_arith_driver): Likewise.
12363         * editfns.c (general_insert_function): Likewise.
12364         * eval.c (struct backtrace.nargs, interactive_p)
12365         (internal_condition_case_n, run_hook_with_args, apply_lambda)
12366         (funcall_lambda, mark_backtrace): Likewise.
12367         * fns.c (concat): Likewise.
12368         * frame.c (x_set_frame_parameters): Likewise.
12369         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
12370         0 if not found, not -1.  All callers changed.
12372         * alloc.c (garbage_collect): Don't assume stack size fits in int.
12373         (stack_copy_size): Now size_t, not int.
12374         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
12376 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
12378         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
12379         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12380         All callers changed.
12382         * lisp.h (multibyte_char_to_unibyte):
12383         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
12384         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
12385         * character.h (CHAR_TO_BYTE8):
12386         * cmds.c (internal_self_insert):
12387         * editfns.c (general_insert_function):
12388         * keymap.c (push_key_description):
12389         * search.c (Freplace_match):
12390         * xdisp.c (message_dolog, set_message_1): All callers changed.
12392 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
12394         * keyboard.c (safe_run_hook_funcall): New function.
12395         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
12396         don't set the hook to nil, but remove the offending function instead.
12397         (Qcommand_hook_internal): Remove, unused.
12398         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
12399         Vcommand_hook_internal.
12401         * eval.c (enum run_hooks_condition): Remove.
12402         (funcall_nil, funcall_not): New functions.
12403         (run_hook_with_args): Call each function through a `funcall' argument.
12404         Remove `cond' argument, now redundant.
12405         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
12406         (Frun_hook_with_args_until_failure): Adjust accordingly.
12407         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
12409 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
12411         * dispextern.h (string_buffer_position): Remove declaration.
12413         * print.c (strout): Remove parameter `multibyte', unused since
12414         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
12416         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
12417         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
12418         All callers changed.
12420         * w32.c (_wsa_errlist): Use braces for struct initializers.
12422         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
12423         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
12424         All callers changed.
12425         (string_buffer_position): Likewise.  Also, make static (it's never
12426         used outside xdisp.c).
12427         (cursor_row_p): Remove parameter `w', unused since
12428         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
12429         (decode_mode_spec): Remove parameter `precision', introduced during
12430         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
12431         All callers changed.
12433 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
12435         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
12437 2011-03-27  Anders Lindgren  <andlind@gmail.com>
12439         * nsterm.m (ns_menu_bar_is_hidden): New variable.
12440         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
12441         (ns_update_auto_hide_menu_bar): New functions.
12442         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
12443         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
12444         ns_constrain_all_frames.
12445         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
12446         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
12448 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
12450         * nsmenu.m (runDialogAt): Remove argument to timer_check.
12452 2011-03-27  Glenn Morris  <rgm@gnu.org>
12454         * syssignal.h: Replace RETSIGTYPE with void.
12455         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
12456         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
12457         Replace SIGTYPE with void everywhere.
12458         * s/usg5-4-common.h (SIGTYPE): Remove definition.
12459         * s/template.h (SIGTYPE): Remove commented out definition.
12461 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
12463         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
12464         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
12466 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
12468         * w32.c (read_unc_volume): Use parameter `henum', instead of
12469         global variable `wget_enum_handle'.
12471         * keymap.c (describe_vector): Remove parameters `indices' and
12472         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
12473         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
12475         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
12477         * keyboard.c (timer_check): Remove parameter `do_it_now',
12478         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
12479         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
12480         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
12482         * keyboard.c (read_char):
12483         * w32menu.c (w32_menu_display_help):
12484         * xmenu.c (show_help_event, menu_help_callback):
12485         Adjust calls to `show_help_echo'.
12487         * gtkutil.c (xg_maybe_add_timer):
12488         * keyboard.c (readable_events):
12489         * process.c (wait_reading_process_output):
12490         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
12492         * insdel.c (adjust_markers_gap_motion):
12493         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
12494         (gap_left, gap_right): Don't call it.
12496 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
12498         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
12499         incurred during fontification.
12501 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
12503         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
12504         (DEFVAR_PER_BUFFER): Don't pass it.
12506         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
12507         (scrolling_window): Don't pass it.
12509 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
12511         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
12513         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
12514         and `suffix'.
12515         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
12516         of variables specific to SELinux and computation of `encoded_absname'.
12518         * image.c (XPutPixel): Remove unused variable `height'.
12520         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
12522         * unexw32.c (get_section_info): Remove unused variable `section'.
12524         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
12525         (system_process_attributes): Remove unused variable `sess'.
12526         (sys_read): Remove unused variable `err'.
12528         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
12529         (w32_wnd_proc): Remove unused variable `isdead'.
12530         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
12531         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
12532         (x_create_tip_frame): Remove unused variable `tem'.
12534         * w32inevt.c (w32_console_read_socket):
12535         Remove unused variable `no_events'.
12537         * w32term.c (x_draw_composite_glyph_string_foreground):
12538         Remove unused variable `width'.
12540 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
12542         * w32term.c (x_set_glyph_string_clipping):
12543         Don't pass uninitialized region to CombineRgn.
12545 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
12547         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
12548         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
12549         (Fx_close_connection): Remove unused variable `i'.
12551         * w32font.c (w32font_draw): Return number of glyphs.
12552         (w32font_open_internal): Remove unused variable `i'.
12553         (w32font_driver): Add missing initializer.
12555         * w32menu.c (utf8to16): Remove unused variable `utf16'.
12556         (fill_in_menu): Remove unused variable `items_added'.
12558         * w32term.c (last_mouse_press_frame): Remove static global variable.
12559         (w32_clip_to_row): Remove unused variable `f'.
12560         (x_delete_terminal): Remove unused variable `i'.
12562         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
12563         (NOTHING): Remove unused static global variable.
12564         (uniscribe_check_otf): Remove unused variable `table'.
12565         (uniscribe_font_driver): Add missing initializers.
12567 2011-03-23  Julien Danjou  <julien@danjou.info>
12569         * term.c (Fsuspend_tty, Fresume_tty):
12570         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
12571         * window.c (temp_output_buffer_show):
12572         * insdel.c (signal_before_change):
12573         * frame.c (Fhandle_switch_frame):
12574         * fileio.c (Fdo_auto_save):
12575         * emacs.c (Fkill_emacs):
12576         * editfns.c (save_excursion_restore):
12577         * cmds.c (internal_self_insert):
12578         * callint.c (Fcall_interactively):
12579         * buffer.c (Fkill_all_local_variables):
12580         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
12581         Use Frun_hooks.
12582         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
12583         unconditionally since it does the check itself.
12585 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
12587         Fix more problems found by GCC 4.5.2's static checks.
12589         * coding.c (encode_coding_raw_text): Avoid unnecessary test
12590         the first time through the loop, since we know p0 < p1 then.
12591         This also avoids a gcc -Wstrict-overflow warning.
12593         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
12594         leading to a memory leak, possible in functions like
12595         load_charset_map_from_file that can allocate an unbounded number
12596         of objects (Bug#8318).
12598         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
12599         that could (at least in theory) be that large.
12601         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
12602         This is less likely to overflow, and avoids undefined behavior if
12603         overflow does occur.  All callers changed.  Use strtoul to scan
12604         for the unsigned long integer.
12605         (pint2hrstr): Simplify and tune code slightly.
12606         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
12608         * scroll.c (do_scrolling): Work around GCC bug 48228.
12609         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
12611         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
12612         This also avoids a warning with gcc -Wstrict-overflow.
12613         (validate_x_resource_name): Simplify count usage.
12614         This also avoids a warning with gcc -Wstrict-overflow.
12616         * fileio.c (Fcopy_file): Report error if fchown or fchmod
12617         fail (Bug#8306).
12619         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
12621         * process.c (Fmake_network_process): Use socklen_t, not int,
12622         where POSIX says socklen_t is required in portable programs.
12623         This fixes a porting bug on hosts like 64-bit HP-UX, where
12624         socklen_t is wider than int (Bug#8277).
12625         (Fmake_network_process, server_accept_connection):
12626         (wait_reading_process_output, read_process_output):
12627         Likewise.
12629         * process.c: Rename or move locals to avoid shadowing.
12630         (list_processes_1, Fmake_network_process):
12631         (read_process_output_error_handler, exec_sentinel_error_handler):
12632         Rename or move locals.
12633         (Fmake_network_process): Define label "retry_connect" only if needed.
12634         (Fnetwork_interface_info): Fix pointer signedness.
12635         (process_send_signal): Add cast to avoid pointer signedness problem.
12636         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
12637         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
12639         Make tparam.h and terminfo.c consistent.
12640         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
12641         Include tparam.h instead, since it declares them.
12642         * cm.h (PC): Remove extern decl; tparam.h now does this.
12643         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
12644         * terminfo.c: Include tparam.h, to check interfaces.
12645         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
12646         (tparam): Adjust signature to match interface in tparam.h;
12647         this removes some undefined behavior.  Check that outstring and len
12648         are zero, which they always are with Emacs.
12649         * tparam.h (PC, BC, UP): New extern decls.
12651         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
12652         (xftfont_open): Rename locals to avoid shadowing.
12654         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
12655         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
12656         (OTF_TAG_SYM): Omit macro if not needed.
12657         (ftfont_list): Remove unused local.
12658         (get_adstyle_property, ftfont_pattern_entity):
12659         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
12660         Rename locals to avoid shadowing.
12662         * xfont.c (xfont_list_family): Mark var as initialized.
12664         * xml.c (make_dom): Now static.
12666         * composite.c (composition_compute_stop_pos): Rename local to
12667         avoid shadowing.
12668         (composition_reseat_it): Remove unused locals.
12669         (find_automatic_composition, composition_adjust_point): Likewise.
12670         (composition_update_it): Mark var as initialized.
12671         (find_automatic_composition): Mark vars as initialized,
12672         with a FIXME (Bug#8290).
12674         character.h: Rename locals to avoid shadowing.
12675         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
12676         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
12677         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
12678         (BUF_DEC_POS): Be more systematic about renaming local temporaries
12679         to avoid shadowing.
12681         * textprop.c (property_change_between_p): Remove; unused.
12683         * intervals.c (interval_start_pos): Now static.
12685         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
12687         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
12688         Rename locals to avoid shadowing.
12690         * sound.c (wav_play, au_play, Fplay_sound_internal):
12691         Fix pointer signedness.
12692         (alsa_choose_format): Remove unused local var.
12693         (wav_play): Initialize a variable to 0, to prevent undefined
12694         behavior (Bug#8278).
12696         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
12698         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
12700         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
12701         clobbering (Bug#8298).
12702         * sysdep.c (sys_subshell): Likewise.
12703         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
12705         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
12706         This should get cleaned up, so that child_setup has the
12707         same signature on all platforms.
12709         * callproc.c (call_process_cleanup): Now static.
12710         (relocate_fd): Rename locals to avoid shadowing.
12712 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
12714         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
12715         not to be necessary, and produces flickering.
12717 2011-03-20  Glenn Morris  <rgm@gnu.org>
12719         * config.in: Remove file.
12721 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
12723         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
12724         are now in src/globals.h.
12725         (syms_of_minibuf): Remove spurious & from previous change.
12727 2011-03-20  Leo Liu  <sdl.web@gmail.com>
12729         * minibuf.c (completing-read-function): New variable.
12730         (completing-read-default): Rename from completing-read.
12731         (completing-read): Call completing-read-function.
12733 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
12735         * xfaces.c (Fx_load_color_file):
12736         Read color file from absolute filename (bug#8250).
12738 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
12740         * makefile.w32-in: Update dependencies.
12742 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
12744         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
12746 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
12748         Fix more problems found by GCC 4.5.2's static checks.
12750         * process.c (make_serial_process_unwind, send_process_trap):
12751         (sigchld_handler): Now static.
12753         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
12754         That way, the code declares only the vars that it needs.
12755         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
12756         * s/cygwin.h (PTY_ITERATION): Likewise.
12757         * s/darwin.h (PTY_ITERATION): Likewise.
12758         * s/gnu-linux.h (PTY_ITERATION): Likewise.
12760         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
12761         * process.c (allocate_pty): Don't declare stb unless it's needed.
12763         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
12764         (CONSTANTLIM): Remove; unused.
12765         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
12766         Define only if needed.
12768         * unexelf.c (unexec): Name an expression,
12769         to avoid gcc -Wbad-function-cast warning.
12770         Use a different way to cause a compilation error if anyone uses
12771         n rather than nn, a way that does not involve shadowing.
12772         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
12774         * deps.mk (unexalpha.o): Remove; unused.
12776         New file unexec.h, the (simple) interface for unexec (Bug#8267).
12777         * unexec.h: New file.
12778         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
12779         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
12780         Depend on unexec.h.
12781         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
12782         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
12783         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
12784         Change as necessary to match prototype in unexec.h.
12786         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
12787         shadowing.
12788         (back_comment, skip_chars): Mark vars as initialized.
12790         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
12791         Rename locals to avoid shadowing.
12793         * lread.c (read1): Rewrite so as not to use empty "else".
12794         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
12796         * print.c (Fredirect_debugging_output): Fix pointer signedess.
12798         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
12799         warning when compiling print.c.
12801         * font.c (font_unparse_fcname): Abort in an "impossible" situation
12802         instead of using an uninitialized var.
12803         (font_sort_entities): Mark var as initialized.
12805         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
12807         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
12808         pointers to constants.
12809         (font_parse_fcname): Remove unused vars.
12810         (font_delete_unmatched): Now static.
12811         (font_get_spec): Remove; unused.
12812         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
12813         (font_update_drivers, Ffont_get_glyphs, font_add_log):
12814         Rename or move locals to avoid shadowing.
12816         * fns.c (require_nesting_list, require_unwind): Now static.
12817         (Ffillarray): Rename locals to avoid shadowing.
12819         * floatfns.c (domain_error2): Define only if needed.
12820         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
12822         * alloc.c (mark_backtrace): Move decl from here ...
12823         * lisp.h: ... to here, so that it can be checked.
12825         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
12826         (Fdefvar): Rewrite so as not to use empty "else".
12827         (lisp_indirect_variable): Name an expression,
12828         to avoid gcc -Wbad-function-cast warning.
12829         (Fdefvar): Rename locals to avoid shadowing.
12831         * callint.c (quotify_arg, quotify_args): Now static.
12832         (Fcall_interactively): Rename locals to avoid shadowing.
12833         Use const pointer when appropriate.
12835         * lisp.h (get_system_name, get_operating_system_release):
12836         Move decls here, to check interfaces.
12837         * process.c (get_operating_system_release): Move decl to lisp.h.
12838         * xrdb.c (get_system_name): Likewise.
12839         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
12840         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
12841         some of which prompt warnings from gcc -Wbad-function-cast.
12842         (Fformat_time_string, Fencode_time, Finsert_char):
12843         (Ftranslate_region_internal, Fformat):
12844         Rename or remove local vars to avoid shadowing.
12845         (Ftranslate_region_internal): Mark var as initialized.
12847         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
12848         avoid shadowing.
12850         * lisp.h (eassert): Check that the argument compiles, even if
12851         ENABLE_CHECKING is not defined.
12853         * data.c (Findirect_variable): Name an expression, to avoid
12854         gcc -Wbad-function-cast warning.
12855         (default_value, arithcompare, arith_driver, arith_error): Now static.
12856         (store_symval_forwarding): Rename local to avoid shadowing.
12857         (Fmake_variable_buffer_local, Fmake_local_variable):
12858         Mark variables as initialized.
12859         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
12861         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
12862         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
12863         Rename locals to avoid shadowing.
12864         (mark_stack): Move local variables into the #ifdef region where
12865         they're used.
12866         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
12867         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
12868         needed otherwise.
12869         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
12870         (GC_STRING_CHARS): Remove; not used.
12871         (Fmemory_limit): Cast sbrk's returned value to char *.
12873         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
12874         avoids undefined behavior in theory.
12876         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
12878         Use functions, not macros, for up- and down-casing (Bug#8254).
12879         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12880         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
12881         to use the following functions instead of these macros.
12882         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
12883         EMACS_INT, since callers assume the returned value fits in int.
12884         (upcase1): Likewise, for UPCASE_TABLE.
12885         (uppercasep, lowercasep, upcase): New static inline functions.
12886         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
12887         the race-condition problem in the old DOWNCASE.
12889         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
12890         Rename locals to avoid shadowing.
12891         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
12892         (regex_compile, re_search_2, re_match_2_internal):
12893         Remove unused local vars.
12894         (FREE_VAR): Rewrite so as not to use empty "else",
12895         which gcc can warn about.
12896         (regex_compile, re_match_2_internal): Mark locals as initialized.
12897         (RETALLOC_IF): Define only if needed.
12898         (WORDCHAR_P): Likewise.  This one is never needed, but is used
12899         only in a comment talking about a compiler bug, so put inside
12900         the #if 0 of that comment.
12901         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
12902         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
12903         Remove; unused.
12905         * search.c (boyer_moore): Rename locals to avoid shadowing.
12906         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
12907         (PREV_CHAR_BOUNDARY): Likewise.
12909         * search.c (simple_search): Remove unused var.
12911         * dired.c (compile_pattern): Move decl from here ...
12912         * lisp.h: ... to here, so that it can be checked.
12913         (struct re_registers): New forward decl.
12915         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
12917         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
12918         All uses changed.
12919         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
12920         Rename locals to avoid shadowing.
12921         (Fvertical_motion): Mark locals as initialized.
12923         * casefiddle.c (casify_object, casify_region): Now static.
12924         (casify_region): Mark local as initialized.
12926         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
12928         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
12929         New macros, so that the caller can use some names other than
12930         gcpro1, gcpro2, etc.
12931         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
12932         of the new macros.
12933         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
12934         argument, for consistency with GCPRO2_VAR, etc: it is now the
12935         prefix of the variable, not the variable itself.  All uses
12936         changed.
12937         * dired.c (directory_files_internal, file_name_completion):
12938         Rename locals to avoid shadowing.
12940         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
12941         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
12942         dired.c's scmp function, had undefined behavior.
12943         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
12944         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
12945         * buffer.h: ... to here, because these macros use current_buffer,
12946         and the new implementation with inline functions needs to have
12947         current_buffer in scope now, rather than later when the macros
12948         are used.
12949         (downcase, upcase1): New static inline functions.
12950         (DOWNCASE, UPCASE1): Reimplement using these functions.
12951         This avoids undefined behavior in expressions like
12952         DOWNCASE (x) == DOWNCASE (y), which previously suffered
12953         from race conditions in accessing the global variables
12954         case_temp1 and case_temp2.
12955         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
12956         * lisp.h (case_temp1, case_temp2): Remove their decls.
12957         * character.h (ASCII_CHAR_P): Move from here ...
12958         * lisp.h: ... to here, so that the inline functions mentioned
12959         above can use them.
12961         * dired.c (directory_files_internal_unwind): Now static.
12963         * fileio.c (file_name_as_directory, directory_file_name):
12964         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
12965         Now static.
12966         (file_name_as_directory): Use const pointers when appropriate.
12967         (Fexpand_file_name): Likewise.  In particular, newdir might
12968         point at constant storage, so make it a const pointer.
12969         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
12970         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
12971         signedness issues.
12972         (Fset_file_times, Finsert_file_contents, auto_save_error):
12973         Rename locals to avoid shadowing.
12975         * minibuf.c (choose_minibuf_frame_1): Now static.
12976         (Ftry_completion, Fall_completions): Rename or remove locals
12977         to avoid shadowing.
12979         * marker.c (bytepos_to_charpos): Remove; unused.
12981         * lisp.h (verify_bytepos, count_markers): New decls,
12982         so that gcc does not warn that these functions aren't declared.
12984         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
12985         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
12986         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
12987         (copy_text): Remove unused local var.
12989         * filelock.c (within_one_second): Now static.
12990         (lock_file_1): Rename local to avoid shadowing.
12992         * buffer.c (fix_overlays_before): Mark locals as initialized.
12993         (fix_start_end_in_overlays): Likewise.  This function should be
12994         simplified by using pointers-to-pointers, but that's a different
12995         matter.
12996         (switch_to_buffer_1): Now static.
12997         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
12998         (report_overlay_modification): Rename locals to avoid shadowing.
13000         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
13001         Fix pointer signedness issue.
13002         (sys_subshell): Mark local as volatile if checking for lint,
13003         to suppress a gcc -Wclobbered warning that does not seem to be right.
13004         (MAXPATHLEN): Define only if needed.
13006         * process.c (serial_open, serial_configure): Move decls from here ...
13007         * systty.h: ... to here, so that they can be checked.
13009         * fns.c (get_random, seed_random): Move extern decls from here ...
13010         * lisp.h: ... to here, so that they can be checked.
13012         * sysdep.c (reset_io): Now static.
13013         (wait_for_termination_signal): Remove; unused.
13015         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
13016         (copy_keymap_item, append_key, push_text_char_description):
13017         Now static.
13018         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
13019         (DENSE_TABLE_SIZE): Remove; unused.
13020         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
13021         (describe_map_tree):
13022         Rename locals to avoid shadowing.
13024         * keyboard.c: Declare functions static if they are not used elsewhere.
13025         (echo_char, echo_dash, cmd_error, top_level_2):
13026         (poll_for_input, handle_async_input): Now static.
13027         (read_char, kbd_buffer_get_event, make_lispy_position):
13028         (make_lispy_event, make_lispy_movement, apply_modifiers):
13029         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
13030         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
13031         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
13032         (read_key_sequence, read_char): Mark locals as initialized.
13033         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
13035         * keyboard.h (make_ctrl_char): New decl.
13036         (mark_kboards): Move decl here ...
13037         * alloc.c (mark_kboards): ... from here.
13039         * lisp.h (force_auto_save_soon): New decl.
13041         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
13042         (DEFINE_DUMMY_FUNCTION): New macro.
13043         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
13044         Use it.
13045         (main): Add casts to avoid warnings
13046         if GCC considers string literals to be constants.
13048         * lisp.h (fatal_error_signal): Add decl, since it's exported.
13050         * dbusbind.c: Pointer signedness fixes.
13051         (xd_signature, xd_append_arg, xd_initialize):
13052         (Fdbus_call_method, Fdbus_call_method_asynchronously):
13053         (Fdbus_method_return_internal, Fdbus_method_error_internal):
13054         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
13055         (Fdbus_register_signal): Use SSDATA when the context wants char *.
13057         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
13058         if GCC considers string literals to be constants.
13059         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
13061 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
13063         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
13064         (print_preprocess, print_object): New macro to fix last change.
13066         * print.c (print_preprocess): Don't forget font objects.
13068 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
13070         * emacs.c (USAGE3): Doc fixes.
13072 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
13074         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
13075         structure.
13077 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
13079         * lisp.h (VWindow_system, Qfile_name_history):
13080         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
13081         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
13082         (w32_system_caret_x, w32_system_caret_y): Declare extern.
13084         * w32select.c: Don't #include "keyboard.h".
13085         (run_protected): Add extern declaration for waiting_for_input.
13087         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
13088         * w32console.c (detect_input_pending, read_input_pending)
13089         (encode_terminal_code):
13090         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
13091         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
13092         (w32_system_caret_y, Qfile_name_history):
13093         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
13094         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
13095         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
13096         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
13097         * w32proc.c (Qlocal, report_file_error):
13098         * w32term.c (Vwindow_system, updating_frame):
13099         * w32uniscribe.c (initialized, uniscribe_font_driver):
13100         Remove unneeded extern declarations.
13102 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
13104         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
13106 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
13108         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
13109         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
13110         These macros can no longer be used for assignment.
13112         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13113         Assign struct members directly, instead of using BUF_BEGV etc.
13114         (record_buffer_markers, fetch_buffer_markers): New functions for
13115         recording and fetching special buffer markers.
13116         (set_buffer_internal_1, set_buffer_temp): Use them.
13118         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
13120         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
13122         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
13123         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
13125         * xdisp.c (hscroll_window_tree):
13126         (reconsider_clip_changes): Use PT instead of BUF_PT.
13128 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
13130         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
13131         $(EMACS_ROOT)/lib/intprops.h.
13133 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
13135         Fix more problems found by GCC 4.5.2's static checks.
13137         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
13138         to unsigned char * to avoid compiler diagnostic.
13139         (xg_free_frame_widgets): Make it clear that a local variable is
13140         needed only if USE_GTK_TOOLTIP.
13141         (gdk_window_get_screen): Make it clear that this macro is needed
13142         only if USE_GTK_TOOLTIP.
13143         (int_gtk_range_get_value): New function, which avoids a diagnostic
13144         from gcc -Wbad-function-cast.
13145         (xg_set_toolkit_scroll_bar_thumb): Use it.
13146         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
13147         diagnostic from gcc -Wbad-function-cast.
13148         (get_utf8_string, xg_get_file_with_chooser):
13149         Rename locals to avoid shadowing.
13150         (create_dialog): Move locals to avoid shadowing.
13152         * xgselect.c (xg_select): Remove unused var.
13154         * image.c (four_corners_best): Mark locals as initialized.
13155         (gif_load): Initialize transparent_p to zero (Bug#8238).
13156         Mark another local as initialized.
13157         (my_png_error, my_error_exit): Mark with NO_RETURN.
13159         * image.c (clear_image_cache): Now static.
13160         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
13161         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
13162         (x_edge_detection): Remove unnecessary cast that
13163         gcc -Wbad-function-cast diagnoses.
13164         (gif_load): Fix pointer signedness.
13165         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
13166         (jpeg_load, gif_load): Rename locals to avoid shadowing.
13168 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
13170         Improve quality of tests for time stamp overflow.
13171         For example, without this patch (encode-time 0 0 0 1 1
13172         1152921504606846976) returns the obviously-bogus value (-948597
13173         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
13174         reports time overflow.  See
13175         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
13176         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
13177         * editfns.c: Include limits.h and intprops.h.
13178         (TIME_T_MIN, TIME_T_MAX): New macros.
13179         (time_overflow): Move earlier, to before first use.
13180         (hi_time, lo_time): New functions, for an accurate test for
13181         out-of-range times.
13182         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
13183         (Fget_internal_run_time): Don't assume time_t fits in int.
13184         (make_time): Use list2 instead of Fcons twice.
13185         (Fdecode_time): More accurate test for out-of-range times.
13186         (check_tm_member): New function.
13187         (Fencode_time): Use it, to test for out-of-range times.
13188         (lisp_time_argument): Don't rely on undefined left-shift and
13189         right-shift behavior when checking for time stamp overflow.
13191         * editfns.c (time_overflow): New function, refactoring common code.
13192         (Fformat_time_string, Fdecode_time, Fencode_time):
13193         (Fcurrent_time_string): Use it.
13195         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
13196         * dired.c (make_time): Move to ...
13197         * editfns.c (make_time): ... here.
13198         * systime.h: Note the move.
13200 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
13202         * fringe.c (update_window_fringes): Remove unused variables.
13204         * unexmacosx.c (copy_data_segment): Also copy __got section.
13205         (Bug#8223)
13207 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
13209         * termcap.c [MSDOS]: Include "msdos.h".
13210         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
13211         Constify `char *' arguments and their references according to
13212         prototypes in tparam.h.
13214         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
13216         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
13217         Adapt all references accordingly.
13219         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
13221 2011-03-11  Tom Tromey  <tromey@redhat.com>
13223         * buffer.c (syms_of_buffer): Remove obsolete comment.
13225 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
13227         * termhooks.h (encode_terminal_code): Declare prototype.
13229         * msdos.c (encode_terminal_code): Don't declare prototype.
13231         * term.c (encode_terminal_code): Now external again, used by
13232         w32console.c and msdos.c.
13234         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
13235         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
13237 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
13239         Fix some minor problems found by GCC 4.5.2's static checks.
13241         * fringe.c (update_window_fringes): Mark locals as initialized
13242         (Bug#8227).
13243         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
13245         * alloc.c (mark_fringe_data): Move decl from here ...
13246         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
13247         to check its interface.
13248         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
13250         * fontset.c (free_realized_fontset): Now static.
13251         (Fset_fontset_font): Rename local to avoid shadowing.
13252         (fontset_font): Mark local as initialized.
13253         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
13255         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
13257         * xselect.c (x_disown_buffer_selections): Remove; not used.
13258         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
13259         (x_own_selection, Fx_disown_selection_internal): Rename locals
13260         to avoid shadowing.
13261         (x_handle_dnd_message): Remove local to avoid shadowing.
13263         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
13264         so that the caller can use some name other than gcpro1.
13265         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
13266         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13267         (Fx_backspace_delete_keys_p):
13268         Use them to avoid shadowing, and rename vars to avoid shadowing.
13269         (x_decode_color, x_set_name, x_window): Now static.
13270         (Fx_create_frame): Add braces to silence GCC warning.
13271         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
13272         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
13273         Remove unused locals.
13274         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
13275         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
13276         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
13277         macros.
13279         * xterm.h (x_mouse_leave): New decl.
13281         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
13282         Remove unused functions.
13283         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
13284         (x_calc_absolute_position): Now static.
13285         (XTread_socket): Don't define label "out" unless it's used.
13286         Don't declare local "event" unless it's used.
13287         (x_iconify_frame, x_free_frame_resources): Don't declare locals
13288         unless they are used.
13289         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
13290         (x_fatal_error_signal): Remove; not used.
13291         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
13292         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
13293         (x_error_catcher, x_connection_closed, x_error_handler):
13294         (x_error_quitter, xembed_send_message, x_iconify_frame):
13295         (my_log_handler): Rename locals to avoid shadowing.
13296         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
13297         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
13299         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
13300         Rename or move locals to avoid shadowing.
13301         (tty_defined_color, merge_face_heights): Now static.
13302         (free_realized_faces_for_fontset): Remove; not used.
13303         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
13304         does not deduce is never used uninitialized.
13305         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
13306         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
13308         * terminal.c (store_terminal_param): Now static.
13310         * xmenu.c (menu_highlight_callback): Now static.
13311         (set_frame_menubar): Remove unused local.
13312         (xmenu_show): Rename parameter to avoid shadowing.
13313         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
13314         since they might point to immutable storage.
13315         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
13316         since it's unused otherwise.
13318         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
13319         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
13320         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
13321         avoids a gcc -Wuninitialized diagnostic.
13322         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
13323         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
13324         does not deduce are never used uninitialized.
13326         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
13328         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
13329         * window.c (window_loop, size_window):
13330         (run_window_configuration_change_hook, enlarge_window): Likewise.
13332         * window.c (display_buffer): Now static.
13333         (size_window): Mark variables that gcc -Wuninitialized
13334         does not deduce are never used uninitialized.
13335         * window.h (check_all_windows): New decl, to forestall
13336         gcc -Wmissing-prototypes diagnostic.
13337         * dispextern.h (bidi_dump_cached_states): Likewise.
13339         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
13340         shadowing.
13341         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
13342         Include <limits.h>.
13343         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
13344         and to avoid gcc -Wuninitialized warning.
13345         (load_charset_map): Mark variables that gcc -Wuninitialized
13346         does not deduce are never used uninitialized.
13347         (load_charset): Abort instead of using uninitialized var (Bug#8229).
13349         * coding.c (coding_set_source, coding_set_destination):
13350         Use "else { /* comment */ }" rather than "else /* comment */;"
13351         for clarity, and to avoid gcc -Wempty-body warning.
13352         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
13353         a block, when the outer 'i' will do.
13354         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
13355         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
13356         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
13357         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
13358         (Fdecode_sjis_char, Fdefine_coding_system_internal):
13359         Rename locals to avoid shadowing.
13360         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
13361         * coding.c (emacs_mule_char, encode_invocation_designation):
13362         Now static, since they're not used elsewhere.
13363         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
13364         (decode_coding_object, encode_coding_object, detect_coding_system):
13365         (decode_coding_emacs_mule): Mark variables that gcc
13366         -Wuninitialized does not deduce are never used uninitialized.
13367         (detect_coding_iso_2022): Initialize a local variable that might
13368         be used uninitialized.  Leave a FIXME because it's not clear that
13369         this initialization is needed.  (Bug#8211)
13370         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
13371         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
13372         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
13373         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
13374         Remove unused macros.
13376         * category.c (hash_get_category_set): Remove unused local var.
13377         (copy_category_table): Now static, since it's not used elsewhere.
13378         * character.c (string_count_byte8): Likewise.
13380         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
13381         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
13383         * chartab.c (copy_sub_char_table): Now static, since it's not used
13384         elsewhere.
13385         (sub_char_table_ref_and_range, char_table_ref_and_range):
13386         Rename locals to avoid shadowing.
13387         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
13389         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
13390         (BIDI_BOB): Remove unused macro.
13392         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
13393         deduce are never used uninitialized.
13394         * term.c (encode_terminal_code): Likewise.
13396         * term.c (encode_terminal_code): Now static.  Remove unused local.
13398         * tparam.h: New file.
13399         * term.c, tparam.h: Include it.
13400         * deps.mk (term.o, tparam.o): Depend on tparam.h.
13401         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
13402         Move these decls to tparam.h, and make them agree with what
13403         is actually in tparam.c.  The previous trick of using incompatible
13404         decls in different modules does not conform to the C standard.
13405         All callers of tparam changed to use tparam's actual API.
13406         * tparam.c (tparam1, tparam, tgoto):
13407         Use const pointers where appropriate.
13409         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
13410         * cm.h (struct cm): Likewise.
13411         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
13412         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
13413         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
13414         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
13415         (turn_on_face, init_tty): Likewise.
13416         * termchar.h (struct tty_display_info): Likewise.
13418         * term.c (term_mouse_position): Rename local to avoid shadowing.
13420         * alloc.c (mark_ttys): Move decl from here ...
13421         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
13423 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
13425         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
13427 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
13429         * search.c (compile_pattern_1): Remove argument regp, unused since
13430         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
13431         (compile_pattern): Don't pass it.
13433 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
13435         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
13436         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
13437         for ! HAVE_GTK3.
13438         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
13440         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
13442         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
13443         gdk_window_get_screen, gdk_window_get_geometry,
13444         gdk_x11_window_lookup_for_display and GDK_KEY_g.
13445         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
13446         (xg_get_pixbuf_from_pixmap): New function.
13447         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
13448         to Pixmap, take frame as parameter, remove GdkColormap parameter.
13449         Call xg_get_pixbuf_from_pixmap instead of
13450         gdk_pixbuf_get_from_drawable.
13451         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
13452         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
13453         (xg_check_special_colors): Use GtkStyleContext and its functions
13454         for HAVE_GTK3.
13455         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
13456         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
13457         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
13458         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
13459         Call gtk_widget_get_preferred_size.
13460         (xg_frame_resized): gdk_window_get_geometry only takes 5
13461         parameters.
13462         (xg_win_to_widget, xg_event_is_for_menubar):
13463         Call gdk_x11_window_lookup_for_display.
13464         (xg_set_widget_bg): New function.
13465         (delete_cb): New function.
13466         (xg_create_frame_widgets): Connect delete-event to delete_cb.
13467         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
13468         (xg_set_background_color): Call xg_set_widget_bg.
13469         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
13470         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
13471         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
13472         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
13473         if ! HAVE_GTK3.
13474         (update_frame_tool_bar): Call gtk_widget_hide.
13475         (xg_initialize): Use GDK_KEY_g.
13477         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
13478         if ! HAVE_GTK3
13479         (x_session_initialize): Call gdk_x11_set_sm_client_id.
13481         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
13482         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
13483         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
13485 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
13487         * w32xfns.c (select_palette): Check success of RealizePalette against
13488         GDI_ERROR, not zero.
13490 See ChangeLog.11 for earlier changes.
13492 ;; Local Variables:
13493 ;; coding: utf-8
13494 ;; End:
13496   Copyright (C) 2011-2012 Free Software Foundation, Inc.
13498   This file is part of GNU Emacs.
13500   GNU Emacs is free software: you can redistribute it and/or modify
13501   it under the terms of the GNU General Public License as published by
13502   the Free Software Foundation, either version 3 of the License, or
13503   (at your option) any later version.
13505   GNU Emacs is distributed in the hope that it will be useful,
13506   but WITHOUT ANY WARRANTY; without even the implied warranty of
13507   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13508   GNU General Public License for more details.
13510   You should have received a copy of the GNU General Public License
13511   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.