* gtkutil.c (xg_get_font): Demand an Xft font.
[emacs.git] / src / ChangeLog
blob663035077bd1b061cc6be7ea6ac10a398809f636
1 2012-08-16  Chong Yidong  <cyd@gnu.org>
3         * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
5         * xfont.c (xfont_open):
6         * xftfont.c (xftfont_open): Set the font's max_width field.
8         * nsfont.m (nsfont_open): Similar to the Xft backend, set
9         min_width to space_width and average_width to the average over
10         printable ASCII characters.
11         (ns_char_width): Code cleanup.
12         (ns_ascii_average_width): New utility function.
14         * font.h (struct font): Update comments.
16 2012-08-16  Dmitry Antipov  <dmantipov@yandex.ru>
18         Simple interface to set Lisp_Object fields of character tables.
19         * lisp.h (CSET): New macro.
20         (char_table_set_extras, char_table_set_contents)
21         (sub_char_table_set_contents): New function.
22         * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
23         * syntax.c: Adjust users.
25 2012-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
27         * eval.c (eval_sub): Bind lexical-binding.
28         * lread.c (Qlexical_binding): Make non-static.
30 2012-08-15  Jan Djärv  <jan.h.d@swipnet.se>
32         * nsmenu.m (popupSession): Remove.
33         (pop_down_menu): Remove endModalSession.
34         (timeout_handler:): New method.
35         (runDialogAt:): Get next timeout.  Start a NSTimer with that timeout.
36         Call runModalForWindow.  Check timer_fired when it returns.
37         If not set, cancel timer and break out of loop.
38         Otherwise loop again, with a new timeout.
40         * nsterm.m: Include fcntl.h if present.
41         (fd_entry, t_readfds, inNsSelect): Remove.
42         (select_writefds, select_valid, select_timeout, selfds)
43         (select_mutex, apploopnr): Add.
44         (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
45         Otherwise call kbd_buffer_store_event.
46         (ns_send_appdefined): Remove release of fd_entry.
47         (ns_read_socket): Always send appdefined.  Remove inNsSelect check.
48         Increment and decrement apploopnr.
49         (ns_select): If no file descriptors, just do a NSTimer.
50         Otherwise copy read/write masks and start select thread (fd_handler).
51         Start main loop and wait for application defined event.
52         Inform select thread to stop selecting after main loop is exited.
53         (ns_term_init): Create selfds pipe and set non-blocking.
54         Initialize select_mutex. Start the select thread (fd_handler).
55         (fd_handler:): Loop forever, wait for info from the main thread
56         to either start or stop selecting.  When select returns, send
57         and appdefined event.
58         (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
59         If not call kbd_buffer_store_event.
61         * nsterm.h (EmacsApp): fd_handler takes id argument.
62         (EmacsDialogPanel): Add timer_fired and timeout_handler.
64         * gtkutil.c (xg_mark_data): Use FRAME_X_P.
66 2012-08-15  Eli Zaretskii  <eliz@gnu.org>
68         * region-cache.c (move_cache_gap): Update gap_len using the actual
69         growth of the boundaries array.  Do not change cache_len.
70         (Bug#12196)
72 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
74         Generalize and cleanup font subsystem checks.
75         * font.h (FONT_DEBUG, font_assert): Remove.
76         * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
77         Change font_assert to eassert.  Use eassert where appropriate.
79 2012-08-15  Dmitry Antipov  <dmantipov@yandex.ru>
81         * gtkutil.c (xg_get_font): Use pango_units_to_double.
83 2012-08-15  Chong Yidong  <cyd@gnu.org>
85         * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
86         When using the new font chooser, use gtk_font_chooser_get_font_desc to
87         extract the font descriptor instead of just the font name.
88         In that case, return a font spec instead of a string.
89         (x_last_font_name): Move to this file from xfns.c.
91         * xfns.c (Fx_select_font): The return value can also be a font
92         spec.  Move x_last_font_name management to gtkutil.c.
94         * xfaces.c: Make font weight and style symbols non-static.
96 2012-08-15  Stefan Monnier  <monnier@iro.umontreal.ca>
98         * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
99         (bug#12117).
101 2012-08-14  Stefan Monnier  <monnier@iro.umontreal.ca>
103         * alloc.c (Fgarbage_collect): Use plural form consistently.
105 2012-08-14  Eli Zaretskii  <eliz@gnu.org>
107         * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
108         iteration through the command loop.  Fixes a problem whereby mouse
109         movements are ignored until the first mouse click.
111 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
113         Use bool, not int, for Lisp booleans.
114         This is more natural, and on my platform (GCC 4.7.1 x86-64) it
115         makes Emacs a bit smaller and presumably a bit faster.
116         * lisp.h: Include <stdbool.h>.
117         (struct Lisp_Boolfwd, defvar_bool):
118         * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
119         * regex.c [!emacs]: Include <stdbool.h>.
120         (false, true): Remove; <stdbool.h> does this for us now.
122 2012-08-14  Chong Yidong  <cyd@gnu.org>
124         * character.c (Fcharacterp): Doc fix (Bug#12076).
126         * data.c (Findirect_variable): Doc fix (Bug#11040).
128         * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
130         * editfns.c (Fformat): Doc fix (Bug#12059).
131         (Fsave_current_buffer): Doc fix (Bug#11542).
133 2012-08-14  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
135         * keyboard.c (access_keymap_keyremap): Accept anonymous functions
136         (bug#12022).
138 2012-08-14  Martin Rudalics  <rudalics@gmx.at>
140         * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
141         (delete_frame, Fmake_frame_invisible, Ficonify_frame):
142         * minibuf.c (choose_minibuf_frame, read_minibuf):
143         * w32fns.c (x_create_tip_frame):
144         * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
145         Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
147 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
149         * intervals.c (offset_intervals): Remove obsolete comment.
151 2012-08-14  Andreas Schwab  <schwab@linux-m68k.org>
153         * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
155 2012-08-14  Gergely Risko  <gergely@risko.hu>
157         * coding.c (decode_coding): Record buffer modification before
158         disabling undo_list (Bug#11773).
160 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
162         Revert and cleanup some recent overlay changes.
163         * buffer.h (enum overlay_type): Remove.
164         (buffer_get_overlays, buffer_set_overlays): Likewise.
165         (buffer_set_overlays_before, buffer_set_overlays_after):
166         New function.  Adjust users.
167         (unchain_both): Add eassert.
169 2012-08-14  Dmitry Antipov  <dmantipov@yandex.ru>
171         * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
173 2012-08-14  Paul Eggert  <eggert@cs.ucla.edu>
175         * gtkutil.c (xg_mark_data): Don't assume C99.
177 2012-08-13  Jan Djärv  <jan.h.d@swipnet.se>
179         * gtkutil.c (xg_frame_tb_info): New struct.
180         (TB_INFO_KEY): New define.
181         (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
182         (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
183         (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
184         if not present.
185         (update_frame_tool_bar): Return early if data in xg_frame_tb_info
186         is up to date. Otherwise store new data.
187         (free_frame_tool_bar): Free xg_frame_tb_info if present.
189 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
191         Use KSET for write access to Lisp_Object members of struct kboard.
192         * keyboard.h (KSET): New macro.
193         * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
194         * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
195         * xterm.c: Adjust users.
197 2012-08-13  Dmitry Antipov  <dmantipov@yandex.ru>
199         Use BSET for write access to Lisp_Object members of struct buffer.
200         * buffer.h (BSET): New macro.
201         * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
202         * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
203         * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
204         * window.c, xdisp.c, xfns.c: Adjust users.
206 2012-08-11  BT Templeton  <bpt@hcoop.net>  (tiny change)
208         * lread.c (syms_of_lread): Initialize Vlexical_binding.
210 2012-08-11  Jan Djärv  <jan.h.d@swipnet.se>
212         * nsterm.m (not_in_argv): New function.
213         (application:openFile,  application:openTempFile:):
214         (application:openFileWithoutUI:, application:openFiles:): Open file
215         if not_in_argv returns non-zero (bug#12171).
217         * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
218         (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
219         Define for Gtk+ versions less than 3.2.
220         (xg_get_font_name): Use those functions/macros here.
221         Reported by Frans Oilinki <moilinki@gmail.com>.
223 2012-08-11  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
225         * unexmacosx.c (copy_data_segment): Copy initialized data in
226         statically linked libraries from input file rather than memory.
228         * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
229         LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
230         (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
232 2012-08-10  Glenn Morris  <rgm@gnu.org>
234         * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
235         * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
237 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
239         Fix last change to allow compilation with low optimization levels.
240         * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
241         Reported by Jan Djärv <jan.h.d@swipnet.se>.
243 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
245         Use common inline syntax in intervals.h.
246         * intervals.h (INTERVALS_INLINE): New macro.
247         Change all users from LISP_INLINE.
249 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
251         Define Qnone once for all platforms.
252         * frame.c (Qnone): Define here.
253         (syms_of_frame): DEFSYM it.
254         * lisp.h (Qnone): New declaration.
255         * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
256         * xfns.c: Remove duplication.  Adjust users.
258 2012-08-10  Dmitry Antipov  <dmantipov@yandex.ru>
260         Remove unused macros from intervals.h.
261         * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
262         * intervals.c: Adjust comment.
264 2012-08-10  Eli Zaretskii  <eliz@gnu.org>
266         * w32fns.c <w32_unicode_gui>: New static variable.
267         (globals_of_w32fns): Initialize it according to os_subtype.
268         (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
269         testing os_subtype.
271 2012-08-10  Joakim Hårsman  <joakim.harsman@gmail.com>  (tiny change)
272             Eli Zaretskii  <eliz@gnu.org>
274         Fix bug #10299 with Unicode characters sent by customized
275         keyboards created by MSKLC.
276         * w32fns.c (INIT_WINDOW_CLASS): New macro.
277         (w32_init_class): Use it to initialize the Emacs class with either
278         ANSI or Unicode API calls.
279         (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
280         later.
281         (w32_wnd_proc): If the character code sent by WM_CHAR or
282         WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
283         original message.  Call DefWindowProcW on NT and later.
285 2012-08-10  Glenn Morris  <rgm@gnu.org>
287         * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
289         * lisp.h (DIRECTORY_SEP): Let configure set it.
291 2012-08-09  Dmitry Antipov  <dmantipov@yandex.ru>
293         Use TSET for write access to Lisp_Object slots of struct terminal.
294         * termhooks.h (TSET): New macro.
295         * coding.c, terminal.c, xselect.c: Adjust users.
297 2012-08-08  Stefan Monnier  <monnier@iro.umontreal.ca>
299         * xdisp.c (safe_eval_handler): Remove prototype.  Receive args describing
300         the failing expression, include them in the error message.
301         * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
302         * lisp.h (internal_condition_case_n): Update declaration.
304 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
306         Inline functions to examine and change buffer overlays.
307         * buffer.c (unchain_both): New function.
308         * buffer.h (buffer_get_overlays, buffer_set_overlays):
309         (buffer_has_overlays): New function.
310         (enum overlay_type): New enum.
311         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
312         * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
314 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
316         Inline functions to examine and change buffer intervals.
317         * alloc.c (mark_interval_tree): Remove.
318         (MARK_INTERVAL_TREE): Simplify.
319         (UNMARK_BALANCE_INTERVALS): Remove.  Adjust users.
320         * intervals.c (buffer_balance_intervals): New function.
321         (graft_intervals_into_buffer): Adjust indentation.
322         (set_intervals_multibyte): Simplify.
323         * buffer.h (BUF_INTERVALS): Remove.
324         (buffer_get_intervals, buffer_set_intervals): New function.
325         * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
326         * intervals.c, textprop.c: Adjust users.
328 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
330         Inline functions to examine and change string intervals.
331         * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
332         (string_get_intervals, string_set_intervals): New function.
333         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
334         * lread.c, print.c, textprop.c: Adjust users.
336 2012-08-08  Glenn Morris  <rgm@gnu.org>
338         * lisp.mk (lisp): Remove language/persian.elc.
340 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
342         Cleanup intervals.
343         * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
344         (NULL_INTERVAL_P): Likewise.  Adjust users.
345         (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
346         Adjust comment.  Move under #if 0.
347         * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
348         * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
350 2012-08-08  Dmitry Antipov  <dmantipov@yandex.ru>
352         Check total length of intervals with eassert.
353         * intervals.h (CHECK_TOTAL_LENGTH): Remove.
354         * intervals.c: Change all users to eassert.
356 2012-08-07  Eli Zaretskii  <eliz@gnu.org>
358         * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
359         Rename fields to match removal of FGET and WGET and disuse of
360         INTERNAL_FIELD in Lisp_Cons.
362 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
364         Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
365         * lisp.h (struct Lisp_Symbol): Change xname to meaningful
366         name since all xname users are fixed long time ago.  Do not
367         use INTERNAL_FIELD.
368         (set_symbol_name, set_symbol_function, set_symbol_plist):
369         (set_symbol_next, set_overlay_plist): New function.
370         (struct Lisp_Cons): Do not use INTERNAL_FIELD.
371         (struct Lisp_Overlay): Likewise.
372         (CVAR, MVAR, SVAR): Remove.
373         * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
374         * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
375         * xterm.c: Adjust users.
376         * .gdbinit: Change to use name field of struct Lisp_Symbol
377         where appropriate.
379 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
381         Basic functions to set Lisp_Object and pointer slots of intervals.
382         * intervals.h (interval_set_parent, interval_set_object):
383         (interval_set_left, interval_set_right, interval_set_plist):
384         (interval_copy_parent): New function.
385         (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
386         (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
387         Adjust indentation.
388         (INTERVAL_SIZE): Remove.  Adjust users.
389         * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
391 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
393         Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
394         * process.h (PGET): Remove.
395         (struct Lisp_Process): Do not use INTERNAL_FIELD.
396         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
398 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
400         Drop WGET and revert read access to Lisp_Objects slots of struct window.
401         * window.h (WGET): Remove.
402         (struct window): Do not use INTERNAL_FIELD.
403         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
404         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
405         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
406         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
407         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
408         Adjust users.
410 2012-08-07  Chong Yidong  <cyd@gnu.org>
412         * window.c (Fwindow_edges, Fwindow_pixel_edges)
413         (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
414         (Fdelete_window_internal): Signal an error if the window is not on
415         a live frame (Bug#12025).
417 2012-08-07  Dmitry Antipov  <dmantipov@yandex.ru>
419         Drop FGET and revert read access to Lisp_Objects slots of struct frame.
420         * frame.h (FGET): Remove.
421         (struct frame): Do not use INTERNAL_FIELD.
422         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
423         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
424         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
425         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
427 2012-08-06  Juanma Barranquero  <lekktu@gmail.com>
429         * w32.c: Silence compiler warnings.
430         (map_w32_filename): Remove unused variable `is_fat'.
431         (chase_symlinks): Add parentheses around expression.
433 2012-08-06  Glenn Morris  <rgm@gnu.org>
435         * sysdep.c: Respect BROKEN_GETWD.
437         * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
438         Let configure handle it.
439         (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
441 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
443         Use GCALIGNMENT where appropriate.
444         * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
445         (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
446         (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
448 2012-08-06  Eli Zaretskii  <eliz@gnu.org>
450         * w32menu.c (set_frame_menubar, initialize_frame_menubar):
451         Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
453 2012-08-06  Stefan Monnier  <monnier@iro.umontreal.ca>
455         * buffer.h (struct buffer): Revert `indirections' to a simple int;
456         that should be sufficient for everyone.
458 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
460         * keyboard.c (timer_check_2): Add break so timer_check returns next
461         timeout.
463 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
465         Fix Windows build errors introduced after converting to WGET and WSET.
466         * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
467         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
469 2012-08-06  Jan Djärv  <jan.h.d@swipnet.se>
471         * nsterm.m (ns_frame_rehighlight): Use FSET.
473         * nsmenu.m (ns_update_menubar): Use FSET.
475 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
477         Separate read and write access to Lisp_Object slots of Lisp_Process.
478         * process.h (PGET, PSET): New macros similar to AREF and ASET.
479         * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
481 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
483         Separate read and write access to Lisp_Object slots of struct window.
484         * window.h (WGET, WSET): New macros similar to AREF and ASET.
485         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
486         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
487         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
488         * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
489         * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
490         Adjust users.
492 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
494         Fix Windows build errors introduced after converting to FGET and FSET.
495         * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
496         (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
497         (w32_judge_scroll_bars): Change to use FSET.
498         Reported by Andy Moreton <andrewjmoreton@gmail.com>.
500 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
502         Fix replacement typo.
503         * window.c (replace_window): Set root_window instead of
504         selected_window.  This fixes a total window subsystem
505         malfunction reported by Bastien Guerry <bzg@gnu.org>.
507 2012-08-06  Glenn Morris  <rgm@gnu.org>
509         * lisp.mk (lisp): Add language/persian.elc.
511 2012-08-06  Dmitry Antipov  <dmantipov@yandex.ru>
513         Separate read and write access to Lisp_Object slots of struct frame.
514         * frame.h (FGET, FSET): New macros similar to AREF and ASET.
515         * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
516         * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
517         * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
518         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
520 2012-08-05  Andreas Schwab  <schwab@linux-m68k.org>
522         * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
524 2012-08-05  Dmitry Antipov  <dmantipov@yandex.ru>
526         Generalize common compile-time constants.
527         * lisp.h (header_size, bool_header_size, word_size): Now here.
528         (struct Lisp_Vector): Add comment.
529         (struct Lisp_Bool_Vector): Move up to define handy constants.
530         (VECSIZE, PSEUDOVECSIZE): Simplify.
531         (SAFE_ALLOCA_LISP): Use new constant.  Adjust indentation.
532         * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
533         * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
534         * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
535         * xfont.c, xmenu.c: Use word_size where appropriate.
537 2012-08-05  Lawrence Mitchell  <wence@gmx.li>
539         * search.c (Freplace_match): Treat \? in the replacement text
540         literally (Bug#8161).
542 2012-08-05  Chong Yidong  <cyd@gnu.org>
544         * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
545         * frame.c (Vdelete_frame_functions):
546         * emacs.c (Vkill_emacs_hook): Doc fix.
548 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
550         * xfns.c (x_set_menu_bar_lines): Fix compilation error in
551         --with-x-toolkit=no builds.
552         Reported by Carsten Mattner <carstenmattner@gmail.com>.
554 2012-08-04  Chong Yidong  <cyd@gnu.org>
556         * syntax.c (Fmodify_syntax_entry): Doc fix.
558 2012-08-04  Eli Zaretskii  <eliz@gnu.org>
560         Fix startup warnings about ../site-lisp on MS-Windows.  (Bug#11959)
561         * w32.c (init_environment): Change the default values of many
562         environment variables in dflt_envvars[] to NULL, to avoid pushing
563         them into environment when they were not already defined.
564         Remove the code that deletes site-lisp subdirectories from the default
565         value of EMACSLOADPATH, as it is no longer needed.
566         (check_windows_init_file): Now external, not static.
567         Use Vload_path as is, without adding anything, as this function is now
568         called when Vload_path is already set up.
570         * w32.h (check_windows_init_file): Add prototype.
572         * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
573         directory, ignore the /*/i386/ tail in Vinvocation_directory, for
574         compatibility with Posix platforms.
575         (main): Move the call to check_windows_init_file to here from
576         w32.c.
577         (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
578         any, in the DEFALT argument into the root of the Emacs build or
579         installation tree, as appropriate.
581         * callproc.c (init_callproc_1): Call decode_env_path instead of
582         doing its equivalent by hand.
583         (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
584         the code that sets Vexec_path run on MS-Windows.
586         * lread.c (init_lread): Add comments to #ifdef's.
588         * msdos.c (dos_set_window_size, IT_update_begin)
589         (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
590         instead of direct references.
592 2012-08-04  Paul Eggert  <eggert@cs.ucla.edu>
594         Export DEFAULT_REHASH_* to GDB.
595         * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
596         Now constants, not macros.
598 2012-08-03  Paul Eggert  <eggert@cs.ucla.edu>
600         Remove unnecessary casts involving pointers.
601         These casts are no longer needed now that we assume C89 or later,
602         since they involve casting to or from void *.
603         * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
604         (make_pure_float, make_pure_vector):
605         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
606         * macros.c (Fstart_kbd_macro):
607         * menu.c (find_and_return_menu_selection):
608         * minibuf.c (read_minibuf_noninteractive):
609         * sysdep.c (closedir):
610         * xdisp.c (x_produce_glyphs):
611         * xfaces.c (compare_fonts_by_sort_order):
612         * xfns.c (x_real_positions, select_visual):
613         * xselect.c (x_stop_queuing_selection_requests)
614         (x_get_window_property, x_get_window_property_as_lisp_data):
615         * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
616         Remove unnecessary pointer casts.
617         * alloc.c (record_xmalloc): New function.
618         * lisp.h (record_xmalloc): New decl.
619         (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
620         more like a function.  This is because the pointer cast is not
621         needed.  All uses changed.
622         * print.c (print_string, print_error_message): Avoid length recalc.
624         Improve fix for macroexp crash with debugging (Bug#12118).
625         * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
626         ARRAY_MARK_FLAG when checking subscripts, because ASET is
627         not supposed to be invoked from the garbage collector.
628         See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
629         (gc_aset): New function, which is like ASET but can be
630         used in the garbage collector.
631         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
632         (set_hash_index): Use it instead of ASET.
634 2012-08-03  Eli Zaretskii  <eliz@gnu.org>
636         Support symlinks on latest versions of MS-Windows.
637         * w32.c: Include winioctl.h and aclapi.h.
638         (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
639         (revert_to_self): Forward declarations of static functions.
640         <static BOOL g_b_init_get_security_info>:
641         <g_b_init_create_symbolic_link>: New static flags.
642         (globals_of_w32): Initialize them to zero.
643         (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
644         (map_w32_filename): Improve commentary.  Simplify switch.
645         (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
646         headers (most versions of MinGW w32api don't).
647         (get_security_info, create_symbolic_link)
648         (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
649         New functions.
650         (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
651         in the argument file name.
652         (sys_access): Call unc_volume_file_attributes only if
653         GetFileAttributes fails with network-related error codes.
654         (sys_rename): Diagnose renaming of a symlink when the user doesn't
655         have the required privileges.
656         (get_file_security_desc_by_name): Rename from
657         get_file_security_desc.
658         (stat_worker): New function, with most of the guts of 'stat', and
659         with addition of handling of symlinks and support for 'lstat'.
660         If possible, get file's attributes and security information by
661         handle, not by name.  Produce S_IFLNK bit for symlinks, when
662         called from 'lstat'.
663         (stat, lstat): New functions, call 'stat_worker'.
664         (symlink, readlink, careadlinkat): Rewritten to create and resolve
665         symlinks when the underlying filesystem supports them.
667 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
669         Fix macroexp crash on Windows with debugging (Bug#12118).
670         * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
671         checking subscripts; problem introduced with the recent
672         "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
673         (ARRAY_MARK_FLAG): Now a macro as well as a constant,
674         since it's used in non-static inline functions now.
676         * xfaces.c (face_at_buffer_position, face_for_overlay_string):
677         Don't assume buffer size fits in 'int'.  Remove unused local.
679         Use C99-style 'extern inline' if available.
680         * buffer.h (BUFFER_INLINE):
681         * category.h (CATEGORY_INLINE):
682         * character.h (CHARACTER_INLINE):
683         * charset.h (CHARSET_INLINE):
684         * composite.h (COMPOSITE_INLINE):
685         * dispextern.h (DISPEXTERN_INLINE):
686         * lisp.h (LISP_INLINE):
687         * systime.h (SYSTIME_INLINE):
688         New macro, replacing 'static inline' in this header.
689         * buffer.h, category.h, character.h, charset.h, composite.h:
690         * dispextern.h, lisp.h, systime.h:
691         Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
692         * alloc.c (LISP_INLINE):
693         * buffer.c (BUFFER_INLINE):
694         * category.c (CATEGORY_INLINE):
695         * character.c (CHARACTER_INLINE):
696         * charset.c (CHARSET_INLINE):
697         * composite.c (COMPOSITE_INLINE):
698         * dispnew.c (DISPEXTERN_INLINE):
699         * sysdep.c (SYSTIME_INLINE):
700         Define to EXTERN_INLINE, so that the corresponding functions
701         are compiled into code.
702         * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
703         (INLINE_HEADER_END): New macros.
704         * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
705         since it's used in non-static inline functions now.
706         (VALMASK) [!USE_LSB_TAG]: Likewise.
708 2012-08-02  Glenn Morris  <rgm@gnu.org>
710         * s/: Remove empty directory.
712         * s/ms-w32.h: Move to ../nt/inc.
713         * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
714         Update for new ms-w32.h location.
716 2012-08-02  Paul Eggert  <eggert@cs.ucla.edu>
718         Port to Solaris 8.
719         * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
721 2012-08-02  Glenn Morris  <rgm@gnu.org>
723         * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
724         hard-coding the path separator.
726 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
728         Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
729         This how ASET and AREF are supposed to work, and makes
730         it easier to think about future improvements.  See
731         <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
732         * charset.h (set_charset_attr): New function.
733         All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
734         * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
735         (aref_addr): New function.  All uses of &AREF(...) changed.
736         (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
737         (set_hash_index): New functions.  All lvalue-style uses of
738         HASH_KEY etc. changed.
739         * keyboard.c (set_prop): New function.  All lvalue-style uses
740         of PROP changed.
742 2012-08-01  Alp Aker  <alp.tekin.aker@gmail.com>
744         * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
745         (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
746         (EmacsScroller-dealloc):  Adjust to use WVAR.  (Bug#12114)
747         * nsfns.m (ns_set_name_as_filename): Likewise.
748         * nsmenu.m (ns_update_menubar): Likewise.
749         * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
751 2012-08-01  Eli Zaretskii  <eliz@gnu.org>
753         * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
754         Adapt to latest changes in field names of the corresponding Lisp
755         objects.
757         * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
759 2012-08-01  Glenn Morris  <rgm@gnu.org>
761         * s/msdos.h: Remove file.
762         * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
763         * Makefile.in (S_FILE): Remove.
764         (config_h): Remove S_FILE.
766 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
768         * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
769         Remove; moved to nt/config.nt.
771 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
773         Use INTERNAL_FIELD for conses and overlays.
774         * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
775         Remove obsolete comment.
776         (MVAR): New macro.
777         (struct Lisp_Overlay): Use INTERNAL_FIELD.
778         * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
780 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
782         Use INTERNAL_FIELD for symbols.
783         * lisp.h (SVAR): New macro.  Adjust users.
784         * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
785         * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
787 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
789         Use INTERNAL_FIELD for processes.
790         * process.h (PVAR): New macro.  Adjust style.
791         (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
792         * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
794 2012-08-01  Dmitry Antipov  <dmantipov@yandex.ru>
796         Use INTERNAL_FIELD for windows.
797         * window.h (WVAR): New macro.
798         (struct window): Change Lisp_Object members to INTERNAL_FIELD.
799         * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
800         * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
801         * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
802         * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
803         * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
805 2012-08-01  Paul Eggert  <eggert@cs.ucla.edu>
807         * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
809 2012-08-01  Glenn Morris  <rgm@gnu.org>
811         * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
812         Move to configure.ac.
814 2012-08-01  Juanma Barranquero  <lekktu@gmail.com>
816         * makefile.w32-in (CONFIG_H): Update dependencies.
817         (CONF_POST_H): New macro.
819         * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
821 2012-07-31  Glenn Morris  <rgm@gnu.org>
823         * Makefile.in (S_FILE): No longer set by configure.
825         * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
826         is available.
827         (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
829         * process.h (NULL_DEVICE):
830         * emacs.c (SEPCHAR):
831         * editfns.c (USER_FULL_NAME): Let configure set them.
833         * s/README, s/template.h: Remove files.
835         * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
837         * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
838         Move to configure.ac.
840 2012-07-31  Eli Zaretskii  <eliz@gnu.org>
842         * .gdbinit (xframe): Adapt to introduction of FVAR and the
843         resulting renaming of 'struct frame' members.
845         * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
847         * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
848         after introduction of FVAR.
850 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
852         * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
854         * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
855         instead of compositeToPoint.
856         (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
858         * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
860 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
862         Generalize INTERNAL_FIELD between buffers, keyboards and frames.
863         * lisp.h (INTERNAL_FIELD): New macro.
864         * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
865         (BVAR): Change to use INTERNAL_FIELD.
866         * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
867         (KVAR): Change to use INTERNAL_FIELD.
868         * frame.h (FVAR): New macro.
869         (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
870         * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
871         * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
872         * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
873         * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
875 2012-07-31  Dmitry Antipov  <dmantipov@yandex.ru>
877         Miscellaneous fixes for non-default X toolkits.
878         * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
879         * xterm.c (x_frame_of_widget): Remove redundant prototype.
880         Move under #ifdef USE_LUCID.
881         (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
882         definition and usage to avoid warnings.
884 2012-07-31  Jan Djärv  <jan.h.d@swipnet.se>
886         * nsterm.m (openFiles): Fix previous checkin.
888 2012-07-31  Paul Eggert  <eggert@cs.ucla.edu>
890         * indent.c (compute_motion): Remove unused local.
892 2012-07-31  Glenn Morris  <rgm@gnu.org>
894         * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
896         * conf_post.h [USG5_4]:
897         Move remaining contents of s/usg5-4-common.h here.
898         * s/usg5-4-common.h: Remove file.
900         * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
901         * s/irix6-5.h: Remove file.
903         * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
904         * s/darwin.h: Remove file.
906         * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
907         * s/hpux10-20.h: Remove file, which is now empty.
909 2012-07-30  Glenn Morris  <rgm@gnu.org>
911         * conf_post.h: New, split from configure.ac's AH_BOTTOM.
912         * Makefile.in (config_h): Add conf_post.h.
913         * makefile.w32-in (CONFIG_H): Add conf_post.h.
915 2012-07-30  Jan Djärv  <jan.h.d@swipnet.se>
917         * nsterm.m (ns_do_open_file): New variable.
918         (ns_term_init): Set ns_do_open_file to YES after run returns.
919         (openFile, openTempFile, openFileWithoutUI, openFiles):
920         Open files only if ns_do_open_file.
922 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
924         * lisp.h (SWITCH_ENUM_CAST): Remove.  All uses removed.
925         This no-op macro hasn't been needed for many years.
926         * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
928         Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
929         * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
930         * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
931         gdb_make_enums_visible.
932         (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
933         (DIRECTORY_SEP): Now a constant, not a macro.
935 2012-07-30  Eli Zaretskii  <eliz@gnu.org>
937         * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
938         w32_kbd_patch_key as the 2nd arg.  (Bug#12082)
940         * w32term.c <w32_keyboard_codepage>: Renamed from
941         keyboard_codepage and now external.  All users changed.
943         * w32term.h: Add declaration of w32_keyboard_codepage.
945         * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
946         the codepage to translate keys to Unicode.  If this argument is
947         -1, use the value returned by GetConsoleCP.  All callers changed.
949 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
951         Update .PHONY listings in makefiles.
952         * Makefile.in (.PHONY): Add all, mostlyclean, clean,
953         bootstrap-clean, distclean, maintainer-clean, versioclean,
954         extraclean, frc.
956         * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
957         This is a bit clearer.  Fix some commentary typos.
959 2012-07-30  Glenn Morris  <rgm@gnu.org>
961         * s/netbsd.h: Let configure include signal.h if needed.
962         Remove file, which is now empty.
964         * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
965         Let configure set them.
966         * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
967         No more need to undefine.
969 2012-07-30  Andreas Schwab  <schwab@linux-m68k.org>
971         * keymap.c (Fkey_description): Don't remove 0x80 bit from
972         non-single-byte char when adding meta modifier.  (Bug#12090)
974 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
976         Convert safe_call to use variable number of arguments.
977         * xdisp.c (safe_call): Convert to use varargs.  Adjust users.
978         (safe_call2): Fix comment.
979         * lisp.h (safe_call): Adjust prototype.
980         * coding.c (encode_coding_object): Change to use safe_call2.
981         * xfaces.c (merge_face_heights): Change to use safe_call1.
983 2012-07-30  Glenn Morris  <rgm@gnu.org>
985         * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
986         does that unconditionally.  Remove file, which is now empty.
988         * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
989         Remove empty files.
991 2012-07-30  Paul Eggert  <eggert@cs.ucla.edu>
993         Export to GDB most of lisp.h's remaining object-like macros.
994         * lisp.h (min, max): Move earlier, because they're used earlier now.
995         (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
996         (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
997         (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
998         (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
999         (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1000         (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1001         (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1002         (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1003         Now constants, for GDB.  They need not be macros.
1004         (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1005         Now constants, for GDB, as well as macros, for static initializers.
1006         (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1007         Move to after the definition of struct Lisp_Char_Table,
1008         since the former now needs that type defined.
1009         (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1010         (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1011         (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1012         New enums, for gdb_make_enums_visible.
1013         (GLYPH_MODE_LINE_FACE): Remove; unused.
1014         * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
1015         (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1016         CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1017         enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1018         enum maxargs, enum MAX_ALLOCA.
1019         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1020         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1021         no longer needed, now that they are done in lisp.h.
1023 2012-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
1025         Cleanup string bytes checking.
1026         * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove.  Convert
1027         all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1028         (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1029         (check_sblock, compact_small_strings): Simplify.
1031 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
1033         * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1034         These macros are confusing and no longer need to be defined, as
1035         the enum values now suffice.  All uses replaced with definiens.
1036         (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1038 2012-07-29  Juanma Barranquero  <lekktu@gmail.com>
1040         * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1041         ($(BLD)/w32console.$(O)): Update dependencies.
1043 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
1045         Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1046         * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1047         time.  Adjust users.
1048         (CHECK_CONS_LIST): Remove.  Convert all users to check_cons_list.
1050 2012-07-29  Jan Djärv  <jan.h.d@swipnet.se>
1052         * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1053         setting sitelisp (Bug#12010).
1055 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
1057         * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
1059         * w32heap.c (cache_system_info):
1060         * w32.c (sys_rename):
1061         * w32proc.c (find_child_console, sys_kill): All users changed.
1063 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
1065         * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1067 2012-07-29  Eli Zaretskii  <eliz@gnu.org>
1069         * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1071 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
1073         Cleanup statistics calculation in Fgarbage_collect.
1074         * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1075         Fix zombies percentage calculation.  Simplify elapsed time calculation.
1077 2012-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
1079         Generalize marker debugging code under MARKER_DEBUG and use eassert.
1080         * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1081         (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1082         (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1083         (replace_range, replace_range_2, del_range_2): Change to eassert.
1084         * marker.c (byte_char_debug_check): Adjust style.
1086 2012-07-29  Paul Eggert  <eggert@cs.ucla.edu>
1088         Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1089         * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1090         long-ago-commented-out code that talks about "WIN32".
1091         * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1092         All uses changed.
1094 2012-07-28  Paul Eggert  <eggert@cs.ucla.edu>
1096         Use Gnulib stdalign module (Bug#9772, Bug#9960).
1097         * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1098         Simplify by using alignof.
1099         (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1100         * lisp.h: Include <stdalign.h>.
1101         (GCALIGNMENT): New macro and constant.
1102         (DECL_ALIGN): Remove.  All uses replaced by alignas (GCALIGNMENT).
1103         (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1104         (stdalign): New macro, if not already defined.
1106 2012-07-28  Eli Zaretskii  <eliz@gnu.org>
1108         Fix non-ASCII input in non-GUI frames on MS-Windows.  (Bug#12055)
1109         * w32inevt.c: Include w32inevt.h.
1110         (w32_read_console_input): New inline function, calls either
1111         ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1112         w32_console_unicode_input.
1113         (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1114         (w32_kbd_patch_key, key_event): Use the codepage returned by
1115         GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1116         (key_event): use uChar.UnicodeChar only if
1117         w32_console_unicode_input is non-zero.
1119         * w32console.c: Include w32heap.h.
1120         <w32_console_unicode_input>: New global variable.
1121         (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1122         family of Windows, zero otherwise.
1124         * w32inevt.h: Declare w32_console_unicode_input.
1126         * xdisp.c (init_iterator): Don't reference tip_frame in a build
1127         --without-x.  (Bug#11742)
1129 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
1131         Adjust GDB to reflect pvec_type changes (Bug#12036).
1132         * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
1133         2012-07-04 changes to pseudovector representation.
1134         Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
1136 2012-07-27  Michael Albinus  <michael.albinus@gmx.de>
1138         * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1139         bus address.
1140         (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1142 2012-07-27  Eli Zaretskii  <eliz@gnu.org>
1144         * alloc.c (listn): Fix the order the arguments are consed onto the
1145         list.
1147         * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1148         enumeration constants, as PURE and HEAP are too general, and clash
1149         with other headers and sources, such as gmalloc.c and the
1150         MS-Windows system headers.  All users changed.
1152 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
1154         Revert last save_excursion_save and save_excursion_restore changes.
1155         * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1156         Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1158 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
1160         Fix recently-introduced typos in Windows port.
1161         Reported by Martin Rudalics <rudalics@gmx.at>.
1162         * w32.c (init_environment): Replace comma with semicolon.
1163         * w32fns.c (syms_of_w32fns): Add missing parenthesis.
1165 2012-07-27  Paul Eggert  <eggert@cs.ucla.edu>
1167         Improve GDB symbol export (Bug#12036).
1168         * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1169         arms of an 'if', not using conditional expressions; otherwise GDB
1170         complains about the types in the unevaluated arm when the argument
1171         is an integer literal.
1172         (xgetint): Simplify expression.
1173         * alloc.c (gdb_make_enums_visible): New constant.  This ports to
1174         GCC 3.4.2 the export of symbols to GDB.  Problem reported by Eli
1175         Zaretskii in <http://bugs.gnu.org/12036#13>.
1176         * lisp.h (PUBLISH_TO_GDB): Remove.  All uses removed.  No longer
1177         needed now that we have gdb_make_enums_visible.
1178         (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
1179         (enum enum_USE_LSB_TAG):
1180         New enum types, packaging up enums that need to be exported to GDB.
1182 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
1184         Utility function to make a list from specified amount of objects.
1185         * lisp.h (enum constype): New datatype.
1186         (listn): New prototype.
1187         * alloc.c (listn): New function.
1188         (Fmemory_use_count, syms_of_alloc): Use it.
1189         * buffer.c (syms_of_buffer): Likewise.
1190         * callint.c (syms_of_callint): Likewise.
1191         * charset.c (define_charset_internal): Likewise.
1192         * coding.c (syms_of_coding): Likewise.
1193         * keymap.c (syms_of_keymap): Likewise.
1194         * search.c (syms_of_search): Likewise.
1195         * syntax.c (syms_of_syntax): Likewise.
1196         * w32.c (init_environment): Likewise.
1197         * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
1198         * xdisp.c (syms_of_xdisp): Likewise.
1199         * xfns.c (syms_of_xfns): Likewise.
1201 2012-07-27  Dmitry Antipov  <dmantipov@yandex.ru>
1203         Fast save_excursion_save and save_excursion_restore.
1204         * lisp.h (struct Lisp_Excursion): New data type.
1205         (PVEC_EXCURSION): New pseudovector type.
1206         (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
1207         to deal with it.  Adjust comments.
1208         (init_marker, attach_marker): New prototype.
1209         (unchain_marker): Adjust prototype.
1210         * marker.c (attach_marker): Change to global.
1211         (init_marker): New function.
1212         * alloc.c (Fmake_marker, build_marker): Use it.
1213         (build_marker): More easserts.
1214         (mark_object): Handle struct Lisp_Excursion.
1215         * editfns.c (save_excursion_save, save_excursion_restore):
1216         Reimplement to use struct Lisp_Excursion.  Add comments.
1218 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
1220         Fix export of symbols to GDB (Bug#12036).
1221         * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
1222         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
1223         emacs.c, as this is a more-suitable home.  Had this been done earlier
1224         the fix for 12036 would have avoided some of the problems noted in
1225         <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
1226         would have been more obvious.
1227         * emacs.c: Do not include <verify.h>; no longer needed.
1228         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
1229         (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
1230         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1231         Remove; now done in lisp.h.
1232         * lisp.h (PUBLISH_TO_GDB): New macro.
1233         (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
1234         (DATA_SEG_BITS): Use it.
1235         (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
1236         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
1237         * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
1238         not be usable in #if.  This simplifies things.
1240 2012-07-26  Juanma Barranquero  <lekktu@gmail.com>
1242         * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
1244 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
1246         Simplify export of symbols to GDB (Bug#12036).
1247         * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
1248         $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
1249         (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
1250         Adjust to changes in lisp.h and emacs.c, by using
1251         CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
1252         of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
1253         INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
1254         gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
1255         instead of gdb_valbits.
1256         (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
1257         PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
1258         instead of gdb_array_mark_flag.
1259         (xboolvector): Get size from $->size, not $->header.size.
1260         Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
1261         (xreload, hook-run, hookpost-run): Remove.
1262         * emacs.c: Include <verify.h>.
1263         (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
1264         (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
1265         Remove.
1266         (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
1267         (gdb_USE_LSB_TAG): New enum constants.
1268         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1269         Also define these as enum constants, so they're visible to GDB.
1270         (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
1271         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
1272         as constants, so they're visible to GDB.
1273         * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
1274         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
1275         Now enum constants, not macros, so they're visible to GDB.
1276         (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
1277         more convenient now.  All uses changed.
1278         (VALMASK) [USE_LSB_TAG]: Also define in this case.
1279         * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
1281 2012-07-26  Dmitry Antipov  <dmantipov@yandex.ru>
1283         Explicitly free restriction data that are not needed anymore.
1284         * editfns.c (save_restriction_restore): Free restriction data.
1286 2012-07-26  Stefan Monnier  <monnier@iro.umontreal.ca>
1288         * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
1289         add argument, tune behavior, and adjust all callers.
1291 2012-07-25  Paul Eggert  <eggert@cs.ucla.edu>
1293         Use typedef for EMACS_INT, EMACS_UINT.
1294         * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
1295         than macros.  This simplifies debugging in the usual case, since
1296         it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
1297         and it allows expressions involving EMACS_INT casts.
1298         * .gdbinit (xreload): Simplify by using EMACS_INT cast.
1300 2012-07-25  Jan Djärv  <jan.h.d@swipnet.se>
1302         * nsterm.m (ns_read_socket): Return early if there is a modal
1303         window (Bug#12043).
1305 2012-07-25  Martin Rudalics  <rudalics@gmx.at>
1307         * frame.c (Fredirect_frame_focus): In doc-string don't mention
1308         that FOCUS-FRAME can be omitted.
1310 2012-07-25  Dmitry Antipov  <dmantipov@yandex.ru>
1312         Adjust buffer text indirection counters at the end of Fkill_buffer.
1313         * buffer.c (Fkill_buffer): Adjust indirection counters when the
1314         buffer is definitely dead.  This should really fix an issue reported
1315         by Christoph Scholtes again.  (Bug#12007).
1316         (init_buffer_once): Initialize indirection counters of
1317         buffer_defaults and buffer_local_symbols (for sanity and safety).
1319 2012-07-24  Eli Zaretskii  <eliz@gnu.org>
1321         * xdisp.c (init_iterator): Don't compute dimensions of truncation
1322         and continuation glyphs on tooltip frames, leave them at zero.
1323         Avoids continued lines in tooltips.  (Bug#11832)
1325 2012-07-24  Dmitry Antipov  <dmantipov@yandex.ru>
1327         Simplify copy_overlay.
1328         * buffer.c (copy_overlay): Simplify.  Use build_marker.
1329         * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
1331 2012-07-23  Eli Zaretskii  <eliz@gnu.org>
1333         * print.c (print_object): Don't crash when a frame's name is nil
1334         or invalid.  (Bug#12025)
1336         * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
1337         it signals an error when a tooltip frame is being created.
1339 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
1341         Cleanup miscellaneous objects allocation and initialization.
1342         * alloc.c (allocate_misc): Change to static.  Add argument to
1343         specify the subtype.  Adjust comment and users.
1344         (build_overlay): New function.
1345         * buffer.c (copy_overlays, Fmake_overlay): Use it.
1346         * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
1347         (allocate_misc): Remove prototype.
1348         (build_overlay): Add prototype.
1350 2012-07-23  Dmitry Antipov  <dmantipov@yandex.ru>
1352         Swap buffer text indirection counters in Fbuffer_swap_text.
1353         * buffer.c (Fbuffer_swap_text): Swap indirections too.
1354         This avoids crash reported by Christoph Scholtes at
1355         http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
1357 2012-07-22  Jan Djärv  <jan.h.d@swipnet.se>
1359         * nsmenu.m (Popdown_data): New struct.
1360         (pop_down_menu): p->pointer is Popdown_data.  Release the pool and
1361         free Popdown_data.
1362         (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
1363         (initWithContentRect): Make imgView and contentView non-static
1364         and autorelease them.  Also autorelease img and matrix (Bug#12005).
1365         (dealloc): Remove (Bug#12005).
1367 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
1369         Adjust consing_since_gc when objects are explicitly freed.
1370         * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
1371         (Fgarbage_collect): Use it.  Change minimum to 1/10 of default.
1372         (free_cons, free_misc): Subtract object size from consing_since_gc.
1374 2012-07-22  Dmitry Antipov  <dmantipov@yandex.ru>
1376         Simplify and cleanup markers positioning code.
1377         * marker.c (attach_marker): More useful eassert.
1378         (live_buffer, set_marker_internal): New function.
1379         (Fset_marker, set_marker_restricted): Use set_marker_internal.
1380         (set_marker_both, set_marker_restricted_both): Use live_buffer.
1382 2012-07-22  Paul Eggert  <eggert@cs.ucla.edu>
1384         * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
1385         as it's limited by the amount of memory, not by INT_MAX.
1387 2012-07-21  Eli Zaretskii  <eliz@gnu.org>
1389         * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
1390         in special-event-map.  See the discussion at
1391         http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
1392         for the reasons.
1394         * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
1395         info.dwItemData.  Fixes crashes on 64-bit Windows.
1396         Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1398 2012-07-21  Jan Djärv  <jan.h.d@swipnet.se>
1400         * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
1401         (conversationIdentifier): Return value is NSInteger.
1402         * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
1404 2012-07-21  Chong Yidong  <cyd@gnu.org>
1406         * window.c (decode_any_window): Signal an error if the window is
1407         on a dead frame (Bug#11984).
1409 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
1411         Add indirection counting to speed up Fkill_buffer.
1412         * buffer.h (struct buffer): New member.
1413         * buffer.c (Fget_buffer_create): Set indirection counter to 0.
1414         (Fmake_indirect_buffer): Set indirection counter to -1, increment
1415         base buffer indirection counter.
1416         (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
1417         (Fkill_buffer): Adjust indirection counters as needed, don't walk
1418         through buffer list if indirection counter is 0.
1420 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
1422         Extend the value returned by Fgarbage_collect with heap statistics.
1423         * alloc.c (Qheap): New symbol.
1424         (syms_of_alloc): DEFSYM it.
1425         (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
1426         (Fmemory_free): Remove.
1427         (syms_of_alloc): Don't defsubr it.
1428         * buffer.c (Fcompact_buffer): Remove.
1429         (syms_of_buffer): Don't defsubr it.
1431 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
1433         Make maybe_gc inline.
1434         Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
1435         * lisp.h (consing_since_gc, gc_relative_threshold)
1436         (memory_full_cons_threshold): Revert declaration.
1437         (maybe_gc): Remove prototype, define as inline.
1438         * alloc.c: Remove old commented-out code.
1439         (consing_since_gc, gc_relative_threshold)
1440         (memory_full_cons_threshold): Revert to global.
1441         (maybe_gc): Remove.
1443 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
1445         Simple wrapper for make_unibyte_string, adjust font_open_by_name.
1446         * lisp.h (build_unibyte_string): New function.
1447         * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
1448         * sysdep.c, w32fns.c, xfns.c: Use it.
1449         * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
1450         of type Lisp_Object to avoid redundant calls to make_unibyte_string.
1451         Adjust users accordingly.
1452         * font.h (font_open_by_name): Adjust prototype.
1454 2012-07-20  Dmitry Antipov  <dmantipov@yandex.ru>
1456         Cleanup calls to Fgarbage_collect.
1457         * lisp.h (maybe_gc): New prototype.
1458         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
1459         Remove declarations.
1460         * alloc.c (maybe_gc): New function.
1461         (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
1462         Make them static.
1463         * bytecode.c (MAYBE_GC): Use maybe_gc.
1464         * eval.c (eval_sub, Ffuncall): Likewise.
1465         * keyboard.c (read_char): Likewise.  Adjust call to maybe_gc
1466         to avoid dependency from auto-save feature.
1468 2012-07-19  Paul Eggert  <eggert@cs.ucla.edu>
1470         * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
1471         (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
1472         'for_each_per_buffer_object_at'.
1473         All uses changed.  It's better to use upper-case for macros that
1474         cannot be implemented as functions, to give the reader a clue
1475         that they're special.
1477 2012-07-19  Stefan Monnier  <monnier@iro.umontreal.ca>
1479         * alloc.c (Fgarbage_collect): Tweak docstring.
1481 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
1483         Tweak the value returned from Fgarbage_collect again.
1484         * alloc.c (Fgarbage_collect): New return value, as confirmed in
1485         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
1486         Adjust documentation.
1487         (total_vector_bytes): Rename to total_vector_slots, adjust
1488         accounting.
1489         (total_free_vector_bytes): Rename to total_free_vector_slots,
1490         adjust accounting.
1491         (Qstring_bytes, Qvector_slots): New symbols.
1492         (syms_of_alloc): DEFSYM them.
1494 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
1496         Buffer compaction primitive which may be used from Lisp.
1497         * buffer.c (compact_buffer, Fcompact_buffer): New function.
1498         (syms_of_buffer): Register Fcompact_buffer.
1499         * alloc.c (Fgarbage_collect): Use compact_buffer.
1500         * buffer.h (compact_buffer): New prototype.
1501         (struct buffer_text): New member.
1503 2012-07-19  Dmitry Antipov  <dmantipov@yandex.ru>
1505         New macro to iterate over all buffers, miscellaneous cleanups.
1506         * lisp.h (all_buffers): Remove declaration.
1507         * buffer.h (all_buffers): Add declaration, with comment.
1508         (for_each_buffer): New macro.
1509         * alloc.c (Fgarbage_collect, mark_object): Use it.
1510         * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
1511         (init_buffer): Likewise.
1512         * data.c (Fset_default): Likewise.
1513         * coding.c (code_conversion_restore): Remove redundant check
1514         for dead buffer.
1515         * buffer.c (Fkill_buffer): Likewise.  Remove obsolete comment.
1517 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
1519         Fix bug that created negative-length intervals.
1520         * intervals.c (merge_interval_right, merge_interval_left):
1521         Do not zero out this interval if it is absorbed by its children,
1522         as this interval's total length doesn't change in that case.  See
1523         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
1525 2012-07-18  Paul Eggert  <eggert@cs.ucla.edu>
1527         * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
1528         when invoking (make-bool-vector N t) and N is a positive
1529         multiple of 8 -- the last 8 bits were mistakenly cleared.
1531         Remove some struct layout assumptions in bool vectors.
1532         * alloc.c (bool_header_size): New constant.
1533         (header_size, word_size): Move earlier, as they're now used earlier.
1534         Use 'word_size' in a few more places, where it's appropriate.
1535         (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
1536         padding before the data member of a bool vector.
1537         (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
1538         than doing the check by hand with an abort ().
1540 2012-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
1542         * eval.c (Fdefvar): Don't check constants since we only set the var if
1543         it's not yet defined anyway (bug#11904).
1545         * lisp.h (last_undo_boundary): Declare new var.
1546         * keyboard.c (command_loop_1): Set it.
1547         * cmds.c (Fself_insert_command): Use it to only remove boundaries that
1548         were auto-added by the command loop (bug#11774).
1550 2012-07-18  Andreas Schwab  <schwab@linux-m68k.org>
1552         * w32font.c (Qsymbol): Remove local definition.
1553         (syms_of_w32font): Don't DEFSYM it.
1555 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
1557         Fix sweep_vectors to handle large bool vectors correctly.
1558         * alloc.c (sweep_vectors): Account total_vector_bytes for
1559         bool vectors larger than VBLOCK_BYTES_MAX.
1561 2012-07-18  Chong Yidong  <cyd@gnu.org>
1563         * frame.c (x_set_frame_parameters): Revert bogus change introduced
1564         in 2012-05-25 commit by Paul Eggert (Bug#11738).
1566 2012-07-18  Dmitry Antipov  <dmantipov@yandex.ru>
1568         Return more descriptive data from Fgarbage_collect.
1569         Suggested by Stefan Monnier in
1570         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
1571         * alloc.c (bounded_number): New function.
1572         (total_buffers, total_vectors): New variable.
1573         (total_string_size): Rename to total_string_bytes, adjust users.
1574         (total_vector_size): Rename to total_vector_bytes, adjust users.
1575         (sweep_vectors): Account total_vectors and total_vector_bytes.
1576         (Fgarbage_collect): New return value.  Adjust documentation.
1577         (gc_sweep): Account total_buffers.
1578         (Fmemory_free, Fmemory_use_counts): Use bounded_number.
1579         (VECTOR_SIZE): Remove.
1580         * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
1581         (Qinterval, Qmisc): New symbols.
1582         (syms_of_data): Initialize them.
1583         * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
1584         (Qcons, Qbuffer): New declarations.
1586 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
1588         * alloc.c (Fmemory_free): Account for memory-free's own storage.
1589         Round up, not down.  Improve doc.
1591 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
1593         Restore old code in allocate_string_data to avoid Faset breakage.
1594         Reported by Julien Danjou <julien@danjou.info> in
1595         http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
1596         * alloc.c (allocate_string_data): Restore old code with minor
1597         adjustments, fix comment to explain this subtle issue.
1599 2012-07-17  Eli Zaretskii  <eliz@gnu.org>
1601         Remove FILE_SYSTEM_CASE.
1602         * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
1604         * fileio.c (FILE_SYSTEM_CASE): Don't define.
1605         (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
1606         Fixes problems on MS-DOS with Vtemp_file_name_pattern when
1607         call-process-region passes it through expand-file-name.
1609         * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
1611 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
1613         Fix crash when creating indirect buffer (Bug#11917)
1614         * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
1615         Don't handle unbound variables specially if non-zero.
1616         (Fbuffer_local_variables): Pass zero.
1617         (clone_per_buffer_values): Pass non-zero.
1619 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
1621         * gnutls.c (emacs_gnutls_handshake): Revert last change.  Add QUIT
1622         to make the loop interruptible.
1624 2012-07-17  Andreas Schwab  <schwab@linux-m68k.org>
1626         * gnutls.c (emacs_gnutls_handshake): Only retry if
1627         GNUTLS_E_INTERRUPTED.
1629 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
1631         Cleanup and convert miscellaneous checks to eassert.
1632         * alloc.c (mark_interval): Fix comment, partially rephrase
1633         old comment from intervals.h (see below).
1634         * intervals.c (find_interval, adjust_intervals_for_insertion)
1635         (delete_interval, adjust_intervals_for_deletion)
1636         (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
1637         Convert to eassert.
1638         (adjust_intervals_for_insertion, make_new_interval):
1639         Remove obsolete and unused code.
1640         * intervals.h (struct interval): Remove obsolete comment.
1641         * textprotp.c (erase_properties): Remove unused code.
1642         (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
1643         (Fremove_list_of_text_properties): Convert to eassert.
1645 2012-07-17  Chong Yidong  <cyd@gnu.org>
1647         * editfns.c (Finsert_char): Doc fix.
1649 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
1651         Fix previous change to make Fmemory_free always accurate.
1652         * alloc.c (make_interval): Update total_free_intervals.
1653         (make_float): Likewise for total_free_floats.
1654         (free_cons, Fcons): Likewise for total_free_conses.
1655         (SETUP_ON_FREE_LIST, allocate_vector_from_block):
1656         Likewise for total_free_vector_bytes.
1657         (Fmake_symbol): Likewise for total_free_symbols.
1658         (bytes_free): Remove.
1660 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
1662         Simple free memory accounting feature.
1663         * alloc.c (bytes_free, total_free_vector_bytes): New variable.
1664         (sweep_vectors): Accumulate size of free vectors.
1665         (Fgarbage_collect): Setup bytes_free.
1666         (Fmemory_free): New function.
1667         (syms_of_alloc): Register it.
1669 2012-07-17  Dmitry Antipov  <dmantipov@yandex.ru>
1671         Cleanup overlays checking.
1672         * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
1673         * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
1674         eassert and OVERLAYP.
1675         (sort_overlays): Change to use OVERLAYP.
1677 2012-07-16  René Kyllingstad  <Rene@Kyllingstad.com>  (tiny change)
1679         * editfns.c (Finsert_char): Make it interactive, and make the
1680         second arg optional.  Copy interactive spec and docstring from
1681         ucs-insert.
1683 2012-07-17  Paul Eggert  <eggert@cs.ucla.edu>
1685         * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
1686         Unlike the other wrapped functions, fabs has an unspecified
1687         effect on errno.
1689 2012-07-16  Jan Djärv  <jan.h.d@swipnet.se>
1691         * nsterm.m (keyDown): Interpret flags without left/right bits
1692         as the left key (Bug#11670).
1694 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
1696         Remove empty and useless init functions.
1697         * lisp.h (init_character_once, init_fns, init_image)
1698         (init_filelock, init_sound): Remove prototype.
1699         * character.c (init_character_once): Remove.
1700         * filelock.c (init_filelock): Likewise.
1701         * fns.c (init_fns): Likewise.
1702         * image.c (init_image): Likewise.
1703         * sound.c (init_sound): Likewise.
1704         * emacs.c (main): Adjust accordingly.
1706 2012-07-16  Dmitry Antipov  <dmantipov@yandex.ru>
1708         * gtkutil.h: Tiny cleanups.
1709         (use_old_gtk_file_dialog): Remove useless declaration.
1710         (xg_uses_old_file_dialog): Add suggested const attribute.
1712 2012-07-15  Eli Zaretskii  <eliz@gnu.org>
1714         * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
1715         (bidi_paragraph_init): Use it to limit search forward for a strong
1716         directional character in abnormally large paragraphs full of
1717         neutral or weak characters.  (Bug#11943)
1719 2012-07-15  Stefano Facchini  <stefano.facchini@gmail.com>  (tiny change)
1721         * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
1722         the toolbar (Bug#9451).
1723         (xg_make_tool_item): Give the widget event box a transparent
1724         background.
1726 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
1728         Cleanup basic allocation variables and functions.
1729         * alloc.c (ignore_warnings, init_intervals, init_float)
1730         (init_cons, init_symbol, init_marker): Remove.
1731         (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
1732         (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
1733         (cons_block_index): Initialize to CONS_BLOCK_SIZE.
1734         (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
1735         (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
1736         (staticidx, init_alloc_once, init_strings, free_ablock):
1737         Remove redundant initialization.
1738         * fns.c (init_weak_hash_tables): Remove.
1739         * lisp.h (init_weak_hash_tables): Remove prototype.
1741 2012-07-15  Dmitry Antipov  <dmantipov@yandex.ru>
1743         Use zero_vector where appropriate.
1744         * alloc.c (zero_vector): Define as Lisp_Object.  Adjust users
1745         accordingly.
1746         * lisp.h (zero_vector): New declaration.
1747         * font.c (null_vector): Remove.
1748         (syms_of_font): Remove initialization and staticpro.
1749         (font_list_entities, font_find_for_lface): Change to use zero_vector.
1750         * keymap.c (Faccessible_keymaps): Likewise.
1752 2012-07-15  Leo Liu  <sdl.web@gmail.com>
1754         * fringe.c: Fix typo in comments.
1756 2012-07-14  Leo Liu  <sdl.web@gmail.com>
1758         * fringe.c: Add a new bitmap exclamation-mark.
1760 2012-07-14  Eli Zaretskii  <eliz@gnu.org>
1762         * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
1764         * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
1765         (HAVE_MENUS): Don't define, defined by editing config.in with
1766         msdos/sed2v2.inp.
1767         (GMALLOC_INHIBIT_VALLOC): Don't define.
1768         (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
1770 2012-07-14  Juanma Barranquero  <lekktu@gmail.com>
1772         * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
1774 2012-07-14  Glenn Morris  <rgm@gnu.org>
1776         * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
1777         * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
1778         Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
1780 2012-07-13  Glenn Morris  <rgm@gnu.org>
1782         * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
1784         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
1785         * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
1787 2012-07-13  Jan Djärv  <jan.h.d@swipnet.se>
1789         * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
1790         (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
1791         (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
1792         (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
1793         where appropriate.
1794         (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
1795         as boolean expression.
1796         (x_set_window_size): Remove unused variable toolbar.
1797         (ns_get_color_default, ns_mod_to_lisp): Remove.
1798         (ns_mouse_position): Remove unused variables xchar and ychar.
1799         (ns_compute_glyph_string_overhangs): Remove unused variable face.
1800         (ns_set_vertical_scroll_bar): Remove unused variable count.
1801         (ns_delete_terminal): Remove unused variable i.
1802         (ns_term_init): Remove unused variables r, g and b.
1803         (mouseDown): Remove unused variable window.
1804         (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
1805         (initFrameFromEmacs): Remove unused variable vbextra.
1806         (mouseEntered): Remove unused variables p and dpyinfo.
1807         (mouseExited): Remove unused variables p and r.
1808         (ns_define_frame_cursor, ns_clear_frame_area)
1809         (ns_draw_window_cursor, ns_initialize_display_info): Make static.
1810         (menuDown): Assign [sender tag] to variable and cast the variable.
1812         * nsterm.h (menuDown): Add id as type to argument sender.
1813         (ns_display_info_for_name): Add Lisp_Object argument.
1814         (ns_term_init): Add Lisp_Object argument.
1815         (ns_map_event_to_object): Add void argument.
1816         (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
1817         prototype with arguments and only declare if __OBJC__.
1818         (nxatoms_of_nsselect): Add void argument.
1819         (ns_lisp_to_cursor_type): Add Lisp_Object argument.
1820         (ns_alloc_autorelease_pool): Add void argument.
1821         (ns_release_autorelease_pool): Add void* argument.
1822         (ns_get_defaults_value): Add const char* argument.
1824         * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
1825         (initFromContents): Use SSDATA where appropriate.
1826         (ns_update_menubar): Add braces to ambigous if-else.
1827         (initWithTitle): Put () around assignment in if statement.
1828         (ns_menu_show): Remove unused variables window and keymap.
1829         (update_frame_tool_bar): Remove unused variable selected_p.
1830         (initWithContentRect): Remove unused variable this_cmd_name.
1832         * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
1833         appropriate.
1834         (setXBMColor): Remove unused variable len.
1835         (setPixmapData): Put () around assignment in loop statement.
1837         * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
1838         (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
1839         where appropriate.
1840         (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
1841         around assignment in loop statement.
1842         (nsfont_open): Remove unused variable i.
1843         (nsfont_open): Remove unused variable len.
1844         (nsfont_draw): Remove unused variable cs.
1846         * nsfns.m (x_set_icon_name, ns_set_name_internal)
1847         (ns_set_name_as_filename, ns_implicitly_set_icon_type)
1848         (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
1849         (Fns_get_resource, Fns_set_resource, Fx_open_connection)
1850         (Fns_font_name, Fns_perform_service)
1851         (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
1852         (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
1853         (ns_set_name): Remove unused variable view.
1854         (x_set_menu_bar_lines): Remove unused variable olines.
1855         (x_set_tool_bar_lines): Remove unused variable root_window.
1856         (Fns_list_colors): Put () around assignment in while statement.
1857         (Fns_perform_service): Remove unused variable len.
1858         (Fns_display_usable_bounds): Remove unused variable top.
1859         (syms_of_nsfns): Remove unused variable i.
1861         * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
1862         memcpy (Bug#11907).
1864 2012-07-13  Kalle Kankare  <kalle.kankare@iki.fi>  (tiny change)
1866         * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
1867         and free it with DestroyExceptionInfo (Bug#11558).
1869 2012-07-13  Juanma Barranquero  <lekktu@gmail.com>
1871         * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
1872         (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
1873         Set here, not in nt/config.nt.
1875 2012-07-13  Eli Zaretskii  <eliz@gnu.org>
1877         * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
1878         cursor overflow into the last glyph on display line when the right
1879         fringe is off.  (Bug#11832)
1881 2012-07-13  Paul Eggert  <eggert@cs.ucla.edu>
1883         * xdisp.c (produce_special_glyphs): Now static.
1884         * dispextern.h (produce_special_glyphs): Remove decl.
1886 2012-07-13  Glenn Morris  <rgm@gnu.org>
1888         * s/bsd-common.h, s/cygwin.h: Remove empty files.
1889         * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
1891         * s/usg5-4-common.h (USG, USG5):
1892         * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
1893         * s/sol2-6.h (SOLARIS2):
1894         * s/irix6-5.h (IRIX6_5):
1895         * s/hpux10-20.h (USG, USG5, HPUX):
1896         * s/gnu-linux.h (USG, GNU_LINUX):
1897         * s/freebsd.h (BSD_SYSTEM):
1898         * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
1899         * s/cygwin.h (CYGWIN):
1900         * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
1901         * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
1903 2012-07-13  BT Templeton  <bpt@hcoop.net>  (tiny change)
1905         * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
1907 2012-07-13  Glenn Morris  <rgm@gnu.org>
1909         * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
1911         * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
1913         * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
1914         * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
1916 2012-07-12  Glenn Morris  <rgm@gnu.org>
1918         * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
1920         * process.c (init_process_emacs): Rename from init_process.
1921         The old name is also the name of a Mach system call.
1922         * lisp.h, emacs.c: Update for this name change.
1923         * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
1924         longer needed.
1926 2012-07-12  Eli Zaretskii  <eliz@gnu.org>
1928         * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
1929         memmove call that removes glyphs covered by the left truncation
1930         glyph.  Improve commentary.
1931         (display_line): Fix display of continuation glyphs on GUI frames
1932         when the right fringe is turned off and variable-size fonts are
1933         used in the window.  Move the code that appends a stretch glyph to
1934         produce_special_glyphs, so that it could be used for truncation
1935         and continuation glyphs alike.
1936         (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
1937         glyph of a suitably computed width, to align the special glyphs at
1938         the window margin.  Code moved from display_line.  (Bug#11832)
1940 2012-07-12  Glenn Morris  <rgm@gnu.org>
1942         * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
1944         * s/gnu-linux.h, s/hpux10-20.h:
1945         Do not unconditionally define HAVE_XRMSETDATABASE.
1947         * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
1949 2012-07-12  Paul Eggert  <eggert@cs.ucla.edu>
1951         Fix typos that broke OS X build.
1952         Reported by Randal L. Schwartz in
1953         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
1954         * nsterm.m (ns_timeout): Add missing local decl.
1955         (ns_get_color): snprintf -> sprintf, to fix typo.
1957 2012-07-12  Glenn Morris  <rgm@gnu.org>
1959         * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
1960         * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
1961         * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
1962         Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
1964         * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
1965         Move PTY_OPEN to configure.
1967         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
1968         * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
1969         * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
1971 2012-07-12  Dmitry Antipov  <dmantipov@yandex.ru>
1973         Use empty_unibyte_string where applicable.
1974         * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
1975         * lread.c (read1): Likewise.
1976         * xsettings.c (syms_of_xsettings): Likewise.
1978 2012-07-12  Glenn Morris  <rgm@gnu.org>
1980         * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
1981         * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
1982         * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
1983         * s/hpux10-20.h (RUN_TIME_REMAP):
1984         * s/bsd-common.h (TABDLY): Move to configure.
1986         * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
1988         * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
1990         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1991         (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
1993         * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
1995         * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
1996         * s/template.h: Move NARROWPROTO to configure.
1998 2012-07-11  Glenn Morris  <rgm@gnu.org>
2000         * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2001         unused since 2011-01-17 change to systty.h.
2003         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2004         * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2005         Move HAVE_PTYS and HAVE_SOCKETS to configure.
2007 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
2009         * s/sol2-6.h (HAVE_LIBKSTAT): Remove.  (Bug#11914)
2011 2012-07-11  Glenn Morris  <rgm@gnu.org>
2013         * s/darwin.h, s/gnu-linux.h, s/template.h:
2014         Move INTERRUPT_INPUT to configure.
2016 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
2018         Minor adjustments to interning code.
2019         * lisp.h (intern, intern_c_string): Redefine as static inline
2020         wrappers for intern_1 and intern_c_string_1, respectively.
2021         (intern_1, intern_c_string_1): Rename prototypes.
2022         * lread.c (intern_1, intern_c_string_1, oblookup):
2023         Simplify Vobarray checking.
2024         * font.c (font_intern_prop): Likewise.  Adjust comment.
2025         * w32font.c (intern_font_name): Likewise.
2027 2012-07-11  Andreas Schwab  <schwab@linux-m68k.org>
2029         * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2031         * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2032         of Fcar/Fcdr if possible.
2033         * font.c (check_otf_features): Likewise.
2034         * fontset.c (Fnew_fontset): Likewise.
2035         * gnutls.c (Fgnutls_boot): Likewise.
2036         * minibuf.c (read_minibuf): Likewise.
2037         * msdos.c (IT_set_frame_parameters): Likewise.
2038         * xmenu.c (Fx_popup_dialog): Likewise.
2039         * w32menu.c (Fx_popup_dialog): Likewise.
2041 2012-07-11  Glenn Morris  <rgm@gnu.org>
2043         * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2044         since nothing has defined it on these platforms.
2046         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2047         * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2049         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2050         * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2051         Move CLASH_DETECTION to configure.
2053         * s/gnu.h: Remove file, which is now empty.
2055         * s/gnu.h, s/gnu-linux.h:
2056         Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2058 2012-07-11  John Wiegley  <johnw@newartisans.com>
2060         * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2061         function attribute, so we only use it if it exists in the
2062         compiler.
2064 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
2066         Avoid call to strlen in fast_c_string_match_ignore_case.
2067         * search.c (fast_c_string_match_ignore_case): Change to use
2068         length argument.  Adjust users accordingly.
2069         * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2071 2012-07-11  Paul Eggert  <eggert@cs.ucla.edu>
2073         Assume mkdir, rmdir.
2074         * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2075         * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2077         Assume rename.
2078         * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2080         Assume perror.
2081         * s/hpux10-20.h (HAVE_PERROR): Remove.
2082         * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2083         Remove dummy definition, as this problem was obsolete long ago.
2085         Assume strerror.
2086         * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2088 2012-07-11  Dmitry Antipov  <dmantipov@yandex.ru>
2090         Avoid calls to strlen in font processing functions.
2091         * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
2092         (font_open_by_name): Change to use length argument.
2093         Adjust users accordingly.
2094         * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2095         Adjust prototypes.
2096         * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2097         Change to return ptrdiff_t.
2098         (xfont_list_pattern, xfont_match): Use length returned by
2099         xfont_decode_coding_xlfd.
2100         * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2102 2012-07-11  Glenn Morris  <rgm@gnu.org>
2104         * s/darwin.h, s/freebsd.h, s/netbsd.h:
2105         Move DONT_REOPEN_PTY to configure.
2107         * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2108         * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2110 2012-07-10  Paul Eggert  <eggert@cs.ucla.edu>
2112         Remove "#define unix" that is no longer needed (Bug#11905).
2113         * s/aix4-2.h (unix): Remove; no longer needed.
2115         EMACS_TIME simplification (Bug#11875).
2116         This replaces macros (which typically do not work in GDB)
2117         with functions, typedefs and enums, making the code easier to debug.
2118         The functional style also makes code easier to read and maintain.
2119         * systime.h: Include <sys/time.h> on all hosts, not just if
2120         WINDOWSNT, since 'struct timeval' is needed in general.
2121         (EMACS_TIME): Now a typedef, not a macro.
2122         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2123         not macros.
2124         (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2125         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2126         (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2127         (EMACS_TIME_LE): Now functions, not macros.
2128         (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2129         (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2130         which are not functions.  All uses rewritten to use:
2131         (make_emacs_time): New function.
2132         (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2133         (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2134         not functions.  All uses rewritten to use the following, respectively:
2135         (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2136         (add_emacs_time, sub_emacs_time): New functions.
2137         * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
2138         * fileio.c (Fcopy_file):
2139         * xterm.c (XTflash): Get the current time closer to when it's used.
2140         * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2142         * bytecode.c (targets): Suppress -Woverride-init warnings.
2144         Simplify by avoiding confusing use of strncpy etc.
2145         * doc.c (Fsnarf_documentation):
2146         * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2147         * frame.c (Fmake_terminal_frame):
2148         * gtkutil.c (get_utf8_string):
2149         * lread.c (openp):
2150         * nsmenu.m (ns_update_menubar):
2151         * regex.c (regerror):
2152         Prefer memcpy to strncpy and strncat when either will do.
2153         * fileio.c (Fsubstitute_in_file_name):
2154         * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2155         (menu_separator_name_p):
2156         * nsmenu.m (ns_update_menubar):
2157         Prefer memcmp to strncmp when either will do.
2158         * nsterm.m: Include <ftoastr.h>.
2159         (ns_get_color):
2160         * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2161         Prefer snprintf to strncpy.
2162         * nsterm.m (ns_term_init):
2163         * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2164         * nsterm.m (ns_term_init):
2165         Avoid the need for strncpy, by using build_string or
2166         make_unibyte_string directly.  Use dtoastr, not snprintf.
2167         * process.c (Fmake_network_process): Diagnose service names that
2168         are too long, rather than silently truncating them or creating
2169         non-null-terminated names.
2170         (Fnetwork_interface_info): Likewise, for interface names.
2171         * sysdep.c (system_process_attributes) [GNU_LINUX]:
2172         Prefer sprintf to strncat.
2173         * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
2174         Prefer vsnprintf to vsprintf + strncpy.
2176 2012-07-10  Glenn Morris  <rgm@gnu.org>
2178         * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
2179         Clarify fallback case.
2181 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
2183         Use XCAR and XCDR instead of Fcar and Fcdr where possible.
2184         * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
2185         * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
2186         * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
2187         where argument type is known to be a Lisp_Cons.
2189 2012-07-10  Tom Tromey  <tromey@redhat.com>
2191         * bytecode.c (BYTE_CODE_THREADED): New macro.
2192         (BYTE_CODES): New macro.  Replaces all old byte-code defines.
2193         (enum byte_code_op): New type.
2194         (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
2195         (exec_byte_code): Use them.  Use token threading when applicable.
2197 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
2199         Optimize pure C strings initialization.
2200         * lisp.h (make_pure_string): Fix prototype.
2201         (build_pure_c_string): New function, defined as static inline.  This
2202         provides a better opportunity to optimize away calls to strlen when
2203         the function is called with compile-time constant argument.
2204         * alloc.c (make_pure_c_string): Fix comment.  Change to add nchars
2205         argument, adjust users accordingly.  Use build_pure_c_string where
2206         appropriate.
2207         * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
2208         * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
2209         * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
2211 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
2213         Avoid calls to strlen in miscellaneous functions.
2214         * buffer.c (init_buffer): Use precalculated len, adjust if needed.
2215         * font.c (Ffont_xlfd_name): Likewise.  Change to call make_string.
2216         * lread.c (openp): Likewise.
2218 2012-07-10  Dmitry Antipov  <dmantipov@yandex.ru>
2220         Avoid calls to strlen in path processing functions.
2221         * fileio.c (file_name_as_directory): Add comment.  Change to add
2222         srclen argument and return the length of result.  Adjust users
2223         accordingly.
2224         (directory_file_name): Fix comment.  Change to add srclen argument,
2225         swap 1st and 2nd arguments to obey the common convention.
2226         Adjust users accordingly.
2227         * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
2229 2012-07-10  Glenn Morris  <rgm@gnu.org>
2231         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
2232         Move PENDING_OUTPUT_COUNT definition to configure.
2234         * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
2235         * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
2236         * s/gnu.h (DATA_START): Move definitions to configure.
2238         * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
2239         We include usg5-4-common.h, which defines them both.
2241         * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
2242         O_RDONLY already includes it).
2244         Stop ns builds setting the EMACSLOADPATH environment variable.
2245         * nsterm.m (ns_load_path): Rename from ns_init_paths.
2246         Now it does not set EMACSLOADPATH, just returns the load-path string.
2247         * nsterm.h: Update accordingly.
2248         * lread.c [HAVE_NS]: Include nsterm.h.
2249         (init_lread) [HAVE_NS]: Use ns_load_path.
2250         * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
2252 2012-07-09  Glenn Morris  <rgm@gnu.org>
2254         * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
2255         since the included bsd-common.h does so.
2257         Stop ns builds setting the EMACSPATH environment variable.
2258         * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
2259         (ns_init_paths): Do not set EMACSPATH.
2260         * nsterm.h (ns_exec_path): Add it.
2261         * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
2262         Use ns_exec_path.
2264         * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2266 2012-07-09  Paul Eggert  <eggert@cs.ucla.edu>
2268         * process.c (wait_reading_process_output): 'waitchannels' was unset
2269         when read_kbd || !NILP (wait_for_cell); fix this.
2271         Add GCC-style 'const' attribute to functions that can use it.
2272         * character.h (char_resolve_modifier_mask):
2273         * keyboard.h (make_ctrl_char):
2274         * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
2275         (init_character_once, next_almost_prime, init_fns, init_image)
2276         (flush_pending_output, init_sound):
2277         * mem-limits.h (start_of_data):
2278         * menu.h (finish_menu_items):
2279         Add ATTRIBUTE_CONST.
2280         * emacs.c (DEFINE_DUMMY_FUNCTION):
2281         Declare the dummy function with ATTRIBUTE_CONST.
2282         * lisp.h (Fbyteorder, Fmax_char, Fidentity):
2283         Add decls with ATTRIBUTE_CONST.
2285         Minor improvements to make_formatted_string.
2286         * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
2287         where int is good enough, as vsprintf returns an int.
2288         * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
2290 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
2292         Use make_formatted_string to avoid double length calculation.
2293         * lisp.h (make_formatted_string): New prototype.
2294         * alloc.c (make_formatted_string): New function.
2295         * buffer.c (Fgenerate_new_buffer_name): Use it.
2296         * dbus.c (syms_of_dbusbind): Likewise.
2297         * editfns.c (Fcurrent_time_zone): Likewise.
2298         * filelock.c (get_boot_time): Likewise.
2299         * frame.c (make_terminal_frame, set_term_frame_name)
2300         (x_report_frame_params): Likewise.
2301         * image.c (gs_load): Likewise.
2302         * minibuf.c (get_minibuffer): Likewise.
2303         * msdos.c (dos_set_window_size): Likewise.
2304         * process.c (make_process): Likewise.
2305         * xdisp.c (ensure_echo_area_buffers): Likewise.
2306         * xsettings.c (apply_xft_settings): Likewise.
2308 2012-07-09  Glenn Morris  <rgm@gnu.org>
2310         Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
2311         * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
2312         (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
2313         * nsterm.h (ns_etc_directory): Add it.
2314         * callproc.c [HAVE_NS]: Include nsterm.h.
2315         (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
2317 2012-07-09  Dmitry Antipov  <dmantipov@yandex.ru>
2319         Move marker debugging code under MARKER_DEBUG.
2320         * marker.c (MARKER_DEBUG): Move marker debugging code under
2321         #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
2322         for bootstrap with --enable-checking (~3x slowdown reported
2323         by Juanma Barranquero <lekktu@gmail.com>).
2324         (verify_bytepos): Move under #ifdef MARKER_DEBUG.
2326 2012-07-08  Paul Eggert  <eggert@cs.ucla.edu>
2328         * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
2329         See <http://bugs.gnu.org/11825#29>.
2331 2012-07-08  Eli Zaretskii  <eliz@gnu.org>
2333         * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
2334         has no font, use the frame's font.  (Bug#11813)
2335         (display_line): Add commentary about displaying truncation glyphs
2336         on GUI frames.
2337         (produce_special_glyphs): Move here from term.c.
2339         * term.c (produce_special_glyphs): Move to xdisp.c.
2341         * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
2342         section.
2344 2012-07-07  Andreas Schwab  <schwab@linux-m68k.org>
2346         * xdisp.c (display_line): Avoid warning about implicit declaration
2347         of FRAME_FONT.
2349         * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
2351         * lisp.h: Remove empty conditional.
2353 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
2355         * lread.c (load_path_check): Now static.
2357         Fix some minor --with-ns problems found by static checking.
2358         * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
2359         (x_set_font) [!HAVE_X_WINDOWS]:
2360         * image.c (xpm_load_image) [HAVE_NS]:
2361         (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
2362         (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
2363         Remove unused local.
2364         (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
2365         (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
2366         * image.c (x_create_bitmap_from_file) [HAVE_NS]:
2367         (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
2368         * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
2369         * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
2370         Fix pointer signedness problem.
2371         * xfaces.c (FRAME_X_FONT_TABLE):
2372         * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
2374 2012-07-07  Glenn Morris  <rgm@gnu.org>
2376         * lread.c (load_path_check): New function, split from init_lread.
2377         (init_lread): Reorganize.  Motivation:
2378         If EMACSLOADPATH is set, check/warn about that rather than the
2379         defaults, which we are not going to use.  Hence we can remove
2380         the turn_off_warning and WINDOWSNT || HAVE_NS tests.
2381         Don't warn if site-lisp directories are missing.
2382         If not installed, start from a blank load-path, since
2383         PATH_LOADSEARCH refers to the eventual installation directories.
2385 2012-07-07  Eli Zaretskii  <eliz@gnu.org>
2387         Support truncation and continuation glyphs on GUI frames, when
2388         fringes are disabled.  (Bug#11832)
2389         * xdisp.c (init_iterator): Get dimensions of truncation and
2390         continuation glyphs even if on GUI frames.
2391         Adjust it->last_visible_x on GUI frames when the left or right fringes,
2392         or both, are absent.
2393         (start_display, move_it_in_display_line_to): Handle the case of a
2394         GUI frame without a fringe to display continuation or truncation
2395         glyphs.
2396         (insert_left_trunc_glyphs): Support GUI frames: make sure
2397         truncation glyphs overwrite enough glyphs from the current line to
2398         have sufficient space in pixels.
2399         (display_line): Support truncation and continuation glyphs on GUI
2400         frames.  If some spare pixels are left on the line after inserting
2401         the truncation glyphs, fill that space with a stretch glyph of a
2402         suitably computed width.
2404         * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
2405         produce_glyphs, to support GUI sessions.
2407 2012-07-07  Paul Eggert  <eggert@cs.ucla.edu>
2409         * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
2411         * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
2413         Do not require float-time's arg to fit in time_t (Bug#11825).
2414         This works better on hosts where time_t is unsigned, and where
2415         float-time is applied to the (negative) difference between two times.
2416         * editfns.c (decode_time_components): Last arg is now double *,
2417         not int *, and means to store all the result as a double, without
2418         worrying about whether the seconds part fits in time_t.
2419         All callers changed.
2420         (lisp_time_argument): Remove last int * arg, as it's no longer needed.
2421         All callers changed.
2422         (Ffloat_time): Do not fail merely because the specified time falls
2423         outside of time_t range.
2425 2012-07-07  Glenn Morris  <rgm@gnu.org>
2427         * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
2428         * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
2429         * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
2431 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
2433         * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
2434         Update dependencies.
2436         * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
2438 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
2440         Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
2441         * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
2442         * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
2443         * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
2444         * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
2445         * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
2447         * xfont.c (compare_font_names): Redo to omit the need for casts.
2449 2012-07-06  Andreas Schwab  <schwab@linux-m68k.org>
2451         * xfns.c (Fx_change_window_property): Doc fix.
2452         * w32fns.c (Fx_change_window_property): Doc fix.
2454         * w32fns.c (Fx_window_property): Accept the same arguments as the
2455         X Windows version.  Doc fix.
2456         * xfns.c (Fx_window_property): Doc fix.  (Bug#11870)
2458 2012-07-06  Juanma Barranquero  <lekktu@gmail.com>
2459             Eli Zaretskii  <eliz@gnu.org>
2461         * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
2462         Windows-specific code from nt/config.nt moved here.
2463         Obsolete settings removed.
2465 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
2467         * process.c: Avoid unnecessary calls to gettime.
2468         (wait_reading_process_output): Don't get the time of day
2469         when gobbling data immediately and not waiting, as there's no need
2470         for it in that case.  This removes a FIXME.
2472 2012-07-06  Jan Djärv  <jan.h.d@swipnet.se>
2474         * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
2475         is defined (Bug#11768).
2477 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
2479         Fix marker debugging code.
2480         * marker.c (byte_char_debug_check): Do not perform the check
2481         if buffer is not multibyte.
2482         (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2483         Call byte_char_debug_check with correct arguments.
2485 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
2487         Compile marker debugging code only if ENABLE_CHECKING is defined.
2488         * marker.c (byte_char_debug_check, count_markers):
2489         Use only if ENABLE_CHECKING is defined.
2490         (byte_debug_flag): Remove.
2491         (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
2492         Always call byte_char_debug_check if ENABLE_CHECKING is defined.
2494 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
2496         Avoid code repetition in marker-related functions.
2497         * marker.c (attach_marker): New function.
2498         (Fset_marker, set_marker_restricted, set_marker_both)
2499         (set_marker_restricted_both): Use it.
2500         (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
2501         Consistently rename charno to charpos.
2502         (marker_position): Add eassert.
2503         (marker_byte_position): Convert to eassert.
2505 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
2507         Simplify list operations in unchain_overlay and unchain_marker.
2508         * buffer.c (unchain_overlay): Simplify.  Add comment.
2509         * marker.c (unchain_marker): Simplify.  Fix comments.
2511 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
2513         Introduce fast path for the widely used marker operation.
2514         * alloc.c (build_marker): New function.
2515         * lisp.h (build_marker): New prototype.
2516         * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
2517         * composite.c (autocmp_chars): Likewise.
2518         * editfns.c (buildmark): Remove.
2519         (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
2520         (save_restriction_save): Use build_marker.
2521         * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
2522         * window.c (save_window_save): Likewise.
2524 2012-07-06  Dmitry Antipov  <dmantipov@yandex.ru>
2526         Do not use Fdelete_overlay in delete_all_overlays
2527         to avoid redundant calls to unchain_overlay.
2528         * buffer.c (drop_overlay): New function.
2529         (delete_all_overlays, Fdelete_overlay): Use it.
2530         * minibuf.c (get_minibuffer): Fix comment.
2532 2012-07-06  Paul Eggert  <eggert@cs.ucla.edu>
2534         Port to OpenBSD 5.1 amd64.
2535         * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
2536         This is needed for OpenBSD, and should be harmless on all BSD systems.
2537         Also, include <sys/sysctl.h>, as it should be available on all
2538         BSD_SYSTEM hosts given that we're already calling sysctl in that case.
2539         (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
2540         use p_pid member, not kp_proc.pid.
2542 2012-07-06  Glenn Morris  <rgm@gnu.org>
2544         * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
2546 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
2548         More xmalloc and related cleanup.
2549         * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
2550         * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
2551         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
2552         * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
2553         * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
2554         * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
2555         * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
2556         * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
2557         * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
2558         * xterm.c:
2559         Omit needless casts involving void * pointers and allocation.
2560         Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
2561         as the former is more robust if P's type is changed.
2562         Prefer xzalloc to xmalloc + memset 0.
2563         Simplify malloc-or-realloc to realloc.
2564         Don't worry about xmalloc returning a null pointer.
2565         Prefer xstrdup to xmalloc + strcpy.
2566         * editfns.c (Fmessage_box): Grow message_text by at least 80 when
2567         growing it.
2568         * keyboard.c (apply_modifiers_uncached): Prefer local array to
2569         alloca of a constant.
2571 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
2573         * xdisp.c (display_line): Fix horizontal pixel coordinates when
2574         hscroll is larger than the line width.  Fixes long and futile
2575         looping inside extend_face_to_end_of_line (on a TTY) producing
2576         glyphs that are not needed and thrown away.
2578 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
2580         * marker.c (set_marker_restricted_both): Simplify by using
2581         clip_to_bounds.
2583 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
2585         * editfns.c (region_limit): Simplify by using clip_to_bounds.
2587 2012-07-05  Jan Djärv  <jan.h.d@swipnet.se>
2589         * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
2590         not defined (Bug#11768).
2591         (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
2592         (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
2593         (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
2594         followed by gtk_box_set_homogeneous (Bug#11768).
2595         (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
2596         (update_theme_scrollbar_width, xg_create_scroll_bar):
2597         Use gtk_scrollbar_new (Bug#11768).
2598         (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
2599         (is_box_type): New function (Bug#11768).
2600         (xg_tool_item_stale_p): Call is_box_type.
2601         (xg_initialize): Get settings by calling gtk_settings_get_for_screen
2602         with default display (Bug#11768).
2604 2012-07-05  Eli Zaretskii  <eliz@gnu.org>
2606         * xdisp.c (window_hscroll_limited): New function.
2607         (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
2608         coordinates when window's hscroll is set to insanely large
2609         values.  (Bug#11857)
2611 2012-07-05  Juanma Barranquero  <lekktu@gmail.com>
2613         * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
2614         ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
2616 2012-07-05  Dmitry Antipov  <dmantipov@yandex.ru>
2618         Cleanup xmalloc.
2619         * lisp.h (xzalloc): New prototype.  Omit needless casts.
2620         * alloc.c (xzalloc): New function.  Omit needless casts.
2621         * charset.c: Omit needless casts.  Convert all calls to
2622         xmalloc with following memset to xzalloc.
2623         * dispnew.c: Likewise.
2624         * fringe.c: Likewise.
2625         * image.c: Likewise.
2626         * sound.c: Likewise.
2627         * term.c: Likewise.
2628         * w32fns.c: Likewise.
2629         * w32font.c: Likewise.
2630         * w32term.c: Likewise.
2631         * xfaces.c: Likewise.
2632         * xfns.c: Likewise.
2633         * xterm.c: Likewise.
2634         * atimer.c: Omit needless casts.
2635         * buffer.c: Likewise.
2636         * callproc.c: Likewise.
2637         * ccl.c: Likewise.
2638         * coding.c: Likewise.
2639         * composite.c: Likewise.
2640         * doc.c: Likewise.
2641         * doprnt.c: Likewise.
2642         * editfns.c: Likewise.
2643         * emacs.c: Likewise.
2644         * eval.c: Likewise.
2645         * filelock.c: Likewise.
2646         * fns.c: Likewise.
2647         * gtkutil.c: Likewise.
2648         * keyboard.c: Likewise.
2649         * lisp.h: Likewise.
2650         * lread.c: Likewise.
2651         * minibuf.c: Likewise.
2652         * msdos.c: Likewise.
2653         * print.c: Likewise.
2654         * process.c: Likewise.
2655         * region-cache.c: Likewise.
2656         * search.c: Likewise.
2657         * sysdep.c: Likewise.
2658         * termcap.c: Likewise.
2659         * terminal.c: Likewise.
2660         * tparam.c: Likewise.
2661         * w16select.c: Likewise.
2662         * w32.c: Likewise.
2663         * w32reg.c: Likewise.
2664         * w32select.c: Likewise.
2665         * w32uniscribe.c: Likewise.
2666         * widget.c: Likewise.
2667         * xdisp.c: Likewise.
2668         * xmenu.c: Likewise.
2669         * xrdb.c: Likewise.
2670         * xselect.c: Likewise.
2672 2012-07-05  Paul Eggert  <eggert@cs.ucla.edu>
2674         * fileio.c (time_error_value): Check the right error number.
2675         Problem reported by Troels Nielsen in
2676         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
2678 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
2680         * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
2681         This should be fixed in a better way; see Eli Zaretskii in
2682         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
2683         (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
2685         * fileio.c (time_error_value): Rename from special_mtime.
2686         The old name's problems were noted by Eli Zaretskii in
2687         <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
2689         * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
2690         This variable's comment says Emacs needs at least one GDB-visible
2691         symbol of type enum pvec_type, to work around GDB problems.
2692         The symbol's value doesn't matter.
2694         * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
2695         that causes compilation to fail on pre-C99 compilers.
2697 2012-07-04  Juanma Barranquero  <lekktu@gmail.com>
2699         * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
2700         (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
2702 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
2704         * buffer.c (init_buffer_once): Fix initialization of
2705         headers for buffer_defaults and buffer_local_symbols.
2706         Reported by Juanma Barranquero <lekktu@gmail.com>.
2708 2012-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
2710         Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
2711         * lisp.h (enum pvec_type): Use fewer bits.
2712         (PSEUDOVECTOR_SIZE_BITS): New constant.
2713         (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
2714         (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
2715         change in pvec_type.
2716         (PSEUDOVECTOR_TYPEP): New macro.
2717         (TYPED_PSEUDOVECTORP): Use it.
2718         * fns.c (internal_equal): Adapt code to extract pvectype.
2719         * emacs.c (gdb_pvec_type): Update type.
2720         * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
2721         (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
2722         (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
2723         (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
2724         (sweep_vectors): Use it.  Use local var `total_bytes' instead of
2725         abusing vector->header.next.nbytes.
2726         (live_vector_p): Use PVEC_TYPE.
2727         (mark_object): Adapt code to extract pvectype.  Use switch.
2729 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
2731         * doprnt.c (doprnt): Don't assume string length fits in 'int'.
2732         Tighten new eassert a bit.
2734 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
2736         Fix compilation with --enable-gcc-warnings and -O1
2737         optimization level.
2738         * doprnt.c (doprnt): Change type of tem to int, initialize
2739         to avoid compiler warning.  Add eassert.
2740         * search.c (simple_search): Initialize match_byte to avoid
2741         compiler warning.  Add eassert.
2743 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
2745         Avoid weird behavior with large horizontal scrolls.
2746         Without this change, for example, large hscroll values would
2747         mess up Emacs's display on Fedora 15 x86, presumably due to
2748         overflows in int calculations in the display code.
2749         Also, if buffers had long lines, Emacs would freeze.
2750         * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
2751         (set_window_hscroll): New function, containing the old guts of
2752         Fset_window_hscroll.  Return the clipped value.
2753         (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
2754         This avoids the need to check against PTRDIFF_MAX.
2756         * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
2758 2012-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
2760         * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
2762 2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
2764         * regex.c: Suppress GCC warning on RHEL 6.  (Bug#11207)
2765         Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
2766         since GCC 4.4.6 issues a bogus warning for them.
2768         Fix bugs in file timestamp newness comparisons.
2769         * fileio.c (Ffile_newer_than_file_p):
2770         * lread.c (Fload): Use full timestamp resolution of files,
2771         not just the 1-second resolution, so that files that are only
2772         slightly newer still count as newer.
2773         * fileio.c (Ffile_newer_than_file_p): Don't assume file
2774         timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
2776 2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
2778         * fileio.c: Improve handling of file time marker.  (Bug#11852)
2779         (special_mtime): New function.
2780         (Finsert_file_contents, Fverify_visited_file_modtime):
2781         Use it to set special mtime values consistently.
2783 2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
2785         * fileio.c (Finsert_file_contents): Properly handle st_mtime
2786         marker for non-existing file.  (Bug#11852)
2788 2012-07-03  Glenn Morris  <rgm@gnu.org>
2790         * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
2791         and did not make it into globals.h).
2793 2012-07-03  Tom Tromey  <tromey@redhat.com>
2795         * window.c (Fset_window_margins, Fset_window_fringes)
2796         (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
2797         * textprop.c (Fprevious_property_change): No longer static.
2798         * syntax.c (Fsyntax_table_p): No longer static.
2799         * process.c (Fget_process, Fprocess_datagram_address): No longer
2800         static.
2801         * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
2802         * keyboard.c (Fcommand_execute): No longer static.
2803         Remove EXFUN.
2804         * insdel.c (Fcombine_after_change_execute): No longer static.
2805         * image.c (Finit_image_library): No longer static.
2806         * fileio.c (Fmake_symbolic_link): No longer static.
2807         * eval.c (Ffetch_bytecode): No longer static.
2808         * editfns.c (Fuser_full_name): No longer static.
2809         * doc.c (Fdocumentation_property, Fsnarf_documentation):
2810         No longer static.
2811         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
2812         static.
2813         * dired.c (Ffile_attributes): No longer static.
2814         * composite.c (Fcomposition_get_gstring): No longer static.
2815         * callproc.c (Fgetenv_internal): No longer static.
2817         * ccl.h: Remove EXFUNs.
2818         * buffer.h: Remove EXFUNs.
2819         * dispextern.h: Remove EXFUNs.
2820         * intervals.h: Remove EXFUNs.
2821         * fontset.h: Remove EXFUN.
2822         * font.h: Remove EXFUNs.
2823         * dosfns.c (system_process_attributes): Remove EXFUN.
2824         * keymap.h: Remove EXFUNs.
2825         * lisp.h: Remove EXFUNs.
2826         * w32term.h: Remove EXFUNs.
2827         * window.h: Remove EXFUNs.
2828         * xsettings.h: Remove EXFUN.
2829         * xterm.h: Remove EXFUN.
2831 2012-07-03  Glenn Morris  <rgm@gnu.org>
2833         * lisp.h (Frandom): Make it visible to C.
2834         * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
2835         buffer for invisible buffers.  (Bug#1229)
2837 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
2839         Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
2840         values which aren't power of 2.
2841         * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
2842         Verify it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
2843         accordingly.
2845 2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
2847         * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
2849         * alloc.c (mark_object): Revert part of last patch to use `switch'.
2851 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
2853         * alloc.c (allocate_vector_block): Remove redundant
2854         calls to mallopt if DOUG_LEA_MALLOC is defined.
2855         (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
2856         avoid calls to mallopt if zero_vector is returned.
2858 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
2860         * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
2861         is enabled, avoid dereferencing NULL current_sblock if
2862         running undumped.
2864 2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
2866         Cleanup basic buffer management.
2867         * buffer.h (struct buffer): Change layout to use generic vector
2868         marking code.  Fix some comments.  Change type of 'clip_changed'
2869         to bitfield.  Remove unused #ifndef old.
2870         (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
2871         (GET_OVERLAYS_AT): Fix indentation.
2872         (for_each_per_buffer_object_at): New macro.
2873         * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
2874         (Fbuffer_local_variables): Use it.
2875         (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
2876         * alloc.c (allocate_buffer): Adjust to match new layout of
2877         struct buffer.  Fix comment.
2878         (mark_overlay): New function.
2879         (mark_buffer): Use it.  Use mark_vectorlike to mark normal
2880         Lisp area of struct buffer.
2881         (mark_object): Use it.  Adjust marking of misc objects
2882         and related comments.
2884 2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
2886         * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
2887         wrapper that is not needed because the wrapped code is a no-op (zero
2888         machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
2889         This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
2891 2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
2893         * alloc.c (mark_buffer): Simplify.  Remove prototype.
2894         (mark_object): Add comment.  Reorganize marking of vector-like
2895         objects.  Use CHECK_LIVE for all vector-like objects except buffers
2896         and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
2897         Avoid redundant calls to mark_vectorlike for bool vectors.
2899 2012-06-30  Glenn Morris  <rgm@gnu.org>
2901         * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
2903         * epaths.in (PATH_SITELOADSEARCH): New.
2904         * lread.c (init_lread): Use PATH_SITELOADSEARCH.
2905         This is rather than relying on --enable-locallisppath elements
2906         having "site-lisp" in their names.  (Bug#10208#25, 11658)
2908 2012-06-30  Eli Zaretskii  <eliz@gnu.org>
2910         * w32proc.c (sys_select): Accept and ignore one more argument.
2912         * w32.c (emacs_gnutls_pull): Call select with one more argument.
2914         * sysselect.h [DOS_NT]: Don't include sys/select.h.
2915         (pselect) [!MS_DOS]: Redirect to sys_select.
2917         * sysdep.c: Don't include dos.h and dosfns.h.
2919         * process.c (sys_select):
2920         * msdos.c (sys_select): Accept one more argument and ignore it.
2922         * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
2923         adapt data types and code to that.
2925         * dosfns.c:
2926         * msdos.c (gettime, settime): Define away the prototypes in dos.h,
2927         which clashes with the gnulib function of the same name.
2929 2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
2931         * font.c (font_style_to_value, font_style_symbolic)
2932         (font_prop_validate_style): Add type checks for values in
2933         font_style_table.
2935         * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
2936         argument.
2937         * character.c, charset.c, menu.c, process.c, window.c: Adjust all
2938         uses.
2940 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
2942         * xdisp.c (try_window_id): Undo last change.
2944         * w32.c (getwd): Adjust commentary about startup_dir.
2945         (init_environment): Always call sys_access, even in non-MSVC
2946         builds.  Don't chdir to the directory of the Emacs executable.
2947         This undoes code from 1997 which was justified by the need to
2948         "avoid conflicts when removing and renaming directories".  But its
2949         downside was that every relative file name was being interpreted
2950         relative to the directory of the Emacs executable, which can never
2951         be TRT.  In particular, it broke sys_access when called with
2952         relative file names.
2953         (sys_access): Map GetLastError to errno.
2955 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
2957         * window.h (struct window): Change type of 'fringes_outside_margins'
2958         to bitfield.  Fix comment.  Adjust users accordingly.
2959         (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2960         Adjust comment.
2961         * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
2962         to ptrdiff_t.
2964 2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
2966         * gnutls.c (emacs_gnutls_handshake):
2967         Add QUIT to make the loop interruptible.
2969 2012-06-29  Glenn Morris  <rgm@gnu.org>
2971         * charset.c (init_charset): Make lack of etc/charsets fatal.
2973 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
2975         * editfns.c (region_limit): Fix type mismatch.
2977 2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
2979         * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
2980         undefined.  Convert from xassert to eassert.
2981         * nsmenu.m: Convert from xassert to eassert.
2982         * nsterm.m: Likewise.
2984 2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
2986         * editfns.c (region_limit): Clip to narrowing (bug#11770).
2988 2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
2990         Avoid integer overflow on scroll-left and scroll-right.
2991         * window.c (HSCROLL_MAX): New macro.
2992         (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
2993         overflow when requested scroll falls outside ptrdiff_t range.
2995 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
2997         * window.h (struct window): Change type of 'hscroll',
2998         'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
2999         'last_modified' and 'last_overlay_modified' to EMACS_INT.
3000         Adjust users accordingly.
3001         * xdisp.c (try_cursor_movement): Replace type check with eassert.
3002         * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3003         from EMACS_INT to ptrdiff_t.
3004         (make_window): Omit redundant initialization.
3006 2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
3008         * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3010 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
3012         * window.h (struct window): Change type of 'use_time' and
3013         'sequence_number' from Lisp_Object to int.
3014         * frame.c (make_frame): Adjust users accordingly.
3015         * print.c (print_object): Likewise.
3016         * window.c (select_window, Fwindow_use_time, make_parent_window)
3017         (make_window): Likewise.
3019 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
3021         * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3022         enabled with --enable-checking=[all,glyphs] configure option.
3023         Fix GLYPH_DEBUG usage assuming that it may be undefined,
3024         adjust comments accordingly.
3025         * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3026         undefined, adjust comments accordingly.
3027         * image.c: Likewise.
3028         * scroll.c: Likewise.
3029         * w32fns.c: Likewise.
3030         * w32term.c: Likewise.
3031         * xdisp.c: Likewise.
3032         * xfaces.c: Likewise.
3033         * xfns.c: Likewise.
3034         * xterm.c: Likewise.
3036 2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
3038         Generalize run-time debugging checks.
3039         * dispextern.h (XASSERTS): Remove.
3040         * fontset.c (xassert): Remove.
3041         Convert from xassert to eassert.
3042         * alloc.c: Convert from xassert to eassert.
3043         * bidi.c: Likewise.
3044         * dispnew.c: Likewise.
3045         * fns.c: Likewise.
3046         * fringe.c: Likewise.
3047         * ftfont.c: Likewise.
3048         * gtkutil.c: Likewise.
3049         * image.c: Likewise.
3050         * keyboard.c: Likewise.
3051         * menu.c: Likewise.
3052         * process.c: Likewise.
3053         * scroll.c: Likewise.
3054         * sound.c: Likewise.
3055         * term.c: Likewise.
3056         * w32console.c: Likewise.
3057         * w32fns.c: Likewise.
3058         * w32term.c: Likewise.
3059         * window.c: Likewise.
3060         * xdisp.c: Likewise.
3061         * xfaces.c: Likewise.
3062         * xfns.c: Likewise.
3063         * xselect.c: Likewise.
3064         * xterm.c: Likewise.
3066 2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
3068         * fns.c (maybe_resize_hash_table): Output message when growing the
3069         purify-hashtable.
3071 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
3073         * alloc.c (allocate_string_data): Remove dead code.
3074         * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3075         avoid GCC warning about unused macro.
3077 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
3079         * alloc.c (allocate_string): Omit intervals initialization.
3080         * alloc.c (make_uninit_multibyte_string): Initialize intervals
3081         as in make_pure_string and make_pure_c_string.
3083 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
3085         * alloc.c (allocate_string): Fix last change.
3087 2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
3089         * alloc.c (allocate_string): Remove two redundant calls
3090         to memset, add explicit initialization where appropriate.
3092 2012-06-27  Glenn Morris  <rgm@gnu.org>
3094         * lisp.mk (lisp): Remove paths.elc.
3096 2012-06-27  Chong Yidong  <cyd@gnu.org>
3098         * doc.c (Fsubstitute_command_keys): Fix punctuation.
3100 2012-06-26  John Wiegley  <johnw@newartisans.com>
3102         * unexmacosx.c (copy_data_segment): Add two section names used
3103         on Mac OS X Lion: __mod_init_func and __mod_term_func.
3105         * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3106         when building with Clang.
3108 2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
3110         * eval.c (Fapply): Allow calling it with a single argument.
3112 2012-06-26  Eli Zaretskii  <eliz@gnu.org>
3114         * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3115         _stricmp and _strnicmp.
3116         (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3118 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
3120         * alloc.c (allocate_window): Zero out non-Lisp part of newly
3121         allocated window.
3122         (allocate_process): Likewise for new process.
3123         (allocate_terminal): Change to use offsetof.
3124         (allocate_frame): Likewise.
3125         * frame.c (make_frame): Omit redundant initialization.
3126         * window.c (make_parent_window): Use memset.
3127         (make_window): Omit redundant initialization.
3128         * process.c (make_process): Omit redundant initialization.
3129         * terminal.c (create_terminal): Likewise.
3131 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
3133         * term.c (delete_tty): Remove redundant call to memset.
3135 2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
3137         * alloc.c: Remove build_string.
3138         * lisp.h: Define build_string as static inline.  This provides
3139         a better opportunity to optimize away calls to strlen when the
3140         function is called with compile-time constant argument.
3141         * image.c (imagemagick_error): Convert to build_string.
3142         * w32proc.c (sys_spawnve): Likewise.
3143         * xterm.c (x_term_init): Likewise.
3145 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
3147         Use sprintf return value instead of invoking strlen on result.
3148         In the old days this wasn't portable, since some sprintf
3149         implementations returned char *.  But they died out years ago and
3150         Emacs already assumes sprintf returns int.
3151         Similarly for float_to_string.
3152         This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3153         * ccl.c (ccl_driver):
3154         * character.c (string_escape_byte8):
3155         * data.c (Fnumber_to_string):
3156         * doprnt.c (doprnt):
3157         * print.c (print_object):
3158         * xdisp.c (message_dolog):
3159         * xfns.c (syms_of_xfns):
3160         Use sprintf or float_to_string result to avoid need to call strlen.
3161         * data.c (Fnumber_to_string):
3162         Use make_unibyte_string, since the string must be ASCII.
3163         * lisp.h, print.c (float_to_string): Now returns int length.
3164         * term.c (produce_glyphless_glyph):
3165         Use sprintf result rather than recomputing it.
3167         Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3168         * Makefile.in (ALL_CFLAGS):
3169         * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3170         * gmalloc.c, regex.c: Include <config.h> unconditionally.
3172 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
3174         * dispextern.h (xstrcasecmp): Define to library function
3175         strcasecmp if available.
3176         * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
3178 2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
3180         * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
3181         Avoid comma operator.
3182         * menu.c (push_submenu_start, push_submenu_end)
3183         (push_left_right_boundary, push_menu_pane): Likewise.
3184         * msdos.c (dos_rawgetc): Likewise.
3186 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
3188         * xfns.c (xic_create_fontsetname): Remove redundant calls
3189         to memset.
3191 2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
3193         * gtkutil.c (get_utf8_string): Remove redundant assignment.
3194         sprintf already null-terminates its output.
3196         * xfns.c (x_window): Remove redundant cast.
3198 2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
3200         * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
3201         `const char *' to `char *' to avoid compiler warning.
3203 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3205         * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
3206         instead of truncating it to 63 (admittedly a generous limit).
3208         * process.c: Fix spelling and caps in comments.
3210 2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
3212         * emacs.c (setpgrp): Remove definition, unused.
3213         * sysdep.c (setpgrp): Remove definition, not used in this file.
3215 2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
3217         * makefile.w32-in: Update dependencies.
3219 2012-06-24  Eli Zaretskii  <eliz@gnu.org>
3221         * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
3222         (SYSTIME_H): Add nt/inc/sys/time.h.
3224         * systime.h [WINDOWSNT]: Include sys/time.h.
3226         * s/ms-w32.h (struct timespec): Definition moved from
3227         nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3229 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3231         Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
3232         * buffer.h (buffer_slot_type_mismatch):
3233         * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3234         * eval.c (unwind_to_catch):
3235         * image.c (my_png_error, my_error_exit):
3236         * keyboard.c (quit_throw_to_read_char, user_error)
3237         (Fexit_recursive_edit, Fabort_recursive_edit):
3238         * lisp.h (die, args_out_of_range, args_out_of_range_3)
3239         (wrong_type_argument, buffer_overflow, __executable_start)
3240         (memory_full, buffer_memory_full, string_overflow, Fthrow)
3241         (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
3242         (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
3243         (fatal):
3244         (child_setup) [!DOS_NT]:
3245         * lread.c (end_of_file_error, invalid_syntax):
3246         * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3247         * puresize.h (pure_write_error):
3248         * search.c (matcher_overflow):
3249         * sound.c (sound_perror, alsa_sound_perror):
3250         * sysdep.c, syssignal.h (croak):
3251         * term.c (maybe_fatal, vfatal):
3252         * textprop.c (text_read_only):
3253         * undo.c (user_error):
3254         * unexmacosx.c (unexec_error):
3255         * xterm.c (x_ins_del_lines, x_delete_glyphs):
3256         Use _Noreturn rather than NO_RETURN.
3257         No need for separate decl merely because of _Noreturn.
3258         * sound.c (sound_warning, parse_sound):
3259         Remove unnecessary forward decls.
3261 2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
3263         Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
3264         * lisp.h (WAIT_READING_MAX): New macro.
3265         * dispnew.c (Fsleep_for, sit_for):
3266         * keyboard.c (kbd_buffer_get_event):
3267         * process.c (Faccept_process_output):
3268         Use it to avoid bogus compiler warnings with obsolescent GCC versions.
3269         This improves on the previous patch, which introduced a bug
3270         when time_t is unsigned and as wide as intmax_t.
3271         See <http://bugs.gnu.org/9000#51>.
3273 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
3275         * dispnew.c (sit_for, Fsleep_for):
3276         * keyboard.c (kbd_buffer_get_event):
3277         * process.c (Faccept_process_output): Avoid compiler warnings when
3278         comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
3280 2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
3282         * makefile.w32-in: Update dependencies.
3284         * w32.c (ltime): Add return type and declare static.
3285         (w32_get_internal_run_time): Remove usused variable `time_100ns'.
3287 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3289         * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
3290         Privately reported by Herbert J. Skuhra.
3291         (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
3292         All uses changed.
3293         (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
3294         not make_lisp_timeval, when the argument is of type EMACS_TIME.
3296 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
3298         * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
3299         last argument of make_unibyte_string.
3301         * keyboard.c (kbd_buffer_get_event): Include the codepage and the
3302         language ID in the event parameters.
3304         * w32term.c (w32_read_socket): Put the new keyboard codepage into
3305         event.code, not the obscure "character set ID".
3307 2012-06-23  Chong Yidong  <cyd@gnu.org>
3309         * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
3311 2012-06-23  Eli Zaretskii  <eliz@gnu.org>
3313         Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
3314         * w32.c (fdutimens): New function.
3316         * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
3318         * s/ms-w32.h (pselect): Redirect to sys_select.
3320         * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
3322         * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
3323         in the logic of incrementing and decrementing the value of
3324         use_relocatable_buffers.
3326 2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3328         * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
3329         Privately reported by Herbert J. Skuhra.
3330         [__FreeBSD__]: Remove "*/" typo after "#include".
3331         (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
3332         (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
3333         (TIMEVAL, system_process_attributes) [__FreeBSD__]:
3334         Don't assume EMACS_TIME and struct timeval are the same type.
3336 2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3338         Support higher-resolution time stamps (Bug#9000).
3339         The time stamps are only nanosecond-resolution at the C level,
3340         since that's the best that any real-world system supports now.
3341         But they are picosecond-resolution at the Lisp level, as that's
3342         easy, and leaves room for future OS improvements.
3344         * Makefile.in (LIB_CLOCK_GETTIME): New macro.
3345         (LIBES): Use it.
3347         * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
3348         Don't get current time unless it's needed.
3350         * atimer.c: Include <sys/time.h> unconditionally, since gnulib
3351         now provides it if it's absent.
3352         (start_atimer): Port to higher-res time stamps.
3353         Check for time stamp overflow.  Don't get current time more
3354         often than is needed.
3356         * buffer.h (struct buffer): Buffer modtime now has high resolution.
3357         Include systime.h, not time.h.
3358         (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
3360         * dired.c: Include stat-time.h.
3361         (Ffile-attributes): File times now have higher resolution.
3363         * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
3364         (struct image): Timestamp now has higher resolution.
3366         * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
3367         has at least microseconds now.  All uses removed.
3368         (update_frame, update_single_window, update_window, update_frame_1)
3369         (Fsleep_for, sit_for): Port to higher-resolution time stamps.
3371         * editfns.c (time_overflow): Now extern.
3372         (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
3373         (float-time, Fformat_time_string, Fcurrent_time_string)
3374         (Fcurrent_time_zone): Accept and generate higher-resolution
3375         time stamps.
3376         (make_time_tail, make_lisp_time, dissassemble_lisp_time)
3377         (decode_time_components, lisp_seconds_argument): New functions.
3378         (make_time): Now static.
3379         (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
3380         Report an error if the time is invalid, rather than having the caller
3381         do that.
3383         * fileio.c: Include <stat-time.h>
3384         (Fcopy_file): Copy higher-resolution time stamps.
3385         Prefer to set the time stamp via a file descriptor if that works.
3386         (Fset_file_times, Finsert_file_contents, Fwrite_region)
3387         (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
3388         (Fvisited_file_modtime, Fset_visited_file_modtime):
3389         Support higher-resolution time stamps.
3391         * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
3393         * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
3395         * image.c (prepare_image_for_display, clear_image_cache)
3396         (lookup_image): Port to higer-resolution time stamps.
3398         * keyboard.c (start_polling, bind_polling_period):
3399         Check for time stamp overflow.
3400         (read_char, kbd_buffer_get_event, timer_start_idle)
3401         (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
3402         (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
3403         Port to higher-resolution time stamps.  Do not assume time_t is signed.
3404         (decode_timer): New function.  Timers are now vectors of length 9,
3405         not 8, to accommodate the picosecond component.
3406         (timer_check_2): Use it.
3408         * nsterm.m (select_timeout, timeval_subtract): Remove.
3409         (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
3410         as they're a bit more accurate and handle overflow better.
3411         (ns_select): Change prototype to be compatible with pselect.
3412         (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
3413         * nsterm.h (ns_select): Adjust prototype.
3415         * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
3416         us-resolution time stamps.
3417         (sys_select): Use the new EMACS_TIME_SIGN macro instead.
3419         * lread.c (read_filtered_event): Port to ns-resolution time stamps.
3421         * lisp.h (time_overflow): New decl.
3422         (wait_reading_process_output): First arg is now intmax_t, not int,
3423         to accommodate larger waits.
3425         * process.h (struct Lisp_Process.read_output_delay):
3426         Now counts nanoseconds, not microseconds.
3427         * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
3428         EMACS_HAS_USECS.
3429         (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
3430         (wait_reading_process_output):
3431         Port to ns-resolution time stamps.
3432         (Faccept_process_output, wait_reading_process_output):
3433         Check for time stamp overflow.  Do not assume time_t is signed.
3434         (select_wrapper): Remove; we now use pselect.
3435         (Fprocess_attributes): Now generates ns-resolution time stamps.
3437         * sysdep.c: Include utimens.h.  Don't include utime.h
3438         or worry about struct utimbuf; gnulib does that for us now.
3439         (gettimeofday): Remove; gnulib provides a substitute.
3440         (make_timeval): New function.
3441         (set_file_times): Now sets ns-resolution time stamps.
3442         New arg FD; all uses changed.
3443         (time_from_jiffies, ltime_from_jiffies, get_up_time)
3444         (system_process_attributes):
3445         Now returns ns-resolution time stamp.  All uses changed.
3446         Check for time stamp overflow.
3448         * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
3449         provides a substitute now.
3451         * systime.h: Include timespec.h rather than sys/time.h and time.h,
3452         since it guarantees struct timespec.
3453         (EMACS_TIME): Now struct timespec, so that we can support
3454         ns-resolution time stamps.
3455         (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
3456         (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
3457         (EMACS_USECS): Remove.
3458         (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
3459         so multiply the arg by 1000 before storing it.
3460         (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
3461         New macros.
3462         (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
3463         Port to ns-resolution time stamps.
3464         (EMACS_TIME_NEG_P): Remove; replaced by....
3465         (EMACS_TIME_SIGN): New macro.
3466         (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
3467         (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
3468         (set_file_times, make_time, lisp_time_argument): Adjust signature.
3469         (make_timeval, make_lisp_time, decode_time_components): New decls.
3470         (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
3471         that it mishandled time_t overflow.  You can't compare by subtracting!
3472         (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
3473         (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
3475         * term.c: Include <sys/time.h>.
3476         (timeval_to_Time): New function, for proper overflow wraparound.
3477         (term_mouse_position, term_mouse_click): Use it.
3479         * undo.c (record_first_change): Support higher-resolution time stamps
3480         in the undo buffer.
3481         (Fprimitive_undo): Use them when restoring time stamps.
3483         * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
3484         (w32_get_internal_run_time):
3485         Port to higher-resolution Emacs time stamps.
3486         (ltime): Now accepts single 64-bit integer, as that's more convenient
3487         for callers.
3489         * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
3491         * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
3492         for compatibility with pselect.  Support ns-resolution time stamps.
3494         * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
3496         * xselect.c (wait_for_property_change, x_get_foreign_selection):
3497         Check for time stamp overflow, and support ns-resolution time stamps.
3499         * xterm.c: Don't include sys/time.h; gnulib does that for us now.
3500         Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
3501         (timeval_subtract): Remove; no longer needed.
3502         (XTflash, XTring_bell, x_wait_for_event):
3503         Port to ns-resolution time stamps.  Don't assume time_t is signed.
3505 2012-06-22  Chong Yidong  <cyd@gnu.org>
3507         * xdisp.c (x_consider_frame_title): Revert last change.
3509 2012-06-22  Eli Zaretskii  <eliz@gnu.org>
3511         * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
3512         with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
3513         aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
3514         staticidx goes up to 1597 out of 1600 = 0x640.)
3516 2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
3518         * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
3519         Otherwise, the umask might be mistakenly 0 while handling input signals.
3521 2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
3523         * minibuf.c (Fread_string): Bind minibuffer-completion-table.
3525 2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
3527         * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
3528         * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
3529         * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
3530         access to `contents' member of Lisp_Vector objects with AREF and ASET
3531         where appropriate.
3533 2012-06-19  Chong Yidong  <cyd@gnu.org>
3535         * frame.c (delete_frame): When selecting a frame on a different
3536         text terminal, do not alter the terminal's top-frame.
3538         * xdisp.c (format_mode_line_unwind_data): Record the target
3539         frame's selected window and its terminal's top-frame.
3540         (unwind_format_mode_line): Restore them.
3541         (x_consider_frame_title, display_mode_line, Fformat_mode_line):
3542         Callers changed.
3543         (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
3544         since tty frames can be explicitly named.
3545         (prepare_menu_bars): Likewise.
3547         * term.c (Ftty_top_frame): New function.
3549 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
3551         Port byte-code-meter to modern targets.
3552         * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
3553         !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
3554         CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
3555         <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
3556         (METER_1, METER_2): Simplify.
3558 2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
3560         * data.c (Fdefalias): Return `symbol' (bug#11686).
3562 2012-06-18  Martin Rudalics  <rudalics@gmx.at>
3564         * buffer.c (Fkill_buffer): Don't throw an error when the buffer
3565         gets killed during executing of this function (Bug#11665).
3566         Try to always return Qt when the buffer has been actually killed.
3567         (Vkill_buffer_query_functions): In doc-string say that functions
3568         run by this hook should not change the current buffer.
3570 2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
3572         Fix recently-introduced process.c problems found by static checking.
3573         * process.c (write_queue_push, write_queue_pop, send_process):
3574         Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
3575         (write_queue_pop): Fix pointer signedness problem.
3576         (send_process): Remove unused local.
3578 2012-06-17  Chong Yidong  <cyd@gnu.org>
3580         * xdisp.c (redisplay_internal): No need to redisplay terminal
3581         frames that are not on top.
3583 2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
3585         * process.c (make_process): Initialize write_queue.
3586         (write_queue_push, write_queue_pop): New functions.
3587         (send_process): Use them to maintain correct ordering of process
3588         writes (Bug#10815).
3590 2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
3592         * lisp.h (eassert): Assume C89 or later.
3593         This removes the need for CHECK.
3594         (CHECK): Remove.  Its comments about always evaluating its
3595         argument were confusing, as 'eassert' typically does not evaluate
3596         its argument.
3598         * coding.c (produce_chars): Use ptrdiff_t, not int.
3600         * xterm.c (x_draw_underwave): Check for integer overflow.
3601         This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
3603 2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
3605         * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
3606         referenced (Bug#11583).
3608 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
3610         Implement wave-style variant of underlining.
3611         * dispextern.h (face_underline_type): New enum.
3612         (face): Add field for underline type.
3613         * nsterm.m (ns_draw_underwave): New function.
3614         (ns_draw_text_decoration): Use it.
3615         * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
3616         New functions.
3617         (x_draw_glyph_string): Use them.
3618         * xfaces.c (Qline, Qwave): New Lisp objects.
3619         (check_lface_attrs, merge_face_ref)
3620         (Finternal_set_lisp_face_attribute, realize_x_face):
3621         Handle wave-style underline face attributes.
3622         * xterm.c (x_draw_underwave): New function.
3623         (x_draw_glyph_string): Use it.
3625 2012-06-16  Juanma Barranquero  <lekktu@gmail.com>
3627         * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
3628         ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
3629         ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
3630         ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
3631         ($(BLD)/w32select.$(O)): Update dependencies.
3633 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
3635         * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
3636         (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
3637         * character.c (_fetch_multibyte_char_p): Remove.
3638         * alloc.c: Include "character.h" before "buffer.h".
3639         * bidi.c: Likewise.
3640         * buffer.c: Likewise.
3641         * bytecode.c: Likewise.
3642         * callint.c: Likewise.
3643         * callproc.c: Likewise.
3644         * casefiddle.c: Likewise.
3645         * casetab.c: Likewise.
3646         * category.c: Likewise.
3647         * cmds.c: Likewise.
3648         * coding.c: Likewise.
3649         * composite.c: Likewise.
3650         * dired.c: Likewise.
3651         * dispnew.c: Likewise.
3652         * doc.c: Likewise.
3653         * dosfns.c: Likewise.
3654         * editfns.c: Likewise.
3655         * emacs.c: Likewise.
3656         * fileio.c: Likewise.
3657         * filelock.c: Likewise.
3658         * font.c: Likewise.
3659         * fontset.c: Likewise.
3660         * fringe.c: Likewise.
3661         * indent.c: Likewise.
3662         * insdel.c: Likewise.
3663         * intervals.c: Likewise.
3664         * keyboard.c: Likewise.
3665         * keymap.c: Likewise.
3666         * lread.c: Likewise.
3667         * macros.c: Likewise.
3668         * marker.c: Likewise.
3669         * minibuf.c: Likewise.
3670         * nsfns.m: Likewise.
3671         * nsmenu.m: Likewise.
3672         * print.c: Likewise.
3673         * process.c: Likewise.
3674         * regex.c: Likewise.
3675         * region-cache.c: Likewise.
3676         * search.c: Likewise.
3677         * syntax.c: Likewise.
3678         * term.c: Likewise.
3679         * textprop.c: Likewise.
3680         * undo.c: Likewise.
3681         * unexsol.c: Likewise.
3682         * w16select.c: Likewise.
3683         * w32fns.c: Likewise.
3684         * w32menu.c: Likewise.
3685         * window.c: Likewise.
3686         * xdisp.c: Likewise.
3687         * xfns.c: Likewise.
3688         * xmenu.c: Likewise.
3689         * xml.c: Likewise.
3690         * xselect.c: Likewise.
3692 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
3694         * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
3695         If all the glyphs of the glyph row came from strings, and we have no
3696         cursor positioning clues, put the cursor on the first glyph of the
3697         row.
3698         (handle_face_prop): Use chunk-relative overlay string index when
3699         indexing into it->string_overlays array.  (Bug#11653)
3700         (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
3701         the rightmost.  (Bug#11720)
3703 2012-06-16  Andreas Schwab  <schwab@linux-m68k.org>
3705         * category.h (CHAR_HAS_CATEGORY): Define as inline.
3706         (CATEGORY_MEMBER): Enforce 1/0 value.
3707         * category.c (_temp_category_set): Remove.
3709 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
3711         * window.c (Fdelete_other_windows_internal)
3712         (Fdelete_window_internal): Don't access frame's mouse highlight
3713         info of the initial frame.  (Bug#11677)
3715 2012-06-14  Paul Eggert  <eggert@cs.ucla.edu>
3717         * .gdbinit (xgetint): Fix recently-introduced paren typo.
3718         Assume USE_2_TAGS_FOR_INTS.
3719         (xreload): Adjust $tagmask width to match recent lisp.h change.
3721         Simplify lisp.h in minor ways that should not affect code.
3722         * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
3723         (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
3724         (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
3725         Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
3726         (INTTYPEBITS): New macro, for clarity.
3727         (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
3728         (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
3729         Simplify now that USE_LSB_TAG is always defined.
3730         (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
3731         (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
3733 2012-06-13  Juanma Barranquero  <lekktu@gmail.com>
3735         * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
3737 2012-06-13  Glenn Morris  <rgm@gnu.org>
3739         * s/bsd-common.h (BSD4_3):
3740         * s/usg5-4-common.h (USG5_4): No longer define; unused.
3742 2012-06-13  Andreas Schwab  <schwab@linux-m68k.org>
3744         * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
3745         instead of union.
3746         (XLI, XIL): Define.
3747         (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
3748         Use them.
3749         * emacs.c (gdb_use_struct): Rename from gdb_use_union.
3750         * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
3751         * alloc.c (widen_to_Lisp_Object): Remove.
3752         (mark_memory): Use XIL instead of widen_to_Lisp_Object.
3753         * frame.c (delete_frame): Remove outdated comment.
3754         * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
3755         USE_LISP_UNION_TYPE.
3756         (Fw32_unregister_hot_key): Likewise.
3757         (Fw32_toggle_lock_key): Likewise.
3758         * w32menu.c (add_menu_item): Likewise.
3759         (w32_menu_display_help): Use XIL instead of checking
3760         USE_LISP_UNION_TYPE.
3761         * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
3762         (init_heap): Likewise.
3763         * w32term.c (w32_read_socket): Update comment.
3765 2012-06-13  Glenn Morris  <rgm@gnu.org>
3767         * s/usg5-4-common.h, src/s/unixware.h:
3768         Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
3770         * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
3772 2012-06-13  Paul Eggert  <eggert@cs.ucla.edu>
3774         USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
3775         * alloc.c (make_number) [!defined make_number]:
3776         Remove, as lisp.h always defines this now.
3777         (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
3778         (roundup_size): Verify that it is a power of 2.
3779         * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
3780         * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
3781         * lisp.h (USE_LSB_TAG): Allow the builder to compile with
3782         -DUSE_LSB_TAG=0, to override the automatically-selected default.
3783         USE_LSB_TAG now is always defined to be either 0 or 1.
3784         All uses changed.
3785         (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
3786         code works fine either way, and efficiency is not a concern here,
3787         as the union type is for debugging, not for production.
3788         (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
3789         Use an inline function on all platforms when using the union type,
3790         since this is simpler and 'static inline' can be used portably
3791         within Emacs now.
3792         (LISP_INITIALLY_ZERO): New macro.
3793         (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
3794         (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
3796 2012-06-12  Glenn Morris  <rgm@gnu.org>
3798         * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
3800         * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
3802         * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
3803         Move BROKEN_SIGIO to configure.
3805         * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
3806         Move NO_TERMIO to configure.
3808 2012-06-12  Chong Yidong  <cyd@gnu.org>
3810         * image.c (imagemagick_load_image): Use MagickFlattenImage if
3811         MagickMergeImageLayers is undefined.  Use pixel pusher loop if
3812         MagickExportImagePixels is undefined.
3814 2012-06-12  Paul Eggert  <eggert@cs.ucla.edu>
3816         * image.c (imagemagick_load_image): Remove unused label.
3818 2012-06-11  Glenn Morris  <rgm@gnu.org>
3820         * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
3821         * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
3822         * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
3823         * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
3825 2012-06-11  Stefan Monnier  <monnier@iro.umontreal.ca>
3827         * alloc.c (make_byte_code): New function.
3828         (Fmake_byte_code): Use it.  Don't purify here.
3829         * lread.c (read1): Use it as well to avoid extra allocation.
3831 2012-06-11  Chong Yidong  <cyd@gnu.org>
3833         * image.c (imagemagick_load_image): Implement transparency.
3835 2012-06-10  Andreas Schwab  <schwab@linux-m68k.org>
3837         * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
3838         account for preceding backslashes.  (Bug#11663)
3840 2012-06-09  Chong Yidong  <cyd@gnu.org>
3842         * term.c: Support italics in capable terminals (Bug#9652).
3843         (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
3844         (turn_on_face): Output using TS_enter_italic_mode if available.
3845         Don't handle unused blinking and alt-charset cases.
3846         (turn_off_face): Handle italic case; discard unused tty_blinking_p
3847         and tty_alt_charset_p cases.
3848         (tty_capable_p, init_tty): Support italics.
3850         * termchar.h (struct tty_display_info): Add field for italics.
3851         Remove unused blink field.
3853         * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
3854         Handle slant.
3856         * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
3857         (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
3858         tty_alt_charset_p.  Add tty_italic_p.
3860 2012-06-09  Michael Albinus  <michael.albinus@gmx.de>
3862         * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
3863         dbus_type_is_basic if available.
3864         (xd_extract_signed, xd_extract_unsigned): Rename from
3865         extract_signed and extract_unsigned, respectively.  Adapt callers.
3867 2012-06-09  Chong Yidong  <cyd@gnu.org>
3869         * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
3871         * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
3872         case (Bug#9752).
3874 2012-06-08  Paul Eggert  <eggert@cs.ucla.edu>
3876         * xdisp.c (vmessage): Treat frame message as multibyte.
3877         Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
3878         would generate the diagnostic "Making \302\247 buffer-local while
3879         let-bound!".
3881 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
3883         * dispnew.c (showing_window_margins_p): Undo last change, which
3884         was done due to an inadvertent commit.
3885         (adjust_frame_glyphs_for_frame_redisplay): Do call
3886         showing_window_margins_p.
3888 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3890         * eval.c (Fmake_var_non_special): New primitive.
3891         (syms_of_eval): Defsubr it.
3892         * lread.c (syms_of_lread): Mark `values' as lexically scoped.
3894 2012-06-08  Juanma Barranquero  <lekktu@gmail.com>
3896         * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
3897         function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
3899 2012-06-08  Eli Zaretskii  <eliz@gnu.org>
3901         * alloc.c (allocate_vectorlike): Fix last change.
3903 2012-06-08  Dmitry Antipov  <dmantipov@yandex.ru>
3905         Block-based vector allocation of small vectors.
3906         * lisp.h (struct vectorlike_header): New field `nbytes',
3907         adjust comment accordingly.
3908         * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
3909         to denote vector blocks. Adjust users (live_vector_p,
3910         mark_maybe_pointer, valid_lisp_object_p) accordingly.
3911         (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
3912         (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
3913         (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
3914         (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
3915         (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
3916         (roundup_size): New constant.
3917         (struct vector_block): New data type.
3918         (vector_blocks, vector_free_lists, zero_vector): New variables.
3919         (all_vectors): Rename to `large_vectors'.
3920         (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
3921         (sweep_vectors): New functions.
3922         (allocate_vectorlike): Return `zero_vector' as the only vector of
3923         0 items. Allocate new vector from block if vector size is less than
3924         or equal to VBLOCK_BYTES_MAX.
3925         (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
3926         (init_alloc_once): Add call to init_vectors.
3928 2012-06-08  Stefan Monnier  <monnier@iro.umontreal.ca>
3930         * eval.c (Fmacroexpand): Stop if the macro returns the same form.
3932 2012-06-07  Paul Eggert  <eggert@cs.ucla.edu>
3934         * doprnt.c (doprnt): Truncate multibyte char correctly.
3935         Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
3936         would mishandle a string argument "Xc" if X was a multibyte
3937         character of length 2: it would truncate after X's first byte
3938         rather than including all of X.
3940 2012-06-06  Chong Yidong  <cyd@gnu.org>
3942         * buffer.c (word_wrap): Doc fix.
3944 2012-06-04  Paul Eggert  <eggert@cs.ucla.edu>
3946         * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
3948 2012-06-03  Glenn Morris  <rgm@gnu.org>
3950         * xdisp.c (tool-bar-style): Doc fix.
3952 2012-06-03  Ulrich Müller  <ulm@gentoo.org>
3954         * Makefile.in (PAXCTL): Define.
3955         (temacs$(EXEEXT)): Disable memory randomization for the temacs
3956         binary via PaX flags if the paxctl utility is available.
3957         (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3958         Restore PaX flags to their default.  (Bug#11398)
3960 2012-06-03  Chong Yidong  <cyd@gnu.org>
3962         * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
3963         buffer (Bug#11226).
3965 2012-06-03  Chong Yidong  <cyd@gnu.org>
3967         * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
3968         (note_mode_line_or_margin_highlight): If there is no help echo,
3969         use mode-line-default-help-echo.  Handle the case where the mouse
3970         position is past the end of the mode line string.
3972         * buffer.c (buffer_local_value_1): New function, split from
3973         Fbuffer_local_value; can return Qunbound.
3974         (Fbuffer_local_value): Use it.
3975         (Vmode_line_format): Docstring tweaks.
3977 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3979         * sysdep.c (system_process_attributes): Improve comment.
3981 2012-06-02  Stefan Monnier  <monnier@iro.umontreal.ca>
3983         * keyboard.c: Export real-this-command to Elisp.
3984         (syms_of_keyboard): Rename real_this_command to Vreal_this_command
3985         and DEFVAR it.  Update all users.
3987 2012-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3989         * minibuf.c (Fassoc_string): Remove duplicate declaration.
3991         * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
3992         Convert pctcpu and pctmem to Lisp float properly.
3993         Let the compiler fold better, as 100.0/0x8000 is exact.
3995 2012-06-02  Andreas Schwab  <schwab@linux-m68k.org>
3997         * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
3998         cons_block.
4000 2012-06-01  Paul Eggert  <eggert@cs.ucla.edu>
4002         * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4004 2012-06-01  Dmitry Antipov  <dmantipov@yandex.ru>
4006         For a 'struct window', replace some Lisp_Object fields to
4007         bitfields where appropriate, remove unused fields.
4008         * window.h (struct window): Remove unused 'last_mark_x' and
4009         'last_mark_y' fields.  Rename 'mini_p' field to 'mini',
4010         change it's type from Lisp_Object to bitfield.
4011         Change type of 'force_start', 'optional_new_start',
4012         'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4013         fields from Lisp_Object to bitfield. Adjust users accordingly.
4015 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
4017         Pacify gcc -Wdouble-precision when using Xaw.
4018         * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4019         [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4020         Use 'float' consistently, rather than 'float' in most places
4021         and 'double' in a couple of places.
4023 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
4025         * xdisp.c (handle_stop): Detect whether we have overlay strings
4026         loaded by testing it->current.overlay_string_index to be
4027         non-negative, instead of checking whether n_overlay_strings is
4028         positive.  (Bug#11587)
4030 2012-05-31  Chong Yidong  <cyd@gnu.org>
4032         * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4034         * doc.c (Fsubstitute_command_keys): Doc fix.
4036 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
4038         * search.c (search_buffer): Remove calls to
4039         r_alloc_inhibit_buffer_relocation, as it is now called by
4040         maybe_unify_char, which was the cause of relocation of buffer text
4041         in bug#11519.
4043 2012-05-31  Eli Zaretskii  <eliz@gnu.org>
4045         * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4046         for the duration of call to load_charset, to avoid problems with
4047         callers of maybe_unify_char that access buffer text through C
4048         pointers.
4050         * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4051         decrement the inhibition flag, instead of just setting or
4052         resetting it.
4054 2012-05-31  Paul Eggert  <eggert@cs.ucla.edu>
4056         Remove obsolete '#define static' cruft.
4057         * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4058         This #undef was "temporary" in 2000; it is no longer needed
4059         now that '#define static' has gone away.
4060         * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4061         (gray_bitmap_bits): Remove; no longer needed.
4062         All uses replaced with definiens.
4063         * xterm.c: Include "bitmaps/gray.xbm".
4065 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
4067         Clean up __executable_start, monstartup when --enable-profiling.
4068         The following changes affect the code only when profiling.
4069         * dispnew.c (__executable_start): Rename from safe_bcopy.
4070         Define only on platforms that need it.
4071         * emacs.c: Include <sys/gmon.h> when profiling.
4072         (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4073         (__executable_start): Remove decl, since lisp.h does it now.
4074         (safe_bcopy): Remove decl; no longer has that name.
4075         (main): Coalesce #if into single bit of code, for simplicity.
4076         Cast pointers to uintptr_t, since standard libraries want integers
4077         and not pointers.
4078         * lisp.h (__executable_start): New decl.
4080 2012-05-31  Glenn Morris  <rgm@gnu.org>
4082         * image.c (Fimagemagick_types): Doc fix.
4084 2012-05-30  Jim Meyering  <meyering@redhat.com>
4086         * callproc.c (Fcall_process_region): Include directory component
4087         in mkstemp error message (Bug#11586).
4089 2012-05-30  Paul Eggert  <eggert@cs.ucla.edu>
4091         * alloc.c, lisp.h (make_pure_vector): Now static.
4093 2012-05-30  Stefan Monnier  <monnier@iro.umontreal.ca>
4095         * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4096         Move to byte-run.el.
4097         (Fautoload): Do the hash-doc more carefully.
4098         * data.c (Fdefalias): Purify definition, except for keymaps.
4099         (Qdefun): Move from eval.c.
4100         * lisp.h (Qdefun): Remove.
4101         * lread.c (read1): Tiny simplification.
4103 2012-05-29  Troels Nielsen  <bn.troels@gmail.com>
4105         Do not create empty overlays with the evaporate property (Bug#9642).
4106         * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4107         Bug#9642, but explicitly check that the buffer the overlay would
4108         be moved to is live and rearrange lines to make sure that errors
4109         will not put the overlay in an inconsistent state.
4110         (Fdelete_overlay): Cosmetics.
4112 2012-05-28  Eli Zaretskii  <eliz@gnu.org>
4114         * w32term.c (my_bring_window_to_top): New function.
4115         (x_raise_frame): Use handle returned by DeferWindowPos, which
4116         could be different from the original one.
4117         Call my_bring_window_to_top instead of my_set_foreground_window.
4118         (Bug#11513)
4120         * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4121         by calling BringWindowToTop.
4123         * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4124         (WM_EMACS_END): Increase by one.
4126 2012-05-28  Paul Eggert  <eggert@cs.ucla.edu>
4128         * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4129         This avoids undefined behavior that might cause the eassert
4130         to not catch an out-of-range value.
4132 2012-05-28  Juanma Barranquero  <lekktu@gmail.com>
4134         * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4135         Update dependencies.
4137 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
4139         * bidi.c (bidi_mirror_char): Fix last change.
4141 2012-05-27  Andreas Schwab  <schwab@linux-m68k.org>
4143         * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4144         when referring to sectname field in printf format.
4146 2012-05-27  Paul Eggert  <eggert@cs.ucla.edu>
4148         * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4149         Only r_alloc_inhibit_buffer_relocation needed to be added;
4150         the others were already declared.
4152         * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4153         before checking whether it's out of range.  Put the check inside
4154         eassert.  See
4155         <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4157 2012-05-27  Ken Brown  <kbrown@cornell.edu>
4159         * callproc.c (Fcall_process): Restore a line that was accidentally
4160         commented out in the 2011-02-13 change (bug#11547).
4162 2012-05-27  Eli Zaretskii  <eliz@gnu.org>
4164         * lisp.h [REL_ALLOC]: Add prototypes for external functions
4165         defined on ralloc.c.
4167         * buffer.c [REL_ALLOC]: Remove prototypes of
4168         r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4169         they are now on lisp.h.
4171         * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
4173         * search.c (search_buffer): Use it to inhibit relocation of buffer
4174         text while re_search_2 is doing its job, because re_search_2 is
4175         passed C pointers to buffer text.  (Bug#11519)
4177         * msdos.c (internal_terminal_init) <Vwindow_system_version>:
4178         Update value to 24.
4180         * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
4181         state after an additional call to move_it_in_display_line_to, keep
4182         the values of it->max_ascent and it->max_descent found for the
4183         entire line.
4184         (pos_visible_p): Revert the comparison against bottom_y to what it
4185         was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
4186         (Bug#11464)
4188 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
4190         Fix coding-related core dumps with gcc -ftrapv.
4191         The code was computing A - B, where A and B are pointers, and B is
4192         random garbage.  This can lead to core dumps on platforms that
4193         have special pointer registers, and it also leads to core dumps on
4194         x86-64 when compiled with gcc -ftrapv.  The fix is to compute
4195         A - B only when B is initialized properly.
4196         * coding.c (coding_set_source, coding_set_destination): Return void.
4197         (coding_change_source, coding_change_destinations): New functions,
4198         with the old behaviors of coding_set_source and coding_set_destination.
4199         All callers that need an offset changed to use these new functions.
4201 2012-05-26  Glenn Morris  <rgm@gnu.org>
4203         * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
4205 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
4207         Extend mouse support on W32 text-mode console.
4208         * xdisp.c (draw_row_with_mouse_face):
4209         Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
4211         * w32console.c: Include window.h.
4212         (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
4213         New functions.
4214         (initialize_w32_display): Initialize mouse-highlight data.
4216         * w32inevt.c: Include termchar.h and window.h.
4217         (do_mouse_event): Support mouse-autoselect-window.  When the mouse
4218         moves, call note_mouse_highlight.  If help_echo changed, call
4219         gen_help_event to produce help-echo message in the echo area.
4220         Call clear_mouse_face if mouse_face_hidden is set in the mouse
4221         highlight info.
4223 2012-05-26  Paul Eggert  <eggert@cs.ucla.edu>
4225         * lread.c (read1): Simplify slightly to avoid an overflow warning
4226         with GCC 4.7.0 on x86-64.
4228 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
4230         * bidi.c (bidi_mirror_char): Revert last change: an int is
4231         definitely wide enough here.
4233 2012-05-25  Paul Eggert  <eggert@cs.ucla.edu>
4235         Fix integer width and related bugs (Bug#9874).
4236         * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
4237         (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
4238         (string_bytes, check_sblock, allocate_string_data):
4239         (compact_small_strings, Fmake_bool_vector, make_string)
4240         (make_unibyte_string, make_multibyte_string)
4241         (make_string_from_bytes, make_specified_string)
4242         (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
4243         (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
4244         (mark_vectorlike):
4245         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4246         (allocate_pseudovector):
4247         Use int, not EMACS_INT, where int is wide enough.
4248         (inhibit_garbage_collection, Fgarbage_collect):
4249         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4250         * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
4251         int might not be wide enough.
4252         (bidi_cache_search, bidi_cache_find, bidi_init_it)
4253         (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4254         (bidi_at_paragraph_end, bidi_find_paragraph_start)
4255         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4256         (bidi_level_of_next_char, bidi_move_to_visually_next):
4257         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4258         * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
4259         (Fkill_buffer, Fset_buffer_major_mode)
4260         (advance_to_char_boundary, Fbuffer_swap_text)
4261         (Fset_buffer_multibyte, overlays_at, overlays_in)
4262         (overlay_touches_p, struct sortvec, record_overlay_string)
4263         (overlay_strings, recenter_overlay_lists)
4264         (adjust_overlays_for_insert, adjust_overlays_for_delete)
4265         (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
4266         (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
4267         (Foverlay_recenter, last_overlay_modification_hooks_used)
4268         (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
4269         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4270         (validate_region): Omit unnecessary test for b <= e,
4271         since that's guaranteed by the previous test.
4272         (adjust_overlays_for_delete): Avoid pos + length overflow.
4273         (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
4274         (report_overlay_modification):
4275         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4276         (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
4277         Omit pointer cast, which isn't needed anyway, and doesn't work
4278         after the EMACS_INT -> ptrdiff_t change.
4279         (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
4280         * buffer.h: Adjust decls to match defn changes elsewhere.
4281         (struct buffer_text, struct buffer):
4282         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4283         Use EMACS_INT, not int, where int might not be wide enough.
4284         * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
4285         not int, to avoid needless 32-bit limit on 64-bit hosts.
4286         (exec_byte_code): Use tighter memory-full test, one that checks
4287         for alloca overflow.  Don't compute the address of the object just
4288         before an array, as that's not portable.  Use EMACS_INT, not
4289         ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
4290         * callint.c (Fcall_interactively):
4291         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4292         * callproc.c (call_process_kill, Fcall_process):
4293         Don't assume pid_t fits into an Emacs fixnum.
4294         (call_process_cleanup, Fcall_process, child_setup):
4295         Don't assume pid_t fits into int.
4296         (call_process_cleanup, Fcall_process, delete_temp_file)
4297         (Fcall_process_region):
4298         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4299         (Fcall_process): Simplify handling of volatile integers.
4300         Use int, not EMACS_INT, where int will do.
4301         * casefiddle.c (casify_object, casify_region, operate_on_word)
4302         (Fupcase_word, Fdowncase_word, Fcapitalize_word):
4303         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4304         (casify_object): Avoid integer overflow when overallocating buffer.
4305         * casetab.c (set_identity, shuffle): Prefer int to unsigned when
4306         either works.  Use lint_assume to convince GCC 4.6.1 that it's OK.
4307         * category.c (Fchar_category_set): Don't assume fixnum fits in int.
4308         * category.h (CATEGORYP): Don't assume arg is nonnegative.
4309         * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
4310         integers are now checked earlier.  All uses replaced with XINT.
4311         (ccl_driver):
4312         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4313         For CCL_MapSingle, check that content and value are in int range.
4314         (ccl_driver, Fregister_code_conversion_map):
4315         Check that Vcode_version_map_vector is a vector.
4316         (resolve_symbol_ccl_program): Check that vector header is in range.
4317         Always copy the vector, so that we can check its contents reliably
4318         now rather than having to recheck each instruction as it's being
4319         executed.  Check that vector words fit in 'int'.
4320         (ccl_get_compiled_code, Fregister_ccl_program)
4321         (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
4322         program indexes, to avoid needless 32-bit limit on 64-bit hosts.
4323         (Fccl_execute, Fccl_execute_on_string): Check that initial reg
4324         contents are in range.
4325         (Fccl_execute_on_string): Check that status is in range.
4326         * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
4327         * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
4328         Accept and return EMACS_INT, not int, because callers can pass values
4329         out of 'int' range.
4330         (c_string_width, strwidth, lisp_string_width, chars_in_text)
4331         (multibyte_chars_in_text, parse_str_as_multibyte)
4332         (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
4333         (str_as_unibyte, str_to_unibyte, string_count_byte8)
4334         (string_escape_byte8, Fget_byte):
4335         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4336         (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
4337         avoid mishandling large integers.
4338         * character.h: Adjust decls to match defn changes elsewhere.
4339         * charset.c (load_charset_map_from_file, find_charsets_in_text)
4340         (Ffind_charset_region):
4341         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4342         (load_charset_map_from_file): Redo idx calculation to avoid overflow.
4343         (load_charset_map_from_vector, Fdefine_charset_internal):
4344         Don't assume fixnum fits in int.
4345         (load_charset_map_from_vector, Fmap_charset_chars):
4346         Remove now-unnecessary CHECK_NATNUMs.
4347         (Fdefine_charset_internal): Check ranges here, more carefully.
4348         Don't rely on undefined behavior with signed left shift overflow.
4349         Don't assume unsigned int fits into fixnum, or that fixnum fits
4350         into unsigned int.  Don't require max_code to be a valid fixnum;
4351         that's not true for gb10830 4-byte on a 32-bit host.  Allow
4352         invalid_code to be a cons, for the same reason.  Require code_offset
4353         to be a character.  Avoid int overflow if max_char is close
4354         to INT_MAX.
4355         (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
4356         this is intended anyway and avoids some undefined behavior.
4357         (load_charset_map): Pass unsigned, not int, as 2nd arg of
4358         INDEX_TO_CODE_POINT, as that's what it expects.
4359         (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
4360         * charset.h (DECODE_CHAR): Return int, not unsigned;
4361         this is what was intended anyway, and it avoids undefined behavior.
4362         (CHARSET_OFFSET): Remove unused macro, instead of fixing its
4363         integer-overflow issues.
4364         (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
4365         Formerly, it returned EMACS_INT on 64-bit hosts in the common case
4366         where the argument is EMACS_INT, and this behavior is not intended.
4367         * chartab.c (Fmake_char_table, Fset_char_table_range)
4368         (uniprop_get_decoder, uniprop_get_encoder):
4369         Don't assume fixnum fits in int.
4370         * cmds.c (move_point): New function, that does the gist of
4371         Fforward_char and Fbackward_char, but does so while checking
4372         for integer overflow more accurately.
4373         (Fforward_char, Fbackward_char): Use it.
4374         (Fforward_line, Fend_of_line, internal_self_insert)
4375         (internal_self_insert):
4376         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4377         Fix a FIXME, by checking for integer overflow when calculating
4378         target_clm and actual_clm.
4379         * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
4380         (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
4381         (ASSURE_DESTINATION, coding_alloc_by_realloc)
4382         (coding_alloc_by_making_gap, alloc_destination)
4383         (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
4384         (encode_coding_utf_16, detect_coding_emacs_mule)
4385         (decode_coding_emacs_mule, encode_coding_emacs_mule)
4386         (detect_coding_iso_2022, decode_coding_iso_2022)
4387         (encode_invocation_designation, encode_designation_at_bol)
4388         (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
4389         (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
4390         (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
4391         (encode_coding_ccl, encode_coding_raw_text)
4392         (detect_coding_charset, decode_coding_charset)
4393         (encode_coding_charset, detect_eol, decode_eol, produce_chars)
4394         (produce_composition, produce_charset, produce_annotation)
4395         (decode_coding, handle_composition_annotation)
4396         (handle_charset_annotation, consume_chars, decode_coding_gap)
4397         (decode_coding_object, encode_coding_object, detect_coding_system)
4398         (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
4399         (code_convert_region, code_convert_string)
4400         (Fdefine_coding_system_internal)
4401         (coding_set_source, coding_set_destination):
4402         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4403         (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
4404         (Fdefine_coding_system_internal):
4405         Don't assume fixnums fit in int.
4406         (decode_coding_gap, decode_coding_object, encode_coding_object)
4407         (Fread_coding_system, Fdetect_coding_region)
4408         (Funencodable_char_position, Fcheck_coding_systems_region)
4409         (get_translation, handle_composition_annotation, consume_chars):
4410         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4411         (consume_chars): Rewrite to not calculate an address outside buffer.
4412         (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
4413         Don't access memory outside of the args array.
4414         (Fdefine_coding_system_internal): Check for charset-id overflow.
4415         (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
4416         result of ENCODE_CHAR.
4417         * coding.h: Adjust decls to match defn changes elsewhere.
4418         (struct coding_system):
4419         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4420         * composite.c (get_composition_id, find_composition)
4421         (run_composition_function, update_compositions)
4422         (compose_text, composition_gstring_put_cache)
4423         (composition_gstring_p, composition_gstring_width)
4424         (fill_gstring_header, fill_gstring_body, autocmp_chars)
4425         (composition_compute_stop_pos, composition_reseat_it)
4426         (composition_update_it, struct position_record)
4427         (find_automatic_composition, composition_adjust_point)
4428         (Fcomposition_get_gstring, Ffind_composition_internal):
4429         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4430         (update_compositions):
4431         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4432         * composite.h: Adjust decls to match defn changes elsewhere.
4433         (struct composition):
4434         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4435         * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
4436         Do not attempt to compute the address of the object just before a
4437         buffer; this is not portable.
4438         (Faref, Faset):
4439         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4440         (Faset): Use int, not EMACS_INT, where int is wide enough.
4441         (Fstring_to_number): Don't assume fixnums fit in int.
4442         (Frem): Don't assume arg is nonnegative.
4443         * dbusbind.c (xd_append_arg): Check for integers out of range.
4444         (Fdbus_call_method): Don't overflow the timeout int.
4445         (extract_signed, extract_unsigned): New functions.
4446         (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
4447         (xd_get_connection_references): Return ptrdiff_t, not int.
4448         All uses changed.
4449         (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
4450         (xd_read_message_1):
4451         Use int, not unsigned, where the dbus API uses int.
4452         (Fdbus_message_internal): Don't overflow mtype.
4453         (syms_of_dbusbind): Allocate right-sized buffer for integers.
4454         * dired.c (directory_files_internal, file_name_completion, scmp)
4455         (file_name_completion_stat):
4456         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4457         (file_name_completion): Don't overflow matchcount.
4458         (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
4459         * dispextern.h: Adjust decls to match defn changes elsewhere.
4460         (struct text_pos, struct glyph, struct bidi_saved_info)
4461         (struct bidi_string_data, struct bidi_it, struct composition_it)
4462         (struct it):
4463         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4464         (struct display_pos, struct composition_it, struct it):
4465         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4466         * dispnew.c (increment_matrix_positions)
4467         (increment_row_positions, mode_line_string)
4468         (marginal_area_string):
4469         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4470         (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
4471         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4472         (duration_to_sec_usec): New function, to check for overflow better.
4473         (Fsleep_for, sit_for): Use it.
4474         * doc.c (get_doc_string, store_function_docstring):
4475         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4476         (get_doc_string, Fsnarf_documentation):
4477         Use int, not EMACS_INT, where int is wide enough.
4478         (get_doc_string):
4479         Use SAFE_ALLOCA, not alloca.
4480         Check for overflow when converting EMACS_INT to off_t.
4481         * doprnt.c (doprnt):
4482         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4483         * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
4484         Don't assume uid_t fits into fixnum.
4485         (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
4486         (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
4487         (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
4488         (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
4489         (general_insert_function)
4490         (Finsert_char, make_buffer_string, make_buffer_string_both)
4491         (update_buffer_properties, Fbuffer_substring)
4492         (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
4493         (Fsubst_char_in_region, check_translation)
4494         (Ftranslate_region_internal, save_restriction_restore, Fformat)
4495         (transpose_markers, Ftranspose_regions):
4496         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4497         (clip_to_bounds): Move to lisp.h as an inline function).
4498         (Fconstrain_to_field): Don't assume integers are nonnegative.
4499         (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
4500         (Fsubst_char_in_region, Fsave_restriction):
4501         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4502         (Femacs_pid): Don't assume pid_t fits into fixnum.
4503         (lo_time): Use int, not EMACS_INT, when int suffices.
4504         (lisp_time_argument): Check for usec out of range.
4505         (Fencode_time): Don't assume fixnum fits in int.
4506         (Fuser_login_name, Fuser_full_name): Signal an error
4507         if a uid argument is out of range, rather than relying on
4508         undefined behavior.
4509         (Fformat_time_string): Remove now-unnecessary check.
4510         lisp_time_argument checks for out-of-range usec now.
4511         Use ptrdiff_t, not size_t, where ptrdiff_t will do.
4512         * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
4513         (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
4514         (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
4515         (init_cmdargs, Fdump_emacs):
4516         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4517         (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
4518         the bottom (typically) 32 bits of the fixnum.
4519         * eval.c (specpdl_size, call_debugger):
4520         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4521         (when_entered_debugger, Fbacktrace_debug):
4522         Don't assume fixnum can fit in int.
4523         (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
4524         the object just before a buffer; this is not portable.
4525         (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
4526         (grow_specpdl, unbind_to):
4527         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4528         (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
4529         (grow_specpdl): Simplify allocation by using xpalloc.
4530         (Fprog1, Fprog2): Don't assume list length fits in int.  Simplify.
4531         * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
4532         (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
4533         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4534         (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
4535         (a_write, e_write):
4536         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4537         (Fcopy_file, non_regular_nbytes, read_non_regular)
4538         (Finsert_file_contents):
4539         Use int, not EMACS_INT, where int is wide enough.
4540         (READ_BUF_SIZE): Verify that it fits in int.
4541         (Finsert_file_contents): Check that counts are in proper range,
4542         rather than assuming fixnums fit into ptrdiff_t etc.
4543         Don't assume fixnums fit into int.
4544         * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
4545         * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
4546         (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
4547         (string_char_to_byte, string_byte_to_char)
4548         (string_make_multibyte, string_to_multibyte)
4549         (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
4550         (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
4551         (substring_both, Fdelete, internal_equal, Ffillarray)
4552         (Fclear_string, mapcar1)
4553         (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
4554         (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
4555         (larger_vector, make_hash_table, maybe_resize_hash_table)
4556         (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
4557         (Fmaphash, secure_hash):
4558         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4559         (concat): Check for string index and length overflow.
4560         (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
4561         (Frequire):
4562         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4563         (larger_vector): New API (vec, incr_min, size_max) replaces old
4564         one (vec, new_size, init).  This catches size overflow.
4565         INIT was removed because it was always Qnil.
4566         All callers changed.
4567         (INDEX_SIZE_BOUND): New macro, which calculates more precisely
4568         the upper bound on a hash table index size.
4569         (make_hash_table, maybe_resize_hash_table): Use it.
4570         (secure_hash): Computer start_byte and end_byte only after
4571         they're known to be in ptrdiff_t range.
4572         * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
4573         (Ffont_get_glyphs, Ffont_at):
4574         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4575         (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
4576         (Flist_fonts, Fopen_font):
4577         Don't assume fixnum can fit in int.
4578         (check_gstring): Don't assume index can fit in int.
4579         (font_match_p): Check that fixnum is a character, not a nonnegative
4580         fixnum, since the later code needs to stuff it into an int.
4581         (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
4582         (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
4583         conversion overflow issues.
4584         (Fopen_font): Check for integer out of  range.
4585         (Ffont_get_glyphs): Don't assume index can fit in int.
4586         * font.h: Adjust decls to match defn changes elsewhere.
4587         * fontset.c (reorder_font_vector): Redo score calculation to avoid
4588         integer overflow.
4589         (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
4590         printmax_t, where ptrdiff_t is wide enough.
4591         (Finternal_char_font):
4592         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4593         * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
4594         (Fset_frame_height, Fset_frame_width, Fset_frame_size)
4595         (Fset_frame_position, x_set_frame_parameters)
4596         (x_set_line_spacing, x_set_border_width)
4597         (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
4598         Check that fixnums are in proper range for system types.
4599         (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
4600         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4601         (Fmodify_frame_parameters): Don't assume fixnum fits in int.
4602         Use SAFE_ALLOCA_LISP, not alloca.
4603         * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
4604         intptr_t is wide enough.
4605         * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
4606         (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
4607         (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
4608         Check for fixnum out of range.
4609         * ftfont.c (ftfont_list): Don't assume index fits in int.
4610         Check that fixnums are in proper range for system types.
4611         (ftfont_shape_by_flt):
4612         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4613         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
4614         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4615         (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
4616         Check that fixnums are in proper range for system types.
4617         * gnutls.h: Adjust decls to match defn changes elsewhere.
4618         * gtkutil.c (xg_dialog_run):
4619         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4620         (update_frame_tool_bar):
4621         Check that fixnums are in proper range for system types.
4622         * image.c (parse_image_spec): Redo count calculation to avoid overflow.
4623         (lookup_image): Check that fixnums are in range for system types.
4624         * indent.c (last_known_column, last_known_column_point):
4625         (current_column_bol_cache):
4626         (skip_invisible, current_column, check_display_width):
4627         (check_display_width, scan_for_column, current_column_1)
4628         (Findent_to, Fcurrent_indentation, position_indentation)
4629         (indented_beyond_p, Fmove_to_column, compute_motion):
4630         (Fcompute_motion, Fvertical_motion):
4631         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4632         (last_known_column_modified): Use EMACS_INT, not int.
4633         (check_display_width):
4634         (Fcompute_motion):
4635         Check that fixnums and floats are in proper range for system types.
4636         (compute_motion): Don't assume index or fixnum fits in int.
4637         (compute_motion, Fcompute_motion):
4638         Use int, not EMACS_INT, when it is wide enough.
4639         (vmotion): Omit local var start_hpos that is always 0; that way
4640         we don't need to worry about overflow in expressions involving it.
4641         * indent.h: Adjust decls to match defn changes elsewhere.
4642         (struct position):
4643         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4644         Use int, not EMACS_INT, where int is wide enough.
4645         Remove unused members ovstring_chars_done and tab_offset;
4646         all uses removed.
4647         * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
4648         (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
4649         (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
4650         (make_gap, copy_text, insert, insert_and_inherit)
4651         (insert_before_markers, insert_before_markers_and_inherit)
4652         (insert_1, count_combining_before, count_combining_after)
4653         (insert_1_both, insert_from_string)
4654         (insert_from_string_before_markers, insert_from_string_1)
4655         (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
4656         (adjust_after_replace, adjust_after_insert, replace_range)
4657         (replace_range_2, del_range, del_range_1, del_range_byte)
4658         (del_range_both, del_range_2, modify_region)
4659         (prepare_to_modify_buffer, signal_before_change)
4660         (signal_after_change, Fcombine_after_change_execute):
4661         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4662         * intervals.c (traverse_intervals, rotate_right, rotate_left)
4663         (balance_an_interval, split_interval_right, split_interval_left)
4664         (find_interval, next_interval, update_interval)
4665         (adjust_intervals_for_insertion, delete_node, delete_interval)
4666         (interval_deletion_adjustment, adjust_intervals_for_deletion)
4667         (static_offset_intervals, offset_intervals)
4668         (merge_interval_right, merge_interval_left, make_new_interval)
4669         (graft_intervals_into_buffer, temp_set_point_both)
4670         (temp_set_point, set_point, adjust_for_invis_intang)
4671         (set_point_both, move_if_not_intangible, get_property_and_range)
4672         (get_local_map, copy_intervals, copy_intervals_to_string)
4673         (compare_string_intervals, set_intervals_multibyte_1):
4674         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4675         * intervals.h: Adjust decls to match defn changes elsewhere.
4676         (struct interval):
4677         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4678         * keyboard.c (this_command_key_count, this_single_command_key_start)
4679         (before_command_key_count, before_command_echo_length, echo_now)
4680         (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
4681         (command_loop_1, safe_run_hooks, read_char, timer_check_2)
4682         (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
4683         (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
4684         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4685         (last_non_minibuf_size, last_point_position, echo_truncate)
4686         (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
4687         (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
4688         (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
4689         (stuff_buffered_input):
4690         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4691         (last_auto_save, command_loop_1, read_char):
4692         Use EMACS_INT, not int, to avoid integer overflow.
4693         (record_char): Avoid overflow in total_keys computation.
4694         (parse_modifiers_uncached): Redo index calculation to avoid overflow.
4695         * keyboard.h: Adjust decls to match defn changes elsewhere.
4696         * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
4697         (Fkey_description, Fdescribe_vector, Flookup_key):
4698         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4699         (click_position): New function, to check that positions are in range.
4700         (Fcurrent_active_maps):
4701         (describe_command):
4702         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4703         (Faccessible_keymaps, Fkey_description):
4704         (preferred_sequence_p):
4705         Don't assume fixnum can fit into int.
4706         (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
4707         Check for integer overflow in size calculations.
4708         (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
4709         avoid mishandling large integers.
4710         * lisp.h: Adjust decls to match defn changes elsewhere.
4711         (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
4712         (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
4713         (struct Lisp_Marker):
4714         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4715         (clip_to_bounds): Now an inline function, moved here from editfns.c.
4716         (GLYPH_CODE_P): Check for overflow in system types, subsuming the
4717         need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
4718         All callers changed.
4719         (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
4720         Assume the arg has valid form, since it always does.
4721         (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
4722         unsigned integer system type.
4723         (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
4724         (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
4725         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4726         (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
4727         (duration_to_sec_usec): New decl.
4728         * lread.c (read_from_string_index, read_from_string_index_byte)
4729         (read_from_string_limit, readchar, unreadchar, openp)
4730         (read_internal_start, read1, oblookup):
4731         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4732         (Fload, readevalloop, Feval_buffer, Feval_region):
4733         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4734         (openp): Check for out-of-range argument to 'access'.
4735         (read1): Use int, not EMACS_INT, where int is wide enough.
4736         Don't assume fixnum fits into int.
4737         Fix off-by-one error that can read outside a buffer.
4738         (read_filtered_event): Use duration_to_sec_usec
4739         to do proper overflow checking on durations.
4740         * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
4741         in size calculation.
4742         (Fexecute_kbd_macro):
4743         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4744         * marker.c (cached_charpos, cached_bytepos, CONSIDER)
4745         (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
4746         (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
4747         (set_marker_both, set_marker_restricted_both, marker_position)
4748         (marker_byte_position, Fbuffer_has_markers_at):
4749         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4750         (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
4751         * menu.c (ensure_menu_items): Rename from grow_menu_items.
4752         It now merely ensures that the menu is large enough, without
4753         necessarily growing it, as this avoids some integer overflow issues.
4754         All callers changed.
4755         (keymap_panes, parse_single_submenu, Fx_popup_menu):
4756         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4757         (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
4758         Use SAFE_ALLOCA_LISP, not alloca.
4759         (find_and_return_menu_selection): Avoid unnecessary casts of pointers
4760         to EMACS_INT.  Check that fixnums are in proper range for system types.
4761         * minibuf.c (minibuf_prompt_width, string_to_object)
4762         (Fminibuffer_contents, Fminibuffer_contents_no_properties)
4763         (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
4764         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4765         (get_minibuffer, read_minibuf_unwind):
4766         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4767         (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
4768         this simplifies overflow checking.  All callers changed.
4769         (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
4770         (Ftest_completion):
4771         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4772         * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
4773         (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
4774         Check that fixnums are in proper range for system types.
4775         (Fx_create_frame, Fx_show_tip):
4776         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4777         * nsfont.m (ns_findfonts, nsfont_list_family):
4778         Don't assume fixnum fits in long.
4779         * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
4780         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4781         (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
4782         wide enough.
4783         * nsselect.m (ns_get_local_selection, clean_local_selection_data):
4784         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4785         * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
4786         (PRINTDECLARE, PRINTPREPARE):
4787         (strout, print_string):
4788         (print, print_preprocess, print_check_string_charset_prop)
4789         (print_object):
4790         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4791         (PRINTDECLARE):
4792         (temp_output_buffer_setup, Fprin1_to_string, print_object):
4793         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4794         (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
4795         (printchar, strout): Use xpalloc to catch size calculation overflow.
4796         (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
4797         (print_error_message): Use SAFE_ALLOCA, not alloca.
4798         (print_object): Use int, not EMACS_INT, where int is wide enough.
4799         (print_depth, new_backquote_output, print_number_index):
4800         Use ptrdiff_t, not int, where int might not be wide enough.
4801         * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
4802         (Fset_process_window_size, Fformat_network_address)
4803         (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
4804         (sigchld_handler):
4805         Check that fixnums are in proper range for system types.
4806         (Fsignal_process): Simplify by avoiding a goto.
4807         Check for process-ids out of pid_t range rather than relying on
4808         undefined behavior.
4809         (process_tick, update_tick): Use EMACS_INT, not int.
4810         (Fformat_network_address, read_process_output, send_process)
4811         (Fprocess_send_region, status_notify):
4812         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4813         (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
4814         (wait_reading_process_output, read_process_output, exec_sentinel):
4815         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4816         (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
4817         (Faccept_process_output): Use duration_to_sec_usec to do proper
4818         overflow checking on durations.
4819         (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
4820         Don't assume pid_t fits in int.
4821         * process.h (struct Lisp_Process): Members tick and update_tick
4822         are now of type EMACS_INT, not int.
4823         * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
4824         configured --with-wide-int.
4825         * scroll.c (calculate_scrolling, calculate_direct_scrolling)
4826         (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
4827         * search.c (looking_at_1, string_match_1):
4828         (fast_string_match, fast_c_string_match_ignore_case)
4829         (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
4830         (scan_newline, find_before_next_newline, search_command)
4831         (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
4832         (set_search_regs, wordify):
4833         (Freplace_match):
4834         (Fmatch_data):
4835         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4836         (string_match_1, search_buffer, set_search_regs):
4837         (Fmatch_data):
4838         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4839         (wordify): Check for overflow in size calculation.
4840         (Freplace_match): Avoid potential buffer overflow in search_regs.start.
4841         (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
4842         Check that fixnums are in proper range for system types.
4843         * sound.c (struct sound_device)
4844         (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
4845         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4846         (Fplay_sound_internal):
4847         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4848         * syntax.c (struct lisp_parse_state, find_start_modiff)
4849         (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
4850         (Fparse_partial_sexp):
4851         Don't assume fixnums can fit in int.
4852         (struct lisp_parse_state, find_start_pos, find_start_value)
4853         (find_start_value_byte, find_start_begv)
4854         (update_syntax_table, char_quoted, dec_bytepos)
4855         (find_defun_start, prev_char_comend_first, back_comment):
4856         (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
4857         (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
4858         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4859         (Finternal_describe_syntax_value): Check that match_lisp is a
4860         character, not an integer, since the code stuffs it into int.
4861         (scan_words, scan_sexps_forward):
4862         Check that fixnums are in proper range for system types.
4863         (Fforward_word):
4864         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4865         (scan_sexps_forward):
4866         Use CHARACTERP, not INTEGERP, since the value must fit into int.
4867         (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
4868         * syntax.h: Adjust decls to match defn changes elsewhere.
4869         (struct gl_state_s):
4870         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4871         (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
4872         MOST_POSITIVE_FIXNUM.
4873         * sysdep.c (wait_for_termination_1, wait_for_termination)
4874         (interruptible_wait_for_termination, mkdir):
4875         Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
4876         (emacs_read, emacs_write):
4877         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4878         (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
4879         and double all fit in int.
4880         * term.c (set_tty_color_mode):
4881         Check that fixnums are in proper range for system types.
4882         * termhooks.h (struct input_event):
4883         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4884         * textprop.c (validate_interval_range, interval_of)
4885         (Fadd_text_properties, set_text_properties_1)
4886         (Fremove_text_properties, Fremove_list_of_text_properties)
4887         (Ftext_property_any, Ftext_property_not_all)
4888         (copy_text_properties, text_property_list, extend_property_ranges)
4889         (verify_interval_modification):
4890         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4891         (Fnext_single_char_property_change)
4892         (Fprevious_single_char_property_change):
4893         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4894         (copy_text_properties):
4895         Check for integer overflow in index calculation.
4896         * undo.c (last_boundary_position, record_point, record_insert)
4897         (record_delete, record_marker_adjustment, record_change)
4898         (record_property_change):
4899         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4900         (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
4901         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4902         * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
4903         (Fx_hide_tip, Fx_file_dialog):
4904         * w32menu.c (set_frame_menubar):
4905         Use ptrdiff_t, not int, for consistency with rest of code.
4906         * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
4907         (select_window, Fdelete_other_windows_internal)
4908         (window_scroll_pixel_based, window_scroll_line_based)
4909         (Frecenter, Fset_window_configuration):
4910         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4911         (Fset_window_hscroll, run_window_configuration_change_hook)
4912         (set_window_buffer, temp_output_buffer_show, scroll_command)
4913         (Fscroll_other_window, Frecenter):
4914         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4915         (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
4916         Don't assume fixnum fits in int.
4917         (Fset_window_scroll_bars):
4918         Check that fixnums are in proper range for system types.
4919         * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
4920         (string_pos, c_string_pos, number_of_chars, init_iterator)
4921         (in_ellipses_for_invisible_text_p, init_from_display_pos)
4922         (compute_stop_pos, next_overlay_change, compute_display_string_pos)
4923         (compute_display_string_end, handle_face_prop)
4924         (face_before_or_after_it_pos, handle_invisible_prop)
4925         (handle_display_prop, handle_display_spec, handle_single_display_spec)
4926         (display_prop_intangible_p, string_buffer_position_lim)
4927         (string_buffer_position, handle_composition_prop, load_overlay_strings)
4928         (get_overlay_strings_1, get_overlay_strings)
4929         (iterate_out_of_display_property, forward_to_next_line_start)
4930         (back_to_previous_visible_line_start, reseat, reseat_to_string)
4931         (get_next_display_element, set_iterator_to_next)
4932         (get_visually_first_element, compute_stop_pos_backwards)
4933         (handle_stop_backwards, next_element_from_buffer)
4934         (move_it_in_display_line_to, move_it_in_display_line)
4935         (move_it_to, move_it_vertically_backward, move_it_by_lines)
4936         (add_to_log, message_dolog, message_log_check_duplicate)
4937         (message2, message2_nolog, message3, message3_nolog
4938         (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
4939         (current_message_1, truncate_echo_area, truncate_message_1)
4940         (set_message, set_message_1, store_mode_line_noprop)
4941         (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
4942         (text_outside_line_unchanged_p, check_point_in_composition)
4943         (reconsider_clip_changes)
4944         (redisplay_internal, set_cursor_from_row, try_scrolling)
4945         (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
4946         (redisplay_window, find_last_unchanged_at_beg_row)
4947         (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
4948         (trailing_whitespace_p, find_row_edges, display_line)
4949         (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
4950         (display_mode_element, store_mode_line_string)
4951         (pint2str, pint2hrstr, decode_mode_spec)
4952         (display_count_lines, display_string, draw_glyphs)
4953         (x_produce_glyphs, x_insert_glyphs)
4954         (rows_from_pos_range, mouse_face_from_buffer_pos)
4955         (fast_find_string_pos, mouse_face_from_string_pos)
4956         (note_mode_line_or_margin_highlight, note_mouse_highlight):
4957         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4958         (safe_call, init_from_display_pos, handle_fontified_prop)
4959         (handle_single_display_spec, load_overlay_strings)
4960         (with_echo_area_buffer, setup_echo_area_for_printing)
4961         (display_echo_area, echo_area_display)
4962         (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
4963         (update_tool_bar, hscroll_window_tree, redisplay_internal)
4964         (redisplay_window, dump_glyph_row, display_mode_line)
4965         (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
4966         (handle_display_spec, display_prop_string_p):
4967         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4968         (handle_single_display_spec, build_desired_tool_bar_string)
4969         (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
4970         (get_specified_cursor_type):
4971         Check that fixnums are in proper range for system types.
4972         (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
4973         (Flookup_image_map):
4974         Don't assume fixnums fit in int.
4975         (compare_overlay_entries):
4976         Avoid mishandling comparisons due to subtraction overflow.
4977         (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
4978         (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
4979         (handle_tool_bar_click):
4980         Use int, not unsigned, since we prefer signed and the signedness
4981         doesn't matter here.
4982         (get_next_display_element, next_element_from_display_vector):
4983         Use int, not EMACS_INT, when int is wide enough.
4984         (start_hourglass): Use duration_to_sec_usec to do proper
4985         overflow checking on durations.
4986         * xfaces.c (Fbitmap_spec_p):
4987         Check that fixnums are in proper range for system types.
4988         (compare_fonts_by_sort_order):
4989         Avoid mishandling comparisons due to subtraction overflow.
4990         (Fx_family_fonts, realize_basic_faces):
4991         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4992         (Fx_family_fonts):
4993         Don't assume fixnum fits in int.
4994         Use SAFE_ALLOCA_LISP, not alloca.
4995         (merge_face_heights): Remove unnecessary cast to EMACS_INT.
4996         (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
4997         (face_at_buffer_position, face_for_overlay_string)
4998         (face_at_string_position):
4999         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5000         (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5001         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5002         (Fx_show_tip):
5003         Check that fixnums are in proper range for system types.
5004         (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5005         (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5006         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5007         (Fx_change_window_property): Don't assume fixnums fit in int.
5008         * xfont.c (xfont_chars_supported):
5009         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5010         * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5011         (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5012         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5013         * xml.c (parse_region):
5014         * xrdb.c (magic_file_p):
5015         Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5016         * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5017         (x_get_local_selection, x_reply_selection_request)
5018         (x_handle_selection_request, wait_for_property_change):
5019         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5020         (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5021         short is wide enough.
5022         (x_send_client_event): Don't assume fixnum fits in int.
5023         * xterm.c (x_x_to_emacs_modifiers):
5024         Don't assume EMACS_INT overflows nicely into int.
5025         (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5026         may come from Lisp.
5027         (handle_one_xevent): NATNUMP can eval its arg twice.
5028         (x_connection_closed):
5029         Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5030         * xterm.h: Adjust decls to match defn changes elsewhere.
5031         (struct scroll_bar): Use struct vectorlike_header
5032         rather than rolling our own approximation.
5033         (SCROLL_BAR_VEC_SIZE): Remove; not used.
5035 2012-05-25  Glenn Morris  <rgm@gnu.org>
5037         * lisp.mk (lisp): Update for more files being compiled now.
5039 2012-05-25  Stefan Monnier  <monnier@iro.umontreal.ca>
5041         * lread.c: Remove `read_pure' which makes no difference.
5042         (read_pure): Remove var.
5043         (unreadpure): Remove function.
5044         (readevalloop): Don't call read_list with -1 flag.
5045         (read1, read_vector): Don't test read_pure any more.
5046         (read_list): Simplify.
5048         * fileio.c, character.h: Minor style tweaks.
5050 2012-05-24  Dmitry Antipov  <dmantipov@yandex.ru>
5052         * window.h (clip_changed): Remove useless declaration.
5054 2012-05-22  Juanma Barranquero  <lekktu@gmail.com>
5056         * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5057         (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5059 2012-05-22  Paul Eggert  <eggert@cs.ucla.edu>
5061         Remove src/m/*.
5062         This directory predates autoconf and is no longer needed nowadays.
5063         Move its few remaining bits of functionality to where they're needed.
5064         * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5065         * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5066         * m/template.h: Remove.
5067         * Makefile.in (M_FILE): Remove.  All uses removed.
5068         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5069         * lisp.h (USE_LSB_TAG):
5070         * mem-limits.h (EXCEEDS_LISP_PTR):
5071         Use VAL_MAX, not VALBITS, in #if.
5072         * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5073         (EMACS_UINT): Define unconditionally now.
5074         (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5075         (BITS_PER_EMACS_INT): New constants, replacing
5076         what used to be in config.h, but not useful in #if.
5077         (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5078         define them any more.
5079         (VAL_MAX): New macro.
5080         (VALMASK): Use it.
5081         * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5082         BITS_PER_EMACS_INT, in #if.
5083         * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5084         (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5085         * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5086         * s/ms-w32.h (DATA_START):
5087         Move here from removed file m/intel386.h.
5088         * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5089         * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5091 2012-05-21  Paul Eggert  <eggert@cs.ucla.edu>
5093         Assume C89 or later.
5094         * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5095         * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5096         (xrealloc):
5097         * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5098         * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5099         * textprop.c, tparam.c (NULL): Remove.
5100         * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5101         * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5102         * regex.h (_RE_ARGS): Remove.  All uses rewritten to use prototypes.
5103         * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5104         * xterm.c (input_signal_count): Assume volatile works.
5106 2012-05-21  Ken Brown  <kbrown@cornell.edu>
5108         * xgselect.c (xg_select): Fix first argument in call to 'select'
5109         (bug#11508).
5111 2012-05-20  Ken Brown  <kbrown@cornell.edu>
5113         * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
5114         [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
5116 2012-05-19  Ken Brown  <kbrown@cornell.edu>
5118         * xfns.c (x_in_use): Remove `static' qualifier.
5119         * xterm.h (x_in_use): Declare.
5120         * xgselect.c: Include xterm.h.
5121         (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5122         and `display_arg' (bug#9754).
5124 2012-05-19  Paul Eggert  <eggert@cs.ucla.edu>
5126         * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5128         * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5129         * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5131 2012-05-18  Eli Zaretskii  <eliz@gnu.org>
5133         Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5135         * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
5136         (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
5138         * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5139         reference to image_cache->refcount.
5140         (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5142 2012-05-17  Juri Linkov  <juri@jurta.org>
5144         * search.c (Fword_search_regexp, Fword_search_backward)
5145         (Fword_search_forward, Fword_search_backward_lax)
5146         (Fword_search_forward_lax): Move functions to isearch.el
5147         (bug#10145, bug#11381).
5149 2012-05-16  Paul Eggert  <eggert@cs.ucla.edu>
5151         * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5153 2012-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
5155         * lread.c (init_obarray): Declare Qt and Qnil as special.
5157 2012-05-14  Glenn Morris  <rgm@gnu.org>
5159         * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
5160         Put "libexec" before "bin", for the sake of init_callproc_1.
5162 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
5164         * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5166         * unexaix.c: Port to more-recent AIX compilers.
5167         (report_error, report_error_1, make_hdr, copy_sym)
5168         (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5169         Make arguments const char *, not char *, to avoid violations of C
5170         standard and to fix some AIX warnings reported by Gilles Pion.
5172 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
5174         * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
5175         already have overlays loaded.
5176         (handle_single_display_spec): Before returning without displaying
5177         fringe bitmap, synchronize the bidi iterator with the main display
5178         iterator, by calling iterate_out_of_display_property.
5179         (iterate_out_of_display_property): Detect buffer iteration by
5180         testing that it->string is a Lisp string.
5181         (get_next_display_element): When the current object is exhausted,
5182         and there's something on it->stack, call set_iterator_to_next to
5183         proceed with what's on the stack, instead of returning zero.
5184         (set_iterator_to_next): If called at the end of a Lisp string,
5185         proceed to consider_string_end without incrementing string
5186         position.  Don't increment display vector index past the end of
5187         the display vector.  (Bug#11417)
5188         (pos_visible_p): Don't report a position visible when move_it_to
5189         stopped at the last line of window, which happens to be scanned
5190         backwards by the bidi iteration.  (Bug#11464)
5192 2012-05-14  Eli Zaretskii  <eliz@gnu.org>
5194         * xdisp.c (handle_single_display_spec): Return 1 for left-margin
5195         and right-margin display specs even if the spec is invalid or we
5196         are on a TTY, and thus unable to display on the fringes.
5197         That's because the text with the property will not be displayed anyway,
5198         so we need to signal to the caller that this is a "replacing"
5199         display spec.  This fixes display when the spec is invalid or we
5200         are on a TTY.
5202 2012-05-14  Paul Eggert  <eggert@cs.ucla.edu>
5204         * unexaix.c (make_hdr): Fix typo in prototype.
5205         This bug broke the build on AIX.  Problem reported by Gilles Pion.
5207 2012-05-14  Michael Albinus  <michael.albinus@gmx.de>
5209         * keyboard.c (kbd_buffer_get_event): Read special events also in
5210         batch mode.  (Bug#11415)
5212 2012-05-12  Glenn Morris  <rgm@gnu.org>
5214         * ns.mk: Update for ns_appbindir no longer having trailing "/".
5216 2012-05-12  Eli Zaretskii  <eliz@gnu.org>
5218         * lisp.mk (lisp): Add newcomment.elc.
5220 2012-05-12  Glenn Morris  <rgm@gnu.org>
5222         * Makefile.in (MKDIR_P): New, set by configure.
5223         * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
5225 2012-05-11  Paul Eggert  <eggert@cs.ucla.edu>
5227         Remove unused function hourglass_started.
5228         * dispextern.h (hourglass_started):
5229         * w32fns.c (hourglass_started):
5230         * xdisp.c (hourglass_started): Remove.
5232 2012-05-10  Juanma Barranquero  <lekktu@gmail.com>
5234         * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
5235         Update dependencies.
5237 2012-05-10  Paul Eggert  <eggert@cs.ucla.edu>
5239         * xgselect.c (xg_select): Put maxfds+1 into a var.
5240         This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
5242         * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
5244 2012-05-10  Dave Abrahams  <dave@boostpro.com>
5246         * filelock.c (syms_of_filelock): New boolean create-lockfiles.
5247         (lock_file): If create_lockfiles is 0, do nothing.  (Bug#11227)
5249 2012-05-09  Michael Albinus  <michael.albinus@gmx.de>
5251         * dbusbind.c (xd_registered_buses): New internal Lisp object.
5252         Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5253         (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
5254         Initialize xd_registered_buses.
5256 2012-05-09  Paul Eggert  <eggert@cs.ucla.edu>
5258         Untag more efficiently if USE_LSB_TAG.
5259         This is based on a proposal by YAMAMOTO Mitsuharu in
5260         <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
5261         For an admittedly artificial (nth 8000 longlist) benchmark on
5262         Fedora 15 x86-64, this yields a 25% CPU speedup.  Also, it shrinks
5263         Emacs's overall text size by 1%.
5264         * lisp.h (XUNTAG): New macro.
5265         (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
5266         (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
5267         (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
5268         * eval.c (Fautoload):
5269         * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
5270         * frame.h (XFRAME): Use XUNTAG.
5272         Port recent dbusbind.c changes to 32-bit --with-wide-int.
5273         * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
5274         Remove unportable assumptions about print widths of types like
5275         dbus_uint32_t.
5276         (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
5277         intptr_t when converting between pointer and integer, to avoid GCC
5278         warnings about wrong width.
5280 2012-05-09  Eli Zaretskii  <eliz@gnu.org>
5282         * w32proc.c (new_child): Force Windows to reserve only 64KB of
5283         stack for each reader_thread, instead of defaulting to 8MB
5284         determined by the linker.  This avoids failures in creating
5285         subprocesses on Windows 7, see the discussion in this thread:
5286         http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
5288 2012-05-07  Jérémy Compostella  <jeremy.compostella@gmail.com>
5290         Fix up display of the *Minibuf-0* buffer in the mini window.
5291         * keyboard.c (read_char): Don't clear the echo area if there's no
5292         message to clear.
5293         * xdisp.c (redisplay_internal): Redisplay the mini window (with the
5294         contents of *Minibuf-0*) if there's no message displayed in its stead.
5296 2012-05-07  Michael Albinus  <michael.albinus@gmx.de>
5298         * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
5299         batch mode.
5301 2012-05-06  Chong Yidong  <cyd@gnu.org>
5303         * lisp.mk (lisp): Update.
5305 2012-05-05  Jim Meyering  <meyering@redhat.com>
5307         * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
5309 2012-05-04  Stefan Monnier  <monnier@iro.umontreal.ca>
5311         * data.c (PUT_ERROR): New macro.
5312         (syms_of_data): Use it.  Add new error type `user-error'.
5313         * undo.c (user_error): New function.
5314         (Fprimitive_undo): Use it.
5315         * print.c (print_error_message): Adjust print style for `user-error'.
5316         * keyboard.c (user_error): New function.
5317         (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
5319 2012-05-03  Paul Eggert  <eggert@cs.ucla.edu>
5321         Do not limit current-time-string to years 1000..9999.
5322         * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
5323         (Fcurrent_time_string): Support any year that is supported by the
5324         underlying localtime representation.  Don't use asctime, as it
5325         has undefined behavior for years outside the range -999..9999.
5327 2012-05-02  Paul Eggert  <eggert@cs.ucla.edu>
5329         Fix race conditions involving setenv, gmtime, localtime, asctime.
5330         Without this fix, interrupts could mess up code that uses these
5331         nonreentrant functions, since setting TZ invalidates existing
5332         tm_zone or tzname values, and since most of these functions return
5333         pointers to static storage.
5334         * editfns.c (format_time_string, Fdecode_time, Fencode_time)
5335         (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
5336         Grow the critical sections to include not just invoking
5337         localtime/gmtime, but also accessing these functions' results
5338         including their tm_zone values if any, and any related TZ setting.
5339         (format_time_string): Last arg is now struct tm *, not struct tm **,
5340         so that the struct tm is saved in the critical section.
5341         All callers changed.  Simplify allocation of initial buffer, partly
5342         motivated by the fact that memory allocation needs to be outside
5343         the critical section.
5345 2012-05-02  Dmitry Antipov  <dmantipov@yandex.ru>
5347         * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
5348         with RESET_INTERVAL.
5350         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
5351         Remove duplicated buffer name initialization.
5353 2012-05-02  Jim Meyering  <jim@meyering.net>
5355         * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
5357         * xfns.c (x_window): Use xstrdup (Bug#11375).
5359 2012-05-02  Eli Zaretskii  <eliz@gnu.org>
5361         * xdisp.c (pos_visible_p): If already at a newline from the
5362         display string before the 'while' loop, don't walk back the glyphs
5363         from it3.glyph_row.  Solves assertion violation when the display
5364         string begins with a newline (egg.el).  (Bug#11367)
5366 2012-05-01  Stefan Monnier  <monnier@iro.umontreal.ca>
5368         * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
5369         Move to simple.el.
5371 2012-05-01  Glenn Morris  <rgm@gnu.org>
5373         * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
5374         s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
5375         and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
5376         All were removed before 23.1.
5378         * dispnew.c: Remove HAVE_LIBNCURSES test;
5379         it is always true on relevant platforms.
5381         * Makefile.in (LD_SWITCH_X_SITE_RPATH):
5382         Rename from LD_SWITCH_X_SITE_AUX_RPATH.
5384         * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
5386 2012-04-30  Andreas Schwab  <schwab@linux-m68k.org>
5388         * .gdbinit (xpr): Remove checks for no longer existing misc types.
5389         (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
5390         Remove.
5392 2012-04-28  Paul Eggert  <eggert@cs.ucla.edu>
5394         Do not avoid creating empty evaporating overlays (Bug#9642).
5395         * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
5396         That is, do not delete an evaporating overlay if it becomes
5397         empty after its bounds are adjusted to fit within its buffer.
5398         This fix caused other problems, and I'm reverting it until we get
5399         to the bottom of them.
5401 2012-04-27  Chong Yidong  <cyd@gnu.org>
5403         * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
5405 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
5407         * xdisp.c (pos_visible_p): If the window start position is beyond
5408         ZV, start the display from buffer beginning.  Prevents assertion
5409         violation in init_iterator when the minibuffer window is scrolled
5410         via the scroll bar.
5412         * window.c (window_scroll_pixel_based): Likewise.
5414 2012-04-27  Chong Yidong  <cyd@gnu.org>
5416         * keymap.c (where_is_internal): Doc fix (Bug#10872).
5418 2012-04-27  Glenn Morris  <rgm@gnu.org>
5420         * fileio.c (Fcopy_file, Fset_file_selinux_context):
5421         Ignore ENOTSUP failures from setfilecon functions.  (Bug#11245)
5423 2012-04-27  Eli Zaretskii  <eliz@gnu.org>
5425         * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
5426         Don't overrun array limits of glyph row's used[] array.  (Bug#11288)
5428 2012-04-26  Eli Zaretskii  <eliz@gnu.org>
5430         * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
5431         display element, check also the underlying string or buffer
5432         character.  (Bug#11341)
5434         * w32menu.c: Include w32heap.h.
5435         (add_menu_item): If the call to AppendMenuW (via
5436         unicode_append_menu) fails, disable Unicode menus only if we are
5437         running on Windows 9X/Me.
5439 2012-04-24  Andreas Schwab  <schwab@linux-m68k.org>
5441         * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
5442         (xgetint): Add missing shift for LSB tags.
5444 2012-04-24  Martin Rudalics  <rudalics@gmx.at>
5446         * keyboard.c (read_char): Don't wipe echo area for select window
5447         events: These might get delayed via `mouse-autoselect-window'
5448         (Bug#11304).
5450 2012-04-24  Juanma Barranquero  <lekktu@gmail.com>
5452         * gnutls.c (init_gnutls_functions): Protect against (unlikely)
5453         manipulation of :loaded-from data.
5455 2012-04-23  Juanma Barranquero  <lekktu@gmail.com>
5457         * gnutls.c (init_gnutls_functions): The value of :loaded-from is
5458         now a cons (bug#11311).
5460 2012-04-23  Paul Eggert  <eggert@cs.ucla.edu>
5462         Do not create empty overlays with the evaporate property (Bug#9642).
5463         * buffer.c (Fmove_overlay): Delete an evaporating overlay
5464         if it becomes empty after its bounds are adjusted to fit within
5465         its buffer.  Without this fix, in a nonempty buffer (let ((o
5466         (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
5467         yields an empty overlay that has the evaporate property, which is
5468         not supposed to happen.
5470         Fix minor GTK3 problems found by static checking.
5471         * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5472         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5473         (struct _EmacsFixedClass, emacs_fixed_get_type):
5474         Move decls here from emacsgtkfixed.h, since they needn't be public.
5475         (emacs_fixed_get_type): Now static.
5476         (emacs_fixed_class_init): Omit unused local.
5477         (emacs_fixed_child_type): Remove; unused.
5478         * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
5479         (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
5480         (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
5481         (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
5482         (EMACS_FIXED_GET_CLASS): Remove; unused.
5483         * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
5485         * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
5486         Problem reported by Juanma Barranquero for Windows -Wunused-function.
5488 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
5490         Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
5491         * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
5492         (__malloc_size_t, __malloc_ptrdiff_t):
5493         Remove.  All uses removed, replaced by the definiens if needed,
5494         since we can assume C89 or better now.
5495         Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
5496         (protect_malloc_state, align, get_contiguous_space)
5497         (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
5498         (malloc_atfork_handler_child, malloc_enable_thread)
5499         (malloc_initialize_1, __malloc_initialize, morecore_nolock)
5500         (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
5501         (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
5502         (special_realloc, _realloc_internal_nolock, _realloc_internal)
5503         (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
5504         (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
5505         Define using prototypes, not old style.
5506         (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
5507         Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
5508         (align): Don't assume that signed integer overflow wraps around.
5509         Omit unused local var.
5510         (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
5511         (_free_internal_nolock, memalign, mallochook, reallochook):
5512         Omit no-longer-needed casts.
5513         (valloc): Use getpagesize, not __getpagesize.
5514         (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
5515         (struct hdr): The 'magic' member is now size_t, not unsigned long.
5517         * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
5519 2012-04-22  Michael Albinus  <michael.albinus@gmx.de>
5521         Move functions from C to Lisp.  Make non-blocking method calls
5522         the default.  Implement further D-Bus standard interfaces.
5524         * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
5525         (QCdbus_request_name_allow_replacement)
5526         (QCdbus_request_name_replace_existing)
5527         (QCdbus_request_name_do_not_queue)
5528         (QCdbus_request_name_reply_primary_owner)
5529         (QCdbus_request_name_reply_in_queue)
5530         (QCdbus_request_name_reply_exists)
5531         (QCdbus_request_name_reply_already_owner): Move to dbus.el.
5532         (QCdbus_registered_serial, QCdbus_registered_method)
5533         (QCdbus_registered_signal): New Lisp objects.
5534         (XD_DEBUG_MESSAGE): Use sizeof.
5535         (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
5536         (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
5537         (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
5538         (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
5539         (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
5540         (xd_signature, xd_append_arg): Allow float for integer types.
5541         (xd_get_connection_references): New function.
5542         (xd_get_connection_address): Rename from xd_initialize.
5543         Return cached address.
5544         (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
5545         (xd_close_bus): Rename from Fdbus_close_bus.  Not needed on Lisp
5546         level.
5547         (Fdbus_init_bus): New optional arg PRIVATE.  Cache address.
5548         Return number of refcounts.
5549         (Fdbus_get_unique_name): Make stronger parameter check.
5550         (Fdbus_message_internal): New defun.
5551         (Fdbus_call_method, Fdbus_call_method_asynchronously)
5552         (Fdbus_method_return_internal, Fdbus_method_error_internal)
5553         (Fdbus_send_signal, Fdbus_register_service)
5554         (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
5555         (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
5556         (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
5557         (Vdbus_compiled_version, Vdbus_runtime_version)
5558         (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
5559         (Vdbus_message_type_method_return, Vdbus_message_type_error)
5560         (Vdbus_message_type_signal): New defvars.
5561         (Vdbus_registered_buses, Vdbus_registered_objects_table):
5562         Adapt docstring.
5564 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
5566         Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
5567         * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
5568         Do not assume ptrdiff_t is the same width as 'int'.
5570         * alloc.c: Handle unusual debugging option combinations.
5571         (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
5572         since the two debugging options are incompatible.
5573         (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
5574         is defined.
5575         (mem_init, mem_insert, mem_insert_fixup):
5576         Define if GC_MARK_STACK || GC_MALLOC_CHECK.
5577         (NEED_MEM_INSERT): Remove; no longer needed.
5579 2012-04-22  Leo Liu  <sdl.web@gmail.com>
5581         * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
5583 2012-04-22  Paul Eggert  <eggert@cs.ucla.edu>
5585         * sysdep.c [__FreeBSD__]: Minor cleanups.
5586         (list_system_processes, system_process_attributes) [__FreeBSD__]:
5587         Use Emacs indenting style more consistently.  Avoid some casts.
5588         Use 'double' consistently rather than mixing 'float' and 'double'.
5590 2012-04-21  Eduard Wiebe  <usenet@pusto.de>
5592         * sysdep.c (list_system_processes, system_process_attributes):
5593         Add implementation for FreeBSD (Bug#5243).
5595 2012-04-21  Andreas Schwab  <schwab@linux-m68k.org>
5597         * lisp.mk (lisp): Update.
5599 2012-04-20  Paul Eggert  <eggert@cs.ucla.edu>
5601         * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
5602         It is never used otherwise.
5604 2012-04-20  Stefan Monnier  <monnier@iro.umontreal.ca>
5606         * print.c (print_preprocess): Only check print_depth if print-circle
5607         is nil.
5608         (print_object): Check for cycles even when print-circle is nil and
5609         print-gensym is t, but only check print_depth if print-circle is nil.
5611 2012-04-20  Chong Yidong  <cyd@gnu.org>
5613         * process.c (wait_reading_process_output): If EIO occurs on a pty,
5614         set the status to "failed" and ensure that sentinel is run.
5616 2012-04-20  Glenn Morris  <rgm@gnu.org>
5618         * process.c (Fset_process_inherit_coding_system_flag)
5619         (Fset_process_query_on_exit_flag): Doc fix (mention return value).
5620         (Fmake_network_process, Fmake_serial_process): Doc fix.
5622 2012-04-20  Eli Zaretskii  <eliz@gnu.org>
5624         * xdisp.c (string_buffer_position_lim): Limit starting position to
5625         BEGV.
5626         (set_cursor_from_row): If called for a mode-line or header-line
5627         row, return zero immediately.
5628         (try_cursor_movement): If inside continuation line, don't back up
5629         farther than the first row after the header line, if any.
5630         Don't consider the header-line row as "partially visible", even if
5631         MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero.  (Bug#11261)
5633 2012-04-20  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
5635         * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
5636         (bug#11238).
5638 2012-04-20  Teodor Zlatanov  <tzz@lifelogs.com>
5639 2012-04-18  Paul Eggert  <eggert@cs.ucla.edu>
5641         configure: new option --enable-gcc-warnings (Bug#11207)
5642         * Makefile.in (C_WARNINGS_SWITCH): Remove.
5643         (WARN_CFLAGS, WERROR_CFLAGS): New macros.
5644         (ALL_CFLAGS): Use new macros rather than old.
5645         * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
5646         * regex.c: Ignore -Wstrict-overflow.  If !emacs, also ignore
5647         -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
5648         -Wunused-result, -Wunused-variable.  This should go away once
5649         the Emacs and Gnulib regex code is merged.
5650         (xmalloc, xrealloc): Now static.
5652 2012-04-17  Paul Eggert  <eggert@cs.ucla.edu>
5654         * dired.c (Fsystem_groups): Remove unused local.
5656 2012-04-17  Glenn Morris  <rgm@gnu.org>
5658         * dired.c (Fsystem_users): Doc fix.
5660 2012-04-17  Dmitry Antipov  <dmantipov@yandex.ru>
5662         * dired.c (Fsystem_users, Fsystem_groups): New functions.  (Bug#7900)
5663         (syms_of_dired): Add them.
5665 2012-04-16  Paul Eggert  <eggert@cs.ucla.edu>
5667         Fix minor alloc.c problems found by static checking.
5668         * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
5669         New extern decls, to avoid calling undeclared functions.
5670         (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
5671         && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
5672         GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
5673         (NEED_MEM_INSERT): New macro.
5674         (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
5675         Remove one incorrect comment and fix another.
5677         Fix minor ralloc.c problems found by static checking.
5678         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5679         * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
5680         (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
5681         (r_alloc_sbrk): Now static.
5683         Improve ralloc.c interface checking.
5684         See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
5685         * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
5686         (r_alloc_free) [REL_ALLOC]: Move decls from here ...
5687         * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
5688         [REL_ALLOC]: ... to here, to check interface.
5689         * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
5690         Remove decls.  This fixes an "It stinks!".
5692         * alloc.c (which_symbols): Fix alignment issue / type clash.
5694 2012-04-15  Andreas Schwab  <schwab@linux-m68k.org>
5696         * lisp.h (struct Lisp_Symbol): Remove explicit padding.
5697         (struct Lisp_Misc_Any): Likewise.
5698         (struct Lisp_Free): Likewise.
5699         * alloc.c (union aligned_Lisp_Symbol): Define.
5700         (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
5701         aligned_Lisp_Symbol instead of struct Lisp_Symbol.
5702         (union aligned_Lisp_Misc): Define.
5703         (MARKER_BLOCK_SIZE, struct marker_block): Use union
5704         aligned_Lisp_Misc instead of union Lisp_Misc.
5705         (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
5707 2012-04-14  Paul Eggert  <eggert@cs.ucla.edu>
5709         Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
5710         * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
5711         * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
5712         * s/netbsd.h, s/sol2-6.h:
5713         Remove definition of GC_MARK_STACK, since the default now works.
5714         * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
5715         Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
5716         no longer the default.
5717         * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
5719 2012-04-14  Atsuo Ohki  <ohki@gssm.otsuka.tsukuba.ac.jp>  (tiny change)
5721         * lread.c (lisp_file_lexically_bound_p):
5722         Fix hang at ";-*-\n" (bug#11238).
5724 2012-04-14  Eli Zaretskii  <eliz@gnu.org>
5726         * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
5727         "unchanged" if its end.pos is beyond ZV.  (Bug#11199)
5729 2012-04-14  Jan Djärv  <jan.h.d@swipnet.se>
5731         * nsterm.m (constrainFrameRect): Always constrain when there is only
5732         one screen (Bug#10962).
5734 2012-04-13  Ken Brown  <kbrown@cornell.edu>
5736         * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
5738 2012-04-13  Reuben Thomas  <rrt@sc3d.org>
5740         * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
5742 2012-04-11  Daniel Colascione  <dancol@dancol.org>
5744         * s/cygwin.h: The vfork the #define in cygwin.h was protecting
5745         against is gone.  It's better to use vfork now so that when Cygwin
5746         gains a new, working vfork, we use it automatically (bug#10398).
5748 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
5750         * window.c (save_window_save): Obey window-point-insertion-type.
5752 2012-04-11  Glenn Morris  <rgm@gnu.org>
5754         * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
5756 2012-04-11  Stefan Monnier  <monnier@iro.umontreal.ca>
5758         * alloc.c (lisp_align_malloc): Remove unneeded prototype.
5760 2012-04-10  Jason S. Cornez  <jcornez@ravenpack.com>  (tiny change)
5762         * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
5763         (force_quit_count): New var.
5764         (handle_interrupt): Use it.
5766 2012-04-10  Juanma Barranquero  <lekktu@gmail.com>
5768         * w32.c (w32_delayed_load): Record the full path of the library
5769         being loaded (bug#10424).
5771 2012-04-09  Glenn Morris  <rgm@gnu.org>
5773         * doc.c (Fsnarf_documentation): Check variables, functions are bound,
5774         not just in the obarray, before snarfing them.  (Bug#11036)
5776         * Makefile.in ($(leimdir)/leim-list.el):
5777         Pass EMACS rather than BUILT_EMACS.
5779 2012-04-09  Teodor Zlatanov  <tzz@lifelogs.com>
5781         * process.c (make_process):
5782         * process.h: Add integer `gnutls_handshakes_tried' member to
5783         process struct.
5785         * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
5786         Add convenience `GNUTLS_LOG2i' macro.
5788         * gnutls.c (gnutls_log_function2i): Convenience log function.
5789         (emacs_gnutls_read): Use new log functions,
5790         `gnutls_handshakes_tried' process member, and
5791         `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
5792         attempts per process (connection).
5794 2012-04-09  Chong Yidong  <cyd@gnu.org>
5796         * eval.c (Fuser_variable_p, user_variable_p_eh)
5797         (lisp_indirect_variable): Functions deleted.
5798         (Fdefvar): Caller changed.
5800         * callint.c (Finteractive, Fcall_interactively):
5801         * minibuf.c (Fread_variable): Callers changed.
5803 2012-04-09  Eli Zaretskii  <eliz@gnu.org>
5805         * xdisp.c (set_cursor_from_row): If the display string appears in
5806         the buffer at position that is closer to point than the position
5807         after the display string, display the cursor on the first glyph of
5808         the display string.  Fixes cursor display when a 'display' text
5809         property immediately follows invisible text.  (Bug#11094)
5811 2012-04-09  Paul Eggert  <eggert@cs.ucla.edu>
5813         composite.c: use 'double' consistently
5814         * composite.c (get_composition_id): Use 'double' consistently
5815         instead of converting 'float' to 'double' and vice versa; this is
5816         easier to understand and avoids a GCC warning.
5818 2012-04-09  Glenn Morris  <rgm@gnu.org>
5820         * Makefile.in: Generate leim-list with bootstrap-emacs, in
5821         preparation for dumping it with emacs.  (Bug#4789)
5822         (leimdir): New variable.
5823         ($(leimdir)/leim-list.el): New rule.
5824         (emacs$(EXEEXT)): Depend on leim-list.el.
5826         * buffer.c (Qucs_set_table_for_input): Remove.  (Bug#9821)
5827         (Fget_buffer_create): Don't call Qucs_set_table_for_input.
5828         (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
5830 2012-04-08  Andreas Schwab  <schwab@linux-m68k.org>
5832         * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
5833         proper alignment.
5835 2012-04-07  Juanma Barranquero  <lekktu@gmail.com>
5837         * xml.c (init_libxml2_functions) [WINDOWSNT]:
5838         Remove unused local variable.
5840 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
5842         Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
5843         * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
5844         (mark_memory): Mark Lisp_Objects only if pointers might hide in
5845         objects, as mark_maybe_pointer will catch them otherwise.
5846         (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
5847         * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
5849 2012-04-07  Paul Eggert  <eggert@cs.ucla.edu>
5851         Fix typo that broke non-Windows builds.
5852         * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
5854 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
5856         Support building on MS-Windows with libxml2.
5858         * makefile.w32-in (OBJ2): Add xml.$(O).
5859         (GLOBAL_SOURCES): Add xml.c.
5860         ($(BLD)/xml.$(O)): New dependency list.
5862         * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
5863         (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
5864         (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
5865         [!WINDOWSNT]: New macros.
5866         (init_libxml2_functions, libxml2_loaded_p): New functions.
5867         (parse_region): Call fn_xmlCheckVersion instead of using the macro
5868         LIBXML_TEST_VERSION.  Call libxml2 functions via the fn_* macros.
5869         (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
5870         Calls xmlCleanupParser only if libxml2 was loaded (or statically
5871         linked in).
5872         (Flibxml_parse_html_region, Flibxml_parse_xml_region):
5873         Call init_libxml2_functions before calling libxml2 functions.
5874         (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
5876         * emacs.c: Don't include libxml/parser.h.
5877         (shut_down_emacs): Call xml_cleanup_parser, instead of calling
5878         xmlCleanupParser directly.
5880         * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
5882 2012-04-07  Eli Zaretskii  <eliz@gnu.org>
5884         * indent.c (Fvertical_motion): If there is a display string at
5885         point, use it.vpos to compute how many lines to backtrack after
5886         move_it_to point.  (Bug#11133)
5888 2012-04-06  Eli Zaretskii  <eliz@gnu.org>
5890         * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
5891         * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
5892         about subtle differences between FETCH_CHAR* and STRING_CHAR*
5893         macros related to unification of CJK characters.  For the details,
5894         see the discussion following the message here:
5895         http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
5897 2012-04-04  Chong Yidong  <cyd@gnu.org>
5899         * keyboard.c (Vdelayed_warnings_list): Doc fix.
5901 2012-04-01  Eli Zaretskii  <eliz@gnu.org>
5903         * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
5904         instead of alloca.  (Bug#11138)
5906 2012-04-01  Andreas Schwab  <schwab@linux-m68k.org>
5908         * w32menu.c (is_simple_dialog): Properly check lisp types.
5909         (Bug#11141)
5911 2012-03-31  Eli Zaretskii  <eliz@gnu.org>
5913         * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
5914         position we get to after a call to move_it_to fails the
5915         IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
5916         only if we wind up in a string from display property.  (Bug#11063)
5918         * window.c (Fdelete_other_windows_internal): Invalidate the row
5919         and column information about mouse highlight, so that redisplay
5920         restores it after reallocating the glyph matrices.  (Bug#7464)
5922         * xdisp.c (set_cursor_from_row): If `cursor' property on a display
5923         string comes from a `display' text property, use the buffer
5924         position of that property as if we actually saw that position in
5925         the row's glyphs.
5926         (move_it_by_lines): Remove the assertion that
5927         "it->current_x == 0 && it->hpos == 0" which can be legitimately
5928         violated when there's a before-string at the beginning of a line.
5929         (Bug#11063)
5931 2012-03-30  Eli Zaretskii  <eliz@gnu.org>
5933         * xdisp.c (append_space_for_newline): If the default face was
5934         remapped, use the remapped face for the appended newline.
5935         (extend_face_to_end_of_line): Use the remapped default face for
5936         extending the face to the end of the line.
5937         (display_line): Call extend_face_to_end_of_line when the default
5938         face was remapped.  (Bug#11068)
5940 2012-03-29  Eli Zaretskii  <eliz@gnu.org>
5942         * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
5944 2012-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
5946         * keyboard.c (safe_run_hooks_error): Don't unquote strings.
5948 2012-03-27  Glenn Morris  <rgm@gnu.org>
5950         * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
5951         Doc fixes.
5953 2012-03-26  Kenichi Handa  <handa@m17n.org>
5955         * dispextern.h (struct glyph): Fix previous change.  Change the
5956         bit length of glyphless.ch to 25 (Bug#11082).
5958 2012-03-26  Chong Yidong  <cyd@gnu.org>
5960         * keyboard.c (Vselection_inhibit_update_commands): New variable.
5961         (command_loop_1): Use it; inhibit selection update for
5962         handle-select-window too (Bug#8996).
5964 2012-03-25  Fabrice Popineau  <fabrice.popineau@supelec.fr>
5966         * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
5968 2012-03-25  Kenichi Handa  <handa@m17n.org>
5970         * dispextern.h (struct glyph): Change the bit length of
5971         glyphless.ch to 22 to make the member glyphless fit in 32 bits.
5973 2012-03-24  Eli Zaretskii  <eliz@gnu.org>
5975         * s/ms-w32.h (tzname): Include time.h before redirecting to
5976         _tzname.  Fixes the MSVC build.  (Bug#9960)
5978 2012-03-24  Andreas Schwab  <schwab@linux-m68k.org>
5980         * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
5981         characters.
5983         * xterm.c (XTread_socket): Only modify handling_signal if
5984         !SYNC_INPUT.  (Bug#11080)
5986 2012-03-23  Eli Zaretskii  <eliz@gnu.org>
5988         * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
5989         FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.  Prevents crashes
5990         when fetching a multibyte character consumes more bytes than
5991         CHAR_BYTES returns, due to unification of CJK characters in
5992         string_char.  (Bug#11073)
5994 2012-03-23  Troels Nielsen  <bn.troels@gmail.com>  (tiny change)
5996         * process.c (wait_reading_process_output): Handle pty disconnect
5997         by refraining from sending oneself a SIGCHLD (bug#10933).
5999 2012-03-22  Chong Yidong  <cyd@gnu.org>
6001         * dispextern.h (struct it): New member string_from_prefix_prop_p.
6003         * xdisp.c (push_prefix_prop): Rename from push_display_prop.
6004         Mark string as coming from a prefix property.
6005         (handle_face_prop): Use default face for prefix strings (Bug#4281).
6006         (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6008 2012-03-21  Chong Yidong  <cyd@gnu.org>
6010         * xfaces.c (Vface_remapping_alist): Doc fix.
6012 2012-03-20  Eli Zaretskii  <eliz@gnu.org>
6014         * w32proc.c (Fw32_set_console_codepage)
6015         (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6016         Doc fixes.
6018 2012-03-20  Chong Yidong  <cyd@gnu.org>
6020         * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6021         to reflect default non-nil value of redisplay-dont-pause.
6023 2012-03-19  Kenichi Handa  <handa@m17n.org>
6025         * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6026         it fit in a valid range (Bug#11003).
6028 2012-03-18  Eli Zaretskii  <eliz@gnu.org>
6030         * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6031         that is not from display property, accept the row as a "cursor
6032         row" if one of the string's character has a non-nil `cursor'
6033         property.  Fixes cursor positioning when there are newlines in
6034         overlay strings, e.g. in icomplete.el.  (Bug#11035)
6036 2012-03-12  Paul Eggert  <eggert@cs.ucla.edu>
6038         * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6040 2012-03-12  Chong Yidong  <cyd@gnu.org>
6042         * eval.c (inhibit_lisp_code): Rename from
6043         inhibit_window_configuration_change_hook; move from window.c.
6045         * xfns.c (unwind_create_frame_1, Fx_create_frame):
6046         * window.c (run_window_configuration_change_hook)
6047         (syms_of_window): Callers changed.
6049 2012-03-11  Chong Yidong  <cyd@gnu.org>
6051         * keymap.c (Fkey_description): Doc fix (Bug#9700).
6053         * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6055 2012-03-10  Chong Yidong  <cyd@gnu.org>
6057         * frame.c (other_visible_frames): Don't assume the selected frame
6058         is visible (Bug#10955).
6060 2012-03-09  Stefan Monnier  <monnier@iro.umontreal.ca>
6062         * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6064 2012-03-08  Jan Djärv  <jan.h.d@swipnet.se>
6066         * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6067         FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6068         zero (Bug#10954).
6070 2012-03-03  Glenn Morris  <rgm@gnu.org>
6072         * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
6074 2012-03-02  Eli Zaretskii  <eliz@gnu.org>
6076         * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6077         position past the first glyph_row that ends at ZV.  (Bug#10902)
6078         (redisplay_window, next_element_from_string): Fix typos in
6079         comments.
6080         (redisplay_window): Pass to move_it_vertically the margin in
6081         pixels, not in screen lines.
6083 2012-03-02  Glenn Morris  <rgm@gnu.org>
6085         * buffer.c (buffer-list-update-hook): Doc fix.
6087 2012-02-29  Eli Zaretskii  <eliz@gnu.org>
6089         * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6090         push_it before setting up the iterator for the first overlay
6091         string, even if we have an empty string loaded.
6092         (next_overlay_string): If there's an empty string on the iterator
6093         stack, pop the stack.  (Bug#10903)
6095 2012-02-25  Paul Eggert  <eggert@cs.ucla.edu>
6097         Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6098         Suggested by Stefan Monnier in
6099         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6100         * alloc.c (widen_to_Lisp_Object): New static function.
6101         (mark_memory): Also mark Lisp_Objects by fetching pointer words
6102         and widening them to Lisp_Objects.  This would work even if
6103         USE_LSB_TAG is defined and wide integers are used, which might
6104         happen in a future version of Emacs.
6106 2012-02-25  Chong Yidong  <cyd@gnu.org>
6108         * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6109         Doc fix.
6111         * xselect.c (Fx_selection_exists_p): Doc fix.
6112         (x_clipboard_manager_save_all): Print an informative message
6113         before saving to clipboard manager.
6115 2012-02-24  Chong Yidong  <cyd@gnu.org>
6117         * keyboard.c (process_special_events): Handle all X selection
6118         requests in kbd_buffer, not just the next one (Bug#8869).
6120 2012-02-23  Chong Yidong  <cyd@gnu.org>
6122         * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6123         call when setting menu-bar-lines and tool-bar-lines parameters.
6124         (unwind_create_frame_1): New helper function.
6126         * window.c (inhibit_window_configuration_change_hook): New var.
6127         (run_window_configuration_change_hook): Obey it.
6128         (syms_of_window): Initialize it.
6130 2012-02-22  Chong Yidong  <cyd@gnu.org>
6132         * xterm.c (x_draw_image_relief): Add missing type check for
6133         Vtool_bar_button_margin (Bug#10743).
6135 2012-02-21  Chong Yidong  <cyd@gnu.org>
6137         * fileio.c (Vfile_name_handler_alist): Doc fix.
6139         * buffer.c (Fget_file_buffer): Protect against invalid file
6140         handler return value.
6142 2012-02-20  Paul Eggert  <eggert@cs.ucla.edu>
6144         * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6145         when computing $valmask.
6147         Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6148         * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6149         (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6150         It's useless in that case, and it can cause problems on hosts
6151         that allocate halves of EMACS_INT values separately.
6152         Reported by Dan Horák.  Diagnosed by Andreas Schwab in
6153         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6154         * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6155         UINTPTR_MAX >> VALBITS == 0.  This is required by the above change;
6156         it avoids undefined behavior on hosts where shifting right by more
6157         than the word width has undefined behavior.
6159 2012-02-19  Chong Yidong  <cyd@gnu.org>
6161         * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6162         (Funhandled_file_name_directory, Ffile_name_as_directory)
6163         (Fdirectory_file_name, Fexpand_file_name)
6164         (Fsubstitute_in_file_name): Protect against invalid file handler
6165         return values (Bug#10845).
6167 2012-02-18  Eli Zaretskii  <eliz@gnu.org>
6169         * .gdbinit (pitx): Fix incorrect references to fields of the
6170         iterator stack.
6172 2012-02-17  Chong Yidong  <cyd@gnu.org>
6174         * syntax.c (Fscan_lists): Doc fix (Bug#10833).
6176 2012-02-15  Paul Eggert  <eggert@cs.ucla.edu>
6178         * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
6179         <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
6181 2012-02-15  Chong Yidong  <cyd@gnu.org>
6183         * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
6184         marked as special.  Also, starting docstrings with * is obsolete.
6186 2012-02-13  Andreas Schwab  <schwab@linux-m68k.org>
6188         * gnutls.c (emacs_gnutls_write): Fix last change.
6190 2012-02-13  Lars Ingebrigtsen  <larsi@gnus.org>
6192         * gnutls.c (emacs_gnutls_write): Set errno appropriately for
6193         send_process.
6195 2012-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
6197         * keymap.c (Fsingle_key_description): Handle char ranges.
6199 2012-02-12  Chong Yidong  <cyd@gnu.org>
6201         * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
6202         as that creates a dangerous corner case.
6204         * window.c (Fdelete_window_internal): Invalidate the mouse
6205         highlight (Bug#9904).
6207 2012-02-12  Glenn Morris  <rgm@gnu.org>
6209         * xselect.c (Fx_own_selection_internal)
6210         (Fx_get_selection_internal, Fx_disown_selection_internal)
6211         (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6212         * nsselect.m (Fx_own_selection_internal)
6213         (Fx_disown_selection_internal, Fx_selection_exists_p)
6214         (Fx_selection_owner_p, Fx_get_selection_internal):
6215         Sync docs and argument specs with the xselect.c versions.
6217 2012-02-11  Lars Ingebrigtsen  <larsi@gnus.org>
6219         * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
6221 2012-02-11  Eli Zaretskii  <eliz@gnu.org>
6223         * w32select.c (Fx_selection_exists_p): Sync doc string and
6224         argument list with xselect.c.  (Bug#10783)
6226         * w16select.c (Fx_selection_exists_p): Sync doc string and
6227         argument list with xselect.c.  (Bug#10783)
6229 2012-02-10  Glenn Morris  <rgm@gnu.org>
6231         * fns.c (Fsecure_hash): Doc fix.
6233 2012-02-09  Kenichi Handa  <handa@m17n.org>
6235         * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
6237 2012-02-07  Chong Yidong  <cyd@gnu.org>
6239         * buffer.c (Fbuffer_local_variables)
6240         (buffer_lisp_local_variables): Handle unbound vars correctly;
6241         don't let Qunbound leak into Lisp.
6243 2012-02-07  Glenn Morris  <rgm@gnu.org>
6245         * image.c (Fimagemagick_types): Doc fix.
6247         * image.c (imagemagick-render-type): Change it from a lisp object
6248         to an integer.  Move the doc here from the lisp manual.
6249         Treat all values not equal to 0 the same.
6251 2012-02-06  Chong Yidong  <cyd@gnu.org>
6253         * doc.c (store_function_docstring): Avoid applying docstring of
6254         alias to base function (Bug#2603).
6256 2012-02-04  Andreas Schwab  <schwab@linux-m68k.org>
6258         * .gdbinit (pp1, pv1): Remove redundant defines.
6259         (pr): Use pp.
6261 2012-02-04  Chong Yidong  <cyd@gnu.org>
6263         * nsterm.m: Declare a global (Bug#10694).
6265 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
6267         * w32.c (get_emacs_configuration_options):
6268         Include --enable-checking, if specified, in the return value.
6270 2012-02-04  Martin Rudalics  <rudalics@gmx.at>
6272         * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
6273         after rounding frame sizes.  (Bug#9723)
6275 2012-02-04  Eli Zaretskii  <eliz@gnu.org>
6277         * keyboard.c (adjust_point_for_property): Don't position point
6278         before BEGV.  (Bug#10696)
6280 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
6282         Handle overflow when computing char display width (Bug#9496).
6283         * character.c (char_width): Return EMACS_INT, not int.
6284         (char_width, c_string_width): Check for overflow when
6285         computing the width; this is possible now that individual
6286         characters can have unbounded width.  Problem introduced
6287         by merge from Emacs 23 on 2012-01-19.
6289 2012-02-02  Michael Albinus  <michael.albinus@gmx.de>
6291         * dbusbind.c (Fdbus_register_method): Mention the return value
6292         :ignore in the docstring.
6294 2012-02-02  Glenn Morris  <rgm@gnu.org>
6296         * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
6298         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6299         Unconditionally set to t.  (Bug#10673)
6300         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6301         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6302         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
6304 2012-02-02  Kenichi Handa  <handa@m17n.org>
6306         (x_produce_glyphs): Cancel previous change.  If cmp->glyph_len is
6307         0, do not call append_composite_glyph.
6309 2012-02-02  Kenichi Handa  <handa@m17n.org>
6311         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
6312         NULL (Bug#6988).
6313         (x_produce_glyphs): If the component of a composition is a null
6314         string, set it->pixel_width to 1 to avoid zero-width glyph.
6316 2012-02-01  Eli Zaretskii  <eliz@gnu.org>
6318         * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
6319         first 2 arguments are identical.  This makes inserting large
6320         output from a subprocess an order of magnitude faster on
6321         MS-Windows, where all sbrk'ed memory is always contiguous.
6323 2012-01-31  Glenn Morris  <rgm@gnu.org>
6325         * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6326         * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6327         * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
6329 2012-01-29  Glenn Morris  <rgm@gnu.org>
6331         * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
6333 2012-01-28  Samuel Thibault  <sthibault@debian.org>  (tiny change)
6335         * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
6337 2012-01-28  Chong Yidong  <cyd@gnu.org>
6339         * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
6341 2012-01-26  Chong Yidong  <cyd@gnu.org>
6343         * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
6345         * search.c (Fsearch_forward, Fsearch_backward): Document negative
6346         repeat counts (Bug#10507).
6348 2012-01-26  Glenn Morris  <rgm@gnu.org>
6350         * lread.c (syms_of_lread): Doc fix.
6352 2012-01-25  HIROSHI OOTA  <nil@mad.dog.cx>  (tiny change)
6354         * coding.c (encode_designation_at_bol): Change return value to
6355         EMACS_INT.
6357 2012-01-25  Chong Yidong  <cyd@gnu.org>
6359         * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
6361 2012-01-21  Chong Yidong  <cyd@gnu.org>
6363         * floatfns.c (Fcopysign): Make the second argument non-optional,
6364         since nil is not allowed anyway.
6366 2012-01-21  Andreas Schwab  <schwab@linux-m68k.org>
6368         * process.c (read_process_output): Use p instead of XPROCESS (proc).
6369         (send_process): Likewise.
6371 2012-01-19  Martin Rudalics  <rudalics@gmx.at>
6373         * window.c (save_window_save, Fcurrent_window_configuration)
6374         (Vwindow_persistent_parameters): Do not use Qstate.
6375         Rewrite doc-strings.
6377 2012-01-19  Kenichi Handa  <handa@m17n.org>
6379         * character.c (char_width): New function.
6380         (Fchar_width, c_string_width, lisp_string_width):
6381         Use char_width (Bug#9496).
6383 2012-01-16  Martin Rudalics  <rudalics@gmx.at>
6385         * window.c (Vwindow_persistent_parameters): New variable.
6386         (Fset_window_configuration, save_window_save): Handle persistent
6387         window parameters.
6389 2012-01-14  Eli Zaretskii  <eliz@gnu.org>
6391         * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
6392         thrashing the stack of the thread.  (Bug#9087)
6394 2012-01-12  Paul Eggert  <eggert@cs.ucla.edu>
6396         * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
6398 2012-01-11  Eli Zaretskii  <eliz@gnu.org>
6400         * xdisp.c (rows_from_pos_range): Handle the case where the
6401         highlight ends on a newline.  (Bug#10464)
6402         (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
6403         he end column for display of highlight that ends on a newline
6404         before a R2L line.
6406 2012-01-11  Glenn Morris  <rgm@gnu.org>
6408         * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
6409         from load-path also when installation-directory is nil.  (Bug#10208)
6411 2012-01-10  Glenn Morris  <rgm@gnu.org>
6413         * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
6415         * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
6416         Update template values to be closer to their typical values these days.
6418 2012-01-09  Eli Zaretskii  <eliz@gnu.org>
6420         * xdisp.c (rows_from_pos_range): Accept additional argument
6421         DISP_STRING, and accept any glyph in a row whose object is that
6422         string as eligible for mouse highlight.  Fixes mouse highlight of
6423         display strings from overlays.  (Bug#10464)
6425 2012-01-07  Paul Eggert  <eggert@cs.ucla.edu>
6427         emacs: fix an auto-save permissions race condition (Bug#10400)
6428         * fileio.c (auto_saving_dir_umask): New static var.
6429         (Fmake_directory_internal): Use it.
6430         (do_auto_save_make_dir): Set it, instead of invoking chmod after
6431         creating the directory.  The old code temporarily assigns
6432         too-generous permissions to the directory.
6433         (do_auto_save_eh): Clear it.
6434         (Fdo_auto_save): Catch all errors, not just file errors, so
6435         that the var is always cleared.
6437 2012-01-07  Eli Zaretskii  <eliz@gnu.org>
6439         * search.c (scan_buffer): Pass character positions to
6440         know_region_cache, not byte positions.  (Bug#6540)
6442 2012-01-07  LynX  <_LynX@bk.ru>  (tiny change)
6444         * w32.c (sys_rename): Report EXDEV when rename of a directory
6445         fails because the target is on another logical disk.  (Bug#10284)
6447 2012-01-07  David Benjamin  <davidben@mit.edu>  (tiny change)
6449         * xterm.c (x_embed_request_focus): New function.
6451         * xterm.h: Add prototype.
6453         * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
6455 2012-01-05  Glenn Morris  <rgm@gnu.org>
6457         * emacs.c (emacs_copyright): Update short copyright year to 2012.
6459 2012-01-01  Eli Zaretskii  <eliz@gnu.org>
6461         * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
6462         Load gnutls_transport_set_lowat only if GnuTLS version is below
6463         2.11.1.
6464         (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
6465         GnuTLS versions below 2.11.1.
6467 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
6469         * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
6470         to the doc string advising against its use for altering the way
6471         windows are scrolled.
6473 2011-12-28  Kenichi Handa  <handa@m17n.org>
6475         * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
6476         coding-system ASCII compatible only when it does not produce BOM
6477         on encoding (Bug#10383).
6479 2011-12-26  Jan Djärv  <jan.h.d@swipnet.se>
6481         * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
6482         can scroll.
6483         (create_and_show_popup_menu): Always use menu_position_func for
6484         Gtk3 (Bug#10361).
6486 2011-12-24  Andreas Schwab  <schwab@linux-m68k.org>
6488         * callint.c (Fcall_interactively): Don't truncate prompt string.
6490 2011-12-23  Eli Zaretskii  <eliz@gnu.org>
6492         * xdisp.c (handle_invisible_prop): Handle correctly an invisible
6493         property that ends at ZV, so that the bidi iteration could be
6494         resumed from there (after widening).  (Bug#10360)
6496 2011-12-22  Jan Djärv  <jan.h.d@swipnet.se>
6498         * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
6500 2011-12-21  Jan Djärv  <jan.h.d@swipnet.se>
6502         * nsterm.m (x_free_frame_resources):
6503         Release f->output_data.ns->miniimage.
6504         (ns_index_color): Fix indentation.  Do not retain
6505         color_table->colors[i].
6507         * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
6508         before returning.
6510         * nsfns.m (x_set_background_color): Assign return value from
6511         ns_index_color to face-background instead of NSColor*.
6512         (ns_implicitly_set_icon_type): Fix indentation.
6513         Change assignment in for loop to comparison.
6515         * emacs.c (ns_pool): New variable.
6516         (main): Assign ns_pool.
6517         (Fkill_emacs): Call ns_release_autorelease_pool.
6519         * nsfont.m (ns_spec_to_descriptor): Fix indentation,
6520         autorelease fdesc, release fdAttrs and tdict.
6521         (ns_get_covering_families): Release charset.
6522         (ns_findfonts): Release NSFontDescriptor created with new.
6523         (ns_uni_to_glyphs): Fix indentation.
6524         (setString): Release attrStr before assigning new value.
6526 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
6528         * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
6529         and NS_IMPL_COCOA.
6530         (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
6531         (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
6533 2011-12-18  David Reitter  <reitter@cmu.edu>
6535         * nsterm.m (ns_term_init): Subscribe for notifications
6536         NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
6537         to method trackingNotification in EmacsMenu.
6539         * nsmenu.m (trackingMenu): New variable.
6540         (trackingNotification): New method (from Aquamacs).
6541         (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
6542         from Aquamacs (Bug#7030).
6544 2011-12-18  Jan Djärv  <jan.h.d@swipnet.se>
6546         * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
6547         (symbol_to_nsstring): Fix indentation.
6548         (ns_symbol_to_pb): New function.
6549         (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
6550         (Fns_rotate_cut_buffers_internal): Remove.
6551         (Fns_store_selection_internal): Rename from
6552         Fns_store_cut_buffer_internal.
6553         (ns_get_foreign_selection, Fx_own_selection_internal)
6554         (Fx_disown_selection_internal, Fx_selection_exists_p)
6555         (Fns_get_selection_internal, Fns_store_selection_internal):
6556         Use ns_symbol_to_pb and check if return value is nil.
6557         (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT.  Remove defsubr
6558         Sns_rotate_cut_buffers_internal.  Sns_get_cut_buffer_internal
6559         renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
6560         renamed to Sns_store_selection_internal.
6561         (ns_handle_selection_request): Move code to Fx_own_selection_internal
6562         and remove this function.
6563         (ns_handle_selection_clear): Remove, never used.
6564         (Fx_own_selection_internal): Move code from ns_handle_selection_request
6565         here.
6567 2011-12-17  Ken Brown  <kbrown@cornell.edu>
6569         * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
6570         GID is unknown (Bug#10257).
6572 2011-12-17  Paul Eggert  <eggert@cs.ucla.edu>
6574         * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
6575         (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
6576         which caused a build failure on GNU/Linux IA-64.  This problem was
6577         introduced by my 2011-10-07 patch.
6579 2011-12-15  Juri Linkov  <juri@jurta.org>
6581         * image.c (imagemagick_error): New function.  (Bug#10112)
6582         (imagemagick_load_image): Comment out `MagickSetResolution' call.
6583         Use `imagemagick_error' where ImageMagick functions return
6584         `MagickFalse'.
6585         (Fimagemagick_types): Add `Fnreverse' to return the list in the
6586         proper order.
6588 2011-12-15  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
6590         * xftfont.c (xftfont_draw): Use the font metrics of s->font to
6591         fill background (Bug#8992).
6593 2011-12-13  Martin Rudalics  <rudalics@gmx.at>
6595         * window.c (Vwindow_combination_resize)
6596         (Vwindow_combination_limit): Use t instead of non-nil in
6597         doc-strings.
6598         (Vrecenter_redisplay): Add first sentence of doc-string on
6599         separate line.
6600         (Frecenter): Fix doc-string typo.
6602 2011-12-11  Kenichi Handa  <handa@m17n.org>
6604         * coding.c (Funencodable_char_position): Pay attention to the
6605         buffer text relocation (Bug#9389).
6607 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
6609         * xterm.c (x_term_init): Move call to gdk_window_add_filter before
6610         gtk_init (Bug#10100).
6612 2011-12-10  Eli Zaretskii  <eliz@gnu.org>
6614         * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
6615         IT->string is nil.  (Bug#10263)
6617 2011-12-10  Jan Djärv  <jan.h.d@swipnet.se>
6619         * nsterm.h (x_free_frame_resources): Declare.
6621         * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
6622         (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
6624         * nsterm.h (ns_get_defaults_value): Declare.
6626         * nsterm.m (ns_default): Call ns_get_defaults_value.
6628 2011-12-09  Eli Zaretskii  <eliz@gnu.org>
6630         * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
6631         (Bug#10170)
6633 2011-12-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
6635         * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
6636         that where the value of an _OBJC_* symbol points to is in the .bss
6637         section (Bug#10240).
6639 2011-12-08  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
6641         * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
6642         after the loop to call ccl_driver at least once (Bug#8619).
6644 2011-12-08  Kenichi Handa  <handa@m17n.org>
6646         * ftfont.c (get_adstyle_property): Fix previous change
6647         (Bug#10233).
6649 2011-12-07  Juanma Barranquero  <lekktu@gmail.com>
6651         * w32.c (init_environment): If no_site_lisp, remove site-lisp
6652         dirs from the default value of EMACSLOADPATH (bug#10208).
6654 2011-12-07  Glenn Morris  <rgm@gnu.org>
6656         * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
6657         installation and source directories as well.  (Bug#10208)
6659 2011-12-06  Chong Yidong  <cyd@gnu.org>
6661         * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
6663 2011-12-06  Glenn Morris  <rgm@gnu.org>
6665         * process.c (start_process_unwind): Treat any pid <= 0, except -2,
6666         as an error, not just -1.  (Bug#10217)
6668 2011-12-05  Chong Yidong  <cyd@gnu.org>
6670         * keyboard.c (process_special_events): New function.
6671         (swallow_events, Finput_pending_p): Use it (Bug#10195).
6673 2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
6675         * coding.c (encode_designation_at_bol): Don't use uninitialized
6676         local variable (Bug#9318).
6678 2011-12-05  Kenichi Handa  <handa@m17n.org>
6680         * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
6681         return Qnil (Bug#8046, Bug#10193).
6683 2011-12-05  Kenichi Handa  <handa@m17n.org>
6685         * coding.c (encode_designation_at_bol): New args charbuf_end and
6686         dst.  Return the number of produced bytes.  Callers changed.
6687         (coding_set_source): Return how many bytes coding->source was
6688         relocated.
6689         (coding_set_destination): Return how many bytes
6690         coding->destination was relocated.
6691         (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
6692         (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
6694 2011-12-05  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
6696         * coding.c (CODING_CHAR_CHARSET_P): New macro.
6697         (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
6698         macro (Bug#9318).
6700 2011-12-05  Andreas Schwab  <schwab@linux-m68k.org>
6702         The following changes are to fix Bug#9318.
6704         * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
6705         (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
6706         (encode_coding_iso_2022, encode_coding_sjis)
6707         (encode_coding_big5, encode_coding_charset): Use the above macros.
6709 2011-12-05  Juanma Barranquero  <lekktu@gmail.com>
6711         * lisp.h (process_quit_flag): Fix external declaration.
6713 2011-12-04  Stefan Monnier  <monnier@iro.umontreal.ca>
6715         Don't macro-inline non-performance-critical code.
6716         * eval.c (process_quit_flag): New function.
6717         * lisp.h (QUIT): Use it.
6719 2011-12-04  Jan Djärv  <jan.h.d@swipnet.se>
6721         * nsfns.m (get_geometry_from_preferences): New function.
6722         (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
6724 2011-12-04  Andreas Schwab  <schwab@linux-m68k.org>
6726         * emacs.c (Qkill_emacs): Define.
6727         (syms_of_emacs): Initialize it.
6728         * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
6729         Qquit_flag to `kill-emacs' instead.
6730         (quit_throw_to_read_char): Add parameter `from_signal'.
6731         All callers changed.  Call Fkill_emacs if requested and safe.
6732         * lisp.h (QUIT): Call Fkill_emacs if requested.
6734 2011-12-03  Jan Djärv  <jan.h.d@swipnet.se>
6736         * widget.c (update_wm_hints): Return if wmshell is null.
6737         (widget_update_wm_size_hints): New function.
6739         * widget.h (widget_update_wm_size_hints): Declare.
6741         * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
6742         widget_update_wm_size_hints (Bug#10104).
6744 2011-12-03  Eli Zaretskii  <eliz@gnu.org>
6746         * xdisp.c (handle_invisible_prop): If the invisible text ends just
6747         before a newline, prepare the bidi iterator for consuming the
6748         newline, and keep the current paragraph direction.  (Bug#10183)
6749         (redisplay_window): Don't let `margin' become negative.  (Bug#10192)
6751 2011-12-02  Juri Linkov  <juri@jurta.org>
6753         * search.c (Fword_search_regexp): New Lisp function created from
6754         `wordify'.  Change type of arg `lax' from `int' to `Lisp_Object'.
6755         (Fword_search_backward, Fword_search_forward)
6756         (Fword_search_backward_lax, Fword_search_forward_lax):
6757         Use `Fword_search_regexp' instead of `wordify'.  Doc fix.
6758         (syms_of_search): Define `Sword_search_regexp'.  (Bug#10145)
6760 2011-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
6762         * fileio.c (Finsert_file_contents): Move after-change-function call
6763         to before the "handled:" label, since all "goto handled" appear in
6764         cases where the *-change-functions have already been properly called
6765         (bug#10117).
6767 2011-12-01  Andreas Schwab  <schwab@linux-m68k.org>
6769         * keyboard.c (interrupt_signal): Don't call kill-emacs when
6770         waiting for input.  (Bug#10169)
6772 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
6774         * dispnew.c (adjust_glyph_matrix): Remove the assertion that
6775         verifies glyph row's hash code--we have just reallocated the
6776         glyphs, so their contents can be complete garbage.  (Bug#10164)
6778 2011-11-30  Juanma Barranquero  <lekktu@gmail.com>
6780         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
6782 2011-11-30  Eli Zaretskii  <eliz@gnu.org>
6784         * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
6785         attributes are tested _before_ calling verify_row_hash, to protect
6786         against GCC re-ordering of the tests.  (Bug#10164)
6788 2011-11-29  Jan Djärv  <jan.h.d@swipnet.se>
6790         * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
6792         * xterm.c (handle_one_xevent): Only set async_visible and friends
6793         if net_wm_state_hidden_seen is non-zero (Bug#10002)
6794         (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
6795         _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
6797 2011-11-28  Paul Eggert  <eggert@cs.ucla.edu>
6799         Remove GCPRO-related macros that exist only to avoid shadowing locals.
6800         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
6801         (GCPRO6_VAR, UNGCPRO_VAR): Remove.  See
6802         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6803         All uses changed to use GCPRO1 etc.
6804         (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
6805         Revert to old implementation (i.e., before 2011-03-11).
6807 2011-11-28  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
6809         * dispnew.c (scrolling_window): Truncate overlaps in copy destination
6810         of scroll runs so as to avoid assigning disabled bogus rows and
6811         unnecessary graphics copy operations.
6813 2011-11-27  Eli Zaretskii  <eliz@gnu.org>
6815         * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
6816         (snprintf) [_MSC_VER]: Redirect to _snprintf.
6817         (strtoll) [_MSC_VER]: Redirect to _strtoi64.
6818         (malloc, free, realloc, calloc): Redirect to e_* only when
6819         compiling Emacs.
6821         * lisp.h (GCTYPEBITS): Move before first use.
6822         (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
6823         (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
6824         this macro definition.
6826         * s/ms-w32.h (tzname): Redirect to _tzname for all values of
6827         _MSC_VER.
6829 2011-11-27  Jan Djärv  <jan.h.d@swipnet.se>
6831         * gtkutil.c (xg_create_frame_widgets):
6832         Call gtk_window_set_has_resize_grip (FALSE) if that function is
6833         present with Gtk+ 2.0.
6835 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
6837         * fileio.c (Finsert_file_contents): Undo previous change; see
6838         <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
6840 2011-11-26  Paul Eggert  <eggert@cs.ucla.edu>
6842         Rename locals to avoid shadowing.
6843         * fileio.c (Finsert_file_contents):
6844         Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
6845         * process.c (wait_reading_process_output):
6846         Rename inner 'proc' to 'p' to avoid shadowing.
6847         Indent for consistency with usual Emacs style.
6849 2011-11-25  Eli Zaretskii  <eliz@gnu.org>
6851         * xdisp.c (redisplay_window): If cursor row is not fully visible
6852         after recentering, and scroll-conservatively is set to a large
6853         number, scroll window by a few more lines to make the cursor fully
6854         visible and out of scroll-margin.  (Bug#10105)
6855         (start_display): Don't move to the next line if the display should
6856         start at a newline that is part of a display vector or an overlay
6857         string.  (Bug#10119)
6859 2011-11-24  Juri Linkov  <juri@jurta.org>
6861         * image.c (imagemagick_load_image): Move `MagickSetResolution' down
6862         after the `MagickPingImage' call.  (Bug#10112)
6864 2011-11-23  Chong Yidong  <cyd@gnu.org>
6866         * window.c (Fcoordinates_in_window_p): Accept only live windows.
6868 2011-11-23  Martin Rudalics  <rudalics@gmx.at>
6870         * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
6871         making another buffer current.  (Bug#10114)
6873 2011-11-23  Glenn Morris  <rgm@gnu.org>
6875         * font.c (font_find_for_lface) [HAVE_NS]: Ignore case.  (Bug#2526)
6877 2011-11-23  Chong Yidong  <cyd@gnu.org>
6879         * xdisp.c (compute_stop_pos): Check validity of end_charpos before
6880         using it (Bug#5984).
6882 2011-11-22  Eli Zaretskii  <eliz@gnu.org>
6884         * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
6885         and header-lines, as they don't have one computed for them.
6886         (Bug#10098)
6888         * .gdbinit (prow): Make displayed values more self-explaining.
6889         Add row's hash code.
6891 2011-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
6893         * process.c (wait_reading_process_output): Fix asynchrounous
6894         GnuTLS socket handling on some versions of the GnuTLS library.
6895         (wait_reading_process_output): Add comment and URL.
6897 2011-11-21  Jan Djärv  <jan.h.d@swipnet.se>
6899         * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
6901 2011-11-21  Chong Yidong  <cyd@gnu.org>
6903         * window.c (Fnext_window, Fprevious_window): Doc fix.
6905 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
6907         * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
6909 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
6911         * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
6913 2011-11-20  Martin Rudalics  <rudalics@gmx.at>
6915         * window.c (Fset_window_combination_limit): Rename argument
6916         STATUS to LIMIT.
6917         (Vwindow_combination_limit): Remove "status" from doc-string.
6919 2011-11-20  Andreas Schwab  <schwab@linux-m68k.org>
6921         * m/ibms390.h: Remove.
6922         * m/ibms390x.h: Don't include "ibms390.h".
6924 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
6926         * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
6927         Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
6929 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
6931         * casetab.c (Fset_case_table):
6932         * charset.c (Fcharset_after): Fix typos.
6934 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
6936         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
6937         Otherwise, valgrind does not work on some platforms.
6938         Problem reported by Andreas Schwab in
6939         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
6940         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
6941         is set, removing the need for VIRT_ADDRESS_VARIES.
6942         (PURE_P): Use a more-efficient implementation that needs just one
6943         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
6944         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
6945         to 4 (xorl, subq, cmpq, setbe).
6946         * alloc.c (pure): Always extern now, since that's the
6947         VIRT_ADDR_VARIES behavior.
6948         (PURE_POINTER_P): Use a single comparison, not two, for
6949         consistency with the new puresize.h.
6950         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
6951         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
6952         Remove VIRT_ADDR_VARIES no longer needed.
6954 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
6956         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
6957         (erase_phys_cursor, update_window_cursor, show_mouse_face)
6958         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
6959         behave as if the cursor position were at the window margin.
6961         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
6962         and the cursor position is out of bounds, behave as if the cursor
6963         position were at the window margin.  (Bug#10075)
6965 2011-11-18  Chong Yidong  <cyd@gnu.org>
6967         * window.c (Fwindow_combination_limit): Make first argument
6968         non-optional, since it is meaningless for live windows like the
6969         selected window.
6971 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
6973         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
6975 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
6977         * intervals.c: Fix grafting over the whole buffer (bug#10071).
6978         (graft_intervals_into_buffer): Simplify.
6980 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
6982         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
6983         hash values of the two rows.
6984         (copy_row_except_pointers): Preserve the used[] arrays and the
6985         hash values of the two rows.  (Bug#10035)
6986         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
6988         * xdisp.c (row_hash): New function, body extracted from
6989         compute_line_metrics.
6990         (compute_line_metrics): Call row_hash, instead of computing the
6991         hash code inline.
6993         * dispnew.c (verify_row_hash): Call row_hash for computing the
6994         hash code of a row, instead of duplicating code from xdisp.c.
6996         * dispextern.h (row_hash): Add prototype.
6998 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
7000         * frame.c (delete_frame): Don't delete the terminal when the last
7001         X frame is closed if emacs is built with GTK toolkit.
7003 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
7005         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7007 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
7009         * window.c (Vwindow_splits): Rename to
7010         Vwindow_combination_resize.  Suggested by Juri Linkov.
7011         (Fsplit_window_internal): Use Vwindow_combination_resize instead
7012         of Vwindow_splits.
7014 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
7016         * nsfns.m (Fns_font_name):
7017         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
7019 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
7021         * window.h (window): Rename slot "nest" to "combination_limit".
7022         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7023         (Fset_window_nest): Rename to Fset_window_combination_limit.
7024         (Vwindow_nest): Rename to Vwindow_combination_limit.
7025         (recombine_windows, make_parent_window, make_window)
7026         (Fsplit_window_internal, saved_window)
7027         (Fset_window_configuration, save_window_save): Rename all
7028         occurrences of window_nest to window_combination_limit.
7030 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
7032         * image.c (imagemagick_load_image): Fix typo.
7034 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
7036         * xdisp.c (display_line): Move the call to
7037         highlight_trailing_whitespace before the call to
7038         compute_line_metrics, since the latter needs to see the final
7039         faces of all the glyphs to compute ROW's hash value.
7040         Fixes assertion violations in row_equal_p.  (Bug#10035)
7042 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
7044         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7045         just return (bug#10044).
7047 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
7049         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7050         with user-defined heap size.  Bump the default size of the temacs
7051         heap to 27MB, to avoid memory warning when running temacs.
7052         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7054         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7055         current_matrix and desired_matrix.  (Bug#9990)
7056         (verify_row_hash) [XASSERTS]: New function.
7057         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7058         that the hash value of glyph rows is correct.
7060 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
7062         * window.h (window): Remove splits slot.
7063         * window.c (Fwindow_splits, Fset_window_splits): Remove.
7064         (Fdelete_other_windows_internal, make_parent_window)
7065         (make_window, Fsplit_window_internal, Fdelete_window_internal)
7066         (Fset_window_configuration, save_window_save): Don't deal with
7067         split status of windows.
7068         (saved_window): Remove splits slot.
7069         (Vwindow_splits): Rewrite doc-string.
7071 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
7073         * xfns.c (unwind_create_frame):
7074         * nsfns.m (unwind_create_frame):
7075         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7076         Vframe_list (Bug#9999).
7078 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
7080         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
7082 2011-11-11  Kenichi Handa  <handa@m17n.org>
7084         * callproc.c (Fcall_process): Set the member dst_multibyte of
7085         process_coding.
7087 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
7089         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7090         avoid a crash (bug#9496).
7092 2011-11-09  Chong Yidong  <cyd@gnu.org>
7094         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7095         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7097 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
7099         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7101 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
7103         Avoid some portability problems by eschewing 'extern inline' functions.
7104         The trivial performance wins aren't worth the portability hassles; see
7105         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7106         et seq.
7107         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7108         (window_box_width, window_box_left, window_box_left_offset)
7109         (window_box_right, window_box_right_offset): Undo previous change,
7110         by removing the "extern"s.
7111         * intervals.c (adjust_intervals_for_insertion)
7112         (adjust_intervals_for_deletion): Undo previous change,
7113         making these static again.
7114         (offset_intervals, temp_set_point_both, temp_set_point)
7115         (copy_intervals_to_string): No longer inline.
7116         * xdisp.c (window_text_bottom_y, window_box_width)
7117         (window_box_height, window_box_left_offset)
7118         (window_box_right_offset, window_box_left, window_box_right)
7119         (window_box): No longer inline.
7121 2011-11-08  Chong Yidong  <cyd@gnu.org>
7123         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
7124         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7125         Signal an error if not a live window.
7126         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7127         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7129 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
7131         * lisp.h (syms_of_abbrev): Remove declaration.
7132         Reported by CHENG Gao <chenggao@royau.me>.
7134 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
7136         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7137         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
7138         of temacs in GUI mode.
7140 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
7142         * window.h: Declare delete_all_child_windows instead of
7143         delete_all_subwindows.
7144         * window.c (Fwindow_nest, Fset_window_nest)
7145         (Fset_window_new_total, Fset_window_new_normal)
7146         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7147         (delete_all_subwindows): Rename to delete_all_child_windows.
7148         (Fdelete_other_windows_internal, Fset_window_configuration):
7149         Call delete_all_child_windows instead of delete_all_subwindows.
7150         * frame.c (delete_frame): Call delete_all_child_windows instead
7151         of delete_all_subwindows.
7153 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
7155         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7156         This is also needed for porting to any host where GC_MARK_STACK is
7157         not GC_MAKE_GCPROS_NOOPS.
7158         (which_symbols): Use it.
7160 2011-11-07  Kenichi Handa  <handa@m17n.org>
7162         * coding.c (coding_set_destination): Check coding->src_pos only
7163         when coding->src_object is a buffer (bug#9910).
7165         * process.c (send_process): Set the member src_multibyte of coding
7166         to 0 (bug#9911) when sending a unibyte text.
7168         * callproc.c (Fcall_process): Set the member src_multibyte of
7169         process_coding to 0 (bug#9912).
7171 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
7173         * xmenu.c (cleanup_widget_value_tree): New function.
7174         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
7175         calling free_menubar_widget_value_tree directly (Bug#9830).
7177 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
7179         Fix some portability problems with 'inline'.
7180         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7181         (window_box_width, window_box_left, window_box_left_offset)
7182         (window_box_right, window_box_right_offset): Declare extern.
7183         Otherwise, these inline functions do not conform to C99 and
7184         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
7185         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
7186         * intervals.c (adjust_intervals_for_insertion)
7187         (adjust_intervals_for_deletion): Now extern, because otherwise the
7188         extern inline functions 'offset_intervals' couldn't refer to it.
7189         (static_offset_intervals): Remove.
7190         (offset_intervals): Rewrite using the old contents of
7191         static_offset_intervals.  The old version didn't conform to C99
7192         because an extern inline function contained a reference to an
7193         identifier with static linkage.
7195 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
7197         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
7198         GC.
7200 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
7202         * xdisp.c (init_iterator, reseat_to_string): Don't set the
7203         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
7204         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
7205         return Qleft_to_right.
7207 2011-11-06  Chong Yidong  <cyd@gnu.org>
7209         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
7210         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
7211         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
7212         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
7213         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
7214         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
7215         (Fwindow_vscroll): Doc fix.
7216         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
7217         argument, since it makes no sense to pass a live window and for
7218         consistency with window-child.
7220 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
7222         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
7223         support MSVC.
7225 2011-11-05  Jason Rumney  <jasonr@gnu.org>
7227         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
7228         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
7229         fonts (Bug#6029).
7230         (add_font_entity_to_list): Fix logic errors in mixed boolean and
7231         bitwise arithmetic preventing use of unicode-sip and non-truetype
7232         opentype fonts.
7234 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
7236         * s/ms-w32.h (fstat, stat, utime): Move redirections to
7237         "emacs"-only part.
7239         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
7240         initialization code to keep similarity to xfns.c after changes
7241         from 2011-11-05.
7243 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
7245         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
7246         (unwind_create_frame): New function (Bug#9943).
7247         (Fx_create_frame): Restructure code to be more similar to the one in
7248         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
7249         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
7250         Move terminal->reference_count++ just before making the frame official
7251         (Bug#9943).
7253         * nsterm.m (x_free_frame_resources): New function.
7254         (x_destroy_window): Move code to x_free_frame_resources.
7256         * xfns.c (unwind_create_frame): Fix comment.
7257         (Fx_create_frame, x_create_tip_frame):
7258         Move terminal->reference_count++ just before making the frame
7259         official.  Move initialization of image_cache_refcount and
7260         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
7262 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
7264         Support MSVC build with newer versions of Visual Studio.
7265         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
7266         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
7267         nt/gmake.defs.
7269         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
7270         which are not supported by MSVC.
7271         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
7272         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
7273         bitfields.
7274         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
7275         types in bitfields.
7276         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
7278         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
7280 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
7282         Support MSVC build with newer versions of Visual Studio.
7283         * w32.c: Don't include w32api.h for MSVC.
7284         (init_environment) [_MSC_VER]: Call sys_access, not _access.
7286         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
7287         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
7288         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
7289         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
7290         e_* cousins.
7291         (alloca) [_MSC_VER]: Define to _alloca.
7293         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
7295         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
7297 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
7299         * xdisp.c (note_mouse_highlight): If either of
7300         previous/next-single-property-change returns nil, treat that as
7301         the beginning or the end of the buffer.  (Bug#9955)
7303 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
7305         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
7306         label is not null (Bug#9951).
7307         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
7308         may be NULL.
7310 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
7312         * window.c (Fwindow_body_size): Mention in the doc string that the
7313         return value is in frame's canonical units.  (Bug#9949)
7315 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
7317         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
7319         * w32fns.c (unwind_create_frame): If needed, free the glyph
7320         matrices of the partially constructed frame.  (Bug#9943)
7321         * xfns.c (unwind_create_frame): Likewise.
7323 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
7325         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
7326         Don't stop backward scan on the continuation glyph, even though
7327         its CHARPOS is positive.
7328         (mouse_face_from_buffer_pos, note_mouse_highlight):
7329         Rename cover_string to disp_string.
7331 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
7333         * window.c (temp_output_buffer_show): Don't use
7334         Vtemp_buffer_show_specifiers.
7335         (Vtemp_buffer_show_specifiers): Remove unused variable.
7337 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
7339         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
7340         past the beginning of the current glyph matrix.
7342 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
7344         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
7345         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
7346         HAVE_GTK3 (Bug#9869).
7348         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
7349         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
7351         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
7353         * xterm.c: Declare x_handle_net_wm_state to return int.
7354         (handle_one_xevent): Check if we are iconified but don't have
7355         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
7356         (get_current_wm_state): Return non-zero if not hidden,
7357         check for _NET_WM_STATE_HIDDEN (Bug#9893).
7358         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
7359         (x_handle_net_wm_state): Return what get_current_wm_state returns.
7360         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
7362 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
7364         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
7365         so that this new function doesn't get optimized away by a
7366         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
7368 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
7370         * frame.h (MOUSE_HL_INFO): Remove excess parens.
7372 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
7374         Fix the `xbytecode' command.
7375         * .gdbinit (xprintbytestr): New command.
7376         (xwhichsymbols): Rename from `which'; all callers changed.
7377         (xbytecode): Print the byte-code string as well.
7379 2011-10-29  Kim Storm  <storm@cua.dk>
7381         * alloc.c (which_symbols): New function.
7383 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
7385         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
7386         line.  (Bug#9903)
7388 2011-10-29  Glenn Morris  <rgm@gnu.org>
7390         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
7391         Not clear what it was for, and it causes various bugs.  (Bug#9839)
7393 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
7395         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
7396         possible random value that matches one of those tested as
7397         condition to clear the mouse face.
7399 2011-10-28  Chong Yidong  <cyd@gnu.org>
7401         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
7403 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
7405         * window.c (make_window): Initialize phys_cursor_on_p.
7407 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
7409         * lisp.h (struct Lisp_Symbol): Update comments.
7411 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
7413         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
7415 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
7417         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
7418         <oslsachem@gmail.com> for helping to debug this.
7420         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
7421         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
7422         (g_b_init_get_glyph_outline_w): New static variables.
7423         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
7424         (GetGlyphOutlineW_Proc): New typedefs.
7425         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
7426         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
7427         New functions.
7428         (w32font_open_internal, compute_metrics):
7429         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
7430         instead of calling the "wide" APIs directly.
7432         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
7434         * w32.h (syms_of_w32font): Add prototype.
7436 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
7438         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
7439         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
7440         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
7441         (Fmove_to_window_line): Doc fix.
7443 2011-10-27  Chong Yidong  <cyd@gnu.org>
7445         * process.c (make_process): Set gnutls_state to NULL.
7447         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
7448         non-NULL, regardless of GNUTLS_INITSTAGE.
7449         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
7450         an error.  Set process slots as soon as we allocate them.
7452         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
7454 2011-10-27  Chong Yidong  <cyd@gnu.org>
7456         * gnutls.c (emacs_gnutls_deinit): New function.
7457         Deallocate credentials structures as well as calling gnutls_deinit.
7458         (Fgnutls_deinit, Fgnutls_boot): Use it.
7460         * process.c (make_process): Initialize GnuTLS credentials to NULL.
7461         (deactivate_process): Call emacs_gnutls_deinit.
7463 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
7465         * image.c (x_create_x_image_and_pixmap):
7466         * w32.c (sys_rename, w32_delayed_load):
7467         * w32font.c (fill_in_logfont):
7468         * w32reg.c (x_get_string_resource): Silence compiler warnings.
7470 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
7472         * w32fns.c (w32_default_color_map): New function,
7473         extracted from Fw32_default_color_map.
7474         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
7476 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
7478         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
7480 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
7482         * keyboard.c (test_undefined): New function (bug#9751).
7483         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
7485 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
7487         * sysdep.c (init_sys_modes): Fix the check for the controlling
7488         terminal (Bug#6649).
7490 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
7492         * dispextern.h (struct bidi_it): New member next_en_type.
7494         * bidi.c (bidi_line_init): Initialize the next_en_type member.
7495         (bidi_resolve_explicit_1): When next_en_pos is valid for the
7496         current character, check also for next_en_type being WEAK_EN.
7497         (bidi_resolve_weak): Don't enter the expensive loop if the current
7498         position is before next_en_pos.  Record the bidi type of the first
7499         non-ET, non-BN character we find, in addition to its position.
7500         (bidi_level_of_next_char): Invalidate next_en_type when
7501         next_en_pos is over-stepped.
7503 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
7505         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
7506         * editfns.c: Rewrite current-time-zone so that it invokes
7507         the equivalent of (format-time-string "%Z") to get the time zone name.
7508         This fixes a bug when the time zone name contains characters that
7509         need converting from the system time locale to Emacs internal format.
7510         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
7511         that patch fixed format-time-string to do the conversion, but
7512         I forgot to fix current-time-zone.
7513         (format_time_string): New function, containing most of
7514         what Fformat_time_string used to contain.
7515         (Fformat_time_string): Rewrite in terms of format_time_string.
7516         This doesn't change this function's behavior.
7517         (current-time-zone): Rewrite to use format_time_string.
7518         This fixes the bug reported by Michael Schierl in
7519         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
7520         Jason Rumney's 2007-06-07 change worked around this bug, but
7521         didn't fix it.
7522         * systime.h (tzname, timezone): Remove no-longer-used declarations.
7524 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
7526         * xdisp.c (start_display): If the character at POS is displayed
7527         via a display vector, reset IT->current.dpvec_index to zero.
7528         (try_window_reusing_current_matrix): If a line ends in a display
7529         vector or the next line starts in a display vector, continue
7530         redrawing the window even though the character position of
7531         start_row was reached.
7532         (Bug#9771, part 2)
7534 2011-10-18  Chong Yidong  <cyd@gnu.org>
7536         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
7537         with nobreak-char-display too.
7539 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
7541         Fix part 3 of bug#9771.
7542         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
7543         (bidi_resolve_neutral): Don't enter the expensive loop looking for
7544         non-neutral characters if the current character is a paragraph
7545         separator (a.k.a. Newline).  This avoids running the same
7546         expensive loop twice, once when we consume the preceding newline
7547         and the other time when the line actually needs to be displayed.
7548         Avoid the loop when we see neutrals on the base embedding level
7549         following a character whose directionality is the same as the
7550         paragraph's.  This avoids running the expensive loop when a line
7551         ends in a long sequence of neutrals, like control characters.
7552         Add assertion against STRONG_AL type.  Slightly rearrange code
7553         that determines the type of a neutral given the first non-neutral
7554         that follows it.
7555         (bidi_level_of_next_char): Set next_en_pos to zero when
7556         invalidating its info.
7558 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
7560         * xdisp.c (push_display_prop): Determine whether to record string
7561         or buffer position by IT->string, not by IT->method.  Allow
7562         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
7563         (move_it_vertically_backward): Don't look for character position
7564         immediately after the newline when in a continuation line.
7565         (Bug#9771, part 1)
7567 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
7569         * window.c (coordinates_in_window): Rewrite and delabelize
7570         vertical border check.  (Bug#5357) (Bug#9618)
7572 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
7574         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
7575         errors in XSetWindowBorder (bug#9310).
7577 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
7579         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
7580         avoid crash when xmalloc overrun checking is enabled.
7582 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
7584         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
7585         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
7586         cursor motion with <left> and <right> arrow keys.
7588         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
7589         some callers set that themselves.
7591 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
7593         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
7594         display string and the previous row comes from the same string and
7595         is empty.  (Bug#9739)  (Bug#9738)
7597 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
7599         * doc.c (get_doc_string): Encode file name (bug#9735).
7601 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
7603         * bidi.c (bidi_level_of_next_char):
7604         * xdisp.c (get_visually_first_element): Remove old incorrect
7605         comments regarding the Unicode Line Separator character.
7607         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
7609 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
7611         * alloc.c (Fgc_status): Do not access beyond zombies array
7612         boundary if nzombies > MAX_ZOMBIES.
7613         * alloc.c (dump_zombies): Add missing format specifier.
7615 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
7617         * xdisp.c (set_cursor_from_row): Simplify conditionals,
7618         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
7620         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
7621         Some packages use them to denote characters with modifiers.
7623 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
7625         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
7626         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
7627         matching a pp-number.  Rename parameter var to var1.
7629 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
7631         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
7633 2011-10-08  Glenn Morris  <rgm@gnu.org>
7635         * callint.c (Fcall_interactively): Give a more explicit error for the
7636         'c' case with a non-character input.  (Bug#8479)
7638 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
7640         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
7641         lines.
7642         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
7643         lines that are hscrolled on the left.
7645         * dispnew.c (buffer_posn_from_coords): Account for a possible
7646         presence of header-line.  (Bug#4426)
7648 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
7650         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
7651         Don't advertise functionality which we discourage or doesn't work.
7653 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
7655         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
7656         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
7657         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
7658         this makes Emacs dump core during garbage collection on rare
7659         occasions.  sizeof is obviously inferior to offsetof here, so
7660         stick with offsetof.
7661         (GC_POINTER_ALIGNMENT): New macro.
7662         (mark_memory): Omit 3rd (offset) arg; caller changed.
7663         Don't assume EMACS_INT alignment is the same as pointer alignment.
7665 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
7667         * keyboard.c (read_key_sequence_remapped): New var.
7668         (read_key_sequence): Compute remapping in the right buffer.
7669         (command_loop_1): Use read_key_sequence's remapping directly.
7671 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
7673         * dired.c (file_name_completion): Don't expand file name.
7674         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
7675         before checking file name handler.
7677         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
7678         they've been requested explicitly (bug#9591).
7680 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
7682         * keymap.c (Fsingle_key_description): Use make_specified_string
7683         instead of build_string to build string from push_key_description.
7684         (Bug#5193)
7686 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
7688         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
7689         This fixes a Y2038 bug on 64-bit hosts.
7690         * buffer.c (reset_buffer):
7691         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
7692         (Fclear_buffer_auto_save_failure):
7693         Use 0, not -1, to represent an unset failure time, since time_t
7694         might not be signed.
7696         Remove dependency on glibc malloc internals.
7697         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7698         Move back here from lisp.h, but with their new implementations.
7699         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7700         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
7701         * charset.c (charset_table_init): New static var.
7702         (syms_of_charset): Use it instead of xmalloc.  This removes a
7703         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
7704         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
7705         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7706         Move back to alloc.c.
7707         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7708         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
7710 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
7712         * nsterm.m (windowDidResize): Call x_set_window_size only when
7713         ns_in_resize is true.  Otherwise set pixelwidth/height and
7714         call change_frame_size (Bug#9628).
7716 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
7718         Port --enable-checking=all to Fedora 14 x86-64.
7719         * charset.c (syms_of_charset): Also account for glibc malloc's
7720         internal overhead when calculating the initial malloc maximum.
7722         Port --enable-checking=all to Fedora 14 x86.
7723         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7724         Move to lisp.h.
7725         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
7726         (overrun_check_realloc, overrun_check_free):
7727         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
7728         That way, xmalloc returns a properly-aligned pointer even if
7729         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
7730         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
7731         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
7732         into account when calculating the initial malloc maximum.
7733         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
7734         Move here from alloc.c, so that charset.c can use it too.
7735         Properly align; the old code wasn't right for common 32-bit hosts
7736         when configured with --enable-checking=all.
7737         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
7738         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
7740 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
7742         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
7743         use EDOM.
7745 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
7747         * xdisp.c (compute_display_string_end): If there's no display
7748         string at CHARPOS, return -1.
7750         * bidi.c (bidi_fetch_char): When compute_display_string_end
7751         returns a negative value, treat the character as a normal
7752         character not covered by a display string.  (Bug#9624)
7754 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
7756         * lread.c (Fread_from_string): Fix typo in docstring.
7758 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
7760         * xdisp.c (handle_invisible_prop): If invisible text ends on a
7761         newline, reseat the iterator instead of bidi-iterating there one
7762         character at a time.  (Bug#9610)
7763         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
7764         TO_CHARPOS if the bidi iterator is at base embedding level.
7766 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
7768         * lread.c (readevalloop): Use correct code for NBSP.
7769         (read1): Likewise.  (Bug#9608)
7771 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
7773         * dbusbind.c (Fdbus_register_signal): When service is not
7774         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
7776 2011-09-25  Glenn Morris  <rgm@gnu.org>
7778         * buffer.c (truncate-lines): Doc fix.
7780 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
7782         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
7783         (Fset_window_next_buffers): Doc fix.
7785 2011-09-24  Glenn Morris  <rgm@gnu.org>
7787         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
7789 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
7791         Fix minor problems found by static checking.
7792         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
7793         * indent.c (Fvertical_motion): Fix == vs = typo.
7795 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
7797         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
7798         Default value is now t.  Doc fix.
7800         * indent.c (Fvertical_motion): Compute and apply the overshoot
7801         logic when moving up, not only when moving down.  Fix the
7802         confusing name and values of the it_overshoot_expected variable;
7803         logic changes accordingly.  (Bug#9254) (Bug#9549)
7805         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
7806         CHARPOS is covered by a display string which includes newlines.
7807         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
7808         is covered by a display string with embedded newlines.
7810 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
7812         * dbusbind.c (Fdbus_register_signal): Add match rule to
7813         Vdbus_registered_objects_table.  (Bug#9581)
7814         (Fdbus_register_method, Vdbus_registered_objects_table):
7815         Fix docstring.
7817 2011-09-24  Jim Meyering  <meyering@redhat.com>
7819         do not ignore write error for any output size
7820         The previous change was incomplete.
7821         While it makes emacs --batch detect the vast majority of stdout
7822         write failures, errors were still ignored whenever the output size is
7823         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
7824           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
7825               && echo FAIL: ignored write error
7826           FAIL: ignored write error
7827           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
7828               && echo FAIL: ignored write error
7829           FAIL: ignored write error
7830         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
7832 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
7834         * emacs.c (Fkill_emacs): In noninteractive mode exit
7835         non-successfully if a write error occurred on stdout.  (Bug#9574)
7837 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
7839         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
7840         the xassert test.
7842         * dispextern.h (struct it): Update the comment documenting what
7843         can it->OBJECT be.
7845 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
7847         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
7848         a display string, extend search for cursor position to end of row.
7849         (find_row_edges): If the row ends in a newline from a display
7850         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
7851         Handle the case of a display string with multiple newlines.
7852         (Fcurrent_bidi_paragraph_direction): Fix search for previous
7853         non-empty line.  Fixes confusing cursor motion with arrow keys at
7854         the beginning of a line that starts with whitespace.
7856 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
7858         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
7859         (bug#9493).
7861 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
7863         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
7864         boolean (Bug#9154).
7866 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
7868         * xdisp.c (display_line): Record maximum and minimum buffer
7869         positions even if no glyphs were produced (e.g., by a zero-width
7870         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
7871         buffer positions that will be removed from the glyph row because
7872         they don't fit.
7873         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
7874         column is beyond frame width: don't subtract 1 "pixel" when
7875         computing width of the stretch.
7876         (reseat_at_next_visible_line_start): Undo the change made on
7877         2011-09-17 that saved paragraph information and restored it after
7878         the call to `reseat'.  (Bug#9545)
7880 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
7882         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
7883         and turn window cursor on if cleared (Bug#9415).
7885 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
7887         * search.c (boyer_moore): Take unibyte characters from pattern
7888         literally.  (Bug#9458)
7890 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
7892         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
7894 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
7896         Fix minor problem found by static checking.
7897         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
7898         initialized, to pacify gcc -Wuninitialized.
7900         * fileio.c: Report proper errno when syscall falls.
7901         (Finsert_file_contents): Save and restore errno,
7902         so that report_file_error outputs the correct diagnostic.
7903         (Fwrite_region) [CLASH_DETECTION]: Likewise.
7905 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
7907         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
7909 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
7911         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
7912         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
7914 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
7916         * xdisp.c (reseat_at_next_visible_line_start): Keep information
7917         about the current paragraph and restore it after the call to reseat.
7919         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
7920         (bidi_find_paragraph_start): Search back for paragraph beginning
7921         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
7922         (bidi_move_to_visually_next): Only trigger paragraph-related
7923         computations when the last character is a newline or at EOB, not
7924         just any NEUTRAL_B.  (Bug#9470)
7926         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
7927         truncated lines if point is covered by a display string.  (Bug#9524)
7929 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
7931         * xselect.c: Relax test for outgoing X longs (Bug#9498).
7932         (cons_to_x_long): New function.
7933         (lisp_data_to_selection_data): Use it.  Correct the test for
7934         short-versus-long data; it was negated.  Break out of vector
7935         loop, for efficiency, when a long datum is discovered.
7937 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
7939         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
7941 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
7943         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
7944         GCC PR/17406) by declaring this function with external scope.
7946 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
7948         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
7949         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
7951 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
7953         * editfns.c (Fformat): Correctly handle text properties on "%%".
7955 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
7957         * xterm.c (x_draw_composite_glyph_string_foreground):
7958         * w32term.c (x_draw_composite_glyph_string_foreground):
7959         * term.c (encode_terminal_code):
7960         * composite.c (composition_update_it, get_composition_id):
7961         * xdisp.c (get_next_display_element)
7962         (fill_composite_glyph_string): Add comments about special meaning
7963         of TAB characters in a composition.
7965 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
7967         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
7968         This occurs when processing a multibyte format.
7969         Problem reported by Wolfgang Jenker.
7971 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
7973         * xdisp.c (try_cursor_movement): Only check for exact match if
7974         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
7976 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
7978         Remove unused external symbols.
7979         * dispextern.h (calc_pixel_width_or_height): Remove decl.
7980         * xdisp.c (calc_pixel_width_or_height): Now static.
7981         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
7982         * indent.c (check_display_width):
7983         * w32term.c: Fix comment to match code.
7984         * xterm.c, xterm.h (x_catching_errors): Remove.
7986 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
7988         * xselect.c: Use signed conversions more consistently (Bug#9498).
7989         (selection_data_to_lisp_data): Assume incoming selection data are
7990         signed integers, not unsigned.  This is to be consistent with
7991         outgoing selection data, which was modified to use signed integers
7992         in as part of the fix to Bug#9196 in response to Jan D.'s comment
7993         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
7994         expects long, not unsigned long.
7996 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
7998         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
7999         computation of loop end.  Reported by Johan Bockgård
8000         <bojohan@gnu.org>.
8002 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
8004         * frame.c (Fother_visible_frames_p): Function deleted.
8006 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
8008         * indent.c (compute_motion): Process display vector front to back
8009         rather than the other way around.  (Bug#2496)
8011 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
8013         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8015 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
8017         * minibuf.c (Fread_from_minibuffer): Doc fix.
8019 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
8021         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8022         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
8024 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8026         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8027         value for non-existent files.
8029 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
8031         * fileio.c (Finsert_file_contents): If the file cannot be opened,
8032         set its "size" to -1.  This will set the modtime_size field of
8033         the corresponding buffer to -1, which is what
8034         verify-visited-file-modtime expects for files that do not exist.
8035         (Bug#9139)
8037 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
8039         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8040         here ...
8041         * lisp.h: ... from here.  push_key_description is no longer
8042         defined in keyboard.c, so its declaration should not be in
8043         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8044         logically belongs with push_key_description.
8046 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
8048         * buffer.h: Include <sys/types.h> instead of <time.h>.
8049         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8050         Problem reported by Herbert J. Skuhra.
8052 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8054         * xml.c (parse_region): Make the parsing work for
8055         non-comment-starting XML files again (bug#9144).
8057 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
8059         * image.c (gif_load): Fix calculation of bottom and right corner.
8060         (Bug#9468)
8062 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
8064         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
8065         redisplay in small windows.
8067 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
8069         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8071 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
8073         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8074         Operate on live windows only.
8076 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
8078         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8080 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
8082         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8083         only under bidi iteration.
8085 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
8087         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8089 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
8091         isnan: Fix porting problem to Solaris 10 with bundled gcc.
8092         Without this fix, the command to link temacs failed due to an
8093         undefined symbol __builtin_isnan.  This is because
8094         /usr/include/iso/math_c99.h #defines isnan(x) to
8095         __builtin_isnan(x), but the bundled gcc, which identifies itself
8096         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8097         a __builtin_isnan.
8098         * floatfns.c (isnan): #undef, and then #define to a clone of
8099         what's in data.c.
8100         (Fisnan): Always define, since it's always available now.
8101         (syms_of_floatfns): Always define isnan at the Lisp level.
8103 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
8105         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8107 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
8109         * fileio.c: Fix bugs with large file offsets (Bug#9428).
8110         The previous code assumed that file offsets (off_t values) fit in
8111         EMACS_INT variables, which is not true on typical 32-bit hosts.
8112         The code messed up by falsely reporting buffer overflow in cases
8113         such as (insert-file-contents "big" nil 1 2) into an empty buffer
8114         when "big" contains more than 2**29 bytes, even though this
8115         inserts just one byte and does not overflow the buffer.
8116         (Finsert_file_contents): Store file offsets as off_t
8117         values, not as EMACS_INT values.  Check for overflow when
8118         converting between EMACS_INT and off_t.  When checking for
8119         buffer overflow or for overlap, take the offsets into account.
8120         Don't use EMACS_INT for small values where int suffices.
8121         When checking for overlap, fix a typo: ZV was used where
8122         ZV_BYTE was intended.
8123         (Fwrite_region): Don't assume off_t fits into 'long'.
8124         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8126 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
8128         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8130 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
8132         sprintf-related integer and memory overflow issues (Bug#9412).
8134         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8135         (esprintf, exprintf, evxprintf): New functions.
8136         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
8137         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
8138         (modify_event_symbol): Do not assume that the length of
8139         name_alist_or_stem is safe to alloca and fits in int.
8140         (Fexecute_extended_command): Likewise for function name and binding.
8141         (Frecursion_depth): Wrap around reliably on integer overflow.
8142         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8143         since some callers pass EMACS_INT values.
8144         (Fsingle_key_description): Don't crash if symbol name contains more
8145         than MAX_ALLOCA bytes.
8146         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8147         (get_minibuffer): Arg is now EMACS_INT, not int.
8148         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8149         (esprintf, exprintf, evxprintf): New decls.
8150         * window.h (command_loop_level, minibuf_level): Reflect API changes.
8152         * dbusbind.c (signature_cat): New function.
8153         (xd_signature, Fdbus_register_signal):
8154         Do not overrun buffer; instead, report string overflow.
8156         * dispnew.c (add_window_display_history): Don't overrun buffer.
8157         Truncate instead; this is OK since it's just a log.
8159         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8160         even if the time zone offset is outlandishly large.
8161         Don't mishandle offset == INT_MIN.
8163         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8164         when creating daemon; the previous buffer-overflow check was incorrect.
8166         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8167         which has the guts of the old verror function.
8169         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8170         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
8172         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
8173         (font_unparse_xlfd): Don't blindly alloca long strings.
8174         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8175         fits in int, when using sprintf.  Use single snprintf to count
8176         length of string rather than counting it via multiple sprintfs;
8177         that's simpler and more reliable.
8178         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
8179         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
8180         sprintf, in case result does not fit in int.
8182         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
8183         (fontset_from_font): Print it.
8185         * frame.c (tty_frame_count): Now printmax_t, not int.
8186         (make_terminal_frame, set_term_frame_name): Print it.
8187         (x_report_frame_params): In X, window IDs are unsigned long,
8188         not signed long, so print them as unsigned.
8189         (validate_x_resource_name): Check for implausibly long names,
8190         and don't assume name length fits in 'int'.
8191         (x_get_resource_string): Don't blindly alloca invocation name;
8192         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
8193         not fit in int.
8195         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
8196         (xg_check_special_colors, xg_set_geometry):
8197         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
8199         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
8200         Use esprintf, not sprintf, in case result does not fit in int.
8202         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8203         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
8204         it as a large positive number.
8205         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
8206         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8208         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
8209         in case result does not fit in int.
8211         * print.c (float_to_string): Detect width overflow more reliably.
8212         (print_object): Make sprintf buffer a bit bigger, to avoid potential
8213         buffer overrun.  Don't assume list length fits in 'int'.  Treat
8214         print length of 0 as 0, not as infinity; to be consistent with other
8215         uses of print length in this function.  Don't overflow print length
8216         index.  Don't assume hash table size fits in 'long', or that
8217         vectorlike size fits in 'unsigned long'.
8219         * process.c (make_process): Use printmax_t, not int, to format
8220         process-name gensyms.
8222         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
8224         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
8225         to avoid potential buffer overrun.
8227         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
8228         if X resource line is longer than 512 bytes.
8230         * xfns.c (x_window): Make sprintf buffer a bit bigger
8231         to avoid potential buffer overrun.
8233         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
8235         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
8237 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
8239         Integer overflow fixes for scrolling, etc.
8240         Without these, Emacs silently mishandles large integers sometimes.
8241         For example, "C-u 4294967297 M-x recenter" was treated as if
8242         it were "C-u 1 M-x recenter" on a typical 64-bit host.
8244         * xdisp.c (try_window_id): Check Emacs fixnum range before
8245         converting to 'int'.
8247         * window.c (window_scroll_line_based, Frecenter):
8248         Check that an Emacs fixnum is in range before assigning it to 'int'.
8249         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
8250         values converted from Emacs fixnums.
8251         (Frecenter): Don't wrap around a line count if it is out of 'int'
8252         range; instead, treat it as an extreme value.
8253         (Fset_window_configuration, compare_window_configurations):
8254         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
8256         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
8257         that can exceed INT_MAX.  Check that EMACS_INT value is in range
8258         before assigning it to the (possibly-narrower) index.
8259         (match_limit): Don't assume that a fixnum can fit in 'int'.
8261         * print.c (print_object): Use ptrdiff_t, not int, for index that can
8262         exceed INT_MAX.
8264         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
8265         (Fvertical_motion): Don't wrap around LINES values that don't fit
8266         in 'int'.  Instead, treat them as extreme values.  This is good
8267         enough for windows, which can't have more than INT_MAX lines anyway.
8269 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
8271         * Require libxml/parser.h to avoid compilation warning.
8273         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
8275         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
8276         since this reportedly can destroy thread storage.
8278 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
8280         * syntax.c (find_defun_start): Update all cache variables if
8281         exiting early (Bug#9401).
8283 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
8285         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
8287         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
8288         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
8289         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
8291         * term.c (tty_append_glyph): New function.
8292         (produce_stretch_glyph): Static function and its prototype deleted.
8294         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
8295         Add prototypes.
8297 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
8299         * image.c (parse_image_spec): Check for nonnegative, not for positive,
8300         when checking :margin (Bug#9390).
8301         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
8302         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
8303         so that the name doesn't mislead.  All uses changed.
8305 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
8307         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
8308         set_tty_hooks.
8310 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
8312         * xdisp.c (move_it_to): Don't bail out early when reaching
8313         position beyond to_charpos, if we are scanning backwards.
8314         (move_it_vertically_backward): When DY == 0, make sure we get to
8315         the first character in the line after the newline.
8317 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
8319         * ccl.c: Improve and simplify overflow checking (Bug#9196).
8320         (ccl_driver): Do not generate an out-of-range pointer.
8321         (Fccl_execute_on_string): Remove unnecessary check for
8322         integer overflow, noted by Stefan Monnier in
8323         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
8324         Remove a FIXME that didn't need fixing.
8325         Simplify the newly-introduced buffer reallocation code.
8327 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
8329         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
8331 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
8333         Integer and memory overflow issues (Bug#9196).
8335         * doc.c (get_doc_string): Rework so that
8336         get_doc_string_buffer_size is the actual buffer size, rather than
8337         being 1 less than the actual buffer size; this makes xpalloc more
8338         convenient.
8340         * image.c (x_allocate_bitmap_record, cache_image):
8341         * xselect.c (Fx_register_dnd_atom):
8342         Simplify previous changes by using xpalloc.
8344         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
8345         since either will do and ptrdiff_t is convenient with xpalloc.
8347         * charset.c (charset_table_size)
8348         (struct charset_sort_data.priority): Now ptrdiff_t.
8349         (charset_compare): Don't overflow if priorities differ greatly.
8350         (Fsort_charsets): Don't assume list length fits in int.
8351         Check for size-calculation overflow when allocating sort data.
8352         (syms_of_charset): Allocate an initial charset table that is
8353         just under 64 KiB, to avoid problems with glibc malloc and mmap.
8355         * cmds.c (internal_self_insert): Check for size-calculation overflow.
8357         * composite.h (struct composition.glyph_len): Now int, not unsigned.
8358         The actual value is always <= INT_MAX, and leaving it unsigned made
8359         overflow checking harder.
8361         * dispextern.h (struct glyph_matrix.rows_allocated)
8362         (struct face_cache.size): Now ptrdiff_t, for convenience in use
8363         with xpalloc.  The values are still always <= INT_MAX.
8365         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
8367         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
8368         (SAFE_NALLOCA): New macro.
8370         * region-cache.c (struct boundary.pos, find_cache_boundary)
8371         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
8372         (set_cache_region, invalidate_region_cache)
8373         (revalidate_region_cache, know_region_cache, region_cache_forward)
8374         (region_cache_backward, pp_cache):
8375         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
8376         so that ptrdiff_t * can be passed to xpalloc.
8377         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
8378         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
8379         (pp_cache): Don't assume cache_len fits in int.
8380         * region-cache.h: Adjust extern decls to match.
8382         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
8383         EMACS_INT, since either will do, for xpalloc.
8385         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
8386         (xnmalloc, xnrealloc, xpalloc): New functions.
8388         * bidi.c (bidi_shelve_header_size): New constant.
8389         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
8390         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
8392         * bidi.c (bidi_cache_shrink):
8393         * buffer.c (overlays_at, overlays_in, record_overlay_string)
8394         (overlay_strings):
8395         Don't update size of array until after memory allocation succeeds,
8396         because xmalloc/xrealloc may not return.
8397         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
8398         now that we have proper integer overflow checking.
8399         (record_overlay_string, overlay_strings): Catch overflows when
8400         calculating size of overlay_str_buf.
8402         * callproc.c (Fcall_process): Check for size overflow when
8403         calculating size of args2.
8404         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
8405         Normally we prefer signed values, but sticking with ptrdiff_t would
8406         require adding more-complicated checks.
8408         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
8409         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
8410         Redo buffer-overflow calculations to avoid integer overflow.
8411         Add a FIXME comment where memory seems to be over-allocated.
8413         * character.c (Fstring): Check for size-calculation overflow.
8415         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
8416         unnecessary integer overflow.  Check for size overflow.
8417         (encode_coding_object): Don't update size until xmalloc succeeds.
8419         * composite.c (get_composition_id): Check for overflow in glyph
8420         length calculations.
8422         Integer and memory overflow fixes for display code.
8423         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
8424         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
8425         (scrolling_window): Check for overflow in size calculations.
8426         (line_draw_cost, realloc_glyph_pool, add_row_entry):
8427         Don't assume glyph table len fits in int.
8428         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
8429         (row_table_size): Now ptrdiff_t, not int.
8430         (scrolling_window): Avoid overflow in size calculations.
8431         Don't update size until allocation succeeds.
8432         * fns.c (concat): Check for overflow in size calculations.
8433         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
8434         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8435         (NEXT_ALMOST_PRIME_LIMIT): New constant.
8437         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
8438         (get_doc_string): Check for size calculation overflow.
8439         Don't update size until allocation succeeds.
8440         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
8441         EMACS_INT, where ptrdiff_t will do.
8442         (Fsubstitute_command_keys): Check for string overflow.
8444         * editfns.c (set_time_zone_rule): Don't assume environment length
8445         fits in int.
8446         (message_length): Now ptrdiff_t, not int.
8447         (Fmessage_box): Don't update size until allocation succeeds.
8448         Don't assume message length fits in int.
8449         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
8451         * emacs.c (main): Do not reallocate argv, since there is a null at
8452         the end that can be overwritten, and this way there's no need to
8453         worry about size-calculation overflow.
8454         (sort_args): Check for size-calculation overflow.
8456         * eval.c (init_eval_once, grow_specpdl): Don't update size until
8457         alloc succeeds.
8458         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
8460         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
8461         (x_set_scroll_bar_width, x_figure_window_size):
8462         Check for integer overflow.
8463         (x_set_alpha): Do not assume XINT fits in int.
8465         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
8466         This is for the members text_lines, text_cols, total_lines, total_cols,
8467         where the system imposes an 'int' limit.
8469         * fringe.c (Fdefine_fringe_bitmap):
8470         Don't update size until alloc works.
8472         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
8473         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
8475         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
8476         Check for size-calculation overflow.
8477         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
8478         do, as we prefer signed integers.
8479         (id_to_widget.max_size, id_to_widget.used)
8480         (xg_store_widget_in_map, xg_remove_widget_from_map)
8481         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
8482         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
8483         Use and return ptrdiff_t, not int.
8484         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
8485         * gtkutil.h: Change prototypes to match the above.
8487         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
8488         are duplicate now that they've been promoted to lisp.h.
8489         (x_allocate_bitmap_record, x_alloc_image_color)
8490         (make_image_cache, cache_image, xpm_load):
8491         Don't update size until alloc is done.
8492         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
8493         (x_detect_edges):
8494         Check for size calculation overflow.
8495         (ct_colors_allocated_max): New constant.
8496         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
8497         overflow.
8499         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
8500         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
8501         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
8502         Use ptrdiff_t, not int, to count maps.
8503         (read_char_minibuf_menu_prompt): Check for overflow in size
8504         calculations.  Don't update size until allocation succeeds.
8505         Redo calculations to avoid overflow.
8506         * keyboard.h: Change prototypes to match the above.
8508         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
8509         to count maps.
8510         (current_minor_maps): Check for size calculation overflow.
8511         * keymap.h: Change prototypes to match the above.
8513         * lread.c (read1, init_obarray): Don't update size until alloc done.
8515         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
8516         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
8518         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
8519         Now ptrdiff_t, not int.
8520         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
8521         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
8523         * process.c (Fnetwork_interface_list): Check for overflow
8524         in size calculation.
8526         * region-cache.c (move_cache_gap): Check for size calculation overflow.
8528         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
8529         overflow.  Don't bother calling xmalloc when xrealloc will do.
8531         * search.c (Freplace_match): Check for size calculation overflow.
8532         (Fset_match_data): Don't assume list lengths fit in 'int'.
8534         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
8535         for command line length.  Do not attempt to address one before the
8536         beginning of an array, as that's not portable.
8538         * term.c (max_frame_lines): Remove; unused.
8539         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
8540         not int.
8541         (encode_terminal_code, calculate_costs): Check for size
8542         calculation overflow.
8543         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
8544         table lengths and related sizes.  Don't update size until alloc
8545         done.  Redo calculations to avoid overflow.
8546         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
8548         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
8549         subtracting pointers.
8550         (gobble_line): Check for overflow more carefully.  Don't update size
8551         until alloc done.
8553         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
8554         Don't update size until alloc done.
8555         Redo size calculations to avoid overflow.
8556         Check for size calculation overflow.
8557         (main) [DEBUG]: Fix typo in invoking tparam1.
8559         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
8560         Use ptrdiff_t, not int, for sizes.
8561         (store_mode_line_noprop_char): Don't update size until alloc done.
8563         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
8564         Use ptrdiff_t, not int, for sizes.
8565         (Finternal_make_lisp_face, cache_face):
8566         Check for size calculation overflow.
8567         (cache_face): Treat size calculation overflows as if they were
8568         memory exhaustion (the usual treatment), rather than aborting.
8570         * xfns.c (x_encode_text, x_set_name_internal)
8571         (Fx_change_window_property): Use ptrdiff_t, not int, to count
8572         sizes, since they can exceed INT_MAX in size.  Check for size
8573         calculation overflow.
8575         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
8576         (xg_select): Check for size calculation overflow.
8577         Don't update size until alloc done.
8579         * xrdb.c (get_environ_db): Don't assume path length fits in int,
8580         as sprintf is limited to int lengths.
8582         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
8583         (X_LONG_MIN): New macros.
8584         Use them to make the following changes clearer.
8585         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
8586         This change doesn't affect the value now, but it may help remind
8587         future maintainers not to raise the value too much later.
8588         (SELECTION_QUANTUM): Remove, replacing with ...
8589         (selection_quantum): ... new function, which avoids overflow.
8590         All uses changed.
8591         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
8592         assumption that selection length fits in 'int'.
8593         (x_reply_selection_request, x_handle_selection_request)
8594         (x_get_window_property, receive_incremental_selection)
8595         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
8596         (lisp_data_to_selection_data, clean_local_selection_data):
8597         Use ptrdiff_t, not int, to record length of selection.
8598         (x_reply_selection_request, x_get_window_property)
8599         (receive_incremental_selection, x_property_data_to_lisp):
8600         Redo calculations to avoid overflow.
8601         (x_reply_selection_request): When sending hint, ceiling it at
8602         X_LONG_MAX rather than relying on wraparound overflow to send
8603         something.
8604         (x_get_window_property, receive_incremental_selection)
8605         (lisp_data_to_selection_data, x_property_data_to_lisp):
8606         Check for size-calculation overflow.
8607         (x_get_window_property, receive_incremental_selection)
8608         (lisp_data_to_selection_data, Fx_register_dnd_atom):
8609         Don't store size until memory allocation succeeds.
8610         (x_get_window_property): Plug memory leak on memory exhaustion.
8611         Don't double-block input; malloc is safe here.  Don't assume 2**34
8612         - 4 fits in unsigned long.  Add an xassert to check
8613         XGetWindowProperty overflow.  Be more careful about overflow
8614         calculations, and distinguish size from memory overflow better.
8615         (receive_incremental_selection): When tracing, don't assume
8616         unsigned int is less than INT_MAX.
8617         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
8618         harmful) conversions of unsigned short to int.
8619         (lisp_data_to_selection_data): Don't assume that integers
8620         in the range -65535 through -1 fit in an X unsigned short.
8621         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
8622         result parameters unless successful.  Rely on cons_to_unsigned
8623         to report problems with elements; the old code wasn't right anyway.
8624         (x_check_property_data): Check for int overflow; we cannot use
8625         a wider type due to X limits.
8626         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
8628         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
8630         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
8631         (x_term_init): Check for size calculation overflow.
8632         (x_color_cells): Don't store size until memory allocation succeeds.
8633         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
8634         Don't assume alloca size is less than MAX_ALLOCA.
8635         (x_term_init): Don't assume length fits in int (sprintf is limited
8636         to int size).
8638         Use ptrdiff_t for composition IDs.
8639         * character.c (lisp_string_width):
8640         * composite.c (composition_table_size, n_compositions)
8641         (get_composition_id, composition_gstring_from_id):
8642         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
8643         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
8644         * window.c (Frecenter):
8645         Use ptrdiff_t, not int, for composition IDs.
8646         * composite.c (get_composition_id): Check for integer overflow.
8647         * composite.h: Adjust prototypes to match the above changes.
8649         Use ptrdiff_t for hash table indexes.
8650         * category.c (hash_get_category_set):
8651         * ccl.c (ccl_driver):
8652         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
8653         * coding.c (coding_system_charset_list, detect_coding_system):
8654         * coding.h (struct coding_system.id):
8655         * composite.c (get_composition_id, gstring_lookup_cache):
8656         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
8657         * image.c (xpm_get_color_table_h):
8658         * lisp.h (hash_lookup, hash_put):
8659         * minibuf.c (Ftest_completion):
8660         Use ptrdiff_t for hash table indexes, not int (which is too
8661         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
8662         32-bit --with-wide-int hosts).
8664         * charset.c (Fdefine_charset_internal): Check for integer overflow.
8665         Add a FIXME comment about memory leaks.
8666         (syms_of_charset): Don't assume xmalloc returns.
8668         Don't assume that stated character widths fit in int.
8669         * character.c (Fchar_width, c_string_width, lisp_string_width):
8670         * character.h (CHAR_WIDTH):
8671         * indent.c (MULTIBYTE_BYTES_WIDTH):
8672         Use sanitize_char_width to avoid undefined and/or bad behavior
8673         with outlandish widths.
8674         * character.h (sanitize_tab_width): Rename from sanitize_width,
8675         now that we have two such functions.  All uses changed.
8676         (sanitize_char_width): New inline function.
8678         Don't assume that tab-width fits in int.
8679         * character.h (sanitize_width): New inline function.
8680         (SANE_TAB_WIDTH): New macro.
8681         (ASCII_CHAR_WIDTH): Use it.
8682         * indent.c (sane_tab_width): Remove.  All uses replaced by
8683         SANE_TAB_WIDTH (current_buffer).
8684         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
8686         * fileio.c: Integer overflow issues with file modes.
8687         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
8689         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
8690         Remove unreachable code.
8691         (read_hex, load_charset_map_from_file): Check for integer overflow.
8693         * xterm.c: Don't go over XClientMessageEvent limit.
8694         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
8695         (x_send_scroll_bar_event): Likewise.  Check that the size does not
8696         exceed limits imposed by XClientMessageEvent, as well as the usual
8697         ptrdiff_t and size_t limits.
8699         * keyboard.c: Overflow, signedness and related fixes.
8700         (make_lispy_movement): Use same integer type in forward decl
8701         that is used in the definition.
8702         (read_key_sequence, keyremap_step):
8703         Change bufsize argument back to int, undoing my 2011-03-30 change.
8704         We prefer signed types, and int is wide enough here.
8705         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
8706         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
8707         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
8708         length, not size_t.  Use ptrdiff_t for index, not int.
8709         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
8710         possibility of integer overflow.
8712         Overflow, signedness and related fixes for images.
8714         * dispextern.h (struct it.stack[0].u.image.image_id)
8715         (struct_it.image_id, struct image.id, struct image_cache.size)
8716         (struct image_cache.used, struct image_cache.ref_count):
8717         * gtkutil.c (update_frame_tool_bar):
8718         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
8719         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
8720         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
8721         * nsmenu.m (update_frame_tool_bar):
8722         * xdisp.c (calc_pixel_width_or_height):
8723         * xfns.c (image_cache_refcount):
8724         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
8725         on typical 64-bit hosts.
8727         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
8728         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
8729         Omit unnecessary casts to int.
8730         (parse_image_spec): Check that integers fall into 'int' range
8731         when the callers expect that.
8732         (image_ascent): Redo ascent calculation to avoid int overflow.
8733         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
8734         (lookup_image): Remove unnecessary tests.
8735         (xbm_image_p): Locals are now of int, not EMACS_INT,
8736         since parse_image_check makes sure they fit into int.
8737         (png_load, gif_load, svg_load_image):
8738         Prefer int to unsigned where either will do.
8739         (tiff_handler): New function, combining the cores of the
8740         old tiff_error_handler and tiff_warning_handler.
8741         This function is rewritten to use vsnprintf and thereby avoid
8742         stack buffer overflows.  It uses only the features of vsnprintf
8743         that are common to both POSIX and native Microsoft.
8744         (tiff_error_handler, tiff_warning_handler): Use it.
8745         (tiff_load, gif_load, imagemagick_load_image):
8746         Don't assume :index value fits in 'int'.
8747         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
8748         (imagemagick_load_image): Check that crop parameters fit into
8749         the integer types that MagickCropImage accepts.  Don't assume
8750         Vimagemagick_render_type has a nonnegative value.  Don't assume
8751         size_t fits in 'long'.
8752         (gs_load): Use printmax_t to print the widest integers possible.
8753         Check for integer overflow when computing image height and width.
8755 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
8757         * xdisp.c (redisplay_window): Don't force window start if point
8758         will be invisible in the resulting window.  (Bug#9324)
8760 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
8762         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
8763         the display spec is of the form `(space ...)'.
8764         (handle_display_spec): Return the value returned by
8765         handle_single_display_spec, not just 1 or zero.
8766         (handle_single_display_spec): If the display spec is of the form
8767         `(space ...)', and specifies display in the text area, return 2
8768         rather than 1.
8769         (try_cursor_movement): Check for the need to scroll more
8770         accurately, and prefer exact match for point under bidi.
8771         Don't advance `row' beyond the last row of the window.
8773         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
8774         into disp_prop; all users changed.
8776         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
8777         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
8778         for the text covered by the display property.
8780 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
8782         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
8783         Change return value to nil.
8784         (Frecord_buffer): Delete unused function.
8786 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
8788         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
8789         buffers, return left-to-right.
8790         (set_cursor_from_row): Consider candidate row a win if its glyph
8791         represents a newline and point is on that newline.  Fixes cursor
8792         positioning on the newline at EOL of R2L text within L2R
8793         paragraph, and vice versa.
8794         (try_cursor_movement): Check continued rows, in addition to
8795         continuation rows.  Fixes unwarranted scroll when point enters a
8796         continued line of R2L text within an L2R paragraph, or vice versa.
8797         (cursor_row_p): Consider the case of point being equal to
8798         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
8799         from the end of a short line to the beginning of a continued line
8800         of R2L text within L2R paragraph.
8801         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
8802         composed characters.
8804         * bidi.c (bidi_check_type): Use xassert.
8805         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
8806         members.
8808 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
8810         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
8811         a character.
8813 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
8815         * nsfont.m (ns_otf_to_script): Fix typo.
8817 2011-08-22  Kenichi Handa  <handa@m17n.org>
8819         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
8820         extra slot even if the purpose is char-code-property-table.
8822 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
8824         * xdisp.c (redisplay_window): When computing centering_position,
8825         account for the height of the header line.  (Bug#8874)
8827         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
8828         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
8829         candidate is selected by the mouse, and that candidate has a
8830         composed character under the mouse.
8832         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
8833         coordinates reported by pos-visible-in-window-p for a composed
8834         character in column zero.
8836 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
8838         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
8840 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
8842         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
8843         consider it a hit if to_charpos is anywhere in the range of the
8844         composed buffer positions.
8846 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
8848         * image.c (gif_load): Don't assume that each subimage has the same
8849         dimensions as the base image.  Handle disposal method that is
8850         "undefined" by the gif spec (Bug#9335).
8852 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
8854         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
8855         (Fcondition_case): Document `debug' symbol in error handler.
8857 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
8859         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
8860         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
8861         from an Org mode buffer to a Speedbar frame.
8863         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
8864         a composition, take its buffer position from IT->cmp_it.charpos.
8865         Fixes cursor positioning at the beginning of a line that begins
8866         with a composed character.
8868 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
8870         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
8871         character bidirectional type, use STRONG_L instead.  Fixes crashes
8872         in a buffer produced by `describe-categories'.
8874         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
8875         members before the level stack, so they would be saved and
8876         restored when copying iterator state.  Fixes incorrect reordering
8877         around TABs covered by display properties.
8879 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
8881         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
8883 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
8885         * eval.c (internal_condition_case, internal_condition_case_1)
8886         (internal_condition_case_2, internal_condition_case_n):
8887         Remove unnecessary aborts (Bug#9081).
8889 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
8891         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
8892         has no `load' handler, try opening the file locally.  (Bug#9311)
8894 2011-08-16  Ken Brown  <kbrown@cornell.edu>
8896         * gmalloc.c: Expand comment.
8898 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
8900         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
8901         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
8903 2011-08-16  Ken Brown  <kbrown@cornell.edu>
8905         Fix memory allocation problems in Cygwin build (Bug#9273).
8907         * unexcw.c ( __malloc_initialized): Declare external variable.
8908         (fixup_executable): Force the dumped emacs to reinitialize malloc.
8910         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
8911         New variables.
8912         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
8913         dumped emacs.
8914         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
8915         in the static heap.
8916         [CYGWIN] (special_realloc): New function.
8917         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
8918         requests to realloc storage in the static heap.
8920 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
8922         * bidi.c (bidi_initialize): Remove unused local.
8924 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
8926         * bidimirror.h:
8927         * biditype.h: Remove file.
8928         * makefile.w32-in ($(BLD)/bidi.$(O)):
8929         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
8931         * dispextern.h: Fix a typo in the comment to bidi_type_t.
8933         * chartab.c: Improve commentary for the uniprop_table API.
8935         * bidi.c (bidi_paragraph_init): Support zero value of
8936         bidi_ignore_explicit_marks_for_paragraph_level.
8937         (bidi_initialize): Use uniprop_table instead of including
8938         biditype.h and bidimirror.h.
8940         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
8941         coordinates of the iterator when restoring from ppos_it.
8942         (Bug#9296)
8944 2011-08-14  Kenichi Handa  <handa@m17n.org>
8946         * process.c (create_process): Call setup_process_coding_systems
8947         after the pid of the process is set to -1 (Bug#8162).
8949 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
8951         * xdisp.c (move_it_in_display_line_to): Don't invoke
8952         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
8953         ppos_it.  Fixes vertical cursor motion when line beginning is
8954         covered by an image.  (Bug#9296)
8956 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
8958         * nsterm.h (ns_run_ascript): Declare.
8959         (NSAPP_DATA2_RUNASSCRIPT): Define.
8961         * nsfns.m (as_script, as_result, as_status): New static variables.
8962         (ns_run_ascript): New function.
8963         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
8964         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
8965         the event loop.  Get status from as_status (Bug#7276).
8967         * nsterm.m (sendEvent): If event is NSApplicationDefined and
8968         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
8969         the event loop (Bug#7276).
8971 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
8973         * gnutls.c (QCgnutls_bootprop_priority)
8974         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
8975         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
8976         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
8977         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
8978         (QCgnutls_bootprop_verify_hostname_error)
8979         (QCgnutls_bootprop_callbacks_verify): Rename from
8980         Qgnutls_bootprop_..., all uses changed.
8982         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
8983         uses changed.
8985 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
8987         * xfaces.c (Qframe_set_background_mode): Now static.
8988         * dispextern.h (Qframe_set_background_mode): Remove decl.
8990         * process.c (Fnetwork_interface_info): Declare local only if needed.
8992 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
8994         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
8995         (Fnetwork_interface_list): Allocate in increments of bytes instead
8996         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
8997         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
8998         sockaddr.
8999         (struct ifflag_def): notrailers is smart on OSX.
9000         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9001         Get hardware address with getifaddrs if available.
9003 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
9005         * xdisp.c (iterate_out_of_display_property): xassert that
9006         IT->position is set to within IT->object's boundaries.  Break from
9007         the loop as soon as EOB is reached; avoids infloops in redisplay
9008         when IT->position is set up wrongly due to some bug.
9009         Set IT->current to match the bidi iterator unconditionally.
9010         (push_display_prop): Allow GET_FROM_STRING as IT->method on
9011         entry.  Force push_it to save on the stack the current
9012         buffer/string position, to be restored by pop_it.  Fix flags in
9013         the iterator structure wrt the object coming from a display
9014         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9015         properties.  (Bug#9284)
9017 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
9019         * fontset.c (fontset_get_font_group): Add proper type checks.
9020         (Bug#9172)
9022 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
9024         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9025         and LC_VERSION_MIN_MACOSX.
9026         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9027         (dump_it) [LC_FUNCTION_STARTS]: Use it.
9029 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
9031         * xdisp.c (forward_to_next_line_start): Allow to use the
9032         no-display-properties-and-no-overlays under bidi display.
9033         Set disp_pos in the bidi iterator to avoid searches for display
9034         properties and overlays.
9036 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
9038         * editfns.c (Fset_time_zone_rule): Document relationship with the
9039         setenv function.
9041         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9042         the font entity extracted from the cache (Bug#8109).
9044 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
9046         * composite.c (autocmp_chars): Don't reset point.  That is done by
9047         restore_point_unwind (Bug#5984).
9049 2011-08-07  Juri Linkov  <juri@jurta.org>
9051         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9052         to show the arg `TIME' instead of `TIMEVAL'.
9054 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
9056         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9057         display property strides EOL and includes a newline, as in
9058         longlines-mode.  (Bug#9254)
9059         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9060         word-wrap under bidirectional display.  (Bug#9224)
9062         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9063         is non-zero, even if the data buffer is NULL.  Fixes a crash in
9064         vertical-motion with longlines-mode.  (Bug#9254)
9066 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
9068         * bidi.c <bidi_cache_total_alloc>: Now static.
9069         (bidi_initialize): Initialize bidi_cache_total_alloc.
9071         * xdisp.c (display_line): Release buffer allocated for shelved bidi
9072         cache.  (Bug#9221)
9074         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9075         amount allocated this far in `bidi_cache_total_alloc'.
9076         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9077         non-zero, only free the data buffer without restoring the cache
9078         contents.  All callers changed.
9080         * dispextern.h (bidi_unshelve_cache): Update prototype.
9082         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9083         (move_it_in_display_line, move_it_to)
9084         (move_it_vertically_backward, move_it_by_lines): Replace the call
9085         to xfree to an equivalent call to bidi_unshelve_cache.
9086         (move_it_in_display_line_to): Fix logic of returning
9087         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
9089 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
9091         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9092         came from a string character with a `cursor' property.  (Bug#9229)
9094 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
9096         * Makefile.in (LIB_PTHREAD): New variable.
9097         (LIBES): Add LIB_PTHREAD (Bug#9216).
9099         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9100         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9102 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
9104         * regex.c (re_iswctype): Remove some redundant boolean conversions.
9106 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
9108         * xterm.c (x_find_topmost_parent): New function.
9109         (x_set_frame_alpha): Find topmost parent window with
9110         x_find_topmost_parent and set the property there also (bug#9181).
9111         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9113 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
9115         * callproc.c (Fcall_process): Avoid vfork clobbering
9116         the local vars buffer, coding_systems, current_dir.
9118 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
9120         * keymap.c (Fmake_composed_keymap): Move to subr.el.
9122 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
9124         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9125         so that it is not optimized away.
9127         * xdisp.c (compute_display_string_pos): Remove unused local.
9129 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
9131         Fix slow cursor motion and scrolling in large buffers with
9132         selective display, like Org Mode buffers.  (Bug#9218)
9134         * dispextern.h (struct bidi_it): New member disp_prop_p.
9136         * xdisp.c: Remove one-slot cache of display string positions.
9137         (compute_display_string_pos): Accept an additional argument
9138         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
9139         for a display string or property.  If found, set DISP_PROP_P
9140         non-zero.
9142         * bidi.c (bidi_fetch_char): Accept an additional argument
9143         DISP_PROP_P, and pass it to compute_display_string_pos.
9144         Only handle text covered by a display string if DISP_PROP_P is returned
9145         non-zero.  All callers of bidi_fetch_char changed.
9147 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
9149         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9151 2010-12-03  Don March  <don@ohspite.net>
9153         * keymap.c (Fdefine_key): Fix non-prefix key error message when
9154         last character M-[char] is translated to ESC [char] (bug#7541).
9156 2011-08-02  Kenichi Handa  <handa@m17n.org>
9158         * lisp.h (uniprop_table): Extern it.
9160         * chartab.c (uniprop_table): Make it non-static.
9162 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
9164         * xdisp.c (forward_to_next_line_start): Accept additional argument
9165         BIDI_IT_PREV, and store into it the state of the bidi iterator had
9166         on the newline.
9167         (reseat_at_next_visible_line_start): Use the bidi iterator state
9168         returned by forward_to_next_line_start to restore the state of
9169         it->bidi_it after backing up to previous newline.  (Bug#9212)
9171 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
9173         * regex.c (re_comp): Protoize.
9174         (re_exec): Fix return type.
9175         (regexec): Fix type of `ret'.  (Bug#9203)
9177 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
9179         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
9180         This is needed if max-image-size is a floating-point number.
9182 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
9184         * print.c (print_object): Print empty symbol as ##.
9186         * lread.c (read1): Read ## as empty symbol.
9188 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
9190         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
9191         setting frame foreground color (Bug#9175).
9192         (x_set_background_color): Likewise.
9194         * nsmenu.m (-setText): Size tooltip dimensions precisely to
9195         contents (Bug#9176).
9196         (EmacsTooltip -init): Remove bezels and add shadows to
9197         tooltip windows.
9199         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
9200         or scroll bar (Bug#8470).
9202         * nsfont.m (nsfont_open): Remove assignment to voffset and
9203         unnecessary vars hshink, expand, hd, full_height, min_height.
9204         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
9206         * nsterm.h (nsfont_info): Remove voffset field.
9208 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
9210         Implement strike-through and overline on NextStep (Bug#8863).
9212         * nsfont.m (nsfont_open): Use underline position provided by font,
9213         instead of hard-coded value of 2.
9214         (nsfont_draw): Call ns_draw_text_decoration instead.
9216         * nsterm.h: Add declaration for ns_draw_text_decoration.
9218         * nsterm.m (ns_draw_text_decoration): New function for drawing
9219         underline, overline, and strike-through.
9220         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
9221         ns_draw_text_decoration.  Change treatment of cursor drawing to
9222         accommodate underlining, etc.
9224 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
9226         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
9227         default.
9229 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
9231         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
9232         Without this fix, if a signal arrives just after memory fills up,
9233         'malloc' might be invoked reentrantly.
9235         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
9236         In other words, assume that every image size is allowed, on non-X
9237         hosts.  This assumption is probably wrong, but it lets Emacs compile.
9239 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
9241         * regex.c (re_iswctype): Convert return values to boolean.
9243 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
9245         * xdisp.c (compute_display_string_pos): Don't use cached display
9246         string position if the buffer had its restriction changed.
9247         (Bug#9184)
9249 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
9251         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9253 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
9255         Integer signedness and overflow and related fixes.  (Bug#9079)
9257         * bidi.c: Integer size and overflow fixes.
9258         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
9259         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
9260         (bidi_cache_find_level_change, bidi_cache_ensure_space)
9261         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
9262         (bidi_find_other_level_edge):
9263         Use ptrdiff_t instead of EMACS_INT where either will do.
9264         This works better on 32-bit hosts configured --with-wide-int.
9265         (bidi_cache_ensure_space): Check for size-calculation overflow.
9266         Use % rather than repeated addition, for better worst-case speed.
9267         Don't set bidi_cache_size until after xrealloc returns, because it
9268         might not return.
9269         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
9270         (bidi_cache_ensure_space): Also check that the bidi cache size
9271         does not exceed that of the largest Lisp string or buffer.  See Eli
9272         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
9274         * alloc.c (__malloc_size_t): Remove.
9275         All uses replaced by size_t.  See Andreas Schwab's note
9276         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
9278         * image.c: Improve checking for integer overflow.
9279         (check_image_size): Assume that f is nonnull, since
9280         it is always nonnull in practice.  This is one less thing to
9281         worry about when checking for integer overflow later.
9282         (x_check_image_size): New function, which checks for integer
9283         overflow issues inside X.
9284         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
9285         This removes the need for a memory_full check.
9286         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
9287         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
9288         (xbm_read_bitmap_data): Change locals back to 'int', since
9289         their values must fit in 'int'.
9290         (xpm_load_image, png_load, tiff_load):
9291         Invoke x_create_x_image_and_pixmap earlier,
9292         to avoid much needless work if the image is too large.
9293         (tiff_load): Treat overly large images as if
9294         x_create_x_image_and_pixmap failed, not as malloc failures.
9295         (gs_load): Use x_check_image_size.
9297         * gtkutil.c: Omit integer casts.
9298         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
9299         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
9301         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
9303         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
9304         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
9305         would wrongly return t on a 64-bit host.
9307         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
9308         The plain *_OVERFLOW macros run afoul of GCC bug 49705
9309         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
9310         and therefore cause GCC to emit a bogus diagnostic in some cases.
9312         * image.c: Integer signedness and overflow and related fixes.
9313         This is not an exhaustive set of fixes, but it's time to
9314         record what I've got.
9315         (lookup_pixel_color, check_image_size): Remove redundant decls.
9316         (check_image_size): Don't assume that arbitrary EMACS_INT values
9317         fit in 'int', or that arbitrary 'double' values fit in 'int'.
9318         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
9319         (tiff_load, imagemagick_load_image):
9320         Check for overflow in size calculations.
9321         (x_create_x_image_and_pixmap): Remove unnecessary test for
9322         xmalloc returning NULL; that can't happen.
9323         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
9324         (xpm_color_bucket): Use better integer hashing function.
9325         (xpm_cache_color): Don't possibly over-allocate memory.
9326         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
9327         (gif_memory_source):
9328         Use ptrdiff_t, not int or size_t, to record sizes.
9329         (png_load): Don't assume values greater than 2**31 fit in 'int'.
9330         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
9331         either works, as we prefer signed integers.
9332         (tiff_read_from_memory, tiff_write_from_memory):
9333         Return tsize_t, not size_t, since that's what the TIFF API wants.
9334         (tiff_read_from_memory): Don't fail simply because the read would
9335         go past EOF; instead, return a short read.
9336         (tiff_load): Omit no-longer-needed casts.
9337         (Fimagemagick_types): Don't assume size fits into 'int'.
9339         Improve hashing quality when configured --with-wide-int.
9340         * fns.c (hash_string): New function, taken from sxhash_string.
9341         Do not discard information about ASCII character case; this
9342         discarding is no longer needed.
9343         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
9344         * lisp.h: Declare it.
9345         * lread.c (hash_string): Remove, since we now use fns.c's version.
9346         The fns.c version returns a wider integer if --with-wide-int is
9347         specified, so this should help the quality of the hashing a bit.
9349         * emacs.c: Integer overflow minor fix.
9350         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
9351         Define only if GNU_LINUX.
9352         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
9354         * dispnew.c: Integer signedness and overflow fixes.
9355         Remove unnecessary forward decls, that were a maintenance hassle.
9356         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
9357         All uses changed.
9358         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
9359         (scrolling_window): Use ptrdiff_t, not int, for byte count.
9360         (prepare_desired_row, line_draw_cost):
9361         Use int, not unsigned, where either works.
9362         (save_current_matrix, restore_current_matrix):
9363         Use ptrdiff_t, not size_t, where either works.
9364         (init_display): Check for overflow more accurately, and without
9365         relying on undefined behavior.
9367         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
9368         Remove, replacing with the new symbols in lisp.h.  All uses changed.
9369         * fileio.c (make_temp_name):
9370         * filelock.c (lock_file_1, lock_file):
9371         * xdisp.c (message_dolog):
9372         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
9373         Use pMd etc. instead.
9374         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
9375         replacing the pWIDE etc. symbols removed from editfns.c.
9377         * keyboard.h (num_input_events): Now uintmax_t.
9378         This is (very slightly) less likely to mess up due to wraparound.
9379         All uses changed.
9381         * buffer.c: Integer signedness fixes.
9382         (alloc_buffer_text, enlarge_buffer_text):
9383         Use ptrdiff_t rather than size_t when either will do, as we prefer
9384         signed integers.
9386         * alloc.c: Integer signedness and overflow fixes.
9387         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
9388         (__malloc_size_t): Default to size_t, not to int.
9389         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
9390         (Fgarbage_collect, mark_object_loop_halt, mark_object):
9391         Prefer ptrdiff_t to size_t when either would do, as we prefer
9392         signed integers.
9393         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
9394         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
9395         Now const.  Initialize with values that are in range even if char
9396         is signed.
9397         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
9398         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
9399         These functions do the right thing with sizes > 2**32.
9400         (check_depth): Now ptrdiff_t, not int.
9401         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
9402         Adjust to new way of storing sizes.  Check for size overflow bugs
9403         in rest of code.
9404         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
9405         slightly wrong anyway, as it missed one instance of
9406         XMALLOC_OVERRUN_CHECK_OVERHEAD.
9407         (refill_memory_reserve): Omit needless cast to size_t.
9408         (mark_object_loop_halt): Mark as externally visible.
9410         * xselect.c: Integer signedness and overflow fixes.
9411         (Fx_register_dnd_atom, x_handle_dnd_message):
9412         Use ptrdiff_t, not size_t, since we prefer signed.
9413         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
9414         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
9415         x_dnd_atoms_size and x_dnd_atoms_length.
9417         * doprnt.c: Prefer signed to unsigned when either works.
9418         * eval.c (verror):
9419         * doprnt.c (doprnt):
9420         * lisp.h (doprnt):
9421         * xdisp.c (vmessage):
9422         Use ptrdiff_t, not size_t, when using or implementing doprnt,
9423         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
9424         prefer signed arithmetic to avoid comparison confusion.
9425         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
9426         but is a bit tricky.
9428         Assume freestanding C89 headers, string.h, stdlib.h.
9429         * data.c, doprnt.c, floatfns.c, print.c:
9430         Include float.h unconditionally.
9431         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
9432         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
9433         * regex.c: Likewise for stddef.h, string.h.
9434         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
9435         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
9436         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
9437         (STDC_HEADERS): Remove obsolete defines.
9438         * sysdep.c: Include limits.h unconditionally.
9440         Assume support for memcmp, memcpy, memmove, memset.
9441         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
9442         * regex.c (memcmp, memcpy):
9443         Remove; we assume C89 now.
9445         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
9446         (__malloc_safe_bcopy): Remove; no longer needed.
9448         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
9449         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
9450         well either way, and we prefer signed to unsigned.
9452 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9454         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
9455         closes the connection while we're reading (bug#9182).
9457 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
9459         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
9460         are specified (Bug#9168).
9462 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
9464         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
9465         Found by GCC static checking and --with-wide-int on a 32-bit host.
9467 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
9469         * xdisp.c (compute_display_string_pos): Fix logic of caching
9470         previous display string position.  Initialize cached_prev_pos to
9471         -1.  Fixes slow-down at the beginning of a buffer.
9473 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
9475         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
9476         for attrs[LFACE_FONTSET_INDEX].
9478 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
9480         * xml.c (parse_region): Remove unused local
9481         that was recently introduced.
9483 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
9485         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
9486         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
9488         * xdisp.c (move_it_in_display_line_to): Record the best matching
9489         position for TO_CHARPOS while scanning the line, and restore it on
9490         exit if none of the characters scanned was an exact match.
9491         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
9492         when exact match is impossible due to invisible text, and the
9493         lines are truncated.
9495 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
9497         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
9498         for OSX >= 10.7.
9500 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
9502         Fix a significant slow-down of cursor motion with C-n, C-p,
9503         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
9504         auto-repeat under bidi redisplay in fontified buffers.
9505         * xdisp.c (compute_stop_pos_backwards): New function.
9506         (next_element_from_buffer): Call compute_stop_pos_backwards to
9507         find a suitable prev_stop when we find ourselves before
9508         base_level_stop.
9509         (reseat): Don't look for prev_stop, as that could mean a very long
9510         run.
9511         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
9512         <cached_disp_overlay_modiff>: Cache for last found display string
9513         position.
9514         (compute_display_string_pos): Return the cached position if asked
9515         about the same buffer in the same area of character positions, and
9516         the buffer wasn't changed since the time the display string
9517         position was cached.
9519 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
9521         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
9522         is an integer, which is important for empty lines.  (Bug#9149)
9524 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
9526         * frame.c (Fmodify_frame_parameters): In tty case, update the
9527         default face if necessary (Bug#4238).
9529 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
9531         * editfns.c (Fstring_to_char): No need to explain what a character
9532         is in the docstring (Bug#6576).
9534 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9536         * xml.c (parse_region): Make sure we always return a tree.
9538 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
9540         * xml.c (parse_region): If a document contains only comments,
9541         return that, too.
9543 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9545         * xml.c (make_dom): Return comments, too.
9547 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
9549         Port to OpenBSD.
9550         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
9551         and the surrounding thread.
9552         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
9553         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
9554         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
9555         timer goes off.
9556         * s/openbsd.h (BROKEN_SIGIO): Define.
9557         * unexelf.c (unexec) [__OpenBSD__]:
9558         Don't update the .mdebug section of the Alpha COFF symbol table.
9560 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9562         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
9563         (bug#8460).
9565 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
9567         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
9568         This fixes some race conditions on the permissions of any newly
9569         created file.
9571         * alloc.c (valid_pointer_p): Use pipe, not open.
9572         This fixes some permissions issues when debugging.
9574         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
9575         If fchown fails to set both uid and gid, try to set just gid,
9576         as that is sometimes allowed.  Adjust the file's mode to eliminate
9577         setuid or setgid bits that are inappropriate if fchown fails.
9579 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
9581         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
9582         to compare Lisp_Objects.
9583         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
9584         global_gnutls_log_level, don't mistake it for a Lisp_Object.
9585         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
9587 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
9589         * lread.c (read_integer): Unread even EOF character.
9590         (read1): Likewise.  Properly record start position of symbol.
9592         * lread.c (read1): Read `#:' as empty uninterned symbol if no
9593         symbol character follows.
9595 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
9597         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
9598         This works around a problem with the previous change to Fcopy_file.
9599         Recent glibc declares fchown with __attribute__((warn_unused_result)),
9600         and without this change, GCC might complain about discarding
9601         fchown's return value.
9603 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
9605         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
9607 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
9609         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
9611 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9613         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
9614         it's used from the C level.
9616         * process.c: Use the same condition for POLL_FOR_INPUT in both
9617         keyboard.c and process.c (bug#1858).
9619 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
9621         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
9622         (Fgnutls_boot): Use it.
9624 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
9626         * doc.c (Fsubstitute_command_keys): Revert last change.
9628 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9630         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
9631         quotes the next character, and doesn't affect other longer
9632         sequences (bug#8935).
9634         * lread.c (syms_of_lread): Clarify that is isn't only
9635         `eval-buffer' and `eval-defun' that's affected by
9636         `lexical-binding' (bug#8460).
9638 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
9640         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
9641         bidi redisplay when a line includes both an image and is truncated.
9643 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
9645         Fix minor problems found by static checking.
9646         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
9647         (elsz): Now a signed constant, not a size_t var.  We prefer signed
9648         types to unsigned, to avoid integer comparison confusion.  Without
9649         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
9650         "cannot optimize loop, the loop counter may overflow", a symptom
9651         of the confusion.
9652         * indent.c (Fvertical_motion): Mark locals as initialized.
9653         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
9655 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9657         * search.c (Fre_search_backward): Mention `case-fold-search' in
9658         all the re_search_* functions (bug#8138).
9660         * keyboard.c (Fopen_dribble_file): Document when the file is
9661         closed (bug#8056).
9663 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
9665         * bidi.c (bidi_dump_cached_states): Fix format of displaying
9666         bidi_cache_idx.
9668         Support bidi reordering of display and overlay strings.
9669         * xdisp.c (compute_display_string_pos)
9670         (compute_display_string_end): Accept additional argument STRING.
9671         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
9672         (reseat_to_string): Initialize bidi_it->string.s and
9673         bidi_it->string.schars.
9674         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
9675         NULL (avoids a crash in bidi_paragraph_init).
9676         Initialize itb.string.lstring.
9677         (init_iterator): Call bidi_init_it only of a valid
9678         buffer position was specified.  Initialize paragraph_embedding to
9679         L2R.
9680         (reseat_to_string): Initialize the bidi iterator.
9681         (display_string): If we need to ignore text properties of
9682         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
9683         original value of -1 will not work with bidi.)
9684         (compute_display_string_pos): First arg is now struct
9685         `text_pos *'; all callers changed.  Support display properties on
9686         Lisp strings.
9687         (compute_display_string_end): Support display properties on Lisp
9688         strings.
9689         (init_iterator, reseat_1, reseat_to_string): Initialize the
9690         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
9691         when iterating on a string not from display properties).
9692         (compute_display_string_pos, compute_display_string_end):
9693         Fix calculation of the object to scan.  Fixes an error when using
9694         arrow keys.
9695         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
9696         base_level_stop; instead, set base_level_stop to BEGV.
9697         Fixes crashes in vertical-motion.
9698         (next_element_from_buffer): Improve commentary for when
9699         the iterator is before prev_stop.
9700         (init_iterator): Initialize bidi_p from the default value of
9701         bidi-display-reordering, not from buffer-local value.  Use the
9702         buffer-local value only if initializing for buffer iteration.
9703         (handle_invisible_prop): Support invisible properties on strings
9704         that are being bidi-reordered.
9705         (set_iterator_to_next): Support bidi reordering of C strings and
9706         Lisp strings.
9707         (next_element_from_string): Support bidi reordering of Lisp
9708         strings.
9709         (handle_stop_backwards): Support Lisp strings as well.
9710         (display_string): Support display of R2L glyph rows.
9711         Use IT_STRING_CHARPOS when displaying from a Lisp string.
9712         (init_iterator): Don't initialize it->bidi_p for strings
9713         here.
9714         (reseat_to_string): Initialize it->bidi_p for strings here.
9715         (next_element_from_string, next_element_from_c_string)
9716         (next_element_from_buffer): Add xassert's for correspondence
9717         between IT's object being iterated and it->bidi_it.string
9718         structure.
9719         (face_before_or_after_it_pos): Support bidi iteration.
9720         (next_element_from_c_string): Handle the case of the first string
9721         character that is not the first one in the visual order.
9722         (get_visually_first_element): New function, refactored from common
9723         parts of next_element_from_buffer, next_element_from_string, and
9724         next_element_from_c_string.
9725         (tool_bar_lines_needed, redisplay_tool_bar)
9726         (display_menu_bar): Force left-to-right direction.  Add a FIXME
9727         comment for making that be controlled by a user option.
9728         (push_it, pop_it): Save and restore the state of the
9729         bidi iterator.  Save and restore the bidi_p flag.
9730         (pop_it): Iterate out of display property for string iteration as
9731         well.
9732         (iterate_out_of_display_property): Support iteration over strings.
9733         (handle_single_display_spec): Set up it->bidi_it for iteration
9734         over a display string, and call bidi_init_it.
9735         (handle_single_display_spec, next_overlay_string)
9736         (get_overlay_strings_1, push_display_prop): Set up the bidi
9737         iterator for displaying display or overlay strings.
9738         (forward_to_next_line_start): Don't use the shortcut if
9739         bidi-iterating.
9740         (back_to_previous_visible_line_start): If handle_display_prop
9741         pushed the iterator stack, restore the internal state of the bidi
9742         iterator by calling bidi_pop_it same number of times.
9743         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
9744         and we are bidi-iterating, don't decrement the iterator position;
9745         instead, set the first_elt flag in the bidi iterator, to produce
9746         the same effect.
9747         (reseat_1): Remove redundant setting of string_from_display_prop_p.
9748         (push_display_prop): xassert that we are iterating a buffer.
9749         (push_it, pop_it): Save and restore paragraph_embedding member.
9750         (handle_single_display_spec, next_overlay_string)
9751         (get_overlay_strings_1, reseat_1, reseat_to_string)
9752         (push_display_prop): Set up the `unibyte' member of bidi_it.string
9753         correctly.  Don't assume unibyte strings are not bidi-reordered.
9754         (compute_display_string_pos)
9755         (compute_display_string_end): Fix handling the case of C string.
9756         (push_it, pop_it): Save and restore from_disp_prop_p.
9757         (handle_single_display_spec, push_display_prop): Set the
9758         from_disp_prop_p flag.
9759         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
9760         (pop_it): Call iterate_out_of_display_property only if we are
9761         popping after iteration over a string that came from a display
9762         property.  Fix a typo in popping stretch info.  Add an assertion
9763         for verifying that the iterator position is in sync with the bidi
9764         iterator.
9765         (handle_single_display_spec, get_overlay_strings_1)
9766         (push_display_prop): Fix initialization of paragraph direction for
9767         string when that of the parent object is not yet determined.
9768         (reseat_1): Call bidi_init_it to resync the bidi
9769         iterator with IT's position.  (Bug#7616)
9770         (find_row_edges): If ROW->start.pos gives position
9771         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
9772         (handle_stop, back_to_previous_visible_line_start, reseat_1):
9773         Reset the from_disp_prop_p flag.
9774         (SAVE_IT, RESTORE_IT): New macros.
9775         (pos_visible_p, face_before_or_after_it_pos)
9776         (back_to_previous_visible_line_start)
9777         (move_it_in_display_line_to, move_it_in_display_line)
9778         (move_it_to, move_it_vertically_backward, move_it_by_lines)
9779         (try_scrolling, redisplay_window, display_line): Use them when
9780         saving a temporary copy of the iterator and restoring it back.
9781         (back_to_previous_visible_line_start, reseat_1)
9782         (init_iterator): Empty the bidi cache "stack".
9783         (move_it_in_display_line_to): If iterator ended up at
9784         EOL, but we never saw any buffer positions smaller than
9785         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
9786         motion in bidi-reordered lines.
9787         (move_it_in_display_line_to): Record prev_method and prev_pos
9788         immediately before the call to set_iterator_to_next.  Fixes cursor
9789         motion in bidi-reordered lines with stretch glyphs and strings
9790         displayed in margins.  (Bug#8133) (Bug#8867)
9791         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
9792         TO_CHARPOS.
9793         (pos_visible_p): Support positions in bidi-reordered lines.
9794         Save and restore bidi cache.
9796         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
9797         (bidi_paragraph_info): Delete unused struct.
9798         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
9799         (bidi_cache_start): New variable.
9800         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
9801         to zero.
9802         (bidi_cache_fetch_state, bidi_cache_search)
9803         (bidi_cache_find_level_change, bidi_cache_iterator_state)
9804         (bidi_cache_find, bidi_peek_at_next_level)
9805         (bidi_level_of_next_char, bidi_find_other_level_edge)
9806         (bidi_move_to_visually_next): Compare cache index with
9807         bidi_cache_start rather than with zero.
9808         (bidi_fetch_char): Accept new argument STRING; all callers
9809         changed.  Support iteration over a string.  Support strings with
9810         display properties.  Support unibyte strings.  Fix the type of
9811         `len' according to what STRING_CHAR_AND_LENGTH expects.
9812         (bidi_paragraph_init, bidi_resolve_explicit_1)
9813         (bidi_resolve_explicit, bidi_resolve_weak)
9814         (bidi_level_of_next_char, bidi_move_to_visually_next):
9815         Support iteration over a string.
9816         (bidi_set_sor_type, bidi_resolve_explicit_1)
9817         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
9818         can now be zero (for strings); special values 0 and -1 were
9819         changed to -1 and -2, respectively.
9820         (bidi_char_at_pos): New function.
9821         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
9822         Call it instead of FETCH_MULTIBYTE_CHAR.
9823         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
9824         initialized to valid values.
9825         (bidi_init_it): Don't initialize charpos and bytepos with invalid
9826         values.
9827         (bidi_level_of_next_char): Allow the sentinel "position" to pass
9828         the test for valid cached positions.  Fix the logic for looking up
9829         the sentinel state in the cache.  GCPRO the Lisp string we are
9830         iterating.
9831         (bidi_push_it, bidi_pop_it): New functions.
9832         (bidi_initialize): Initialize the bidi cache start stack pointer.
9833         (bidi_cache_ensure_space): New function, refactored from part of
9834         bidi_cache_iterator_state.  Don't assume the required size is just
9835         one BIDI_CACHE_CHUNK away.
9836         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
9837         (bidi_count_bytes, bidi_char_at_pos): New functions.
9838         (bidi_cache_search): Don't assume bidi_cache_last_idx is
9839         always valid if bidi_cache_idx is valid.
9840         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
9841         is valid if it's going to be used.
9842         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
9843         (bidi_cache_fetch_state, bidi_cache_search)
9844         (bidi_cache_find_level_change, bidi_cache_ensure_space)
9845         (bidi_cache_iterator_state, bidi_cache_find)
9846         (bidi_find_other_level_edge, bidi_cache_start_stack):
9847         All variables related to cache indices are now EMACS_INT.
9849         * dispextern.h (struct bidi_string_data): New structure.
9850         (struct bidi_it): New member `string'.  Make flag members be 1-bit
9851         fields, and put them last in the struct.
9852         (compute_display_string_pos, compute_display_string_end):
9853         Update prototypes.
9854         (bidi_push_it, bidi_pop_it): Add prototypes.
9855         (struct iterator_stack_entry): New members bidi_p,
9856         paragraph_embedding, and from_disp_prop_p.
9857         (struct it): Member bidi_p is now a bit field 1 bit wide.
9858         (bidi_shelve_cache, bidi_unshelve_cache):
9859         Declare prototypes.
9861         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
9862         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
9863         and vector-like objects.
9865         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
9866         cache around display iteration.
9868         * window.c (Fwindow_end, window_scroll_pixel_based)
9869         (displayed_window_lines, Frecenter): Save and restore the bidi
9870         cache around display iteration.
9872 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9874         * editfns.c (Fdelete_region): Clarify the use of the named
9875         parameters (bug#6788).
9877 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
9879         * indent.c (Fvertical_motion): Set and restore w->pointm when
9880         saving and restoring the window's buffer (Bug#9006).
9882 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9884         * editfns.c (Fstring_to_char): Clarify just what is returned
9885         (bug#6576).  Text by Eli Zaretskii.
9887 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
9889         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
9891 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
9893         * buffer.c (mmap_find): Fix a typo.
9895 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
9897         Fix execution of x selection hooks.
9898         * xselect.c (Qx_lost_selection_functions)
9899         (Qx_sent_selection_functions): New vars.
9900         (syms_of_xselect): DEFSYM them.
9901         (x_handle_selection_request): Pass Qx_sent_selection_functions
9902         rather than Vx_sent_selection_functions to Frun_hook_with_args.
9903         (x_handle_selection_clear,x_clear_frame_selections):
9904         Pass Qx_lost_selection_functions rather than
9905         Vx_lost_selection_functions to Frun_hook_with_args.
9907 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
9909         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
9910         The old code sometimes used this field without initializing it.
9912         * alloc.c (gc_sweep): Don't read past end of array.
9913         In theory, the old code could also have corrupted Emacs internals,
9914         though it'd be very unlikely.
9916 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
9918         * character.c (Fcharacterp): Don't advertise optional ignored
9919         argument.  (Bug#4026)
9921 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9923         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
9924         key" (bug#4257).
9926         * window.c (Fset_window_start): Doc fix (bug#4199).
9927         (Fset_window_hscroll): Ditto.
9929 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
9931         Fix minor new problems caught by GCC 4.6.1.
9932         * term.c (init_tty): Remove unused local.
9933         * xsettings.c (store_monospaced_changed): Define this function only
9934         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
9935         not used otherwise.
9937 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
9939         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
9941 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
9943         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
9944         are the mini-buffer and the echo area (bug#3320).
9946         * term.c (init_tty): Remove support for supdup, c10 and perq
9947         terminals, which are no longer supported (bug#1482).
9949 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
9951         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
9953 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
9955         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
9956         for non-popups (Bug#3642).
9958 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
9960         * alloc.c (reset_malloc_hooks): Protoize.
9961         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
9962         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
9963         * cm.c (losecursor): Likewise.
9964         * data.c (fmod): Likewise.
9965         * dispnew.c (swap_glyphs_in_rows): Likewise.
9966         * emacs.c (memory_warning_signal): Likewise.
9967         * floatfns.c (float_error): Likewise.
9968         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
9969         (otf_open, font_otf_capability, generate_otf_features)
9970         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
9971         Likewise.
9972         * image.c (pbm_read_file): Likewise.
9973         * indent.c (string_display_width): Likewise.
9974         * intervals.c (check_for_interval, search_for_interval)
9975         (inc_interval_count, count_intervals, root_interval)
9976         (adjust_intervals_for_insertion, make_new_interval): Likewise.
9977         * lread.c (defalias): Likewise.
9978         * ralloc.c (r_alloc_check): Likewise.
9979         * regex.c (set_image_of_range_1, set_image_of_range)
9980         (regex_grow_registers): Likewise.
9981         * sysdep.c (strerror): Likewise.
9982         * termcap.c (valid_filename_p, tprint, main): Likewise.
9983         * tparam.c (main): Likewise.
9984         * unexhp9k800.c (run_time_remap, save_data_space)
9985         (update_file_ptrs, read_header, write_header, calculate_checksum)
9986         (copy_file, copy_rest, display_header): Likewise.
9987         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
9988         Likewise.
9989         * xdisp.c (check_it): Likewise.
9990         * xfaces.c (register_color, unregister_color, unregister_colors):
9991         Likewise.
9992         * xfns.c (print_fontset_result): Likewise.
9993         * xrdb.c (member, fatal, main): Likewise.
9995 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
9997         Fix minor problems found by static checking (Bug#9031).
9998         * chartab.c (char_table_set_range, map_sub_char_table):
9999         Remove unused locals.
10000         (uniprop_table): Now static.
10001         * composite.c (_work_char): Remove unused static var.
10003 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
10005         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10007 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
10009         * gtkutil.c (qttip_cb): Remove code without function.
10011 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
10013         * w32.c (pthread_sigmask): New stub.
10015 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
10017         Use pthread_sigmask, not sigprocmask (Bug#9010).
10018         sigprocmask is portable only for single-threaded applications, and
10019         Emacs can be multi-threaded when it uses GTK.
10020         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10021         (LIBES): Use it.
10022         * callproc.c (Fcall_process):
10023         * process.c (create_process):
10024         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10025         Use pthread_sigmask, not sigprocmask.
10027 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
10029         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10030         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10031         wrong (Bug#8591).
10033 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
10035         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10036         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10037         (xg_hide_tooltip): Fix comment.
10039         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10040         in registerServicesMenuSendTypes.
10041         (validRequestorForSendType): Don't check ns_return_types.
10043         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10044         ns_return_type.
10046 2011-07-08  Jason Rumney  <jasonr@gnu.org>
10048         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10049         SH_SHOW for hidden windows (Bug#5482).
10051         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10052         frame struct members of non-existent frames (Bug#6284).
10054 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
10056         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10057         variable firstTime not needed on OSX >= 10.6.
10058         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10059         >= 10.5.  Use setKnobProportion, setDoubleValue.
10061         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10062         (MAC_OS_X_VERSION_10_5): Define if not defined.
10063         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10064         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10065         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10067         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
10068         cString and lossyCString on OSX >= 10.4.
10070         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
10071         sizeToFit on OSX >= 10.2.
10073         * nsimage.m (allocInitFromFile): Don't use deprecated method
10074         bestRepresentationForDevice on OSX >= 10.6.
10076         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10077         to avoid warning.
10079         * emacs.c: Declare unexec_init_emacs_zone.
10081         * nsgui.h: Fix compiler warning about gnulib redefining verify.
10083         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10085         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10086         on svcsMenu (Bug#8842).
10088         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10089         ns_return_types.
10090         (Fns_list_services): Just return Qnil on 10.6, code not working there.
10092         * nsterm.m (QUTF8_STRING): Declare.
10093         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10094         (validRequestorForSendType): Return type is (id).
10095         Change indexOfObjectIdenticalTo to indexOfObject.
10096         Check if we have local selection before returning self (Bug#8842).
10097         (writeSelectionToPasteboard): Put local selection into paste board
10098         if we have a local selection (Bug#8842).
10099         (syms_of_nsterm): DEFSYM QUTF8_STRING.
10101         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10102         (ns_get_local_selection): Declare.
10104 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10106         * keymap.c (describe_map_tree): Don't insert a double newline at
10107         the end of the buffer (bug#1169) and return whether we inserted
10108         something.
10110         * callint.c (Fcall_interactively): Change "reading args" to
10111         "providing args" to try to clarify what it does (bug#1010).
10113 2011-07-07  Kenichi Handa  <handa@m17n.org>
10115         * composite.c (composition_compute_stop_pos): Ignore a static
10116         composition starting before CHARPOS (Bug#8915).
10118         * xdisp.c (handle_composition_prop): Likewise.
10120 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
10122         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10123         (Bug#9015)
10125 2011-07-07  Kenichi Handa  <handa@m17n.org>
10127         * character.h (unicode_category_t): New enum type.
10129         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10130         (Qchar_code_property_table): New variable.
10131         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10132         (UNIPROP_COMPRESSED_FORM_P): New macros.
10133         (char_table_ascii): Uncompress the compressed values.
10134         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
10135         Uncompress the compressed values.
10136         (sub_char_table_ref_and_range): Likewise.
10137         (char_table_ref_and_range): Uncompress the compressed values.
10138         (sub_char_table_set): New arg is_uniprop.  Callers changed.
10139         Uncompress the compressed values.
10140         (sub_char_table_set_range): Args changed.  Callers changed.
10141         (char_table_set_range): Adjuted for the above change.
10142         (map_sub_char_table): Delete args default_val and parent.  Add arg
10143         top.  Give decoded values to a Lisp function.
10144         (map_char_table): Adjust for the above change.  Give decoded
10145         values to a Lisp function.  Gcpro more variables.
10146         (uniprop_table_uncompress)
10147         (uniprop_decode_value_run_length): New functions.
10148         (uniprop_decoder, uniprop_decoder_count): New variables.
10149         (uniprop_get_decoder, uniprop_encode_value_character)
10150         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10151         New functions.
10152         (uniprop_encoder, uniprop_encoder_count): New variables.
10153         (uniprop_get_encoder, uniprop_table)
10154         (Funicode_property_table_internal, Fget_unicode_property_internal)
10155         (Fput_unicode_property_internal): New functions.
10156         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10157         Sunicode_property_table_internal, Sget_unicode_property_internal,
10158         and Sput_unicode_property_internal.  Defvar_lisp
10159         char-code-property-alist.
10161         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
10162         Vunicode_category_table.
10164         * font.c (font_range): Adjust for the change of
10165         Vunicode_category_table.
10167 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
10169         * m/iris4d.h: Remove file, move contents ...
10170         * s/irix6-5.h: ... here.
10172 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
10174         Remove unportable assumption about struct layout (Bug#8884).
10175         * alloc.c (mark_buffer):
10176         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
10177         (clone_per_buffer_values): Don't assume that
10178         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
10179         This isn't true in general, and it's particularly not true
10180         if Emacs is configured with --with-wide-int.
10181         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
10182         New macros, used in the buffer.c change.
10184 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
10186         * xsettings.c: Use both GConf and GSettings if both are available.
10187         (store_config_changed_event): Add comment.
10188         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
10189         (store_tool_bar_style_changed): New functions.
10190         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
10191         (struct xsettings): Move font inside HAVE_XFT.
10192         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
10193         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
10194         Move inside HAVE_XFT.
10195         (something_changed_gsettingsCB): Rename from something_changedCB.
10196         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
10197         also.
10198         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
10199         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
10200         (something_changed_gconfCB): Rename from something_changedCB.
10201         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
10202         (parse_settings): Move check for font inside HAVE_XFT.
10203         (read_settings, apply_xft_settings): Add comment.
10204         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
10205         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
10206         call store_font_name_changed.
10207         (xft_settings_event): Add comment.
10208         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
10209         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
10210         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
10211         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
10212         (xsettings_initialize): Call init_gsettings last.
10213         (xsettings_get_system_font, xsettings_get_system_normal_font):
10214         Add comment.
10216 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
10218         Random fixes.  E.g., (random) never returned negative values.
10219         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
10220         subseconds part to the entropy, as that's a bit more random.
10221         Prefer signed to unsigned, since the signedness doesn't matter and
10222         in general we prefer signed.  When given a limit, use a
10223         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
10224         latter isn't right if USE_2_TAGS_FOR_INTS.
10225         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
10226         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
10228 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
10230         * textprop.c (text_property_stickiness):
10231         Obey Vtext_property_default_nonsticky.
10232         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
10233         * w32fns.c (syms_of_w32fns):
10234         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
10236 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10238         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
10239         This is more efficient than Ffile_directory_p and avoids a minor race.
10241 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10243         * buffer.c (Foverlay_put): Say what the return value is
10244         (bug#7835).
10246         * fileio.c (barf_or_query_if_file_exists): Check first if the file
10247         is a directory before asking whether to use the file name
10248         (bug#7564).
10249         (barf_or_query_if_file_exists): Make the "File is a directory"
10250         error be more correct.
10252         * fns.c (Frequire): Remove the mention of the .gz files, since
10253         that's installation-specific, but keep the mention of
10254         `get-load-suffixes'.
10256 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
10258         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
10259         Report string overflow if the output is too long.
10261 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
10263         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
10264         (syms_of_gnutls): Remove duplicate DEFSYM for
10265         Qgnutls_bootprop_verify_hostname_error, an error for
10266         Qgnutls_bootprop_verify_error (which is no longer used).
10268         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
10269         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
10270         Also (re)move comments that are misplaced or no longer relevant.
10272 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10274         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
10276 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
10278         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
10279         and background color parameters if they have been changed.
10281 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10283         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
10285 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
10287         * xsettings.c (SYSTEM_FONT): Define only when used.
10288         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
10290         * keymap.c (access_keymap_1): Now static.
10292 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
10294         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
10295         leave any prefix arg for the up event (Bug#1586).
10297 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
10299         * lread.c (syms_of_lread): Mention single symbols defined by
10300         `defvar' or `defconst' (bug#7154).
10302         * fns.c (Frequire): Mention .el.gz files (bug#7314).
10303         (Frequire): Mention get-load-suffixes.
10305 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
10307         * window.h (window): Remove clone_number slot.
10308         * window.c (Fwindow_clone_number, Fset_window_clone_number):
10309         Remove.
10310         (make_parent_window, make_window, saved_window)
10311         (Fset_window_configuration, save_window_save): Don't deal with
10312         clone numbers.
10313         * buffer.c (Qclone_number): Remove declaration.
10314         (sort_overlays, overlay_strings): Don't deal with clone numbers.
10316 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
10318         Add multiple inheritance to keymaps.
10319         * keymap.c (Fmake_composed_keymap): New function.
10320         (Fset_keymap_parent): Simplify.
10321         (fix_submap_inheritance): Remove.
10322         (access_keymap_1): New function extracted from access_keymap to handle
10323         embedded parents and handle lists of maps.
10324         (access_keymap): Use it.
10325         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
10326         (Fcopy_keymap): Handle embedded parents.
10327         (Fcommand_remapping, define_as_prefix): Simplify.
10328         (Fkey_binding): Simplify.
10329         (syms_of_keymap): Move minibuffer-local-completion-map,
10330         minibuffer-local-filename-completion-map,
10331         minibuffer-local-must-match-map, and
10332         minibuffer-local-filename-must-match-map to Elisp.
10333         (syms_of_keymap): Defsubr make-composed-keymap.
10334         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
10335         (parse_menu_item): Trivial simplification.
10337 2011-07-01  Glenn Morris  <rgm@gnu.org>
10339         * Makefile.in (SETTINGS_LIBS): Fix typo.
10341 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
10343         * coding.c (Fencode_coding_string): Record the last coding system
10344         used, as the function doc string says (bug#8738).
10346 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
10348         * xsettings.c (store_monospaced_changed): Take new font as arg and
10349         check for change against current_mono_font.
10350         (EMACS_TYPE_SETTINGS): Remove this and related defines.
10351         (emacs_settings_constructor, emacs_settings_get_property)
10352         (emacs_settings_set_property, emacs_settings_class_init)
10353         (emacs_settings_init, gsettings_obj): Remove.
10354         (something_changedCB): New function for HAVE_GSETTINGS.
10355         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
10356         with value as argument.
10357         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
10358         g_settings_new (Bug#8967).  Do not create gsettings_obj.
10359         Remove calls to g_settings_bind.  Connect something_changedCB to
10360         "changed".
10362         * xgselect.c: Add defined (HAVE_GSETTINGS).
10363         (xgselect_initialize): Ditto.
10365         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
10366         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
10367         xg_select.
10369 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
10371         * eval.c (struct backtrace): Simplify and port the data structure.
10372         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
10373         signed bit field, as this assumption is not portable and it makes
10374         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
10375         "char debug_on_exit : 1" as this is not portable either; instead,
10376         use the portable "unsigned int debug_on_exit : 1".  Remove unused
10377         member evalargs.  Remove obsolete comments about cc bombing out.
10379 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
10381         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
10382         Let HAVE_GSETTINGS override HAVE_GCONF.
10383         (store_monospaced_changed): New function.
10384         (EMACS_SETTINGS): A new type derived from GObject to handle
10385         GSettings notifications.
10386         (emacs_settings_constructor, emacs_settings_get_property)
10387         (emacs_settings_set_property, emacs_settings_class_init):
10388         New functions.
10389         (gsettings_client, gsettings_obj): New variables.
10390         (GSETTINGS_SCHEMA): New define.
10391         (something_changedCB): Call store_monospaced_changed.
10392         (init_gsettings): New function.
10393         (xsettings_initialize): Call init_gsettings.
10394         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
10395         to NULL.
10397         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
10398         GCONF_CFLAGS/LIBS.
10400 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
10402         * window.c (resize_root_window, grow_mini_window)
10403         (shrink_mini_window): Rename Qresize_root_window to
10404         Qwindow_resize_root_window and Qresize_root_window_vertically to
10405         Qwindow_resize_root_window_vertically.
10407 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
10409         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
10411 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
10413         * makefile.w32-in: Redesign dependencies so they reflect more
10414         clearly which files are directly included by each source file,
10415         and not through other includes.
10417 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
10419         * buffer.c (Qclone_number): Declare static and DEFSYM it.
10420         (sort_overlays, overlay_strings): When an overlay's clone number
10421         matches the window's clone number process the overlay even if
10422         the overlay's window property doesn't match the current window.
10424         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
10425         (Fwindow_hchild): Rename to Fwindow_left_child.
10426         (Fwindow_next): Rename to Fwindow_next_sibling.
10427         (Fwindow_prev): Rename to Fwindow_prev_sibling.
10428         (resize_window_check): Rename to window_resize_check.
10429         (resize_window_apply): Rename to window_resize_apply.
10430         (Fresize_window_apply): Rename to Fwindow_resize_apply.
10431         (Fdelete_other_windows_internal, resize_frame_windows)
10432         (Fsplit_window_internal, Fdelete_window_internal)
10433         (grow_mini_window, shrink_mini_window)
10434         (Fresize_mini_window_internal): Fix callers accordingly.
10436 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
10438         * emacsgtkfixed.h: State that this is only used with Gtk+3.
10439         (emacs_fixed_set_min_size): Remove.
10440         (emacs_fixed_new): Take frame as argument.
10442         * emacsgtkfixed.c: State that this is only used with Gtk+3.
10443         (_EmacsFixedPrivate): Remove minwidth/height.
10444         Add struct frame *f.
10445         (emacs_fixed_init): Initialize priv->f.
10446         (get_parent_class, emacs_fixed_set_min_size): Remove.
10447         (emacs_fixed_new): Set priv->f to argument.
10448         (emacs_fixed_get_preferred_width)
10449         (emacs_fixed_get_preferred_height): Use min_width/height from
10450         frames size_hint to set minimum and natural (Bug#8919).
10451         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
10452         and use min_width/height from frames size_hint to set
10453         min_width/height (Bug#8919).
10455         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
10456         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
10457         Fix indentation.
10459 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
10461         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
10462         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
10463         called at ZV.
10465 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
10467         * process.c (wait_reading_process_output): Bypass select if
10468         waiting for a cell while ignoring keyboard input, and input is
10469         pending.  Suggested by Jan Djärv (Bug#8869).
10471 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
10473         Use gnulib's dup2 module instead of rolling our own.
10474         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
10476 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
10478         * dispnew.c (scrolling_window): Before scrolling, turn off a
10479         mouse-highlight in the window being scrolled.
10481 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
10483         Move DEFSYM to lisp.h and use everywhere.
10485         * character.h (DEFSYM): Move declaration...
10486         * lisp.h (DEFSYM): ...here.
10488         * gnutls.c:
10489         * minibuf.c:
10490         * w32menu.c:
10491         * w32proc.c:
10492         * w32select.c: Don't include character.h.
10494         * alloc.c (syms_of_alloc):
10495         * buffer.c (syms_of_buffer):
10496         * bytecode.c (syms_of_bytecode):
10497         * callint.c (syms_of_callint):
10498         * casefiddle.c (syms_of_casefiddle):
10499         * casetab.c (init_casetab_once):
10500         * category.c (init_category_once, syms_of_category):
10501         * ccl.c (syms_of_ccl):
10502         * cmds.c (syms_of_cmds):
10503         * composite.c (syms_of_composite):
10504         * dbusbind.c (syms_of_dbusbind):
10505         * dired.c (syms_of_dired):
10506         * dispnew.c (syms_of_display):
10507         * doc.c (syms_of_doc):
10508         * editfns.c (syms_of_editfns):
10509         * emacs.c (syms_of_emacs):
10510         * eval.c (syms_of_eval):
10511         * fileio.c (syms_of_fileio):
10512         * fns.c (syms_of_fns):
10513         * frame.c (syms_of_frame):
10514         * fringe.c (syms_of_fringe):
10515         * insdel.c (syms_of_insdel):
10516         * keymap.c (syms_of_keymap):
10517         * lread.c (init_obarray, syms_of_lread):
10518         * macros.c (syms_of_macros):
10519         * msdos.c (syms_of_msdos):
10520         * print.c (syms_of_print):
10521         * process.c (syms_of_process):
10522         * search.c (syms_of_search):
10523         * sound.c (syms_of_sound):
10524         * syntax.c (init_syntax_once, syms_of_syntax):
10525         * terminal.c (syms_of_terminal):
10526         * textprop.c (syms_of_textprop):
10527         * undo.c (syms_of_undo):
10528         * w32.c (globals_of_w32):
10529         * window.c (syms_of_window):
10530         * xdisp.c (syms_of_xdisp):
10531         * xfaces.c (syms_of_xfaces):
10532         * xfns.c (syms_of_xfns):
10533         * xmenu.c (syms_of_xmenu):
10534         * xsettings.c (syms_of_xsettings):
10535         * xterm.c (syms_of_xterm): Use DEFSYM.
10537 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
10539         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
10541 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
10543         Integer and buffer overflow fixes (Bug#8873).
10545         * print.c (printchar, strout): Check for string overflow.
10546         (PRINTPREPARE, printchar, strout):
10547         Don't set size unless allocation succeeds.
10549         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
10550         for sizes.  Check for string overflow more accurately.
10551         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
10553         * macros.c: Integer and buffer overflow fixes.
10554         * keyboard.h (struct keyboard.kbd_macro_bufsize):
10555         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
10556         Use ptrdiff_t, not int, for sizes.
10557         Don't increment bufsize until after realloc succeeds.
10558         Check for size-calculation overflow.
10559         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
10561         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
10563         * lread.c: Integer overflow fixes.
10564         (read_integer): Radix is now EMACS_INT, not int,
10565         to improve quality of diagnostics for out-of-range radices.
10566         Calculate buffer size correctly for out-of-range radices.
10567         (read1): Check for integer overflow in radices, and in
10568         read-circle numbers.
10569         (read_escape): Avoid int overflow.
10570         (Fload, openp, read_buffer_size, read1)
10571         (substitute_object_recurse, read_vector, read_list, map_obarray):
10572         Use ptrdiff_t, not int, for sizes.
10573         (read1): Use EMACS_INT, not int, for sizes.
10574         Check for size overflow.
10576         * image.c (cache_image): Check for size arithmetic overflow.
10578         * lread.c: Integer overflow issues.
10579         (saved_doc_string_size, saved_doc_string_length)
10580         (prev_saved_doc_string_size, prev_saved_doc_string_length):
10581         Now ptrdiff_t, not int.
10582         (read1): Don't assume doc string length fits in int.  Check for
10583         out-of-range doc string lengths.
10584         (read_list): Don't assume file position fits in int.
10585         (read_escape): Check for hex character overflow.
10587 2011-06-22  Leo Liu  <sdl.web@gmail.com>
10589         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
10590         Move to minibuffer.el.
10592 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
10594         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
10595         The following patches are for when GLYPH_DEBUG && !XASSERT.
10596         * dispextern.h (trace_redisplay_p, dump_glyph_string):
10597         * dispnew.c (flush_stdout):
10598         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
10599         Mark as externally visible.
10600         * dispnew.c (check_window_matrix_pointers): Now static.
10601         * dispnew.c (window_to_frame_vpos):
10602         * xfns.c (unwind_create_frame):
10603         * xterm.c (x_check_font): Remove unused local.
10604         * scroll.c (CHECK_BOUNDS):
10605         * xfaces.c (cache_fache): Rename local to avoid shadowing.
10606         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
10607         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
10608         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
10609         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
10610         Now static.
10611         (debug_method_add): Use va_list and vsprintf rather than relying
10612         on undefined behavior with wrong number of arguments.
10613         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
10614         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
10615         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
10616         since we're not interested in debugging glyphs with old libraries.
10617         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
10618         GCC 4.6.0's static checking.
10620 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
10622         Integer overflow and signedness fixes (Bug#8873).
10623         A few related buffer overrun fixes, too.
10625         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
10627         * dispextern.h (struct face.stipple):
10628         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
10629         (x_bitmap_mask, x_allocate_bitmap_record)
10630         (x_create_bitmap_from_data, x_create_bitmap_from_file)
10631         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
10632         (x_create_bitmap_from_xpm_data):
10633         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
10634         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
10635         (.bitmaps_last):
10636         * xfaces.c (load_pixmap):
10637         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
10638         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
10639         (.bitmaps_last, struct x_output.icon_bitmap):
10640         Use ptrdiff_t, not int, for bitmap indexes.
10641         (x_allocate_bitmap_record): Check for size overflow.
10642         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
10644         Use ptrdiff_t, not int, for overlay counts.
10645         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
10646         * editfns.c (overlays_around, get_pos_property):
10647         * textprop.c (get_char_property_and_overlay):
10648         * xdisp.c (next_overlay_change, note_mouse_highlight):
10649         * xfaces.c (face_at_buffer_position):
10650         * buffer.c (OVERLAY_COUNT_MAX): New macro.
10651         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
10652         (Fnext_overlay_change, Fprevious_overlay_change)
10653         (mouse_face_overlay_overlaps, Foverlays_in):
10654         Use ptrdiff_t, not int, for sizes.
10655         (overlays_at, overlays_in): Check for size-calculation overflow.
10657         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
10659         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
10660         (x_session_initialize): Do not assume string length fits in int.
10662         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
10663         This is unlikely, but can occur if DPI is outlandish.
10665         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
10666         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
10668         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
10669         * xrdb.c (magic_file_p, search_magic_path):
10670         Omit last arg SUFFIX; it was always 0.  All callers changed.
10671         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
10673         * xfont.c (xfont_match): Avoid need for strlen.
10675         * xfns.c: Don't assume strlen fits in int.
10676         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
10678         * xdisp.c (message_log_check_duplicate): Return intmax_t,
10679         not unsigned long, as we prefer signed integers.  All callers changed.
10680         Detect integer overflow in repeat count.
10681         (message_dolog): Don't assume print length fits in 39 bytes.
10682         (display_mode_element): Don't assume strlen fits in int.
10684         * termcap.c: Don't assume sizes fit in int and never overflow.
10685         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
10686         (gobble_line): Check for size-calculation overflow.
10688         * minibuf.c (Fread_buffer):
10689         * lread.c (intern, intern_c_string):
10690         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
10691         Don't assume string length fits in int.
10693         * keyboard.c (parse_tool_bar_item):
10694         * gtkutil.c (style_changed_cb): Avoid need for strlen.
10696         * font.c: Don't assume string length fits in int.
10697         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
10698         Use ptrdiff_t, not int.
10699         (font_intern_prop): Don't assume string length fits in int.
10700         Don't assume integer property fits in fixnum.
10701         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
10703         * filelock.c: Fix some buffer overrun and integer overflow issues.
10704         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
10705         Reformulate so as not to need the command string.
10706         Invoke gzip -cd rather than gunzip, as it's more portable.
10707         (lock_info_type, lock_file_1, lock_file):
10708         Don't assume pid_t and time_t fit in unsigned long.
10709         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
10710         (current_lock_owner): Prefer signed type for sizes.
10711         Use memcpy, not strncpy, where memcpy is what is really wanted.
10712         Don't assume (via atoi) that time_t and pid_t fit in int.
10713         Check for time_t and/or pid_t out of range, e.g., via a network share.
10714         Don't alloca where an auto var works fine.
10716         * fileio.c: Fix some integer overflow issues.
10717         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
10718         Don't assume string length fits in int.
10719         (directory_file_name): Don't assume string length fits in long.
10720         (make_temp_name): Don't assume pid fits in int, or that its print
10721         length is less than 20.
10723         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
10725         * coding.c (make_subsidiaries): Don't assume string length fits in int.
10727         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
10729         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
10730         We prefer signed integers, even for size calculations.
10732         * emacs.c: Don't assume string length fits in 'int'.
10733         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
10734         (main): Don't invoke strlen when not needed.
10736         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
10737         (XD_DEBUG_MESSAGE): Don't waste a byte.
10739         * callproc.c (getenv_internal_1, getenv_internal)
10740         (Fgetenv_internal):
10741         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
10743         * lread.c (invalid_syntax): Omit length argument.
10744         All uses changed.  This doesn't fix a bug, but it simplifies the
10745         code away from its former Hollerith-constant appearance, and it's
10746         one less 'int' to worry about when looking at integer-overflow issues.
10747         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
10749         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
10750         This didn't break anything, but it didn't help either.
10751         It's confusing to put a bogus integer in a place where the actual
10752         value does not matter.
10753         (LIST_END_P): Remove unused macro and its bogus comment.
10754         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
10756         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
10757         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
10758         implementation.
10759         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
10760         We prefer signed types, and the value cannot exceed the EMACS_INT
10761         range anyway (because otherwise the length would not be representable).
10762         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
10763         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
10764         This avoids a GCC warning when WIDE_EMACS_INT.
10766         * indent.c (sane_tab_width): New function.
10767         (current_column, scan_for_column, Findent_to, position_indentation)
10768         (compute_motion): Use it.  This is just for clarity.
10769         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
10771         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
10773         * lisp.h (lint_assume): New macro.
10774         * composite.c (composition_gstring_put_cache):
10775         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
10777         * editfns.c, insdel.c:
10778         Omit unnecessary forward decls, to simplify future changes.
10780         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
10782         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
10784         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
10785         Use much-faster test for byte-length change.
10786         Don't assume string byte-length fits in 'int'.
10787         Check that character arg fits in 'int'.
10788         (mapcar1): Declare byte as byte, for clarity.
10790         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
10792         * fns.c (concat): Catch string overflow earlier.
10793         Do not rely on integer wraparound.
10795         * dispextern.h (struct it.overlay_strings_charpos)
10796         (struct it.selective): Now EMACS_INT, not int.
10797         * xdisp.c (forward_to_next_line_start)
10798         (back_to_previous_visible_line_start)
10799         (reseat_at_next_visible_line_start, next_element_from_buffer):
10800         Don't arbitrarily truncate the value of 'selective' to int.
10802         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
10804         * composite.c: Don't truncate sizes to 'int'.
10805         (composition_gstring_p, composition_reseat_it)
10806         (composition_adjust_point): Use EMACS_INT, not int.
10807         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
10808         not EMACS_UINT, for indexes.
10810         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
10812         * buffer.c: Include <verify.h>.
10813         (struct sortvec.priority, struct sortstr.priority):
10814         Now EMACS_INT, not int.
10815         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
10816         (struct sortstr.size, record_overlay_string)
10817         (struct sortstrlist.size, struct sortlist.used):
10818         Don't truncate size to int.
10819         (record_overlay_string): Check for size-calculation overflow.
10820         (init_buffer_once): Check at compile-time, not run-time.
10822 2011-06-22  Jim Meyering  <meyering@redhat.com>
10824         Don't leak an XBM-image-sized buffer
10825         * image.c (xbm_load): Free the image buffer after using it.
10827 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
10829         Port to Sun C.
10830         * composite.c (find_automatic_composition): Omit needless 'return 0;'
10831         that Sun C diagnosed.
10832         * fns.c (secure_hash): Fix pointer signedness issue.
10833         * intervals.c (static_offset_intervals): New function.
10834         (offset_intervals): Use it.
10836 2011-06-21  Leo Liu  <sdl.web@gmail.com>
10838         * deps.mk (fns.o):
10839         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
10840         sha512.h.
10842         * fns.c (secure_hash): Rename from crypto_hash_function and change
10843         the first arg to accept symbols.
10844         (Fsecure_hash): New primitive.
10845         (syms_of_fns): New symbols.
10847 2011-06-20  Deniz Dogan  <deniz@dogan.se>
10849         * process.c (Fset_process_buffer): Clarify return value in
10850         docstring.
10852 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
10854         * dispnew.c (add_window_display_history): Use BVAR.
10856         * xdisp.c (debug_method_add): Use BVAR.
10857         (check_window_end, dump_glyph_matrix, dump_glyph)
10858         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
10860         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
10861         Likewise.
10863         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
10864         check till after the cache is created in init_frame_faces.
10866 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
10868         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
10870 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
10872         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
10873         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
10874         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
10876         Improve buffer-overflow checking (Bug#8873).
10877         * fileio.c (Finsert_file_contents):
10878         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
10879         Remove the old (too-loose) buffer overflow checks.
10880         They weren't needed, since make_gap checks for buffer overflow.
10881         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
10882         The old code merely checked for Emacs fixnum overflow, and relied
10883         on undefined (wraparound) behavior.  The new code avoids undefined
10884         behavior, and also checks for ptrdiff_t and/or size_t overflow.
10886         * editfns.c (Finsert_char): Don't dump core with very negative counts.
10887         Tune.  Don't use wider integers than needed.  Don't use alloca.
10888         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
10890         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
10892         * insdel.c, lisp.h (buffer_overflow): New function.
10893         (insert_from_buffer_1, replace_range, replace_range_2):
10894         * insdel.c (make_gap_larger):
10895         * editfns.c (Finsert_char):
10896         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
10898         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
10900 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
10902         Integer overflow and signedness fixes (Bug#8873, Bug#8828).
10904         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
10905         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
10907         * fileio.c: Don't assume EMACS_INT fits in off_t.
10908         (emacs_lseek): New static function.
10909         (Finsert_file_contents, Fwrite_region): Use it.
10910         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
10912         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
10914         * fns.c: Don't overflow int when computing a list length.
10915         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
10916         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
10917         truncation on 64-bit hosts.  Check for QUIT every
10918         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
10919         faster and is responsive enough.
10920         (Flength): Report an error instead of overflowing an integer.
10921         (Fsafe_length): Return a float if the value is not representable
10922         as a fixnum.  This shouldn't happen except in contrived situations.
10923         (Fnthcdr, Fsort): Don't assume list length fits in int.
10924         (Fcopy_sequence): Don't assume vector length fits in int.
10926         * alloc.c: Check that resized vectors' lengths fit in fixnums.
10927         (header_size, word_size): New constants.
10928         (allocate_vectorlike): Don't check size overflow here.
10929         (allocate_vector): Check it here instead, since this is the only
10930         caller of allocate_vectorlike that could cause overflow.
10931         Check that the new vector's length is representable as a fixnum.
10933         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
10934         The previous code was bogus.  For example, next_almost_prime (32)
10935         returned 39, which is undesirable as it is a multiple of 3; and
10936         next_almost_prime (24) returned 25, which is a multiple of 5 so
10937         why was the code bothering to check for multiples of 7?
10939         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
10941         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
10943         Variadic C functions now count arguments with ptrdiff_t.
10944         This partly undoes my 2011-03-30 change, which replaced int with size_t.
10945         Back then I didn't know that the Emacs coding style prefers signed int.
10946         Also, in the meantime I found a few more instances where arguments
10947         were being counted with int, which may truncate counts on 64-bit
10948         machines, or EMACS_INT, which may be unnecessarily wide.
10949         * lisp.h (struct Lisp_Subr.function.aMANY)
10950         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
10951         Arg counts are now ptrdiff_t, not size_t.
10952         All variadic functions and their callers changed accordingly.
10953         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
10954         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
10955         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
10956         * callint.c (Fcall_interactively): Check arg count for overflow,
10957         to avoid potential buffer overrun.  Use signed char, not 'int',
10958         for 'varies' array, so that we needn't bother to check its size
10959         calculation for overflow.
10960         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
10961         * eval.c (apply_lambda):
10962         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
10963         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
10964         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
10966         * callint.c (Fcall_interactively): Don't use index var as event count.
10968         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
10969         * mem-limits.h (SIZE): Remove; no longer used.
10971         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
10973         Remove unnecessary casts.
10974         * xterm.c (x_term_init):
10975         * xfns.c (x_set_border_pixel):
10976         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
10977         These aren't needed now that we assume ANSI C.
10979         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
10980         It's more likely to cause problems (due to unsigned overflow)
10981         than to cure them.
10983         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
10985         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
10987         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
10989         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
10991         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
10993         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
10995         GLYPH_CODE_FACE returns EMACS_INT, not int.
10996         * dispextern.h (merge_faces):
10997         * xfaces.c (merge_faces):
10998         * xdisp.c (get_next_display_element, next_element_from_display_vector):
10999         Don't assume EMACS_INT fits in int.
11001         * character.h (CHAR_VALID_P): Remove unused parameter.
11002         * fontset.c, lisp.h, xdisp.c: All uses changed.
11004         * editfns.c (Ftranslate_region_internal): Omit redundant test.
11006         * fns.c (concat): Minor tuning based on overflow analysis.
11007         This doesn't fix any bugs.  Use int to hold character, instead
11008         of constantly refetching from Emacs object.  Use XFASTINT, not
11009         XINT, for value known to be a character.  Don't bother comparing
11010         a single byte to 0400, as it's always less.
11012         * floatfns.c (Fexpt):
11013         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11015         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11016         for characters.
11018         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11020         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11021         Without this fix, on a 64-bit host (aset S 0 4294967386) would
11022         incorrectly succeed when S was a string, because 4294967386 was
11023         truncated before it was used.
11025         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11026         Otherwise, an out-of-range integer could cause undefined behavior
11027         on a 64-bit host.
11029         * composite.c: Use int, not EMACS_INT, for characters.
11030         (fill_gstring_body, composition_compute_stop_pos): Use int, not
11031         EMACS_INT, for values that are known to be in character range.
11032         This doesn't fix any bugs but is the usual style inside Emacs and
11033         may generate better code on 32-bit machines.
11035         Make sure a 64-bit char is never passed to ENCODE_CHAR.
11036         This is for reasons similar to the recent CHAR_STRING fix.
11037         * charset.c (Fencode_char): Check that character arg is actually
11038         a character.  Pass an int to ENCODE_CHAR.
11039         * charset.h (ENCODE_CHAR): Verify that the character argument is no
11040         wider than 'int', as a compile-time check to prevent future regressions
11041         in this area.
11043         * character.c (char_string): Remove unnecessary casts.
11045         Make sure a 64-bit char is never passed to CHAR_STRING.
11046         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11047         by silently ignoring the top 32 bits, allowing some values
11048         that were far too large to be valid characters.
11049         * character.h: Include <verify.h>.
11050         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11051         arguments are no wider than unsigned, as a compile-time check
11052         to prevent future regressions in this area.
11053         * data.c (Faset):
11054         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
11055         (Fsubst_char_in_region):
11056         * fns.c (concat):
11057         * xdisp.c (decode_mode_spec_coding):
11058         Adjust to CHAR_STRING's new requirement.
11059         * editfns.c (Finsert_char, Fsubst_char_in_region):
11060         * fns.c (concat): Check that character args are actually
11061         characters.  Without this test, these functions did the wrong
11062         thing with wildly out-of-range values on 64-bit hosts.
11064         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11065         These casts should not be needed on 32-bit hosts, either.
11066         * keyboard.c (read_char):
11067         * lread.c (Fload): Remove casts to unsigned.
11069         * lisp.h (UNSIGNED_CMP): New macro.
11070         This fixes comparison bugs on 64-bit hosts.
11071         (ASCII_CHAR_P): Use it.
11072         * casefiddle.c (casify_object):
11073         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
11074         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11075         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11076         * dispextern.h (FACE_FROM_ID):
11077         * keyboard.c (read_char): Use UNSIGNED_CMP.
11079         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11080         not to EMACS_INT, to avoid GCC warning.
11082         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11084         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11085         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11086         isn't needed on 32-bit machines.
11088         * buffer.c (Fgenerate_new_buffer_name):
11089         Use EMACS_INT for count, not int.
11090         (advance_to_char_boundary): Return EMACS_INT, not int.
11092         * data.c (Qcompiled_function): Now static.
11094         * window.c (window_body_lines): Now static.
11096         * image.c (gif_load): Rename local to avoid shadowing.
11098         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11099         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11100         * alloc.c (make_save_value): Integer argument is now of type
11101         ptrdiff_t, not int.
11102         (mark_object): Use ptrdiff_t, not int.
11103         * lisp.h (pD): New macro.
11104         * print.c (print_object): Use it.
11106         * alloc.c: Use EMACS_INT, not int, to count objects.
11107         (total_conses, total_markers, total_symbols, total_vector_size)
11108         (total_free_conses, total_free_markers, total_free_symbols)
11109         (total_free_floats, total_floats, total_free_intervals)
11110         (total_intervals, total_strings, total_free_strings):
11111         Now EMACS_INT, not int.  All uses changed.
11112         (Fgarbage_collect): Compute overall total using a double, so that
11113         integer overflow is less likely to be a problem.  Check for overflow
11114         when converting back to an integer.
11115         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11116         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11117         These were 'int' variables that could overflow on 64-bit hosts;
11118         they were never used, so remove them instead of repairing them.
11119         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
11120         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11121         Previously, this ceilinged at INT_MAX, but that doesn't work on
11122         64-bit machines.
11123         (allocate_pseudovector): Don't use EMACS_INT when int would do.
11125         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
11126         (allocate_vectorlike): Check for ptrdiff_t overflow.
11127         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11128         when a (possibly-narrower) signed value would do just as well.
11129         We prefer using signed arithmetic, to avoid comparison confusion.
11131         * alloc.c: Catch some string size overflows that we were missing.
11132         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11133         for convenience in STRING_BYTES_MAX.
11134         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11135         The definition here is exact; the one in lisp.h was approximate.
11136         (allocate_string_data): Check for string overflow.  This catches
11137         some instances we weren't catching before.  Also, it catches
11138         size_t overflow on (unusual) hosts where SIZE_MAX <= min
11139         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11140         and ptrdiff_t and EMACS_INT are both 64 bits.
11142         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11143         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
11144         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
11146         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11148         * alloc.c (Fmake_string): Check for out-of-range init.
11150 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
11152         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11154 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
11156         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11157         xg_get_default_scrollbar_width.
11159         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11160         (int_gtk_range_get_value): Move to the scroll bar part of the file.
11161         (style_changed_cb): Call update_theme_scrollbar_width and call
11162         x_set_scroll_bar_default_width and xg_frame_set_char_size for
11163         all frames (Bug#8505).
11164         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11165         Call gtk_window_set_resizable if HAVE_GTK3.
11166         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11167         and height if HAVE_GTK3 (Bug#8505).
11168         (scroll_bar_width_for_theme): New variable.
11169         (update_theme_scrollbar_width): New function.
11170         (xg_get_default_scrollbar_width): Move code to
11171         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
11172         (xg_initialize): Call update_theme_scrollbar_width.
11174         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
11176         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
11178 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
11180         * frame.c (make_frame): Call other_buffer_safely instead of
11181         other_buffer.
11183         * window.c (temp_output_buffer_show): Call display_buffer with
11184         second argument Vtemp_buffer_show_specifiers and reset latter
11185         immediately after the call.
11186         (Vtemp_buffer_show_specifiers): New variable.
11187         (auto_window_vscroll_p, next_screen_context_lines)
11188         (Vscroll_preserve_screen_position): Remove leading asterisks from
11189         doc-strings.
11191 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
11193         Fix minor problems found by GCC 4.6.0 static checking.
11194         * buffer.c (Qclone_number): Remove for now, as it's unused.
11195         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
11196         (record_buffer): Remove unused local.
11197         * frame.c (other_visible_frames, frame_buffer_list): Now static.
11198         (set_frame_buffer_list): Remove; unused.
11199         * frame.h (other_visible_frames): Remove decl.
11200         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
11201         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
11202         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
11203         if HAVE_GPM.
11204         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
11205         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
11206         Define only if HAVE_GPM.
11207         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
11208         (update_hints_inhibit): Remove; never set.  All uses removed.
11209         * widgetprv.h (emacsFrameClassRec): Remove decl.
11210         * window.c (delete_deletable_window): Now returns void, since it
11211         wasn't returning anything.
11212         (compare_window_configurations): Remove unused locals.
11213         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
11214         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
11215         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
11216         the same widths as pointers.  This follows up on the 2011-05-06 patch.
11217         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
11218         * xterm.h: Likewise.
11219         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
11221 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
11223         * makefile.w32-in: Update dependencies.
11224         (LISP_H): Add lib/intprops.h.
11226 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
11228         * image.c (gif_load): Add animation frame delay to the metadata.
11229         (syms_of_image): Use DEFSYM.  New symbol `delay'.
11231 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
11233         * window.c (delete_deletable_window): Re-add.
11234         (Fset_window_configuration): Rewrite to handle dead buffers and
11235         consequently deletable windows.
11236         (window_tree, Fwindow_tree): Remove.  Supply functionality in
11237         window.el.
11238         (compare_window_configurations): Simplify code.
11240 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
11242         * image.c (imagemagick_load_image): Fix type mismatch.
11243         (Fimagemagick_types): Likewise.
11245         * window.h (replace_buffer_in_windows): Declare.
11247 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
11249         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
11250         Qclone_number.  Remove external declaration of Qdelete_window.
11251         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
11252         code.
11253         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
11254         Run Qbuffer_list_update_hook if allowed.
11255         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
11256         buffer list implementation.
11257         (other_buffer_safely): New function.
11258         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
11259         calls to replace_buffer_in_windows and
11260         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
11261         if allowed.
11262         (record_buffer): Inhibit quitting and rewrite using quittable
11263         functions.  Run Qbuffer_list_update_hook if allowed.
11264         (Frecord_buffer, Funrecord_buffer): New functions.
11265         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
11266         Move switch-to-buffer to window.el.
11267         (bury-buffer): Move to window.el.
11268         (Vbuffer_list_update_hook): New variable.
11270         * lisp.h (other_buffer_safely): Add prototype in buffer.c
11271         section.
11273         * window.h (resize_frame_windows): Move up in code.
11274         (Fwindow_frame): Remove EXFUN.
11275         (replace_buffer_in_all_windows): Remove prototype.
11276         (replace_buffer_in_windows_safely): Add prototype.
11278         * window.c: Declare Qdelete_window static again.  Move down
11279         declaration of select_count.
11280         (Fnext_window, Fprevious_window): Rewrite doc-strings.
11281         (Fother_window): Move to window.el.
11282         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
11283         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
11284         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
11285         window.el.
11286         (replace_buffer_in_windows): Implement by calling
11287         Qreplace_buffer_in_windows.
11288         (replace_buffer_in_all_windows): Remove with some functionality
11289         moved into replace_buffer_in_windows_safely.
11290         (replace_buffer_in_windows_safely): New function.
11291         (select_window_norecord, select_frame_norecord): Move in front
11292         of run_window_configuration_change_hook.  Remove now obsolete
11293         declarations.
11294         (Fset_window_buffer): Rewrite doc-string.
11295         Call Qrecord_window_buffer.
11296         (keys_of_window): Move binding for other-window to window.el.
11298 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
11300         * dispextern.h (struct image): Replace data member, whose int_val
11301         and ptr_val fields were not used by anything, with a single
11302         lisp_val object.
11304         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
11305         (gif_clear_image, gif_load, imagemagick_load_image)
11306         (gs_clear_image, gs_load): Callers changed.
11308 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
11310         * buffer.h: Include <time.h>, for time_t.
11311         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
11313         Fix minor problems found by static checking.
11315         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
11317         Make identifiers static if they are not used in other modules.
11318         * data.c (Qcompiled_function, Qframe, Qvector):
11319         * image.c (QimageMagick, Qsvg):
11320         * minibuf.c (Qmetadata):
11321         * window.c (resize_window_check, resize_root_window): Now static.
11322         * window.h (resize_window_check, resize_root_window): Remove decls.
11324         * window.c (window_deletion_count, delete_deletable_window):
11325         Remove; unused.
11326         (window_body_lines): Now static.
11327         (Fdelete_other_windows_internal): Mark vars as initialized.
11328         Make sure 'resize_failed' is initialized.
11329         (run_window_configuration_change_hook): Rename local to avoid shadowing.
11330         (resize_window_apply): Remove unused local.
11331         * window.h (delete_deletable_window): Remove decl.
11333         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
11334         (imagemagick_load_image): Fix pointer signedness problem by changing
11335         last arg from unsigned char * to char *.  All uses changed.
11336         Also, fix a local for similar reasons.
11337         Remove unused locals.  Remove locals to avoid shadowing.
11338         (fn_rsvg_handle_free): Remove; unused.
11339         (svg_load, svg_load_image): Fix pointer signedness problem.
11340         (imagemagick_load_image): Don't use garbage pointer image_wand.
11342         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
11344 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
11346         * image.c (gif_load): Fix omitted cast error introduced by
11347         2011-06-06 change.
11349 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
11351         * window.h (resize_proportionally, orig_total_lines)
11352         (orig_top_line): Remove from window structure.
11353         (set_window_height, set_window_width, change_window_heights)
11354         (Fdelete_window): Remove prototypes.
11355         (resize_frame_windows): Remove duplicate declaration.
11357 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
11359         * window.h (resize_frame_windows, resize_window_check)
11360         (delete_deletable_window, resize_root_window)
11361         (resize_frame_windows): Declare prototypes.
11363         * window.c (resize_window_apply): Make definition be "static" to
11364         match the prototype.
11366 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
11368         * window.c: Remove declarations of Qwindow_size_fixed,
11369         window_min_size_1, window_min_size_2, window_min_size,
11370         size_window, window_fixed_size_p, enlarge_window, delete_window.
11371         Remove static from declaration of Qdelete_window, it's
11372         temporarily needed by Fbury_buffer.
11373         (replace_window): Don't assign orig_top_line and
11374         orig_total_lines.
11375         (Fdelete_window, delete_window): Remove.  Window deletion is
11376         handled by window.el.
11377         (window_loop): Remove DELETE_OTHER_WINDOWS case.
11378         Replace Fdelete_window calls with calls to Qdelete_window.
11379         (Fdelete_other_windows): Remove.  Deleting other windows is
11380         handled by window.el.
11381         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
11382         handled in window.el.
11383         (window_min_size_2, window_min_size_1, window_min_size): Remove.
11384         Window minimum sizes are handled in window.el.
11385         (shrink_windows, size_window, set_window_height)
11386         (set_window_width, change_window_heights, window_height)
11387         (window_width, CURBEG, CURSIZE, enlarge_window)
11388         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
11389         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
11390         handled in window.el.
11391         (make_dummy_parent): Rename to make_parent_window and give it a
11392         second argument horflag.
11393         (make_window): Don't set resize_proportionally any more.
11394         (Fsplit_window): Remove.  Windows are split in window.el.
11395         (save_restore_action, save_restore_orig_size)
11396         (shrink_window_lowest_first, save_restore_orig_size): Remove.
11397         Resize mini windows in window.el.
11398         (grow_mini_window, shrink_mini_window): Implement by calling
11399         Qresize_root_window_vertically, resize_window_check and
11400         resize_window_apply.
11401         (saved_window, Fset_window_configuration, save_window_save):
11402         Do not handle orig_top_line, orig_total_lines, and
11403         resize_proportionally.
11404         (window_min_height, window_min_width): Move to window.el.
11405         (keys_of_window): Move bindings for delete-other-windows,
11406         split-window, delete-window and enlarge-window to window.el.
11408         * buffer.c: Temporarily extern Qdelete_window.
11409         (Fbury_buffer): Temporarily call Qdelete_window instead of
11410         Fdelete_window (Fbury_buffer will move to window.el soon).
11412         * frame.c (set_menu_bar_lines_1): Remove code handling
11413         orig_top_line and orig_total_lines.
11415         * dispnew.c (adjust_frame_glyphs_initially): Don't use
11416         set_window_height but set heights directly.
11417         (change_frame_size_1): Use resize_frame_windows.
11419         * xdisp.c (init_xdisp): Don't use set_window_height but set
11420         heights directly.
11422         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
11423         Use resize_frame_windows instead of change_window_heights and run
11424         run_window_configuration_change_hook.
11426         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
11427         instead of change_window_heights and run
11428         run_window_configuration_change_hook.
11430 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
11432         * window.c (replace_window): Rename second argument REPLACEMENT to
11433         NEW.  New third argument SETFLAG.  Rewrite.
11434         (delete_window, make_dummy_parent): Call replace_window with
11435         third argument 1.
11436         (window_list_1): Move down in code.
11437         (run_window_configuration_change_hook): Move set_buffer part
11438         before select_frame_norecord part in order to unwind correctly.
11439         Rename count1 to count.
11440         (recombine_windows, delete_deletable_window, resize_root_window)
11441         (Fdelete_other_windows_internal)
11442         (Frun_window_configuration_change_hook, make_parent_window)
11443         (resize_window_check, resize_window_apply, Fresize_window_apply)
11444         (resize_frame_windows, Fsplit_window_internal)
11445         (Fdelete_window_internal, Fresize_mini_window_internal):
11446         New functions.
11447         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
11449 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
11451         * window.h (window): Add some new members to window structure -
11452         normal_lines, normal_cols, new_total, new_normal, clone_number,
11453         splits, nest, prev_buffers, next_buffers.
11454         (WINDOW_TOTAL_SIZE): Move here from window.c.
11455         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
11457         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
11458         Remove.
11459         (make_dummy_parent): Set new members of windows structure.
11460         (make_window): Move down in code.  Handle new members of window
11461         structure.
11462         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
11463         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
11464         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
11465         (Fset_window_prev_buffers, Fwindow_next_buffers)
11466         (Fset_window_next_buffers, Fset_window_clone_number):
11467         New functions.
11468         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
11469         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
11470         Doc-string fixes.
11471         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
11472         Argument WINDOW can be now internal window too.
11473         (Fwindow_use_time): Move up in code.
11474         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
11475         Rewrite doc-string.
11476         (Fset_window_configuration, saved_window)
11477         (Fcurrent_window_configuration, save_window_save): Handle new
11478         members of window structure.
11479         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
11480         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
11481         (syms_of_window): New Lisp objects Qrecord_window_buffer,
11482         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
11483         Qget_mru_window, Qresize_root_window,
11484         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
11485         Qauto_buffer_name; staticpro them.
11487 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
11489         * window.c (Fwindow_total_size, Fwindow_left_column)
11490         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
11491         (Fwindow_list_1): New functions.
11492         (window_box_text_cols): Replace with window_body_cols.
11493         (Fwindow_width, Fscroll_left, Fscroll_right):
11494         Use window_body_cols instead of window_box_text_cols.
11495         (delete_window, Fset_window_configuration):
11496         Call delete_all_subwindows with window as argument.
11497         (delete_all_subwindows): Take a window as argument and not a
11498         structure.  Rewrite.
11499         (window_loop): Remove handling of GET_LRU_WINDOW and
11500         GET_LARGEST_WINDOW.
11501         (Fget_lru_window, Fget_largest_window): Move to window.el.
11503         * window.h: Extern window_body_cols instead of
11504         window_box_text_cols.  delete_all_subwindows now takes a
11505         Lisp_Object as argument.
11507         * indent.c (compute_motion, Fcompute_motion):
11508         Use window_body_cols instead of window_box_text_cols.
11510         * frame.c (delete_frame): Call delete_all_subwindows with root
11511         window as argument.
11513 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
11515         * fns.c (Fputhash): Document return value.
11517 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
11519         * image.c (gif_load): Implement gif89a spec "no disposal" method.
11521 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
11523         Cons<->int and similar integer overflow fixes (Bug#8794).
11525         Check for overflow when converting integer to cons and back.
11526         * charset.c (Fdefine_charset_internal, Fdecode_char):
11527         Use cons_to_unsigned to catch overflow.
11528         (Fencode_char): Use INTEGER_TO_CONS.
11529         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
11530         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
11531         * data.c (long_to_cons, cons_to_long): Remove.
11532         (cons_to_unsigned, cons_to_signed): New functions.
11533         These signal an error for invalid or out-of-range values.
11534         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
11535         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
11536         * font.c (Ffont_variation_glyphs):
11537         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
11538         * lisp.h: Include <intprops.h>.
11539         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
11540         (cons_to_signed, cons_to_unsigned): New decls.
11541         (long_to_cons, cons_to_long): Remove decls.
11542         * undo.c (record_first_change): Use INTEGER_TO_CONS.
11543         (Fprimitive_undo): Use CONS_TO_INTEGER.
11544         * xfns.c (Fx_window_property): Likewise.
11545         * xselect.c: Include <limits.h>.
11546         (x_own_selection, selection_data_to_lisp_data):
11547         Use INTEGER_TO_CONS.
11548         (x_handle_selection_request, x_handle_selection_clear)
11549         (x_get_foreign_selection, Fx_disown_selection_internal)
11550         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
11551         (lisp_data_to_selection_data): Use cons_to_unsigned.
11552         (x_fill_property_data): Use cons_to_signed.
11553         Report values out of range.
11555         Check for buffer and string overflow more precisely.
11556         * buffer.h (BUF_BYTES_MAX): New macro.
11557         * lisp.h (STRING_BYTES_MAX): New macro.
11558         * alloc.c (Fmake_string):
11559         * character.c (string_escape_byte8):
11560         * coding.c (coding_alloc_by_realloc):
11561         * doprnt.c (doprnt):
11562         * editfns.c (Fformat):
11563         * eval.c (verror):
11564         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
11565         since they may not be the same number.
11566         * editfns.c (Finsert_char):
11567         * fileio.c (Finsert_file_contents):
11568         Likewise for BUF_BYTES_MAX.
11570         * image.c: Use ptrdiff_t, not int, for sizes.
11571         (slurp_file): Switch from int to ptrdiff_t.
11572         All uses changed.
11573         (slurp_file): Check that file size fits in both size_t (for
11574         malloc) and ptrdiff_t (for sanity and safety).
11576         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
11577         if b->modtime has its maximal value.
11579         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
11581         Don't assume time_t can fit into int.
11582         * buffer.h (struct buffer.modtime): Now time_t, not int.
11583         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
11584         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
11586         Minor fixes for signed vs unsigned integers.
11587         * character.h (MAYBE_UNIFY_CHAR):
11588         * charset.c (maybe_unify_char):
11589         * keyboard.c (read_char, reorder_modifiers):
11590         XINT -> XFASTINT, since the integer must be nonnegative.
11591         * ftfont.c (ftfont_spec_pattern):
11592         * keymap.c (access_keymap, silly_event_symbol_error):
11593         XUINT -> XFASTINT, since the integer must be nonnegative.
11594         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
11595         since it makes no difference and we prefer signed.
11596         * keyboard.c (record_char): Use XUINT when all the neighbors do.
11597         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
11598         nonnegative.
11600 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
11602         * window.h (Fwindow_frame): Declare.
11604 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
11606         * alloc.c: Simplify handling of large-request failures (Bug#8800).
11607         (SPARE_MEMORY): Always define.
11608         (LARGE_REQUEST): Remove.
11609         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
11611 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
11613         * lisp.h: Move EXFUNS for Fframe_root_window,
11614         Fframe_first_window and Fset_frame_selected_window to window.h.
11616         * window.h: Move EXFUNS for Fframe_root_window,
11617         Fframe_first_window and Fset_frame_selected_window here from
11618         lisp.h.
11620         * frame.c (Fwindow_frame, Fframe_first_window)
11621         (Fframe_root_window, Fframe_selected_window)
11622         (Fset_frame_selected_window): Move to window.c.
11623         (Factive_minibuffer_window): Move to minibuf.c.
11624         (Fother_visible_frames_p): New function.
11626         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
11628         * window.c (decode_window, decode_any_window): Move up in code.
11629         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
11630         (inhibit_frame_unsplittable): Remove unused variable.
11631         (Fwindow_buffer): Move up and rewrite doc-string.
11632         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
11633         (Fwindow_prev): New functions.
11634         (Fwindow_frame): Move here from frame.c.  Accept any window as
11635         argument.
11636         (Fframe_root_window, Fframe_first_window)
11637         (Fframe_selected_window): Move here from frame.c.  Accept frame
11638         or arbitrary window as argument.  Update doc-strings.
11639         (Fminibuffer_window): Move up in code.
11640         (Fwindow_minibuffer_p): Move up in code and simplify.
11641         (Fset_frame_selected_window): Move here from frame.c.
11642         Marginal rewrite.
11643         (Fselected_window, select_window, Fselect_window): Move up in
11644         code.  Minor doc-string fixes.
11646 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
11648         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
11649         Do not assume that spare memory exists; that assumption is valid
11650         only if SYSTEM_MALLOC.
11651         (LARGE_REQUEST): New macro, so that the issue of large requests
11652         is separated from the issue of spare memory.
11654 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
11656         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
11657         format.  (Bug#8806)
11659         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
11661         * xfns.c (x_set_scroll_bar_default_width): Move declarations
11662         before statements.
11664 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
11666         * gtkutil.c (xg_get_default_scrollbar_width): New function.
11668         * gtkutil.h: Declare xg_get_default_scrollbar_width.
11670         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
11671         min width by calling x_set_scroll_bar_default_width (Bug#8505).
11673 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
11675         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
11677 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
11679         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
11680         (x_clipboard_manager_save): Add return value.
11681         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
11682         New error handlers.
11683         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
11684         Obey Vx_select_enable_clipboard_manager.  Catch errors in
11685         x_clipboard_manager_save (Bug#8779).
11686         (Vx_select_enable_clipboard_manager): New variable.
11687         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
11689 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
11691         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
11693 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
11695         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
11696         in the current matrix if keep_current_p is non-zero.
11698 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
11700         * bidi.c (bidi_level_of_next_char): Fix last change.
11702 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
11704         Support bidi reordering of text covered by display properties.
11706         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
11707         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
11708         (bidi_cache_search, bidi_cache_iterator_state)
11709         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11710         (bidi_level_of_next_char, bidi_move_to_visually_next):
11711         Support character positions inside a run of characters covered by a
11712         display string.
11713         (bidi_paragraph_init, bidi_resolve_explicit_1)
11714         (bidi_level_of_next_char): Call bidi_fetch_char and
11715         bidi_fetch_char_advance instead of FETCH_CHAR and
11716         FETCH_CHAR_ADVANCE.
11717         (bidi_init_it): Initialize new members.
11718         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
11719         definitions.
11720         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
11721         instead of using explicit *_CHAR codes.
11722         (bidi_resolve_explicit, bidi_resolve_weak):
11723         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
11724         bidirectional text is supported only in multibyte buffers.
11725         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
11726         it to initialize the frame_window_p member of struct bidi_it.
11727         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
11728         (bidi_resolve_explicit, bidi_resolve_weak)
11729         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
11730         bidi_it->nchars is non-positive.
11731         (bidi_level_of_next_char): Don't try to lookup the cache for the
11732         next/previous character if nothing is cached there yet, or if we
11733         were just reseat()'ed to a new position.
11735         * xdisp.c (set_cursor_from_row): Set start and stop points
11736         according to the row's direction when priming the loop that looks
11737         for the glyph on which to display cursor.
11738         (single_display_spec_intangible_p): Function deleted.
11739         (display_prop_intangible_p): Reimplement to call
11740         handle_display_spec instead of single_display_spec_intangible_p.
11741         Accept 3 additional arguments needed by handle_display_spec.
11742         This fixes incorrect cursor motion across display property with complex
11743         values: lists, `(when COND...)' forms, etc.
11744         (single_display_spec_string_p): Support property values that are
11745         lists with the argument STRING its top-level element.
11746         (display_prop_string_p): Fix the condition for processing a
11747         property that is a list to be consistent with handle_display_spec.
11748         (handle_display_spec): New function, refactored from the
11749         last portion of handle_display_prop.
11750         (compute_display_string_pos): Accept additional argument
11751         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
11752         value of a `display' property is a "replacing spec".
11753         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
11754         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
11755         the display property, but just return a value indicating whether
11756         the display property will replace the characters it covers.
11757         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
11758         frame_window_p members of struct bidi_it.
11759         (compute_display_string_pos, compute_display_string_end):
11760         New functions.
11761         (push_it): Accept second argument POSITION, where pop_it should
11762         jump to continue iteration.
11763         (reseat_1): Initialize bidi_it.disp_pos.
11765         * keyboard.c (adjust_point_for_property): Adjust the call to
11766         display_prop_intangible_p to its new signature.
11768         * dispextern.h (struct bidi_it): New member frame_window_p.
11769         (bidi_init_it): Update prototypes.
11770         (display_prop_intangible_p): Update prototype.
11771         (compute_display_string_pos, compute_display_string_end):
11772         Declare prototypes.
11773         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
11774         EMACS_INT.
11776 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
11778         Malloc failure behavior now depends on size of allocation.
11779         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
11780         * lisp.h: Change signatures accordingly.
11781         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
11782         All callers changed.  (Bug#8762)
11784         * gnutls.c: Use Emacs's memory allocators.
11785         Without this change, the gnutls library would invoke malloc etc.
11786         directly, which causes problems on non-SYNC_INPUT hosts, and which
11787         runs afoul of improving memory_full behavior.  (Bug#8761)
11788         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
11789         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
11790         xfree instead of the default malloc, realloc, free.
11791         (Fgnutls_boot): No need to check for memory allocation failure,
11792         since xmalloc does that for us.
11794         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
11795         * category.c (hash_get_category_set):
11796         * ccl.c (ccl_driver):
11797         * charset.c (Fdefine_charset_internal):
11798         * charset.h (struct charset.hash_index):
11799         * composite.c (get_composition_id, gstring_lookup_cache)
11800         (composition_gstring_put_cache):
11801         * composite.h (struct composition.hash_index):
11802         * dispextern.h (struct image.hash):
11803         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
11804         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
11805         (hashfn_equal, hashfn_user_defined, make_hash_table)
11806         (maybe_resize_hash_table, hash_lookup, hash_put)
11807         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
11808         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
11809         (Fsxhash, Fgethash, Fputhash, Fmaphash):
11810         * image.c (make_image, search_image_cache, lookup_image)
11811         (xpm_put_color_table_h):
11812         * lisp.h (struct Lisp_Hash_Table):
11813         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
11814         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
11815         for hashes and hash indexes, instead of 'unsigned' and 'int'.
11816         * alloc.c (allocate_vectorlike):
11817         Check for overflow in vector size calculations.
11818         * ccl.c (ccl_driver):
11819         Check for overflow when converting EMACS_INT to int.
11820         * fns.c, image.c: Remove unnecessary static decls that would otherwise
11821         need to be updated by these changes.
11822         * fns.c (make_hash_table, maybe_resize_hash_table):
11823         Check for integer overflow with large hash tables.
11824         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
11825         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
11826         (SXHASH_REDUCE): New macro.
11827         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
11828         Use it instead of discarding useful hash info with large hash values.
11829         (sxhash_float): New function.
11830         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
11831         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
11832         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
11833         Rewrite to use FIXNUM_BITS, as this simplifies things.
11834         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
11835         Adjust signatures to match updated version of code.
11836         (consing_since_gc): Now EMACS_INT, since a single hash table can
11837         use more than INT_MAX bytes.
11839 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
11841         Make it possible to build with GCC-4.6+ -O2 -flto.
11843         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
11845 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
11847         * minibuf.c (get_minibuffer, read_minibuf_unwind):
11848         Call minibuffer-inactive-mode.
11850 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
11852         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
11853         Update dependencies.
11855 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
11857         * data.c (init_data): Remove code for UTS, this system is not
11858         supported anymore.
11860 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
11862         Don't force ./temacs to start in terminal mode.
11864         * frame.c (make_initial_frame): Initialize faces in all cases, not
11865         only when CANNOT_DUMP is defined.
11866         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
11868 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
11870         * dispnew.c (add_window_display_history): Use const for the string
11871         pointer.  Remove declaration, not needed.
11873 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
11875         Use 'inline', not 'INLINE'.
11876         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
11877         * alloc.c, fontset.c (INLINE): Remove.
11878         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
11879         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
11880         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
11881         * gmalloc.c (register_heapinfo): Use inline unconditionally.
11882         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
11884 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
11886         Make it possible to run ./temacs.
11888         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
11889         syms_of_callproc does the same thing.  Remove test for
11890         "initialized", do it in the caller.
11891         * emacs.c (main): Avoid calling set_initial_environment when dumping.
11893 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
11895         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
11896         (read_minibuf): Use get_minibuffer.
11897         (syms_of_minibuf): Use DEFSYM.
11898         (Qmetadata): New var.
11899         * data.c (Qbuffer): Don't make it static.
11900         (syms_of_data): Use DEFSYM.
11902 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
11904         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
11905         (CCL_CODE_MIN): New macro.
11907 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
11909         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
11911         * eval.c (Qdebug): Now static.
11912         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
11913         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
11914         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
11916 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
11918         * image.c: Various fixes to ImageMagick code comments.
11919         (Fimagemagick_types): Doc fix.
11921 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
11923         Minor fixes prompted by GCC 4.6.0 warnings.
11925         * xselect.c (converted_selections, conversion_fail_tag): Now static.
11927         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
11928         (x_clipboard_manager_save_all): Move extern decl to ...
11929         * xterm.h: ... here, so that it can be checked for consistency.
11931 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
11933         * xselect.c (x_clipboard_manager_save_frame)
11934         (x_clipboard_manager_save_all): New functions.
11935         (Fx_clipboard_manager_save): Lisp function deleted.
11937         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
11938         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
11940         * xterm.h: Update prototype.
11942 2011-05-28  William Xu  <william.xwl@gmail.com>
11944         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
11945         exiting (Bug#8239).
11947 2011-05-28  Jim Meyering  <meyering@redhat.com>
11949         Avoid a sign-extension bug in crypto_hash_function.
11950         * fns.c (to_uchar): Define.
11951         (crypto_hash_function): Use it to convert some newly-signed
11952         variables to unsigned, to avoid sign-extension bugs.  For example,
11953         without this change, (md5 "truc") would evaluate to
11954         45723a2aff78ff4fff7fff1114760e62 rather than the expected
11955         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
11956         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
11958 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
11960         Integer overflow fixes.
11962         * dbusbind.c: Serial number integer overflow fixes.
11963         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
11964         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
11965         to hold a serial number that is too large for a fixnum.
11966         (Fdbus_method_return_internal, Fdbus_method_error_internal):
11967         Check for serial numbers out of range.  Decode any serial number
11968         that was so large that it became a float.  (Bug#8722)
11970         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
11971         (Fdbus_call_method, Fdbus_call_method_asynchronously):
11972         Use XFASTINT rather than XUINT when numbers are nonnegative.
11973         (xd_append_arg, Fdbus_method_return_internal):
11974         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
11975         arguments, check that Lisp number is nonnegative, rather than
11976         silently wrapping negative numbers around.  (Bug#8722)
11977         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
11978         (Bug#8722)
11980         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
11982         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
11984         ccl: Add integer overflow checks.
11985         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
11986         (IN_INT_RANGE): New macros.
11987         (ccl_driver): Use them to check for integer overflow when
11988         decoding a CCL program.  Many of the new checks are whether XINT (x)
11989         fits in int; it doesn't always, on 64-bit hosts.  The new version
11990         doesn't catch all possible integer overflows, but it's an
11991         improvement.  (Bug#8719)
11993         * alloc.c (make_event_array): Use XINT, not XUINT.
11994         There's no need for unsigned here.
11996         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
11997         This follows up to the 2011-05-06 change that substituted uintptr_t
11998         for EMACS_INT.  This case wasn't caught back then.
12000         Rework Fformat to avoid integer overflow issues.
12001         * editfns.c: Include <float.h> unconditionally, as it's everywhere
12002         now (part of C89).  Include <verify.h>.
12003         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12004         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12005         (Fformat): Avoid the prepass trying to compute sizes; it was only
12006         approximate and thus did not catch overflow reliably.  Instead, walk
12007         through the format just once, formatting and computing sizes as we go,
12008         checking for integer overflow at every step, and allocating a larger
12009         buffer as needed.  Keep track separately whether the format is
12010         multibyte.  Keep only the most-recently calculated precision, rather
12011         than them all.  Record whether each argument has been converted to
12012         string.  Use EMACS_INT, not int, for byte and char and arg counts.
12013         Support field widths and precisions larger than INT_MAX.  Avoid
12014         sprintf's undefined behavior with conversion specifications such as %#d
12015         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
12016         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
12017         formatting out-of-range floating point numbers with int
12018         formats.  (Bug#8668)
12020         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12022         * data.c: Avoid integer truncation in expressions involving floats.
12023         * data.c: Include <intprops.h>.
12024         (arith_driver): When there's an integer overflow in an expression
12025         involving floating point, convert the integers to floating point
12026         so that the resulting value does not suffer from catastrophic
12027         integer truncation.  For example, on a 64-bit host (* 4
12028         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12029         Do not rely on undefined behavior after integer overflow.
12031         merge count_size_as_multibyte, parse_str_to_multibyte
12032         * character.c, character.h (count_size_as_multibyte):
12033         Rename from parse_str_to_multibyte; all uses changed.
12034         Check for integer overflow.
12035         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12036         since it's now a duplicate of the other.  This is more of
12037         a character than a buffer op, so better that it's in character.c.
12038         * fns.c, print.c: Adjust to above changes.
12040 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
12042         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12044 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
12046         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12047         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12048         (x_clipboard_manager_save): Now static.
12049         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12051         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12052         (crypto_hash_function): Now static.
12053         Fix pointer signedness problems.  Avoid unnecessary initializations.
12055 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
12057         * termhooks.h (Vselection_alist): Make it terminal-local.
12059         * terminal.c (create_terminal): Initialize it.
12061         * xselect.c: Support for clipboard managers.
12062         (Vselection_alist): Move to termhooks.h as terminal-local var.
12063         (LOCAL_SELECTION): New macro.
12064         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12065         (symbol_to_x_atom): Remove gratuitous arg.
12066         (x_handle_selection_request, lisp_data_to_selection_data)
12067         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
12068         (x_own_selection, x_get_local_selection, x_convert_selection):
12069         New arg, specifying work frame.  Use terminal-local Vselection_alist.
12070         (some_frame_on_display): Delete unused function.
12071         (Fx_own_selection_internal, Fx_get_selection_internal)
12072         (Fx_disown_selection_internal, Fx_selection_owner_p)
12073         (Fx_selection_exists_p): New optional frame arg.
12074         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12075         (x_handle_selection_clear): Don't treat other terminals with the
12076         same keyboard specially.  Use the terminal-local Vselection_alist.
12077         (x_clear_frame_selections): Use Frun_hook_with_args.
12079         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12081         * xterm.h: Add support for those atoms.
12083 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
12085         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12086         (converted_selections, conversion_fail_tag): New global variables.
12087         (x_selection_request_lisp_error): Free the above.
12088         (x_get_local_selection): Remove unnecessary code.
12089         (x_reply_selection_request): Args changed; handle arbitrary array
12090         of converted selections stored in converted_selections.
12091         Separate the XChangeProperty and SelectionNotify steps.
12092         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12093         (x_convert_selection): New function.
12094         (x_handle_selection_event): Simplify.
12095         (x_get_foreign_selection): Don't ignore incoming requests while
12096         waiting for an answer; this will fail when we implement
12097         SAVE_TARGETS, and seems unnecessary anyway.
12098         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12099         (Vx_sent_selection_functions): Doc fix.
12101 2011-05-26  Leo Liu  <sdl.web@gmail.com>
12103         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
12105 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12107         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12109         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12110         for fringe update if it has periodic bitmap.
12111         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
12112         and fringe_bitmap_periodic_p.
12114         * fringe.c (get_fringe_bitmap_data): New function.
12115         (draw_fringe_bitmap_1, update_window_fringes): Use it.
12116         (update_window_fringes): Record periodicity of fringe bitmap in glyph
12117         row.  Mark glyph row for fringe update if periodicity changed.
12119         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12120         for fringe update unless it has periodic bitmap.
12122 2011-05-25  Kenichi Handa  <handa@m17n.org>
12124         * xdisp.c (get_next_display_element): Set correct it->face_id for
12125         a static composition.
12127 2011-05-24  Leo Liu  <sdl.web@gmail.com>
12129         * deps.mk (fns.o):
12130         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12132         * fns.c (crypto_hash_function, Fsha1): New function.
12133         (Fmd5): Use crypto_hash_function.
12134         (syms_of_fns): Add Ssha1.
12136 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
12138         * gnutls.c: Remove unused macros.
12139         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12140         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12141         Remove macros that are defined and never used.
12142         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12144 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
12146         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12147         (Fx_get_selection_internal): Minor cleanup.
12148         (Fx_own_selection_internal): Rename arguments for consistency with
12149         select.el.
12151 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
12153         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12155 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
12157         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12159 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12161         * dispnew.c (scrolling_window): Don't exclude the case that the
12162         last enabled row in the desired matrix touches the bottom boundary.
12164 2011-05-21  Glenn Morris  <rgm@gnu.org>
12166         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
12167         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12168         and add some more files.
12170 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
12172         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
12173         report_file_error introduced by the change from 2011-05-07.
12175 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
12177         * systime.h (Time): Define only if emacs is defined.
12178         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
12179         where the include path doesn't have X11/X.h by default.  See
12180         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
12182 2011-05-20  Kenichi Handa  <handa@m17n.org>
12184         * composite.c (find_automatic_composition): Fix previous change.
12186 2011-05-20  Glenn Morris  <rgm@gnu.org>
12188         * lisp.mk: New file, split from Makefile.in.
12189         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
12190         (shortlisp): Remove.
12191         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
12193 2011-05-19  Glenn Morris  <rgm@gnu.org>
12195         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
12196         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
12197         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
12198         (lisp): Set the order to that of loadup.el.
12199         (shortlisp): Make it a copy of $lisp.
12200         (SOME_MACHINE_LISP): Remove.
12201         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
12202         Use just $shortlisp, not $SOME_MACHINE_LISP too.
12204 2011-05-18  Kenichi Handa  <handa@m17n.org>
12206         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
12207         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
12208         (find_automatic_composition): Mostly rewrite for efficiency.
12210 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
12212         * makefile.w32-in: Update dependencies.
12214 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
12216         * menu.c: Include limits.h (fixes the MS-Windows build broken by
12217         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
12219 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
12221         Fix some integer overflow issues, such as string length overflow.
12223         * insdel.c (count_size_as_multibyte): Check for string overflow.
12225         * character.c (lisp_string_width): Check for string overflow.
12226         Use EMACS_INT, not int, for string indexes and lengths; in
12227         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
12228         the resulting string length overflows an EMACS_INT; instead,
12229         report a string overflow if no precision given.  When checking for
12230         precision exhaustion, use a check that cannot possibly have
12231         integer overflow.  (Bug#8675)
12232         * character.h (lisp_string_width): Adjust to new signature.
12234         * alloc.c (string_overflow): New function.
12235         (Fmake_string): Use it.  This doesn't change behavior, but saves
12236         a few bytes and will simplify future changes.
12237         * character.c (string_escape_byte8): Likewise.
12238         * lisp.h (string_overflow): New decl.
12240         Fixups, following up to the user-interface timestamp change.
12241         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
12242         for UI timestamps, instead of unsigned long.
12243         * msdos.c (mouse_get_pos): Likewise.
12244         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
12245         * w32gui.h (Time): Define by including "systime.h" rather than by
12246         declaring it ourselves.  (Bug#8664)
12248         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
12249         * image.c (clear_image_cache): Likewise.
12251         * term.c (term_mouse_position): Don't assume time_t wraparound.
12253         Be more systematic about user-interface timestamps.
12254         Before, the code sometimes used 'Time', sometimes 'unsigned long',
12255         and sometimes 'EMACS_UINT', to represent these timestamps.
12256         This change causes it to use 'Time' uniformly, as that's what X uses.
12257         This makes the code easier to follow, and makes it easier to catch
12258         integer overflow bugs such as Bug#8664.
12259         * frame.c (Fmouse_position, Fmouse_pixel_position):
12260         Use Time, not unsigned long, for user-interface timestamps.
12261         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
12262         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
12263         * keyboard.h (last_event_timestamp): Likewise.
12264         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
12265         * menu.h (xmenu_show): Likewise.
12266         * term.c (term_mouse_position): Likewise.
12267         * termhooks.h (struct input_event.timestamp): Likewise.
12268         (struct terminal.mouse_position_hook): Likewise.
12269         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
12270         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
12271         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
12272         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
12273         what it was before.
12274         * menu.h, termhooks.h: Include "systime.h", for Time.
12276         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
12277         Don't assume that the difference between two unsigned long values
12278         can fit into an integer.  At this point, we know button_down_time
12279         <= event->timestamp, so the difference must be nonnegative, so
12280         there's no need to cast the result if double-click-time is
12281         nonnegative, as it should be; check that it's nonnegative, just in
12282         case.  This bug is triggered when events are more than 2**31 ms
12283         apart (about 25 days).  (Bug#8664)
12285         * xselect.c (last_event_timestamp): Remove duplicate decl.
12286         (x_own_selection): Remove needless cast to unsigned long.
12288         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
12289         that always fit in int.  Use a sentinel instead of a counter, to
12290         avoid a temp and to allay GCC's concerns about possible int overflow.
12291         * frame.h (struct frame): Use int for menu_bar_items_used
12292         instead of EMACS_INT, since it always fits in int.
12294         * menu.c (grow_menu_items): Check for int overflow.
12296         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
12298         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
12299         Before, the code was not consistent.  These values cannot exceed
12300         2**31 - 1 so there's no need to make them unsigned.
12301         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
12302         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
12303         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
12304         as modifiers.
12305         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
12307         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
12308         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
12309         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
12310         presumably because the widths might not match.
12312         * window.c (size_window): Avoid needless test at loop start.
12314 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
12316         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
12318 2011-05-12  Drew Adams  <drew.adams@oracle.com>
12320         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
12322 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
12324         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
12325         `width' to `bar_area_x' and `bar_area_width', respectively.
12326         (x_scroll_run): Take account of fringe background extension.
12328         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
12329         Rename local vars `left' and `width' to `bar_area_x' and
12330         `bar_area_width', respectively.
12331         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
12332         background extension.
12334 2011-05-10  Jim Meyering  <meyering@redhat.com>
12336         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
12338 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
12340         * image.c (Finit_image_library): Return t for built-in image types,
12341         like pbm and xbm.  (Bug#8640)
12343 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
12345         * w32menu.c (set_frame_menubar): Fix submenu allocation.
12347 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
12349         * w32console.c (Fset_screen_color): Doc fix.
12350         (Fget_screen_color): New function.
12351         (syms_of_ntterm): Defsubr it.
12353         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
12354         unlink the temporary file if Fcall_process didn't create it in the
12355         first place.
12356         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
12357         child process will be redirected to a file specified with `:file'.
12358         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
12359         cue to call_process_cleanup not to close that handle.
12361 2011-05-07  Ben Key  <bkey76@gmail.com>
12363         * makefile.w32-in: The bootstrap-temacs rule now makes use of
12364         one of two shell specific rules, either bootstrap-temacs-CMD or
12365         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
12366         to the previous implementation of the bootstrap-temacs rule.
12367         The bootstrap-temacs-CMD rule is similar to the previous
12368         implementation of the bootstrap-temacs rule except that it
12369         makes use of the ESC_CFLAGS variable instead of the CFLAGS
12370         variable.
12372         These changes, along with some changes to nt/configure.bat,
12373         nt/gmake.defs, and nt/nmake.defs, are required to extend my
12374         earlier fix to add support for --cflags and --ldflags options
12375         that include quotes so that it works whether make uses cmd or
12376         sh as the shell.
12378 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
12380         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
12381         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
12382         is a constant.
12383         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
12384         a string.  Handle both cases.
12385         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
12386         (Fdbus_register_method): Use Qinvalid_function.
12388 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
12390         * makefile.w32-in: Update dependencies.
12391         (LISP_H): Add inttypes.h and stdin.h.
12392         (PROCESS_H): Add unistd.h.
12394 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
12396         * lread.c: Include limits.h (fixes the MS-Windows build broken by
12397         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
12399 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
12401         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
12403         * term.c (vfatal): Remove stray call to va_end.
12404         It's not needed and the C Standard doesn't allow it here anyway.
12406         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
12407         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
12409         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
12410         bytes.
12412         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
12414         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12416         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
12418         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
12420         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
12422         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
12423         * charset.c (Fdefine_charset_internal): Don't initialize
12424         charset.code_space[15].  The value was garbage, on hosts with
12425         32-bit int (Bug#8600).
12427         * lread.c (read_integer): Be more consistent with string-to-number.
12428         Use string_to_number to do the actual conversion; this avoids
12429         rounding errors and fixes some other screwups.  Without this fix,
12430         for example, #x1fffffffffffffff was misread as -2305843009213693952.
12431         (digit_to_number): Move earlier, for benefit of read_integer.
12432         Return -1 if the digit is out of range for the base, -2 if it is
12433         not a digit in any supported base.  (Bug#8602)
12435         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
12437         * dispnew.c (scrolling_window): Return 1 if we scrolled,
12438         to match comment at start of function.  This also removes a
12439         GCC warning about overflow in a 32+64-bit port.
12441         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
12443         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
12444         Reported by Stefan Monnier in
12445         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
12446         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12447         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
12449         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
12450         (EMACS_UINTPTR): Likewise, with uintptr_t.
12452         * lisp.h: Prefer 64-bit EMACS_INT if available.
12453         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
12454         on 32-bit hosts that have 64-bit int, so that they can access
12455         large files.
12456         However, temporarily disable this change unless the temporary
12457         symbol WIDE_EMACS_INT is defined.
12459         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
12461         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
12462         This removes an assumption that EMACS_INT and long are the same
12463         width as pointers.  The assumption is true for Emacs porting targets
12464         now, but we want to make other targets possible.
12465         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
12466         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
12467         In the rest of the code, change types of integers that hold casted
12468         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
12469         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
12470         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
12471         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
12472         No need to cast type when ORing.
12473         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
12474         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
12475         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
12476         assume EMACS_INT is the same width as char *.
12477         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
12478         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
12479         Remove no-longer-needed casts.
12480         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
12481         (xg_tool_bar_help_callback, xg_make_tool_item):
12482         Use EMACS_INTPTR to hold an integer
12483         that will be cast to void *; this can avoid a GCC warning
12484         if EMACS_INT is not the same width as void *.
12485         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
12486         * xdisp.c (display_echo_area_1, resize_mini_window_1):
12487         (current_message_1, set_message_1):
12488         Use a local to convert to proper width without a cast.
12489         * xmenu.c (dialog_selection_callback): Likewise.
12491         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
12492         Also, don't assume VALBITS / RAND_BITS is less than 5,
12493         and don't rely on undefined behavior when shifting a 1 left into
12494         the sign bit.
12495         * lisp.h (get_random): Change signature to match.
12497         * lread.c (hash_string): Use size_t, not int, for hash computation.
12498         Normally we prefer signed values; but hashing is special, because
12499         it's better to use unsigned division on hash table sizes so that
12500         the remainder is nonnegative.  Also, size_t is the natural width
12501         for hashing into memory.  The previous code used 'int', which doesn't
12502         retain enough info to hash well into very large tables.
12503         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
12505         * dbusbind.c: Don't possibly lose pointer info when converting.
12506         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
12507         Use XPNTR rather than XHASH, so that the high-order bits of
12508         the pointer aren't lost when converting through void *.
12510         * eval.c (Fautoload): Don't double-shift a pointer.
12512         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
12514 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
12516         * gnutls.c (DEF_GNUTLS_FN):
12517         * image.c (DEF_IMGLIB_FN): Make function pointers static.
12519 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
12521         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
12522         marker.  (Bug#8610)
12524 2011-05-05  Eli Zaretskii  <eliz@gnu.org>
12526         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
12527         New version that can reserve upto 2GB of heap space.
12529 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
12531         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
12533 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
12535         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
12536         `gnutls_certificate_set_x509_key_file'.
12538 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
12540         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
12541         Update dependencies.
12543 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
12545         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
12546         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12547         Remove unused parameter `fildes'.
12548         * process.c (read_process_output, send_process): Don't pass it.
12550 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
12552         Fix previous change: the library cache is defined in w32.c.
12553         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
12554         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
12556 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
12558         Implement dynamic loading of GnuTLS on Windows.
12560         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
12561         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
12562         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12563         Declare.
12565         * gnutls.c (Qgnutls_dll): Define.
12566         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
12567         (gnutls_*): Declare function pointers.
12568         (init_gnutls_functions): New function to initialize function pointers.
12569         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
12570         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
12571         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
12572         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
12573         (emacs_gnutls_write, emacs_gnutls_read)
12574         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
12575         (Fgnutls_available_p): New function.
12576         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
12577         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
12578         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
12580         * image.c: Include w32.h.
12581         (Vimage_type_cache): Delete.
12582         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
12583         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
12584         (w32_delayed_load): Move to w32.c.
12586         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
12588         * w32.c (QCloaded_from, Vlibrary_cache): Define.
12589         (w32_delayed_load): Move from image.c.  When loading a library, record
12590         its filename in the :loaded-from property of the library id.
12591         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
12592         Initialize and staticpro them.
12593         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
12595         * process.c: Include lisp.h before w32.h, not after.
12596         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
12597         instead of gnutls_record_check_pending.
12599         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
12601 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
12603         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
12604         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
12605         as passed in.
12607 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
12609         * xterm.c (x_set_frame_alpha): Do not set property on anything
12610         else than FRAME_X_OUTER_WINDOW (Bug#8608).
12612 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
12614         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
12616 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
12618         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
12619         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
12620         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
12621         (gnutls_global_initialized, Qgnutls_bootprop_priority)
12622         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
12623         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
12624         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
12625         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
12626         (Qgnutls_bootprop_callbacks_verify): Make static.
12628 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
12630         * callproc.c: Indentation fixup.
12632         * sysdep.c (wait_for_termination_1): Make static.
12633         (wait_for_termination, interruptible_wait_for_termination):
12634         Move after wait_for_termination_1.
12636 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
12638         * sysdep.c (interruptible_wait_for_termination): New function
12639         which is like wait_for_termination, but allows keyboard
12640         interruptions.
12642         * callproc.c (Fcall_process): Add (:file "file") as an option for
12643         the STDOUT buffer.
12644         (Fcall_process_region): Ditto.
12646 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
12648         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
12649         rather than `XVECTOR (FOO)->size'.
12651         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
12652         inttypes.h, as a gnulib replacement is used if it not available in
12653         system headers.
12655 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
12657         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
12658         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
12659         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
12661         * coding.c (coding_alloc_by_realloc): Error out if destination
12662         will grow beyond MOST_POSITIVE_FIXNUM.
12663         (decode_coding_emacs_mule): Abort if there isn't enough place in
12664         charbuf for the composition carryover bytes.  Reserve an extra
12665         space for up to 2 characters produced in a loop.
12666         (decode_coding_iso_2022): Abort if there isn't enough place in
12667         charbuf for the composition carryover bytes.
12669 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
12671         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
12672         aborting when %lld or %lll format is passed.
12673         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
12674         %llo or %llx format is passed.  (Bug#8545)
12676         * window.c (window_scroll_line_based): Use a marker instead of
12677         simple variables to record original value of point.  (Bug#7952)
12679         * doprnt.c (doprnt): Fix the case where a multibyte sequence
12680         produced by %s or %c overflows available buffer space.  (Bug#8545)
12682 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
12684         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
12685         (SIZE_MAX): Move defn after all includes, as they might #define it.
12687 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
12689         * w32.c (init_environment): Warn about defaulting HOME to C:\.
12691 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
12693         * keyboard.c (Qdelayed_warnings_hook): Define.
12694         (command_loop_1): Run `delayed-warnings-hook'
12695         if Vdelayed_warnings_list is non-nil.
12696         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
12697         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
12699 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
12701         * doprnt.c (doprnt): Don't return value smaller than the buffer
12702         size if the message was truncated.  (Bug#8545).
12704 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
12706         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
12707         (Fx_window_property): #if-0 the whole functions, not just the bodies.
12709 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
12711         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
12713 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
12715         * makefile.w32-in: Update dependencies.
12717 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
12719         Improve `doprnt' and its usage.  (Bug#8545)
12720         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
12721         `format_end'.  Remove support for %l as a conversion specifier.
12722         Don't use xrealloc.  Improve diagnostics when the %l size modifier
12723         is used.  Update the commentary.
12725         * eval.c (verror): Simplify calculation of size_t.
12727         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
12728         messages.
12730 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
12732         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
12733         change.
12735 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
12737         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
12738         This makes this file independent of the recent pseudovector change.
12740 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
12742         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
12744         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
12745         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
12746         Remove unused local.
12747         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
12749         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
12750         GCC 4.6.0 optimizes based on type-based alias analysis.
12751         For example, if b is of type struct buffer * and v of type struct
12752         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
12753         != &v->size, and therefore "v->size = 1; b->size = 2; return
12754         v->size;" must therefore return 1.  This assumption is incorrect
12755         for Emacs, since it type-puns struct Lisp_Vector * with many other
12756         types.  To fix this problem, this patch adds a new type struct
12757         vectorlike_header that documents the constraints on layout of vectors
12758         and pseudovectors, and helps optimizing compilers not get fooled
12759         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
12760         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
12761         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
12762         the size member.
12763         (XSETPVECTYPE): Rewrite in terms of new macro.
12764         (XSETPVECTYPESIZE): New macro, specifying both type and size.
12765         This is a bit clearer, and further avoids the possibility of
12766         undesirable aliasing.
12767         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
12768         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
12769         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
12770         since Lisp_Subr is a special case (no "next" field).
12771         (ASIZE): Now uses header.size rather than size.
12772         All previous uses of XVECTOR (foo)->size replaced to use this macro,
12773         to avoid the hassle of writing XVECTOR (foo)->header.size.
12774         (struct vectorlike_header): New type.
12775         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
12776         object, to help avoid aliasing.
12777         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
12778         (SUBRP): Likewise, since Lisp_Subr is a special case.
12779         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
12780         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
12781         (struct Lisp_Hash_Table): Combine first two members into a single
12782         struct vectorlike_header member.  All uses of "size" and "next" members
12783         changed to be "header.size" and "header.next".
12784         * buffer.h (struct buffer): Likewise.
12785         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
12786         * frame.h (struct frame): Likewise.
12787         * process.h (struct Lisp_Process): Likewise.
12788         * termhooks.h (struct terminal): Likewise.
12789         * window.c (struct save_window_data, struct saved_window): Likewise.
12790         * window.h (struct window): Likewise.
12791         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
12792         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
12793         * buffer.c (init_buffer_once): Likewise.
12794         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
12795         special case.
12796         * process.c (Fformat_network_address): Use local var for size,
12797         for brevity.
12799         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
12801         Make the Lisp reader and string-to-float more consistent (Bug#8525)
12802         * data.c (atof): Remove decl; no longer used or needed.
12803         (digit_to_number): Move to lread.c.
12804         (Fstring_to_number): Use new string_to_number function, to be
12805         consistent with how the Lisp reader treats infinities and NaNs.
12806         Do not assume that floating-point numbers represent EMACS_INT
12807         without losing information; this is not true on most 64-bit hosts.
12808         Avoid double-rounding errors, by insisting on integers when
12809         parsing non-base-10 numbers, as the documentation specifies.
12810         * lisp.h (string_to_number): New decl, replacing ...
12811         (isfloat_string): Remove.
12812         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
12813         (read1): Do not accept +. and -. as integers; this
12814         appears to have been a coding error.  Similarly, do not accept
12815         strings like +-1e0 as floating point numbers.  Do not report
12816         overflow for integer overflows unless the base is not 10 which
12817         means we have no simple and reliable way to continue.
12818         Break out the floating-point parsing into a new
12819         function string_to_number, so that Fstring_to_number parses
12820         floating point numbers consistently with the Lisp reader.
12821         (digit_to_number): Move here from data.c.  Make it static inline.
12822         (E_CHAR, EXP_INT): Remove, replacing with ...
12823         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
12824         (string_to_number): New function, replacing isfloat_string.
12825         This function checks for valid syntax and produces the resulting
12826         Lisp float number too.  Rework it so that string-to-number
12827         no longer mishandles examples like "1.0e+".  Use strtoumax,
12828         so that overflow for non-base-10 numbers is reported only when
12829         there's no portable and simple way to convert to floating point.
12831         * textprop.c (set_text_properties_1): Rewrite for clarity,
12832         and to avoid GCC warning about integer overflow.
12834         * intervals.h (struct interval): Use EMACS_INT for members
12835         where EMACS_UINT might cause problems.  See
12836         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
12837         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
12838         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
12839         All uses changed.
12840         (offset_intervals): Tell GCC not to worry about length overflow
12841         when negating a negative length.
12843         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
12844         (overrun_check_free): Likewise.
12846         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
12847         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
12848         word size.
12850         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12851         (gnutls_make_error): Rename local to avoid shadowing.
12852         (gnutls_emacs_global_deinit): ifdef out; not used.
12853         (Fgnutls_boot): Use const for pointer to readonly storage.
12854         Comment out unused local.  Fix pointer signedness problems.
12856         * lread.c (openp): Don't stuff size_t into an 'int'.
12857         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
12858         about possible signed overflow.
12860         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
12861         (GDK_KEY_g): Don't define if already defined.
12862         (xg_prepare_tooltip): Avoid pointer signedness problem.
12863         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
12865         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
12866         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
12868         * xfns.c (Fx_window_property): Simplify a bit,
12869         to make a bit faster and to avoid GCC 4.6.0 warning.
12870         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
12872         * fns.c (internal_equal): Don't assume size_t fits in int.
12874         * alloc.c (compact_small_strings): Tighten assertion a little.
12876         Replace pEd with more-general pI, and fix some printf arg casts.
12877         * lisp.h (pI): New macro, generalizing old pEd macro to other
12878         conversion specifiers.  For example, use "...%"pI"d..." rather
12879         than "...%"pEd"...".
12880         (pEd): Remove.  All uses replaced with similar uses of pI.
12881         * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
12882         * alloc.c (check_pure_size): Don't overflow by converting size to int.
12883         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
12884         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
12885         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
12886         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
12887         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
12888         64-bit hosts.
12889         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
12890         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
12891         * print.c (safe_debug_print, print_object): Likewise.
12892         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
12893         to int.
12894         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
12895         avoiding the 0 flag, which is not portable.
12896         * process.c (Fmake_network_process): Use pI to avoid cast.
12897         * region-cache.c (pp_cache): Likewise.
12898         * xdisp.c (decode_mode_spec): Likewise.
12899         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
12900         behavior on 64-bit hosts with printf arg.
12901         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
12902         (x_stop_queuing_selection_requests): Likewise.
12903         (x_get_window_property): Don't truncate byte count to an 'int'
12904         when tracing.
12906         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
12907         here, since it parses constructs like leading '-' and spaces,
12908         which are not wanted; and it overflows with large numbers.
12909         Instead, simply match F[0-9]+, which is what is wanted anyway.
12911         * alloc.c: Remove unportable assumptions about struct layout.
12912         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
12913         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
12914         (allocate_vectorlike, make_pure_vector): Use the new macros,
12915         plus offsetof, to remove unportable assumptions about struct layout.
12916         These assumptions hold on all porting targets that I know of, but
12917         they are not guaranteed, they're easy to remove, and removing them
12918         makes further changes easier.
12920         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
12921         This doesn't fix a bug but makes the code clearer.
12922         (string_overrun_cookie): Now const.  Use initializers that
12923         don't formally overflow signed char, to avoid warnings.
12924         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
12925         can cause Emacs to crash when string overrun checking is enabled.
12926         (allocate_buffer): Don't assume sizeof (struct buffer) is a
12927         multiple of sizeof (EMACS_INT); it need not be, if
12928         alignof(EMACS_INT) < sizeof (EMACS_INT).
12929         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
12931 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
12933         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
12935 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
12937         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
12938         supposed to be handshaking.  (Bug#8556)
12939         Reported by Paul Eggert <eggert@cs.ucla.edu>.
12941 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
12943         * lisp.h (Qdebug): List symbol.
12944         * eval.c (Qdebug): Restore global linkage.
12945         * keyboard.c (debug-on-event): New variable.
12946         (handle_user_signal): Break into debugger when debug-on-event
12947         matches the current signal symbol.
12949 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
12951         * alloc.c (check_sblock, check_string_bytes)
12952         (check_string_free_list): Convert to standard C.
12954 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
12956         * w32.c (emacs_gnutls_push): Fix typo.
12958 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
12960         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
12961         "cast to pointer from integer of different size".
12963         Improve doprnt and its use in verror.  (Bug#8545)
12964         * doprnt.c (doprnt): Document the set of format control sequences
12965         supported by the function.  Use SAFE_ALLOCA instead of always
12966         using `alloca'.
12968         * eval.c (verror): Don't limit the buffer size at size_max-1, that
12969         is one byte too soon.  Don't use xrealloc; instead xfree and
12970         xmalloc anew.
12972 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
12974         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
12975         callbacks stage.
12977         * gnutls.c: Renamed global_initialized to
12978         gnutls_global_initialized.  Added internals for the
12979         :verify-hostname-error, :verify-error, and :verify-flags
12980         parameters of `gnutls-boot' and documented those parameters in the
12981         docstring.  Start callback support.
12982         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
12983         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
12984         on error.  Return error code.
12985         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
12986         (emacs_gnutls_read): Likewise.
12987         (Fgnutls_boot): Return handshake error code.
12988         (emacs_gnutls_handle_error): New function.
12989         (wsaerror_to_errno): Likewise.
12991         * w32.h (emacs_gnutls_pull): Add prototype.
12992         (emacs_gnutls_push): Likewise.
12994         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
12995         (emacs_gnutls_push): Likewise.
12997 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
12999         * process.c (wait_reading_process_output): Check if GnuTLS
13000         buffered some data internally if no FDs are set for TLS
13001         connections.
13003         * makefile.w32-in (OBJ2): Add gnutls.$(O).
13004         (LIBS): Link to USER_LIBS.
13005         ($(BLD)/gnutls.$(0)): New target.
13007 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
13009         * xdisp.c (handle_single_display_spec): Rename the
13010         display_replaced_before_p argument into display_replaced_p, to
13011         make it consistent with the commentary.  Fix typos in the
13012         commentary.
13014         * textprop.c (syms_of_textprop): Remove dead code.
13015         (copy_text_properties): Delete obsolete commentary about an
13016         interface that was deleted long ago.  Fix typos in the description
13017         of arguments.
13019         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13020         to changes in oldXMenu/XMenu.h from 2011-04-16.
13021         <menu_help_message, prev_menu_help_message>: Constify.
13022         (IT_menu_make_room): menu->help_text is now `const char **';
13023         adjust.
13025         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13026         to changes in oldXMenu/XMenu.h from 2011-04-16.
13027         (struct XMenu): Declare `help_text' `const char **'.
13029         * xfaces.c <Qunspecified>: Make extern again.
13031         * syntax.c: Include sys/types.h before including regex.h, as
13032         required by POSIX.
13034         * doc.c (get_doc_string): Improve the format passed to `error'.
13036         * doprnt.c (doprnt): Improve commentary.
13038         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13040         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13041         them with etags.
13043         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13044         changes in globals.h immediately force recompilation.
13045         (TAGS): Depend on $(CURDIR)/m/intel386.h and
13046         $(CURDIR)/s/ms-w32.h.
13047         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
13049         * character.c (Fchar_direction): Function deleted.
13050         (syms_of_character): Don't defsubr it.
13051         <char-direction-table>: Deleted.
13053 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
13055         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
13056         * doprnt.c: Include limits.h.
13057         (SIZE_MAX): New macro.
13058         (doprnt): Return a size_t value.  2nd arg is now size_t.
13059         Many local variables are now size_t instead of int or unsigned.
13060         Improve overflow protection.  Support `l' modifier for integer
13061         conversions.  Support %l conversion.  Don't assume an EMACS_INT
13062         argument for integer conversions and for %c.
13064         * lisp.h (doprnt): Restore prototype.
13066         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13067         $(SRC)/character.h.
13069         * Makefile.in (base_obj): Add back doprnt.o.
13071         * deps.mk (doprnt.o): Add back prerequisites.
13072         (callint.o): Depend on character.h.
13074         * eval.c (internal_lisp_condition_case): Include the handler
13075         representation in the error message.
13076         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
13077         when breaking from the loop.
13079         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13081         * callint.c (Fcall_interactively): When displaying error message
13082         about invalid control letter, pass the character's codepoint, not
13083         a pointer to its multibyte form.  Improve display of the character
13084         in octal and display also its hex code.
13086         * character.c (char_string): Use %x to display the (unsigned)
13087         codepoint of an invalid character, to avoid displaying a bogus
13088         negative value.
13090         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13091         `error', not SYMBOL_NAME itself.
13093         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13094         character arguments to `error'.
13096         * charset.c (check_iso_charset_parameter): Fix incorrect argument
13097         to `error' in error message about FINAL_CHAR argument.  Make sure
13098         FINAL_CHAR is a character, and use %c when it is passed as
13099         argument to `error'.
13101 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
13103         * s/ms-w32.h (localtime): Redirect to sys_localtime.
13105         * w32.c: Include <time.h>.
13106         (sys_localtime): New function.
13108 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
13110         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13112         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
13114 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
13116         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13117         zombies (Bug#8467).
13119 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
13121         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13122         gl_state.e_property when gl_state.object is Qt.
13124         * insdel.c (make_gap_larger): Remove limitation of buffer size
13125         to <= INT_MAX.
13127 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
13129         * xdisp.c (lookup_glyphless_char_display)
13130         (produce_glyphless_glyph): Handle cons cell entry in
13131         glyphless-char-display.
13132         (Vglyphless_char_display): Document it.
13134         * term.c (produce_glyphless_glyph): Handle cons cell entry in
13135         glyphless-char-display.
13137 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
13139         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13141         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13143         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13144         definition for no-X builds.
13146 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
13148         Static checks with GCC 4.6.0 and non-default toolkits.
13150         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13152         * process.c (keyboard_bit_set): Define only if SIGIO.
13153         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13154         (send_process): Repair possible setjmp clobbering.
13156         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13158         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13160         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13162         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13163         Define only if needed.
13165         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13166         by pacifying GCC about it.  Maybe it's time to retire it?
13167         * xfaces.c (USG, __TIMEVAL__): Likewise.
13169         * dispextern.h (struct redisplay_interface): Rename param
13170         to avoid shadowing.
13171         * termhooks.h (struct terminal): Likewise.
13172         * xterm.c (xembed_send_message): Likewise.
13174         * insdel.c (make_gap_smaller): Define only if
13175         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
13177         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
13178         it.
13180         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
13181         so that we aren't warned about unused symbols.
13183         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
13185         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
13187         * xfns.c (x_real_positions): Mark locals as initialized.
13189         * xmenu.c (xmenu_show): Don't use uninitialized vars.
13191         * xterm.c: Fix problems found by static analysis with other toolkits.
13192         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
13193         (x_dispatch_event): Declare static if USE_GTK, and
13194         define if USE_GTK || USE_X_TOOLKIT.
13195         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
13196         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
13197         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
13198         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
13200         * xmenu.c (menu_help_callback): Pointer type fixes.
13201         Use const pointers when pointing at readonly data.  Avoid pointer
13202         signedness clashes.
13203         (FALSE): Remove unused macro.
13204         (update_frame_menubar): Remove unused decl.
13206         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
13208         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
13209         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
13210         (single_menu_item): Rename local to avoid shadowing.
13212         * keyboard.c (make_lispy_event): Remove unused local var.
13214         * frame.c, frame.h (x_get_resource_string): Bring this back, but
13215         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
13217         * bitmaps: Change bitmaps from unsigned char back to the X11
13218         compatible char.  Avoid the old compiler warnings about
13219         out-of-range initializers by using, for example, '\xab' rather
13220         than 0xab.
13222         * xgselect.c (xgselect_initialize): Check vs interface
13223         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
13225         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
13227         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
13228         to read-only memory.
13230         * fns.c (vector): Remove; this old hack is no longer needed.
13232         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
13233         Remove unused var.
13234         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
13236         * xrdb.c (x_load_resources): Omit unused local.
13238         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
13239         (x_window): Rename locals to avoid shadowing.
13240         (USG): Use the kludged USG macro, to pacify gcc.
13242         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
13243         (x_term_init): Remove local to avoid shadowing.
13245         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
13247         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
13248         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
13250 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
13252         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
13254         Fix regex.c, syntax.c and friends for buffers > 2GB.
13255         * syntax.h (struct gl_state_s): Declare character position members
13256         EMACS_INT.
13258         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
13260         * textprop.c (verify_interval_modification, interval_of):
13261         Declare arguments EMACS_INT.
13263         * intervals.c (adjust_intervals_for_insertion): Declare arguments
13264         EMACS_INT.
13266         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
13268         * indent.c (Fvertical_motion): Local variable it_start is now
13269         EMACS_INT.
13271         * regex.c (re_match, re_match_2, re_match_2_internal)
13272         (bcmp_translate, regcomp, regexec, print_double_string)
13273         (group_in_compile_stack, re_search, re_search_2, regex_compile)
13274         (re_compile_pattern, re_exec): Declare arguments and local
13275         variables `size_t' and `ssize_t' and return values `regoff_t', as
13276         appropriate.
13277         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
13278         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
13279         <compile_stack_type>: `size' and `avail' are now `size_t'.
13281         * regex.h <regoff_t>: Use ssize_t, not int.
13282         (re_search, re_search_2, re_match, re_match_2): Arguments that
13283         specify buffer/string position and length are now ssize_t and
13284         size_t.  Return type is regoff_t.
13286 2011-04-16  Ben Key  <bkey76@gmail.com>
13288         * nsfont.m: Fixed bugs in ns_get_family and
13289         ns_descriptor_to_entity that were caused by using free to
13290         deallocate memory blocks that were allocated by xmalloc (via
13291         xstrdup).  This caused Emacs to crash when compiled with
13292         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
13293         --enable-checking=xmallocoverrun).  xfree is now used to
13294         deallocate these memory blocks.
13296 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
13298         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
13300         emacs_write: Accept and return EMACS_INT for sizes.
13301         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
13302         et seq.
13303         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
13304         Accept and return EMACS_INT.
13305         (emacs_gnutls_write): Return the number of bytes written on
13306         partial writes.
13307         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
13308         (emacs_read, emacs_write): Remove check for negative size, as the
13309         Emacs source code has been audited now.
13310         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
13311         (emacs_read, emacs_write): Use it.
13312         * process.c (send_process): Adjust to the new signatures of
13313         emacs_write and emacs_gnutls_write.  Do not attempt to store
13314         a byte offset into an 'int'; it might overflow.
13315         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
13317         * sound.c: Don't assume sizes fit in 'int'.
13318         (struct sound_device.period_size, alsa_period_size):
13319         Return EMACS_INT, not int.
13320         (struct sound_device.write, vox_write, alsa_write):
13321         Accept EMACS_INT, not int.
13322         (wav_play, au_play): Use EMACS_INT to store sizes and to
13323         record read return values.
13325 2011-04-15  Ben Key  <bkey76@gmail.com>
13327         * keyboard.c (Qundefined): Don't declare static since it is used
13328         in nsfns.m.
13329         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
13330         static since they are used in nsfont.m.
13332 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
13334         * process.c (Qprocessp): Don't declare static.
13335         * lisp.h (Qprocessp): Declare again.
13337 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
13339         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
13341 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
13343         Improve C-level modularity by making more things 'static'.
13345         Don't publish debugger-only interfaces to other modules.
13346         * lisp.h (safe_debug_print, debug_output_compilation_hack):
13347         (verify_bytepos, count_markers): Move decls to the only modules
13348         that need them.
13349         * region-cache.h (pp_cache): Likewise.
13350         * window.h (check_all_windows): Likewise.
13351         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
13353         * sysdep.c (croak): Now static, if
13354         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
13355         * syssignal.h (croak): Declare only if not static.
13357         * alloc.c (refill_memory_reserve): Now static if
13358         !defined REL_ALLOC || defined SYSTEM_MALLOC.
13359         * lisp.h (refill_memory_reserve): Declare only if not static.
13361         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
13362         Define only if USE_LUCID.
13364         * xrdb.c (x_customization_string, x_rm_string): Now static.
13366         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
13367         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
13369         * xdisp.c (draw_row_with_mouse_face): Now static.
13370         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
13372         * window.h (check_all_windows): Mark externally visible.
13374         * window.c (window_deletion_count): Now static.
13376         * undo.c: Make symbols static if they're not exported.
13377         (last_undo_buffer, last_boundary_position, pending_boundary):
13378         Now static.
13380         * textprop.c (interval_insert_behind_hooks): Now static.
13381         (interval_insert_in_front_hooks): Likewise.
13383         * term.c: Make symbols static if they're not exported.
13384         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
13385         (max_frame_lines, tty_set_terminal_modes):
13386         (tty_reset_terminal_modes, tty_turn_off_highlight):
13387         (get_tty_terminal): Now static.
13388         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
13389         * termhooks.h (term_mouse_moveto): Do not declare if
13390         HAVE_WINDOW_SYSTEM.
13391         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
13392         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
13394         * sysdep.c: Make symbols static if they're not exported.
13395         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
13396         Now static.
13397         (sigprocmask_set, full_mask): Remove; unused.
13398         (wait_debugging): Mark as visible.
13399         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
13400         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
13402         * syntax.c (syntax_temp): Define only if !__GNUC__.
13404         * sound.c (current_sound_device, current_sound): Now static.
13406         * search.c (searchbufs, searchbuf_head): Now static.
13408         * scroll.c (scroll_cost): Remove; unused.
13409         * dispextern.h (scroll_cost): Remove decl.
13411         * region-cache.h (pp_cache): Mark as externally visible.
13413         * process.c: Make symbols static if they're not exported.
13414         (process_tick, update_tick, create_process, chan_process):
13415         (Vprocess_alist, proc_buffered_char, datagram_access):
13416         (fd_callback_data, send_process_frame, process_sent_to): Now static.
13417         (deactivate_process): Mark defn as static, as well as decl.
13418         * lisp.h (create_process): Remove decl.
13419         * process.h (chan_process, Vprocess_alist): Remove decls.
13421         * print.c: Make symbols static if they're not exported.
13422         (print_depth, new_backquote_output, being_printed, print_buffer):
13423         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
13424         (print_interval, print_number_index, initial_stderr_stream):
13425         Now static.
13426         * lisp.h (Fprinc): Remove decl.
13427         (debug_output_compilation_hack): Mark as externally visible.
13429         * sysdep.c (croak): Move decl from here to syssignal.h.
13430         * syssignal.h (croak): Put it here, so the API can be checked when
13431         'croak' is called from dissociate_if_controlling_tty.
13433         * minibuf.c: Make symbols static if they're not exported.
13434         (minibuf_save_list, choose_minibuf_frame): Now static.
13435         * lisp.h (choose_minibuf_frame): Remove decl.
13437         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
13439         * lread.c: Make symbols static if they're not exported.
13440         (read_objects, initial_obarray, oblookup_last_bucket_number):
13441         Now static.
13442         (make_symbol): Remove; unused.
13443         * lisp.h (initial_obarray, make_symbol): Remove decls.
13445         * keyboard.c: Make symbols static if they're not exported.
13446         (single_kboard, recent_keys_index, total_keys, recent_keys):
13447         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
13448         (this_single_command_key_start, echoing, last_auto_save):
13449         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
13450         (command_loop, echo_now, keyboard_init_hook, help_char_p):
13451         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
13452         (Vlispy_mouse_stem, double_click_count):
13453         Now static.
13454         (force_auto_save_soon): Define only if SIGDANGER.
13455         (ignore_mouse_drag_p): Now static if
13456         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
13457         (print_help): Remove; unused.
13458         (stop_character, last_timer_event): Mark as externally visible.
13459         * keyboard.h (ignore_mouse_drag_p): Declare only if
13460         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
13461         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
13462         * lisp.h (echoing): Remove decl.
13463         (force_auto_save_soon): Declare only if SIGDANGER.
13464         * xdisp.c (redisplay_window): Simplify code, to make it more
13465         obvious that ignore_mouse_drag_p is not accessed if !defined
13466         USE_GTK && !defined HAVE_NS.
13468         * intervals.c: Make symbols static if they're not exported.
13469         (merge_properties_sticky, merge_interval_right, delete_interval):
13470         Now static.
13471         * intervals.h (merge_interval_right, delete_interval): Remove decls.
13473         * insdel.c: Make symbols static if they're not exported.
13474         However, leave prepare_to_modify_buffer alone.  It's never
13475         called from outside this function, but that appears to be a bug.
13476         (combine_after_change_list, combine_after_change_buffer):
13477         (adjust_after_replace, signal_before_change): Now static.
13478         (adjust_after_replace_noundo): Remove; unused.
13479         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
13480         (signal_before_change): Remove decls.
13482         * indent.c (val_compute_motion, val_vmotion): Now static.
13484         * image.c: Make symbols static if they're not exported.
13485         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
13486         if USE_GTK.
13487         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
13488         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
13490         * fringe.c (standard_bitmaps): Now static.
13491         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
13493         * frame.c: Make symbols static if they're not exported.
13494         (x_report_frame_params, make_terminal_frame): Now static.
13495         (get_frame_param): Now static, unless HAVE_NS.
13496         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
13497         (x_get_resource_string): Remove; not used.
13498         * frame.h (make_terminal_frame, x_report_frame_params):
13499         (x_get_resource_string); Remove decls.
13500         (x_fullscreen_adjust): Declare only if WINDOWSNT.
13501         * lisp.h (get_frame_param): Declare only if HAVE_NS.
13503         * font.c, fontset.c: Make symbols static if they're not exported.
13504         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
13505         (FACE_SUITABLE_FOR_CHAR_P): Use it.
13506         * font.c (font_close_object): Now static.
13507         * font.h (font_close_object): Remove.
13508         * fontset.c (FONTSET_OBJLIST): Remove.
13509         (free_realized_fontset) #if-0 the body, which does nothing.
13510         (face_suitable_for_char_p): #if-0, as it's never called.
13511         * fontset.h (face_suitable_for_char_p): Remove decl.
13512         * xfaces.c (face_at_string_position):
13513         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
13514         since 0 is always ASCII.
13516         * fns.c (weak_hash_tables): Now static.
13518         * fileio.c: Make symbols static if they're not exported.
13519         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
13520         (Vwrite_region_annotation_buffers): Now static.
13522         * eval.c: Make symbols static if they're not exported.
13523         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
13524         * lisp.h (backtrace_list): Remove decl.
13526         * emacs.c: Make symbols static if they're not exported.
13527         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
13528         (fatal_error_code, fatal_error_signal_hook, standard_args):
13529         Now static.
13530         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
13531         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
13532         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
13533         * lisp.h (fatal_error_signal_hook): Remove decl.
13534         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
13536         * editfns.c: Move a (normally-unused) function to its only use.
13537         * editfns.c, lisp.h (get_operating_system_release): Remove.
13538         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
13539         worth the hassle of breaking this out.
13541         * xterm.c: Make symbols static if they're not exported.
13542         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
13543         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
13544         (x_destroy_window, x_delete_display):
13545         Now static.
13546         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
13547         (x_mouse_leave): Remove; unused.
13548         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
13549         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
13550         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
13551         Remove decls.
13552         (x_mouse_leave): Declare only if WINDOWSNT.
13553         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
13554         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
13555         USE_X_TOOLKIT.
13557         * ftxfont.c: Make symbols static if they're not exported.
13558         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
13559         HAVE_FREETYPE.
13560         * font.h (ftxfont_driver): Likewise.
13562         * xfns.c: Make symbols static if they're not exported.
13563         (x_last_font_name, x_display_info_for_name):
13564         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
13565         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
13566         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
13567         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
13568         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
13569         (last_show_tip_args): Now static.
13570         (xic_defaut_fontset, xic_create_fontsetname): Define only if
13571         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
13572         (x_screen_planes): Remove; unused.
13573         * dispextern.h (x_screen_planes): Remove decl.
13575         * dispnew.c: Make symbols static if they're not exported.
13576         * dispextern.h (redraw_garbaged_frames, scrolling):
13577         (increment_row_positions): Remove.
13578         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
13579         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
13580         Now static.
13581         (redraw_garbaged_frames): Remove; unused.
13583         * xfaces.c: Make symbols static if they're not exported.
13584         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
13585         Remove decls.
13586         * xterm.h (defined_color): Remove decls.
13587         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
13588         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
13589         (menu_face_changed_default, defined_color, free_realized_face):
13590         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
13591         (ascii_face_of_lisp_face): Remove; unused.
13593         * xdisp.c: Make symbols static if they're not exported.
13594         * dispextern.h (scratch_glyph_row, window_box_edges):
13595         (glyph_to_pixel_coords, set_cursor_from_row):
13596         (get_next_display_element, set_iterator_to_next):
13597         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
13598         (show_mouse_face): Remove decls
13599         * frame.h (message_buf_print): Likewise.
13600         * lisp.h (pop_message, set_message, check_point_in_composition):
13601         Likewise.
13602         * xterm.h (set_vertical_scroll_bar): Likewise.
13603         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
13604         (message_buf_print, scratch_glyph_row, displayed_buffer):
13605         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
13606         (get_next_display_element, show_mouse_face, window_box_edges):
13607         (frame_to_window_pixel_xy, check_point_in_composition):
13608         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
13609         (glyph_to_pixel_coords): Remove; unused.
13611         * dired.c (file_name_completion): Now static.
13613         * dbusbind.c (xd_in_read_queued_messages): Now static.
13615         * lisp.h (circular_list_error, FOREACH): Remove; unused.
13616         * data.c (circular_list_error): Remove.
13618         * commands.h (last_point_position, last_point_position_buffer):
13619         (last_point_position_window): Remove decls.
13620         * keyboard.c: Make these variables static.
13622         * coding.h (coding, code_convert_region, encode_coding_gap):
13623         Remove decls.
13624         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
13625         (iso_code_class, detect_coding, code_convert_region): Now static.
13626         (encode_coding_gap): Remove; unused.
13628         * chartab.c (chartab_chars, chartab_bits): Now static.
13630         * charset.h (charset_iso_8859_1): Remove decl.
13631         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
13632         Now static.
13634         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
13635         * ccl.c (Vccl_program_table): Now static.
13636         (check_ccl_update): Remove; unused.
13638         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
13639         * category.h: ... from here.
13640         * category.c (check_category_table, set_category_set): Now static.
13642         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
13643         * lisp.h: Remove these decls.
13645         * buffer.c (buffer_count): Remove unused var.
13647         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
13648         so that it's not optimized away.
13649         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
13650         * dispextern.h (bidi_dump_cached_states): Remove, since it's
13651         exported only to the debugger.
13653         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
13654         * atimer.h (run_all_atimers): Remove; not exported.
13656         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
13657         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
13658         was inaccessible from Lisp.
13659         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
13660         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
13662         alloc.c: Import and export fewer symbols, and remove unused items.
13663         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
13664         is defined.
13665         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
13666         it's not optimized away by whole-program optimization.
13667         (message_enable_multibyte, free_misc): Remove.
13668         (catchlist, handlerlist, mark_backtrace):
13669         Declare only if BYTE_MARK_STACK.
13670         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
13671         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
13672         (message_enable_multibyte): Remove decl.
13673         (free_misc, interval_free_list, float_block, float_block_index):
13674         (n_float_blocks, float_free_list, cons_block, cons_block_index):
13675         (cons_free_list, last_marked_index):
13676         Now static.
13677         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
13678         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
13679         (mark_backtrace): Define only if BYTE_MARK_STACK.
13680         * xdisp.c (message_enable_multibyte): Now static.
13682         Declare Lisp_Object Q* variables to be 'static' if not exported.
13683         This makes it easier for human readers (and static analyzers)
13684         to see whether these variables are used from other modules.
13685         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
13686         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
13687         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
13688         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
13689         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
13690         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
13691         * xmenu.c, xselect.c:
13692         Declare Q* vars static if they are not used in other modules.
13693         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
13694         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
13695         Remove decls of unexported vars.
13696         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
13698         * lisp.h (DEFINE_FUNC): Make sname 'static'.
13700         Make Emacs functions such as Fatom 'static' by default.
13701         This makes it easier for human readers (and static analyzers)
13702         to see whether these functions can be called from other modules.
13703         DEFUN now defines a static function.  To make the function external
13704         so that it can be used in other C modules, use the new macro DEFUE.
13705         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
13706         (Finit_image_library):
13707         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
13708         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
13709         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
13710         Remove decls, since these functions are now static.
13711         (Funintern, Fget_internal_run_time): New decls, since these functions
13712         were already external.
13714         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
13715         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
13716         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
13717         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
13718         * keyboard.c, keymap.c, lread.c:
13719         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
13720         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
13721         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
13722         Mark functions with DEFUE instead of DEFUN,
13723         if they are used in other modules.
13724         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
13725         decls for now-static functions.
13726         * buffer.h (Fdelete_overlay): Remove decl.
13727         * callproc.c (Fgetenv_internal): Mark as internal.
13728         * composite.c (Fremove_list_of_text_properties): Remove decl.
13729         (Fcomposition_get_gstring): New forward static decl.
13730         * composite.h (Fcomposite_get_gstring): Remove decl.
13731         * dired.c (Ffile_attributes): New forward static decl.
13732         * doc.c (Fdocumntation_property): New forward static decl.
13733         * eval.c (Ffetch_bytecode): New forward static decl.
13734         (Funintern): Remove extern decl; now in .h file where it belongs.
13735         * fileio.c (Fmake_symbolic_link): New forward static decl.
13736         * image.c (Finit_image_library): New forward static decl.
13737         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
13738         * intervals.h (Fprevious_property_change):
13739         (Fremove_list_of_text_properties): Remove decls.
13740         * keyboard.c (Fthis_command_keys): Remove decl.
13741         (Fcommand_execute): New forward static decl.
13742         * keymap.c (Flookup_key): New forward static decl.
13743         (Fcopy_keymap): Now static.
13744         * keymap.h (Flookup_key): Remove decl.
13745         * process.c (Fget_process): New forward static decl.
13746         (Fprocess_datagram_address): Mark as internal.
13747         * syntax.c (Fsyntax_table_p): New forward static decl.
13748         (skip_chars): Remove duplicate decl.
13749         * textprop.c (Fprevious_property_change): New forward static decl.
13750         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
13751         Now internal.
13752         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
13753         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
13755         * editfns.c (Fformat): Remove unreachable code.
13757 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
13759         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
13760         change.  (Bug#8496)
13762 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
13764         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
13765         when at ZV.  (Bug#8487)
13767 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
13769         * charset.c (Fclear_charset_maps): Use xfree instead of free.
13770         (Bug#8437)
13771         * keyboard.c (parse_tool_bar_item): Likewise.
13772         * sound.c (sound_cleanup, alsa_close): Likewise.
13773         * termcap.c (tgetent): Likewise.
13774         * xfns.c (x_default_font_parameter): Likewise.
13775         * xsettings.c (read_and_apply_settings): Likewise.
13777         * alloc.c (overrun_check_malloc, overrun_check_realloc)
13778         (overrun_check_free): Protoize.
13780 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
13782         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
13783         since callers should never pass a negative size.
13784         Change the signature to match that of plain 'read' and 'write'; see
13785         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
13786         * lisp.h: Update prototypes of emacs_write and emacs_read.
13788 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
13790         * xdisp.c (redisplay_window): Don't try to determine the character
13791         position of the scroll margin if the window start point w->startp
13792         is outside the buffer's accessible region.  (Bug#8468)
13794 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
13796         Fix write-region and its subroutines for buffers > 2GB.
13797         * fileio.c (a_write, e_write): Modify declaration of arguments and
13798         local variables to support buffers larger than 2GB.
13799         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
13801         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
13802         argument, local variables, and return value.
13804         * lisp.h: Update prototypes of emacs_write and emacs_read.
13806         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
13808 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
13810         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
13812         Fix more problems found by GCC 4.6.0's static checks.
13814         * xdisp.c (vmessage): Use a better test for character truncation.
13816         * charset.c (load_charset_map): <, not <=, for optimization,
13817         and to avoid potential problems with integer overflow.
13818         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
13819         * casetab.c (set_identity, shuffle): Likewise.
13820         * editfns.c (Fformat): Likewise.
13821         * syntax.c (skip_chars): Likewise.
13823         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
13824         This also lets GCC 4.6.0 generate slightly better loop code.
13826         * callint.c (Fcall_interactively): <, not <=, for optimization.
13827         (Fcall_interactively): Count the number of arguments produced,
13828         not the number of arguments given.  This is simpler and lets GCC
13829         4.6.0 generate slightly better code.
13831         * ftfont.c: Distingish more carefully between FcChar8 and char.
13832         The previous code passed unsigned char * to a functions like
13833         strlen and xstrcasecmp that expect char *, which does not
13834         conform to the C standard.
13835         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
13836         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
13837         char * when the C standard requires it.
13839         * keyboard.c (read_char): Remove unused var.
13841         * eval.c: Port to Windows vsnprintf (Bug#8435).
13842         Include <limits.h>.
13843         (SIZE_MAX): Define if the headers do not.
13844         (verror): Do not give up if vsnprintf returns a negative count.
13845         Instead, grow the buffer.  This ports to Windows vsnprintf, which
13846         does not conform to C99.  Problem reported by Eli Zaretskii.
13847         Also, simplify the allocation scheme, by avoiding the need for
13848         calling realloc, and removing the ALLOCATED variable.
13850         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
13852         Remove invocations of doprnt, as Emacs now uses vsnprintf.
13853         But keep the doprint source code for now, as we might revamp it
13854         and use it again (Bug#8435).
13855         * lisp.h (doprnt): Remove.
13856         * Makefile.in (base_obj): Remove doprnt.o.
13857         * deps.mk (doprnt.o): Remove.
13859         error: Print 32- and 64-bit integers portably (Bug#8435).
13860         Without this change, on typical 64-bit hosts error ("...%d...", N)
13861         was used to print both 32- and 64-bit integers N, which relied on
13862         undefined behavior.
13863         * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
13864         * lisp.h (error, verror): Mark as printf-like functions.
13865         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
13866         Report overflow in size calculations when allocating printf buffer.
13867         Do not truncate output string at its first null byte.
13868         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
13869         Truncate the output at a character boundary, since vsnprintf does not
13870         do that.
13871         * charset.c (check_iso_charset_parameter): Convert internal
13872         character to string before calling 'error', since %c now has the
13873         printf meaning.
13874         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
13875         overflow when computing char to be passed to 'error'.  Do not
13876         pass Lisp_Object to 'error'; pass the integer instead.
13877         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
13878         formatted with plain %d.
13880         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
13882         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
13884         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
13886         * xterm.c (x_catch_errors): Remove duplicate declaration.
13888         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
13890         * xdisp.c, lisp.h (message_nolog): Remove; unused.
13892 2011-04-10  Jim Meyering  <meyering@redhat.com>
13894         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
13895         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
13896         return ssize_t not "int", and use size_t as the buffer length.
13897         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
13898         * gnutls.h: Update declarations.
13899         * process.c (read_process_output): Use ssize_t, to match.
13900         (send_process): Likewise.
13902 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
13904         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
13906 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
13908         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
13909         Use unsigned char, to match FcChar8 type definition.
13911         * xterm.c (handle_one_xevent):
13912         * xmenu.c (create_and_show_popup_menu):
13913         * xselect.c (x_decline_selection_request)
13914         (x_reply_selection_request): Avoid type-punned deref of X events.
13916 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
13918         Fix some uses of `int' instead of EMACS_INT.
13919         * search.c (string_match_1, fast_string_match)
13920         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
13921         (scan_buffer, find_next_newline_no_quit)
13922         (find_before_next_newline, search_command, Freplace_match)
13923         (Fmatch_data): Make some `int' variables be EMACS_INT.
13925         * xdisp.c (display_count_lines): 3rd argument and return value now
13926         EMACS_INT.  All callers changed.
13927         (pint2hrstr): Last argument is now EMACS_INT.
13929         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
13930         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13931         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
13932         (decode_coding_utf_16, decode_coding_emacs_mule)
13933         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
13934         (decode_coding_ccl, decode_coding_charset)
13935         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
13936         (decode_coding_iso_2022, decode_coding_emacs_mule)
13937         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
13938         <char_offset, last_offset>: Declare EMACS_INT.
13939         (encode_coding_utf_8, encode_coding_utf_16)
13940         (encode_coding_emacs_mule, encode_invocation_designation)
13941         (encode_designation_at_bol, encode_coding_iso_2022)
13942         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
13943         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
13944         Declare EMACS_INT.
13945         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
13946         (encode_invocation_designation): Last argument P_NCHARS is now
13947         EMACS_INT.
13948         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
13949         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
13951         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
13952         All users changed.
13954         * ccl.c (Fccl_execute_on_string): Declare some variables
13955         EMACS_INT.
13957 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
13959         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
13961 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
13963         * process.c (Fformat_network_address): Doc fix.
13965 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
13967         * xml.c (parse_region): Avoid creating spurious whitespace nodes.
13969 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
13971         * keyboard.c (read_char): Call Lisp function help-form-show,
13972         instead of using internal_with_output_to_temp_buffer.
13973         (Qhelp_form_show): New var.
13974         (syms_of_keyboard): Use DEFSYM macro.
13976         * print.c (internal_with_output_to_temp_buffer): Function deleted.
13978         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
13980 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
13982         * process.c (Flist_processes): Remove to Lisp.
13983         (list_processes_1): Delete.
13985 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
13987         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
13989         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
13991 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
13993         Fix more problems found by GCC 4.6.0's static checks.
13995         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
13997         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
13999         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
14001         * xdisp.c (vmessage): Mark as a printf-like function.
14003         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14005         * sound.c (sound_warning): Don't crash if arg contains a printf format.
14007         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14008         printf-like functions.
14009         (tiff_load): Add casts to remove these marks before passing them
14010         to system-supplied API.
14012         * eval.c (Fsignal): Remove excess argument to 'fatal'.
14014         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14015         This avoids several warnings with gcc -Wstrict-overflow.
14016         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14017         directly, rather than having caller test rule sign.  This avoids
14018         some unnecessary tests.
14019         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14020         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
14021         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
14023         * xfont.c (xfont_text_extents): Remove var that was set but not used.
14024         (xfont_open): Avoid unnecessary tests.
14026         * composite.c (composition_gstring_put_cache): Use unsigned integer.
14028         * composite.h, composite.c (composition_gstring_put_cache):
14029         Use EMACS_INT, not int, for length.
14031         * composite.h (COMPOSITION_DECODE_REFS): New macro,
14032         breaking out part of COMPOSITION_DECODE_RULE.
14033         (COMPOSITION_DECODE_RULE): Use it.
14034         * composite.c (get_composition_id): Remove unused local vars,
14035         by using the new macro.
14037         * textprop.c (set_text_properties_1): Change while to do-while,
14038         since the condition is always true at first.
14040         * intervals.c (graft_intervals_into_buffer): Mark var as used.
14041         (interval_deletion_adjustment): Return unsigned value.
14042         All uses changed.
14044         * process.c (list_processes_1, create_pty, read_process_output):
14045         (exec_sentinel): Remove vars that were set but not used.
14046         (create_pty): Remove unnecessary "volatile"s.
14047         (Fnetwork_interface_info): Avoid possibility of int overflow.
14048         (read_process_output): Do adaptive read buffering even if carryover.
14049         (read_process_output): Simplify nbytes computation if buffered.
14051         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14053         * syntax.c (scan_words): Remove var that was set but not used.
14054         (update_syntax_table): Use unsigned instead of int.
14056         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
14057         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
14058         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
14060         * print.c (print_error_message): Avoid int overflow.
14062         * font.c (font_list_entities): Redo for clarity,
14063         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14065         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
14066         (font_score): Avoid potential overflow in diff calculation.
14068         * fns.c (substring_both): Remove var that is set but not used.
14069         (sxhash): Redo loop for clarity and to avoid wraparound warning.
14071         * eval.c (funcall_lambda): Rename local to avoid shadowing.
14073         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14074         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14075         can always succeed if overflow has undefined behavior.
14077         * search.c (boyer_moore, wordify): Remove vars set but not used.
14078         (wordify): Omit three unnecessary tests.
14080         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14081         All callers changed.  This avoids the need for an unused var.
14083         * casefiddle.c (casify_region): Remove var that is set but not used.
14085         * dired.c (file_name_completion): Remove var that is set but not used.
14087         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14089         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
14090         (Finsert_file_contents): Remove unnecessary code checking fd.
14092         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14093         Check for integer overflow on size calculations.
14095         * buffer.c (Fprevious_overlay_change): Remove var that is set
14096         but not used.
14098         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14099         Remove vars that are set but not used.
14100         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
14101         (timer_check_2): Mark vars as initialized.
14103         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14105         * image.c (lookup_image): Remove var that is set but not used.
14106         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
14108         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14109         that are set but not used.
14111         * xfns.c (make_invisible_cursor): Don't return garbage
14112         if XCreateBitmapFromData fails (Bug#8410).
14114         * xselect.c (x_get_local_selection, x_handle_property_notify):
14115         Remove vars that are set but not used.
14117         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
14118         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
14120         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14121         Remove var that is set but not used.
14122         (scroll_bar_windows_size): Now size_t, not int.
14123         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14124         Check for overflow.
14126         * xfaces.c (realize_named_face): Remove vars that are set but not used.
14127         (map_tty_color) [!defined MSDOS]: Likewise.
14129         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14131         * coding.c: Remove vars that are set but not used.
14132         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14133         All callers changed.
14134         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14135         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14136         (decode_coding_charset): Remove vars that are set but not used.
14138         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14139         that is set but not used.
14141         * print.c (print_object): Remove var that is set but not used.
14143         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
14144         The gnulib version avoids calling malloc in the usual case,
14145         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14146         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14147         * filelock.c (current_lock_owner): Likewise.
14148         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14149         * sysdep.c: Include allocator.h, careadlinkat.h.
14150         (emacs_no_realloc_allocator): New static constant.
14151         (emacs_readlink): New function.
14152         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14153         ../lib/careadlinkat.h.
14155 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
14157         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14158         first non-nil return value).
14160 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
14162         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14163         if not defined (Bug#8403).
14165 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
14167         * xdisp.c (display_count_lines): Remove parameter `start',
14168         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
14169         (get_char_face_and_encoding): Remove parameter `multibyte_p',
14170         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
14171         (fill_stretch_glyph_string): Remove parameters `row' and `area',
14172         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
14173         and thereabouts.  All callers changed.
14174         (get_per_char_metric): Remove parameter `f', unused since
14175         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
14177 2011-04-02  Jim Meyering  <meyering@redhat.com>
14179         do not dereference NULL upon failed strdup
14180         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
14181         (ns_get_family): Likewise.
14183 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
14185         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
14187 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
14189         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
14190         later (Bug#8403).
14192 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
14194         Add lexical binding.
14196         * window.c (Ftemp_output_buffer_show): New fun.
14197         (Fsave_window_excursion):
14198         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
14200         * lread.c (lisp_file_lexically_bound_p): New function.
14201         (Fload): Bind Qlexical_binding.
14202         (readevalloop): Remove `evalfun' arg.
14203         Bind Qinternal_interpreter_environment.
14204         (Feval_buffer): Bind Qlexical_binding.
14205         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
14206         Mark as dynamic.
14207         (syms_of_lread): Declare `lexical-binding'.
14209         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
14211         * keyboard.c (eval_dyn): New fun.
14212         (menu_item_eval_property): Use it.
14214         * image.c (parse_image_spec): Use Ffunctionp.
14216         * fns.c (concat, mapcar1): Accept byte-code-functions.
14218         * eval.c (Fsetq): Handle lexical vars.
14219         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
14220         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
14221         (FletX, Flet): Obey lexical binding.
14222         (Fcommandp): Handle closures.
14223         (Feval): New `lexical' arg.
14224         (eval_sub): New function extracted from Feval.  Use it almost
14225         everywhere where Feval was used.  Look up vars in lexical env.
14226         Handle closures.
14227         (Ffunctionp): Move from subr.el.
14228         (Ffuncall): Handle closures.
14229         (apply_lambda): Remove `eval_flags'.
14230         (funcall_lambda): Handle closures and new byte-code-functions.
14231         (Fspecial_variable_p): New function.
14232         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
14233         but without exporting it to Lisp.
14235         * doc.c (Fdocumentation, store_function_docstring):
14236         * data.c (Finteractive_form): Handle closures.
14238         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
14239         interactive spec.
14241         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
14242         New byte-codes.
14243         (exec_byte_code): New function extracted from Fbyte_code to handle new
14244         calling convention for byte-code-functions.  Add new byte-codes.
14246         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
14248         * alloc.c (Fmake_symbol): Init new `declared_special' field.
14250 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
14252         * xdisp.c (redisplay_internal): Fix prototype.
14254 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
14256         * xdisp.c (SCROLL_LIMIT): New macro.
14257         (try_scrolling): Use it when setting scroll_limit.
14258         Limit scrolling to 100 screen lines.
14259         (redisplay_window): Even when falling back on "recentering",
14260         position point in the window according to scroll-conservatively,
14261         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
14263         (try_scrolling): When point is above the window, allow searching
14264         as far as scroll_max, or one screenful, to compute vertical
14265         distance from PT to the scroll margin position.  This prevents
14266         try_scrolling from unnecessarily failing when
14267         scroll-conservatively is set to a value slightly larger than the
14268         window height.  Clean up the case of PT below the margin at bottom
14269         of window: scroll_max can no longer be INT_MAX.  When aggressive
14270         scrolling is in use, don't let point enter the opposite scroll
14271         margin as result of the scroll.
14272         (syms_of_xdisp) <scroll-conservatively>: Document the
14273         threshold of 100 lines for never-recentering scrolling.
14275 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
14277         * dispextern.h (move_it_by_lines):
14278         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
14279         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
14280         (message_log_check_duplicate): Remove parameters `prev_bol' and
14281         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
14282         (redisplay_internal): Remove parameter `preserve_echo_area',
14283         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
14285         * indent.c (Fvertical_motion):
14286         * window.c (window_scroll_pixel_based, Frecenter):
14287         Don't pass `need_y_p' to `move_it_by_lines'.
14289 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
14291         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
14292         steal a few bits to be more compact.
14293         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
14294         Remove unneeded casts.
14296         * bytecode.c (Fbyte_code): CAR and CDR can GC.
14298 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
14300         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
14301         binding" message (bug#7967).
14303 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
14305         Fix more problems found by GCC 4.6.0's static checks.
14307         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
14308         Remove unused local var.
14310         * editfns.c (Fmessage_box): Remove unused local var.
14312         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
14313         (note_mode_line_or_margin_highlight, note_mouse_highlight):
14314         Omit unused local vars.
14315         * window.c (shrink_windows): Omit unused local var.
14316         * menu.c (digest_single_submenu): Omit unused local var.
14317         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
14318         Omit unused local var.
14320         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
14321         Don't assume string length fits in int.
14322         (keyremap_step, read_key_sequence): Use size_t for sizes.
14323         (read_key_sequence): Don't check last_real_key_start redundantly.
14325         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
14326         instead of alloca (Bug#8344).
14328         * eval.c (Fbacktrace): Don't assume nargs fits in int.
14329         (Fbacktrace_frame): Don't assume nframes fits in int.
14331         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
14333         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
14334         concerns.
14336         * term.c (produce_glyphless_glyph): Remove unnecessary test.
14338         * cm.c (calccost): Turn while-do into do-while, for clarity.
14340         * keyboard.c (syms_of_keyboard): Use the same style as later
14341         in this function when indexing through an array.  This also
14342         works around GCC bug 48267.
14344         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
14346         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
14348         * chartab.c (sub_char_table_ref_and_range): Redo for slight
14349         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
14351         * keyboard.c, keyboard.h (num_input_events): Now size_t.
14352         This avoids undefined behavior on integer overflow, and is a bit
14353         more convenient anyway since it is compared to a size_t variable.
14355         Variadic C functions now count arguments with size_t, not int.
14356         This avoids an unnecessary limitation on 64-bit machines, which
14357         caused (substring ...) to crash on large vectors (Bug#8344).
14358         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
14359         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
14360         All variadic functions and their callers changed accordingly.
14361         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
14362         * data.c (arith_driver, float_arith_driver): Likewise.
14363         * editfns.c (general_insert_function): Likewise.
14364         * eval.c (struct backtrace.nargs, interactive_p)
14365         (internal_condition_case_n, run_hook_with_args, apply_lambda)
14366         (funcall_lambda, mark_backtrace): Likewise.
14367         * fns.c (concat): Likewise.
14368         * frame.c (x_set_frame_parameters): Likewise.
14369         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
14370         0 if not found, not -1.  All callers changed.
14372         * alloc.c (garbage_collect): Don't assume stack size fits in int.
14373         (stack_copy_size): Now size_t, not int.
14374         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
14376 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
14378         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
14379         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14380         All callers changed.
14382         * lisp.h (multibyte_char_to_unibyte):
14383         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
14384         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14385         * character.h (CHAR_TO_BYTE8):
14386         * cmds.c (internal_self_insert):
14387         * editfns.c (general_insert_function):
14388         * keymap.c (push_key_description):
14389         * search.c (Freplace_match):
14390         * xdisp.c (message_dolog, set_message_1): All callers changed.
14392 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
14394         * keyboard.c (safe_run_hook_funcall): New function.
14395         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
14396         don't set the hook to nil, but remove the offending function instead.
14397         (Qcommand_hook_internal): Remove, unused.
14398         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
14399         Vcommand_hook_internal.
14401         * eval.c (enum run_hooks_condition): Remove.
14402         (funcall_nil, funcall_not): New functions.
14403         (run_hook_with_args): Call each function through a `funcall' argument.
14404         Remove `cond' argument, now redundant.
14405         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
14406         (Frun_hook_with_args_until_failure): Adjust accordingly.
14407         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
14409 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
14411         * dispextern.h (string_buffer_position): Remove declaration.
14413         * print.c (strout): Remove parameter `multibyte', unused since
14414         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
14416         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
14417         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
14418         All callers changed.
14420         * w32.c (_wsa_errlist): Use braces for struct initializers.
14422         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
14423         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
14424         All callers changed.
14425         (string_buffer_position): Likewise.  Also, make static (it's never
14426         used outside xdisp.c).
14427         (cursor_row_p): Remove parameter `w', unused since
14428         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
14429         (decode_mode_spec): Remove parameter `precision', introduced during
14430         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
14431         All callers changed.
14433 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
14435         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
14437 2011-03-27  Anders Lindgren  <andlind@gmail.com>
14439         * nsterm.m (ns_menu_bar_is_hidden): New variable.
14440         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
14441         (ns_update_auto_hide_menu_bar): New functions.
14442         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
14443         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
14444         ns_constrain_all_frames.
14445         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
14446         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
14448 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
14450         * nsmenu.m (runDialogAt): Remove argument to timer_check.
14452 2011-03-27  Glenn Morris  <rgm@gnu.org>
14454         * syssignal.h: Replace RETSIGTYPE with void.
14455         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
14456         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
14457         Replace SIGTYPE with void everywhere.
14458         * s/usg5-4-common.h (SIGTYPE): Remove definition.
14459         * s/template.h (SIGTYPE): Remove commented out definition.
14461 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
14463         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
14464         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
14466 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
14468         * w32.c (read_unc_volume): Use parameter `henum', instead of
14469         global variable `wget_enum_handle'.
14471         * keymap.c (describe_vector): Remove parameters `indices' and
14472         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
14473         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
14475         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
14477         * keyboard.c (timer_check): Remove parameter `do_it_now',
14478         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
14479         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
14480         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
14482         * keyboard.c (read_char):
14483         * w32menu.c (w32_menu_display_help):
14484         * xmenu.c (show_help_event, menu_help_callback):
14485         Adjust calls to `show_help_echo'.
14487         * gtkutil.c (xg_maybe_add_timer):
14488         * keyboard.c (readable_events):
14489         * process.c (wait_reading_process_output):
14490         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
14492         * insdel.c (adjust_markers_gap_motion):
14493         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
14494         (gap_left, gap_right): Don't call it.
14496 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
14498         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
14499         incurred during fontification.
14501 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
14503         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
14504         (DEFVAR_PER_BUFFER): Don't pass it.
14506         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
14507         (scrolling_window): Don't pass it.
14509 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
14511         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
14513         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
14514         and `suffix'.
14515         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
14516         of variables specific to SELinux and computation of `encoded_absname'.
14518         * image.c (XPutPixel): Remove unused variable `height'.
14520         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
14522         * unexw32.c (get_section_info): Remove unused variable `section'.
14524         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
14525         (system_process_attributes): Remove unused variable `sess'.
14526         (sys_read): Remove unused variable `err'.
14528         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
14529         (w32_wnd_proc): Remove unused variable `isdead'.
14530         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
14531         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
14532         (x_create_tip_frame): Remove unused variable `tem'.
14534         * w32inevt.c (w32_console_read_socket):
14535         Remove unused variable `no_events'.
14537         * w32term.c (x_draw_composite_glyph_string_foreground):
14538         Remove unused variable `width'.
14540 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
14542         * w32term.c (x_set_glyph_string_clipping):
14543         Don't pass uninitialized region to CombineRgn.
14545 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
14547         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
14548         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
14549         (Fx_close_connection): Remove unused variable `i'.
14551         * w32font.c (w32font_draw): Return number of glyphs.
14552         (w32font_open_internal): Remove unused variable `i'.
14553         (w32font_driver): Add missing initializer.
14555         * w32menu.c (utf8to16): Remove unused variable `utf16'.
14556         (fill_in_menu): Remove unused variable `items_added'.
14558         * w32term.c (last_mouse_press_frame): Remove static global variable.
14559         (w32_clip_to_row): Remove unused variable `f'.
14560         (x_delete_terminal): Remove unused variable `i'.
14562         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
14563         (NOTHING): Remove unused static global variable.
14564         (uniscribe_check_otf): Remove unused variable `table'.
14565         (uniscribe_font_driver): Add missing initializers.
14567 2011-03-23  Julien Danjou  <julien@danjou.info>
14569         * term.c (Fsuspend_tty, Fresume_tty):
14570         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
14571         * window.c (temp_output_buffer_show):
14572         * insdel.c (signal_before_change):
14573         * frame.c (Fhandle_switch_frame):
14574         * fileio.c (Fdo_auto_save):
14575         * emacs.c (Fkill_emacs):
14576         * editfns.c (save_excursion_restore):
14577         * cmds.c (internal_self_insert):
14578         * callint.c (Fcall_interactively):
14579         * buffer.c (Fkill_all_local_variables):
14580         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
14581         Use Frun_hooks.
14582         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
14583         unconditionally since it does the check itself.
14585 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
14587         Fix more problems found by GCC 4.5.2's static checks.
14589         * coding.c (encode_coding_raw_text): Avoid unnecessary test
14590         the first time through the loop, since we know p0 < p1 then.
14591         This also avoids a gcc -Wstrict-overflow warning.
14593         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
14594         leading to a memory leak, possible in functions like
14595         load_charset_map_from_file that can allocate an unbounded number
14596         of objects (Bug#8318).
14598         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
14599         that could (at least in theory) be that large.
14601         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
14602         This is less likely to overflow, and avoids undefined behavior if
14603         overflow does occur.  All callers changed.  Use strtoul to scan
14604         for the unsigned long integer.
14605         (pint2hrstr): Simplify and tune code slightly.
14606         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
14608         * scroll.c (do_scrolling): Work around GCC bug 48228.
14609         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
14611         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
14612         This also avoids a warning with gcc -Wstrict-overflow.
14613         (validate_x_resource_name): Simplify count usage.
14614         This also avoids a warning with gcc -Wstrict-overflow.
14616         * fileio.c (Fcopy_file): Report error if fchown or fchmod
14617         fail (Bug#8306).
14619         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
14621         * process.c (Fmake_network_process): Use socklen_t, not int,
14622         where POSIX says socklen_t is required in portable programs.
14623         This fixes a porting bug on hosts like 64-bit HP-UX, where
14624         socklen_t is wider than int (Bug#8277).
14625         (Fmake_network_process, server_accept_connection):
14626         (wait_reading_process_output, read_process_output):
14627         Likewise.
14629         * process.c: Rename or move locals to avoid shadowing.
14630         (list_processes_1, Fmake_network_process):
14631         (read_process_output_error_handler, exec_sentinel_error_handler):
14632         Rename or move locals.
14633         (Fmake_network_process): Define label "retry_connect" only if needed.
14634         (Fnetwork_interface_info): Fix pointer signedness.
14635         (process_send_signal): Add cast to avoid pointer signedness problem.
14636         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
14637         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
14639         Make tparam.h and terminfo.c consistent.
14640         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
14641         Include tparam.h instead, since it declares them.
14642         * cm.h (PC): Remove extern decl; tparam.h now does this.
14643         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
14644         * terminfo.c: Include tparam.h, to check interfaces.
14645         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
14646         (tparam): Adjust signature to match interface in tparam.h;
14647         this removes some undefined behavior.  Check that outstring and len
14648         are zero, which they always are with Emacs.
14649         * tparam.h (PC, BC, UP): New extern decls.
14651         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
14652         (xftfont_open): Rename locals to avoid shadowing.
14654         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
14655         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
14656         (OTF_TAG_SYM): Omit macro if not needed.
14657         (ftfont_list): Remove unused local.
14658         (get_adstyle_property, ftfont_pattern_entity):
14659         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
14660         Rename locals to avoid shadowing.
14662         * xfont.c (xfont_list_family): Mark var as initialized.
14664         * xml.c (make_dom): Now static.
14666         * composite.c (composition_compute_stop_pos): Rename local to
14667         avoid shadowing.
14668         (composition_reseat_it): Remove unused locals.
14669         (find_automatic_composition, composition_adjust_point): Likewise.
14670         (composition_update_it): Mark var as initialized.
14671         (find_automatic_composition): Mark vars as initialized,
14672         with a FIXME (Bug#8290).
14674         character.h: Rename locals to avoid shadowing.
14675         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
14676         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
14677         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
14678         (BUF_DEC_POS): Be more systematic about renaming local temporaries
14679         to avoid shadowing.
14681         * textprop.c (property_change_between_p): Remove; unused.
14683         * intervals.c (interval_start_pos): Now static.
14685         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
14687         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
14688         Rename locals to avoid shadowing.
14690         * sound.c (wav_play, au_play, Fplay_sound_internal):
14691         Fix pointer signedness.
14692         (alsa_choose_format): Remove unused local var.
14693         (wav_play): Initialize a variable to 0, to prevent undefined
14694         behavior (Bug#8278).
14696         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
14698         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
14700         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
14701         clobbering (Bug#8298).
14702         * sysdep.c (sys_subshell): Likewise.
14703         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
14705         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
14706         This should get cleaned up, so that child_setup has the
14707         same signature on all platforms.
14709         * callproc.c (call_process_cleanup): Now static.
14710         (relocate_fd): Rename locals to avoid shadowing.
14712 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
14714         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
14715         not to be necessary, and produces flickering.
14717 2011-03-20  Glenn Morris  <rgm@gnu.org>
14719         * config.in: Remove file.
14721 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
14723         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
14724         are now in src/globals.h.
14725         (syms_of_minibuf): Remove spurious & from previous change.
14727 2011-03-20  Leo Liu  <sdl.web@gmail.com>
14729         * minibuf.c (completing-read-function): New variable.
14730         (completing-read-default): Rename from completing-read.
14731         (completing-read): Call completing-read-function.
14733 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
14735         * xfaces.c (Fx_load_color_file):
14736         Read color file from absolute filename (bug#8250).
14738 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
14740         * makefile.w32-in: Update dependencies.
14742 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
14744         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
14746 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
14748         Fix more problems found by GCC 4.5.2's static checks.
14750         * process.c (make_serial_process_unwind, send_process_trap):
14751         (sigchld_handler): Now static.
14753         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
14754         That way, the code declares only the vars that it needs.
14755         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
14756         * s/cygwin.h (PTY_ITERATION): Likewise.
14757         * s/darwin.h (PTY_ITERATION): Likewise.
14758         * s/gnu-linux.h (PTY_ITERATION): Likewise.
14760         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
14761         * process.c (allocate_pty): Don't declare stb unless it's needed.
14763         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
14764         (CONSTANTLIM): Remove; unused.
14765         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
14766         Define only if needed.
14768         * unexelf.c (unexec): Name an expression,
14769         to avoid gcc -Wbad-function-cast warning.
14770         Use a different way to cause a compilation error if anyone uses
14771         n rather than nn, a way that does not involve shadowing.
14772         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
14774         * deps.mk (unexalpha.o): Remove; unused.
14776         New file unexec.h, the (simple) interface for unexec (Bug#8267).
14777         * unexec.h: New file.
14778         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
14779         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
14780         Depend on unexec.h.
14781         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
14782         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
14783         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
14784         Change as necessary to match prototype in unexec.h.
14786         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
14787         shadowing.
14788         (back_comment, skip_chars): Mark vars as initialized.
14790         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
14791         Rename locals to avoid shadowing.
14793         * lread.c (read1): Rewrite so as not to use empty "else".
14794         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
14796         * print.c (Fredirect_debugging_output): Fix pointer signedess.
14798         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
14799         warning when compiling print.c.
14801         * font.c (font_unparse_fcname): Abort in an "impossible" situation
14802         instead of using an uninitialized var.
14803         (font_sort_entities): Mark var as initialized.
14805         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
14807         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
14808         pointers to constants.
14809         (font_parse_fcname): Remove unused vars.
14810         (font_delete_unmatched): Now static.
14811         (font_get_spec): Remove; unused.
14812         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
14813         (font_update_drivers, Ffont_get_glyphs, font_add_log):
14814         Rename or move locals to avoid shadowing.
14816         * fns.c (require_nesting_list, require_unwind): Now static.
14817         (Ffillarray): Rename locals to avoid shadowing.
14819         * floatfns.c (domain_error2): Define only if needed.
14820         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
14822         * alloc.c (mark_backtrace): Move decl from here ...
14823         * lisp.h: ... to here, so that it can be checked.
14825         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
14826         (Fdefvar): Rewrite so as not to use empty "else".
14827         (lisp_indirect_variable): Name an expression,
14828         to avoid gcc -Wbad-function-cast warning.
14829         (Fdefvar): Rename locals to avoid shadowing.
14831         * callint.c (quotify_arg, quotify_args): Now static.
14832         (Fcall_interactively): Rename locals to avoid shadowing.
14833         Use const pointer when appropriate.
14835         * lisp.h (get_system_name, get_operating_system_release):
14836         Move decls here, to check interfaces.
14837         * process.c (get_operating_system_release): Move decl to lisp.h.
14838         * xrdb.c (get_system_name): Likewise.
14839         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
14840         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
14841         some of which prompt warnings from gcc -Wbad-function-cast.
14842         (Fformat_time_string, Fencode_time, Finsert_char):
14843         (Ftranslate_region_internal, Fformat):
14844         Rename or remove local vars to avoid shadowing.
14845         (Ftranslate_region_internal): Mark var as initialized.
14847         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
14848         avoid shadowing.
14850         * lisp.h (eassert): Check that the argument compiles, even if
14851         ENABLE_CHECKING is not defined.
14853         * data.c (Findirect_variable): Name an expression, to avoid
14854         gcc -Wbad-function-cast warning.
14855         (default_value, arithcompare, arith_driver, arith_error): Now static.
14856         (store_symval_forwarding): Rename local to avoid shadowing.
14857         (Fmake_variable_buffer_local, Fmake_local_variable):
14858         Mark variables as initialized.
14859         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
14861         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
14862         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
14863         Rename locals to avoid shadowing.
14864         (mark_stack): Move local variables into the #ifdef region where
14865         they're used.
14866         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
14867         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
14868         needed otherwise.
14869         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
14870         (GC_STRING_CHARS): Remove; not used.
14871         (Fmemory_limit): Cast sbrk's returned value to char *.
14873         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
14874         avoids undefined behavior in theory.
14876         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
14878         Use functions, not macros, for up- and down-casing (Bug#8254).
14879         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14880         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
14881         to use the following functions instead of these macros.
14882         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
14883         EMACS_INT, since callers assume the returned value fits in int.
14884         (upcase1): Likewise, for UPCASE_TABLE.
14885         (uppercasep, lowercasep, upcase): New static inline functions.
14886         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
14887         the race-condition problem in the old DOWNCASE.
14889         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
14890         Rename locals to avoid shadowing.
14891         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
14892         (regex_compile, re_search_2, re_match_2_internal):
14893         Remove unused local vars.
14894         (FREE_VAR): Rewrite so as not to use empty "else",
14895         which gcc can warn about.
14896         (regex_compile, re_match_2_internal): Mark locals as initialized.
14897         (RETALLOC_IF): Define only if needed.
14898         (WORDCHAR_P): Likewise.  This one is never needed, but is used
14899         only in a comment talking about a compiler bug, so put inside
14900         the #if 0 of that comment.
14901         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
14902         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
14903         Remove; unused.
14905         * search.c (boyer_moore): Rename locals to avoid shadowing.
14906         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
14907         (PREV_CHAR_BOUNDARY): Likewise.
14909         * search.c (simple_search): Remove unused var.
14911         * dired.c (compile_pattern): Move decl from here ...
14912         * lisp.h: ... to here, so that it can be checked.
14913         (struct re_registers): New forward decl.
14915         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
14917         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
14918         All uses changed.
14919         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
14920         Rename locals to avoid shadowing.
14921         (Fvertical_motion): Mark locals as initialized.
14923         * casefiddle.c (casify_object, casify_region): Now static.
14924         (casify_region): Mark local as initialized.
14926         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
14928         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
14929         New macros, so that the caller can use some names other than
14930         gcpro1, gcpro2, etc.
14931         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
14932         of the new macros.
14933         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
14934         argument, for consistency with GCPRO2_VAR, etc: it is now the
14935         prefix of the variable, not the variable itself.  All uses
14936         changed.
14937         * dired.c (directory_files_internal, file_name_completion):
14938         Rename locals to avoid shadowing.
14940         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
14941         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
14942         dired.c's scmp function, had undefined behavior.
14943         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
14944         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
14945         * buffer.h: ... to here, because these macros use current_buffer,
14946         and the new implementation with inline functions needs to have
14947         current_buffer in scope now, rather than later when the macros
14948         are used.
14949         (downcase, upcase1): New static inline functions.
14950         (DOWNCASE, UPCASE1): Reimplement using these functions.
14951         This avoids undefined behavior in expressions like
14952         DOWNCASE (x) == DOWNCASE (y), which previously suffered
14953         from race conditions in accessing the global variables
14954         case_temp1 and case_temp2.
14955         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
14956         * lisp.h (case_temp1, case_temp2): Remove their decls.
14957         * character.h (ASCII_CHAR_P): Move from here ...
14958         * lisp.h: ... to here, so that the inline functions mentioned
14959         above can use them.
14961         * dired.c (directory_files_internal_unwind): Now static.
14963         * fileio.c (file_name_as_directory, directory_file_name):
14964         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
14965         Now static.
14966         (file_name_as_directory): Use const pointers when appropriate.
14967         (Fexpand_file_name): Likewise.  In particular, newdir might
14968         point at constant storage, so make it a const pointer.
14969         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
14970         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
14971         signedness issues.
14972         (Fset_file_times, Finsert_file_contents, auto_save_error):
14973         Rename locals to avoid shadowing.
14975         * minibuf.c (choose_minibuf_frame_1): Now static.
14976         (Ftry_completion, Fall_completions): Rename or remove locals
14977         to avoid shadowing.
14979         * marker.c (bytepos_to_charpos): Remove; unused.
14981         * lisp.h (verify_bytepos, count_markers): New decls,
14982         so that gcc does not warn that these functions aren't declared.
14984         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
14985         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
14986         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
14987         (copy_text): Remove unused local var.
14989         * filelock.c (within_one_second): Now static.
14990         (lock_file_1): Rename local to avoid shadowing.
14992         * buffer.c (fix_overlays_before): Mark locals as initialized.
14993         (fix_start_end_in_overlays): Likewise.  This function should be
14994         simplified by using pointers-to-pointers, but that's a different
14995         matter.
14996         (switch_to_buffer_1): Now static.
14997         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
14998         (report_overlay_modification): Rename locals to avoid shadowing.
15000         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
15001         Fix pointer signedness issue.
15002         (sys_subshell): Mark local as volatile if checking for lint,
15003         to suppress a gcc -Wclobbered warning that does not seem to be right.
15004         (MAXPATHLEN): Define only if needed.
15006         * process.c (serial_open, serial_configure): Move decls from here ...
15007         * systty.h: ... to here, so that they can be checked.
15009         * fns.c (get_random, seed_random): Move extern decls from here ...
15010         * lisp.h: ... to here, so that they can be checked.
15012         * sysdep.c (reset_io): Now static.
15013         (wait_for_termination_signal): Remove; unused.
15015         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15016         (copy_keymap_item, append_key, push_text_char_description):
15017         Now static.
15018         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
15019         (DENSE_TABLE_SIZE): Remove; unused.
15020         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15021         (describe_map_tree):
15022         Rename locals to avoid shadowing.
15024         * keyboard.c: Declare functions static if they are not used elsewhere.
15025         (echo_char, echo_dash, cmd_error, top_level_2):
15026         (poll_for_input, handle_async_input): Now static.
15027         (read_char, kbd_buffer_get_event, make_lispy_position):
15028         (make_lispy_event, make_lispy_movement, apply_modifiers):
15029         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15030         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15031         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
15032         (read_key_sequence, read_char): Mark locals as initialized.
15033         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
15035         * keyboard.h (make_ctrl_char): New decl.
15036         (mark_kboards): Move decl here ...
15037         * alloc.c (mark_kboards): ... from here.
15039         * lisp.h (force_auto_save_soon): New decl.
15041         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
15042         (DEFINE_DUMMY_FUNCTION): New macro.
15043         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15044         Use it.
15045         (main): Add casts to avoid warnings
15046         if GCC considers string literals to be constants.
15048         * lisp.h (fatal_error_signal): Add decl, since it's exported.
15050         * dbusbind.c: Pointer signedness fixes.
15051         (xd_signature, xd_append_arg, xd_initialize):
15052         (Fdbus_call_method, Fdbus_call_method_asynchronously):
15053         (Fdbus_method_return_internal, Fdbus_method_error_internal):
15054         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15055         (Fdbus_register_signal): Use SSDATA when the context wants char *.
15057         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15058         if GCC considers string literals to be constants.
15059         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
15061 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
15063         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15064         (print_preprocess, print_object): New macro to fix last change.
15066         * print.c (print_preprocess): Don't forget font objects.
15068 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
15070         * emacs.c (USAGE3): Doc fixes.
15072 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
15074         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15075         structure.
15077 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
15079         * lisp.h (VWindow_system, Qfile_name_history):
15080         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15081         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15082         (w32_system_caret_x, w32_system_caret_y): Declare extern.
15084         * w32select.c: Don't #include "keyboard.h".
15085         (run_protected): Add extern declaration for waiting_for_input.
15087         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15088         * w32console.c (detect_input_pending, read_input_pending)
15089         (encode_terminal_code):
15090         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15091         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15092         (w32_system_caret_y, Qfile_name_history):
15093         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15094         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15095         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15096         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15097         * w32proc.c (Qlocal, report_file_error):
15098         * w32term.c (Vwindow_system, updating_frame):
15099         * w32uniscribe.c (initialized, uniscribe_font_driver):
15100         Remove unneeded extern declarations.
15102 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
15104         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
15106 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
15108         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15109         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15110         These macros can no longer be used for assignment.
15112         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15113         Assign struct members directly, instead of using BUF_BEGV etc.
15114         (record_buffer_markers, fetch_buffer_markers): New functions for
15115         recording and fetching special buffer markers.
15116         (set_buffer_internal_1, set_buffer_temp): Use them.
15118         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15120         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15122         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15123         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15125         * xdisp.c (hscroll_window_tree):
15126         (reconsider_clip_changes): Use PT instead of BUF_PT.
15128 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
15130         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15131         $(EMACS_ROOT)/lib/intprops.h.
15133 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
15135         Fix more problems found by GCC 4.5.2's static checks.
15137         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15138         to unsigned char * to avoid compiler diagnostic.
15139         (xg_free_frame_widgets): Make it clear that a local variable is
15140         needed only if USE_GTK_TOOLTIP.
15141         (gdk_window_get_screen): Make it clear that this macro is needed
15142         only if USE_GTK_TOOLTIP.
15143         (int_gtk_range_get_value): New function, which avoids a diagnostic
15144         from gcc -Wbad-function-cast.
15145         (xg_set_toolkit_scroll_bar_thumb): Use it.
15146         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15147         diagnostic from gcc -Wbad-function-cast.
15148         (get_utf8_string, xg_get_file_with_chooser):
15149         Rename locals to avoid shadowing.
15150         (create_dialog): Move locals to avoid shadowing.
15152         * xgselect.c (xg_select): Remove unused var.
15154         * image.c (four_corners_best): Mark locals as initialized.
15155         (gif_load): Initialize transparent_p to zero (Bug#8238).
15156         Mark another local as initialized.
15157         (my_png_error, my_error_exit): Mark with NO_RETURN.
15159         * image.c (clear_image_cache): Now static.
15160         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
15161         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
15162         (x_edge_detection): Remove unnecessary cast that
15163         gcc -Wbad-function-cast diagnoses.
15164         (gif_load): Fix pointer signedness.
15165         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15166         (jpeg_load, gif_load): Rename locals to avoid shadowing.
15168 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
15170         Improve quality of tests for time stamp overflow.
15171         For example, without this patch (encode-time 0 0 0 1 1
15172         1152921504606846976) returns the obviously-bogus value (-948597
15173         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
15174         reports time overflow.  See
15175         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
15176         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
15177         * editfns.c: Include limits.h and intprops.h.
15178         (TIME_T_MIN, TIME_T_MAX): New macros.
15179         (time_overflow): Move earlier, to before first use.
15180         (hi_time, lo_time): New functions, for an accurate test for
15181         out-of-range times.
15182         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
15183         (Fget_internal_run_time): Don't assume time_t fits in int.
15184         (make_time): Use list2 instead of Fcons twice.
15185         (Fdecode_time): More accurate test for out-of-range times.
15186         (check_tm_member): New function.
15187         (Fencode_time): Use it, to test for out-of-range times.
15188         (lisp_time_argument): Don't rely on undefined left-shift and
15189         right-shift behavior when checking for time stamp overflow.
15191         * editfns.c (time_overflow): New function, refactoring common code.
15192         (Fformat_time_string, Fdecode_time, Fencode_time):
15193         (Fcurrent_time_string): Use it.
15195         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
15196         * dired.c (make_time): Move to ...
15197         * editfns.c (make_time): ... here.
15198         * systime.h: Note the move.
15200 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
15202         * fringe.c (update_window_fringes): Remove unused variables.
15204         * unexmacosx.c (copy_data_segment): Also copy __got section.
15205         (Bug#8223)
15207 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
15209         * termcap.c [MSDOS]: Include "msdos.h".
15210         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
15211         Constify `char *' arguments and their references according to
15212         prototypes in tparam.h.
15214         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
15216         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
15217         Adapt all references accordingly.
15219         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
15221 2011-03-11  Tom Tromey  <tromey@redhat.com>
15223         * buffer.c (syms_of_buffer): Remove obsolete comment.
15225 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
15227         * termhooks.h (encode_terminal_code): Declare prototype.
15229         * msdos.c (encode_terminal_code): Don't declare prototype.
15231         * term.c (encode_terminal_code): Now external again, used by
15232         w32console.c and msdos.c.
15234         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
15235         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
15237 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
15239         Fix some minor problems found by GCC 4.5.2's static checks.
15241         * fringe.c (update_window_fringes): Mark locals as initialized
15242         (Bug#8227).
15243         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
15245         * alloc.c (mark_fringe_data): Move decl from here ...
15246         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
15247         to check its interface.
15248         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
15250         * fontset.c (free_realized_fontset): Now static.
15251         (Fset_fontset_font): Rename local to avoid shadowing.
15252         (fontset_font): Mark local as initialized.
15253         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
15255         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
15257         * xselect.c (x_disown_buffer_selections): Remove; not used.
15258         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
15259         (x_own_selection, Fx_disown_selection_internal): Rename locals
15260         to avoid shadowing.
15261         (x_handle_dnd_message): Remove local to avoid shadowing.
15263         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
15264         so that the caller can use some name other than gcpro1.
15265         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
15266         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15267         (Fx_backspace_delete_keys_p):
15268         Use them to avoid shadowing, and rename vars to avoid shadowing.
15269         (x_decode_color, x_set_name, x_window): Now static.
15270         (Fx_create_frame): Add braces to silence GCC warning.
15271         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
15272         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
15273         Remove unused locals.
15274         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15275         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
15276         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
15277         macros.
15279         * xterm.h (x_mouse_leave): New decl.
15281         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
15282         Remove unused functions.
15283         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
15284         (x_calc_absolute_position): Now static.
15285         (XTread_socket): Don't define label "out" unless it's used.
15286         Don't declare local "event" unless it's used.
15287         (x_iconify_frame, x_free_frame_resources): Don't declare locals
15288         unless they are used.
15289         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
15290         (x_fatal_error_signal): Remove; not used.
15291         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
15292         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
15293         (x_error_catcher, x_connection_closed, x_error_handler):
15294         (x_error_quitter, xembed_send_message, x_iconify_frame):
15295         (my_log_handler): Rename locals to avoid shadowing.
15296         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
15297         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
15299         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
15300         Rename or move locals to avoid shadowing.
15301         (tty_defined_color, merge_face_heights): Now static.
15302         (free_realized_faces_for_fontset): Remove; not used.
15303         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
15304         does not deduce is never used uninitialized.
15305         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
15306         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
15308         * terminal.c (store_terminal_param): Now static.
15310         * xmenu.c (menu_highlight_callback): Now static.
15311         (set_frame_menubar): Remove unused local.
15312         (xmenu_show): Rename parameter to avoid shadowing.
15313         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
15314         since they might point to immutable storage.
15315         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
15316         since it's unused otherwise.
15318         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
15319         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
15320         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
15321         avoids a gcc -Wuninitialized diagnostic.
15322         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
15323         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
15324         does not deduce are never used uninitialized.
15326         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
15328         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
15329         * window.c (window_loop, size_window):
15330         (run_window_configuration_change_hook, enlarge_window): Likewise.
15332         * window.c (display_buffer): Now static.
15333         (size_window): Mark variables that gcc -Wuninitialized
15334         does not deduce are never used uninitialized.
15335         * window.h (check_all_windows): New decl, to forestall
15336         gcc -Wmissing-prototypes diagnostic.
15337         * dispextern.h (bidi_dump_cached_states): Likewise.
15339         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
15340         shadowing.
15341         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
15342         Include <limits.h>.
15343         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
15344         and to avoid gcc -Wuninitialized warning.
15345         (load_charset_map): Mark variables that gcc -Wuninitialized
15346         does not deduce are never used uninitialized.
15347         (load_charset): Abort instead of using uninitialized var (Bug#8229).
15349         * coding.c (coding_set_source, coding_set_destination):
15350         Use "else { /* comment */ }" rather than "else /* comment */;"
15351         for clarity, and to avoid gcc -Wempty-body warning.
15352         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
15353         a block, when the outer 'i' will do.
15354         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
15355         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
15356         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
15357         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
15358         (Fdecode_sjis_char, Fdefine_coding_system_internal):
15359         Rename locals to avoid shadowing.
15360         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
15361         * coding.c (emacs_mule_char, encode_invocation_designation):
15362         Now static, since they're not used elsewhere.
15363         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
15364         (decode_coding_object, encode_coding_object, detect_coding_system):
15365         (decode_coding_emacs_mule): Mark variables that gcc
15366         -Wuninitialized does not deduce are never used uninitialized.
15367         (detect_coding_iso_2022): Initialize a local variable that might
15368         be used uninitialized.  Leave a FIXME because it's not clear that
15369         this initialization is needed.  (Bug#8211)
15370         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
15371         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
15372         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
15373         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
15374         Remove unused macros.
15376         * category.c (hash_get_category_set): Remove unused local var.
15377         (copy_category_table): Now static, since it's not used elsewhere.
15378         * character.c (string_count_byte8): Likewise.
15380         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
15381         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
15383         * chartab.c (copy_sub_char_table): Now static, since it's not used
15384         elsewhere.
15385         (sub_char_table_ref_and_range, char_table_ref_and_range):
15386         Rename locals to avoid shadowing.
15387         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
15389         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
15390         (BIDI_BOB): Remove unused macro.
15392         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
15393         deduce are never used uninitialized.
15394         * term.c (encode_terminal_code): Likewise.
15396         * term.c (encode_terminal_code): Now static.  Remove unused local.
15398         * tparam.h: New file.
15399         * term.c, tparam.h: Include it.
15400         * deps.mk (term.o, tparam.o): Depend on tparam.h.
15401         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
15402         Move these decls to tparam.h, and make them agree with what
15403         is actually in tparam.c.  The previous trick of using incompatible
15404         decls in different modules does not conform to the C standard.
15405         All callers of tparam changed to use tparam's actual API.
15406         * tparam.c (tparam1, tparam, tgoto):
15407         Use const pointers where appropriate.
15409         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
15410         * cm.h (struct cm): Likewise.
15411         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
15412         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
15413         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
15414         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
15415         (turn_on_face, init_tty): Likewise.
15416         * termchar.h (struct tty_display_info): Likewise.
15418         * term.c (term_mouse_position): Rename local to avoid shadowing.
15420         * alloc.c (mark_ttys): Move decl from here ...
15421         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
15423 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
15425         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
15427 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
15429         * search.c (compile_pattern_1): Remove argument regp, unused since
15430         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
15431         (compile_pattern): Don't pass it.
15433 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
15435         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
15436         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
15437         for ! HAVE_GTK3.
15438         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
15440         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
15442         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
15443         gdk_window_get_screen, gdk_window_get_geometry,
15444         gdk_x11_window_lookup_for_display and GDK_KEY_g.
15445         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
15446         (xg_get_pixbuf_from_pixmap): New function.
15447         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
15448         to Pixmap, take frame as parameter, remove GdkColormap parameter.
15449         Call xg_get_pixbuf_from_pixmap instead of
15450         gdk_pixbuf_get_from_drawable.
15451         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
15452         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
15453         (xg_check_special_colors): Use GtkStyleContext and its functions
15454         for HAVE_GTK3.
15455         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
15456         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
15457         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
15458         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
15459         Call gtk_widget_get_preferred_size.
15460         (xg_frame_resized): gdk_window_get_geometry only takes 5
15461         parameters.
15462         (xg_win_to_widget, xg_event_is_for_menubar):
15463         Call gdk_x11_window_lookup_for_display.
15464         (xg_set_widget_bg): New function.
15465         (delete_cb): New function.
15466         (xg_create_frame_widgets): Connect delete-event to delete_cb.
15467         Call xg_set_widget_bg.  Only set background pixmap for ! HAVE_GTK3
15468         (xg_set_background_color): Call xg_set_widget_bg.
15469         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
15470         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
15471         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
15472         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
15473         if ! HAVE_GTK3.
15474         (update_frame_tool_bar): Call gtk_widget_hide.
15475         (xg_initialize): Use GDK_KEY_g.
15477         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
15478         if ! HAVE_GTK3
15479         (x_session_initialize): Call gdk_x11_set_sm_client_id.
15481         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
15482         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
15483         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
15485 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
15487         * w32xfns.c (select_palette): Check success of RealizePalette against
15488         GDI_ERROR, not zero.
15490 See ChangeLog.11 for earlier changes.
15492 ;; Local Variables:
15493 ;; coding: utf-8
15494 ;; End:
15496   Copyright (C) 2011-2012 Free Software Foundation, Inc.
15498   This file is part of GNU Emacs.
15500   GNU Emacs is free software: you can redistribute it and/or modify
15501   it under the terms of the GNU General Public License as published by
15502   the Free Software Foundation, either version 3 of the License, or
15503   (at your option) any later version.
15505   GNU Emacs is distributed in the hope that it will be useful,
15506   but WITHOUT ANY WARRANTY; without even the implied warranty of
15507   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15508   GNU General Public License for more details.
15510   You should have received a copy of the GNU General Public License
15511   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.