Fix typos.
[emacs.git] / src / ChangeLog
blob6cb461b0ea1ead1cdc18717c6d51eb771fe0b6b1
1 2011-11-20  Juanma Barranquero  <lekktu@gmail.com>
3         * casetab.c (Fset_case_table):
4         * charset.c (Fcharset_after): Fix typos.
6 2011-11-20  Paul Eggert  <eggert@cs.ucla.edu>
8         Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
9         Otherwise, valgrind does not work on some platforms.
10         Problem reported by Andreas Schwab in
11         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
12         * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
13         is set, removing the need for VIRT_ADDRESS_VARIES.
14         (PURE_P): Use a more-efficient implementation that needs just one
15         comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
16         number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
17         to 4 (xorl, subq, cmpq, setbe).
18         * alloc.c (pure): Always extern now, since that's the
19         VIRT_ADDR_VARIES behavior.
20         (PURE_POINTER_P): Use a single comparison, not two, for
21         consistency with the new puresize.h.
22         * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
23         * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
24         Remove VIRT_ADDR_VARIES no longer needed.
26 2011-11-19  Eli Zaretskii  <eliz@gnu.org>
28         * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
29         (erase_phys_cursor, update_window_cursor, show_mouse_face)
30         (cursor_in_mouse_face_p): If the cursor position is out of bounds,
31         behave as if the cursor position were at the window margin.
33         * window.c (get_phys_cursor_glyph): If the window is hscrolled,
34         and the cursor position is out of bounds, behave as if the cursor
35         position were at the window margin.  (Bug#10075)
37 2011-11-18  Chong Yidong  <cyd@gnu.org>
39         * window.c (Fwindow_combination_limit): Make first argument
40         non-optional, since it is meaningless for live windows like the
41         selected window.
43 2011-11-18  Dmitry Antipov  <dmantipov@yandex.ru>
45         * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
47 2011-11-18  Stefan Monnier  <monnier@iro.umontreal.ca>
49         * intervals.c: Fix grafting over the whole buffer (bug#10071).
50         (graft_intervals_into_buffer): Simplify.
52 2011-11-18  Eli Zaretskii  <eliz@gnu.org>
54         * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
55         hash values of the two rows.
56         (copy_row_except_pointers): Preserve the used[] arrays and the
57         hash values of the two rows.  (Bug#10035)
58         (add_row_entry): Add xassert to verify that ROW's hash code is valid.
60         * xdisp.c (row_hash): New function, body extracted from
61         compute_line_metrics.
62         (compute_line_metrics): Call row_hash, instead of computing the
63         hash code inline.
65         * dispnew.c (verify_row_hash): Call row_hash for computing the
66         hash code of a row, instead of duplicating code from xdisp.c.
68         * dispextern.h (row_hash): Add prototype.
70 2011-11-18  Tassilo Horn  <tassilo@member.fsf.org>
72         * frame.c (delete_frame): Don't delete the terminal when the last
73         X frame is closed if emacs is built with GTK toolkit.
75 2011-11-17  Juanma Barranquero  <lekktu@gmail.com>
77         * window.c (syms_of_window) <window-combination-resize>: Fix typo.
79 2011-11-17  Martin Rudalics  <rudalics@gmx.at>
81         * window.c (Vwindow_splits): Rename to
82         Vwindow_combination_resize.  Suggested by Juri Linkov.
83         (Fsplit_window_internal): Use Vwindow_combination_resize instead
84         of Vwindow_splits.
86 2011-11-16  Juanma Barranquero  <lekktu@gmail.com>
88         * nsfns.m (Fns_font_name):
89         * window.c (syms_of_window) <window-combination-limit>: Fix typos.
91 2011-11-16  Martin Rudalics  <rudalics@gmx.at>
93         * window.h (window): Rename slot "nest" to "combination_limit".
94         * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
95         (Fset_window_nest): Rename to Fset_window_combination_limit.
96         (Vwindow_nest): Rename to Vwindow_combination_limit.
97         (recombine_windows, make_parent_window, make_window)
98         (Fsplit_window_internal, saved_window)
99         (Fset_window_configuration, save_window_save): Rename all
100         occurrences of window_nest to window_combination_limit.
102 2011-11-15  Juanma Barranquero  <lekktu@gmail.com>
104         * image.c (imagemagick_load_image): Fix typo.
106 2011-11-14  Eli Zaretskii  <eliz@gnu.org>
108         * xdisp.c (display_line): Move the call to
109         highlight_trailing_whitespace before the call to
110         compute_line_metrics, since the latter needs to see the final
111         faces of all the glyphs to compute ROW's hash value.  Fixes
112         assertion violations in row_equal_p.  (Bug#10035)
114 2011-11-14  Juanma Barranquero  <lekktu@gmail.com>
116         * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
117         just return (bug#10044).
119 2011-11-12  Eli Zaretskii  <eliz@gnu.org>
121         * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
122         with user-defined heap size.  Bump the default size of the temacs
123         heap to 27MB, to avoid memory warning when running temacs.
124         ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
126         * dispnew.c (scrolling_window): Fix incorrect indices in accessing
127         current_matrix and desired_matrix.  (Bug#9990)
128         (verify_row_hash) [XASSERTS]: New function.
129         (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
130         that the hash value of glyph rows is correct.
132 2011-11-12  Martin Rudalics  <rudalics@gmx.at>
134         * window.h (window): Remove splits slot.
135         * window.c (Fwindow_splits, Fset_window_splits): Remove.
136         (Fdelete_other_windows_internal, make_parent_window)
137         (make_window, Fsplit_window_internal, Fdelete_window_internal)
138         (Fset_window_configuration, save_window_save): Don't deal with
139         split status of windows.
140         (saved_window): Remove splits slot.
141         (Vwindow_splits): Rewrite doc-string.
143 2011-11-11  Jan Djärv  <jan.h.d@swipnet.se>
145         * xfns.c (unwind_create_frame):
146         * nsfns.m (unwind_create_frame):
147         * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
148         Vframe_list (Bug#9999).
150 2011-11-11  Dmitry Antipov  <dmantipov@yandex.ru>
152         * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
154 2011-11-11  Kenichi Handa  <handa@m17n.org>
156         * callproc.c (Fcall_process): Set the member dst_multibyte of
157         process_coding.
159 2011-11-11  Johan Bockgård  <bojohan@gnu.org>
161         * xdisp.c (fill_composite_glyph_string): Always set s->face, to
162         avoid a crash (bug#9496).
164 2011-11-09  Chong Yidong  <cyd@gnu.org>
166         * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
167         (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
169 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
171         * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
173 2011-11-08  Paul Eggert  <eggert@cs.ucla.edu>
175         Avoid some portability problems by eschewing 'extern inline' functions.
176         The trivial performance wins aren't worth the portability hassles; see
177         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
178         et seq.
179         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
180         (window_box_width, window_box_left, window_box_left_offset)
181         (window_box_right, window_box_right_offset): Undo previous change,
182         by removing the "extern"s.
183         * intervals.c (adjust_intervals_for_insertion)
184         (adjust_intervals_for_deletion): Undo previous change,
185         making these static again.
186         (offset_intervals, temp_set_point_both, temp_set_point)
187         (copy_intervals_to_string): No longer inline.
188         * xdisp.c (window_text_bottom_y, window_box_width)
189         (window_box_height, window_box_left_offset)
190         (window_box_right_offset, window_box_left, window_box_right)
191         (window_box): No longer inline.
193 2011-11-08  Chong Yidong  <cyd@gnu.org>
195         * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
196         (Fwindow_body_height, Fwindow_body_width): Move from Lisp.  Signal
197         an error if not a live window.
198         (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
199         (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
201 2011-11-07  Juanma Barranquero  <lekktu@gmail.com>
203         * lisp.h (syms_of_abbrev): Remove declaration.
204         Reported by CHENG Gao <chenggao@royau.me>.
206 2011-11-07  Eli Zaretskii  <eliz@gnu.org>
208         * w32.c (check_windows_init_file): Don't look for term/w32-win.el
209         if Vpurify_flag is non-nil.  Fixes a crash when running w32 build
210         of temacs in GUI mode.
212 2011-11-07  Martin Rudalics  <rudalics@gmx.at>
214         * window.h: Declare delete_all_child_windows instead of
215         delete_all_subwindows.
216         * window.c (Fwindow_nest, Fset_window_nest)
217         (Fset_window_new_total, Fset_window_new_normal)
218         (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
219         (delete_all_subwindows): Rename to delete_all_child_windows.
220         (Fdelete_other_windows_internal, Fset_window_configuration):
221         Call delete_all_child_windows instead of delete_all_subwindows.
222         * frame.c (delete_frame): Call delete_all_child_windows instead
223         of delete_all_subwindows.
225 2011-11-07  Paul Eggert  <eggert@cs.ucla.edu>
227         * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
228         This is also needed for porting to any host where GC_MARK_STACK is
229         not GC_MAKE_GCPROS_NOOPS.
230         (which_symbols): Use it.
232 2011-11-07  Kenichi Handa  <handa@m17n.org>
234         * coding.c (coding_set_destination): Check coding->src_pos only
235         when coding->src_object is a buffer (bug#9910).
237         * process.c (send_process): Set the member src_multibyte of coding
238         to 0 (bug#9911) when sending a unibyte text.
240         * callproc.c (Fcall_process): Set the member src_multibyte of
241         process_coding to 0 (bug#9912).
243 2011-11-06  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
245         * xmenu.c (cleanup_widget_value_tree): New function.
246         (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
247         calling free_menubar_widget_value_tree directly (Bug#9830).
249 2011-11-06  Paul Eggert  <eggert@cs.ucla.edu>
251         Fix some portability problems with 'inline'.
252         * dispextern.h (window_box, window_box_height, window_text_bottom_y)
253         (window_box_width, window_box_left, window_box_left_offset)
254         (window_box_right, window_box_right_offset): Declare extern.
255         Otherwise, these inline functions do not conform to C99 and
256         are miscompiled by Microsoft compilers.  Reported by Eli Zaretskii in
257         <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
258         * intervals.c (adjust_intervals_for_insertion)
259         (adjust_intervals_for_deletion): Now extern, because otherwise the
260         extern inline functions 'offset_intervals' couldn't refer to it.
261         (static_offset_intervals): Remove.
262         (offset_intervals): Rewrite using the old contents of
263         static_offset_intervals.  The old version didn't conform to C99
264         because an extern inline function contained a reference to an
265         identifier with static linkage.
267 2011-11-06  Andreas Schwab  <schwab@linux-m68k.org>
269         * keyboard.c (interrupt_signal): Don't call kill-emacs while in
270         GC.
272 2011-11-06  Eli Zaretskii  <eliz@gnu.org>
274         * xdisp.c (init_iterator, reseat_to_string): Don't set the
275         iterator's bidi_p flag if Vpurify_flag is non-nil.  (Bug#9963)
276         (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
277         return Qleft_to_right.
279 2011-11-06  Chong Yidong  <cyd@gnu.org>
281         * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
282         (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
283         (Fset_window_splits, Fwindow_nest, Fset_window_nest)
284         (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
285         (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
286         (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
287         (Fwindow_vscroll): Doc fix.
288         (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
289         argument, since it makes no sense to pass a live window and for
290         consistency with window-child.
292 2011-11-05  Christoph Scholtes  <cschol2112@googlemail.com>
294         * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
295         support MSVC.
297 2011-11-05  Jason Rumney  <jasonr@gnu.org>
299         * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
300         (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
301         fonts (Bug#6029).
302         (add_font_entity_to_list): Fix logic errors in mixed boolean and
303         bitwise arithmetic preventing use of unicode-sip and non-truetype
304         opentype fonts.
306 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
308         * s/ms-w32.h (fstat, stat, utime): Move redirections to
309         "emacs"-only part.
311         * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
312         initialization code to keep similarity to xfns.c after changes
313         from 2011-11-05.
315 2011-11-05  Jan Djärv  <jan.h.d@swipnet.se>
317         * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
318         (unwind_create_frame): New function (Bug#9943).
319         (Fx_create_frame): Restructure code to be more similar to the one in
320         xfns.c.  Call record_unwind_protect with unwind_create_frame (Bug#9943).
321         Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
322         Move terminal->reference_count++ just before making the frame official
323         (Bug#9943).
325         * nsterm.m (x_free_frame_resources): New function.
326         (x_destroy_window): Move code to x_free_frame_resources.
328         * xfns.c (unwind_create_frame): Fix comment.
329         (Fx_create_frame, x_create_tip_frame): Move
330         terminal->reference_count++ just before making the frame
331         official. Move initialization of image_cache_refcount and
332         dpyinfo_refcount before calling init_frame_faces (Bug#9943).
334 2011-11-05  Eli Zaretskii  <eliz@gnu.org>
336         Support MSVC build with newer versions of Visual Studio.
337         * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
338         Nmake barfs on that.  Use $(OBJ*_c) variables instead, defined on
339         nt/gmake.defs.
341         * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
342         which are not supported by MSVC.
343         (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
344         (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
345         bitfields.
346         (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
347         types in bitfields.
348         (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
350         * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
352 2011-11-05  Fabrice Popineau  <fabrice.popineau@supelec.fr>  (tiny change)
354         Support MSVC build with newer versions of Visual Studio.
355         * w32.c: Don't include w32api.h for MSVC.
356         (init_environment) [_MSC_VER]: Call sys_access, not _access.
358         * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
359         [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
360         (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
361         (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
362         e_* cousins.
363         (alloca) [_MSC_VER]: Define to _alloca.
365         * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
367         * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
369 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
371         * xdisp.c (note_mouse_highlight): If either of
372         previous/next-single-property-change returns nil, treat that as
373         the beginning or the end of the buffer.  (Bug#9955)
375 2011-11-04  Jan Djärv  <jan.h.d@swipnet.se>
377         * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
378         label is not null (Bug#9951).
379         (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
380         may be NULL.
382 2011-11-04  Eli Zaretskii  <eliz@gnu.org>
384         * window.c (Fwindow_body_size): Mention in the doc string that the
385         return value is in frame's canonical units.  (Bug#9949)
387 2011-11-03  Eli Zaretskii  <eliz@gnu.org>
389         * xdisp.c (note_mouse_highlight): Initialize `area'.  (Bug#9947)
391         * w32fns.c (unwind_create_frame): If needed, free the glyph
392         matrices of the partially constructed frame.  (Bug#9943)
393         * xfns.c (unwind_create_frame): Likewise.
395 2011-11-01  Eli Zaretskii  <eliz@gnu.org>
397         * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
398         Don't stop backward scan on the continuation glyph, even though
399         its CHARPOS is positive.
400         (mouse_face_from_buffer_pos, note_mouse_highlight): Rename
401         cover_string to disp_string.
403 2011-11-01  Martin Rudalics  <rudalics@gmx.at>
405         * window.c (temp_output_buffer_show): Don't use
406         Vtemp_buffer_show_specifiers.
407         (Vtemp_buffer_show_specifiers): Remove unused variable.
409 2011-10-30  Eli Zaretskii  <eliz@gnu.org>
411         * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
412         past the beginning of the current glyph matrix.
414 2011-10-30  Adam Sjøgren  <asjo@koldfront.dk>  (tiny change)
416         * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
417         (x_error_handler): Ignore BadMatch for X_SetInputFocus for
418         HAVE_GTK3 (Bug#9869).
420         * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
421         type to GDK_NOTHING so valgrind does not complain (Bug#9901).
423         * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
425         * xterm.c: Declare x_handle_net_wm_state to return int.
426         (handle_one_xevent): Check if we are iconified but don't have
427         _NET_WM_STATE_HIDDEN.  If do, treat as deiconify (Bug#9893).
428         (get_current_wm_state): Return non-zero if not hidden,
429         check for _NET_WM_STATE_HIDDEN (Bug#9893).
430         (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
431         (x_handle_net_wm_state): Return what get_current_wm_state returns.
432         (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
434 2011-10-29  Paul Eggert  <eggert@cs.ucla.edu>
436         * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
437         so that this new function doesn't get optimized away by a
438         whole-program optimizer.  Make the 2nd arg EMACS_INT, not int.
440 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
442         * frame.h (MOUSE_HL_INFO): Remove excess parens.
444 2011-10-29  Eli Zaretskii  <eliz@gnu.org>
446         Fix the `xbytecode' command.
447         * .gdbinit (xprintbytestr): New command.
448         (xwhichsymbols): Rename from `which'; all callers changed.
449         (xbytecode): Print the byte-code string as well.
451 2011-10-29  Kim Storm  <storm@cua.dk>
453         * alloc.c (which_symbols): New function.
455 2011-10-29  Andreas Schwab  <schwab@linux-m68k.org>
457         * minibuf.c (read_minibuf_noninteractive): Allow reading empty
458         line.  (Bug#9903)
460 2011-10-29  Glenn Morris  <rgm@gnu.org>
462         * process.c (wait_reading_process_output): Revert 2009-08-30 change.
463         Not clear what it was for, and it causes various bugs.  (Bug#9839)
465 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
467         * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
468         possible random value that matches one of those tested as
469         condition to clear the mouse face.
471 2011-10-28  Chong Yidong  <cyd@gnu.org>
473         * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
475 2011-10-28  Dan Nicolaescu  <dann@ics.uci.edu>
477         * window.c (make_window): Initialize phys_cursor_on_p.
479 2011-10-28  Stefan Monnier  <monnier@iro.umontreal.ca>
481         * lisp.h (struct Lisp_Symbol): Update comments.
483 2011-10-28  Juanma Barranquero  <lekktu@gmail.com>
485         * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
487 2011-10-28  Eli Zaretskii  <eliz@gnu.org>
489         Fix Emacs on Windows 9X (bug#8562).  Thanks to oslsachem
490         <oslsachem@gmail.com> for helping to debug this.
492         * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
493         (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
494         (g_b_init_get_glyph_outline_w): New static variables.
495         (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
496         (GetGlyphOutlineW_Proc): New typedefs.
497         (w32_load_unicows_or_gdi32, get_outline_metrics_w)
498         (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
499         New functions.
500         (w32font_open_internal, compute_metrics):
501         Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
502         instead of calling the "wide" APIs directly.
504         * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
506         * w32.h (syms_of_w32font): Add prototype.
508 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
510         * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
511         (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
512         (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
513         (Fmove_to_window_line): Doc fix.
515 2011-10-27  Chong Yidong  <cyd@gnu.org>
517         * process.c (make_process): Set gnutls_state to NULL.
519         * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
520         non-NULL, regardless of GNUTLS_INITSTAGE.
521         (Fgnutls_boot): Cleanups.  Call emacs_gnutls_deinit if we signal
522         an error.  Set process slots as soon as we allocate them.
524         * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
526 2011-10-27  Chong Yidong  <cyd@gnu.org>
528         * gnutls.c (emacs_gnutls_deinit): New function.
529         Deallocate credentials structures as well as calling gnutls_deinit.
530         (Fgnutls_deinit, Fgnutls_boot): Use it.
532         * process.c (make_process): Initialize GnuTLS credentials to NULL.
533         (deactivate_process): Call emacs_gnutls_deinit.
535 2011-10-27  Juanma Barranquero  <lekktu@gmail.com>
537         * image.c (x_create_x_image_and_pixmap):
538         * w32.c (sys_rename, w32_delayed_load):
539         * w32font.c (fill_in_logfont):
540         * w32reg.c (x_get_string_resource): Silence compiler warnings.
542 2011-10-26  Juanma Barranquero  <lekktu@gmail.com>
544         * w32fns.c (w32_default_color_map): New function,
545         extracted from Fw32_default_color_map.
546         (Fw32_default_color_map, Fx_open_connection): Use it.  (Bug#9785)
548 2011-10-25  Paul Eggert  <eggert@cs.ucla.edu>
550         * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
552 2011-10-25  Stefan Monnier  <monnier@iro.umontreal.ca>
554         * keyboard.c (test_undefined): New function (bug#9751).
555         (read_key_sequence): Use it to detect when a key is bound to `undefined'.
557 2011-10-25  Enami Tsugutomo  <tsugutomo.enami@jp.sony.com>
559         * sysdep.c (init_sys_modes): Fix the check for the controlling
560         terminal (Bug#6649).
562 2011-10-20  Eli Zaretskii  <eliz@gnu.org>
564         * dispextern.h (struct bidi_it): New member next_en_type.
566         * bidi.c (bidi_line_init): Initialize the next_en_type member.
567         (bidi_resolve_explicit_1): When next_en_pos is valid for the
568         current character, check also for next_en_type being WEAK_EN.
569         (bidi_resolve_weak): Don't enter the expensive loop if the current
570         position is before next_en_pos.  Record the bidi type of the first
571         non-ET, non-BN character we find, in addition to its position.
572         (bidi_level_of_next_char): Invalidate next_en_type when
573         next_en_pos is over-stepped.
575 2011-10-20  Paul Eggert  <eggert@cs.ucla.edu>
577         Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
578         * editfns.c: Rewrite current-time-zone so that it invokes
579         the equivalent of (format-time-string "%Z") to get the time zone name.
580         This fixes a bug when the time zone name contains characters that
581         need converting from the system time locale to Emacs internal format.
582         This fixes a shortcoming that I introduced in my 1999-10-19 patch:
583         that patch fixed format-time-string to do the conversion, but
584         I forgot to fix current-time-zone.
585         (format_time_string): New function, containing most of
586         what Fformat_time_string used to contain.
587         (Fformat_time_string): Rewrite in terms of format_time_string.
588         This doesn't change this function's behavior.
589         (current-time-zone): Rewrite to use format_time_string.
590         This fixes the bug reported by Michael Schierl in
591         <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
592         Jason Rumney's 2007-06-07 change worked around this bug, but
593         didn't fix it.
594         * systime.h (tzname, timezone): Remove no-longer-used declarations.
596 2011-10-19  Eli Zaretskii  <eliz@gnu.org>
598         * xdisp.c (start_display): If the character at POS is displayed
599         via a display vector, reset IT->current.dpvec_index to zero.
600         (try_window_reusing_current_matrix): If a line ends in a display
601         vector or the next line starts in a display vector, continue
602         redrawing the window even though the character position of
603         start_row was reached.
604         (Bug#9771, part 2)
606 2011-10-18  Chong Yidong  <cyd@gnu.org>
608         * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
609         with nobreak-char-display too.
611 2011-10-18  Eli Zaretskii  <eliz@gnu.org>
613         Fix part 3 of bug#9771.
614         * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
615         (bidi_resolve_neutral): Don't enter the expensive loop looking for
616         non-neutral characters if the current character is a paragraph
617         separator (a.k.a. Newline).  This avoids running the same
618         expensive loop twice, once when we consume the preceding newline
619         and the other time when the line actually needs to be displayed.
620         Avoid the loop when we see neutrals on the base embedding level
621         following a character whose directionality is the same as the
622         paragraph's.  This avoids running the expensive loop when a line
623         ends in a long sequence of neutrals, like control characters.
624         Add assertion against STRONG_AL type.  Slightly rearrange code
625         that determines the type of a neutral given the first non-neutral
626         that follows it.
627         (bidi_level_of_next_char): Set next_en_pos to zero when
628         invalidating its info.
630 2011-10-17  Eli Zaretskii  <eliz@gnu.org>
632         * xdisp.c (push_display_prop): Determine whether to record string
633         or buffer position by IT->string, not by IT->method.  Allow
634         GET_FROM_DISPLAY_VECTOR as IT->method on entry.  (Bug#9771, part 4)
635         (move_it_vertically_backward): Don't look for character position
636         immediately after the newline when in a continuation line.
637         (Bug#9771, part 1)
639 2011-10-15  Martin Rudalics  <rudalics@gmx.at>
641         * window.c (coordinates_in_window): Rewrite and delabelize
642         vertical border check.  (Bug#5357) (Bug#9618)
644 2011-10-14  Stefan Monnier  <monnier@iro.umontreal.ca>
646         * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
647         errors in XSetWindowBorder (bug#9310).
649 2011-10-13  Dmitry Antipov  <dmantipov@yandex.ru>
651         * editfns.c (Fset_time_zone_rule): Replace free with xfree to
652         avoid crash when xmalloc overrun checking is enabled.
654 2011-10-13  Eli Zaretskii  <eliz@gnu.org>
656         * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
657         itb.paragraph_dir to NEUTRAL_DIR.  Fixes an occasional incorrect
658         cursor motion with <left> and <right> arrow keys.
660         * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
661         some callers set that themselves.
663 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
665         * xdisp.c (find_row_edges): Handle the case where ROW comes from a
666         display string and the previous row comes from the same string and
667         is empty.  (Bug#9739)  (Bug#9738)
669 2011-10-12  Stefan Monnier  <monnier@iro.umontreal.ca>
671         * doc.c (get_doc_string): Encode file name (bug#9735).
673 2011-10-12  Eli Zaretskii  <eliz@gnu.org>
675         * bidi.c (bidi_level_of_next_char):
676         * xdisp.c (get_visually_first_element): Remove old incorrect
677         comments regarding the Unicode Line Separator character.
679         * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
681 2011-10-12  Dmitry Antipov  <dmantipov@yandex.ru>
683         * alloc.c (Fgc_status): Do not access beyond zombies array
684         boundary if nzombies > MAX_ZOMBIES.
685         * alloc.c (dump_zombies): Add missing format specifier.
687 2011-10-12  Paul Eggert  <eggert@cs.ucla.edu>
689         * xdisp.c (set_cursor_from_row): Simplify conditionals,
690         to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
692         * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
693         Some packages use them to denote characters with modifiers.
695 2011-10-11  Andreas Schwab  <schwab@linux-m68k.org>
697         * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
698         (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
699         matching a pp-number.  Rename parameter var to var1.
701 2011-10-11  Stefan Monnier  <monnier@iro.umontreal.ca>
703         * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
705 2011-10-08  Glenn Morris  <rgm@gnu.org>
707         * callint.c (Fcall_interactively): Give a more explicit error for the
708         'c' case with a non-character input.  (Bug#8479)
710 2011-10-08  Eli Zaretskii  <eliz@gnu.org>
712         * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
713         lines.
714         (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
715         lines that are hscrolled on the left.
717         * dispnew.c (buffer_posn_from_coords): Account for a possible
718         presence of header-line.  (Bug#4426)
720 2011-10-07  Stefan Monnier  <monnier@iro.umontreal.ca>
722         * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
723         Don't advertise functionality which we discourage or doesn't work.
725 2011-10-07  Paul Eggert  <eggert@cs.ucla.edu>
727         * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
728         or sizeof.  __alignof__ gives the wrong answer on Fedora x86-64
729         with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
730         this makes Emacs dump core during garbage collection on rare
731         occasions.  sizeof is obviously inferior to offsetof here, so
732         stick with offsetof.
733         (GC_POINTER_ALIGNMENT): New macro.
734         (mark_memory): Omit 3rd (offset) arg; caller changed.
735         Don't assume EMACS_INT alignment is the same as pointer alignment.
737 2011-10-03  Stefan Monnier  <monnier@iro.umontreal.ca>
739         * keyboard.c (read_key_sequence_remapped): New var.
740         (read_key_sequence): Compute remapping in the right buffer.
741         (command_loop_1): Use read_key_sequence's remapping directly.
743 2011-10-02  Stefan Monnier  <monnier@iro.umontreal.ca>
745         * dired.c (file_name_completion): Don't expand file name.
746         (Ffile_name_completion, Ffile_name_all_completions): Expand file name
747         before checking file name handler.
749         * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
750         they've been requested explicitly (bug#9591).
752 2011-10-01  Andreas Schwab  <schwab@linux-m68k.org>
754         * keymap.c (Fsingle_key_description): Use make_specified_string
755         instead of build_string to build string from push_key_description.
756         (Bug#5193)
758 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
760         * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
761         This fixes a Y2038 bug on 64-bit hosts.
762         * buffer.c (reset_buffer):
763         * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
764         (Fclear_buffer_auto_save_failure):
765         Use 0, not -1, to represent an unset failure time, since time_t
766         might not be signed.
768         Remove dependency on glibc malloc internals.
769         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
770         Move back here from lisp.h, but with their new implementations.
771         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
772         (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
773         * charset.c (charset_table_init): New static var.
774         (syms_of_charset): Use it instead of xmalloc.  This removes a
775         dependency on glibc malloc internals.  See Eli Zaretskii's comment in
776         <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
777         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
778         Move back to alloc.c.
779         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
780         (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
782 2011-09-30  Jan Djärv  <jan.h.d@swipnet.se>
784         * nsterm.m (windowDidResize): Call x_set_window_size only when
785         ns_in_resize is true.  Otherwise set pixelwidth/height and
786         call change_frame_size (Bug#9628).
788 2011-09-30  Paul Eggert  <eggert@cs.ucla.edu>
790         Port --enable-checking=all to Fedora 14 x86-64.
791         * charset.c (syms_of_charset): Also account for glibc malloc's
792         internal overhead when calculating the initial malloc maximum.
794         Port --enable-checking=all to Fedora 14 x86.
795         * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
796         Move to lisp.h.
797         (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
798         (overrun_check_realloc, overrun_check_free):
799         Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
800         That way, xmalloc returns a properly-aligned pointer even if
801         XMALLOC_OVERRUN_CHECK is defined.  The old debugging code happened
802         to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
803         * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
804         into account when calculating the initial malloc maximum.
805         * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
806         Move here from alloc.c, so that charset.c can use it too.
807         Properly align; the old code wasn't right for common 32-bit hosts
808         when configured with --enable-checking=all.
809         (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
810         (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
812 2011-09-29  Eli Zaretskii  <eliz@gnu.org>
814         * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
815         use EDOM.
817 2011-09-28  Eli Zaretskii  <eliz@gnu.org>
819         * xdisp.c (compute_display_string_end): If there's no display
820         string at CHARPOS, return -1.
822         * bidi.c (bidi_fetch_char): When compute_display_string_end
823         returns a negative value, treat the character as a normal
824         character not covered by a display string.  (Bug#9624)
826 2011-09-28  Juanma Barranquero  <lekktu@gmail.com>
828         * lread.c (Fread_from_string): Fix typo in docstring.
830 2011-09-27  Eli Zaretskii  <eliz@gnu.org>
832         * xdisp.c (handle_invisible_prop): If invisible text ends on a
833         newline, reseat the iterator instead of bidi-iterating there one
834         character at a time.  (Bug#9610)
835         (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
836         TO_CHARPOS if the bidi iterator is at base embedding level.
838 2011-09-27  Andreas Schwab  <schwab@linux-m68k.org>
840         * lread.c (readevalloop): Use correct code for NBSP.
841         (read1): Likewise.  (Bug#9608)
843 2011-09-25  Michael Albinus  <michael.albinus@gmx.de>
845         * dbusbind.c (Fdbus_register_signal): When service is not
846         registered, use nil in Vdbus_registered_objects_table.  (Bug#9581)
848 2011-09-25  Glenn Morris  <rgm@gnu.org>
850         * buffer.c (truncate-lines): Doc fix.
852 2011-09-24  Chong Yidong  <cyd@stupidchicken.com>
854         * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
855         (Fset_window_next_buffers): Doc fix.
857 2011-09-24  Glenn Morris  <rgm@gnu.org>
859         * minibuf.c (read_minibuf): Disable line truncation.  (Bug#5715)
861 2011-09-24  Paul Eggert  <eggert@cs.ucla.edu>
863         Fix minor problems found by static checking.
864         * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
865         * indent.c (Fvertical_motion): Fix == vs = typo.
867 2011-09-24  Eli Zaretskii  <eliz@gnu.org>
869         * dispnew.c (syms_of_display) <redisplay-dont-pause>:
870         Default value is now t.  Doc fix.
872         * indent.c (Fvertical_motion): Compute and apply the overshoot
873         logic when moving up, not only when moving down.  Fix the
874         confusing name and values of the it_overshoot_expected variable;
875         logic changes accordingly.  (Bug#9254) (Bug#9549)
877         * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
878         CHARPOS is covered by a display string which includes newlines.
879         (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
880         is covered by a display string with embedded newlines.
882 2011-09-24  Michael Albinus  <michael.albinus@gmx.de>
884         * dbusbind.c (Fdbus_register_signal): Add match rule to
885         Vdbus_registered_objects_table.  (Bug#9581)
886         (Fdbus_register_method, Vdbus_registered_objects_table):
887         Fix docstring.
889 2011-09-24  Jim Meyering  <meyering@redhat.com>
891         do not ignore write error for any output size
892         The previous change was incomplete.
893         While it makes emacs --batch detect the vast majority of stdout
894         write failures, errors were still ignored whenever the output size is
895         k * (BUFSIZ+1) - 4.  E.g., on a system with BUFSIZ of 4096,
896           $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
897               && echo FAIL: ignored write error
898           FAIL: ignored write error
899           $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
900               && echo FAIL: ignored write error
901           FAIL: ignored write error
902         * emacs.c (Fkill_emacs): Also test ferror.  (Bug#9574)
904 2011-09-23  Andreas Schwab  <schwab@linux-m68k.org>
906         * emacs.c (Fkill_emacs): In noninteractive mode exit
907         non-successfully if a write error occurred on stdout.  (Bug#9574)
909 2011-09-21  Eli Zaretskii  <eliz@gnu.org>
911         * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
912         the xassert test.
914         * dispextern.h (struct it): Update the comment documenting what
915         can it->OBJECT be.
917 2011-09-20  Eli Zaretskii  <eliz@gnu.org>
919         * xdisp.c (set_cursor_from_row): If the row ends in a newline from
920         a display string, extend search for cursor position to end of row.
921         (find_row_edges): If the row ends in a newline from a display
922         string, increment its MATRIX_ROW_END_CHARPOS by one.  (Bug#9549)
923         Handle the case of a display string with multiple newlines.
924         (Fcurrent_bidi_paragraph_direction): Fix search for previous
925         non-empty line.  Fixes confusing cursor motion with arrow keys at
926         the beginning of a line that starts with whitespace.
928 2011-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
930         * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
931         (bug#9493).
933 2011-09-18  Chong Yidong  <cyd@stupidchicken.com>
935         * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
936         boolean (Bug#9154).
938 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
940         * xdisp.c (display_line): Record maximum and minimum buffer
941         positions even if no glyphs were produced (e.g., by a zero-width
942         stretch).  Fixes bug#9530 on a TTY.  Under word-wrap, don't record
943         buffer positions that will be removed from the glyph row because
944         they don't fit.
945         (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
946         column is beyond frame width: don't subtract 1 "pixel" when
947         computing width of the stretch.
948         (reseat_at_next_visible_line_start): Undo the change made on
949         2011-09-17 that saved paragraph information and restored it after
950         the call to `reseat'.  (Bug#9545)
952 2011-09-18  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
954         * xdisp.c (expose_window): Save original value of phys_cursor_on_p
955         and turn window cursor on if cleared (Bug#9415).
957 2011-09-18  Andreas Schwab  <schwab@linux-m68k.org>
959         * search.c (boyer_moore): Take unibyte characters from pattern
960         literally.  (Bug#9458)
962 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
964         * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
966 2011-09-18  Paul Eggert  <eggert@cs.ucla.edu>
968         Fix minor problem found by static checking.
969         * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
970         initialized, to pacify gcc -Wuninitialized.
972         * fileio.c: Report proper errno when syscall falls.
973         (Finsert_file_contents): Save and restore errno,
974         so that report_file_error outputs the correct diagnostic.
975         (Fwrite_region) [CLASH_DETECTION]: Likewise.
977 2011-09-18  Eli Zaretskii  <eliz@gnu.org>
979         * .gdbinit (pgx): Fix references to fields of `struct glyph'.
981 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
983         * xdisp.c (produce_stretch_glyph): Another fix for changes made on
984         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9530)
986 2011-09-17  Eli Zaretskii  <eliz@gnu.org>
988         * xdisp.c (reseat_at_next_visible_line_start): Keep information
989         about the current paragraph and restore it after the call to reseat.
991         * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
992         (bidi_find_paragraph_start): Search back for paragraph beginning
993         at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
994         (bidi_move_to_visually_next): Only trigger paragraph-related
995         computations when the last character is a newline or at EOB, not
996         just any NEUTRAL_B.  (Bug#9470)
998         * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
999         truncated lines if point is covered by a display string.  (Bug#9524)
1001 2011-09-16  Paul Eggert  <eggert@cs.ucla.edu>
1003         * xselect.c: Relax test for outgoing X longs (Bug#9498).
1004         (cons_to_x_long): New function.
1005         (lisp_data_to_selection_data): Use it.  Correct the test for
1006         short-versus-long data; it was negated.  Break out of vector
1007         loop, for efficiency, when a long datum is discovered.
1009 2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
1011         * eval.c (Fquote): Document its non-consing behavior (bug#9482).
1013 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
1015         * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
1016         GCC PR/17406) by declaring this function with external scope.
1018 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
1020         * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
1021         Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
1023 2011-09-15  Andreas Schwab  <schwab@linux-m68k.org>
1025         * editfns.c (Fformat): Correctly handle text properties on "%%".
1027 2011-09-15  Eli Zaretskii  <eliz@gnu.org>
1029         * xterm.c (x_draw_composite_glyph_string_foreground):
1030         * w32term.c (x_draw_composite_glyph_string_foreground):
1031         * term.c (encode_terminal_code):
1032         * composite.c (composition_update_it, get_composition_id):
1033         * xdisp.c (get_next_display_element)
1034         (fill_composite_glyph_string): Add comments about special meaning
1035         of TAB characters in a composition.
1037 2011-09-15  Paul Eggert  <eggert@cs.ucla.edu>
1039         * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
1040         This occurs when processing a multibyte format.
1041         Problem reported by Wolfgang Jenker.
1043 2011-09-15  Johan Bockgård  <bojohan@gnu.org>
1045         * xdisp.c (try_cursor_movement): Only check for exact match if
1046         cursor hpos found by set_cursor_from_row is valid.  (Bug#9495)
1048 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
1050         Remove unused external symbols.
1051         * dispextern.h (calc_pixel_width_or_height): Remove decl.
1052         * xdisp.c (calc_pixel_width_or_height): Now static.
1053         * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
1054         * indent.c (check_display_width):
1055         * w32term.c: Fix comment to match code.
1056         * xterm.c, xterm.h (x_catching_errors): Remove.
1058 2011-09-14  Paul Eggert  <eggert@cs.ucla.edu>
1060         * xselect.c: Use signed conversions more consistently (Bug#9498).
1061         (selection_data_to_lisp_data): Assume incoming selection data are
1062         signed integers, not unsigned.  This is to be consistent with
1063         outgoing selection data, which was modified to use signed integers
1064         in as part of the fix to Bug#9196 in response to Jan D.'s comment
1065         in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
1066         expects long, not unsigned long.
1068 2011-09-14  Eli Zaretskii  <eliz@gnu.org>
1070         * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
1071         computation of loop end.  Reported by Johan Bockgård
1072         <bojohan@gnu.org>.
1074 2011-09-13  Chong Yidong  <cyd@stupidchicken.com>
1076         * frame.c (Fother_visible_frames_p): Function deleted.
1078 2011-09-12  Eli Zaretskii  <eliz@gnu.org>
1080         * indent.c (compute_motion): Process display vector front to back
1081         rather than the other way around.  (Bug#2496)
1083 2011-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
1085         * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
1087 2011-09-11  Chong Yidong  <cyd@stupidchicken.com>
1089         * minibuf.c (Fread_from_minibuffer): Doc fix.
1091 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
1093         * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
1094         2011-08-30T17:32:44Z!eliz@gnu.org.  (Bug#9475)
1096 2011-09-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
1098         * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
1099         value for non-existent files.
1101 2011-09-11  Eli Zaretskii  <eliz@gnu.org>
1103         * fileio.c (Finsert_file_contents): If the file cannot be opened,
1104         set its "size" to -1.  This will set the modtime_size field of
1105         the corresponding buffer to -1, which is what
1106         verify-visited-file-modtime expects for files that do not exist.
1107         (Bug#9139)
1109 2011-09-11  Paul Eggert  <eggert@cs.ucla.edu>
1111         * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
1112         here ...
1113         * lisp.h: ... from here.  push_key_description is no longer
1114         defined in keyboard.c, so its declaration should not be in
1115         lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
1116         logically belongs with push_key_description.
1118 2011-09-10  Paul Eggert  <eggert@cs.ucla.edu>
1120         * buffer.h: Include <sys/types.h> instead of <time.h>.
1121         Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
1122         Problem reported by Herbert J. Skuhra.
1124 2011-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
1126         * xml.c (parse_region): Make the parsing work for
1127         non-comment-starting XML files again (bug#9144).
1129 2011-09-10  Andreas Schwab  <schwab@linux-m68k.org>
1131         * image.c (gif_load): Fix calculation of bottom and right corner.
1132         (Bug#9468)
1134 2011-09-10  Eli Zaretskii  <eliz@gnu.org>
1136         * xdisp.c (MAX_DISP_SCAN): Decrease to 250.  Prevents sluggish
1137         redisplay in small windows.
1139 2011-09-09  Eli Zaretskii  <eliz@gnu.org>
1141         * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
1143 2011-09-08  Martin Rudalics  <rudalics@gmx.at>
1145         * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
1146         Operate on live windows only.
1148 2011-09-08  Juanma Barranquero  <lekktu@gmail.com>
1150         * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
1152 2011-09-07  Eli Zaretskii  <eliz@gnu.org>
1154         * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
1155         only under bidi iteration.
1157 2011-09-07  Jan Djärv  <jan.h.d@swipnet.se>
1159         * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
1161 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1163         isnan: Fix porting problem to Solaris 10 with bundled gcc.
1164         Without this fix, the command to link temacs failed due to an
1165         undefined symbol __builtin_isnan.  This is because
1166         /usr/include/iso/math_c99.h #defines isnan(x) to
1167         __builtin_isnan(x), but the bundled gcc, which identifies itself
1168         as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
1169         a __builtin_isnan.
1170         * floatfns.c (isnan): #undef, and then #define to a clone of
1171         what's in data.c.
1172         (Fisnan): Always define, since it's always available now.
1173         (syms_of_floatfns): Always define isnan at the Lisp level.
1175 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1177         * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
1179 2011-09-06  Paul Eggert  <eggert@cs.ucla.edu>
1181         * fileio.c: Fix bugs with large file offsets (Bug#9428).
1182         The previous code assumed that file offsets (off_t values) fit in
1183         EMACS_INT variables, which is not true on typical 32-bit hosts.
1184         The code messed up by falsely reporting buffer overflow in cases
1185         such as (insert-file-contents "big" nil 1 2) into an empty buffer
1186         when "big" contains more than 2**29 bytes, even though this
1187         inserts just one byte and does not overflow the buffer.
1188         (Finsert_file_contents): Store file offsets as off_t
1189         values, not as EMACS_INT values.  Check for overflow when
1190         converting between EMACS_INT and off_t.  When checking for
1191         buffer overflow or for overlap, take the offsets into account.
1192         Don't use EMACS_INT for small values where int suffices.
1193         When checking for overlap, fix a typo: ZV was used where
1194         ZV_BYTE was intended.
1195         (Fwrite_region): Don't assume off_t fits into 'long'.
1196         * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
1198 2011-09-05  Michael Albinus  <michael.albinus@gmx.de>
1200         * dbusbind.c (xd_signature_cat): Rename from signature_cat.
1202 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1204         sprintf-related integer and memory overflow issues (Bug#9412).
1206         * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
1207         (esprintf, exprintf, evxprintf): New functions.
1208         * keyboard.c (command_loop_level): Now EMACS_INT, not int.
1209         (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
1210         (modify_event_symbol): Do not assume that the length of
1211         name_alist_or_stem is safe to alloca and fits in int.
1212         (Fexecute_extended_command): Likewise for function name and binding.
1213         (Frecursion_depth): Wrap around reliably on integer overflow.
1214         * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
1215         since some callers pass EMACS_INT values.
1216         (Fsingle_key_description): Don't crash if symbol name contains more
1217         than MAX_ALLOCA bytes.
1218         * minibuf.c (minibuf_level): Now EMACS_INT, not int.
1219         (get_minibuffer): Arg is now EMACS_INT, not int.
1220         * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
1221         (esprintf, exprintf, evxprintf): New decls.
1222         * window.h (command_loop_level, minibuf_level): Reflect API changes.
1224         * dbusbind.c (signature_cat): New function.
1225         (xd_signature, Fdbus_register_signal):
1226         Do not overrun buffer; instead, report string overflow.
1228         * dispnew.c (add_window_display_history): Don't overrun buffer.
1229         Truncate instead; this is OK since it's just a log.
1231         * editfns.c (Fcurrent_time_zone): Don't overrun buffer
1232         even if the time zone offset is outlandishly large.
1233         Don't mishandle offset == INT_MIN.
1235         * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
1236         when creating daemon; the previous buffer-overflow check was incorrect.
1238         * eval.c (verror): Simplify by rewriting in terms of evxprintf,
1239         which has the guts of the old verror function.
1241         * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
1242         use SAFE_ALLOCA instead.  Use esprintf to avoid int-overflow issues.
1244         * font.c: Include <float.h>, for DBL_MAX_10_EXP.
1245         (font_unparse_xlfd): Don't blindly alloca long strings.
1246         Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
1247         fits in int, when using sprintf.  Use single snprintf to count
1248         length of string rather than counting it via multiple sprintfs;
1249         that's simpler and more reliable.
1250         (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
1251         (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
1252         sprintf, in case result does not fit in int.
1254         * fontset.c (num_auto_fontsets): Now printmax_t, not int.
1255         (fontset_from_font): Print it.
1257         * frame.c (tty_frame_count): Now printmax_t, not int.
1258         (make_terminal_frame, set_term_frame_name): Print it.
1259         (x_report_frame_params): In X, window IDs are unsigned long,
1260         not signed long, so print them as unsigned.
1261         (validate_x_resource_name): Check for implausibly long names,
1262         and don't assume name length fits in 'int'.
1263         (x_get_resource_string): Don't blindly alloca invocation name;
1264         use SAFE_ALLOCA.  Use esprintf, not sprintf, in case result does
1265         not fit in int.
1267         * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
1268         (xg_check_special_colors, xg_set_geometry):
1269         Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
1271         * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
1272         Use esprintf, not sprintf, in case result does not fit in int.
1274         * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
1275         (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
1276         it as a large positive number.
1277         (Fexecute_kbd_macro): Don't assume repeat count fits in int.
1278         * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
1280         * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
1281         in case result does not fit in int.
1283         * print.c (float_to_string): Detect width overflow more reliably.
1284         (print_object): Make sprintf buffer a bit bigger, to avoid potential
1285         buffer overrun.  Don't assume list length fits in 'int'.  Treat
1286         print length of 0 as 0, not as infinity; to be consistent with other
1287         uses of print length in this function.  Don't overflow print length
1288         index.  Don't assume hash table size fits in 'long', or that
1289         vectorlike size fits in 'unsigned long'.
1291         * process.c (make_process): Use printmax_t, not int, to format
1292         process-name gensyms.
1294         * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
1296         * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
1297         to avoid potential buffer overrun.
1299         * xfaces.c (x_update_menu_appearance): Don't overrun buffer
1300         if X resource line is longer than 512 bytes.
1302         * xfns.c (x_window): Make sprintf buffer a bit bigger
1303         to avoid potential buffer overrun.
1305         * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
1307         * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
1309 2011-09-04  Paul Eggert  <eggert@cs.ucla.edu>
1311         Integer overflow fixes for scrolling, etc.
1312         Without these, Emacs silently mishandles large integers sometimes.
1313         For example, "C-u 4294967297 M-x recenter" was treated as if
1314         it were "C-u 1 M-x recenter" on a typical 64-bit host.
1316         * xdisp.c (try_window_id): Check Emacs fixnum range before
1317         converting to 'int'.
1319         * window.c (window_scroll_line_based, Frecenter):
1320         Check that an Emacs fixnum is in range before assigning it to 'int'.
1321         (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
1322         values converted from Emacs fixnums.
1323         (Frecenter): Don't wrap around a line count if it is out of 'int'
1324         range; instead, treat it as an extreme value.
1325         (Fset_window_configuration, compare_window_configurations):
1326         Use ptrdiff_t, not int, for index that might exceed 2 GiB.
1328         * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
1329         that can exceed INT_MAX.  Check that EMACS_INT value is in range
1330         before assigning it to the (possibly-narrower) index.
1331         (match_limit): Don't assume that a fixnum can fit in 'int'.
1333         * print.c (print_object): Use ptrdiff_t, not int, for index that can
1334         exceed INT_MAX.
1336         * indent.c (position_indentation): Now takes ptrdiff_t, not int.
1337         (Fvertical_motion): Don't wrap around LINES values that don't fit
1338         in 'int'.  Instead, treat them as extreme values.  This is good
1339         enough for windows, which can't have more than INT_MAX lines anyway.
1341 2011-09-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
1343         * Require libxml/parser.h to avoid compilation warning.
1345         * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
1347         * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
1348         since this reportedly can destroy thread storage.
1350 2011-08-30  Chong Yidong  <cyd@stupidchicken.com>
1352         * syntax.c (find_defun_start): Update all cache variables if
1353         exiting early (Bug#9401).
1355 2011-08-30  Eli Zaretskii  <eliz@gnu.org>
1357         * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
1359         * xdisp.c (produce_stretch_glyph): No longer static, compiled also
1360         when HAVE_WINDOW_SYSTEM is not defined.  Support both GUI and TTY
1361         frames.  Call tty_append_glyph in the TTY case.  (Bug#9402)
1363         * term.c (tty_append_glyph): New function.
1364         (produce_stretch_glyph): Static function and its prototype deleted.
1366         * dispextern.h (produce_stretch_glyph, tty_append_glyph):
1367         Add prototypes.
1369 2011-08-29  Paul Eggert  <eggert@cs.ucla.edu>
1371         * image.c (parse_image_spec): Check for nonnegative, not for positive,
1372         when checking :margin (Bug#9390).
1373         (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
1374         Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
1375         so that the name doesn't mislead.  All uses changed.
1377 2011-08-28  Johan Bockgård  <bojohan@gnu.org>
1379         * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
1380         set_tty_hooks.
1382 2011-08-27  Eli Zaretskii  <eliz@gnu.org>
1384         * xdisp.c (move_it_to): Don't bail out early when reaching
1385         position beyond to_charpos, if we are scanning backwards.
1386         (move_it_vertically_backward): When DY == 0, make sure we get to
1387         the first character in the line after the newline.
1389 2011-08-27  Paul Eggert  <eggert@cs.ucla.edu>
1391         * ccl.c: Improve and simplify overflow checking (Bug#9196).
1392         (ccl_driver): Do not generate an out-of-range pointer.
1393         (Fccl_execute_on_string): Remove unnecessary check for
1394         integer overflow, noted by Stefan Monnier in
1395         <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
1396         Remove a FIXME that didn't need fixing.
1397         Simplify the newly-introduced buffer reallocation code.
1399 2011-08-27  Juanma Barranquero  <lekktu@gmail.com>
1401         * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
1403 2011-08-26  Paul Eggert  <eggert@cs.ucla.edu>
1405         Integer and memory overflow issues (Bug#9196).
1407         * doc.c (get_doc_string): Rework so that
1408         get_doc_string_buffer_size is the actual buffer size, rather than
1409         being 1 less than the actual buffer size; this makes xpalloc more
1410         convenient.
1412         * image.c (x_allocate_bitmap_record, cache_image):
1413         * xselect.c (Fx_register_dnd_atom):
1414         Simplify previous changes by using xpalloc.
1416         * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
1417         since either will do and ptrdiff_t is convenient with xpalloc.
1419         * charset.c (charset_table_size)
1420         (struct charset_sort_data.priority): Now ptrdiff_t.
1421         (charset_compare): Don't overflow if priorities differ greatly.
1422         (Fsort_charsets): Don't assume list length fits in int.
1423         Check for size-calculation overflow when allocating sort data.
1424         (syms_of_charset): Allocate an initial charset table that is
1425         just under 64 KiB, to avoid problems with glibc malloc and mmap.
1427         * cmds.c (internal_self_insert): Check for size-calculation overflow.
1429         * composite.h (struct composition.glyph_len): Now int, not unsigned.
1430         The actual value is always <= INT_MAX, and leaving it unsigned made
1431         overflow checking harder.
1433         * dispextern.h (struct glyph_matrix.rows_allocated)
1434         (struct face_cache.size): Now ptrdiff_t, for convenience in use
1435         with xpalloc.  The values are still always <= INT_MAX.
1437         * indent.c (compute_motion): Adjust to region_cache_forward sig change.
1439         * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
1440         (SAFE_NALLOCA): New macro.
1442         * region-cache.c (struct boundary.pos, find_cache_boundary)
1443         (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
1444         (set_cache_region, invalidate_region_cache)
1445         (revalidate_region_cache, know_region_cache, region_cache_forward)
1446         (region_cache_backward, pp_cache):
1447         Use ptrdiff_t, not EMACS_INT, since either will do.  This is needed
1448         so that ptrdiff_t * can be passed to xpalloc.
1449         (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
1450         beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
1451         (pp_cache): Don't assume cache_len fits in int.
1452         * region-cache.h: Adjust extern decls to match.
1454         * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
1455         EMACS_INT, since either will do, for xpalloc.
1457         * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
1458         (xnmalloc, xnrealloc, xpalloc): New functions.
1460         * bidi.c (bidi_shelve_header_size): New constant.
1461         (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
1462         (bidi_cache_ensure_space): Avoid integer overflow when allocating.
1464         * bidi.c (bidi_cache_shrink):
1465         * buffer.c (overlays_at, overlays_in, record_overlay_string)
1466         (overlay_strings):
1467         Don't update size of array until after memory allocation succeeds,
1468         because xmalloc/xrealloc may not return.
1469         (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
1470         now that we have proper integer overflow checking.
1471         (record_overlay_string, overlay_strings): Catch overflows when
1472         calculating size of overlay_str_buf.
1474         * callproc.c (Fcall_process): Check for size overflow when
1475         calculating size of args2.
1476         (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
1477         Normally we prefer signed values, but sticking with ptrdiff_t would
1478         require adding more-complicated checks.
1480         * ccl.c (Fccl_execute_on_string): Check for memory overflow.
1481         Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
1482         Redo buffer-overflow calculations to avoid integer overflow.
1483         Add a FIXME comment where memory seems to be over-allocated.
1485         * character.c (Fstring): Check for size-calculation overflow.
1487         * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
1488         unnecessary integer overflow.  Check for size overflow.
1489         (encode_coding_object): Don't update size until xmalloc succeeds.
1491         * composite.c (get_composition_id): Check for overflow in glyph
1492         length calculations.
1494         Integer and memory overflow fixes for display code.
1495         * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
1496         * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
1497         (scrolling_window): Check for overflow in size calculations.
1498         (line_draw_cost, realloc_glyph_pool, add_row_entry):
1499         Don't assume glyph table len fits in int.
1500         (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
1501         (row_table_size): Now ptrdiff_t, not int.
1502         (scrolling_window): Avoid overflow in size calculations.
1503         Don't update size until allocation succeeds.
1504         * fns.c (concat): Check for overflow in size calculations.
1505         (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
1506         * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
1507         (NEXT_ALMOST_PRIME_LIMIT): New constant.
1509         * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
1510         (get_doc_string): Check for size calculation overflow.
1511         Don't update size until allocation succeeds.
1512         (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
1513         EMACS_INT, where ptrdiff_t will do.
1514         (Fsubstitute_command_keys): Check for string overflow.
1516         * editfns.c (set_time_zone_rule): Don't assume environment length
1517         fits in int.
1518         (message_length): Now ptrdiff_t, not int.
1519         (Fmessage_box): Don't update size until allocation succeeds.
1520         Don't assume message length fits in int.
1521         (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
1523         * emacs.c (main): Do not reallocate argv, since there is a null at
1524         the end that can be overwritten, and this way there's no need to
1525         worry about size-calculation overflow.
1526         (sort_args): Check for size-calculation overflow.
1528         * eval.c (init_eval_once, grow_specpdl): Don't update size until
1529         alloc succeeds.
1530         (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
1532         * frame.c (set_menu_bar_lines, x_set_frame_parameters)
1533         (x_set_scroll_bar_width, x_figure_window_size):
1534         Check for integer overflow.
1535         (x_set_alpha): Do not assume XINT fits in int.
1537         * frame.h (struct frame): Use int, not EMACS_INT, where int works.
1538         This is for the members text_lines, text_cols, total_lines, total_cols,
1539         where the system imposes an 'int' limit.
1541         * fringe.c (Fdefine_fringe_bitmap):
1542         Don't update size until alloc works.
1544         * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
1545         (ftfont_shape_by_flt): Check for integer overflow in size calculations.
1547         * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
1548         Check for size-calculation overflow.
1549         (get_utf8_string): Use ptrdiff_t, not size_t, where either will
1550         do, as we prefer signed integers.
1551         (id_to_widget.max_size, id_to_widget.used)
1552         (xg_store_widget_in_map, xg_remove_widget_from_map)
1553         (xg_get_widget_from_map, xg_get_scroll_id_for_window)
1554         (xg_remove_scroll_bar, xg_update_scrollbar_pos):
1555         Use and return ptrdiff_t, not int.
1556         (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
1557         * gtkutil.h: Change prototypes to match the above.
1559         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
1560         are duplicate now that they've been promoted to lisp.h.
1561         (x_allocate_bitmap_record, x_alloc_image_color)
1562         (make_image_cache, cache_image, xpm_load):
1563         Don't update size until alloc is done.
1564         (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
1565         (x_detect_edges):
1566         Check for size calculation overflow.
1567         (ct_colors_allocated_max): New constant.
1568         (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
1569         overflow.
1571         * keyboard.c (read_char, menu_bar_items, tool_bar_items)
1572         (read_char_x_menu_prompt, read_char_minibuf_menu_width)
1573         (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
1574         Use ptrdiff_t, not int, to count maps.
1575         (read_char_minibuf_menu_prompt): Check for overflow in size
1576         calculations.  Don't update size until allocation succeeds.
1577         Redo calculations to avoid overflow.
1578         * keyboard.h: Change prototypes to match the above.
1580         * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
1581         to count maps.
1582         (current_minor_maps): Check for size calculation overflow.
1583         * keymap.h: Change prototypes to match the above.
1585         * lread.c (read1, init_obarray): Don't update size until alloc done.
1587         * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
1588         (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
1590         * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
1591         Now ptrdiff_t, not int.
1592         * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
1593         (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
1595         * process.c (Fnetwork_interface_list): Check for overflow
1596         in size calculation.
1598         * region-cache.c (move_cache_gap): Check for size calculation overflow.
1600         * scroll.c (do_line_insertion_deletion_costs): Check for size calc
1601         overflow.  Don't bother calling xmalloc when xrealloc will do.
1603         * search.c (Freplace_match): Check for size calculation overflow.
1604         (Fset_match_data): Don't assume list lengths fit in 'int'.
1606         * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
1607         for command line length.  Do not attempt to address one before the
1608         beginning of an array, as that's not portable.
1610         * term.c (max_frame_lines): Remove; unused.
1611         (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
1612         not int.
1613         (encode_terminal_code, calculate_costs): Check for size
1614         calculation overflow.
1615         (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
1616         table lengths and related sizes.  Don't update size until alloc
1617         done.  Redo calculations to avoid overflow.
1618         (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
1620         * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
1621         subtracting pointers.
1622         (gobble_line): Check for overflow more carefully.  Don't update size
1623         until alloc done.
1625         * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
1626         Don't update size until alloc done.
1627         Redo size calculations to avoid overflow.
1628         Check for size calculation overflow.
1629         (main) [DEBUG]: Fix typo in invoking tparam1.
1631         * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
1632         Use ptrdiff_t, not int, for sizes.
1633         (store_mode_line_noprop_char): Don't update size until alloc done.
1635         * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
1636         Use ptrdiff_t, not int, for sizes.
1637         (Finternal_make_lisp_face, cache_face):
1638         Check for size calculation overflow.
1639         (cache_face): Treat size calculation overflows as if they were
1640         memory exhaustion (the usual treatment), rather than aborting.
1642         * xfns.c (x_encode_text, x_set_name_internal)
1643         (Fx_change_window_property): Use ptrdiff_t, not int, to count
1644         sizes, since they can exceed INT_MAX in size.  Check for size
1645         calculation overflow.
1647         * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
1648         (xg_select): Check for size calculation overflow.
1649         Don't update size until alloc done.
1651         * xrdb.c (get_environ_db): Don't assume path length fits in int,
1652         as sprintf is limited to int lengths.
1654         * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
1655         (X_LONG_MIN): New macros.
1656         Use them to make the following changes clearer.
1657         (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
1658         This change doesn't affect the value now, but it may help remind
1659         future maintainers not to raise the value too much later.
1660         (SELECTION_QUANTUM): Remove, replacing with ...
1661         (selection_quantum): ... new function, which avoids overflow.
1662         All uses changed.
1663         (struct selection_data.size): Now ptrdiff_t, not int, to avoid
1664         assumption that selection length fits in 'int'.
1665         (x_reply_selection_request, x_handle_selection_request)
1666         (x_get_window_property, receive_incremental_selection)
1667         (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
1668         (lisp_data_to_selection_data, clean_local_selection_data):
1669         Use ptrdiff_t, not int, to record length of selection.
1670         (x_reply_selection_request, x_get_window_property)
1671         (receive_incremental_selection, x_property_data_to_lisp):
1672         Redo calculations to avoid overflow.
1673         (x_reply_selection_request): When sending hint, ceiling it at
1674         X_LONG_MAX rather than relying on wraparound overflow to send
1675         something.
1676         (x_get_window_property, receive_incremental_selection)
1677         (lisp_data_to_selection_data, x_property_data_to_lisp):
1678         Check for size-calculation overflow.
1679         (x_get_window_property, receive_incremental_selection)
1680         (lisp_data_to_selection_data, Fx_register_dnd_atom):
1681         Don't store size until memory allocation succeeds.
1682         (x_get_window_property): Plug memory leak on memory exhaustion.
1683         Don't double-block input; malloc is safe here.  Don't assume 2**34
1684         - 4 fits in unsigned long.  Add an xassert to check
1685         XGetWindowProperty overflow.  Be more careful about overflow
1686         calculations, and distinguish size from memory overflow better.
1687         (receive_incremental_selection): When tracing, don't assume
1688         unsigned int is less than INT_MAX.
1689         (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
1690         harmful) conversions of unsigned short to int.
1691         (lisp_data_to_selection_data): Don't assume that integers
1692         in the range -65535 through -1 fit in an X unsigned short.
1693         Don't assume that ULONG_MAX == X_ULONG_MAX.  Don't store into
1694         result parameters unless successful.  Rely on cons_to_unsigned
1695         to report problems with elements; the old code wasn't right anyway.
1696         (x_check_property_data): Check for int overflow; we cannot use
1697         a wider type due to X limits.
1698         (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
1700         * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
1702         * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
1703         (x_term_init): Check for size calculation overflow.
1704         (x_color_cells): Don't store size until memory allocation succeeds.
1705         (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
1706         Don't assume alloca size is less than MAX_ALLOCA.
1707         (x_term_init): Don't assume length fits in int (sprintf is limited
1708         to int size).
1710         Use ptrdiff_t for composition IDs.
1711         * character.c (lisp_string_width):
1712         * composite.c (composition_table_size, n_compositions)
1713         (get_composition_id, composition_gstring_from_id):
1714         * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
1715         * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
1716         * window.c (Frecenter):
1717         Use ptrdiff_t, not int, for composition IDs.
1718         * composite.c (get_composition_id): Check for integer overflow.
1719         * composite.h: Adjust prototypes to match the above changes.
1721         Use ptrdiff_t for hash table indexes.
1722         * category.c (hash_get_category_set):
1723         * ccl.c (ccl_driver):
1724         * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
1725         * coding.c (coding_system_charset_list, detect_coding_system):
1726         * coding.h (struct coding_system.id):
1727         * composite.c (get_composition_id, gstring_lookup_cache):
1728         * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
1729         * image.c (xpm_get_color_table_h):
1730         * lisp.h (hash_lookup, hash_put):
1731         * minibuf.c (Ftest_completion):
1732         Use ptrdiff_t for hash table indexes, not int (which is too
1733         narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
1734         32-bit --with-wide-int hosts).
1736         * charset.c (Fdefine_charset_internal): Check for integer overflow.
1737         Add a FIXME comment about memory leaks.
1738         (syms_of_charset): Don't assume xmalloc returns.
1740         Don't assume that stated character widths fit in int.
1741         * character.c (Fchar_width, c_string_width, lisp_string_width):
1742         * character.h (CHAR_WIDTH):
1743         * indent.c (MULTIBYTE_BYTES_WIDTH):
1744         Use sanitize_char_width to avoid undefined and/or bad behavior
1745         with outlandish widths.
1746         * character.h (sanitize_tab_width): Rename from sanitize_width,
1747         now that we have two such functions.  All uses changed.
1748         (sanitize_char_width): New inline function.
1750         Don't assume that tab-width fits in int.
1751         * character.h (sanitize_width): New inline function.
1752         (SANE_TAB_WIDTH): New macro.
1753         (ASCII_CHAR_WIDTH): Use it.
1754         * indent.c (sane_tab_width): Remove.  All uses replaced by
1755         SANE_TAB_WIDTH (current_buffer).
1756         * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
1758         * fileio.c: Integer overflow issues with file modes.
1759         (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
1761         * charset.c (read_hex): New arg OVERFLOW.  All uses changed.
1762         Remove unreachable code.
1763         (read_hex, load_charset_map_from_file): Check for integer overflow.
1765         * xterm.c: don't go over XClientMessageEvent limit
1766         (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
1767         (x_send_scroll_bar_event): Likewise.  Check that the size does not
1768         exceed limits imposed by XClientMessageEvent, as well as the usual
1769         ptrdiff_t and size_t limits.
1771         * keyboard.c: Overflow, signedness and related fixes.
1772         (make_lispy_movement): Use same integer type in forward decl
1773         that is used in the definition.
1774         (read_key_sequence, keyremap_step):
1775         Change bufsize argument back to int, undoing my 2011-03-30 change.
1776         We prefer signed types, and int is wide enough here.
1777         (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
1778         than TYPE_MAXIMUM (EMACS_INT) / 2.  Don't let the label size grow
1779         larger than STRING_BYTES_BOUND.  Use ptrdiff_t for Emacs string
1780         length, not size_t.  Use ptrdiff_t for index, not int.
1781         (keyremap_step, read_key_sequence): Redo bufsize check to avoid
1782         possibility of integer overflow.
1784         Overflow, signedness and related fixes for images.
1786         * dispextern.h (struct it.stack[0].u.image.image_id)
1787         (struct_it.image_id, struct image.id, struct image_cache.size)
1788         (struct image_cache.used, struct image_cache.ref_count):
1789         * gtkutil.c (update_frame_tool_bar):
1790         * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
1791         (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
1792         (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
1793         * nsmenu.m (update_frame_tool_bar):
1794         * xdisp.c (calc_pixel_width_or_height):
1795         * xfns.c (image_cache_refcount):
1796         Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
1797         on typical 64-bit hosts.
1799         * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
1800         (x_bitmap_pixmap, x_create_x_image_and_pixmap):
1801         Omit unnecessary casts to int.
1802         (parse_image_spec): Check that integers fall into 'int' range
1803         when the callers expect that.
1804         (image_ascent): Redo ascent calculation to avoid int overflow.
1805         (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
1806         (lookup_image): Remove unnecessary tests.
1807         (xbm_image_p): Locals are now of int, not EMACS_INT,
1808         since parse_image_check makes sure they fit into int.
1809         (png_load, gif_load, svg_load_image):
1810         Prefer int to unsigned where either will do.
1811         (tiff_handler): New function, combining the cores of the
1812         old tiff_error_handler and tiff_warning_handler.
1813         This function is rewritten to use vsnprintf and thereby avoid
1814         stack buffer overflows.  It uses only the features of vsnprintf
1815         that are common to both POSIX and native Microsoft.
1816         (tiff_error_handler, tiff_warning_handler): Use it.
1817         (tiff_load, gif_load, imagemagick_load_image):
1818         Don't assume :index value fits in 'int'.
1819         (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
1820         (imagemagick_load_image): Check that crop parameters fit into
1821         the integer types that MagickCropImage accepts.  Don't assume
1822         Vimagemagick_render_type has a nonnegative value.  Don't assume
1823         size_t fits in 'long'.
1824         (gs_load): Use printmax_t to print the widest integers possible.
1825         Check for integer overflow when computing image height and width.
1827 2011-08-26  Eli Zaretskii  <eliz@gnu.org>
1829         * xdisp.c (redisplay_window): Don't force window start if point
1830         will be invisible in the resulting window.  (Bug#9324)
1832 2011-08-25  Eli Zaretskii  <eliz@gnu.org>
1834         * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
1835         the display spec is of the form `(space ...)'.
1836         (handle_display_spec): Return the value returned by
1837         handle_single_display_spec, not just 1 or zero.
1838         (handle_single_display_spec): If the display spec is of the form
1839         `(space ...)', and specifies display in the text area, return 2
1840         rather than 1.
1841         (try_cursor_movement): Check for the need to scroll more
1842         accurately, and prefer exact match for point under bidi.
1843         Don't advance `row' beyond the last row of the window.
1845         * dispextern.h (struct bidi_it): Rename the disp_prop_p member
1846         into disp_prop; all users changed.
1848         * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
1849         DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
1850         for the text covered by the display property.
1852 2011-08-25  Chong Yidong  <cyd@stupidchicken.com>
1854         * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
1855         Change return value to nil.
1856         (Frecord_buffer): Delete unused function.
1858 2011-08-24  Eli Zaretskii  <eliz@gnu.org>
1860         * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
1861         buffers, return left-to-right.
1862         (set_cursor_from_row): Consider candidate row a win if its glyph
1863         represents a newline and point is on that newline.  Fixes cursor
1864         positioning on the newline at EOL of R2L text within L2R
1865         paragraph, and vice versa.
1866         (try_cursor_movement): Check continued rows, in addition to
1867         continuation rows.  Fixes unwarranted scroll when point enters a
1868         continued line of R2L text within an L2R paragraph, or vice versa.
1869         (cursor_row_p): Consider the case of point being equal to
1870         MATRIX_ROW_END_CHARPOS.  Prevents cursor being stuck when moving
1871         from the end of a short line to the beginning of a continued line
1872         of R2L text within L2R paragraph.
1873         (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
1874         composed characters.
1876         * bidi.c (bidi_check_type): Use xassert.
1877         (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
1878         members.
1880 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
1882         * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
1883         a character.
1885 2011-08-23  Chong Yidong  <cyd@stupidchicken.com>
1887         * nsfont.m (ns_otf_to_script): Fix typo.
1889 2011-08-22  Kenichi Handa  <handa@m17n.org>
1891         * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
1892         extra slot even if the purpose is char-code-property-table.
1894 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
1896         * xdisp.c (redisplay_window): When computing centering_position,
1897         account for the height of the header line.  (Bug#8874)
1899         * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
1900         instead of CHAR_TO_BYTE.  Fixes a crash when a completion
1901         candidate is selected by the mouse, and that candidate has a
1902         composed character under the mouse.
1904         * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1.  Fixes pixel
1905         coordinates reported by pos-visible-in-window-p for a composed
1906         character in column zero.
1908 2011-08-23  Stefan Monnier  <monnier@iro.umontreal.ca>
1910         * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
1912 2011-08-22  Eli Zaretskii  <eliz@gnu.org>
1914         * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
1915         consider it a hit if to_charpos is anywhere in the range of the
1916         composed buffer positions.
1918 2011-08-22  Chong Yidong  <cyd@stupidchicken.com>
1920         * image.c (gif_load): Don't assume that each subimage has the same
1921         dimensions as the base image.  Handle disposal method that is
1922         "undefined" by the gif spec (Bug#9335).
1924 2011-08-20  Chong Yidong  <cyd@stupidchicken.com>
1926         * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
1927         (Fcondition_case): Document `debug' symbol in error handler.
1929 2011-08-19  Eli Zaretskii  <eliz@gnu.org>
1931         * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
1932         face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
1933         from an Org mode buffer to a Speedbar frame.
1935         * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
1936         a composition, take its buffer position from IT->cmp_it.charpos.
1937         Fixes cursor positioning at the beginning of a line that begins
1938         with a composed character.
1940 2011-08-18  Eli Zaretskii  <eliz@gnu.org>
1942         * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
1943         character bidirectional type, use STRONG_L instead.  Fixes crashes
1944         in a buffer produced by `describe-categories'.
1946         * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
1947         members before the level stack, so they would be saved and
1948         restored when copying iterator state.  Fixes incorrect reordering
1949         around TABs covered by display properties.
1951 2011-08-18  Andreas Schwab  <schwab@linux-m68k.org>
1953         * process.c (Fnetwork_interface_list): Correctly determine buffer size.
1955 2011-08-17  Chong Yidong  <cyd@stupidchicken.com>
1957         * eval.c (internal_condition_case, internal_condition_case_1)
1958         (internal_condition_case_2, internal_condition_case_n):
1959         Remove unnecessary aborts (Bug#9081).
1961 2011-08-17  Eli Zaretskii  <eliz@gnu.org>
1963         * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
1964         has no `load' handler, try opening the file locally.  (Bug#9311)
1966 2011-08-16  Ken Brown  <kbrown@cornell.edu>
1968         * gmalloc.c: Expand comment.
1970 2011-08-16  Eli Zaretskii  <eliz@gnu.org>
1972         * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
1973         if it fails the cursor_row_p test.  Fixes cursor positioning at ZV.
1975 2011-08-16  Ken Brown  <kbrown@cornell.edu>
1977         Fix memory allocation problems in Cygwin build (Bug#9273).
1979         * unexcw.c ( __malloc_initialized): Declare external variable.
1980         (fixup_executable): Force the dumped emacs to reinitialize malloc.
1982         * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
1983         New variables.
1984         (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
1985         dumped emacs.
1986         (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
1987         in the static heap.
1988         [CYGWIN] (special_realloc): New function.
1989         (_realloc_internal_nolock) [CYGWIN]: Use the new function on
1990         requests to realloc storage in the static heap.
1992 2011-08-15  Paul Eggert  <eggert@cs.ucla.edu>
1994         * bidi.c (bidi_initialize): Remove unused local.
1996 2011-08-15  Eli Zaretskii  <eliz@gnu.org>
1998         * bidimirror.h:
1999         * biditype.h: Remove file.
2000         * makefile.w32-in ($(BLD)/bidi.$(O)):
2001         * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
2003         * dispextern.h: Fix a typo in the comment to bidi_type_t.
2005         * chartab.c: Improve commentary for the uniprop_table API.
2007         * bidi.c (bidi_paragraph_init): Support zero value of
2008         bidi_ignore_explicit_marks_for_paragraph_level.
2009         (bidi_initialize): Use uniprop_table instead of including
2010         biditype.h and bidimirror.h.
2012         * xdisp.c (move_it_in_display_line_to): Don't reset pixel
2013         coordinates of the iterator when restoring from ppos_it.
2014         (Bug#9296)
2016 2011-08-14  Kenichi Handa  <handa@m17n.org>
2018         * process.c (create_process): Call setup_process_coding_systems
2019         after the pid of the process is set to -1 (Bug#8162).
2021 2011-08-14  Eli Zaretskii  <eliz@gnu.org>
2023         * xdisp.c (move_it_in_display_line_to): Don't invoke
2024         IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
2025         ppos_it.  Fixes vertical cursor motion when line beginning is
2026         covered by an image.  (Bug#9296)
2028 2011-08-14  Jan Djärv  <jan.h.d@swipnet.se>
2030         * nsterm.h (ns_run_ascript): Declare.
2031         (NSAPP_DATA2_RUNASSCRIPT): Define.
2033         * nsfns.m (as_script, as_result, as_status): New static variables.
2034         (ns_run_ascript): New function.
2035         (Fns_do_applescript): Set variables as_*.  Make an NSApplicationDefined
2036         event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
2037         the event loop.  Get status from as_status (Bug#7276).
2039         * nsterm.m (sendEvent): If event is NSApplicationDefined and
2040         data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
2041         the event loop (Bug#7276).
2043 2011-08-14  Andreas Schwab  <schwab@linux-m68k.org>
2045         * gnutls.c (QCgnutls_bootprop_priority)
2046         (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
2047         (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
2048         (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
2049         (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
2050         (QCgnutls_bootprop_verify_hostname_error)
2051         (QCgnutls_bootprop_callbacks_verify): Rename from
2052         Qgnutls_bootprop_..., all uses changed.
2054         * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
2055         uses changed.
2057 2011-08-14  Paul Eggert  <eggert@cs.ucla.edu>
2059         * xfaces.c (Qframe_set_background_mode): Now static.
2060         * dispextern.h (Qframe_set_background_mode): Remove decl.
2062         * process.c (Fnetwork_interface_info): Declare local only if needed.
2064 2011-08-13  Jan Djärv  <jan.h.d@swipnet.se>
2066         * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
2067         (Fnetwork_interface_list): Allocate in increments of bytes instead
2068         of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
2069         bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
2070         sockaddr.
2071         (struct ifflag_def): notrailers is smart on OSX.
2072         (Fnetwork_interface_info): Handle case when ifr_flags is negative.
2073         Get hardware address with getifaddrs if available.
2075 2011-08-12  Eli Zaretskii  <eliz@gnu.org>
2077         * xdisp.c (iterate_out_of_display_property): xassert that
2078         IT->position is set to within IT->object's boundaries.  Break from
2079         the loop as soon as EOB is reached; avoids infloops in redisplay
2080         when IT->position is set up wrongly due to some bug.
2081         Set IT->current to match the bidi iterator unconditionally.
2082         (push_display_prop): Allow GET_FROM_STRING as IT->method on
2083         entry.  Force push_it to save on the stack the current
2084         buffer/string position, to be restored by pop_it.  Fix flags in
2085         the iterator structure wrt the object coming from a display
2086         property, as `line-prefix' and `wrap-prefix' are not ``replacing''
2087         properties.  (Bug#9284)
2089 2011-08-09  Andreas Schwab  <schwab@linux-m68k.org>
2091         * fontset.c (fontset_get_font_group): Add proper type checks.
2092         (Bug#9172)
2094 2011-08-09  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
2096         * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
2097         and LC_VERSION_MIN_MACOSX.
2098         (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
2099         (dump_it) [LC_FUNCTION_STARTS]: Use it.
2101 2011-08-08  Eli Zaretskii  <eliz@gnu.org>
2103         * xdisp.c (forward_to_next_line_start): Allow to use the
2104         no-display-properties-and-no-overlays under bidi display.
2105         Set disp_pos in the bidi iterator to avoid searches for display
2106         properties and overlays.
2108 2011-08-08  Chong Yidong  <cyd@stupidchicken.com>
2110         * editfns.c (Fset_time_zone_rule): Document relationship with the
2111         setenv function.
2113         * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
2114         the font entity extracted from the cache (Bug#8109).
2116 2011-08-07  Chong Yidong  <cyd@stupidchicken.com>
2118         * composite.c (autocmp_chars): Don't reset point.  That is done by
2119         restore_point_unwind (Bug#5984).
2121 2011-08-07  Juri Linkov  <juri@jurta.org>
2123         * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
2124         to show the arg `TIME' instead of `TIMEVAL'.
2126 2011-08-06  Eli Zaretskii  <eliz@gnu.org>
2128         * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
2129         display property strides EOL and includes a newline, as in
2130         longlines-mode.  (Bug#9254)
2131         (move_it_in_display_line_to): Fix vertical-motion in a buffer with
2132         word-wrap under bidirectional display.  (Bug#9224)
2134         * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
2135         is non-zero, even if the data buffer is NULL.  Fixes a crash in
2136         vertical-motion with longlines-mode.  (Bug#9254)
2138 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
2140         * bidi.c <bidi_cache_total_alloc>: Now static.
2141         (bidi_initialize): Initialize bidi_cache_total_alloc.
2143         * xdisp.c (display_line): Release buffer allocated for shelved bidi
2144         cache.  (Bug#9221)
2146         * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
2147         amount allocated this far in `bidi_cache_total_alloc'.
2148         (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
2149         non-zero, only free the data buffer without restoring the cache
2150         contents.  All callers changed.
2152         * dispextern.h (bidi_unshelve_cache): Update prototype.
2154         * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
2155         (move_it_in_display_line, move_it_to)
2156         (move_it_vertically_backward, move_it_by_lines): Replace the call
2157         to xfree to an equivalent call to bidi_unshelve_cache.
2158         (move_it_in_display_line_to): Fix logic of returning
2159         MOVE_POS_MATCH_OR_ZV in the bidi case.  (Bug#9224)
2161 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
2163         * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
2164         came from a string character with a `cursor' property.  (Bug#9229)
2166 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
2168         * Makefile.in (LIB_PTHREAD): New variable.
2169         (LIBES): Add LIB_PTHREAD (Bug#9216).
2171         * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
2172         Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
2174 2011-08-04  Andreas Schwab  <schwab@linux-m68k.org>
2176         * regex.c (re_iswctype): Remove some redundant boolean conversions.
2178 2011-08-04  Jan Djärv  <jan.h.d@swipnet.se>
2180         * xterm.c (x_find_topmost_parent): New function.
2181         (x_set_frame_alpha): Find topmost parent window with
2182         x_find_topmost_parent and set the property there also (bug#9181).
2183         (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
2185 2011-08-04  Paul Eggert  <eggert@cs.ucla.edu>
2187         * callproc.c (Fcall_process): Avoid vfork clobbering
2188         the local vars buffer, coding_systems, current_dir.
2190 2011-08-03  Stefan Monnier  <monnier@iro.umontreal.ca>
2192         * keymap.c (Fmake_composed_keymap): Move to subr.el.
2194 2011-08-03  Paul Eggert  <eggert@cs.ucla.edu>
2196         * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
2197         so that it is not optimized away.
2199         * xdisp.c (compute_display_string_pos): Remove unused local.
2201 2011-08-02  Eli Zaretskii  <eliz@gnu.org>
2203         Fix slow cursor motion and scrolling in large buffers with
2204         selective display, like Org Mode buffers.  (Bug#9218)
2206         * dispextern.h (struct bidi_it): New member disp_prop_p.
2208         * xdisp.c: Remove one-slot cache of display string positions.
2209         (compute_display_string_pos): Accept an additional argument
2210         DISP_PROP_P; callers changed.  Scan at most 5K characters forward
2211         for a display string or property.  If found, set DISP_PROP_P
2212         non-zero.
2214         * bidi.c (bidi_fetch_char): Accept an additional argument
2215         DISP_PROP_P, and pass it to compute_display_string_pos.
2216         Only handle text covered by a display string if DISP_PROP_P is returned
2217         non-zero.  All callers of bidi_fetch_char changed.
2219 2011-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
2221         * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
2223 2010-12-03  Don March  <don@ohspite.net>
2225         * keymap.c (Fdefine_key): Fix non-prefix key error message when
2226         last character M-[char] is translated to ESC [char] (bug#7541).
2228 2011-08-02  Kenichi Handa  <handa@m17n.org>
2230         * lisp.h (uniprop_table): Extern it.
2232         * chartab.c (uniprop_table): Make it non-static.
2234 2011-08-01  Eli Zaretskii  <eliz@gnu.org>
2236         * xdisp.c (forward_to_next_line_start): Accept additional argument
2237         BIDI_IT_PREV, and store into it the state of the bidi iterator had
2238         on the newline.
2239         (reseat_at_next_visible_line_start): Use the bidi iterator state
2240         returned by forward_to_next_line_start to restore the state of
2241         it->bidi_it after backing up to previous newline.  (Bug#9212)
2243 2011-07-30  Andreas Schwab  <schwab@linux-m68k.org>
2245         * regex.c (re_comp): Protoize.
2246         (re_exec): Fix return type.
2247         (regexec): Fix type of `ret'.  (Bug#9203)
2249 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
2251         * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
2252         This is needed if max-image-size is a floating-point number.
2254 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
2256         * print.c (print_object): Print empty symbol as ##.
2258         * lread.c (read1): Read ## as empty symbol.
2260 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
2262         * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
2263         setting frame foreground color (Bug#9175).
2264         (x_set_background_color): Likewise.
2266         * nsmenu.m (-setText): Size tooltip dimensions precisely to
2267         contents (Bug#9176).
2268         (EmacsTooltip -init): Remove bezels and add shadows to
2269         tooltip windows.
2271         * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
2272         or scroll bar (Bug#8470).
2274         * nsfont.m (nsfont_open): Remove assignment to voffset and
2275         unnecessary vars hshink, expand, hd, full_height, min_height.
2276         (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
2278         * nsterm.h (nsfont_info): Remove voffset field.
2280 2011-07-28  Alp Aker  <alp.tekin.aker@gmail.com>
2282         Implement strike-through and overline on NextStep (Bug#8863).
2284         * nsfont.m (nsfont_open): Use underline position provided by font,
2285         instead of hard-coded value of 2.
2286         (nsfont_draw): Call ns_draw_text_decoration instead.
2288         * nsterm.h: Add declaration for ns_draw_text_decoration.
2290         * nsterm.m (ns_draw_text_decoration): New function for drawing
2291         underline, overline, and strike-through.
2292         (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
2293         ns_draw_text_decoration.  Change treatment of cursor drawing to
2294         accommodate underlining, etc.
2296 2011-07-28  Eli Zaretskii  <eliz@gnu.org>
2298         * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
2299         default.
2301 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
2303         * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
2304         Without this fix, if a signal arrives just after memory fills up,
2305         'malloc' might be invoked reentrantly.
2307         * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
2308         In other words, assume that every image size is allowed, on non-X
2309         hosts.  This assumption is probably wrong, but it lets Emacs compile.
2311 2011-07-28  Andreas Schwab  <schwab@linux-m68k.org>
2313         * regex.c (re_iswctype): Convert return values to boolean.
2315 2011-07-28  Eli Zaretskii  <eliz@fencepost.gnu.org>
2317         * xdisp.c (compute_display_string_pos): Don't use cached display
2318         string position if the buffer had its restriction changed.
2319         (Bug#9184)
2321 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
2323         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
2325 2011-07-28  Paul Eggert  <eggert@cs.ucla.edu>
2327         Integer signedness and overflow and related fixes.  (Bug#9079)
2329         * bidi.c: Integer size and overflow fixes.
2330         (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
2331         (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
2332         (bidi_cache_find_level_change, bidi_cache_ensure_space)
2333         (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
2334         (bidi_find_other_level_edge):
2335         Use ptrdiff_t instead of EMACS_INT where either will do.
2336         This works better on 32-bit hosts configured --with-wide-int.
2337         (bidi_cache_ensure_space): Check for size-calculation overflow.
2338         Use % rather than repeated addition, for better worst-case speed.
2339         Don't set bidi_cache_size until after xrealloc returns, because it
2340         might not return.
2341         (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
2342         (bidi_cache_ensure_space): Also check that the bidi cache size
2343         does not exceed that of the largest Lisp string or buffer.  See Eli
2344         Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
2346         * alloc.c (__malloc_size_t): Remove.
2347         All uses replaced by size_t.  See Andreas Schwab's note
2348         <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
2350         * image.c: Improve checking for integer overflow.
2351         (check_image_size): Assume that f is nonnull, since
2352         it is always nonnull in practice.  This is one less thing to
2353         worry about when checking for integer overflow later.
2354         (x_check_image_size): New function, which checks for integer
2355         overflow issues inside X.
2356         (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
2357         This removes the need for a memory_full check.
2358         (xbm_image_p): Rewrite to avoid integer multiplication overflow.
2359         (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
2360         (xbm_read_bitmap_data): Change locals back to 'int', since
2361         their values must fit in 'int'.
2362         (xpm_load_image, png_load, tiff_load):
2363         Invoke x_create_x_image_and_pixmap earlier,
2364         to avoid much needless work if the image is too large.
2365         (tiff_load): Treat overly large images as if
2366         x_create_x_image_and_pixmap failed, not as malloc failures.
2367         (gs_load): Use x_check_image_size.
2369         * gtkutil.c: Omit integer casts.
2370         (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
2371         (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
2373         * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
2375         * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
2376         Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
2377         would wrongly return t on a 64-bit host.
2379         * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
2380         The plain *_OVERFLOW macros run afoul of GCC bug 49705
2381         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
2382         and therefore cause GCC to emit a bogus diagnostic in some cases.
2384         * image.c: Integer signedness and overflow and related fixes.
2385         This is not an exhaustive set of fixes, but it's time to
2386         record what I've got.
2387         (lookup_pixel_color, check_image_size): Remove redundant decls.
2388         (check_image_size): Don't assume that arbitrary EMACS_INT values
2389         fit in 'int', or that arbitrary 'double' values fit in 'int'.
2390         (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
2391         (tiff_load, imagemagick_load_image):
2392         Check for overflow in size calculations.
2393         (x_create_x_image_and_pixmap): Remove unnecessary test for
2394         xmalloc returning NULL; that can't happen.
2395         (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
2396         (xpm_color_bucket): Use better integer hashing function.
2397         (xpm_cache_color): Don't possibly over-allocate memory.
2398         (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
2399         (gif_memory_source):
2400         Use ptrdiff_t, not int or size_t, to record sizes.
2401         (png_load): Don't assume values greater than 2**31 fit in 'int'.
2402         (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
2403         either works, as we prefer signed integers.
2404         (tiff_read_from_memory, tiff_write_from_memory):
2405         Return tsize_t, not size_t, since that's what the TIFF API wants.
2406         (tiff_read_from_memory): Don't fail simply because the read would
2407         go past EOF; instead, return a short read.
2408         (tiff_load): Omit no-longer-needed casts.
2409         (Fimagemagick_types): Don't assume size fits into 'int'.
2411         Improve hashing quality when configured --with-wide-int.
2412         * fns.c (hash_string): New function, taken from sxhash_string.
2413         Do not discard information about ASCII character case; this
2414         discarding is no longer needed.
2415         (sxhash-string): Use it.  Change sig to match it.  Caller changed.
2416         * lisp.h: Declare it.
2417         * lread.c (hash_string): Remove, since we now use fns.c's version.
2418         The fns.c version returns a wider integer if --with-wide-int is
2419         specified, so this should help the quality of the hashing a bit.
2421         * emacs.c: Integer overflow minor fix.
2422         (heap_bss_diff): Now uprintmax_t, not unsigned long.  All used changed.
2423         Define only if GNU_LINUX.
2424         (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
2426         * dispnew.c: Integer signedness and overflow fixes.
2427         Remove unnecessary forward decls, that were a maintenance hassle.
2428         (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
2429         All uses changed.
2430         (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
2431         (scrolling_window): Use ptrdiff_t, not int, for byte count.
2432         (prepare_desired_row, line_draw_cost):
2433         Use int, not unsigned, where either works.
2434         (save_current_matrix, restore_current_matrix):
2435         Use ptrdiff_t, not size_t, where either works.
2436         (init_display): Check for overflow more accurately, and without
2437         relying on undefined behavior.
2439         * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
2440         Remove, replacing with the new symbols in lisp.h.  All uses changed.
2441         * fileio.c (make_temp_name):
2442         * filelock.c (lock_file_1, lock_file):
2443         * xdisp.c (message_dolog):
2444         Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
2445         Use pMd etc. instead.
2446         * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
2447         replacing the pWIDE etc. symbols removed from editfns.c.
2449         * keyboard.h (num_input_events): Now uintmax_t.
2450         This is (very slightly) less likely to mess up due to wraparound.
2451         All uses changed.
2453         * buffer.c: Integer signedness fixes.
2454         (alloc_buffer_text, enlarge_buffer_text):
2455         Use ptrdiff_t rather than size_t when either will do, as we prefer
2456         signed integers.
2458         * alloc.c: Integer signedness and overflow fixes.
2459         Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
2460         (__malloc_size_t): Default to size_t, not to int.
2461         (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
2462         (Fgarbage_collect, mark_object_loop_halt, mark_object):
2463         Prefer ptrdiff_t to size_t when either would do, as we prefer
2464         signed integers.
2465         (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
2466         (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
2467         Now const.  Initialize with values that are in range even if char
2468         is signed.
2469         (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
2470         (xmalloc_put_size, xmalloc_get_size): New functions.  All uses changed.
2471         These functions do the right thing with sizes > 2**32.
2472         (check_depth): Now ptrdiff_t, not int.
2473         (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
2474         Adjust to new way of storing sizes.  Check for size overflow bugs
2475         in rest of code.
2476         (STRING_BYTES_MAX): Adjust to new overheads.  The old code was
2477         slightly wrong anyway, as it missed one instance of
2478         XMALLOC_OVERRUN_CHECK_OVERHEAD.
2479         (refill_memory_reserve): Omit needless cast to size_t.
2480         (mark_object_loop_halt): Mark as externally visible.
2482         * xselect.c: Integer signedness and overflow fixes.
2483         (Fx_register_dnd_atom, x_handle_dnd_message):
2484         Use ptrdiff_t, not size_t, since we prefer signed.
2485         (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
2486         * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
2487         x_dnd_atoms_size and x_dnd_atoms_length.
2489         * doprnt.c: Prefer signed to unsigned when either works.
2490         * eval.c (verror):
2491         * doprnt.c (doprnt):
2492         * lisp.h (doprnt):
2493         * xdisp.c (vmessage):
2494         Use ptrdiff_t, not size_t, when using or implementing doprnt,
2495         since the sizes cannot exceed ptrdiff_t bounds anyway, and we
2496         prefer signed arithmetic to avoid comparison confusion.
2497         * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
2498         but is a bit tricky.
2500         Assume freestanding C89 headers, string.h, stdlib.h.
2501         * data.c, doprnt.c, floatfns.c, print.c:
2502         Include float.h unconditionally.
2503         * gmalloc.c: Assume C89-at-least behavior for preprocessor,
2504         limits.h, stddef.h, string.h.  Use memset instead of 'flood'.
2505         * regex.c: Likewise for stddef.h, string.h.
2506         (ISASCII): Remove; can assume it returns 1 now.  All uses removed.
2507         * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
2508         * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
2509         (STDC_HEADERS): Remove obsolete defines.
2510         * sysdep.c: Include limits.h unconditionally.
2512         Assume support for memcmp, memcpy, memmove, memset.
2513         * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
2514         * regex.c (memcmp, memcpy):
2515         Remove; we assume C89 now.
2517         * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
2518         (__malloc_safe_bcopy): Remove; no longer needed.
2520         * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
2521         Use EMACS_INT, not EMACS_UINT, for sizes.  The code works equally
2522         well either way, and we prefer signed to unsigned.
2524 2011-07-27  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2526         * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
2527         closes the connection while we're reading (bug#9182).
2529 2011-07-25  Jan Djärv  <jan.h.d@swipnet.se>
2531         * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
2532         are specified (Bug#9168).
2534 2011-07-25  Paul Eggert  <eggert@cs.ucla.edu>
2536         * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
2537         Found by GCC static checking and --with-wide-int on a 32-bit host.
2539 2011-07-25  Eli Zaretskii  <eliz@gnu.org>
2541         * xdisp.c (compute_display_string_pos): Fix logic of caching
2542         previous display string position.  Initialize cached_prev_pos to
2543         -1.  Fixes slow-down at the beginning of a buffer.
2545 2011-07-24  Eli Zaretskii  <eliz@gnu.org>
2547         * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
2548         for attrs[LFACE_FONTSET_INDEX].
2550 2011-07-23  Paul Eggert  <eggert@cs.ucla.edu>
2552         * xml.c (parse_region): Remove unused local
2553         that was recently introduced.
2555 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
2557         * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
2558         2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
2560         * xdisp.c (move_it_in_display_line_to): Record the best matching
2561         position for TO_CHARPOS while scanning the line, and restore it on
2562         exit if none of the characters scanned was an exact match.
2563         Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
2564         when exact match is impossible due to invisible text, and the
2565         lines are truncated.
2567 2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
2569         * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
2570         for OSX >= 10.7.
2572 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
2574         Fix a significant slow-down of cursor motion with C-n, C-p,
2575         C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
2576         auto-repeat under bidi redisplay in fontified buffers.
2577         * xdisp.c (compute_stop_pos_backwards): New function.
2578         (next_element_from_buffer): Call compute_stop_pos_backwards to
2579         find a suitable prev_stop when we find ourselves before
2580         base_level_stop.
2581         (reseat): Don't look for prev_stop, as that could mean a very long
2582         run.
2583         <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
2584         <cached_disp_overlay_modiff>: Cache for last found display string
2585         position.
2586         (compute_display_string_pos): Return the cached position if asked
2587         about the same buffer in the same area of character positions, and
2588         the buffer wasn't changed since the time the display string
2589         position was cached.
2591 2011-07-22  Eli Zaretskii  <eliz@gnu.org>
2593         * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
2594         is an integer, which is important for empty lines.  (Bug#9149)
2596 2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
2598         * frame.c (Fmodify_frame_parameters): In tty case, update the
2599         default face if necessary (Bug#4238).
2601 2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
2603         * editfns.c (Fstring_to_char): No need to explain what a character
2604         is in the docstring (Bug#6576).
2606 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2608         * xml.c (parse_region): Make sure we always return a tree.
2610 2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
2612         * xml.c (parse_region): If a document contains only comments,
2613         return that, too.
2615 2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2617         * xml.c (make_dom): Return comments, too.
2619 2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
2621         Port to OpenBSD.
2622         See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
2623         and the surrounding thread.
2624         * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
2625         rather than fgets, and retry after EINTR.  Otherwise, 'emacs
2626         --batch -f byte-compile-file' fails on OpenBSD if an inactivity
2627         timer goes off.
2628         * s/openbsd.h (BROKEN_SIGIO): Define.
2629         * unexelf.c (unexec) [__OpenBSD__]:
2630         Don't update the .mdebug section of the Alpha COFF symbol table.
2632 2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2634         * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
2635         (bug#8460).
2637 2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
2639         * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
2640         This fixes some race conditions on the permissions of any newly
2641         created file.
2643         * alloc.c (valid_pointer_p): Use pipe, not open.
2644         This fixes some permissions issues when debugging.
2646         * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
2647         If fchown fails to set both uid and gid, try to set just gid,
2648         as that is sometimes allowed.  Adjust the file's mode to eliminate
2649         setuid or setgid bits that are inappropriate if fchown fails.
2651 2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
2653         * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
2654         to compare Lisp_Objects.
2655         * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
2656         global_gnutls_log_level, don't mistake it for a Lisp_Object.
2657         (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
2659 2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
2661         * lread.c (read_integer): Unread even EOF character.
2662         (read1): Likewise.  Properly record start position of symbol.
2664         * lread.c (read1): Read `#:' as empty uninterned symbol if no
2665         symbol character follows.
2667 2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
2669         * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
2670         This works around a problem with the previous change to Fcopy_file.
2671         Recent glibc declares fchown with __attribute__((warn_unused_result)),
2672         and without this change, GCC might complain about discarding
2673         fchown's return value.
2675 2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
2677         * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
2679 2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
2681         * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
2683 2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2685         * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
2686         it's used from the C level.
2688         * process.c: Use the same condition for POLL_FOR_INPUT in both
2689         keyboard.c and process.c (bug#1858).
2691 2011-07-09  Lawrence Mitchell  <wence@gmx.li>
2693         * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
2694         (Fgnutls_boot): Use it.
2696 2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
2698         * doc.c (Fsubstitute_command_keys): Revert last change.
2700 2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2702         * doc.c (Fsubstitute_command_keys): Clarify that \= really only
2703         quotes the next character, and doesn't affect other longer
2704         sequences (bug#8935).
2706         * lread.c (syms_of_lread): Clarify that is isn't only
2707         `eval-buffer' and `eval-defun' that's affected by
2708         `lexical-binding' (bug#8460).
2710 2011-07-15  Eli Zaretskii  <eliz@gnu.org>
2712         * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
2713         bidi redisplay when a line includes both an image and is truncated.
2715 2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
2717         Fix minor problems found by static checking.
2718         * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
2719         (elsz): Now a signed constant, not a size_t var.  We prefer signed
2720         types to unsigned, to avoid integer comparison confusion.  Without
2721         this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
2722         "cannot optimize loop, the loop counter may overflow", a symptom
2723         of the confusion.
2724         * indent.c (Fvertical_motion): Mark locals as initialized.
2725         * xdisp.c (reseat_to_string): Fix pointer signedness issue.
2727 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2729         * search.c (Fre_search_backward): Mention `case-fold-search' in
2730         all the re_search_* functions (bug#8138).
2732         * keyboard.c (Fopen_dribble_file): Document when the file is
2733         closed (bug#8056).
2735 2011-07-14  Eli Zaretskii  <eliz@gnu.org>
2737         * bidi.c (bidi_dump_cached_states): Fix format of displaying
2738         bidi_cache_idx.
2740         Support bidi reordering of display and overlay strings.
2741         * xdisp.c (compute_display_string_pos)
2742         (compute_display_string_end): Accept additional argument STRING.
2743         (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
2744         (reseat_to_string): Initialize bidi_it->string.s and
2745         bidi_it->string.schars.
2746         (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
2747         NULL (avoids a crash in bidi_paragraph_init).
2748         Initialize itb.string.lstring.
2749         (init_iterator): Call bidi_init_it only of a valid
2750         buffer position was specified.  Initialize paragraph_embedding to
2751         L2R.
2752         (reseat_to_string): Initialize the bidi iterator.
2753         (display_string): If we need to ignore text properties of
2754         LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
2755         original value of -1 will not work with bidi.)
2756         (compute_display_string_pos): First arg is now struct
2757         `text_pos *'; all callers changed.  Support display properties on
2758         Lisp strings.
2759         (compute_display_string_end): Support display properties on Lisp
2760         strings.
2761         (init_iterator, reseat_1, reseat_to_string): Initialize the
2762         string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
2763         when iterating on a string not from display properties).
2764         (compute_display_string_pos, compute_display_string_end):
2765         Fix calculation of the object to scan.  Fixes an error when using
2766         arrow keys.
2767         (next_element_from_buffer): Don't abort when IT_CHARPOS is before
2768         base_level_stop; instead, set base_level_stop to BEGV.
2769         Fixes crashes in vertical-motion.
2770         (next_element_from_buffer): Improve commentary for when
2771         the iterator is before prev_stop.
2772         (init_iterator): Initialize bidi_p from the default value of
2773         bidi-display-reordering, not from buffer-local value.  Use the
2774         buffer-local value only if initializing for buffer iteration.
2775         (handle_invisible_prop): Support invisible properties on strings
2776         that are being bidi-reordered.
2777         (set_iterator_to_next): Support bidi reordering of C strings and
2778         Lisp strings.
2779         (next_element_from_string): Support bidi reordering of Lisp
2780         strings.
2781         (handle_stop_backwards): Support Lisp strings as well.
2782         (display_string): Support display of R2L glyph rows.
2783         Use IT_STRING_CHARPOS when displaying from a Lisp string.
2784         (init_iterator): Don't initialize it->bidi_p for strings
2785         here.
2786         (reseat_to_string): Initialize it->bidi_p for strings here.
2787         (next_element_from_string, next_element_from_c_string)
2788         (next_element_from_buffer): Add xassert's for correspondence
2789         between IT's object being iterated and it->bidi_it.string
2790         structure.
2791         (face_before_or_after_it_pos): Support bidi iteration.
2792         (next_element_from_c_string): Handle the case of the first string
2793         character that is not the first one in the visual order.
2794         (get_visually_first_element): New function, refactored from common
2795         parts of next_element_from_buffer, next_element_from_string, and
2796         next_element_from_c_string.
2797         (tool_bar_lines_needed, redisplay_tool_bar)
2798         (display_menu_bar): Force left-to-right direction.  Add a FIXME
2799         comment for making that be controlled by a user option.
2800         (push_it, pop_it): Save and restore the state of the
2801         bidi iterator.  Save and restore the bidi_p flag.
2802         (pop_it): Iterate out of display property for string iteration as
2803         well.
2804         (iterate_out_of_display_property): Support iteration over strings.
2805         (handle_single_display_spec): Set up it->bidi_it for iteration
2806         over a display string, and call bidi_init_it.
2807         (handle_single_display_spec, next_overlay_string)
2808         (get_overlay_strings_1, push_display_prop): Set up the bidi
2809         iterator for displaying display or overlay strings.
2810         (forward_to_next_line_start): Don't use the shortcut if
2811         bidi-iterating.
2812         (back_to_previous_visible_line_start): If handle_display_prop
2813         pushed the iterator stack, restore the internal state of the bidi
2814         iterator by calling bidi_pop_it same number of times.
2815         (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
2816         and we are bidi-iterating, don't decrement the iterator position;
2817         instead, set the first_elt flag in the bidi iterator, to produce
2818         the same effect.
2819         (reseat_1): Remove redundant setting of string_from_display_prop_p.
2820         (push_display_prop): xassert that we are iterating a buffer.
2821         (push_it, pop_it): Save and restore paragraph_embedding member.
2822         (handle_single_display_spec, next_overlay_string)
2823         (get_overlay_strings_1, reseat_1, reseat_to_string)
2824         (push_display_prop): Set up the `unibyte' member of bidi_it.string
2825         correctly.  Don't assume unibyte strings are not bidi-reordered.
2826         (compute_display_string_pos)
2827         (compute_display_string_end): Fix handling the case of C string.
2828         (push_it, pop_it): Save and restore from_disp_prop_p.
2829         (handle_single_display_spec, push_display_prop): Set the
2830         from_disp_prop_p flag.
2831         (get_overlay_strings_1): Reset the from_disp_prop_p flag.
2832         (pop_it): Call iterate_out_of_display_property only if we are
2833         popping after iteration over a string that came from a display
2834         property.  Fix a typo in popping stretch info.  Add an assertion
2835         for verifying that the iterator position is in sync with the bidi
2836         iterator.
2837         (handle_single_display_spec, get_overlay_strings_1)
2838         (push_display_prop): Fix initialization of paragraph direction for
2839         string when that of the parent object is not yet determined.
2840         (reseat_1): Call bidi_init_it to resync the bidi
2841         iterator with IT's position.  (Bug#7616)
2842         (find_row_edges): If ROW->start.pos gives position
2843         smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
2844         (handle_stop, back_to_previous_visible_line_start, reseat_1):
2845         Reset the from_disp_prop_p flag.
2846         (SAVE_IT, RESTORE_IT): New macros.
2847         (pos_visible_p, face_before_or_after_it_pos)
2848         (back_to_previous_visible_line_start)
2849         (move_it_in_display_line_to, move_it_in_display_line)
2850         (move_it_to, move_it_vertically_backward, move_it_by_lines)
2851         (try_scrolling, redisplay_window, display_line): Use them when
2852         saving a temporary copy of the iterator and restoring it back.
2853         (back_to_previous_visible_line_start, reseat_1)
2854         (init_iterator): Empty the bidi cache "stack".
2855         (move_it_in_display_line_to): If iterator ended up at
2856         EOL, but we never saw any buffer positions smaller than
2857         to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
2858         motion in bidi-reordered lines.
2859         (move_it_in_display_line_to): Record prev_method and prev_pos
2860         immediately before the call to set_iterator_to_next.  Fixes cursor
2861         motion in bidi-reordered lines with stretch glyphs and strings
2862         displayed in margins.  (Bug#8133) (Bug#8867)
2863         Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
2864         TO_CHARPOS.
2865         (pos_visible_p): Support positions in bidi-reordered lines.
2866         Save and restore bidi cache.
2868         * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
2869         (bidi_paragraph_info): Delete unused struct.
2870         (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
2871         (bidi_cache_start): New variable.
2872         (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
2873         to zero.
2874         (bidi_cache_fetch_state, bidi_cache_search)
2875         (bidi_cache_find_level_change, bidi_cache_iterator_state)
2876         (bidi_cache_find, bidi_peek_at_next_level)
2877         (bidi_level_of_next_char, bidi_find_other_level_edge)
2878         (bidi_move_to_visually_next): Compare cache index with
2879         bidi_cache_start rather than with zero.
2880         (bidi_fetch_char): Accept new argument STRING; all callers
2881         changed.  Support iteration over a string.  Support strings with
2882         display properties.  Support unibyte strings.  Fix the type of
2883         `len' according to what STRING_CHAR_AND_LENGTH expects.
2884         (bidi_paragraph_init, bidi_resolve_explicit_1)
2885         (bidi_resolve_explicit, bidi_resolve_weak)
2886         (bidi_level_of_next_char, bidi_move_to_visually_next):
2887         Support iteration over a string.
2888         (bidi_set_sor_type, bidi_resolve_explicit_1)
2889         (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
2890         can now be zero (for strings); special values 0 and -1 were
2891         changed to -1 and -2, respectively.
2892         (bidi_char_at_pos): New function.
2893         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
2894         Call it instead of FETCH_MULTIBYTE_CHAR.
2895         (bidi_move_to_visually_next): Abort if charpos or bytepos were not
2896         initialized to valid values.
2897         (bidi_init_it): Don't initialize charpos and bytepos with invalid
2898         values.
2899         (bidi_level_of_next_char): Allow the sentinel "position" to pass
2900         the test for valid cached positions.  Fix the logic for looking up
2901         the sentinel state in the cache.  GCPRO the Lisp string we are
2902         iterating.
2903         (bidi_push_it, bidi_pop_it): New functions.
2904         (bidi_initialize): Initialize the bidi cache start stack pointer.
2905         (bidi_cache_ensure_space): New function, refactored from part of
2906         bidi_cache_iterator_state.  Don't assume the required size is just
2907         one BIDI_CACHE_CHUNK away.
2908         (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
2909         (bidi_count_bytes, bidi_char_at_pos): New functions.
2910         (bidi_cache_search): Don't assume bidi_cache_last_idx is
2911         always valid if bidi_cache_idx is valid.
2912         (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
2913         is valid if it's going to be used.
2914         (bidi_shelve_cache, bidi_unshelve_cache): New functions.
2915         (bidi_cache_fetch_state, bidi_cache_search)
2916         (bidi_cache_find_level_change, bidi_cache_ensure_space)
2917         (bidi_cache_iterator_state, bidi_cache_find)
2918         (bidi_find_other_level_edge, bidi_cache_start_stack):
2919         All variables related to cache indices are now EMACS_INT.
2921         * dispextern.h (struct bidi_string_data): New structure.
2922         (struct bidi_it): New member `string'.  Make flag members be 1-bit
2923         fields, and put them last in the struct.
2924         (compute_display_string_pos, compute_display_string_end):
2925         Update prototypes.
2926         (bidi_push_it, bidi_pop_it): Add prototypes.
2927         (struct iterator_stack_entry): New members bidi_p,
2928         paragraph_embedding, and from_disp_prop_p.
2929         (struct it): Member bidi_p is now a bit field 1 bit wide.
2930         (bidi_shelve_cache, bidi_unshelve_cache):
2931         Declare prototypes.
2933         * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
2934         (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
2935         and vector-like objects.
2937         * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
2938         cache around display iteration.
2940         * window.c (Fwindow_end, window_scroll_pixel_based)
2941         (displayed_window_lines, Frecenter): Save and restore the bidi
2942         cache around display iteration.
2944 2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2946         * editfns.c (Fdelete_region): Clarify the use of the named
2947         parameters (bug#6788).
2949 2011-07-14  Martin Rudalics  <rudalics@gmx.at>
2951         * indent.c (Fvertical_motion): Set and restore w->pointm when
2952         saving and restoring the window's buffer (Bug#9006).
2954 2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2956         * editfns.c (Fstring_to_char): Clarify just what is returned
2957         (bug#6576).  Text by Eli Zaretskii.
2959 2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
2961         * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
2963 2011-07-13  Eli Zaretskii  <eliz@gnu.org>
2965         * buffer.c (mmap_find): Fix a typo.
2967 2011-07-13  Johan Bockgård  <bojohan@gnu.org>
2969         Fix execution of x selection hooks.
2970         * xselect.c (Qx_lost_selection_functions)
2971         (Qx_sent_selection_functions): New vars.
2972         (syms_of_xselect): DEFSYM them.
2973         (x_handle_selection_request): Pass Qx_sent_selection_functions
2974         rather than Vx_sent_selection_functions to Frun_hook_with_args.
2975         (x_handle_selection_clear,x_clear_frame_selections):
2976         Pass Qx_lost_selection_functions rather than
2977         Vx_lost_selection_functions to Frun_hook_with_args.
2979 2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
2981         * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2982         The old code sometimes used this field without initializing it.
2984         * alloc.c (gc_sweep): Don't read past end of array.
2985         In theory, the old code could also have corrupted Emacs internals,
2986         though it'd be very unlikely.
2988 2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
2990         * character.c (Fcharacterp): Don't advertise optional ignored
2991         argument.  (Bug#4026)
2993 2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
2995         * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
2996         key" (bug#4257).
2998         * window.c (Fset_window_start): Doc fix (bug#4199).
2999         (Fset_window_hscroll): Ditto.
3001 2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
3003         Fix minor new problems caught by GCC 4.6.1.
3004         * term.c (init_tty): Remove unused local.
3005         * xsettings.c (store_monospaced_changed): Define this function only
3006         if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
3007         not used otherwise.
3009 2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
3011         * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
3013 2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
3015         * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
3016         are the mini-buffer and the echo area (bug#3320).
3018         * term.c (init_tty): Remove support for supdup, c10 and perq
3019         terminals, which are no longer supported (bug#1482).
3021 2011-07-10  Johan Bockgård  <bojohan@gnu.org>
3023         * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
3025 2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
3027         * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
3028         for non-popups (Bug#3642).
3030 2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
3032         * alloc.c (reset_malloc_hooks): Protoize.
3033         * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
3034         (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
3035         * cm.c (losecursor): Likewise.
3036         * data.c (fmod): Likewise.
3037         * dispnew.c (swap_glyphs_in_rows): Likewise.
3038         * emacs.c (memory_warning_signal): Likewise.
3039         * floatfns.c (float_error): Likewise.
3040         * font.c (check_gstring, check_otf_features, otf_tag_symbol)
3041         (otf_open, font_otf_capability, generate_otf_features)
3042         (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
3043         Likewise.
3044         * image.c (pbm_read_file): Likewise.
3045         * indent.c (string_display_width): Likewise.
3046         * intervals.c (check_for_interval, search_for_interval)
3047         (inc_interval_count, count_intervals, root_interval)
3048         (adjust_intervals_for_insertion, make_new_interval): Likewise.
3049         * lread.c (defalias): Likewise.
3050         * ralloc.c (r_alloc_check): Likewise.
3051         * regex.c (set_image_of_range_1, set_image_of_range)
3052         (regex_grow_registers): Likewise.
3053         * sysdep.c (strerror): Likewise.
3054         * termcap.c (valid_filename_p, tprint, main): Likewise.
3055         * tparam.c (main): Likewise.
3056         * unexhp9k800.c (run_time_remap, save_data_space)
3057         (update_file_ptrs, read_header, write_header, calculate_checksum)
3058         (copy_file, copy_rest, display_header): Likewise.
3059         * widget.c (mark_shell_size_user_specified, create_frame_gcs):
3060         Likewise.
3061         * xdisp.c (check_it): Likewise.
3062         * xfaces.c (register_color, unregister_color, unregister_colors):
3063         Likewise.
3064         * xfns.c (print_fontset_result): Likewise.
3065         * xrdb.c (member, fatal, main): Likewise.
3067 2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
3069         Fix minor problems found by static checking (Bug#9031).
3070         * chartab.c (char_table_set_range, map_sub_char_table):
3071         Remove unused locals.
3072         (uniprop_table): Now static.
3073         * composite.c (_work_char): Remove unused static var.
3075 2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
3077         * chartab.c (uniprop_table_uncompress): Remove unused local variable.
3079 2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
3081         * gtkutil.c (qttip_cb): Remove code without function.
3083 2011-07-09  Eli Zaretskii  <eliz@gnu.org>
3085         * w32.c (pthread_sigmask): New stub.
3087 2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
3089         Use pthread_sigmask, not sigprocmask (Bug#9010).
3090         sigprocmask is portable only for single-threaded applications, and
3091         Emacs can be multi-threaded when it uses GTK.
3092         * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
3093         (LIBES): Use it.
3094         * callproc.c (Fcall_process):
3095         * process.c (create_process):
3096         * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
3097         Use pthread_sigmask, not sigprocmask.
3099 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
3101         * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
3102         (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
3103         wrong (Bug#8591).
3105 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
3107         * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
3108         Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
3109         (xg_hide_tooltip): Fix comment.
3111         * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
3112         in registerServicesMenuSendTypes.
3113         (validRequestorForSendType): Don't check ns_return_types.
3115         * nsfns.m (Fx_open_connection): Put NSStringPboardType into
3116         ns_return_type.
3118 2011-07-08  Jason Rumney  <jasonr@gnu.org>
3120         * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
3121         SH_SHOW for hidden windows (Bug#5482).
3123         * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
3124         frame struct members of non-existent frames (Bug#6284).
3126 2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
3128         * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
3129         variable firstTime not needed on OSX >= 10.6.
3130         (setPosition): setFloatValue:knobProportion: is deprecated on OSX
3131         >= 10.5.  Use setKnobProportion, setDoubleValue.
3133         * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
3134         (MAC_OS_X_VERSION_10_5): Define if not defined.
3135         (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
3136         (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
3137         (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
3139         * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
3140         cString and lossyCString on OSX >= 10.4
3142         * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
3143         sizeToFit on OSX >= 10.2.
3145         * nsimage.m (allocInitFromFile): Don't use deprecated method
3146         bestRepresentationForDevice on OSX >= 10.6.
3148         * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
3149         to avoid warning.
3151         * emacs.c: Declare unexec_init_emacs_zone.
3153         * nsgui.h: Fix compiler warning about gnulib redefining verify.
3155         * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
3157         * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
3158         on svcsMenu (Bug#8842).
3160         * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
3161         ns_return_types.
3162         (Fns_list_services): Just return Qnil on 10.6, code not working there.
3164         * nsterm.m (QUTF8_STRING): Declare.
3165         (initFrameFromEmacs): Call registerServicesMenuSendTypes.
3166         (validRequestorForSendType): Return type is (id).
3167         Change indexOfObjectIdenticalTo to indexOfObject.
3168         Check if we have local selection before returning self (Bug#8842).
3169         (writeSelectionToPasteboard): Put local selection into paste board
3170         if we have a local selection (Bug#8842).
3171         (syms_of_nsterm): DEFSYM QUTF8_STRING.
3173         * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
3174         (ns_get_local_selection): Declare.
3176 2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
3178         * keymap.c (describe_map_tree): Don't insert a double newline at
3179         the end of the buffer (bug#1169) and return whether we inserted
3180         something.
3182         * callint.c (Fcall_interactively): Change "reading args" to
3183         "providing args" to try to clarify what it does (bug#1010).
3185 2011-07-07  Kenichi Handa  <handa@m17n.org>
3187         * composite.c (composition_compute_stop_pos): Ignore a static
3188         composition starting before CHARPOS (Bug#8915).
3190         * xdisp.c (handle_composition_prop): Likewise.
3192 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
3194         * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
3195         (Bug#9015)
3197 2011-07-07  Kenichi Handa  <handa@m17n.org>
3199         * character.h (unicode_category_t): New enum type.
3201         * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
3202         (Qchar_code_property_table): New variable.
3203         (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
3204         (UNIPROP_COMPRESSED_FORM_P): New macros.
3205         (char_table_ascii): Uncompress the compressed values.
3206         (sub_char_table_ref): New arg is_uniprop.  Callers changed.
3207         Uncompress the compressed values.
3208         (sub_char_table_ref_and_range): Likewise.
3209         (char_table_ref_and_range): Uncompress the compressed values.
3210         (sub_char_table_set): New arg is_uniprop.  Callers changed.
3211         Uncompress the compressed values.
3212         (sub_char_table_set_range): Args changed.  Callers changed.
3213         (char_table_set_range): Adjuted for the above change.
3214         (map_sub_char_table): Delete args default_val and parent.  Add arg
3215         top.  Give decoded values to a Lisp function.
3216         (map_char_table): Adjust for the above change.  Give decoded
3217         values to a Lisp function.  Gcpro more variables.
3218         (uniprop_table_uncompress)
3219         (uniprop_decode_value_run_length): New functions.
3220         (uniprop_decoder, uniprop_decoder_count): New variables.
3221         (uniprop_get_decoder, uniprop_encode_value_character)
3222         (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
3223         New functions.
3224         (uniprop_encoder, uniprop_encoder_count): New variables.
3225         (uniprop_get_encoder, uniprop_table)
3226         (Funicode_property_table_internal, Fget_unicode_property_internal)
3227         (Fput_unicode_property_internal): New functions.
3228         (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
3229         Sunicode_property_table_internal, Sget_unicode_property_internal,
3230         and Sput_unicode_property_internal.  Defvar_lisp
3231         char-code-property-alist.
3233         * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
3234         Vunicode_category_table.
3236         * font.c (font_range): Adjust for the change of
3237         Vunicode_category_table.
3239 2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
3241         * m/iris4d.h: Remove file, move contents ...
3242         * s/irix6-5.h: ... here.
3244 2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
3246         Remove unportable assumption about struct layout (Bug#8884).
3247         * alloc.c (mark_buffer):
3248         * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
3249         (clone_per_buffer_values): Don't assume that
3250         sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
3251         This isn't true in general, and it's particularly not true
3252         if Emacs is configured with --with-wide-int.
3253         * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
3254         New macros, used in the buffer.c change.
3256 2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
3258         * xsettings.c: Use both GConf and GSettings if both are available.
3259         (store_config_changed_event): Add comment.
3260         (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
3261         (store_tool_bar_style_changed): New functions.
3262         (store_monospaced_changed): Add comment.  Call dpyinfo_valid.
3263         (struct xsettings): Move font inside HAVE_XFT.
3264         (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
3265         (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
3266         Move inside HAVE_XFT.
3267         (something_changed_gsettingsCB): Rename from something_changedCB.
3268         Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
3269         also.
3270         (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
3271         (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT.  Move inside HAVE_XFT.
3272         (something_changed_gconfCB): Rename from something_changedCB.
3273         Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
3274         (parse_settings): Move check for font inside HAVE_XFT.
3275         (read_settings, apply_xft_settings): Add comment.
3276         (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
3277         store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
3278         call store_font_name_changed.
3279         (xft_settings_event): Add comment.
3280         (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
3281         and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
3282         (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
3283         and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
3284         (xsettings_initialize): Call init_gsettings last.
3285         (xsettings_get_system_font, xsettings_get_system_normal_font):
3286         Add comment.
3288 2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
3290         Random fixes.  E.g., (random) never returned negative values.
3291         * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
3292         subseconds part to the entropy, as that's a bit more random.
3293         Prefer signed to unsigned, since the signedness doesn't matter and
3294         in general we prefer signed.  When given a limit, use a
3295         denominator equal to INTMASK + 1, not to VALMASK + 1, because the
3296         latter isn't right if USE_2_TAGS_FOR_INTS.
3297         * sysdep.c (get_random): Return a value in the range 0..INTMASK,
3298         not 0..VALMASK.  Don't discard "excess" bits that random () returns.
3300 2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
3302         * textprop.c (text_property_stickiness):
3303         Obey Vtext_property_default_nonsticky.
3304         (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
3305         * w32fns.c (syms_of_w32fns):
3306         * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
3308 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
3310         * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
3311         This is more efficient than Ffile_directory_p and avoids a minor race.
3313 2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
3315         * buffer.c (Foverlay_put): Say what the return value is
3316         (bug#7835).
3318         * fileio.c (barf_or_query_if_file_exists): Check first if the file
3319         is a directory before asking whether to use the file name
3320         (bug#7564).
3321         (barf_or_query_if_file_exists): Make the "File is a directory"
3322         error be more correct.
3324         * fns.c (Frequire): Remove the mention of the .gz files, since
3325         that's installation-specific, but keep the mention of
3326         `get-load-suffixes'.
3328 2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
3330         * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
3331         Report string overflow if the output is too long.
3333 2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
3335         * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
3336         (syms_of_gnutls): Remove duplicate DEFSYM for
3337         Qgnutls_bootprop_verify_hostname_error, an error for
3338         Qgnutls_bootprop_verify_error (which is no longer used).
3340         * eval.c (find_handler_clause): Remove parameters `sig' and `data',
3341         unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
3342         Also (re)move comments that are misplaced or no longer relevant.
3344 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
3346         * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
3348 2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
3350         * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
3351         and background color parameters if they have been changed.
3353 2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
3355         * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
3357 2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
3359         * xsettings.c (SYSTEM_FONT): Define only when used.
3360         No need to define when HAVE_GSETTINGS || !HAVE_XFT.
3362         * keymap.c (access_keymap_1): Now static.
3364 2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
3366         * keyboard.c (command_loop_1): If a down-mouse event is unbound,
3367         leave any prefix arg for the up event (Bug#1586).
3369 2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
3371         * lread.c (syms_of_lread): Mention single symbols defined by
3372         `defvar' or `defconst' (bug#7154).
3374         * fns.c (Frequire): Mention .el.gz files (bug#7314).
3375         (Frequire): Mention get-load-suffixes.
3377 2011-07-02  Martin Rudalics  <rudalics@gmx.at>
3379         * window.h (window): Remove clone_number slot.
3380         * window.c (Fwindow_clone_number, Fset_window_clone_number):
3381         Remove.
3382         (make_parent_window, make_window, saved_window)
3383         (Fset_window_configuration, save_window_save): Don't deal with
3384         clone numbers.
3385         * buffer.c (Qclone_number): Remove declaration.
3386         (sort_overlays, overlay_strings): Don't deal with clone numbers.
3388 2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
3390         Add multiple inheritance to keymaps.
3391         * keymap.c (Fmake_composed_keymap): New function.
3392         (Fset_keymap_parent): Simplify.
3393         (fix_submap_inheritance): Remove.
3394         (access_keymap_1): New function extracted from access_keymap to handle
3395         embedded parents and handle lists of maps.
3396         (access_keymap): Use it.
3397         (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
3398         (Fcopy_keymap): Handle embedded parents.
3399         (Fcommand_remapping, define_as_prefix): Simplify.
3400         (Fkey_binding): Simplify.
3401         (syms_of_keymap): Move minibuffer-local-completion-map,
3402         minibuffer-local-filename-completion-map,
3403         minibuffer-local-must-match-map, and
3404         minibuffer-local-filename-must-match-map to Elisp.
3405         (syms_of_keymap): Defsubr make-composed-keymap.
3406         * keyboard.c (menu_bar_items): Use map_keymap_canonical.
3407         (parse_menu_item): Trivial simplification.
3409 2011-07-01  Glenn Morris  <rgm@gnu.org>
3411         * Makefile.in (SETTINGS_LIBS): Fix typo.
3413 2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny patch)
3415         * coding.c (Fencode_coding_string): Record the last coding system
3416         used, as the function doc string says (bug#8738).
3418 2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
3420         * xsettings.c (store_monospaced_changed): Take new font as arg and
3421         check for change against current_mono_font.
3422         (EMACS_TYPE_SETTINGS): Remove this and related defines.
3423         (emacs_settings_constructor, emacs_settings_get_property)
3424         (emacs_settings_set_property, emacs_settings_class_init)
3425         (emacs_settings_init, gsettings_obj): Remove.
3426         (something_changedCB): New function for HAVE_GSETTINGS.
3427         (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
3428         with value as argument.
3429         (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
3430         g_settings_new (Bug#8967).  Do not create gsettings_obj.
3431         Remove calls to g_settings_bind.  Connect something_changedCB to
3432         "changed".
3434         * xgselect.c: Add defined (HAVE_GSETTINGS).
3435         (xgselect_initialize): Ditto.
3437         * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
3438         (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
3439         xg_select.
3441 2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
3443         * eval.c (struct backtrace): Simplify and port the data structure.
3444         Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
3445         signed bit field, as this assumption is not portable and it makes
3446         Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
3447         "char debug_on_exit : 1" as this is not portable either; instead,
3448         use the portable "unsigned int debug_on_exit : 1".  Remove unused
3449         member evalargs.  Remove obsolete comments about cc bombing out.
3451 2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
3453         * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
3454         Let HAVE_GSETTINGS override HAVE_GCONF.
3455         (store_monospaced_changed): New function.
3456         (EMACS_SETTINGS): A new type derived from GObject to handle
3457         GSettings notifications.
3458         (emacs_settings_constructor, emacs_settings_get_property)
3459         (emacs_settings_set_property, emacs_settings_class_init):
3460         New functions.
3461         (gsettings_client, gsettings_obj): New variables.
3462         (GSETTINGS_SCHEMA): New define.
3463         (something_changedCB): Call store_monospaced_changed.
3464         (init_gsettings): New function.
3465         (xsettings_initialize): Call init_gsettings.
3466         (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
3467         to NULL.
3469         * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
3470         GCONF_CFLAGS/LIBS.
3472 2011-06-29  Martin Rudalics  <rudalics@gmx.at>
3474         * window.c (resize_root_window, grow_mini_window)
3475         (shrink_mini_window): Rename Qresize_root_window to
3476         Qwindow_resize_root_window and Qresize_root_window_vertically to
3477         Qwindow_resize_root_window_vertically.
3479 2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
3481         * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
3483 2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
3485         * makefile.w32-in: Redesign dependencies so they reflect more
3486         clearly which files are directly included by each source file,
3487         and not through other includes.
3489 2011-06-27  Martin Rudalics  <rudalics@gmx.at>
3491         * buffer.c (Qclone_number): Declare static and DEFSYM it.
3492         (sort_overlays, overlay_strings): When an overlay's clone number
3493         matches the window's clone number process the overlay even if
3494         the overlay's window property doesn't match the current window.
3496         * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
3497         (Fwindow_hchild): Rename to Fwindow_left_child.
3498         (Fwindow_next): Rename to Fwindow_next_sibling.
3499         (Fwindow_prev): Rename to Fwindow_prev_sibling.
3500         (resize_window_check): Rename to window_resize_check.
3501         (resize_window_apply): Rename to window_resize_apply.
3502         (Fresize_window_apply): Rename to Fwindow_resize_apply.
3503         (Fdelete_other_windows_internal, resize_frame_windows)
3504         (Fsplit_window_internal, Fdelete_window_internal)
3505         (grow_mini_window, shrink_mini_window)
3506         (Fresize_mini_window_internal): Fix callers accordingly.
3508 2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
3510         * emacsgtkfixed.h: State that this is only used with Gtk+3.
3511         (emacs_fixed_set_min_size): Remove.
3512         (emacs_fixed_new): Take frame as argument.
3514         * emacsgtkfixed.c: State that this is only used with Gtk+3.
3515         (_EmacsFixedPrivate): Remove minwidth/height.
3516         Add struct frame *f.
3517         (emacs_fixed_init): Initialize priv->f.
3518         (get_parent_class, emacs_fixed_set_min_size): Remove.
3519         (emacs_fixed_new): Set priv->f to argument.
3520         (emacs_fixed_get_preferred_width)
3521         (emacs_fixed_get_preferred_height): Use min_width/height from
3522         frames size_hint to set minimum and natural (Bug#8919).
3523         (XSetWMSizeHints, XSetWMNormalHints): Override these functions
3524         and use min_width/height from frames size_hint to set
3525         min_width/height (Bug#8919).
3527         * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
3528         (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
3529         Fix indentation.
3531 2011-06-26  Eli Zaretskii  <eliz@gnu.org>
3533         * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
3534         bidi_at_paragraph_end, since fast_looking_at doesn't like to be
3535         called at ZV.
3537 2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
3539         * process.c (wait_reading_process_output): Bypass select if
3540         waiting for a cell while ignoring keyboard input, and input is
3541         pending.  Suggested by Jan Djärv (Bug#8869).
3543 2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
3545         Use gnulib's dup2 module instead of rolling our own.
3546         * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
3548 2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
3550         * dispnew.c (scrolling_window): Before scrolling, turn off a
3551         mouse-highlight in the window being scrolled.
3553 2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
3555         Move DEFSYM to lisp.h and use everywhere.
3557         * character.h (DEFSYM): Move declaration...
3558         * lisp.h (DEFSYM): ...here.
3560         * gnutls.c:
3561         * minibuf.c:
3562         * w32menu.c:
3563         * w32proc.c:
3564         * w32select.c: Don't include character.h.
3566         * alloc.c (syms_of_alloc):
3567         * buffer.c (syms_of_buffer):
3568         * bytecode.c (syms_of_bytecode):
3569         * callint.c (syms_of_callint):
3570         * casefiddle.c (syms_of_casefiddle):
3571         * casetab.c (init_casetab_once):
3572         * category.c (init_category_once, syms_of_category):
3573         * ccl.c (syms_of_ccl):
3574         * cmds.c (syms_of_cmds):
3575         * composite.c (syms_of_composite):
3576         * dbusbind.c (syms_of_dbusbind):
3577         * dired.c (syms_of_dired):
3578         * dispnew.c (syms_of_display):
3579         * doc.c (syms_of_doc):
3580         * editfns.c (syms_of_editfns):
3581         * emacs.c (syms_of_emacs):
3582         * eval.c (syms_of_eval):
3583         * fileio.c (syms_of_fileio):
3584         * fns.c (syms_of_fns):
3585         * frame.c (syms_of_frame):
3586         * fringe.c (syms_of_fringe):
3587         * insdel.c (syms_of_insdel):
3588         * keymap.c (syms_of_keymap):
3589         * lread.c (init_obarray, syms_of_lread):
3590         * macros.c (syms_of_macros):
3591         * msdos.c (syms_of_msdos):
3592         * print.c (syms_of_print):
3593         * process.c (syms_of_process):
3594         * search.c (syms_of_search):
3595         * sound.c (syms_of_sound):
3596         * syntax.c (init_syntax_once, syms_of_syntax):
3597         * terminal.c (syms_of_terminal):
3598         * textprop.c (syms_of_textprop):
3599         * undo.c (syms_of_undo):
3600         * w32.c (globals_of_w32):
3601         * window.c (syms_of_window):
3602         * xdisp.c (syms_of_xdisp):
3603         * xfaces.c (syms_of_xfaces):
3604         * xfns.c (syms_of_xfns):
3605         * xmenu.c (syms_of_xmenu):
3606         * xsettings.c (syms_of_xsettings):
3607         * xterm.c (syms_of_xterm): Use DEFSYM.
3609 2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
3611         * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
3613 2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
3615         Integer and buffer overflow fixes (Bug#8873).
3617         * print.c (printchar, strout): Check for string overflow.
3618         (PRINTPREPARE, printchar, strout):
3619         Don't set size unless allocation succeeds.
3621         * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
3622         for sizes.  Check for string overflow more accurately.
3623         Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
3625         * macros.c: Integer and buffer overflow fixes.
3626         * keyboard.h (struct keyboard.kbd_macro_bufsize):
3627         * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
3628         Use ptrdiff_t, not int, for sizes.
3629         Don't increment bufsize until after realloc succeeds.
3630         Check for size-calculation overflow.
3631         (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
3633         * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
3635         * lread.c: Integer overflow fixes.
3636         (read_integer): Radix is now EMACS_INT, not int,
3637         to improve quality of diagnostics for out-of-range radices.
3638         Calculate buffer size correctly for out-of-range radices.
3639         (read1): Check for integer overflow in radices, and in
3640         read-circle numbers.
3641         (read_escape): Avoid int overflow.
3642         (Fload, openp, read_buffer_size, read1)
3643         (substitute_object_recurse, read_vector, read_list, map_obarray):
3644         Use ptrdiff_t, not int, for sizes.
3645         (read1): Use EMACS_INT, not int, for sizes.
3646         Check for size overflow.
3648         * image.c (cache_image): Check for size arithmetic overflow.
3650         * lread.c: Integer overflow issues.
3651         (saved_doc_string_size, saved_doc_string_length)
3652         (prev_saved_doc_string_size, prev_saved_doc_string_length):
3653         Now ptrdiff_t, not int.
3654         (read1): Don't assume doc string length fits in int.  Check for
3655         out-of-range doc string lengths.
3656         (read_list): Don't assume file position fits in int.
3657         (read_escape): Check for hex character overflow.
3659 2011-06-22  Leo Liu  <sdl.web@gmail.com>
3661         * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
3662         Move to minibuffer.el.
3664 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3666         Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
3667         The following patches are for when GLYPH_DEBUG && !XASSERT.
3668         * dispextern.h (trace_redisplay_p, dump_glyph_string):
3669         * dispnew.c (flush_stdout):
3670         * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
3671         Mark as externally visible.
3672         * dispnew.c (check_window_matrix_pointers): Now static.
3673         * dispnew.c (window_to_frame_vpos):
3674         * xfns.c (unwind_create_frame):
3675         * xterm.c (x_check_font): Remove unused local.
3676         * scroll.c (CHECK_BOUNDS):
3677         * xfaces.c (cache_fache): Rename local to avoid shadowing.
3678         * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
3679         * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
3680         (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
3681         (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
3682         Now static.
3683         (debug_method_add): Use va_list and vsprintf rather than relying
3684         on undefined behavior with wrong number of arguments.
3685         (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
3686         Don't assume ptrdiff_t and EMACS_INT are the same width as int.
3687         In this code, it's OK to assume C99 behavior for ptrdiff_t formats
3688         since we're not interested in debugging glyphs with old libraries.
3689         * xfaces.c (cache_face): Move debugging code earlier; this pacifies
3690         GCC 4.6.0's static checking.
3692 2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3694         Integer overflow and signedness fixes (Bug#8873).
3695         A few related buffer overrun fixes, too.
3697         * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
3699         * dispextern.h (struct face.stipple):
3700         * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
3701         (x_bitmap_mask, x_allocate_bitmap_record)
3702         (x_create_bitmap_from_data, x_create_bitmap_from_file)
3703         (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
3704         (x_create_bitmap_from_xpm_data):
3705         * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
3706         * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
3707         (.bitmaps_last):
3708         * xfaces.c (load_pixmap):
3709         * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
3710         * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
3711         (.bitmaps_last, struct x_output.icon_bitmap):
3712         Use ptrdiff_t, not int, for bitmap indexes.
3713         (x_allocate_bitmap_record): Check for size overflow.
3714         * dispextern.h, lisp.h: Adjust to API changes elsewhere.
3716         Use ptrdiff_t, not int, for overlay counts.
3717         * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
3718         * editfns.c (overlays_around, get_pos_property):
3719         * textprop.c (get_char_property_and_overlay):
3720         * xdisp.c (next_overlay_change, note_mouse_highlight):
3721         * xfaces.c (face_at_buffer_position):
3722         * buffer.c (OVERLAY_COUNT_MAX): New macro.
3723         (overlays_at, overlays_in, sort_overlays, Foverlays_at)
3724         (Fnext_overlay_change, Fprevious_overlay_change)
3725         (mouse_face_overlay_overlaps, Foverlays_in):
3726         Use ptrdiff_t, not int, for sizes.
3727         (overlays_at, overlays_in): Check for size-calculation overflow.
3729         * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
3731         * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
3732         (x_session_initialize): Do not assume string length fits in int.
3734         * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
3735         This is unlikely, but can occur if DPI is outlandish.
3737         * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3738         * xselect.c (Fx_get_atom_name): Avoid need for strlen.
3740         * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
3741         * xrdb.c (magic_file_p, search_magic_path):
3742         Omit last arg SUFFIX; it was always 0.  All callers changed.
3743         (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
3745         * xfont.c (xfont_match): Avoid need for strlen.
3747         * xfns.c: Don't assume strlen fits in int.
3748         (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
3750         * xdisp.c (message_log_check_duplicate): Return intmax_t,
3751         not unsigned long, as we prefer signed integers.  All callers changed.
3752         Detect integer overflow in repeat count.
3753         (message_dolog): Don't assume print length fits in 39 bytes.
3754         (display_mode_element): Don't assume strlen fits in int.
3756         * termcap.c: Don't assume sizes fit in int and never overflow.
3757         (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
3758         (gobble_line): Check for size-calculation overflow.
3760         * minibuf.c (Fread_buffer):
3761         * lread.c (intern, intern_c_string):
3762         * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
3763         Don't assume string length fits in int.
3765         * keyboard.c (parse_tool_bar_item):
3766         * gtkutil.c (style_changed_cb): Avoid need for strlen.
3768         * font.c: Don't assume string length fits in int.
3769         (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
3770         Use ptrdiff_t, not int.
3771         (font_intern_prop): Don't assume string length fits in int.
3772         Don't assume integer property fits in fixnum.
3773         * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
3775         * filelock.c: Fix some buffer overrun and integer overflow issues.
3776         (get_boot_time): Don't assume gzip command string fits in 100 bytes.
3777         Reformulate so as not to need the command string.
3778         Invoke gzip -cd rather than gunzip, as it's more portable.
3779         (lock_info_type, lock_file_1, lock_file):
3780         Don't assume pid_t and time_t fit in unsigned long.
3781         (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
3782         (current_lock_owner): Prefer signed type for sizes.
3783         Use memcpy, not strncpy, where memcpy is what is really wanted.
3784         Don't assume (via atoi) that time_t and pid_t fit in int.
3785         Check for time_t and/or pid_t out of range, e.g., via a network share.
3786         Don't alloca where an auto var works fine.
3788         * fileio.c: Fix some integer overflow issues.
3789         (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
3790         Don't assume string length fits in int.
3791         (directory_file_name): Don't assume string length fits in long.
3792         (make_temp_name): Don't assume pid fits in int, or that its print
3793         length is less than 20.
3795         * data.c (Fsubr_name): Rewrite to avoid a strlen call.
3797         * coding.c (make_subsidiaries): Don't assume string length fits in int.
3799         * callproc.c (child_setup): Rewrite to avoid two strlen calls.
3801         * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
3802         We prefer signed integers, even for size calculations.
3804         * emacs.c: Don't assume string length fits in 'int'.
3805         (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
3806         (main): Don't invoke strlen when not needed.
3808         * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
3809         (XD_DEBUG_MESSAGE): Don't waste a byte.
3811         * callproc.c (getenv_internal_1, getenv_internal)
3812         (Fgetenv_internal):
3813         * buffer.c (init_buffer): Don't assume string length fits in 'int'.
3815         * lread.c (invalid_syntax): Omit length argument.
3816         All uses changed.  This doesn't fix a bug, but it simplifies the
3817         code away from its former Hollerith-constant appearance, and it's
3818         one less 'int' to worry about when looking at integer-overflow issues.
3819         (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
3821         * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
3822         This didn't break anything, but it didn't help either.
3823         It's confusing to put a bogus integer in a place where the actual
3824         value does not matter.
3825         (LIST_END_P): Remove unused macro and its bogus comment.
3826         (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
3828         * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
3829         This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
3830         implementation.
3831         (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
3832         We prefer signed types, and the value cannot exceed the EMACS_INT
3833         range anyway (because otherwise the length would not be representable).
3834         (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
3835         not EMACS_UINT and EMACS_INT, when converting pointer to integer.
3836         This avoids a GCC warning when WIDE_EMACS_INT.
3838         * indent.c (sane_tab_width): New function.
3839         (current_column, scan_for_column, Findent_to, position_indentation)
3840         (compute_motion): Use it.  This is just for clarity.
3841         (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
3843         * image.c (xbm_image_p): Don't assume stated width, height fit in int.
3845         * lisp.h (lint_assume): New macro.
3846         * composite.c (composition_gstring_put_cache):
3847         * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
3849         * editfns.c, insdel.c:
3850         Omit unnecessary forward decls, to simplify future changes.
3852         * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
3854         * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
3856         * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
3857         Use much-faster test for byte-length change.
3858         Don't assume string byte-length fits in 'int'.
3859         Check that character arg fits in 'int'.
3860         (mapcar1): Declare byte as byte, for clarity.
3862         * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
3864         * fns.c (concat): Catch string overflow earlier.
3865         Do not rely on integer wraparound.
3867         * dispextern.h (struct it.overlay_strings_charpos)
3868         (struct it.selective): Now EMACS_INT, not int.
3869         * xdisp.c (forward_to_next_line_start)
3870         (back_to_previous_visible_line_start)
3871         (reseat_at_next_visible_line_start, next_element_from_buffer):
3872         Don't arbitrarily truncate the value of 'selective' to int.
3874         * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
3876         * composite.c: Don't truncate sizes to 'int'.
3877         (composition_gstring_p, composition_reseat_it)
3878         (composition_adjust_point): Use EMACS_INT, not int.
3879         (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
3880         not EMACS_UINT, for indexes.
3882         * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
3884         * buffer.c: Include <verify.h>.
3885         (struct sortvec.priority, struct sortstr.priority):
3886         Now EMACS_INT, not int.
3887         (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
3888         (struct sortstr.size, record_overlay_string)
3889         (struct sortstrlist.size, struct sortlist.used):
3890         Don't truncate size to int.
3891         (record_overlay_string): Check for size-calculation overflow.
3892         (init_buffer_once): Check at compile-time, not run-time.
3894 2011-06-22  Jim Meyering  <meyering@redhat.com>
3896         Don't leak an XBM-image-sized buffer
3897         * image.c (xbm_load): Free the image buffer after using it.
3899 2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
3901         Port to Sun C.
3902         * composite.c (find_automatic_composition): Omit needless 'return 0;'
3903         that Sun C diagnosed.
3904         * fns.c (secure_hash): Fix pointer signedness issue.
3905         * intervals.c (static_offset_intervals): New function.
3906         (offset_intervals): Use it.
3908 2011-06-21  Leo Liu  <sdl.web@gmail.com>
3910         * deps.mk (fns.o):
3911         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
3912         sha512.h.
3914         * fns.c (secure_hash): Rename from crypto_hash_function and change
3915         the first arg to accept symbols.
3916         (Fsecure_hash): New primitive.
3917         (syms_of_fns): New symbols.
3919 2011-06-20  Deniz Dogan  <deniz@dogan.se>
3921         * process.c (Fset_process_buffer): Clarify return value in
3922         docstring.
3924 2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
3926         * dispnew.c (add_window_display_history): Use BVAR.
3928         * xdisp.c (debug_method_add): Use BVAR.
3929         (check_window_end, dump_glyph_matrix, dump_glyph)
3930         (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
3932         * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
3933         Likewise.
3935         * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
3936         check till after the cache is created in init_frame_faces.
3938 2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
3940         * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
3942 2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
3944         * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
3945         Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
3946         hosts with pre-C99 libraries, because pD is wrongly defined to "t".
3948         Improve buffer-overflow checking (Bug#8873).
3949         * fileio.c (Finsert_file_contents):
3950         * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
3951         Remove the old (too-loose) buffer overflow checks.
3952         They weren't needed, since make_gap checks for buffer overflow.
3953         * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
3954         The old code merely checked for Emacs fixnum overflow, and relied
3955         on undefined (wraparound) behavior.  The new code avoids undefined
3956         behavior, and also checks for ptrdiff_t and/or size_t overflow.
3958         * editfns.c (Finsert_char): Don't dump core with very negative counts.
3959         Tune.  Don't use wider integers than needed.  Don't use alloca.
3960         Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
3962         * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
3964         * insdel.c, lisp.h (buffer_overflow): New function.
3965         (insert_from_buffer_1, replace_range, replace_range_2):
3966         * insdel.c (make_gap_larger):
3967         * editfns.c (Finsert_char):
3968         * fileio.c (Finsert_file_contents): Use it, to normalize wording.
3970         * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
3972 2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
3974         Integer overflow and signedness fixes (Bug#8873).
3976         * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
3977         (GET_CCL_RANGE, IN_INT_RANGE): Use it.
3979         * fileio.c: Don't assume EMACS_INT fits in off_t.
3980         (emacs_lseek): New static function.
3981         (Finsert_file_contents, Fwrite_region): Use it.
3982         Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
3984         * fns.c (Fload_average): Don't assume 100 * load average fits in int.
3986         * fns.c: Don't overflow int when computing a list length.
3987         * fns.c (QUIT_COUNT_HEURISTIC): New constant.
3988         (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
3989         truncation on 64-bit hosts.  Check for QUIT every
3990         QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
3991         faster and is responsive enough.
3992         (Flength): Report an error instead of overflowing an integer.
3993         (Fsafe_length): Return a float if the value is not representable
3994         as a fixnum.  This shouldn't happen except in contrived situations.
3995         (Fnthcdr, Fsort): Don't assume list length fits in int.
3996         (Fcopy_sequence): Don't assume vector length fits in int.
3998         * alloc.c: Check that resized vectors' lengths fit in fixnums.
3999         (header_size, word_size): New constants.
4000         (allocate_vectorlike): Don't check size overflow here.
4001         (allocate_vector): Check it here instead, since this is the only
4002         caller of allocate_vectorlike that could cause overflow.
4003         Check that the new vector's length is representable as a fixnum.
4005         * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
4006         The previous code was bogus.  For example, next_almost_prime (32)
4007         returned 39, which is undesirable as it is a multiple of 3; and
4008         next_almost_prime (24) returned 25, which is a multiple of 5 so
4009         why was the code bothering to check for multiples of 7?
4011         * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
4013         * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
4015         Variadic C functions now count arguments with ptrdiff_t.
4016         This partly undoes my 2011-03-30 change, which replaced int with size_t.
4017         Back then I didn't know that the Emacs coding style prefers signed int.
4018         Also, in the meantime I found a few more instances where arguments
4019         were being counted with int, which may truncate counts on 64-bit
4020         machines, or EMACS_INT, which may be unnecessarily wide.
4021         * lisp.h (struct Lisp_Subr.function.aMANY)
4022         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
4023         Arg counts are now ptrdiff_t, not size_t.
4024         All variadic functions and their callers changed accordingly.
4025         (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
4026         * bytecode.c (exec_byte_code): Check maxdepth for overflow,
4027         to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
4028         * callint.c (Fcall_interactively): Check arg count for overflow,
4029         to avoid potential buffer overrun.  Use signed char, not 'int',
4030         for 'varies' array, so that we needn't bother to check its size
4031         calculation for overflow.
4032         * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
4033         * eval.c (apply_lambda):
4034         * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
4035         (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
4036         (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
4038         * callint.c (Fcall_interactively): Don't use index var as event count.
4040         * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
4041         * mem-limits.h (SIZE): Remove; no longer used.
4043         * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
4045         Remove unnecessary casts.
4046         * xterm.c (x_term_init):
4047         * xfns.c (x_set_border_pixel):
4048         * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
4049         These aren't needed now that we assume ANSI C.
4051         * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
4052         It's more likely to cause problems (due to unsigned overflow)
4053         than to cure them.
4055         * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
4057         * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
4059         * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
4061         * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
4063         * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
4065         * lread.c (Fload): Don't compare a possibly-garbage time_t value.
4067         GLYPH_CODE_FACE returns EMACS_INT, not int.
4068         * dispextern.h (merge_faces):
4069         * xfaces.c (merge_faces):
4070         * xdisp.c (get_next_display_element, next_element_from_display_vector):
4071         Don't assume EMACS_INT fits in int.
4073         * character.h (CHAR_VALID_P): Remove unused parameter.
4074         * fontset.c, lisp.h, xdisp.c: All uses changed.
4076         * editfns.c (Ftranslate_region_internal): Omit redundant test.
4078         * fns.c (concat): Minor tuning based on overflow analysis.
4079         This doesn't fix any bugs.  Use int to hold character, instead
4080         of constantly refetching from Emacs object.  Use XFASTINT, not
4081         XINT, for value known to be a character.  Don't bother comparing
4082         a single byte to 0400, as it's always less.
4084         * floatfns.c (Fexpt):
4085         * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
4087         * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
4088         for characters.
4090         * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
4092         * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
4093         Without this fix, on a 64-bit host (aset S 0 4294967386) would
4094         incorrectly succeed when S was a string, because 4294967386 was
4095         truncated before it was used.
4097         * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
4098         Otherwise, an out-of-range integer could cause undefined behavior
4099         on a 64-bit host.
4101         * composite.c: Use int, not EMACS_INT, for characters.
4102         (fill_gstring_body, composition_compute_stop_pos): Use int, not
4103         EMACS_INT, for values that are known to be in character range.
4104         This doesn't fix any bugs but is the usual style inside Emacs and
4105         may generate better code on 32-bit machines.
4107         Make sure a 64-bit char is never passed to ENCODE_CHAR.
4108         This is for reasons similar to the recent CHAR_STRING fix.
4109         * charset.c (Fencode_char): Check that character arg is actually
4110         a character.  Pass an int to ENCODE_CHAR.
4111         * charset.h (ENCODE_CHAR): Verify that the character argument is no
4112         wider than 'int', as a compile-time check to prevent future regressions
4113         in this area.
4115         * character.c (char_string): Remove unnecessary casts.
4117         Make sure a 64-bit char is never passed to CHAR_STRING.
4118         Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
4119         by silently ignoring the top 32 bits, allowing some values
4120         that were far too large to be valid characters.
4121         * character.h: Include <verify.h>.
4122         (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
4123         arguments are no wider than unsigned, as a compile-time check
4124         to prevent future regressions in this area.
4125         * data.c (Faset):
4126         * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
4127         (Fsubst_char_in_region):
4128         * fns.c (concat):
4129         * xdisp.c (decode_mode_spec_coding):
4130         Adjust to CHAR_STRING's new requirement.
4131         * editfns.c (Finsert_char, Fsubst_char_in_region):
4132         * fns.c (concat): Check that character args are actually
4133         characters.  Without this test, these functions did the wrong
4134         thing with wildly out-of-range values on 64-bit hosts.
4136         Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
4137         These casts should not be needed on 32-bit hosts, either.
4138         * keyboard.c (read_char):
4139         * lread.c (Fload): Remove casts to unsigned.
4141         * lisp.h (UNSIGNED_CMP): New macro.
4142         This fixes comparison bugs on 64-bit hosts.
4143         (ASCII_CHAR_P): Use it.
4144         * casefiddle.c (casify_object):
4145         * character.h (ASCII_BYTE_P, CHAR_VALID_P)
4146         (SINGLE_BYTE_CHAR_P, CHAR_STRING):
4147         * composite.h (COMPOSITION_ENCODE_RULE_VALID):
4148         * dispextern.h (FACE_FROM_ID):
4149         * keyboard.c (read_char): Use UNSIGNED_CMP.
4151         * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
4152         not to EMACS_INT, to avoid GCC warning.
4154         * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
4156         * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
4157         The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
4158         isn't needed on 32-bit machines.
4160         * buffer.c (Fgenerate_new_buffer_name):
4161         Use EMACS_INT for count, not int.
4162         (advance_to_char_boundary): Return EMACS_INT, not int.
4164         * data.c (Qcompiled_function): Now static.
4166         * window.c (window_body_lines): Now static.
4168         * image.c (gif_load): Rename local to avoid shadowing.
4170         * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
4171         (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
4172         * alloc.c (make_save_value): Integer argument is now of type
4173         ptrdiff_t, not int.
4174         (mark_object): Use ptrdiff_t, not int.
4175         * lisp.h (pD): New macro.
4176         * print.c (print_object): Use it.
4178         * alloc.c: Use EMACS_INT, not int, to count objects.
4179         (total_conses, total_markers, total_symbols, total_vector_size)
4180         (total_free_conses, total_free_markers, total_free_symbols)
4181         (total_free_floats, total_floats, total_free_intervals)
4182         (total_intervals, total_strings, total_free_strings):
4183         Now EMACS_INT, not int.  All uses changed.
4184         (Fgarbage_collect): Compute overall total using a double, so that
4185         integer overflow is less likely to be a problem.  Check for overflow
4186         when converting back to an integer.
4187         (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
4188         (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
4189         These were 'int' variables that could overflow on 64-bit hosts;
4190         they were never used, so remove them instead of repairing them.
4191         (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
4192         (inhibit_garbage_collection): Set gc_cons_threshold to max value.
4193         Previously, this ceilinged at INT_MAX, but that doesn't work on
4194         64-bit machines.
4195         (allocate_pseudovector): Don't use EMACS_INT when int would do.
4197         * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
4198         (allocate_vectorlike): Check for ptrdiff_t overflow.
4199         (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
4200         when a (possibly-narrower) signed value would do just as well.
4201         We prefer using signed arithmetic, to avoid comparison confusion.
4203         * alloc.c: Catch some string size overflows that we were missing.
4204         (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
4205         for convenience in STRING_BYTES_MAX.
4206         (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
4207         The definition here is exact; the one in lisp.h was approximate.
4208         (allocate_string_data): Check for string overflow.  This catches
4209         some instances we weren't catching before.  Also, it catches
4210         size_t overflow on (unusual) hosts where SIZE_MAX <= min
4211         (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
4212         and ptrdiff_t and EMACS_INT are both 64 bits.
4214         * character.c, coding.c, doprnt.c, editfns.c, eval.c:
4215         All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
4216         * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
4218         * character.c (string_escape_byte8): Fix nbytes/nchars typo.
4220         * alloc.c (Fmake_string): Check for out-of-range init.
4222 2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
4224         * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
4226 2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
4228         * xfns.c (x_set_scroll_bar_default_width): Remove argument to
4229         xg_get_default_scrollbar_width.
4231         * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
4232         (int_gtk_range_get_value): Move to the scroll bar part of the file.
4233         (style_changed_cb): Call update_theme_scrollbar_width and call
4234         x_set_scroll_bar_default_width and xg_frame_set_char_size for
4235         all frames (Bug#8505).
4236         (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
4237         Call gtk_window_set_resizable if HAVE_GTK3.
4238         (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
4239         and height if HAVE_GTK3 (Bug#8505).
4240         (scroll_bar_width_for_theme): New variable.
4241         (update_theme_scrollbar_width): New function.
4242         (xg_get_default_scrollbar_width): Move code to
4243         update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
4244         (xg_initialize): Call update_theme_scrollbar_width.
4246         * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
4248         * emacsgtkfixed.c, emacsgtkfixed.h: New files.
4250 2011-06-12  Martin Rudalics  <rudalics@gmx.at>
4252         * frame.c (make_frame): Call other_buffer_safely instead of
4253         other_buffer.
4255         * window.c (temp_output_buffer_show): Call display_buffer with
4256         second argument Vtemp_buffer_show_specifiers and reset latter
4257         immediately after the call.
4258         (Vtemp_buffer_show_specifiers): New variable.
4259         (auto_window_vscroll_p, next_screen_context_lines)
4260         (Vscroll_preserve_screen_position): Remove leading asterisks from
4261         doc-strings.
4263 2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
4265         Fix minor problems found by GCC 4.6.0 static checking.
4266         * buffer.c (Qclone_number): Remove for now, as it's unused.
4267         (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
4268         (record_buffer): Remove unused local.
4269         * frame.c (other_visible_frames, frame_buffer_list): Now static.
4270         (set_frame_buffer_list): Remove; unused.
4271         * frame.h (other_visible_frames): Remove decl.
4272         * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
4273         * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
4274         (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
4275         if HAVE_GPM.
4276         * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
4277         * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
4278         Define only if HAVE_GPM.
4279         * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
4280         (update_hints_inhibit): Remove; never set.  All uses removed.
4281         * widgetprv.h (emacsFrameClassRec): Remove decl.
4282         * window.c (delete_deletable_window): Now returns void, since it
4283         wasn't returning anything.
4284         (compare_window_configurations): Remove unused locals.
4285         * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
4286         * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4287         (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
4288         the same widths as pointers.  This follows up on the 2011-05-06 patch.
4289         * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
4290         * xterm.h: Likewise.
4291         (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
4293 2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
4295         * makefile.w32-in: Update dependencies.
4296         (LISP_H): Add lib/intprops.h.
4298 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
4300         * image.c (gif_load): Add animation frame delay to the metadata.
4301         (syms_of_image): Use DEFSYM.  New symbol `delay'.
4303 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
4305         * window.c (delete_deletable_window): Re-add.
4306         (Fset_window_configuration): Rewrite to handle dead buffers and
4307         consequently deletable windows.
4308         (window_tree, Fwindow_tree): Remove.  Supply functionality in
4309         window.el.
4310         (compare_window_configurations): Simplify code.
4312 2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
4314         * image.c (imagemagick_load_image): Fix type mismatch.
4315         (Fimagemagick_types): Likewise.
4317         * window.h (replace_buffer_in_windows): Declare.
4319 2011-06-11  Martin Rudalics  <rudalics@gmx.at>
4321         * buffer.c: New Lisp objects Qbuffer_list_update_hook and
4322         Qclone_number.  Remove external declaration of Qdelete_window.
4323         (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
4324         code.
4325         (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
4326         Run Qbuffer_list_update_hook if allowed.
4327         (Fother_buffer): Rewrite doc-string.  Major rewrite for new
4328         buffer list implementation.
4329         (other_buffer_safely): New function.
4330         (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
4331         calls to replace_buffer_in_windows and
4332         replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
4333         if allowed.
4334         (record_buffer): Inhibit quitting and rewrite using quittable
4335         functions.  Run Qbuffer_list_update_hook if allowed.
4336         (Frecord_buffer, Funrecord_buffer): New functions.
4337         (switch_to_buffer_1, Fswitch_to_buffer): Remove.
4338         Move switch-to-buffer to window.el.
4339         (bury-buffer): Move to window.el.
4340         (Vbuffer_list_update_hook): New variable.
4342         * lisp.h (other_buffer_safely): Add prototype in buffer.c
4343         section.
4345         * window.h (resize_frame_windows): Move up in code.
4346         (Fwindow_frame): Remove EXFUN.
4347         (replace_buffer_in_all_windows): Remove prototype.
4348         (replace_buffer_in_windows_safely): Add prototype.
4350         * window.c: Declare Qdelete_window static again.  Move down
4351         declaration of select_count.
4352         (Fnext_window, Fprevious_window): Rewrite doc-strings.
4353         (Fother_window): Move to window.el.
4354         (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
4355         cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
4356         (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
4357         window.el.
4358         (replace_buffer_in_windows): Implement by calling
4359         Qreplace_buffer_in_windows.
4360         (replace_buffer_in_all_windows): Remove with some functionality
4361         moved into replace_buffer_in_windows_safely.
4362         (replace_buffer_in_windows_safely): New function.
4363         (select_window_norecord, select_frame_norecord): Move in front
4364         of run_window_configuration_change_hook.  Remove now obsolete
4365         declarations.
4366         (Fset_window_buffer): Rewrite doc-string.
4367         Call Qrecord_window_buffer.
4368         (keys_of_window): Move binding for other-window to window.el.
4370 2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
4372         * dispextern.h (struct image): Replace data member, whose int_val
4373         and ptr_val fields were not used by anything, with a single
4374         lisp_val object.
4376         * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
4377         (gif_clear_image, gif_load, imagemagick_load_image)
4378         (gs_clear_image, gs_load): Callers changed.
4380 2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
4382         * buffer.h: Include <time.h>, for time_t.
4383         Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
4385         Fix minor problems found by static checking.
4387         * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
4389         Make identifiers static if they are not used in other modules.
4390         * data.c (Qcompiled_function, Qframe, Qvector):
4391         * image.c (QimageMagick, Qsvg):
4392         * minibuf.c (Qmetadata):
4393         * window.c (resize_window_check, resize_root_window): Now static.
4394         * window.h (resize_window_check, resize_root_window): Remove decls.
4396         * window.c (window_deletion_count, delete_deletable_window):
4397         Remove; unused.
4398         (window_body_lines): Now static.
4399         (Fdelete_other_windows_internal): Mark vars as initialized.
4400         Make sure 'resize_failed' is initialized.
4401         (run_window_configuration_change_hook): Rename local to avoid shadowing.
4402         (resize_window_apply): Remove unused local.
4403         * window.h (delete_deletable_window): Remove decl.
4405         * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
4406         (imagemagick_load_image): Fix pointer signedness problem by changing
4407         last arg from unsigned char * to char *.  All uses changed.
4408         Also, fix a local for similar reasons.
4409         Remove unused locals.  Remove locals to avoid shadowing.
4410         (fn_rsvg_handle_free): Remove; unused.
4411         (svg_load, svg_load_image): Fix pointer signedness problem.
4412         (imagemagick_load_image): Don't use garbage pointer image_wand.
4414         * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
4416 2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
4418         * image.c (gif_load): Fix omitted cast error introduced by
4419         2011-06-06 change.
4421 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
4423         * window.h (resize_proportionally, orig_total_lines)
4424         (orig_top_line): Remove from window structure.
4425         (set_window_height, set_window_width, change_window_heights)
4426         (Fdelete_window): Remove prototypes.
4427         (resize_frame_windows): Remove duplicate declaration.
4429 2011-06-10  Eli Zaretskii  <eliz@gnu.org>
4431         * window.h (resize_frame_windows, resize_window_check)
4432         (delete_deletable_window, resize_root_window)
4433         (resize_frame_windows): Declare prototypes.
4435         * window.c (resize_window_apply): Make definition be "static" to
4436         match the prototype.
4438 2011-06-10  Martin Rudalics  <rudalics@gmx.at>
4440         * window.c: Remove declarations of Qwindow_size_fixed,
4441         window_min_size_1, window_min_size_2, window_min_size,
4442         size_window, window_fixed_size_p, enlarge_window, delete_window.
4443         Remove static from declaration of Qdelete_window, it's
4444         temporarily needed by Fbury_buffer.
4445         (replace_window): Don't assign orig_top_line and
4446         orig_total_lines.
4447         (Fdelete_window, delete_window): Remove.  Window deletion is
4448         handled by window.el.
4449         (window_loop): Remove DELETE_OTHER_WINDOWS case.
4450         Replace Fdelete_window calls with calls to Qdelete_window.
4451         (Fdelete_other_windows): Remove.  Deleting other windows is
4452         handled by window.el.
4453         (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
4454         handled in window.el.
4455         (window_min_size_2, window_min_size_1, window_min_size): Remove.
4456         Window minimum sizes are handled in window.el.
4457         (shrink_windows, size_window, set_window_height)
4458         (set_window_width, change_window_heights, window_height)
4459         (window_width, CURBEG, CURSIZE, enlarge_window)
4460         (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
4461         (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
4462         handled in window.el.
4463         (make_dummy_parent): Rename to make_parent_window and give it a
4464         second argument horflag.
4465         (make_window): Don't set resize_proportionally any more.
4466         (Fsplit_window): Remove.  Windows are split in window.el.
4467         (save_restore_action, save_restore_orig_size)
4468         (shrink_window_lowest_first, save_restore_orig_size): Remove.
4469         Resize mini windows in window.el.
4470         (grow_mini_window, shrink_mini_window): Implement by calling
4471         Qresize_root_window_vertically, resize_window_check and
4472         resize_window_apply.
4473         (saved_window, Fset_window_configuration, save_window_save):
4474         Do not handle orig_top_line, orig_total_lines, and
4475         resize_proportionally.
4476         (window_min_height, window_min_width): Move to window.el.
4477         (keys_of_window): Move bindings for delete-other-windows,
4478         split-window, delete-window and enlarge-window to window.el.
4480         * buffer.c: Temporarily extern Qdelete_window.
4481         (Fbury_buffer): Temporarily call Qdelete_window instead of
4482         Fdelete_window (Fbury_buffer will move to window.el soon).
4484         * frame.c (set_menu_bar_lines_1): Remove code handling
4485         orig_top_line and orig_total_lines.
4487         * dispnew.c (adjust_frame_glyphs_initially): Don't use
4488         set_window_height but set heights directly.
4489         (change_frame_size_1): Use resize_frame_windows.
4491         * xdisp.c (init_xdisp): Don't use set_window_height but set
4492         heights directly.
4494         * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
4495         Use resize_frame_windows instead of change_window_heights and run
4496         run_window_configuration_change_hook.
4498         * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
4499         instead of change_window_heights and run
4500         run_window_configuration_change_hook.
4502 2011-06-09  Martin Rudalics  <rudalics@gmx.at>
4504         * window.c (replace_window): Rename second argument REPLACEMENT to
4505         NEW.  New third argument SETFLAG.  Rewrite.
4506         (delete_window, make_dummy_parent): Call replace_window with
4507         third argument 1.
4508         (window_list_1): Move down in code.
4509         (run_window_configuration_change_hook): Move set_buffer part
4510         before select_frame_norecord part in order to unwind correctly.
4511         Rename count1 to count.
4512         (recombine_windows, delete_deletable_window, resize_root_window)
4513         (Fdelete_other_windows_internal)
4514         (Frun_window_configuration_change_hook, make_parent_window)
4515         (resize_window_check, resize_window_apply, Fresize_window_apply)
4516         (resize_frame_windows, Fsplit_window_internal)
4517         (Fdelete_window_internal, Fresize_mini_window_internal):
4518         New functions.
4519         (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
4521 2011-06-08  Martin Rudalics  <rudalics@gmx.at>
4523         * window.h (window): Add some new members to window structure -
4524         normal_lines, normal_cols, new_total, new_normal, clone_number,
4525         splits, nest, prev_buffers, next_buffers.
4526         (WINDOW_TOTAL_SIZE): Move here from window.c.
4527         (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
4529         * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
4530         Remove.
4531         (make_dummy_parent): Set new members of windows structure.
4532         (make_window): Move down in code.  Handle new members of window
4533         structure.
4534         (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
4535         (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
4536         (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
4537         (Fset_window_prev_buffers, Fwindow_next_buffers)
4538         (Fset_window_next_buffers, Fset_window_clone_number):
4539         New functions.
4540         (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
4541         (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
4542         Doc-string fixes.
4543         (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
4544         Argument WINDOW can be now internal window too.
4545         (Fwindow_use_time): Move up in code.
4546         (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
4547         Rewrite doc-string.
4548         (Fset_window_configuration, saved_window)
4549         (Fcurrent_window_configuration, save_window_save): Handle new
4550         members of window structure.
4551         (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
4552         (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
4553         (syms_of_window): New Lisp objects Qrecord_window_buffer,
4554         Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
4555         Qget_mru_window, Qresize_root_window,
4556         Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
4557         Qauto_buffer_name; staticpro them.
4559 2011-06-07  Martin Rudalics  <rudalics@gmx.at>
4561         * window.c (Fwindow_total_size, Fwindow_left_column)
4562         (Fwindow_top_line, window_body_lines, Fwindow_body_size)
4563         (Fwindow_list_1): New functions.
4564         (window_box_text_cols): Replace with window_body_cols.
4565         (Fwindow_width, Fscroll_left, Fscroll_right):
4566         Use window_body_cols instead of window_box_text_cols.
4567         (delete_window, Fset_window_configuration):
4568         Call delete_all_subwindows with window as argument.
4569         (delete_all_subwindows): Take a window as argument and not a
4570         structure.  Rewrite.
4571         (window_loop): Remove handling of GET_LRU_WINDOW and
4572         GET_LARGEST_WINDOW.
4573         (Fget_lru_window, Fget_largest_window): Move to window.el.
4575         * window.h: Extern window_body_cols instead of
4576         window_box_text_cols.  delete_all_subwindows now takes a
4577         Lisp_Object as argument.
4579         * indent.c (compute_motion, Fcompute_motion):
4580         Use window_body_cols instead of window_box_text_cols.
4582         * frame.c (delete_frame): Call delete_all_subwindows with root
4583         window as argument.
4585 2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
4587         * fns.c (Fputhash): Document return value.
4589 2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
4591         * image.c (gif_load): Implement gif89a spec "no disposal" method.
4593 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
4595         Cons<->int and similar integer overflow fixes (Bug#8794).
4597         Check for overflow when converting integer to cons and back.
4598         * charset.c (Fdefine_charset_internal, Fdecode_char):
4599         Use cons_to_unsigned to catch overflow.
4600         (Fencode_char): Use INTEGER_TO_CONS.
4601         * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
4602         (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
4603         * data.c (long_to_cons, cons_to_long): Remove.
4604         (cons_to_unsigned, cons_to_signed): New functions.
4605         These signal an error for invalid or out-of-range values.
4606         * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
4607         * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
4608         * font.c (Ffont_variation_glyphs):
4609         * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
4610         * lisp.h: Include <intprops.h>.
4611         (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
4612         (cons_to_signed, cons_to_unsigned): New decls.
4613         (long_to_cons, cons_to_long): Remove decls.
4614         * undo.c (record_first_change): Use INTEGER_TO_CONS.
4615         (Fprimitive_undo): Use CONS_TO_INTEGER.
4616         * xfns.c (Fx_window_property): Likewise.
4617         * xselect.c: Include <limits.h>.
4618         (x_own_selection, selection_data_to_lisp_data):
4619         Use INTEGER_TO_CONS.
4620         (x_handle_selection_request, x_handle_selection_clear)
4621         (x_get_foreign_selection, Fx_disown_selection_internal)
4622         (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
4623         (lisp_data_to_selection_data): Use cons_to_unsigned.
4624         (x_fill_property_data): Use cons_to_signed.
4625         Report values out of range.
4627         Check for buffer and string overflow more precisely.
4628         * buffer.h (BUF_BYTES_MAX): New macro.
4629         * lisp.h (STRING_BYTES_MAX): New macro.
4630         * alloc.c (Fmake_string):
4631         * character.c (string_escape_byte8):
4632         * coding.c (coding_alloc_by_realloc):
4633         * doprnt.c (doprnt):
4634         * editfns.c (Fformat):
4635         * eval.c (verror):
4636         Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
4637         since they may not be the same number.
4638         * editfns.c (Finsert_char):
4639         * fileio.c (Finsert_file_contents):
4640         Likewise for BUF_BYTES_MAX.
4642         * image.c: Use ptrdiff_t, not int, for sizes.
4643         (slurp_file): Switch from int to ptrdiff_t.
4644         All uses changed.
4645         (slurp_file): Check that file size fits in both size_t (for
4646         malloc) and ptrdiff_t (for sanity and safety).
4648         * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
4649         if b->modtime has its maximal value.
4651         * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
4653         Don't assume time_t can fit into int.
4654         * buffer.h (struct buffer.modtime): Now time_t, not int.
4655         * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
4656         * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
4658         Minor fixes for signed vs unsigned integers.
4659         * character.h (MAYBE_UNIFY_CHAR):
4660         * charset.c (maybe_unify_char):
4661         * keyboard.c (read_char, reorder_modifiers):
4662         XINT -> XFASTINT, since the integer must be nonnegative.
4663         * ftfont.c (ftfont_spec_pattern):
4664         * keymap.c (access_keymap, silly_event_symbol_error):
4665         XUINT -> XFASTINT, since the integer must be nonnegative.
4666         (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
4667         since it makes no difference and we prefer signed.
4668         * keyboard.c (record_char): Use XUINT when all the neighbors do.
4669         (access_keymap): NATNUMP -> INTEGERP, since the integer must be
4670         nonnegative.
4672 2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
4674         * window.h (Fwindow_frame): Declare.
4676 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
4678         * alloc.c: Simplify handling of large-request failures (Bug#8800).
4679         (SPARE_MEMORY): Always define.
4680         (LARGE_REQUEST): Remove.
4681         (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
4683 2011-06-06  Martin Rudalics  <rudalics@gmx.at>
4685         * lisp.h: Move EXFUNS for Fframe_root_window,
4686         Fframe_first_window and Fset_frame_selected_window to window.h.
4688         * window.h: Move EXFUNS for Fframe_root_window,
4689         Fframe_first_window and Fset_frame_selected_window here from
4690         lisp.h.
4692         * frame.c (Fwindow_frame, Fframe_first_window)
4693         (Fframe_root_window, Fframe_selected_window)
4694         (Fset_frame_selected_window): Move to window.c.
4695         (Factive_minibuffer_window): Move to minibuf.c.
4696         (Fother_visible_frames_p): New function.
4698         * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
4700         * window.c (decode_window, decode_any_window): Move up in code.
4701         (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
4702         (inhibit_frame_unsplittable): Remove unused variable.
4703         (Fwindow_buffer): Move up and rewrite doc-string.
4704         (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
4705         (Fwindow_prev): New functions.
4706         (Fwindow_frame): Move here from frame.c.  Accept any window as
4707         argument.
4708         (Fframe_root_window, Fframe_first_window)
4709         (Fframe_selected_window): Move here from frame.c.  Accept frame
4710         or arbitrary window as argument.  Update doc-strings.
4711         (Fminibuffer_window): Move up in code.
4712         (Fwindow_minibuffer_p): Move up in code and simplify.
4713         (Fset_frame_selected_window): Move here from frame.c.
4714         Marginal rewrite.
4715         (Fselected_window, select_window, Fselect_window): Move up in
4716         code.  Minor doc-string fixes.
4718 2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
4720         * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
4721         Do not assume that spare memory exists; that assumption is valid
4722         only if SYSTEM_MALLOC.
4723         (LARGE_REQUEST): New macro, so that the issue of large requests
4724         is separated from the issue of spare memory.
4726 2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
4728         * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
4729         format.  (Bug#8806)
4731         * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
4733         * xfns.c (x_set_scroll_bar_default_width): Move declarations
4734         before statements.
4736 2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
4738         * gtkutil.c (xg_get_default_scrollbar_width): New function.
4740         * gtkutil.h: Declare xg_get_default_scrollbar_width.
4742         * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
4743         min width by calling x_set_scroll_bar_default_width (Bug#8505).
4745 2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
4747         * xdisp.c (single_display_spec_intangible_p): Remove declaration.
4749 2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
4751         * xselect.c (x_clipboard_manager_save): Remove redundant arg.
4752         (x_clipboard_manager_save): Add return value.
4753         (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
4754         New error handlers.
4755         (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
4756         Obey Vx_select_enable_clipboard_manager.  Catch errors in
4757         x_clipboard_manager_save (Bug#8779).
4758         (Vx_select_enable_clipboard_manager): New variable.
4759         (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4761 2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
4763         * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
4765 2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
4767         * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
4768         in the current matrix if keep_current_p is non-zero.
4770 2011-06-04  Eli Zaretskii  <eliz@gnu.org>
4772         * bidi.c (bidi_level_of_next_char): Fix last change.
4774 2011-06-03  Eli Zaretskii  <eliz@gnu.org>
4776         Support bidi reordering of text covered by display properties.
4778         * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
4779         (bidi_fetch_char, bidi_fetch_char_advance): New functions.
4780         (bidi_cache_search, bidi_cache_iterator_state)
4781         (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4782         (bidi_level_of_next_char, bidi_move_to_visually_next):
4783         Support character positions inside a run of characters covered by a
4784         display string.
4785         (bidi_paragraph_init, bidi_resolve_explicit_1)
4786         (bidi_level_of_next_char): Call bidi_fetch_char and
4787         bidi_fetch_char_advance instead of FETCH_CHAR and
4788         FETCH_CHAR_ADVANCE.
4789         (bidi_init_it): Initialize new members.
4790         (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
4791         definitions.
4792         (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
4793         instead of using explicit *_CHAR codes.
4794         (bidi_resolve_explicit, bidi_resolve_weak):
4795         Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
4796         bidirectional text is supported only in multibyte buffers.
4797         (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
4798         it to initialize the frame_window_p member of struct bidi_it.
4799         (bidi_cache_iterator_state, bidi_resolve_explicit_1)
4800         (bidi_resolve_explicit, bidi_resolve_weak)
4801         (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
4802         bidi_it->nchars is non-positive.
4803         (bidi_level_of_next_char): Don't try to lookup the cache for the
4804         next/previous character if nothing is cached there yet, or if we
4805         were just reseat()'ed to a new position.
4807         * xdisp.c (set_cursor_from_row): Set start and stop points
4808         according to the row's direction when priming the loop that looks
4809         for the glyph on which to display cursor.
4810         (single_display_spec_intangible_p): Function deleted.
4811         (display_prop_intangible_p): Reimplement to call
4812         handle_display_spec instead of single_display_spec_intangible_p.
4813         Accept 3 additional arguments needed by handle_display_spec.
4814         This fixes incorrect cursor motion across display property with complex
4815         values: lists, `(when COND...)' forms, etc.
4816         (single_display_spec_string_p): Support property values that are
4817         lists with the argument STRING its top-level element.
4818         (display_prop_string_p): Fix the condition for processing a
4819         property that is a list to be consistent with handle_display_spec.
4820         (handle_display_spec): New function, refactored from the
4821         last portion of handle_display_prop.
4822         (compute_display_string_pos): Accept additional argument
4823         FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
4824         value of a `display' property is a "replacing spec".
4825         (handle_single_display_spec): Accept 2 additional arguments BUFPOS
4826         and FRAME_WINDOW_P.  If IT is NULL, don't set up the iterator from
4827         the display property, but just return a value indicating whether
4828         the display property will replace the characters it covers.
4829         (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
4830         frame_window_p members of struct bidi_it.
4831         (compute_display_string_pos, compute_display_string_end):
4832         New functions.
4833         (push_it): Accept second argument POSITION, where pop_it should
4834         jump to continue iteration.
4835         (reseat_1): Initialize bidi_it.disp_pos.
4837         * keyboard.c (adjust_point_for_property): Adjust the call to
4838         display_prop_intangible_p to its new signature.
4840         * dispextern.h (struct bidi_it): New member frame_window_p.
4841         (bidi_init_it): Update prototypes.
4842         (display_prop_intangible_p): Update prototype.
4843         (compute_display_string_pos, compute_display_string_end):
4844         Declare prototypes.
4845         (struct bidi_it): New members nchars and disp_pos.  ch_len is now
4846         EMACS_INT.
4848 2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4850         Malloc failure behavior now depends on size of allocation.
4851         * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
4852         * lisp.h: Change signatures accordingly.
4853         * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
4854         All callers changed.  (Bug#8762)
4856         * gnutls.c: Use Emacs's memory allocators.
4857         Without this change, the gnutls library would invoke malloc etc.
4858         directly, which causes problems on non-SYNC_INPUT hosts, and which
4859         runs afoul of improving memory_full behavior.  (Bug#8761)
4860         (fn_gnutls_global_set_mem_functions): New macro or function pointer.
4861         (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
4862         xfree instead of the default malloc, realloc, free.
4863         (Fgnutls_boot): No need to check for memory allocation failure,
4864         since xmalloc does that for us.
4866         Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
4867         * category.c (hash_get_category_set):
4868         * ccl.c (ccl_driver):
4869         * charset.c (Fdefine_charset_internal):
4870         * charset.h (struct charset.hash_index):
4871         * composite.c (get_composition_id, gstring_lookup_cache)
4872         (composition_gstring_put_cache):
4873         * composite.h (struct composition.hash_index):
4874         * dispextern.h (struct image.hash):
4875         * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
4876         (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4877         (hashfn_equal, hashfn_user_defined, make_hash_table)
4878         (maybe_resize_hash_table, hash_lookup, hash_put)
4879         (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
4880         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
4881         (Fsxhash, Fgethash, Fputhash, Fmaphash):
4882         * image.c (make_image, search_image_cache, lookup_image)
4883         (xpm_put_color_table_h):
4884         * lisp.h (struct Lisp_Hash_Table):
4885         * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
4886         * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
4887         for hashes and hash indexes, instead of 'unsigned' and 'int'.
4888         * alloc.c (allocate_vectorlike):
4889         Check for overflow in vector size calculations.
4890         * ccl.c (ccl_driver):
4891         Check for overflow when converting EMACS_INT to int.
4892         * fns.c, image.c: Remove unnecessary static decls that would otherwise
4893         need to be updated by these changes.
4894         * fns.c (make_hash_table, maybe_resize_hash_table):
4895         Check for integer overflow with large hash tables.
4896         (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
4897         Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
4898         (SXHASH_REDUCE): New macro.
4899         (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
4900         Use it instead of discarding useful hash info with large hash values.
4901         (sxhash_float): New function.
4902         (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
4903         * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
4904         (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
4905         Rewrite to use FIXNUM_BITS, as this simplifies things.
4906         (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
4907         Adjust signatures to match updated version of code.
4908         (consing_since_gc): Now EMACS_INT, since a single hash table can
4909         use more than INT_MAX bytes.
4911 2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
4913         Make it possible to build with GCC-4.6+ -O2 -flto.
4915         * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
4917 2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
4919         * minibuf.c (get_minibuffer, read_minibuf_unwind):
4920         Call minibuffer-inactive-mode.
4922 2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
4924         * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
4925         Update dependencies.
4927 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
4929         * data.c (init_data): Remove code for UTS, this system is not
4930         supported anymore.
4932 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
4934         Don't force ./temacs to start in terminal mode.
4936         * frame.c (make_initial_frame): Initialize faces in all cases, not
4937         only when CANNOT_DUMP is defined.
4938         * dispnew.c (init_display): Remove CANNOT_DUMP condition.
4940 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
4942         * dispnew.c (add_window_display_history): Use const for the string
4943         pointer.  Remove declaration, not needed.
4945 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
4947         Use 'inline', not 'INLINE'.
4948         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
4949         * alloc.c, fontset.c (INLINE): Remove.
4950         * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
4951         * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
4952         * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
4953         * gmalloc.c (register_heapinfo): Use inline unconditionally.
4954         * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
4956 2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
4958         Make it possible to run ./temacs.
4960         * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
4961         syms_of_callproc does the same thing.  Remove test for
4962         "initialized", do it in the caller.
4963         * emacs.c (main): Avoid calling set_initial_environment when dumping.
4965 2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
4967         * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
4968         (read_minibuf): Use get_minibuffer.
4969         (syms_of_minibuf): Use DEFSYM.
4970         (Qmetadata): New var.
4971         * data.c (Qbuffer): Don't make it static.
4972         (syms_of_data): Use DEFSYM.
4974 2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
4976         * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
4977         (CCL_CODE_MIN): New macro.
4979 2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
4981         * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
4983         * eval.c (Qdebug): Now static.
4984         * lisp.h (Qdebug): Remove decl.  This reverts a part of the
4985         2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
4986         2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
4988 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
4990         * image.c: Various fixes to ImageMagick code comments.
4991         (Fimagemagick_types): Doc fix.
4993 2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
4995         Minor fixes prompted by GCC 4.6.0 warnings.
4997         * xselect.c (converted_selections, conversion_fail_tag): Now static.
4999         * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
5000         (x_clipboard_manager_save_all): Move extern decl to ...
5001         * xterm.h: ... here, so that it can be checked for consistency.
5003 2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
5005         * xselect.c (x_clipboard_manager_save_frame)
5006         (x_clipboard_manager_save_all): New functions.
5007         (Fx_clipboard_manager_save): Lisp function deleted.
5009         * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
5010         * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
5012         * xterm.h: Update prototype.
5014 2011-05-28  William Xu  <william.xwl@gmail.com>
5016         * nsterm.m (ns_term_shutdown): Synchronize user defaults before
5017         exiting (Bug#8239).
5019 2011-05-28  Jim Meyering  <meyering@redhat.com>
5021         Avoid a sign-extension bug in crypto_hash_function.
5022         * fns.c (to_uchar): Define.
5023         (crypto_hash_function): Use it to convert some newly-signed
5024         variables to unsigned, to avoid sign-extension bugs.  For example,
5025         without this change, (md5 "truc") would evaluate to
5026         45723a2aff78ff4fff7fff1114760e62 rather than the expected
5027         45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
5028         https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
5030 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
5032         Integer overflow fixes.
5034         * dbusbind.c: Serial number integer overflow fixes.
5035         (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
5036         (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
5037         to hold a serial number that is too large for a fixnum.
5038         (Fdbus_method_return_internal, Fdbus_method_error_internal):
5039         Check for serial numbers out of range.  Decode any serial number
5040         that was so large that it became a float.  (Bug#8722)
5042         * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
5043         (Fdbus_call_method, Fdbus_call_method_asynchronously):
5044         Use XFASTINT rather than XUINT when numbers are nonnegative.
5045         (xd_append_arg, Fdbus_method_return_internal):
5046         (Fdbus_method_error_internal): Likewise.  Also, for unsigned
5047         arguments, check that Lisp number is nonnegative, rather than
5048         silently wrapping negative numbers around.  (Bug#8722)
5049         (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
5050         (Bug#8722)
5052         * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
5054         * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
5056         ccl: add integer overflow checks
5057         * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
5058         (IN_INT_RANGE): New macros.
5059         (ccl_driver): Use them to check for integer overflow when
5060         decoding a CCL program.  Many of the new checks are whether XINT (x)
5061         fits in int; it doesn't always, on 64-bit hosts.  The new version
5062         doesn't catch all possible integer overflows, but it's an
5063         improvement.  (Bug#8719)
5065         * alloc.c (make_event_array): Use XINT, not XUINT.
5066         There's no need for unsigned here.
5068         * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
5069         This follows up to the 2011-05-06 change that substituted uintptr_t
5070         for EMACS_INT.  This case wasn't caught back then.
5072         Rework Fformat to avoid integer overflow issues.
5073         * editfns.c: Include <float.h> unconditionally, as it's everywhere
5074         now (part of C89).  Include <verify.h>.
5075         (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
5076         (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
5077         (Fformat): Avoid the prepass trying to compute sizes; it was only
5078         approximate and thus did not catch overflow reliably.  Instead, walk
5079         through the format just once, formatting and computing sizes as we go,
5080         checking for integer overflow at every step, and allocating a larger
5081         buffer as needed.  Keep track separately whether the format is
5082         multibyte.  Keep only the most-recently calculated precision, rather
5083         than them all.  Record whether each argument has been converted to
5084         string.  Use EMACS_INT, not int, for byte and char and arg counts.
5085         Support field widths and precisions larger than INT_MAX.  Avoid
5086         sprintf's undefined behavior with conversion specifications such as %#d
5087         and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
5088         flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
5089         formatting out-of-range floating point numbers with int
5090         formats.  (Bug#8668)
5092         * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
5094         * data.c: Avoid integer truncation in expressions involving floats.
5095         * data.c: Include <intprops.h>.
5096         (arith_driver): When there's an integer overflow in an expression
5097         involving floating point, convert the integers to floating point
5098         so that the resulting value does not suffer from catastrophic
5099         integer truncation.  For example, on a 64-bit host (* 4
5100         most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
5101         Do not rely on undefined behavior after integer overflow.
5103         merge count_size_as_multibyte, parse_str_to_multibyte
5104         * character.c, character.h (count_size_as_multibyte):
5105         Rename from parse_str_to_multibyte; all uses changed.
5106         Check for integer overflow.
5107         * insdel.c, lisp.h (count_size_as_multibyte): Remove,
5108         since it's now a duplicate of the other.  This is more of
5109         a character than a buffer op, so better that it's in character.c.
5110         * fns.c, print.c: Adjust to above changes.
5112 2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
5114         * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
5116 2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
5118         * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
5119         (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
5120         (x_clipboard_manager_save): Now static.
5121         (Fx_clipboard_manager_save): Rename local to avoid shadowing.
5123         * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
5124         (crypto_hash_function): Now static.
5125         Fix pointer signedness problems.  Avoid unnecessary initializations.
5127 2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
5129         * termhooks.h (Vselection_alist): Make it terminal-local.
5131         * terminal.c (create_terminal): Initialize it.
5133         * xselect.c: Support for clipboard managers.
5134         (Vselection_alist): Move to termhooks.h as terminal-local var.
5135         (LOCAL_SELECTION): New macro.
5136         (x_atom_to_symbol): Handle x_display_info_for_display fail case.
5137         (symbol_to_x_atom): Remove gratuitous arg.
5138         (x_handle_selection_request, lisp_data_to_selection_data)
5139         (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
5140         (x_own_selection, x_get_local_selection, x_convert_selection):
5141         New arg, specifying work frame.  Use terminal-local Vselection_alist.
5142         (some_frame_on_display): Delete unused function.
5143         (Fx_own_selection_internal, Fx_get_selection_internal)
5144         (Fx_disown_selection_internal, Fx_selection_owner_p)
5145         (Fx_selection_exists_p): New optional frame arg.
5146         (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
5147         (x_handle_selection_clear): Don't treat other terminals with the
5148         same keyboard specially.  Use the terminal-local Vselection_alist.
5149         (x_clear_frame_selections): Use Frun_hook_with_args.
5151         * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
5153         * xterm.h: Add support for those atoms.
5155 2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
5157         * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
5158         (converted_selections, conversion_fail_tag): New global variables.
5159         (x_selection_request_lisp_error): Free the above.
5160         (x_get_local_selection): Remove unnecessary code.
5161         (x_reply_selection_request): Args changed; handle arbitrary array
5162         of converted selections stored in converted_selections.
5163         Separate the XChangeProperty and SelectionNotify steps.
5164         (x_handle_selection_request): Rewrite to handle MULTIPLE target.
5165         (x_convert_selection): New function.
5166         (x_handle_selection_event): Simplify.
5167         (x_get_foreign_selection): Don't ignore incoming requests while
5168         waiting for an answer; this will fail when we implement
5169         SAVE_TARGETS, and seems unnecessary anyway.
5170         (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
5171         (Vx_sent_selection_functions): Doc fix.
5173 2011-05-26  Leo Liu  <sdl.web@gmail.com>
5175         * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
5177 2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5179         * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
5181         * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
5182         for fringe update if it has periodic bitmap.
5183         (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
5184         and fringe_bitmap_periodic_p.
5186         * fringe.c (get_fringe_bitmap_data): New function.
5187         (draw_fringe_bitmap_1, update_window_fringes): Use it.
5188         (update_window_fringes): Record periodicity of fringe bitmap in glyph
5189         row.  Mark glyph row for fringe update if periodicity changed.
5191         * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
5192         for fringe update unless it has periodic bitmap.
5194 2011-05-25  Kenichi Handa  <handa@m17n.org>
5196         * xdisp.c (get_next_display_element): Set correct it->face_id for
5197         a static composition.
5199 2011-05-24  Leo Liu  <sdl.web@gmail.com>
5201         * deps.mk (fns.o):
5202         * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
5204         * fns.c (crypto_hash_function, Fsha1): New function.
5205         (Fmd5): Use crypto_hash_function.
5206         (syms_of_fns): Add Ssha1.
5208 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
5210         * gnutls.c: Remove unused macros.
5211         (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
5212         (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
5213         Remove macros that are defined and never used.
5214         Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
5216 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
5218         * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
5219         (Fx_get_selection_internal): Minor cleanup.
5220         (Fx_own_selection_internal): Rename arguments for consistency with
5221         select.el.
5223 2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
5225         * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
5227 2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
5229         * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
5231 2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5233         * dispnew.c (scrolling_window): Don't exclude the case that the
5234         last enabled row in the desired matrix touches the bottom boundary.
5236 2011-05-21  Glenn Morris  <rgm@gnu.org>
5238         * Makefile.in ($(etc)/DOC): Make second command line even shorter.
5239         (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
5240         and add some more files.
5242 2011-05-20  Eli Zaretskii  <eliz@gnu.org>
5244         * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
5245         report_file_error introduced by the change from 2011-05-07.
5247 2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
5249         * systime.h (Time): Define only if emacs is defined.
5250         This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
5251         where the include path doesn't have X11/X.h by default.  See
5252         <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
5254 2011-05-20 Kenichi Handa  <handa@m17n.org>
5256         * composite.c (find_automatic_composition): Fix previous change.
5258 2011-05-20  Glenn Morris  <rgm@gnu.org>
5260         * lisp.mk: New file, split from Makefile.in.
5261         * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
5262         (shortlisp): Remove.
5263         ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
5265 2011-05-19  Glenn Morris  <rgm@gnu.org>
5267         * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
5268         (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
5269         (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
5270         (lisp): Set the order to that of loadup.el.
5271         (shortlisp): Make it a copy of $lisp.
5272         (SOME_MACHINE_LISP): Remove.
5273         ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
5274         Use just $shortlisp, not $SOME_MACHINE_LISP too.
5276 2011-05-18  Kenichi Handa  <handa@m17n.org>
5278         * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
5279         (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
5280         (find_automatic_composition): Mostly rewrite for efficiency.
5282 2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
5284         * makefile.w32-in: Update dependencies.
5286 2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
5288         * menu.c: Include limits.h (fixes the MS-Windows build broken by
5289         2011-06-18T18:49:19Z!cyd@stupidchicken.com).
5291 2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
5293         Fix some integer overflow issues, such as string length overflow.
5295         * insdel.c (count_size_as_multibyte): Check for string overflow.
5297         * character.c (lisp_string_width): Check for string overflow.
5298         Use EMACS_INT, not int, for string indexes and lengths; in
5299         particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
5300         the resulting string length overflows an EMACS_INT; instead,
5301         report a string overflow if no precision given.  When checking for
5302         precision exhaustion, use a check that cannot possibly have
5303         integer overflow.  (Bug#8675)
5304         * character.h (lisp_string_width): Adjust to new signature.
5306         * alloc.c (string_overflow): New function.
5307         (Fmake_string): Use it.  This doesn't change behavior, but saves
5308         a few bytes and will simplify future changes.
5309         * character.c (string_escape_byte8): Likewise.
5310         * lisp.h (string_overflow): New decl.
5312         Fixups, following up to the user-interface timestamp change.
5313         * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
5314         for UI timestamps, instead of unsigned long.
5315         * msdos.c (mouse_get_pos): Likewise.
5316         * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
5317         * w32gui.h (Time): Define by including "systime.h" rather than by
5318         declaring it ourselves.  (Bug#8664)
5320         * dispextern.h (struct image): Don't assume time_t <= unsigned long.
5321         * image.c (clear_image_cache): Likewise.
5323         * term.c (term_mouse_position): Don't assume time_t wraparound.
5325         Be more systematic about user-interface timestamps.
5326         Before, the code sometimes used 'Time', sometimes 'unsigned long',
5327         and sometimes 'EMACS_UINT', to represent these timestamps.
5328         This change causes it to use 'Time' uniformly, as that's what X uses.
5329         This makes the code easier to follow, and makes it easier to catch
5330         integer overflow bugs such as Bug#8664.
5331         * frame.c (Fmouse_position, Fmouse_pixel_position):
5332         Use Time, not unsigned long, for user-interface timestamps.
5333         * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
5334         (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
5335         * keyboard.h (last_event_timestamp): Likewise.
5336         * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
5337         * menu.h (xmenu_show): Likewise.
5338         * term.c (term_mouse_position): Likewise.
5339         * termhooks.h (struct input_event.timestamp): Likewise.
5340         (struct terminal.mouse_position_hook): Likewise.
5341         * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
5342         * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
5343         * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
5344         HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
5345         what it was before.
5346         * menu.h, termhooks.h: Include "systime.h", for Time.
5348         * keyboard.c (make_lispy_event): Fix problem in integer overflow.
5349         Don't assume that the difference between two unsigned long values
5350         can fit into an integer.  At this point, we know button_down_time
5351         <= event->timestamp, so the difference must be nonnegative, so
5352         there's no need to cast the result if double-click-time is
5353         nonnegative, as it should be; check that it's nonnegative, just in
5354         case.  This bug is triggered when events are more than 2**31 ms
5355         apart (about 25 days).  (Bug#8664)
5357         * xselect.c (last_event_timestamp): Remove duplicate decl.
5358         (x_own_selection): Remove needless cast to unsigned long.
5360         * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
5361         that always fit in int.  Use a sentinel instead of a counter, to
5362         avoid a temp and to allay GCC's concerns about possible int overflow.
5363         * frame.h (struct frame): Use int for menu_bar_items_used
5364         instead of EMACS_INT, since it always fits in int.
5366         * menu.c (grow_menu_items): Check for int overflow.
5368         * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
5370         * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
5371         Before, the code was not consistent.  These values cannot exceed
5372         2**31 - 1 so there's no need to make them unsigned.
5373         (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
5374         (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
5375         (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
5376         as modifiers.
5377         * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
5379         * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
5380         (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
5381         Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
5382         presumably because the widths might not match.
5384         * window.c (size_window): Avoid needless test at loop start.
5386 2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
5388         * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
5390 2011-05-12  Drew Adams  <drew.adams@oracle.com>
5392         * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
5394 2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
5396         * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
5397         `width' to `bar_area_x' and `bar_area_width', respectively.
5398         (x_scroll_run): Take account of fringe background extension.
5400         * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
5401         Rename local vars `left' and `width' to `bar_area_x' and
5402         `bar_area_width', respectively.
5403         (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
5404         background extension.
5406 2011-05-10  Jim Meyering  <meyering@redhat.com>
5408         * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
5410 2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
5412         * image.c (Finit_image_library): Return t for built-in image types,
5413         like pbm and xbm.  (Bug#8640)
5415 2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
5417         * w32menu.c (set_frame_menubar): Fix submenu allocation.
5419 2011-05-07  Eli Zaretskii  <eliz@gnu.org>
5421         * w32console.c (Fset_screen_color): Doc fix.
5422         (Fget_screen_color): New function.
5423         (syms_of_ntterm): Defsubr it.
5425         * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
5426         unlink the temporary file if Fcall_process didn't create it in the
5427         first place.
5428         (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
5429         child process will be redirected to a file specified with `:file'.
5430         Don't try to re-open tempfile in that case, and set fd[0] to -1 as
5431         cue to call_process_cleanup not to close that handle.
5433 2011-05-07  Ben Key  <bkey76@gmail.com>
5435         * makefile.w32-in: The bootstrap-temacs rule now makes use of
5436         one of two shell specific rules, either bootstrap-temacs-CMD or
5437         bootstrap-temacs-SH.  The bootstrap-temacs-SH rule is identical
5438         to the previous implementation of the bootstrap-temacs rule.
5439         The bootstrap-temacs-CMD rule is similar to the previous
5440         implementation of the bootstrap-temacs rule except that it
5441         makes use of the ESC_CFLAGS variable instead of the CFLAGS
5442         variable.
5444         These changes, along with some changes to nt/configure.bat,
5445         nt/gmake.defs, and nt/nmake.defs, are required to extend my
5446         earlier fix to add support for --cflags and --ldflags options
5447         that include quotes so that it works whether make uses cmd or
5448         sh as the shell.
5450 2011-05-06  Michael Albinus  <michael.albinus@gmx.de>
5452         * dbusbind.c (QCdbus_type_unix_fd): Declare static.
5453         (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
5454         is a constant.
5455         (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
5456         a string.  Handle both cases.
5457         (Fdbus_call_method_asynchronously, Fdbus_register_signal)
5458         (Fdbus_register_method): Use Qinvalid_function.
5460 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
5462         * makefile.w32-in: Update dependencies.
5463         (LISP_H): Add inttypes.h and stdin.h.
5464         (PROCESS_H): Add unistd.h.
5466 2011-05-06  Eli Zaretskii  <eliz@gnu.org>
5468         * lread.c: Include limits.h (fixes the MS-Windows build broken by
5469         2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
5471 2011-05-06  Paul Eggert  <eggert@cs.ucla.edu>
5473         * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
5475         * term.c (vfatal): Remove stray call to va_end.
5476         It's not needed and the C Standard doesn't allow it here anyway.
5478         Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
5479         * eval.c (verror): doprnt a copy of ap, not the original.  (Bug#8545)
5481         * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
5482         bytes.
5484         * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
5486         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5488         * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
5490         * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
5492         * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
5494         * charset.h (struct charset.code_space): Now has 15 elements, not 16.
5495         * charset.c (Fdefine_charset_internal): Don't initialize
5496         charset.code_space[15].  The value was garbage, on hosts with
5497         32-bit int (Bug#8600).
5499         * lread.c (read_integer): Be more consistent with string-to-number.
5500         Use string_to_number to do the actual conversion; this avoids
5501         rounding errors and fixes some other screwups.  Without this fix,
5502         for example, #x1fffffffffffffff was misread as -2305843009213693952.
5503         (digit_to_number): Move earlier, for benefit of read_integer.
5504         Return -1 if the digit is out of range for the base, -2 if it is
5505         not a digit in any supported base.  (Bug#8602)
5507         * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
5509         * dispnew.c (scrolling_window): Return 1 if we scrolled,
5510         to match comment at start of function.  This also removes a
5511         GCC warning about overflow in a 32+64-bit port.
5513         * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
5515         * dbusbind.c: Do not use XPNTR on a value that may be an integer.
5516         Reported by Stefan Monnier in
5517         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
5518         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
5519         Use SYMBOLP-guarded XSYMBOL, not XPNTR.
5521         * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
5522         (EMACS_UINTPTR): Likewise, with uintptr_t.
5524         * lisp.h: Prefer 64-bit EMACS_INT if available.
5525         (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
5526         on 32-bit hosts that have 64-bit int, so that they can access
5527         large files.
5528         However, temporarily disable this change unless the temporary
5529         symbol WIDE_EMACS_INT is defined.
5531         * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
5533         Prefer intptr_t/uintptr_t for integers the same widths as pointers.
5534         This removes an assumption that EMACS_INT and long are the same
5535         width as pointers.  The assumption is true for Emacs porting targets
5536         now, but we want to make other targets possible.
5537         * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
5538         (EMACS_INTPTR, EMACS_UINTPTR): New macros.
5539         In the rest of the code, change types of integers that hold casted
5540         pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
5541         replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
5542         (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
5543         (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
5544         No need to cast type when ORing.
5545         (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
5546         * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
5547         * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
5548         assume EMACS_INT is the same width as char *.
5549         * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
5550         (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
5551         Remove no-longer-needed casts.
5552         (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
5553         (xg_tool_bar_help_callback, xg_make_tool_item):
5554         Use EMACS_INTPTR to hold an integer
5555         that will be cast to void *; this can avoid a GCC warning
5556         if EMACS_INT is not the same width as void *.
5557         * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
5558         * xdisp.c (display_echo_area_1, resize_mini_window_1):
5559         (current_message_1, set_message_1):
5560         Use a local to convert to proper width without a cast.
5561         * xmenu.c (dialog_selection_callback): Likewise.
5563         * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
5564         Also, don't assume VALBITS / RAND_BITS is less than 5,
5565         and don't rely on undefined behavior when shifting a 1 left into
5566         the sign bit.
5567         * lisp.h (get_random): Change signature to match.
5569         * lread.c (hash_string): Use size_t, not int, for hash computation.
5570         Normally we prefer signed values; but hashing is special, because
5571         it's better to use unsigned division on hash table sizes so that
5572         the remainder is nonnegative.  Also, size_t is the natural width
5573         for hashing into memory.  The previous code used 'int', which doesn't
5574         retain enough info to hash well into very large tables.
5575         (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
5577         * dbusbind.c: Don't possibly lose pointer info when converting.
5578         (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
5579         Use XPNTR rather than XHASH, so that the high-order bits of
5580         the pointer aren't lost when converting through void *.
5582         * eval.c (Fautoload): Don't double-shift a pointer.
5584         * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
5586 2011-05-06  Juanma Barranquero  <lekktu@gmail.com>
5588         * gnutls.c (DEF_GNUTLS_FN):
5589         * image.c (DEF_IMGLIB_FN): Make function pointers static.
5591 2011-05-05  Andreas Schwab  <schwab@linux-m68k.org>
5593         * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
5594         marker.  (Bug#8610)
5596 2011-05-05 Eli Zaretskii  <eliz@gnu.org>
5598         * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
5599         New version that can reserve upto 2GB of heap space.
5601 2011-05-05  Chong Yidong  <cyd@stupidchicken.com>
5603         * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
5605 2011-05-05  Teodor Zlatanov  <tzz@lifelogs.com>
5607         * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
5608         `gnutls_certificate_set_x509_key_file'.
5610 2011-05-05  Juanma Barranquero  <lekktu@gmail.com>
5612         * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
5613         Update dependencies.
5615 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
5617         * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
5618         * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5619         Remove unused parameter `fildes'.
5620         * process.c (read_process_output, send_process): Don't pass it.
5622 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
5624         Fix previous change: the library cache is defined in w32.c.
5625         * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
5626         (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
5628 2011-05-04  Juanma Barranquero  <lekktu@gmail.com>
5630         Implement dynamic loading of GnuTLS on Windows.
5632         * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
5633         (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
5634         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
5635         Declare.
5637         * gnutls.c (Qgnutls_dll): Define.
5638         (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
5639         (gnutls_*): Declare function pointers.
5640         (init_gnutls_functions): New function to initialize function pointers.
5641         (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
5642         (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
5643         (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
5644         Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
5645         (emacs_gnutls_write, emacs_gnutls_read)
5646         (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
5647         (Fgnutls_available_p): New function.
5648         (Fgnutls_boot): Call Fgnutls_available_p.  Use function pointers.
5649         (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
5650         (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
5652         * image.c: Include w32.h.
5653         (Vimage_type_cache): Delete.
5654         (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
5655         (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
5656         (w32_delayed_load): Move to w32.c.
5658         * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
5660         * w32.c (QCloaded_from, Vlibrary_cache): Define.
5661         (w32_delayed_load): Move from image.c.  When loading a library, record
5662         its filename in the :loaded-from property of the library id.
5663         (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
5664         Initialize and staticpro them.
5665         (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
5667         * process.c: Include lisp.h before w32.h, not after.
5668         (wait_reading_process_output): Call emacs_gnutls_record_check_pending
5669         instead of gnutls_record_check_pending.
5671         * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
5673 2011-05-04  Teodor Zlatanov  <tzz@lifelogs.com>
5675         * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
5676         instead of :keyfiles.  Give GnuTLS the keylist and the CRL lists
5677         as passed in.
5679 2011-05-03  Jan Djärv  <jan.h.d@swipnet.se>
5681         * xterm.c (x_set_frame_alpha): Do not set property on anything
5682         else than FRAME_X_OUTER_WINDOW (Bug#8608).
5684 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
5686         * sysdep.c (get_tty_size) [WINDOWSNT]: Implement.  (Bug#8596)
5688 2011-05-02  Juanma Barranquero  <lekktu@gmail.com>
5690         * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
5691         (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
5692         (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
5693         (gnutls_global_initialized, Qgnutls_bootprop_priority)
5694         (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
5695         (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
5696         (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
5697         (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
5698         (Qgnutls_bootprop_callbacks_verify): Make static.
5700 2011-05-01  Andreas Schwab  <schwab@linux-m68k.org>
5702         * callproc.c: Indentation fixup.
5704         * sysdep.c (wait_for_termination_1): Make static.
5705         (wait_for_termination, interruptible_wait_for_termination):
5706         Move after wait_for_termination_1.
5708 2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
5710         * sysdep.c (interruptible_wait_for_termination): New function
5711         which is like wait_for_termination, but allows keyboard
5712         interruptions.
5714         * callproc.c (Fcall_process): Add (:file "file") as an option for
5715         the STDOUT buffer.
5716         (Fcall_process_region): Ditto.
5718 2011-04-30  Eli Zaretskii  <eliz@gnu.org>
5720         * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
5721         rather than `XVECTOR (FOO)->size'.
5723         * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
5724         inttypes.h, as a gnulib replacement is used if it not available in
5725         system headers.
5727 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
5729         Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
5730         * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
5731         of MOST_POSITIVE_FIXNUM.  (Bug#8528)
5733         * coding.c (coding_alloc_by_realloc): Error out if destination
5734         will grow beyond MOST_POSITIVE_FIXNUM.
5735         (decode_coding_emacs_mule): Abort if there isn't enough place in
5736         charbuf for the composition carryover bytes.  Reserve an extra
5737         space for up to 2 characters produced in a loop.
5738         (decode_coding_iso_2022): Abort if there isn't enough place in
5739         charbuf for the composition carryover bytes.
5741 2011-04-21  Eli Zaretskii  <eliz@gnu.org>
5743         * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
5744         aborting when %lld or %lll format is passed.
5745         [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
5746         %llo or %llx format is passed.  (Bug#8545)
5748         * window.c (window_scroll_line_based): Use a marker instead of
5749         simple variables to record original value of point.  (Bug#7952)
5751         * doprnt.c (doprnt): Fix the case where a multibyte sequence
5752         produced by %s or %c overflows available buffer space.  (Bug#8545)
5754 2011-04-28  Paul Eggert  <eggert@cs.ucla.edu>
5756         * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
5757         (SIZE_MAX): Move defn after all includes, as they might #define it.
5759 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
5761         * w32.c (init_environment): Warn about defaulting HOME to C:\.
5763 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
5765         * keyboard.c (Qdelayed_warnings_hook): Define.
5766         (command_loop_1): Run `delayed-warnings-hook'
5767         if Vdelayed_warnings_list is non-nil.
5768         (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
5769         (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
5771 2011-04-28  Eli Zaretskii  <eliz@gnu.org>
5773         * doprnt.c (doprnt): Don't return value smaller than the buffer
5774         size if the message was truncated.  (Bug#8545).
5776 2011-04-28  Juanma Barranquero  <lekktu@gmail.com>
5778         * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
5779         (Fx_window_property): #if-0 the whole functions, not just the bodies.
5781 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
5783         * doprnt.c (doprnt): Support "ll" length modifier, for long long.
5785 2011-04-27  Juanma Barranquero  <lekktu@gmail.com>
5787         * makefile.w32-in: Update dependencies.
5789 2011-04-27  Eli Zaretskii  <eliz@gnu.org>
5791         Improve `doprnt' and its usage.  (Bug#8545)
5792         * doprnt.c (doprnt): Make sure `format' is never accessed beyond
5793         `format_end'.  Remove support for %l as a conversion specifier.
5794         Don't use xrealloc.  Improve diagnostics when the %l size modifier
5795         is used.  Update the commentary.
5797         * eval.c (verror): Simplify calculation of size_t.
5799         * coding.c (Ffind_operation_coding_system): Fix diagnostic error
5800         messages.
5802 2011-04-27  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
5804         * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
5805         change.
5807 2011-04-27  Paul Eggert  <eggert@cs.ucla.edu>
5809         * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
5810         This makes this file independent of the recent pseudovector change.
5812 2011-04-26  Paul Eggert  <eggert@cs.ucla.edu>
5814         * keyboard.c (handle_user_signal): Fix pointer signedness problem.
5816         * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
5817         (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
5818         Remove unused local.
5819         (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
5821         * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
5822         GCC 4.6.0 optimizes based on type-based alias analysis.
5823         For example, if b is of type struct buffer * and v of type struct
5824         Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
5825         != &v->size, and therefore "v->size = 1; b->size = 2; return
5826         v->size;" must therefore return 1.  This assumption is incorrect
5827         for Emacs, since it type-puns struct Lisp_Vector * with many other
5828         types.  To fix this problem, this patch adds a new type struct
5829         vectorlike_header that documents the constraints on layout of vectors
5830         and pseudovectors, and helps optimizing compilers not get fooled
5831         by Emacs's type punning.  It also adds the macros XSETTYPED_PVECTYPE
5832         XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
5833         * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
5834         the size member.
5835         (XSETPVECTYPE): Rewrite in terms of new macro.
5836         (XSETPVECTYPESIZE): New macro, specifying both type and size.
5837         This is a bit clearer, and further avoids the possibility of
5838         undesirable aliasing.
5839         (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
5840         (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
5841         (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
5842         since Lisp_Subr is a special case (no "next" field).
5843         (ASIZE): Now uses header.size rather than size.
5844         All previous uses of XVECTOR (foo)->size replaced to use this macro,
5845         to avoid the hassle of writing XVECTOR (foo)->header.size.
5846         (struct vectorlike_header): New type.
5847         (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
5848         object, to help avoid aliasing.
5849         (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
5850         (SUBRP): Likewise, since Lisp_Subr is a special case.
5851         * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
5852         (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
5853         (struct Lisp_Hash_Table): Combine first two members into a single
5854         struct vectorlike_header member.  All uses of "size" and "next" members
5855         changed to be "header.size" and "header.next".
5856         * buffer.h (struct buffer): Likewise.
5857         * font.h (struct font_spec, struct font_entity, struct font): Likewise.
5858         * frame.h (struct frame): Likewise.
5859         * process.h (struct Lisp_Process): Likewise.
5860         * termhooks.h (struct terminal): Likewise.
5861         * window.c (struct save_window_data, struct saved_window): Likewise.
5862         * window.h (struct window): Likewise.
5863         * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
5864         Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
5865         * buffer.c (init_buffer_once): Likewise.
5866         * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
5867         special case.
5868         * process.c (Fformat_network_address): Use local var for size,
5869         for brevity.
5871         * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
5873         Make the Lisp reader and string-to-float more consistent (Bug#8525)
5874         * data.c (atof): Remove decl; no longer used or needed.
5875         (digit_to_number): Move to lread.c.
5876         (Fstring_to_number): Use new string_to_number function, to be
5877         consistent with how the Lisp reader treats infinities and NaNs.
5878         Do not assume that floating-point numbers represent EMACS_INT
5879         without losing information; this is not true on most 64-bit hosts.
5880         Avoid double-rounding errors, by insisting on integers when
5881         parsing non-base-10 numbers, as the documentation specifies.
5882         * lisp.h (string_to_number): New decl, replacing ...
5883         (isfloat_string): Remove.
5884         * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
5885         (read1): Do not accept +. and -. as integers; this
5886         appears to have been a coding error.  Similarly, do not accept
5887         strings like +-1e0 as floating point numbers.  Do not report
5888         overflow for integer overflows unless the base is not 10 which
5889         means we have no simple and reliable way to continue.
5890         Break out the floating-point parsing into a new
5891         function string_to_number, so that Fstring_to_number parses
5892         floating point numbers consistently with the Lisp reader.
5893         (digit_to_number): Move here from data.c.  Make it static inline.
5894         (E_CHAR, EXP_INT): Remove, replacing with ...
5895         (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
5896         (string_to_number): New function, replacing isfloat_string.
5897         This function checks for valid syntax and produces the resulting
5898         Lisp float number too.  Rework it so that string-to-number
5899         no longer mishandles examples like "1.0e+".  Use strtoumax,
5900         so that overflow for non-base-10 numbers is reported only when
5901         there's no portable and simple way to convert to floating point.
5903         * textprop.c (set_text_properties_1): Rewrite for clarity,
5904         and to avoid GCC warning about integer overflow.
5906         * intervals.h (struct interval): Use EMACS_INT for members
5907         where EMACS_UINT might cause problems.  See
5908         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
5909         (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
5910         * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
5911         All uses changed.
5912         (offset_intervals): Tell GCC not to worry about length overflow
5913         when negating a negative length.
5915         * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
5916         (overrun_check_free): Likewise.
5918         * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
5919         in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
5920         word size.
5922         * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
5923         (gnutls_make_error): Rename local to avoid shadowing.
5924         (gnutls_emacs_global_deinit): ifdef out; not used.
5925         (Fgnutls_boot): Use const for pointer to readonly storage.
5926         Comment out unused local.  Fix pointer signedness problems.
5928         * lread.c (openp): Don't stuff size_t into an 'int'.
5929         Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
5930         about possible signed overflow.
5932         * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
5933         (GDK_KEY_g): Don't define if already defined.
5934         (xg_prepare_tooltip): Avoid pointer signedness problem.
5935         (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
5937         * process.c (Fnetwork_interface_info): Avoid left-shift undefined
5938         behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
5940         * xfns.c (Fx_window_property): Simplify a bit,
5941         to make a bit faster and to avoid GCC 4.6.0 warning.
5942         * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
5944         * fns.c (internal_equal): Don't assume size_t fits in int.
5946         * alloc.c (compact_small_strings): Tighten assertion a little.
5948         Replace pEd with more-general pI, and fix some printf arg casts.
5949         * lisp.h (pI): New macro, generalizing old pEd macro to other
5950         conversion specifiers.  For example, use "...%"pI"d..." rather
5951         than "...%"pEd"...".
5952         (pEd): Remove.  All uses replaced with similar uses of pI.
5953         * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
5954         * alloc.c (check_pure_size): Don't overflow by converting size to int.
5955         * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
5956         * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
5957         * dbusbind.c (xd_append_arg): Use pI to avoid cast.
5958         (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
5959         * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
5960         64-bit hosts.
5961         (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
5962         * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
5963         * print.c (safe_debug_print, print_object): Likewise.
5964         (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
5965         to int.
5966         Use pI instead of if-then-else-abort.  Use %p to avoid casts,
5967         avoiding the 0 flag, which is not portable.
5968         * process.c (Fmake_network_process): Use pI to avoid cast.
5969         * region-cache.c (pp_cache): Likewise.
5970         * xdisp.c (decode_mode_spec): Likewise.
5971         * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
5972         behavior on 64-bit hosts with printf arg.
5973         * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
5974         (x_stop_queuing_selection_requests): Likewise.
5975         (x_get_window_property): Don't truncate byte count to an 'int'
5976         when tracing.
5978         * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
5979         here, since it parses constructs like leading '-' and spaces,
5980         which are not wanted; and it overflows with large numbers.
5981         Instead, simply match F[0-9]+, which is what is wanted anyway.
5983         * alloc.c: Remove unportable assumptions about struct layout.
5984         (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
5985         (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
5986         (allocate_vectorlike, make_pure_vector): Use the new macros,
5987         plus offsetof, to remove unportable assumptions about struct layout.
5988         These assumptions hold on all porting targets that I know of, but
5989         they are not guaranteed, they're easy to remove, and removing them
5990         makes further changes easier.
5992         * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
5993         This doesn't fix a bug but makes the code clearer.
5994         (string_overrun_cookie): Now const.  Use initializers that
5995         don't formally overflow signed char, to avoid warnings.
5996         (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
5997         can cause Emacs to crash when string overrun checking is enabled.
5998         (allocate_buffer): Don't assume sizeof (struct buffer) is a
5999         multiple of sizeof (EMACS_INT); it need not be, if
6000         alignof(EMACS_INT) < sizeof (EMACS_INT).
6001         (check_sblock, check_string_bytes, check_string_free_list): Protoize.
6003 2011-04-26  Juanma Barranquero  <lekktu@gmail.com>
6005         * keyboard.c (QCrtl): Rename from Qrtl.  All uses changed.
6007 2011-04-26  Teodor Zlatanov  <tzz@lifelogs.com>
6009         * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
6010         supposed to be handshaking.  (Bug#8556)
6011         Reported by Paul Eggert <eggert@cs.ucla.edu>.
6013 2011-04-26  Daniel Colascione  <dan.colascione@gmail.com>
6015         * lisp.h (Qdebug): List symbol.
6016         * eval.c (Qdebug): Restore global linkage.
6017         * keyboard.c (debug-on-event): New variable.
6018         (handle_user_signal): Break into debugger when debug-on-event
6019         matches the current signal symbol.
6021 2011-04-25  Dan Nicolaescu  <dann@ics.uci.edu>
6023         * alloc.c (check_sblock, check_string_bytes)
6024         (check_string_free_list): Convert to standard C.
6026 2011-04-25  Teodor Zlatanov  <tzz@lifelogs.com>
6028         * w32.c (emacs_gnutls_push): Fix typo.
6030 2011-04-25  Eli Zaretskii  <eliz@gnu.org>
6032         * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
6033         "cast to pointer from integer of different size".
6035         Improve doprnt and its use in verror.  (Bug#8545)
6036         * doprnt.c (doprnt): Document the set of format control sequences
6037         supported by the function.  Use SAFE_ALLOCA instead of always
6038         using `alloca'.
6040         * eval.c (verror): Don't limit the buffer size at size_max-1, that
6041         is one byte too soon.  Don't use xrealloc; instead xfree and
6042         xmalloc anew.
6044 2011-04-24  Teodor Zlatanov  <tzz@lifelogs.com>
6046         * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
6047         callbacks stage.
6049         * gnutls.c: Renamed global_initialized to
6050         gnutls_global_initialized.  Added internals for the
6051         :verify-hostname-error, :verify-error, and :verify-flags
6052         parameters of `gnutls-boot' and documented those parameters in the
6053         docstring.  Start callback support.
6054         (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
6055         unless a fatal error occurred.  Call gnutls_alert_send_appropriate
6056         on error.  Return error code.
6057         (emacs_gnutls_write): Call emacs_gnutls_handle_error.
6058         (emacs_gnutls_read): Likewise.
6059         (Fgnutls_boot): Return handshake error code.
6060         (emacs_gnutls_handle_error): New function.
6061         (wsaerror_to_errno): Likewise.
6063         * w32.h (emacs_gnutls_pull): Add prototype.
6064         (emacs_gnutls_push): Likewise.
6066         * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
6067         (emacs_gnutls_push): Likewise.
6069 2011-04-24  Claudio Bley  <claudio.bley@gmail.com>  (tiny change)
6071         * process.c (wait_reading_process_output): Check if GnuTLS
6072         buffered some data internally if no FDs are set for TLS
6073         connections.
6075         * makefile.w32-in (OBJ2): Add gnutls.$(O).
6076         (LIBS): Link to USER_LIBS.
6077         ($(BLD)/gnutls.$(0)): New target.
6079 2011-04-24  Eli Zaretskii  <eliz@gnu.org>
6081         * xdisp.c (handle_single_display_spec): Rename the
6082         display_replaced_before_p argument into display_replaced_p, to
6083         make it consistent with the commentary.  Fix typos in the
6084         commentary.
6086         * textprop.c (syms_of_textprop): Remove dead code.
6087         (copy_text_properties): Delete obsolete commentary about an
6088         interface that was deleted long ago.  Fix typos in the description
6089         of arguments.
6091         * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
6092         to changes in oldXMenu/XMenu.h from 2011-04-16.
6093         <menu_help_message, prev_menu_help_message>: Constify.
6094         (IT_menu_make_room): menu->help_text is now `const char **';
6095         adjust.
6097         * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
6098         to changes in oldXMenu/XMenu.h from 2011-04-16.
6099         (struct XMenu): Declare `help_text' `const char **'.
6101         * xfaces.c <Qunspecified>: Make extern again.
6103         * syntax.c: Include sys/types.h before including regex.h, as
6104         required by Posix.
6106         * doc.c (get_doc_string): Improve the format passed to `error'.
6108         * doprnt.c (doprnt): Improve commentary.
6110         * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
6112         * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
6113         them with etags.
6115         * makefile.w32-in (globals.h): Add a dummy recipe, to make any
6116         changes in globals.h immediately force recompilation.
6117         (TAGS): Depend on $(CURDIR)/m/intel386.h and
6118         $(CURDIR)/s/ms-w32.h.
6119         (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
6121         * character.c (Fchar_direction): Function deleted.
6122         (syms_of_character): Don't defsubr it.
6123         <char-direction-table>: Deleted.
6125 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
6127         Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
6128         * doprnt.c: Include limits.h.
6129         (SIZE_MAX): New macro.
6130         (doprnt): Return a size_t value.  2nd arg is now size_t.
6131         Many local variables are now size_t instead of int or unsigned.
6132         Improve overflow protection.  Support `l' modifier for integer
6133         conversions.  Support %l conversion.  Don't assume an EMACS_INT
6134         argument for integer conversions and for %c.
6136         * lisp.h (doprnt): Restore prototype.
6138         * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
6139         $(SRC)/character.h.
6141         * Makefile.in (base_obj): Add back doprnt.o.
6143         * deps.mk (doprnt.o): Add back prerequisites.
6144         (callint.o): Depend on character.h.
6146         * eval.c (internal_lisp_condition_case): Include the handler
6147         representation in the error message.
6148         (verror): Call doprnt instead of vsnprintf.  Fix an off-by-one bug
6149         when breaking from the loop.
6151         * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
6153         * callint.c (Fcall_interactively): When displaying error message
6154         about invalid control letter, pass the character's codepoint, not
6155         a pointer to its multibyte form.  Improve display of the character
6156         in octal and display also its hex code.
6158         * character.c (char_string): Use %x to display the (unsigned)
6159         codepoint of an invalid character, to avoid displaying a bogus
6160         negative value.
6162         * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
6163         `error', not SYMBOL_NAME itself.
6165         * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
6166         character arguments to `error'.
6168         * charset.c (check_iso_charset_parameter): Fix incorrect argument
6169         to `error' in error message about FINAL_CHAR argument.  Make sure
6170         FINAL_CHAR is a character, and use %c when it is passed as
6171         argument to `error'.
6173 2011-04-23  Eli Zaretskii  <eliz@gnu.org>
6175         * s/ms-w32.h (localtime): Redirect to sys_localtime.
6177         * w32.c: Include <time.h>.
6178         (sys_localtime): New function.
6180 2011-04-23  Chong Yidong  <cyd@stupidchicken.com>
6182         * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
6184         * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
6186 2011-04-23  Samuel Thibault  <sthibault@debian.org>  (tiny change)
6188         * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
6189         zombies (Bug#8467).
6191 2011-04-19  Eli Zaretskii  <eliz@gnu.org>
6193         * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
6194         gl_state.e_property when gl_state.object is Qt.
6196         * insdel.c (make_gap_larger): Remove limitation of buffer size
6197         to <= INT_MAX.
6199 2011-04-18  Chong Yidong  <cyd@stupidchicken.com>
6201         * xdisp.c (lookup_glyphless_char_display)
6202         (produce_glyphless_glyph): Handle cons cell entry in
6203         glyphless-char-display.
6204         (Vglyphless_char_display): Document it.
6206         * term.c (produce_glyphless_glyph): Handle cons cell entry in
6207         glyphless-char-display.
6209 2011-04-17  Chong Yidong  <cyd@stupidchicken.com>
6211         * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
6213         * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
6215         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
6216         definition for no-X builds.
6218 2011-04-16  Paul Eggert  <eggert@cs.ucla.edu>
6220         Static checks with GCC 4.6.0 and non-default toolkits.
6222         * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
6224         * process.c (keyboard_bit_set): Define only if SIGIO.
6225         (send_process_trap): Mark it with NO_RETURN if it doesn't return.
6226         (send_process): Repair possible setjmp clobbering.
6228         * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
6230         * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
6232         * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
6234         * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
6235         Define only if needed.
6237         * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
6238         by pacifying GCC about it.  Maybe it's time to retire it?
6239         * xfaces.c (USG, __TIMEVAL__): Likewise.
6241         * dispextern.h (struct redisplay_interface): Rename param
6242         to avoid shadowing.
6243         * termhooks.h (struct terminal): Likewise.
6244         * xterm.c (xembed_send_message): Likewise.
6246         * insdel.c (make_gap_smaller): Define only if
6247         USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
6249         * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
6250         it.
6252         * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
6253         so that we aren't warned about unused symbols.
6255         * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
6257         * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
6259         * xfns.c (x_real_positions): Mark locals as initialized.
6261         * xmenu.c (xmenu_show): Don't use uninitialized vars.
6263         * xterm.c: Fix problems found by static analysis with other toolkits.
6264         (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
6265         (x_dispatch_event): Declare static if USE_GTK, and
6266         define if USE_GTK || USE_X_TOOLKIT.
6267         (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
6268         * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
6269         * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
6270         if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
6272         * xmenu.c (menu_help_callback): Pointer type fixes.
6273         Use const pointers when pointing at readonly data.  Avoid pointer
6274         signedness clashes.
6275         (FALSE): Remove unused macro.
6276         (update_frame_menubar): Remove unused decl.
6278         * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
6280         * menu.c (push_submenu_start, push_submenu_end): Do not define unless
6281         USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
6282         (single_menu_item): Rename local to avoid shadowing.
6284         * keyboard.c (make_lispy_event): Remove unused local var.
6286         * frame.c, frame.h (x_get_resource_string): Bring this back, but
6287         only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
6289         * bitmaps: Change bitmaps from unsigned char back to the X11
6290         compatible char.  Avoid the old compiler warnings about
6291         out-of-range initializers by using, for example, '\xab' rather
6292         than 0xab.
6294         * xgselect.c (xgselect_initialize): Check vs interface
6295         even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
6297         * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
6299         * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
6300         to read-only memory.
6302         * fns.c (vector): Remove; this old hack is no longer needed.
6304         * xsmfns.c (create_client_leader_window): Rename shadowing arg.
6305         Remove unused var.
6306         (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
6308         * xrdb.c (x_load_resources): Omit unused local.
6310         * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
6311         (x_window): Rename locals to avoid shadowing.
6312         (USG): Use the kludged USG macro, to pacify gcc.
6314         * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
6315         (x_term_init): Remove local to avoid shadowing.
6317         * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
6319         * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
6320         USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
6322 2011-04-16  Eli Zaretskii  <eliz@gnu.org>
6324         * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
6326         Fix regex.c, syntax.c and friends for buffers > 2GB.
6327         * syntax.h (struct gl_state_s): Declare character position members
6328         EMACS_INT.
6330         * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
6332         * textprop.c (verify_interval_modification, interval_of):
6333         Declare arguments EMACS_INT.
6335         * intervals.c (adjust_intervals_for_insertion): Declare arguments
6336         EMACS_INT.
6338         * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
6340         * indent.c (Fvertical_motion): Local variable it_start is now
6341         EMACS_INT.
6343         * regex.c (re_match, re_match_2, re_match_2_internal)
6344         (bcmp_translate, regcomp, regexec, print_double_string)
6345         (group_in_compile_stack, re_search, re_search_2, regex_compile)
6346         (re_compile_pattern, re_exec): Declare arguments and local
6347         variables `size_t' and `ssize_t' and return values `regoff_t', as
6348         appropriate.
6349         (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
6350         (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
6351         <compile_stack_type>: `size' and `avail' are now `size_t'.
6353         * regex.h <regoff_t>: Use ssize_t, not int.
6354         (re_search, re_search_2, re_match, re_match_2): Arguments that
6355         specify buffer/string position and length are now ssize_t and
6356         size_t.  Return type is regoff_t.
6358 2011-04-16  Ben Key  <bkey76@gmail.com>
6360         * nsfont.m: Fixed bugs in ns_get_family and
6361         ns_descriptor_to_entity that were caused by using free to
6362         deallocate memory blocks that were allocated by xmalloc (via
6363         xstrdup).  This caused Emacs to crash when compiled with
6364         XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
6365         --enable-checking=xmallocoverrun).  xfree is now used to
6366         deallocate these memory blocks.
6368 2011-04-15  Paul Eggert  <eggert@cs.ucla.edu>
6370         * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
6372         emacs_write: Accept and return EMACS_INT for sizes.
6373         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
6374         et seq.
6375         * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
6376         Accept and return EMACS_INT.
6377         (emacs_gnutls_write): Return the number of bytes written on
6378         partial writes.
6379         * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
6380         (emacs_read, emacs_write): Remove check for negative size, as the
6381         Emacs source code has been audited now.
6382         * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
6383         (emacs_read, emacs_write): Use it.
6384         * process.c (send_process): Adjust to the new signatures of
6385         emacs_write and emacs_gnutls_write.  Do not attempt to store
6386         a byte offset into an 'int'; it might overflow.
6387         See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
6389         * sound.c: Don't assume sizes fit in 'int'.
6390         (struct sound_device.period_size, alsa_period_size):
6391         Return EMACS_INT, not int.
6392         (struct sound_device.write, vox_write, alsa_write):
6393         Accept EMACS_INT, not int.
6394         (wav_play, au_play): Use EMACS_INT to store sizes and to
6395         record read return values.
6397 2011-04-15  Ben Key  <bkey76@gmail.com>
6399         * keyboard.c (Qundefined): Don't declare static since it is used
6400         in nsfns.m.
6401         * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
6402         static since they are used in nsfont.m.
6404 2011-04-15  Stefan Monnier  <monnier@iro.umontreal.ca>
6406         * process.c (Qprocessp): Don't declare static.
6407         * lisp.h (Qprocessp): Declare again.
6409 2011-04-15  Juanma Barranquero  <lekktu@gmail.com>
6411         * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
6413 2011-04-14  Paul Eggert  <eggert@cs.ucla.edu>
6415         Improve C-level modularity by making more things 'static'.
6417         Don't publish debugger-only interfaces to other modules.
6418         * lisp.h (safe_debug_print, debug_output_compilation_hack):
6419         (verify_bytepos, count_markers): Move decls to the only modules
6420         that need them.
6421         * region-cache.h (pp_cache): Likewise.
6422         * window.h (check_all_windows): Likewise.
6423         * marker.c, print.c, region-cache.c, window.c: Decls moved here.
6425         * sysdep.c (croak): Now static, if
6426         defined TIOCNOTTY || defined USG5 || defined CYGWIN.
6427         * syssignal.h (croak): Declare only if not static.
6429         * alloc.c (refill_memory_reserve): Now static if
6430         !defined REL_ALLOC || defined SYSTEM_MALLOC.
6431         * lisp.h (refill_memory_reserve): Declare only if not static.
6433         * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
6434         Define only if USE_LUCID.
6436         * xrdb.c (x_customization_string, x_rm_string): Now static.
6438         * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
6439         * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
6441         * xdisp.c (draw_row_with_mouse_face): Now static.
6442         * dispextern.h (draw_row_with_mouse_fave): Remove decl.
6444         * window.h (check_all_windows): Mark externally visible.
6446         * window.c (window_deletion_count): Now static.
6448         * undo.c: Make symbols static if they're not exported.
6449         (last_undo_buffer, last_boundary_position, pending_boundary):
6450         Now static.
6452         * textprop.c (interval_insert_behind_hooks): Now static.
6453         (interval_insert_in_front_hooks): Likewise.
6455         * term.c: Make symbols static if they're not exported.
6456         (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
6457         (max_frame_lines, tty_set_terminal_modes):
6458         (tty_reset_terminal_modes, tty_turn_off_highlight):
6459         (get_tty_terminal): Now static.
6460         (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
6461         * termhooks.h (term_mouse_moveto): Do not declare if
6462         HAVE_WINDOW_SYSTEM.
6463         * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
6464         (tty_turn_off_highlight, get_tty_terminal): Remove decls.
6466         * sysdep.c: Make symbols static if they're not exported.
6467         (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
6468         Now static.
6469         (sigprocmask_set, full_mask): Remove; unused.
6470         (wait_debugging): Mark as visible.
6471         * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
6472         * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
6474         * syntax.c (syntax_temp): Define only if !__GNUC__.
6476         * sound.c (current_sound_device, current_sound): Now static.
6478         * search.c (searchbufs, searchbuf_head): Now static.
6480         * scroll.c (scroll_cost): Remove; unused.
6481         * dispextern.h (scroll_cost): Remove decl.
6483         * region-cache.h (pp_cache): Mark as externally visible.
6485         * process.c: Make symbols static if they're not exported.
6486         (process_tick, update_tick, create_process, chan_process):
6487         (Vprocess_alist, proc_buffered_char, datagram_access):
6488         (fd_callback_data, send_process_frame, process_sent_to): Now static.
6489         (deactivate_process): Mark defn as static, as well as decl.
6490         * lisp.h (create_process): Remove decl.
6491         * process.h (chan_process, Vprocess_alist): Remove decls.
6493         * print.c: Make symbols static if they're not exported.
6494         (print_depth, new_backquote_output, being_printed, print_buffer):
6495         (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
6496         (print_interval, print_number_index, initial_stderr_stream):
6497         Now static.
6498         * lisp.h (Fprinc): Remove decl.
6499         (debug_output_compilation_hack): Mark as externally visible.
6501         * sysdep.c (croak): Move decl from here to syssignal.h.
6502         * syssignal.h (croak): Put it here, so the API can be checked when
6503         'croak' is called from dissociate_if_controlling_tty.
6505         * minibuf.c: Make symbols static if they're not exported.
6506         (minibuf_save_list, choose_minibuf_frame): Now static.
6507         * lisp.h (choose_minibuf_frame): Remove decl.
6509         * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
6511         * lread.c: Make symbols static if they're not exported.
6512         (read_objects, initial_obarray, oblookup_last_bucket_number):
6513         Now static.
6514         (make_symbol): Remove; unused.
6515         * lisp.h (initial_obarray, make_symbol): Remove decls.
6517         * keyboard.c: Make symbols static if they're not exported.
6518         (single_kboard, recent_keys_index, total_keys, recent_keys):
6519         (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
6520         (this_single_command_key_start, echoing, last_auto_save):
6521         (read_key_sequence_cmd, dribble, recursive_edit_unwind):
6522         (command_loop, echo_now, keyboard_init_hook, help_char_p):
6523         (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
6524         (Vlispy_mouse_stem, double_click_count):
6525         Now static.
6526         (force_auto_save_soon): Define only if SIGDANGER.
6527         (ignore_mouse_drag_p): Now static if
6528         !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
6529         (print_help): Remove; unused.
6530         (stop_character, last_timer_event): Mark as externally visible.
6531         * keyboard.h (ignore_mouse_drag_p): Declare only if
6532         defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
6533         (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
6534         * lisp.h (echoing): Remove decl.
6535         (force_auto_save_soon): Declare only if SIGDANGER.
6536         * xdisp.c (redisplay_window): Simplify code, to make it more
6537         obvious that ignore_mouse_drag_p is not accessed if !defined
6538         USE_GTK && !defined HAVE_NS.
6540         * intervals.c: Make symbols static if they're not exported.
6541         (merge_properties_sticky, merge_interval_right, delete_interval):
6542         Now static.
6543         * intervals.h (merge_interval_right, delete_interval): Remove decls.
6545         * insdel.c: Make symbols static if they're not exported.
6546         However, leave prepare_to_modify_buffer alone.  It's never
6547         called from outside this function, but that appears to be a bug.
6548         (combine_after_change_list, combine_after_change_buffer):
6549         (adjust_after_replace, signal_before_change): Now static.
6550         (adjust_after_replace_noundo): Remove; unused.
6551         * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
6552         (signal_before_change): Remove decls.
6554         * indent.c (val_compute_motion, val_vmotion): Now static.
6556         * image.c: Make symbols static if they're not exported.
6557         * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
6558         if USE_GTK.
6559         * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
6560         (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
6562         * fringe.c (standard_bitmaps): Now static.
6563         (max_used_fringe_bitmap): Now static, unless HAVE_NS.
6565         * frame.c: Make symbols static if they're not exported.
6566         (x_report_frame_params, make_terminal_frame): Now static.
6567         (get_frame_param): Now static, unless HAVE_NS.
6568         (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
6569         (x_get_resource_string): Remove; not used.
6570         * frame.h (make_terminal_frame, x_report_frame_params):
6571         (x_get_resource_string); Remove decls.
6572         (x_fullscreen_adjust): Declare only if WINDOWSNT.
6573         * lisp.h (get_frame_param): Declare only if HAVE_NS.
6575         * font.c, fontset.c: Make symbols static if they're not exported.
6576         * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
6577         (FACE_SUITABLE_FOR_CHAR_P): Use it.
6578         * font.c (font_close_object): Now static.
6579         * font.h (font_close_object): Remove.
6580         * fontset.c (FONTSET_OBJLIST): Remove.
6581         (free_realized_fontset) #if-0 the body, which does nothing.
6582         (face_suitable_for_char_p): #if-0, as it's never called.
6583         * fontset.h (face_suitable_for_char_p): Remove decl.
6584         * xfaces.c (face_at_string_position):
6585         Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
6586         since 0 is always ASCII.
6588         * fns.c (weak_hash_tables): Now static.
6590         * fileio.c: Make symbols static if they're not exported.
6591         (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
6592         (Vwrite_region_annotation_buffers): Now static.
6594         * eval.c: Make symbols static if they're not exported.
6595         (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
6596         * lisp.h (backtrace_list): Remove decl.
6598         * emacs.c: Make symbols static if they're not exported.
6599         (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
6600         (fatal_error_code, fatal_error_signal_hook, standard_args):
6601         Now static.
6602         (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
6603         (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
6604         (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
6605         * lisp.h (fatal_error_signal_hook): Remove decl.
6606         (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
6608         * editfns.c: Move a (normally-unused) function to its only use.
6609         * editfns.c, lisp.h (get_operating_system_release): Remove.
6610         * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
6611         worth the hassle of breaking this out.
6613         * xterm.c: Make symbols static if they're not exported.
6614         (x_raise_frame, x_lower_frame, x_wm_set_window_state):
6615         (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
6616         (x_destroy_window, x_delete_display):
6617         Now static.
6618         (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
6619         (x_mouse_leave): Remove; unused.
6620         * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
6621         (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
6622         (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
6623         Remove decls.
6624         (x_mouse_leave): Declare only if WINDOWSNT.
6625         (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
6626         (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
6627         USE_X_TOOLKIT.
6629         * ftxfont.c: Make symbols static if they're not exported.
6630         (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
6631         HAVE_FREETYPE.
6632         * font.h (ftxfont_driver): Likewise.
6634         * xfns.c: Make symbols static if they're not exported.
6635         (x_last_font_name, x_display_info_for_name):
6636         (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
6637         (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
6638         (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
6639         (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
6640         (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
6641         (last_show_tip_args): Now static.
6642         (xic_defaut_fontset, xic_create_fontsetname): Define only if
6643         defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
6644         (x_screen_planes): Remove; unused.
6645         * dispextern.h (x_screen_planes): Remove decl.
6647         * dispnew.c: Make symbols static if they're not exported.
6648         * dispextern.h (redraw_garbaged_frames, scrolling):
6649         (increment_row_positions): Remove.
6650         * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
6651         (delayed_size_change, glyph_matrix_count, glyph_pool_count):
6652         Now static.
6653         (redraw_garbaged_frames): Remove; unused.
6655         * xfaces.c: Make symbols static if they're not exported.
6656         * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
6657         Remove decls.
6658         * xterm.h (defined_color): Remove decls.
6659         (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
6660         * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
6661         (menu_face_changed_default, defined_color, free_realized_face):
6662         (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
6663         (ascii_face_of_lisp_face): Remove; unused.
6665         * xdisp.c: Make symbols static if they're not exported.
6666         * dispextern.h (scratch_glyph_row, window_box_edges):
6667         (glyph_to_pixel_coords, set_cursor_from_row):
6668         (get_next_display_element, set_iterator_to_next):
6669         (highlight_trailing_whitespace, frame_to_window_pixel_xy):
6670         (show_mouse_face): Remove decls
6671         * frame.h (message_buf_print): Likewise.
6672         * lisp.h (pop_message, set_message, check_point_in_composition):
6673         Likewise.
6674         * xterm.h (set_vertical_scroll_bar): Likewise.
6675         * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
6676         (message_buf_print, scratch_glyph_row, displayed_buffer):
6677         (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
6678         (get_next_display_element, show_mouse_face, window_box_edges):
6679         (frame_to_window_pixel_xy, check_point_in_composition):
6680         (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
6681         (glyph_to_pixel_coords): Remove; unused.
6683         * dired.c (file_name_completion): Now static.
6685         * dbusbind.c (xd_in_read_queued_messages): Now static.
6687         * lisp.h (circular_list_error, FOREACH): Remove; unused.
6688         * data.c (circular_list_error): Remove.
6690         * commands.h (last_point_position, last_point_position_buffer):
6691         (last_point_position_window): Remove decls.
6692         * keyboard.c: Make these variables static.
6694         * coding.h (coding, code_convert_region, encode_coding_gap):
6695         Remove decls.
6696         * coding.c (Vsjis_coding_system, Vbig5_coding_system):
6697         (iso_code_class, detect_coding, code_convert_region): Now static.
6698         (encode_coding_gap): Remove; unused.
6700         * chartab.c (chartab_chars, chartab_bits): Now static.
6702         * charset.h (charset_iso_8859_1): Remove decl.
6703         * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
6704         Now static.
6706         * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
6707         * ccl.c (Vccl_program_table): Now static.
6708         (check_ccl_update): Remove; unused.
6710         * category.c (SET_CATEGORY_SET, set_category_set): Move here.
6711         * category.h: ... from here.
6712         * category.c (check_category_table, set_category_set): Now static.
6714         * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
6715         * lisp.h: Remove these decls.
6717         * buffer.c (buffer_count): Remove unused var.
6719         * bidi.c (bidi_dump_cached_states): Mark as externally visible,
6720         so that it's not optimized away.
6721         (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
6722         * dispextern.h (bidi_dump_cached_states): Remove, since it's
6723         exported only to the debugger.
6725         * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
6726         * atimer.h (run_all_atimers): Remove; not exported.
6728         font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
6729         * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
6730         was inaccessible from Lisp.
6731         (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
6732         * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
6734         alloc.c: Import and export fewer symbols, and remove unused items.
6735         * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
6736         is defined.
6737         (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
6738         it's not optimized away by whole-program optimization.
6739         (message_enable_multibyte, free_misc): Remove.
6740         (catchlist, handlerlist, mark_backtrace):
6741         Declare only if BYTE_MARK_STACK.
6742         (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
6743         * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
6744         (message_enable_multibyte): Remove decl.
6745         (free_misc, interval_free_list, float_block, float_block_index):
6746         (n_float_blocks, float_free_list, cons_block, cons_block_index):
6747         (cons_free_list, last_marked_index):
6748         Now static.
6749         (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
6750         * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
6751         (mark_backtrace): Define only if BYTE_MARK_STACK.
6752         * xdisp.c (message_enable_multibyte): Now static.
6754         Declare Lisp_Object Q* variables to be 'static' if not exported.
6755         This makes it easier for human readers (and static analyzers)
6756         to see whether these variables are used from other modules.
6757         * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
6758         * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
6759         * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
6760         * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
6761         * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
6762         * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
6763         * xmenu.c, xselect.c:
6764         Declare Q* vars static if they are not used in other modules.
6765         * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
6766         * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
6767         Remove decls of unexported vars.
6768         * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
6770         * lisp.h (DEFINE_FUNC): Make sname 'static'.
6772         Make Emacs functions such as Fatom 'static' by default.
6773         This makes it easier for human readers (and static analyzers)
6774         to see whether these functions can be called from other modules.
6775         DEFUN now defines a static function.  To make the function external
6776         so that it can be used in other C modules, use the new macro DEFUE.
6777         * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
6778         (Finit_image_library):
6779         (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
6780         (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
6781         (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
6782         Remove decls, since these functions are now static.
6783         (Funintern, Fget_internal_run_time): New decls, since these functions
6784         were already external.
6786         * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
6787         * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
6788         * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
6789         * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
6790         * keyboard.c, keymap.c, lread.c:
6791         * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
6792         * syntax.c, term.c, terminal.c, textprop.c, undo.c:
6793         * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
6794         Mark functions with DEFUE instead of DEFUN,
6795         if they are used in other modules.
6796         * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
6797         decls for now-static functions.
6798         * buffer.h (Fdelete_overlay): Remove decl.
6799         * callproc.c (Fgetenv_internal): Mark as internal.
6800         * composite.c (Fremove_list_of_text_properties): Remove decl.
6801         (Fcomposition_get_gstring): New forward static decl.
6802         * composite.h (Fcomposite_get_gstring): Remove decl.
6803         * dired.c (Ffile_attributes): New forward static decl.
6804         * doc.c (Fdocumntation_property): New forward static decl.
6805         * eval.c (Ffetch_bytecode): New forward static decl.
6806         (Funintern): Remove extern decl; now in .h file where it belongs.
6807         * fileio.c (Fmake_symbolic_link): New forward static decl.
6808         * image.c (Finit_image_library): New forward static decl.
6809         * insdel.c (Fcombine_after_change_execute): Make forward decl static.
6810         * intervals.h (Fprevious_property_change):
6811         (Fremove_list_of_text_properties): Remove decls.
6812         * keyboard.c (Fthis_command_keys): Remove decl.
6813         (Fcommand_execute): New forward static decl.
6814         * keymap.c (Flookup_key): New forward static decl.
6815         (Fcopy_keymap): Now static.
6816         * keymap.h (Flookup_key): Remove decl.
6817         * process.c (Fget_process): New forward static decl.
6818         (Fprocess_datagram_address): Mark as internal.
6819         * syntax.c (Fsyntax_table_p): New forward static decl.
6820         (skip_chars): Remove duplicate decl.
6821         * textprop.c (Fprevious_property_change): New forward static decl.
6822         * window.c (Fset_window_fringes, Fset_window_scroll_bars):
6823         Now internal.
6824         (Fset_window_margins, Fset_window_vscroll): New forward static decls.
6825         * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
6827         * editfns.c (Fformat): Remove unreachable code.
6829 2011-04-14  Andreas Schwab  <schwab@linux-m68k.org>
6831         * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
6832         change.  (Bug#8496)
6834 2011-04-13  Eli Zaretskii  <eliz@gnu.org>
6836         * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
6837         when at ZV.  (Bug#8487)
6839 2011-04-12  Andreas Schwab  <schwab@linux-m68k.org>
6841         * charset.c (Fclear_charset_maps): Use xfree instead of free.
6842         (Bug#8437)
6843         * keyboard.c (parse_tool_bar_item): Likewise.
6844         * sound.c (sound_cleanup, alsa_close): Likewise.
6845         * termcap.c (tgetent): Likewise.
6846         * xfns.c (x_default_font_parameter): Likewise.
6847         * xsettings.c (read_and_apply_settings): Likewise.
6849         * alloc.c (overrun_check_malloc, overrun_check_realloc)
6850         (overrun_check_free): Protoize.
6852 2011-04-12  Paul Eggert  <eggert@cs.ucla.edu>
6854         * sysdep.c (emacs_read, emacs_write): Check for negative sizes
6855         since callers should never pass a negative size.
6856         Change the signature to match that of plain 'read' and 'write'; see
6857         <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
6858         * lisp.h: Update prototypes of emacs_write and emacs_read.
6860 2011-04-11  Eli Zaretskii  <eliz@gnu.org>
6862         * xdisp.c (redisplay_window): Don't try to determine the character
6863         position of the scroll margin if the window start point w->startp
6864         is outside the buffer's accessible region.  (Bug#8468)
6866 2011-04-10  Eli Zaretskii  <eliz@gnu.org>
6868         Fix write-region and its subroutines for buffers > 2GB.
6869         * fileio.c (a_write, e_write): Modify declaration of arguments and
6870         local variables to support buffers larger than 2GB.
6871         (Fcopy_file): Use EMACS_INT for return value of emacs_read.
6873         * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
6874         argument, local variables, and return value.
6876         * lisp.h: Update prototypes of emacs_write and emacs_read.
6878         * sound.c (vox_write): Use ssize_t for return value of emacs_write.
6880 2011-04-10  Paul Eggert  <eggert@cs.ucla.edu>
6882         * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
6884         Fix more problems found by GCC 4.6.0's static checks.
6886         * xdisp.c (vmessage): Use a better test for character truncation.
6888         * charset.c (load_charset_map): <, not <=, for optimization,
6889         and to avoid potential problems with integer overflow.
6890         * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
6891         * casetab.c (set_identity, shuffle): Likewise.
6892         * editfns.c (Fformat): Likewise.
6893         * syntax.c (skip_chars): Likewise.
6895         * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
6896         This also lets GCC 4.6.0 generate slightly better loop code.
6898         * callint.c (Fcall_interactively): <, not <=, for optimization.
6899         (Fcall_interactively): Count the number of arguments produced,
6900         not the number of arguments given.  This is simpler and lets GCC
6901         4.6.0 generate slightly better code.
6903         * ftfont.c: Distingish more carefully between FcChar8 and char.
6904         The previous code passed unsigned char * to a functions like
6905         strlen and xstrcasecmp that expect char *, which does not
6906         conform to the C standard.
6907         (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
6908         arguments to FcPatternGetString, and explicitly cast FcChar8 * to
6909         char * when the C standard requires it.
6911         * keyboard.c (read_char): Remove unused var.
6913         * eval.c: Port to Windows vsnprintf (Bug#8435).
6914         Include <limits.h>.
6915         (SIZE_MAX): Define if the headers do not.
6916         (verror): Do not give up if vsnprintf returns a negative count.
6917         Instead, grow the buffer.  This ports to Windows vsnprintf, which
6918         does not conform to C99.  Problem reported by Eli Zaretskii.
6919         Also, simplify the allocation scheme, by avoiding the need for
6920         calling realloc, and removing the ALLOCATED variable.
6922         * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
6924         Remove invocations of doprnt, as Emacs now uses vsnprintf.
6925         But keep the doprint source code for now, as we might revamp it
6926         and use it again (Bug#8435).
6927         * lisp.h (doprnt): Remove.
6928         * Makefile.in (base_obj): Remove doprnt.o.
6929         * deps.mk (doprnt.o): Remove.
6931         error: Print 32- and 64-bit integers portably (Bug#8435).
6932         Without this change, on typical 64-bit hosts error ("...%d...", N)
6933         was used to print both 32- and 64-bit integers N, which relied on
6934         undefined behavior.
6935         * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
6936         New macro.
6937         * lisp.h (error, verror): Mark as printf-like functions.
6938         * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
6939         Report overflow in size calculations when allocating printf buffer.
6940         Do not truncate output string at its first null byte.
6941         * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
6942         Truncate the output at a character boundary, since vsnprintf does not
6943         do that.
6944         * charset.c (check_iso_charset_parameter): Convert internal
6945         character to string before calling 'error', since %c now has the
6946         printf meaning.
6947         * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
6948         overflow when computing char to be passed to 'error'.  Do not
6949         pass Lisp_Object to 'error'; pass the integer instead.
6950         * nsfns.m (Fns_do_applescript): Use int, not long, since it's
6951         formatted with plain %d.
6953         * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
6955         * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
6957         * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
6959         * xterm.c (x_catch_errors): Remove duplicate declaration.
6961         * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
6963         * xdisp.c, lisp.h (message_nolog): Remove; unused.
6965 2011-04-10  Jim Meyering  <meyering@redhat.com>
6967         use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
6968         * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
6969         return ssize_t not "int", and use size_t as the buffer length.
6970         (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
6971         * gnutls.h: Update declarations.
6972         * process.c (read_process_output): Use ssize_t, to match.
6973         (send_process): Likewise.
6975 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
6977         * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
6979 2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
6981         * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
6982         Use unsigned char, to match FcChar8 type definition.
6984         * xterm.c (handle_one_xevent):
6985         * xmenu.c (create_and_show_popup_menu):
6986         * xselect.c (x_decline_selection_request)
6987         (x_reply_selection_request): Avoid type-punned deref of X events.
6989 2011-04-09  Eli Zaretskii  <eliz@gnu.org>
6991         Fix some uses of `int' instead of EMACS_INT.
6992         * search.c (string_match_1, fast_string_match)
6993         (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
6994         (scan_buffer, find_next_newline_no_quit)
6995         (find_before_next_newline, search_command, Freplace_match)
6996         (Fmatch_data): Make some `int' variables be EMACS_INT.
6998         * xdisp.c (display_count_lines): 3rd argument and return value now
6999         EMACS_INT.  All callers changed.
7000         (pint2hrstr): Last argument is now EMACS_INT.
7002         * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
7003         (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7004         (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
7005         (decode_coding_utf_16, decode_coding_emacs_mule)
7006         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
7007         (decode_coding_ccl, decode_coding_charset)
7008         <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
7009         (decode_coding_iso_2022, decode_coding_emacs_mule)
7010         (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
7011         <char_offset, last_offset>: Declare EMACS_INT.
7012         (encode_coding_utf_8, encode_coding_utf_16)
7013         (encode_coding_emacs_mule, encode_invocation_designation)
7014         (encode_designation_at_bol, encode_coding_iso_2022)
7015         (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
7016         (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
7017         Declare EMACS_INT.
7018         (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
7019         (encode_invocation_designation): Last argument P_NCHARS is now
7020         EMACS_INT.
7021         (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
7022         (produce_chars): from_nchars and to_nchars are now EMACS_INT.
7024         * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
7025         All users changed.
7027         * ccl.c (Fccl_execute_on_string): Declare some variables
7028         EMACS_INT.
7030 2011-04-08  Samuel Thibault  <sthibault@debian.org>  (tiny change)
7032         * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
7034 2011-03-19  Christoph Scholtes  <cschol2112@googlemail.com>
7036         * process.c (Fformat_network_address): Doc fix.
7038 2011-04-08  T.V. Raman  <tv.raman.tv@gmail.com>  (tiny change)
7040         * xml.c (parse_region): Avoid creating spurious whiespace nodes.
7042 2011-04-08  Chong Yidong  <cyd@stupidchicken.com>
7044         * keyboard.c (read_char): Call Lisp function help-form-show,
7045         instead of using internal_with_output_to_temp_buffer.
7046         (Qhelp_form_show): New var.
7047         (syms_of_keyboard): Use DEFSYM macro.
7049         * print.c (internal_with_output_to_temp_buffer): Function deleted.
7051         * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
7053 2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
7055         * process.c (Flist_processes): Remove to Lisp.
7056         (list_processes_1): Delete.
7058 2011-04-06  Eli Zaretskii  <eliz@gnu.org>
7060         * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
7062         * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
7064 2011-04-06  Paul Eggert  <eggert@cs.ucla.edu>
7066         Fix more problems found by GCC 4.6.0's static checks.
7068         * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
7070         * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
7072         * lisp.h (message, message_nolog, fatal): Mark as printf-like.
7074         * xdisp.c (vmessage): Mark as a printf-like function.
7076         * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
7078         * sound.c (sound_warning): Don't crash if arg contains a printf format.
7080         * image.c (tiff_error_handler, tiff_warning_handler): Mark as
7081         printf-like functions.
7082         (tiff_load): Add casts to remove these marks before passing them
7083         to system-supplied API.
7085         * eval.c (Fsignal): Remove excess argument to 'fatal'.
7087         * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
7088         This avoids several warnings with gcc -Wstrict-overflow.
7089         (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
7090         directly, rather than having caller test rule sign.  This avoids
7091         some unnecessary tests.
7092         * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
7093         (COMPOSITION_ENCODE_RULE): Arguments now must be valid.  This
7094         affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
7096         * xfont.c (xfont_text_extents): Remove var that was set but not used.
7097         (xfont_open): Avoid unnecessary tests.
7099         * composite.c (composition_gstring_put_cache): Use unsigned integer.
7101         * composite.h, composite.c (composition_gstring_put_cache):
7102         Use EMACS_INT, not int, for length.
7104         * composite.h (COMPOSITION_DECODE_REFS): New macro,
7105         breaking out part of COMPOSITION_DECODE_RULE.
7106         (COMPOSITION_DECODE_RULE): Use it.
7107         * composite.c (get_composition_id): Remove unused local vars,
7108         by using the new macro.
7110         * textprop.c (set_text_properties_1): Change while to do-while,
7111         since the condition is always true at first.
7113         * intervals.c (graft_intervals_into_buffer): Mark var as used.
7114         (interval_deletion_adjustment): Return unsigned value.
7115         All uses changed.
7117         * process.c (list_processes_1, create_pty, read_process_output):
7118         (exec_sentinel): Remove vars that were set but not used.
7119         (create_pty): Remove unnecessary "volatile"s.
7120         (Fnetwork_interface_info): Avoid possibility of int overflow.
7121         (read_process_output): Do adaptive read buffering even if carryover.
7122         (read_process_output): Simplify nbytes computation if buffered.
7124         * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
7126         * syntax.c (scan_words): Remove var that was set but not used.
7127         (update_syntax_table): Use unsigned instead of int.
7129         * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
7130         (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
7131         (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
7133         * print.c (print_error_message): Avoid int overflow.
7135         * font.c (font_list_entities): Redo for clarity,
7136         so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
7138         * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
7139         (font_score): Avoid potential overflow in diff calculation.
7141         * fns.c (substring_both): Remove var that is set but not used.
7142         (sxhash): Redo loop for clarity and to avoid wraparound warning.
7144         * eval.c (funcall_lambda): Rename local to avoid shadowing.
7146         * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
7147         Otherwise, GCC 4.6.0 optimizes the loop check away since the check
7148         can always succeed if overflow has undefined behavior.
7150         * search.c (boyer_moore, wordify): Remove vars set but not used.
7151         (wordify): Omit three unnecessary tests.
7153         * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
7154         All callers changed.  This avoids the need for an unused var.
7156         * casefiddle.c (casify_region): Remove var that is set but not used.
7158         * dired.c (file_name_completion): Remove var that is set but not used.
7160         * fileio.c (Finsert_file_contents): Make EOF condition clearer.
7162         * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
7163         (Finsert_file_contents): Remove unnecessary code checking fd.
7165         * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
7166         Check for integer overflow on size calculations.
7168         * buffer.c (Fprevious_overlay_change): Remove var that is set
7169         but not used.
7171         * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
7172         Remove vars that are set but not used.
7173         (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
7174         (timer_check_2): Mark vars as initialized.
7176         * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
7178         * image.c (lookup_image): Remove var that is set but not used.
7179         (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
7181         * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
7182         that are set but not used.
7184         * xfns.c (make_invisible_cursor): Don't return garbage
7185         if XCreateBitmapFromData fails (Bug#8410).
7187         * xselect.c (x_get_local_selection, x_handle_property_notify):
7188         Remove vars that are set but not used.
7190         * xfns.c (x_create_tip_frame): Remove var that is set but not used.
7191         (make_invisible_cursor): Initialize a possibly-uninitialized variable.
7193         * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
7194         Remove var that is set but not used.
7195         (scroll_bar_windows_size): Now size_t, not int.
7196         (x_send_scroll_bar_event): Use size_t, not int, for sizes.
7197         Check for overflow.
7199         * xfaces.c (realize_named_face): Remove vars that are set but not used.
7200         (map_tty_color) [!defined MSDOS]: Likewise.
7202         * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
7204         * coding.c: Remove vars that are set but not used.
7205         (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
7206         All callers changed.
7207         (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
7208         (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
7209         (decode_coding_charset): Remove vars that are set but not used.
7211         * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
7212         that is set but not used.
7214         * print.c (print_object): Remove var that is set but not used.
7216         Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
7217         The gnulib version avoids calling malloc in the usual case,
7218         and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
7219         * fileio.c (Ffile_symlink_p): Use emacs_readlink.
7220         * filelock.c (current_lock_owner): Likewise.
7221         * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
7222         * sysdep.c: Include allocator.h, careadlinkat.h.
7223         (emacs_no_realloc_allocator): New static constant.
7224         (emacs_readlink): New function.
7225         * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
7226         ../lib/careadlinkat.h.
7228 2011-04-04  Stefan Monnier  <monnier@iro.umontreal.ca>
7230         * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
7231         first non-nil return value).
7233 2011-04-03  Jan Djärv  <jan.h.d@swipnet.se>
7235         * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
7236         if not defined (Bug#8403).
7238 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
7240         * xdisp.c (display_count_lines): Remove parameter `start',
7241         unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
7242         (get_char_face_and_encoding): Remove parameter `multibyte_p',
7243         unused since 2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
7244         (fill_stretch_glyph_string): Remove parameters `row' and `area',
7245         unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
7246         and thereabouts.  All callers changed.
7247         (get_per_char_metric): Remove parameter `f', unused since
7248         2008-05-14T01:40:23Z!handa@m17n.org.  All callers changed.
7250 2011-04-02  Jim Meyering  <meyering@redhat.com>
7252         do not dereference NULL upon failed strdup
7253         * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
7254         (ns_get_family): Likewise.
7256 2011-04-02  Juanma Barranquero  <lekktu@gmail.com>
7258         * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
7260 2011-04-02  Jan Djärv  <jan.h.d@swipnet.se>
7262         * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
7263         later (Bug#8403).
7265 2011-04-01  Stefan Monnier  <monnier@iro.umontreal.ca>
7267         Add lexical binding.
7269         * window.c (Ftemp_output_buffer_show): New fun.
7270         (Fsave_window_excursion):
7271         * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
7273         * lread.c (lisp_file_lexically_bound_p): New function.
7274         (Fload): Bind Qlexical_binding.
7275         (readevalloop): Remove `evalfun' arg.
7276         Bind Qinternal_interpreter_environment.
7277         (Feval_buffer): Bind Qlexical_binding.
7278         (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
7279         Mark as dynamic.
7280         (syms_of_lread): Declare `lexical-binding'.
7282         * lisp.h (struct Lisp_Symbol): New field `declared_special'.
7284         * keyboard.c (eval_dyn): New fun.
7285         (menu_item_eval_property): Use it.
7287         * image.c (parse_image_spec): Use Ffunctionp.
7289         * fns.c (concat, mapcar1): Accept byte-code-functions.
7291         * eval.c (Fsetq): Handle lexical vars.
7292         (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
7293         (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
7294         (FletX, Flet): Obey lexical binding.
7295         (Fcommandp): Handle closures.
7296         (Feval): New `lexical' arg.
7297         (eval_sub): New function extracted from Feval.  Use it almost
7298         everywhere where Feval was used.  Look up vars in lexical env.
7299         Handle closures.
7300         (Ffunctionp): Move from subr.el.
7301         (Ffuncall): Handle closures.
7302         (apply_lambda): Remove `eval_flags'.
7303         (funcall_lambda): Handle closures and new byte-code-functions.
7304         (Fspecial_variable_p): New function.
7305         (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
7306         but without exporting it to Lisp.
7308         * doc.c (Fdocumentation, store_function_docstring):
7309         * data.c (Finteractive_form): Handle closures.
7311         * callint.c (Fcall_interactively): Preserve lexical-binding mode for
7312         interactive spec.
7314         * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
7315         New byte-codes.
7316         (exec_byte_code): New function extracted from Fbyte_code to handle new
7317         calling convention for byte-code-functions.  Add new byte-codes.
7319         * buffer.c (defvar_per_buffer): Set new `declared_special' field.
7321         * alloc.c (Fmake_symbol): Init new `declared_special' field.
7323 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
7325         * xdisp.c (redisplay_internal): Fix prototype.
7327 2011-03-31  Eli Zaretskii  <eliz@gnu.org>
7329         * xdisp.c (SCROLL_LIMIT): New macro.
7330         (try_scrolling): Use it when setting scroll_limit.
7331         Limit scrolling to 100 screen lines.
7332         (redisplay_window): Even when falling back on "recentering",
7333         position point in the window according to scroll-conservatively,
7334         scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
7336         (try_scrolling): When point is above the window, allow searching
7337         as far as scroll_max, or one screenful, to compute vertical
7338         distance from PT to the scroll margin position.  This prevents
7339         try_scrolling from unnecessarily failing when
7340         scroll-conservatively is set to a value slightly larger than the
7341         window height.  Clean up the case of PT below the margin at bottom
7342         of window: scroll_max can no longer be INT_MAX.  When aggressive
7343         scrolling is in use, don't let point enter the opposite scroll
7344         margin as result of the scroll.
7345         (syms_of_xdisp) <scroll-conservatively>: Document the
7346         threshold of 100 lines for never-recentering scrolling.
7348 2011-03-31  Juanma Barranquero  <lekktu@gmail.com>
7350         * dispextern.h (move_it_by_lines):
7351         * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
7352         since 2000-12-29T14:24:09Z!gerd@gnu.org.  All callers changed.
7353         (message_log_check_duplicate): Remove parameters `prev_bol' and
7354         `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org.  All callers changed.
7355         (redisplay_internal): Remove parameter `preserve_echo_area',
7356         unused since 1999-07-21T21:43:52Z!gerd@gnu.org.  All callers changed.
7358         * indent.c (Fvertical_motion):
7359         * window.c (window_scroll_pixel_based, Frecenter):
7360         Don't pass `need_y_p' to `move_it_by_lines'.
7362 2011-03-30  Stefan Monnier  <monnier@iro.umontreal.ca>
7364         * eval.c (struct backtrace): Don't cheat with negative numbers, but do
7365         steal a few bits to be more compact.
7366         (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
7367         Remove unneeded casts.
7369         * bytecode.c (Fbyte_code): CAR and CDR can GC.
7371 2011-03-30  Zachary Kanfer  <zkanfer@gmail.com>  (tiny change)
7373         * keyboard.c (Fexecute_extended_command): Do log the "suggest key
7374         binding" message (bug#7967).
7376 2011-03-30  Paul Eggert  <eggert@cs.ucla.edu>
7378         Fix more problems found by GCC 4.6.0's static checks.
7380         * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
7381         Remove unused local var.
7383         * editfns.c (Fmessage_box): Remove unused local var.
7385         * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
7386         (note_mode_line_or_margin_highlight, note_mouse_highlight):
7387         Omit unused local vars.
7388         * window.c (shrink_windows): Omit unused local var.
7389         * menu.c (digest_single_submenu): Omit unused local var.
7390         * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
7391         Omit unused local var.
7393         * keyboard.c (parse_modifiers_uncached, parse_modifiers):
7394         Don't assume string length fits in int.
7395         (keyremap_step, read_key_sequence): Use size_t for sizes.
7396         (read_key_sequence): Don't check last_real_key_start redundantly.
7398         * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
7399         instead of alloca (Bug#8344).
7401         * eval.c (Fbacktrace): Don't assume nargs fits in int.
7402         (Fbacktrace_frame): Don't assume nframes fits in int.
7404         * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
7406         * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
7407         concerns.
7409         * term.c (produce_glyphless_glyph): Remove unnecessary test.
7411         * cm.c (calccost): Turn while-do into do-while, for clarity.
7413         * keyboard.c (syms_of_keyboard): Use the same style as later
7414         in this function when indexing through an array.  This also
7415         works around GCC bug 48267.
7417         * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
7419         * xselect.c (x_check_property_data): Return correct size (Bug#8335).
7421         * chartab.c (sub_char_table_ref_and_range): Redo for slight
7422         efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
7424         * keyboard.c, keyboard.h (num_input_events): Now size_t.
7425         This avoids undefined behavior on integer overflow, and is a bit
7426         more convenient anyway since it is compared to a size_t variable.
7428         Variadic C functions now count arguments with size_t, not int.
7429         This avoids an unnecessary limitation on 64-bit machines, which
7430         caused (substring ...) to crash on large vectors (Bug#8344).
7431         * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
7432         (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
7433         All variadic functions and their callers changed accordingly.
7434         (struct gcpro.nvars): Now size_t, not int.  All uses changed.
7435         * data.c (arith_driver, float_arith_driver): Likewise.
7436         * editfns.c (general_insert_function): Likewise.
7437         * eval.c (struct backtrace.nargs, interactive_p)
7438         (internal_condition_case_n, run_hook_with_args, apply_lambda)
7439         (funcall_lambda, mark_backtrace): Likewise.
7440         * fns.c (concat): Likewise.
7441         * frame.c (x_set_frame_parameters): Likewise.
7442         * fns.c (get_key_arg): Now accepts and returns size_t, and returns
7443         0 if not found, not -1.  All callers changed.
7445         * alloc.c (garbage_collect): Don't assume stack size fits in int.
7446         (stack_copy_size): Now size_t, not int.
7447         (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
7449 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
7451         * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
7452         unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
7453         All callers changed.
7455         * lisp.h (multibyte_char_to_unibyte):
7456         * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
7457         unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
7458         * character.h (CHAR_TO_BYTE8):
7459         * cmds.c (internal_self_insert):
7460         * editfns.c (general_insert_function):
7461         * keymap.c (push_key_description):
7462         * search.c (Freplace_match):
7463         * xdisp.c (message_dolog, set_message_1): All callers changed.
7465 2011-03-28  Stefan Monnier  <monnier@iro.umontreal.ca>
7467         * keyboard.c (safe_run_hook_funcall): New function.
7468         (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
7469         don't set the hook to nil, but remove the offending function instead.
7470         (Qcommand_hook_internal): Remove, unused.
7471         (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
7472         Vcommand_hook_internal.
7474         * eval.c (enum run_hooks_condition): Remove.
7475         (funcall_nil, funcall_not): New functions.
7476         (run_hook_with_args): Call each function through a `funcall' argument.
7477         Remove `cond' argument, now redundant.
7478         (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
7479         (Frun_hook_with_args_until_failure): Adjust accordingly.
7480         (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
7482 2011-03-28  Juanma Barranquero  <lekktu@gmail.com>
7484         * dispextern.h (string_buffer_position): Remove declaration.
7486         * print.c (strout): Remove parameter `multibyte', unused since
7487         1999-08-21T19:30:21Z!gerd@gnu.org.  All callers changed.
7489         * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
7490         never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
7491         All callers changed.
7493         * w32.c (_wsa_errlist): Use braces for struct initializers.
7495         * xdisp.c (string_buffer_position_lim): Remove parameter `w',
7496         never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
7497         All callers changed.
7498         (string_buffer_position): Likewise.  Also, make static (it's never
7499         used outside xdisp.c).
7500         (cursor_row_p): Remove parameter `w', unused since
7501         2000-10-17T16:08:57Z!gerd@gnu.org.  All callers changed.
7502         (decode_mode_spec): Remove parameter `precision', introduced during
7503         Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
7504         All callers changed.
7506 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
7508         * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
7510 2011-03-27  Anders Lindgren  <andlind@gmail.com>
7512         * nsterm.m (ns_menu_bar_is_hidden): New variable.
7513         (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
7514         (ns_update_auto_hide_menu_bar): New functions.
7515         (ns_update_begin): Call ns_update_auto_hide_menu_bar.
7516         (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
7517         ns_constrain_all_frames.
7518         (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
7519         (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
7521 2011-03-27  Jan Djärv  <jan.h.d@swipnet.se>
7523         * nsmenu.m (runDialogAt): Remove argument to timer_check.
7525 2011-03-27  Glenn Morris  <rgm@gnu.org>
7527         * syssignal.h: Replace RETSIGTYPE with void.
7528         * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
7529         * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
7530         Replace SIGTYPE with void everywhere.
7531         * s/usg5-4-common.h (SIGTYPE): Remove definition.
7532         * s/template.h (SIGTYPE): Remove commented out definition.
7534 2011-03-26  Eli Zaretskii  <eliz@gnu.org>
7536         * xdisp.c (redisplay_window): Don't check buffer's clip_changed
7537         flag as a prerequisite for invoking try_scrolling.  (Bug#6671)
7539 2011-03-26  Juanma Barranquero  <lekktu@gmail.com>
7541         * w32.c (read_unc_volume): Use parameter `henum', instead of
7542         global variable `wget_enum_handle'.
7544         * keymap.c (describe_vector): Remove parameters `indices' and
7545         `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
7546         (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
7548         * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
7550         * keyboard.c (timer_check): Remove parameter `do_it_now',
7551         unused since 1996-04-12T06:01:29Z!rms@gnu.org.
7552         (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
7553         unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
7555         * keyboard.c (read_char):
7556         * w32menu.c (w32_menu_display_help):
7557         * xmenu.c (show_help_event, menu_help_callback):
7558         Adjust calls to `show_help_echo'.
7560         * gtkutil.c (xg_maybe_add_timer):
7561         * keyboard.c (readable_events):
7562         * process.c (wait_reading_process_output):
7563         * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
7565         * insdel.c (adjust_markers_gap_motion):
7566         Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
7567         (gap_left, gap_right): Don't call it.
7569 2011-03-25  Chong Yidong  <cyd@stupidchicken.com>
7571         * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
7572         incurred during fontification.
7574 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
7576         * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
7577         (DEFVAR_PER_BUFFER): Don't pass it.
7579         * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
7580         (scrolling_window): Don't pass it.
7582 2011-03-25  Juanma Barranquero  <lekktu@gmail.com>
7584         * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
7586         * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
7587         and `suffix'.
7588         (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
7589         of variables specific to SELinux and computation of `encoded_absname'.
7591         * image.c (XPutPixel): Remove unused variable `height'.
7593         * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
7595         * unexw32.c (get_section_info): Remove unused variable `section'.
7597         * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
7598         (system_process_attributes): Remove unused variable `sess'.
7599         (sys_read): Remove unused variable `err'.
7601         * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
7602         (w32_wnd_proc): Remove unused variable `isdead'.
7603         (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
7604         (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
7605         (x_create_tip_frame): Remove unused variable `tem'.
7607         * w32inevt.c (w32_console_read_socket):
7608         Remove unused variable `no_events'.
7610         * w32term.c (x_draw_composite_glyph_string_foreground):
7611         Remove unused variable `width'.
7613 2011-03-24  Juanma Barranquero  <lekktu@gmail.com>
7615         * w32term.c (x_set_glyph_string_clipping):
7616         Don't pass uninitialized region to CombineRgn.
7618 2011-03-23  Juanma Barranquero  <lekktu@gmail.com>
7620         * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
7621         (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
7622         (Fx_close_connection): Remove unused variable `i'.
7624         * w32font.c (w32font_draw): Return number of glyphs.
7625         (w32font_open_internal): Remove unused variable `i'.
7626         (w32font_driver): Add missing initializer.
7628         * w32menu.c (utf8to16): Remove unused variable `utf16'.
7629         (fill_in_menu): Remove unused variable `items_added'.
7631         * w32term.c (last_mouse_press_frame): Remove static global variable.
7632         (w32_clip_to_row): Remove unused variable `f'.
7633         (x_delete_terminal): Remove unused variable `i'.
7635         * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
7636         (NOTHING): Remove unused static global variable.
7637         (uniscribe_check_otf): Remove unused variable `table'.
7638         (uniscribe_font_driver): Add missing initializers.
7640 2011-03-23  Julien Danjou  <julien@danjou.info>
7642         * term.c (Fsuspend_tty, Fresume_tty):
7643         * minibuf.c (read_minibuf, run_exit_minibuf_hook):
7644         * window.c (temp_output_buffer_show):
7645         * insdel.c (signal_before_change):
7646         * frame.c (Fhandle_switch_frame):
7647         * fileio.c (Fdo_auto_save):
7648         * emacs.c (Fkill_emacs):
7649         * editfns.c (save_excursion_restore):
7650         * cmds.c (internal_self_insert):
7651         * callint.c (Fcall_interactively):
7652         * buffer.c (Fkill_all_local_variables):
7653         * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
7654         Use Frun_hooks.
7655         (command_loop_1): Use Frun_hooks.  Call safe_run_hooks
7656         unconditionnaly since it does the check itself.
7658 2011-03-23  Paul Eggert  <eggert@cs.ucla.edu>
7660         Fix more problems found by GCC 4.5.2's static checks.
7662         * coding.c (encode_coding_raw_text): Avoid unnecessary test
7663         the first time through the loop, since we know p0 < p1 then.
7664         This also avoids a gcc -Wstrict-overflow warning.
7666         * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
7667         leading to a memory leak, possible in functions like
7668         load_charset_map_from_file that can allocate an unbounded number
7669         of objects (Bug#8318).
7671         * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
7672         that could (at least in theory) be that large.
7674         * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
7675         This is less likely to overflow, and avoids undefined behavior if
7676         overflow does occur.  All callers changed.  Use strtoul to scan
7677         for the unsigned long integer.
7678         (pint2hrstr): Simplify and tune code slightly.
7679         This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
7681         * scroll.c (do_scrolling): Work around GCC bug 48228.
7682         See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
7684         * frame.c (Fmodify_frame_parameters): Simplify loop counter.
7685         This also avoids a warning with gcc -Wstrict-overflow.
7686         (validate_x_resource_name): Simplify count usage.
7687         This also avoids a warning with gcc -Wstrict-overflow.
7689         * fileio.c (Fcopy_file): Report error if fchown or fchmod
7690         fail (Bug#8306).
7692         * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
7694         * process.c (Fmake_network_process): Use socklen_t, not int,
7695         where POSIX says socklen_t is required in portable programs.
7696         This fixes a porting bug on hosts like 64-bit HP-UX, where
7697         socklen_t is wider than int (Bug#8277).
7698         (Fmake_network_process, server_accept_connection):
7699         (wait_reading_process_output, read_process_output):
7700         Likewise.
7702         * process.c: Rename or move locals to avoid shadowing.
7703         (list_processes_1, Fmake_network_process):
7704         (read_process_output_error_handler, exec_sentinel_error_handler):
7705         Rename or move locals.
7706         (Fmake_network_process): Define label "retry_connect" only if needed.
7707         (Fnetwork_interface_info): Fix pointer signedness.
7708         (process_send_signal): Add cast to avoid pointer signedness problem.
7709         (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
7710         (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
7712         Make tparam.h and terminfo.c consistent.
7713         * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
7714         Include tparam.h instead, since it declares them.
7715         * cm.h (PC): Remove extern decl; tparam.h now does this.
7716         * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
7717         * terminfo.c: Include tparam.h, to check interfaces.
7718         (tparm): Make 1st arg a const pointer in decl.  Put it at top level.
7719         (tparam): Adjust signature to match interface in tparam.h;
7720         this removes some undefined behavior.  Check that outstring and len
7721         are zero, which they always are with Emacs.
7722         * tparam.h (PC, BC, UP): New extern decls.
7724         * xftfont.c (xftfont_shape): Now static, and defined only if needed.
7725         (xftfont_open): Rename locals to avoid shadowing.
7727         * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
7728         (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
7729         (OTF_TAG_SYM): Omit macro if not needed.
7730         (ftfont_list): Remove unused local.
7731         (get_adstyle_property, ftfont_pattern_entity):
7732         (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
7733         Rename locals to avoid shadowing.
7735         * xfont.c (xfont_list_family): Mark var as initialized.
7737         * xml.c (make_dom): Now static.
7739         * composite.c (composition_compute_stop_pos): Rename local to
7740         avoid shadowing.
7741         (composition_reseat_it): Remove unused locals.
7742         (find_automatic_composition, composition_adjust_point): Likewise.
7743         (composition_update_it): Mark var as initialized.
7744         (find_automatic_composition): Mark vars as initialized,
7745         with a FIXME (Bug#8290).
7747         character.h: Rename locals to avoid shadowing.
7748         * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
7749         (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
7750         (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
7751         (BUF_DEC_POS): Be more systematic about renaming local temporaries
7752         to avoid shadowing.
7754         * textprop.c (property_change_between_p): Remove; unused.
7756         * intervals.c (interval_start_pos): Now static.
7758         * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
7760         * atimer.c (start_atimer, append_atimer_lists, set_alarm):
7761         Rename locals to avoid shadowing.
7763         * sound.c (wav_play, au_play, Fplay_sound_internal):
7764         Fix pointer signedness.
7765         (alsa_choose_format): Remove unused local var.
7766         (wav_play): Initialize a variable to 0, to prevent undefined
7767         behavior (Bug#8278).
7769         * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
7771         * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
7773         * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
7774         clobbering (Bug#8298).
7775         * sysdep.c (sys_subshell): Likewise.
7776         Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7778         * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
7779         This should get cleaned up, so that child_setup has the
7780         same signature on all platforms.
7782         * callproc.c (call_process_cleanup): Now static.
7783         (relocate_fd): Rename locals to avoid shadowing.
7785 2011-03-22  Chong Yidong  <cyd@stupidchicken.com>
7787         * xterm.c (x_clear_frame): Remove XClearWindow call.  This appears
7788         not to be necessary, and produces flickering.
7790 2011-03-20  Glenn Morris  <rgm@gnu.org>
7792         * config.in: Remove file.
7794 2011-03-20  Juanma Barranquero  <lekktu@gmail.com>
7796         * minibuf.c (Vcompleting_read_function): Don't declare, global variables
7797         are now in src/globals.h.
7798         (syms_of_minibuf): Remove spurious & from previous change.
7800 2011-03-20  Leo  <sdl.web@gmail.com>
7802         * minibuf.c (completing-read-function): New variable.
7803         (completing-read-default): Rename from completing-read.
7804         (completing-read): Call completing-read-function.
7806 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
7808         * xfaces.c (Fx_load_color_file):
7809         Read color file from absolute filename (bug#8250).
7811 2011-03-19  Juanma Barranquero  <lekktu@gmail.com>
7813         * makefile.w32-in: Update dependencies.
7815 2011-03-17  Eli Zaretskii  <eliz@gnu.org>
7817         * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
7819 2011-03-17  Paul Eggert  <eggert@cs.ucla.edu>
7821         Fix more problems found by GCC 4.5.2's static checks.
7823         * process.c (make_serial_process_unwind, send_process_trap):
7824         (sigchld_handler): Now static.
7826         * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
7827         That way, the code declares only the vars that it needs.
7828         * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
7829         * s/cygwin.h (PTY_ITERATION): Likewise.
7830         * s/darwin.h (PTY_ITERATION): Likewise.
7831         * s/gnu-linux.h (PTY_ITERATION): Likewise.
7833         * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
7834         * process.c (allocate_pty): Don't declare stb unless it's needed.
7836         * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
7837         (CONSTANTLIM): Remove; unused.
7838         (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
7839         Define only if needed.
7841         * unexelf.c (unexec): Name an expression,
7842         to avoid gcc -Wbad-function-cast warning.
7843         Use a different way to cause a compilation error if anyone uses
7844         n rather than nn, a way that does not involve shadowing.
7845         (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
7847         * deps.mk (unexalpha.o): Remove; unused.
7849         New file unexec.h, the (simple) interface for unexec (Bug#8267).
7850         * unexec.h: New file.
7851         * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
7852         (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
7853         Depend on unexec.h.
7854         * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
7855         * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
7856         * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
7857         Change as necessary to match prototype in unexec.h.
7859         * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
7860         shadowing.
7861         (back_comment, skip_chars): Mark vars as initialized.
7863         * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
7864         Rename locals to avoid shadowing.
7866         * lread.c (read1): Rewrite so as not to use empty "else".
7867         (Fload, readevalloop, read1): Rename locals to avoid shadowing.
7869         * print.c (Fredirect_debugging_output): Fix pointer signedess.
7871         * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
7872         warning when compiling print.c.
7874         * font.c (font_unparse_fcname): Abort in an "impossible" situation
7875         instead of using an uninitialized var.
7876         (font_sort_entities): Mark var as initialized.
7878         * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
7880         * font.c (font_unparse_xlfd): Don't mix pointers to variables with
7881         pointers to constants.
7882         (font_parse_fcname): Remove unused vars.
7883         (font_delete_unmatched): Now static.
7884         (font_get_spec): Remove; unused.
7885         (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
7886         (font_update_drivers, Ffont_get_glyphs, font_add_log):
7887         Rename or move locals to avoid shadowing.
7889         * fns.c (require_nesting_list, require_unwind): Now static.
7890         (Ffillarray): Rename locals to avoid shadowing.
7892         * floatfns.c (domain_error2): Define only if needed.
7893         (Ffrexp, Fldexp): Rename locals to avoid shadowing.
7895         * alloc.c (mark_backtrace): Move decl from here ...
7896         * lisp.h: ... to here, so that it can be checked.
7898         * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
7899         (Fdefvar): Rewrite so as not to use empty "else".
7900         (lisp_indirect_variable): Name an expression,
7901         to avoid gcc -Wbad-function-cast warning.
7902         (Fdefvar): Rename locals to avoid shadowing.
7904         * callint.c (quotify_arg, quotify_args): Now static.
7905         (Fcall_interactively): Rename locals to avoid shadowing.
7906         Use const pointer when appropriate.
7908         * lisp.h (get_system_name, get_operating_system_release):
7909         Move decls here, to check interfaces.
7910         * process.c (get_operating_system_release): Move decl to lisp.h.
7911         * xrdb.c (get_system_name): Likewise.
7912         * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
7913         (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
7914         some of which prompt warnings from gcc -Wbad-function-cast.
7915         (Fformat_time_string, Fencode_time, Finsert_char):
7916         (Ftranslate_region_internal, Fformat):
7917         Rename or remove local vars to avoid shadowing.
7918         (Ftranslate_region_internal): Mark var as initialized.
7920         * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
7921         avoid shadowing.
7923         * lisp.h (eassert): Check that the argument compiles, even if
7924         ENABLE_CHECKING is not defined.
7926         * data.c (Findirect_variable): Name an expression, to avoid
7927         gcc -Wbad-function-cast warning.
7928         (default_value, arithcompare, arith_driver, arith_error): Now static.
7929         (store_symval_forwarding): Rename local to avoid shadowing.
7930         (Fmake_variable_buffer_local, Fmake_local_variable):
7931         Mark variables as initialized.
7932         (do_blv_forwarding, do_symval_forwarding): Remove; unused.
7934         * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
7935         (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
7936         Rename locals to avoid shadowing.
7937         (mark_stack): Move local variables into the #ifdef region where
7938         they're used.
7939         (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
7940         ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
7941         needed otherwise.
7942         (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
7943         (GC_STRING_CHARS): Remove; not used.
7944         (Fmemory_limit): Cast sbrk's returned value to char *.
7946         * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
7947         avoids undefined behavior in theory.
7949         * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
7951         Use functions, not macros, for up- and down-casing (Bug#8254).
7952         * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
7953         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove.  All callers changed
7954         to use the following functions instead of these macros.
7955         (downcase): Adjust to lack of DOWNCASE_TABLE.  Return int, not
7956         EMACS_INT, since callers assume the returned value fits in int.
7957         (upcase1): Likewise, for UPCASE_TABLE.
7958         (uppercasep, lowercasep, upcase): New static inline functions.
7959         * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
7960         the race-condition problem in the old DOWNCASE.
7962         * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
7963         Rename locals to avoid shadowing.
7964         (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
7965         (regex_compile, re_search_2, re_match_2_internal):
7966         Remove unused local vars.
7967         (FREE_VAR): Rewrite so as not to use empty "else",
7968         which gcc can warn about.
7969         (regex_compile, re_match_2_internal): Mark locals as initialized.
7970         (RETALLOC_IF): Define only if needed.
7971         (WORDCHAR_P): Likewise.  This one is never needed, but is used
7972         only in a comment talking about a compiler bug, so put inside
7973         the #if 0 of that comment.
7974         (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
7975         (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
7976         Remove; unused.
7978         * search.c (boyer_moore): Rename locals to avoid shadowing.
7979         * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
7980         (PREV_CHAR_BOUNDARY): Likewise.
7982         * search.c (simple_search): Remove unused var.
7984         * dired.c (compile_pattern): Move decl from here ...
7985         * lisp.h: ... to here, so that it can be checked.
7986         (struct re_registers): New forward decl.
7988         * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
7990         * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
7991         All uses changed.
7992         (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
7993         Rename locals to avoid shadowing.
7994         (Fvertical_motion): Mark locals as initialized.
7996         * casefiddle.c (casify_object, casify_region): Now static.
7997         (casify_region): Mark local as initialized.
7999         * cmds.c (internal_self_insert): Rename local to avoid shadowing.
8001         * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
8002         New macros, so that the caller can use some names other than
8003         gcpro1, gcpro2, etc.
8004         (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
8005         of the new macros.
8006         (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
8007         argument, for consistency with GCPRO2_VAR, etc: it is now the
8008         prefix of the variable, not the variable itself.  All uses
8009         changed.
8010         * dired.c (directory_files_internal, file_name_completion):
8011         Rename locals to avoid shadowing.
8013         Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
8014         An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
8015         dired.c's scmp function, had undefined behavior.
8016         * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
8017         (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
8018         * buffer.h: ... to here, because these macros use current_buffer,
8019         and the new implementation with inline functions needs to have
8020         current_buffer in scope now, rather than later when the macros
8021         are used.
8022         (downcase, upcase1): New static inline functions.
8023         (DOWNCASE, UPCASE1): Reimplement using these functions.
8024         This avoids undefined behavior in expressions like
8025         DOWNCASE (x) == DOWNCASE (y), which previously suffered
8026         from race conditions in accessing the global variables
8027         case_temp1 and case_temp2.
8028         * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
8029         * lisp.h (case_temp1, case_temp2): Remove their decls.
8030         * character.h (ASCII_CHAR_P): Move from here ...
8031         * lisp.h: ... to here, so that the inline functions mentioned
8032         above can use them.
8034         * dired.c (directory_files_internal_unwind): Now static.
8036         * fileio.c (file_name_as_directory, directory_file_name):
8037         (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
8038         Now static.
8039         (file_name_as_directory): Use const pointers when appropriate.
8040         (Fexpand_file_name): Likewise.  In particular, newdir might
8041         point at constant storage, so make it a const pointer.
8042         (Fmake_directory_internal, Fread_file_name): Remove unused vars.
8043         (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
8044         signedness issues.
8045         (Fset_file_times, Finsert_file_contents, auto_save_error):
8046         Rename locals to avoid shadowing.
8048         * minibuf.c (choose_minibuf_frame_1): Now static.
8049         (Ftry_completion, Fall_completions): Rename or remove locals
8050         to avoid shadowing.
8052         * marker.c (bytepos_to_charpos): Remove; unused.
8054         * lisp.h (verify_bytepos, count_markers): New decls,
8055         so that gcc does not warn that these functions aren't declared.
8057         * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
8058         (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
8059         (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
8060         (copy_text): Remove unused local var.
8062         * filelock.c (within_one_second): Now static.
8063         (lock_file_1): Rename local to avoid shadowing.
8065         * buffer.c (fix_overlays_before): Mark locals as initialized.
8066         (fix_start_end_in_overlays): Likewise.  This function should be
8067         simplified by using pointers-to-pointers, but that's a different
8068         matter.
8069         (switch_to_buffer_1): Now static.
8070         (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
8071         (report_overlay_modification): Rename locals to avoid shadowing.
8073         * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
8074         Fix pointer signedness issue.
8075         (sys_subshell): Mark local as volatile if checking for lint,
8076         to suppress a gcc -Wclobbered warning that does not seem to be right.
8077         (MAXPATHLEN): Define only if needed.
8079         * process.c (serial_open, serial_configure): Move decls from here ...
8080         * systty.h: ... to here, so that they can be checked.
8082         * fns.c (get_random, seed_random): Move extern decls from here ...
8083         * lisp.h: ... to here, so that they can be checked.
8085         * sysdep.c (reset_io): Now static.
8086         (wait_for_termination_signal): Remove; unused.
8088         * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
8089         (copy_keymap_item, append_key, push_text_char_description):
8090         Now static.
8091         (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
8092         (DENSE_TABLE_SIZE): Remove; unused.
8093         (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
8094         (describe_map_tree):
8095         Rename locals to avoid shadowing.
8097         * keyboard.c: Declare functions static if they are not used elsewhere.
8098         (echo_char, echo_dash, cmd_error, top_level_2):
8099         (poll_for_input, handle_async_input): Now static.
8100         (read_char, kbd_buffer_get_event, make_lispy_position):
8101         (make_lispy_event, make_lispy_movement, apply_modifiers):
8102         (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
8103         (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
8104         (Fread_key_sequence_vector): Rename locals to avoid shadowing.
8105         (read_key_sequence, read_char): Mark locals as initialized.
8106         (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
8108         * keyboard.h (make_ctrl_char): New decl.
8109         (mark_kboards): Move decl here ...
8110         * alloc.c (mark_kboards): ... from here.
8112         * lisp.h (force_auto_save_soon): New decl.
8114         * emacs.c (init_cmdargs): Rename local to avoid shadowing.
8115         (DEFINE_DUMMY_FUNCTION): New macro.
8116         (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
8117         Use it.
8118         (main): Add casts to avoid warnings
8119         if GCC considers string literals to be constants.
8121         * lisp.h (fatal_error_signal): Add decl, since it's exported.
8123         * dbusbind.c: Pointer signedness fixes.
8124         (xd_signature, xd_append_arg, xd_initialize):
8125         (Fdbus_call_method, Fdbus_call_method_asynchronously):
8126         (Fdbus_method_return_internal, Fdbus_method_error_internal):
8127         (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
8128         (Fdbus_register_signal): Use SSDATA when the context wants char *.
8130         * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
8131         if GCC considers string literals to be constants.
8132         (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
8134 2011-03-16  Stefan Monnier  <monnier@iro.umontreal.ca>
8136         * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
8137         (print_preprocess, print_object): New macro to fix last change.
8139         * print.c (print_preprocess): Don't forget font objects.
8141 2011-03-16  Juanma Barranquero  <lekktu@gmail.com>
8143         * emacs.c (USAGE3): Doc fixes.
8145 2011-03-15  Andreas Schwab  <schwab@linux-m68k.org>
8147         * coding.c (detect_coding_iso_2022): Reorganize code to clarify
8148         structure.
8150 2011-03-14  Juanma Barranquero  <lekktu@gmail.com>
8152         * lisp.h (VWindow_system, Qfile_name_history):
8153         * keyboard.h (lispy_function_keys) [WINDOWSNT]:
8154         * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
8155         (w32_system_caret_x, w32_system_caret_y): Declare extern.
8157         * w32select.c: Don't #include "keyboard.h".
8158         (run_protected): Add extern declaration for waiting_for_input.
8160         * w32.c (Qlocal, noninteractive1, inhibit_window_system):
8161         * w32console.c (detect_input_pending, read_input_pending)
8162         (encode_terminal_code):
8163         * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
8164         (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
8165         (w32_system_caret_y, Qfile_name_history):
8166         * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
8167         * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
8168         * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
8169         (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
8170         * w32proc.c (Qlocal, report_file_error):
8171         * w32term.c (Vwindow_system, updating_frame):
8172         * w32uniscribe.c (initialized, uniscribe_font_driver):
8173         Remove unneeded extern declarations.
8175 2011-03-14  Chong Yidong  <cyd@stupidchicken.com>
8177         * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
8179 2011-03-13  Chong Yidong  <cyd@stupidchicken.com>
8181         * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
8182         (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
8183         These macros can no longer be used for assignment.
8185         * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8186         Assign struct members directly, instead of using BUF_BEGV etc.
8187         (record_buffer_markers, fetch_buffer_markers): New functions for
8188         recording and fetching special buffer markers.
8189         (set_buffer_internal_1, set_buffer_temp): Use them.
8191         * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
8193         * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
8195         * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
8196         (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
8198         * xdisp.c (hscroll_window_tree):
8199         (reconsider_clip_changes): Use PT instead of BUF_PT.
8201 2011-03-13  Eli Zaretskii  <eliz@gnu.org>
8203         * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
8204         $(EMACS_ROOT)/lib/intprops.h.
8206 2011-03-13  Paul Eggert  <eggert@cs.ucla.edu>
8208         Fix more problems found by GCC 4.5.2's static checks.
8210         * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
8211         to unsigned char * to avoid compiler diagnostic.
8212         (xg_free_frame_widgets): Make it clear that a local variable is
8213         needed only if USE_GTK_TOOLTIP.
8214         (gdk_window_get_screen): Make it clear that this macro is needed
8215         only if USE_GTK_TOOLTIP.
8216         (int_gtk_range_get_value): New function, which avoids a diagnostic
8217         from gcc -Wbad-function-cast.
8218         (xg_set_toolkit_scroll_bar_thumb): Use it.
8219         (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
8220         diagnostic from gcc -Wbad-function-cast.
8221         (get_utf8_string, xg_get_file_with_chooser):
8222         Rename locals to avoid shadowing.
8223         (create_dialog): Move locals to avoid shadowing.
8225         * xgselect.c (xg_select): Remove unused var.
8227         * image.c (four_corners_best): Mark locals as initialized.
8228         (gif_load): Initialize transparent_p to zero (Bug#8238).
8229         Mark another local as initialized.
8230         (my_png_error, my_error_exit): Mark with NO_RETURN.
8232         * image.c (clear_image_cache): Now static.
8233         (DIM, HAVE_STDLIB_H_1): Remove unused macros.
8234         (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
8235         (x_edge_detection): Remove unnecessary cast that
8236         gcc -Wbad-function-cast diagnoses.
8237         (gif_load): Fix pointer signedness.
8238         (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
8239         (jpeg_load, gif_load): Rename locals to avoid shadowing.
8241 2011-03-12  Paul Eggert  <eggert@cs.ucla.edu>
8243         Improve quality of tests for time stamp overflow.
8244         For example, without this patch (encode-time 0 0 0 1 1
8245         1152921504606846976) returns the obviously-bogus value (-948597
8246         62170) on my RHEL 5.5 x86-64 host.  With the patch, it correctly
8247         reports time overflow.  See
8248         <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
8249         * deps.mk (editfns.o): Depend on ../lib/intprops.h.
8250         * editfns.c: Include limits.h and intprops.h.
8251         (TIME_T_MIN, TIME_T_MAX): New macros.
8252         (time_overflow): Move earlier, to before first use.
8253         (hi_time, lo_time): New functions, for an accurate test for
8254         out-of-range times.
8255         (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
8256         (Fget_internal_run_time): Don't assume time_t fits in int.
8257         (make_time): Use list2 instead of Fcons twice.
8258         (Fdecode_time): More accurate test for out-of-range times.
8259         (check_tm_member): New function.
8260         (Fencode_time): Use it, to test for out-of-range times.
8261         (lisp_time_argument): Don't rely on undefined left-shift and
8262         right-shift behavior when checking for time stamp overflow.
8264         * editfns.c (time_overflow): New function, refactoring common code.
8265         (Fformat_time_string, Fdecode_time, Fencode_time):
8266         (Fcurrent_time_string): Use it.
8268         Move 'make_time' to be next to its inverse 'lisp_time_argument'.
8269         * dired.c (make_time): Move to ...
8270         * editfns.c (make_time): ... here.
8271         * systime.h: Note the move.
8273 2011-03-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
8275         * fringe.c (update_window_fringes): Remove unused variables.
8277         * unexmacosx.c (copy_data_segment): Also copy __got section.
8278         (Bug#8223)
8280 2011-03-12  Eli Zaretskii  <eliz@gnu.org>
8282         * termcap.c [MSDOS]: Include "msdos.h".
8283         (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
8284         Constify `char *' arguments and their references according to
8285         prototypes in tparam.h.
8287         * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
8289         * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
8290         Adapt all references accordingly.
8292         * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
8294 2011-03-11  Tom Tromey  <tromey@redhat.com>
8296         * buffer.c (syms_of_buffer): Remove obsolete comment.
8298 2011-03-11  Eli Zaretskii  <eliz@gnu.org>
8300         * termhooks.h (encode_terminal_code): Declare prototype.
8302         * msdos.c (encode_terminal_code): Don't declare prototype.
8304         * term.c (encode_terminal_code): Now external again, used by
8305         w32console.c and msdos.c.
8307         * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
8308         Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
8310 2011-03-11  Paul Eggert  <eggert@cs.ucla.edu>
8312         Fix some minor problems found by GCC 4.5.2's static checks.
8314         * fringe.c (update_window_fringes): Mark locals as initialized
8315         (Bug#8227).
8316         (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
8318         * alloc.c (mark_fringe_data): Move decl from here ...
8319         * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
8320         to check its interface.
8321         (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
8323         * fontset.c (free_realized_fontset): Now static.
8324         (Fset_fontset_font): Rename local to avoid shadowing.
8325         (fontset_font): Mark local as initialized.
8326         (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
8328         * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
8330         * xselect.c (x_disown_buffer_selections): Remove; not used.
8331         (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
8332         (x_own_selection, Fx_disown_selection_internal): Rename locals
8333         to avoid shadowing.
8334         (x_handle_dnd_message): Remove local to avoid shadowing.
8336         * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
8337         so that the caller can use some name other than gcpro1.
8338         (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
8339         * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
8340         (Fx_backspace_delete_keys_p):
8341         Use them to avoid shadowing, and rename vars to avoid shadowing.
8342         (x_decode_color, x_set_name, x_window): Now static.
8343         (Fx_create_frame): Add braces to silence GCC warning.
8344         (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
8345         (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
8346         Remove unused locals.
8347         (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
8348         (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
8349         Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
8350         macros.
8352         * xterm.h (x_mouse_leave): New decl.
8354         * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
8355         Remove unused functions.
8356         (x_shift_glyphs_for_insert, XTflash, XTring_bell):
8357         (x_calc_absolute_position): Now static.
8358         (XTread_socket): Don't define label "out" unless it's used.
8359         Don't declare local "event" unless it's used.
8360         (x_iconify_frame, x_free_frame_resources): Don't declare locals
8361         unless they are used.
8362         (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
8363         (x_fatal_error_signal): Remove; not used.
8364         (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
8365         (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
8366         (x_error_catcher, x_connection_closed, x_error_handler):
8367         (x_error_quitter, xembed_send_message, x_iconify_frame):
8368         (my_log_handler): Rename locals to avoid shadowing.
8369         (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
8370         (x_connection_closed): Tell GCC not to suggest NO_RETURN.
8372         * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
8373         Rename or move locals to avoid shadowing.
8374         (tty_defined_color, merge_face_heights): Now static.
8375         (free_realized_faces_for_fontset): Remove; not used.
8376         (Fx_list_fonts): Mark variable that gcc -Wuninitialized
8377         does not deduce is never used uninitialized.
8378         (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
8379         (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
8381         * terminal.c (store_terminal_param): Now static.
8383         * xmenu.c (menu_highlight_callback): Now static.
8384         (set_frame_menubar): Remove unused local.
8385         (xmenu_show): Rename parameter to avoid shadowing.
8386         (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
8387         since they might point to immutable storage.
8388         (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
8389         since it's unused otherwise.
8391         * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
8392         Add a FIXME, since the code still doesn't look right.  (Bug#8215)
8393         (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
8394         avoids a gcc -Wuninitialized diagnostic.
8395         (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
8396         (note_mouse_highlight): Mark variables that gcc -Wuninitialized
8397         does not deduce are never used uninitialized.
8399         * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
8401         * xdisp.c (redisplay_window): Rename local to avoid shadowing.
8402         * window.c (window_loop, size_window):
8403         (run_window_configuration_change_hook, enlarge_window): Likewise.
8405         * window.c (display_buffer): Now static.
8406         (size_window): Mark variables that gcc -Wuninitialized
8407         does not deduce are never used uninitialized.
8408         * window.h (check_all_windows): New decl, to forestall
8409         gcc -Wmissing-prototypes diagnostic.
8410         * dispextern.h (bidi_dump_cached_states): Likewise.
8412         * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
8413         shadowing.
8414         * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
8415         Include <limits.h>.
8416         (Fsort_charsets): Redo min/max calculation to shorten the code a bit
8417         and to avoid gcc -Wuninitialized warning.
8418         (load_charset_map): Mark variables that gcc -Wuninitialized
8419         does not deduce are never used uninitialized.
8420         (load_charset): Abort instead of using uninitialized var (Bug#8229).
8422         * coding.c (coding_set_source, coding_set_destination):
8423         Use "else { /* comment */ }" rather than "else /* comment */;"
8424         for clarity, and to avoid gcc -Wempty-body warning.
8425         (Fdefine_coding_system_internal): Don't redeclare 'i' inside
8426         a block, when the outer 'i' will do.
8427         (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
8428         (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
8429         (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
8430         (decode_coding_raw_text, decode_coding_charset, get_translation_table):
8431         (Fdecode_sjis_char, Fdefine_coding_system_internal):
8432         Rename locals to avoid shadowing.
8433         * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
8434         * coding.c (emacs_mule_char, encode_invocation_designation):
8435         Now static, since they're not used elsewhere.
8436         (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
8437         (decode_coding_object, encode_coding_object, detect_coding_system):
8438         (decode_coding_emacs_mule): Mark variables that gcc
8439         -Wuninitialized does not deduce are never used uninitialized.
8440         (detect_coding_iso_2022): Initialize a local variable that might
8441         be used uninitialized.  Leave a FIXME because it's not clear that
8442         this initialization is needed.  (Bug#8211)
8443         (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
8444         (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
8445         (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
8446         (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
8447         Remove unused macros.
8449         * category.c (hash_get_category_set): Remove unused local var.
8450         (copy_category_table): Now static, since it's not used elsewhere.
8451         * character.c (string_count_byte8): Likewise.
8453         * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
8454         (Fregister_code_conversion_map): Rename locals to avoid shadowing.
8456         * chartab.c (copy_sub_char_table): Now static, since it's not used
8457         elsewhere.
8458         (sub_char_table_ref_and_range, char_table_ref_and_range):
8459         Rename locals to avoid shadowing.
8460         (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
8462         * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
8463         (BIDI_BOB): Remove unused macro.
8465         * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
8466         deduce are never used uninitialized.
8467         * term.c (encode_terminal_code): Likewise.
8469         * term.c (encode_terminal_code): Now static.  Remove unused local.
8471         * tparam.h: New file.
8472         * term.c, tparam.h: Include it.
8473         * deps.mk (term.o, tparam.o): Depend on tparam.h.
8474         * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
8475         Move these decls to tparam.h, and make them agree with what
8476         is actually in tparam.c.  The previous trick of using incompatible
8477         decls in different modules does not conform to the C standard.
8478         All callers of tparam changed to use tparam's actual API.
8479         * tparam.c (tparam1, tparam, tgoto):
8480         Use const pointers where appropriate.
8482         * cm.c (calccost, cmgoto): Use const pointers where appropriate.
8483         * cm.h (struct cm): Likewise.
8484         * dispextern.h (do_line_insertion_deletion_costs): Likewise.
8485         * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
8486         * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
8487         (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
8488         (turn_on_face, init_tty): Likewise.
8489         * termchar.h (struct tty_display_info): Likewise.
8491         * term.c (term_mouse_position): Rename local to avoid shadowing.
8493         * alloc.c (mark_ttys): Move decl from here ...
8494         * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
8496 2011-03-11  Andreas Schwab  <schwab@linux-m68k.org>
8498         * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
8500 2011-03-09  Juanma Barranquero  <lekktu@gmail.com>
8502         * search.c (compile_pattern_1): Remove argument regp, unused since
8503         revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
8504         (compile_pattern): Don't pass it.
8506 2011-03-08  Jan Djärv  <jan.h.d@swipnet.se>
8508         * xterm.h (DEFAULT_GDK_DISPLAY): New define.
8509         (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
8510         for ! HAVE_GTK3.
8511         (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
8513         * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
8515         * gtkutil.c: Include gtkx.h if HAVE_GTK3.  If ! HAVE_GTK3, define
8516         gdk_window_get_screen, gdk_window_get_geometry,
8517         gdk_x11_window_lookup_for_display and GDK_KEY_g.
8518         (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
8519         (xg_get_pixbuf_from_pixmap): New function.
8520         (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
8521         to Pixmap, take frame as parameter, remove GdkColormap parameter.
8522         Call xg_get_pixbuf_from_pixmap instead of
8523         gdk_pixbuf_get_from_drawable.
8524         (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
8525         xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
8526         (xg_check_special_colors): Use GtkStyleContext and its functions
8527         for HAVE_GTK3.
8528         (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
8529         (xg_prepare_tooltip, create_dialog, menubar_map_cb)
8530         (xg_update_frame_menubar, xg_tool_bar_detach_callback)
8531         (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
8532         Call gtk_widget_get_preferred_size.
8533         (xg_frame_resized): gdk_window_get_geometry only takes 5
8534         parameters.
8535         (xg_win_to_widget, xg_event_is_for_menubar):
8536         Call gdk_x11_window_lookup_for_display.
8537         (xg_set_widget_bg): New function.
8538         (delete_cb): New function.
8539         (xg_create_frame_widgets): Connect delete-event to delete_cb.
8540         Call xg_set_widget_bg.  Only set backgrund pixmap for ! HAVE_GTK3
8541         (xg_set_background_color): Call xg_set_widget_bg.
8542         (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
8543         (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
8544         Only call gtk_range_set_update_policy if ! HAVE_GTK3.
8545         (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
8546         if ! HAVE_GTK3.
8547         (update_frame_tool_bar): Call gtk_widget_hide.
8548         (xg_initialize): Use GDK_KEY_g.
8550         * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
8551         if ! HAVE_GTK3
8552         (x_session_initialize): Call gdk_x11_set_sm_client_id.
8554         * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
8555         (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
8556         Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
8558 2011-03-08  Juanma Barranquero  <lekktu@gmail.com>
8560         * w32xfns.c (select_palette): Check success of RealizePalette against
8561         GDI_ERROR, not zero.
8563 See ChangeLog.11 for earlier changes.
8565 ;; Local Variables:
8566 ;; coding: utf-8
8567 ;; End:
8569   Copyright (C) 2011  Free Software Foundation, Inc.
8571   This file is part of GNU Emacs.
8573   GNU Emacs is free software: you can redistribute it and/or modify
8574   it under the terms of the GNU General Public License as published by
8575   the Free Software Foundation, either version 3 of the License, or
8576   (at your option) any later version.
8578   GNU Emacs is distributed in the hope that it will be useful,
8579   but WITHOUT ANY WARRANTY; without even the implied warranty of
8580   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8581   GNU General Public License for more details.
8583   You should have received a copy of the GNU General Public License
8584   along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.